You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.3 KiB
1 lines
7.3 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/inventory/gategory"],{1687:function(t,e,i){"use strict";i.r(e);var o=i("b571"),n=i.n(o);for(var u in o)["default"].indexOf(u)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(u);e["default"]=n.a},"18c2":function(t,e,i){"use strict";(function(t,e){var o=i("4ea4");i("c8e4");o(i("66fd"));var n=o(i("a0b7"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},1916:function(t,e,i){},"34fa":function(t,e,i){"use strict";var o=i("1916"),n=i.n(o);n.a},"49ff":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return u})),i.d(e,"a",(function(){return o}));var o={uButton:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-button/u-button")]).then(i.bind(null,"a94e"))},uIcon:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(i.bind(null,"d93f"))},uTag:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-tag/u-tag")]).then(i.bind(null,"882f"))},uModal:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-modal/u-modal")]).then(i.bind(null,"e0ca"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"167d"))},uniPopupDialog:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog")]).then(i.bind(null,"6702"))}},n=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.show=!1})},u=[]},a0b7:function(t,e,i){"use strict";i.r(e);var o=i("49ff"),n=i("1687");for(var u in n)["default"].indexOf(u)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(u);i("34fa");var s=i("f0c5"),a=Object(s["a"])(n["default"],o["b"],o["c"],!1,null,"d78f7b5a",null,!1,o["a"],void 0);e["default"]=a.exports},b571:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={data:function(){return{indexList:[],show:!1,inputVal:"",typeModel:"",editItem:{},delItems:{},isOpenId:"",attrList:[],openIndex:"",delType:"",showList:{},dialogTit:"输入分类名"}},computed:{},onLoad:function(){this.getGategoryList()},methods:{getGategoryList:function(){var t=this;this.tui.request("/app/productCategory/list","get",{},!1,!0).then((function(e){console.log(e,"res"),200==e.code&&(t.indexList=e.result,t.indexList.forEach((function(e,i){t.tui.request("/app/productAttribute/selectByCategoryId","get",{categoryId:e.id},!1,!0).then((function(i){200==i.code&&(e.attrName=i.result,e.attrName.length>0&&e.attrName.forEach((function(e){t.tui.request("/app/productAttributeValue/selectByAttributeId","get",{id:e.id},!1,!0).then((function(t){200==t.code&&(e.attributeValue=t.result)})).catch((function(t){}))})))})).catch((function(t){}))})),setTimeout((function(){t.showList=t.indexList}),1e3))})).catch((function(t){}))},getProductAttribute:function(){var t=this;this.indexList.forEach((function(e,i){t.tui.request("/app/productAttribute/selectByCategoryId","get",{categoryId:e.id},!1,!0).then((function(i){200==i.code&&(e.attrName=i.result,e.attrName.length>0&&e.attrName.forEach((function(e){t.tui.request("/app/productAttributeValue/selectByAttributeId","get",{id:e.id},!1,!0).then((function(i){200==i.code&&(e.attributeValue=i.result,t.showList=t.indexList)})).catch((function(t){}))})))})).catch((function(t){}))}))},getProductAttributeValue:function(t){var e=this;console.log(t,this.indexList,this.indexList[t].attrName),this.indexList[t].attrName.forEach((function(t){e.tui.request("/app/productAttributeValue/selectByAttributeId","get",{id:t.id},!1,!0).then((function(e){200==e.code&&(t.attributeValue=e.result)})).catch((function(t){}))})),this.showList=JSON.parse(JSON.stringify(this.indexList)),console.log(this.showList,"shoeList",t)},inputDialogToggle:function(t,e,i){console.log(t,e,i),this.typeModel=t,"edit"==t?(this.inputVal=e.categoryName,this.editItem=e):"add"==t||"attrAdd"==t||"attrValAdd"==t?(this.inputVal="",this.isOpenId=e,"add"==t?this.dialogTit="输入分类名":"attrAdd"==t?this.dialogTit="输入属性名":"attrValAdd"==t&&(this.dialogTit="输入属性值")):"attrEdit"==t&&(this.inputVal=e.attributeName,this.editItem=e),this.$refs.inputDialog.open()},dialogInputConfirm:function(e){var i=this;switch(console.log(e,this.typeModel),this.typeModel){case"add":this.tui.request("/app/productCategory/save","post",{categoryName:e},!1,!0).then((function(e){console.log(e,"res"),200==e.code?(i.getGategoryList(),t.showToast({title:"添加成功",icon:"none"})):t.showToast({title:"添加失败",icon:"none"})})).catch((function(t){}));break;case"edit":this.tui.request("/app/productCategory/edit","post",{categoryName:e,id:this.editItem.id},!1,!0).then((function(e){console.log(e,"res"),200==e.code?(i.getGategoryList(),t.showToast({title:"修改成功",icon:"none"})):t.showToast({title:"修改失败",icon:"none"})})).catch((function(t){}));break;case"attrAdd":this.tui.request("/app/productAttribute/save","post",{attributeName:e,categoryId:this.isOpenId},!1,!0).then((function(e){200==e.code?(i.getGategoryList(),t.showToast({title:"添加成功",icon:"none"})):t.showToast({title:"添加失败",icon:"none"})})).catch((function(t){}));break;case"attrValAdd":this.tui.request("/app/productAttributeValue/save","post",{value:e,attributeId:this.isOpenId},!1,!0).then((function(e){200==e.code?(i.getGategoryList(),t.showToast({title:"添加成功",icon:"none"})):t.showToast({title:"添加失败",icon:"none"})})).catch((function(t){}));break;case"attrEdit":this.tui.request("/app/productAttribute/edit","post",{attributeName:e,categoryId:this.editItem.categoryId,id:this.editItem.id},!1,!0).then((function(e){console.log(e,"res"),200==e.code?(i.getGategoryList(),t.showToast({title:"修改成功",icon:"none"})):t.showToast({title:"修改失败",icon:"none"})})).catch((function(t){}));break;default:}this.$refs.inputClose.val=""},dialogClose:function(){this.inputVal="",this.$refs.inputClose.val=""},delItemModal:function(){var e=this;this.show=!1,"del"==this.delType?this.tui.request("/app/productCategory/delById","post",{id:this.delItems.id},!1,!0).then((function(i){console.log(i,"res"),200==i.code?(e.getGategoryList(),t.showToast({title:"删除成功",icon:"none"})):t.showToast({title:"删除失败",icon:"none"})})).catch((function(t){})):"attrDel"==this.delType?this.tui.request("/app/productAttribute/delById","post",{categoryId:this.delItems.categoryId,attributeName:this.delItems.attributeName,id:this.delItems.id},!1,!0).then((function(i){console.log(i,"res"),200==i.code?(e.getGategoryList(),t.showToast({title:"删除成功",icon:"none"})):t.showToast({title:"删除失败",icon:"none"})})).catch((function(t){})):"attrNameDel"==this.delType&&this.tui.request("/app/productAttributeValue/delById","post",{attributeId:this.delItems.attributeId,value:this.delItems.value,id:this.delItems.id},!1,!0).then((function(i){console.log(i,"res"),200==i.code?(e.getGategoryList(),t.showToast({title:"删除成功",icon:"none"})):t.showToast({title:"删除失败",icon:"none"})})).catch((function(t){}))},delItem:function(t,e){this.delType=e,this.delItems=t,this.show=!0,console.log(this.delItems)},delAttrName:function(t){}}};e.default=i}).call(this,i("543d")["default"])}},[["18c2","common/runtime","common/vendor"]]]);
|