diff --git a/pages/inventory/gategory.vue b/pages/inventory/gategory.vue index 24b6d7a..6f2e9d3 100644 --- a/pages/inventory/gategory.vue +++ b/pages/inventory/gategory.vue @@ -93,6 +93,15 @@ icon: 'none' }) return; + } + for(let i=0;i { @@ -207,25 +209,41 @@ }).catch((res) => {}) break; case 'attrAdd': - this.tui.request("/app/productAttribute/save", "post", { - attributeName: e, - categoryId: this.isOpenId - }, false, true).then((res) => { - if (res.code == 200) { - this.getGategoryList() - uni.showToast({ - title:"添加成功", - icon: 'none' - }) - } else { + for(let i=0;i { + if (res.code == 200) { + this.getGategoryList() + uni.showToast({ + title:"添加成功", + icon: 'none' + }) + } else { + uni.showToast({ + title:"添加失败", + icon: 'none' + }) + } + }).catch((res) => {}) + break; + case 'attrValAdd': + if(e == ''){ uni.showToast({ - title:"添加失败", + title:"不能为空!", icon: 'none' }) + return } - }).catch((res) => {}) - break; - case 'attrValAdd': this.tui.request("/app/productAttributeValue/save", "post", { value: e, attributeId: this.isOpenId @@ -238,7 +256,7 @@ }) } else { uni.showToast({ - title:"添加失败", + title:res.message, icon: 'none' }) }