1234567891011121314151617181920212223242526272829303132 |
- import Vue from 'vue'
- import iview from 'iview'
- export default function deleteAttributeDetail (payload = {}) {
- return new Promise((resolve, reject) => {
- const {
- id,
- name,
- attribute_category_name: attributeCategoryName,
- attribute_type: attributeType,
- } = payload
- const type = attributeType ? '参数' : '规格'
- iview.Modal.confirm({
- title: `删除${type}`,
- content: `确定要删除"${attributeCategoryName}"属性的"${name}"${type}吗?`,
- onOk: async () => {
- try {
- await Vue.http.delete(`/product/attribute/item?id=${id}`)
- iview.Message.success('删除成功')
- resolve('remove')
- } catch (e) {
- reject(e)
- }
- },
- onCancel: (e) => {
- reject(e)
- },
- })
- })
- }
|