wangfukang 3 years ago
parent
commit
9604a786b1
  1. 9
      pages/inventory/gategory.vue
  2. 52
      pages/inventory/gategoryLow.vue

9
pages/inventory/gategory.vue

@ -93,6 +93,15 @@
icon: 'none' icon: 'none'
}) })
return; return;
}
for(let i=0;i<this.indexList.length;i++){
if(this.indexList[i].categoryName == e){
uni.showToast({
title:"请勿重复添加!",
icon: 'error'
})
return
}
} }
this.tui.request("/app/productCategory/save", "post", { this.tui.request("/app/productCategory/save", "post", {
categoryName: e categoryName: e

52
pages/inventory/gategoryLow.vue

@ -165,9 +165,11 @@
} }
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
dialogInputConfirm(e) { dialogInputConfirm(e) {
console.log(this.typeModel)
switch (this.typeModel) { switch (this.typeModel) {
case 'add': case 'add':
this.tui.request("/app/productCategory/save", "post", { this.tui.request("/app/productCategory/save", "post", {
categoryName: e categoryName: e
}, false, true).then((res) => { }, false, true).then((res) => {
@ -207,25 +209,41 @@
}).catch((res) => {}) }).catch((res) => {})
break; break;
case 'attrAdd': case 'attrAdd':
this.tui.request("/app/productAttribute/save", "post", { for(let i=0;i<this.attrList.length;i++){
attributeName: e, if(this.attrList[i].attributeName == e){
categoryId: this.isOpenId uni.showToast({
}, false, true).then((res) => { title:"请勿重复添加",
if (res.code == 200) { icon: 'none'
this.getGategoryList() })
uni.showToast({ return
title:"添加成功", }
icon: 'none' }
}) this.tui.request("/app/productAttribute/save", "post", {
} else { attributeName: e,
categoryId: this.isOpenId
}, false, true).then((res) => {
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({ uni.showToast({
title:"添加失败", title:"不能为空!",
icon: 'none' icon: 'none'
}) })
return
} }
}).catch((res) => {})
break;
case 'attrValAdd':
this.tui.request("/app/productAttributeValue/save", "post", { this.tui.request("/app/productAttributeValue/save", "post", {
value: e, value: e,
attributeId: this.isOpenId attributeId: this.isOpenId
@ -238,7 +256,7 @@
}) })
} else { } else {
uni.showToast({ uni.showToast({
title:"添加失败", title:res.message,
icon: 'none' icon: 'none'
}) })
} }

Loading…
Cancel
Save