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'
})
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", {
categoryName: e

52
pages/inventory/gategoryLow.vue

@ -165,9 +165,11 @@
}
this.$refs.inputDialog.open()
},
dialogInputConfirm(e) {
dialogInputConfirm(e) {
console.log(this.typeModel)
switch (this.typeModel) {
case 'add':
this.tui.request("/app/productCategory/save", "post", {
categoryName: e
}, false, true).then((res) => {
@ -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<this.attrList.length;i++){
if(this.attrList[i].attributeName == e){
uni.showToast({
title:"请勿重复添加",
icon: 'none'
})
return
}
}
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 {
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'
})
}

Loading…
Cancel
Save