|
|
|
@ -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' |
|
|
|
}) |
|
|
|
} |
|
|
|
|