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.0 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/inventory/gategoryLow"],{"16e5":function(t,e,i){},"3e08":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return o}));var o={uIcon:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(i.bind(null,"1608"))},uModal:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-modal/u-modal")]).then(i.bind(null,"9e1e"))},uniPopup:function(){return i.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(i.bind(null,"2864"))},uniEasyinput:function(){return i.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(i.bind(null,"5fa6"))}},n=function(){var t=this,e=t.$createElement,i=(t._self._c,t.__map(t.goodsList,(function(e,i){var o=t.__get_orig(e),n=t._f("sliceMsg")(e.attributeList);return{$orig:o,f0:n}})));t._isMounted||(t.e0=function(e){t.show=!1},t.e1=function(e){return t.$refs.inputDialog.close()},t.e2=function(t){return this.$refs.carPopup.close()},t.e3=function(t){this.show=!0}),t.$mp.data=Object.assign({},{$root:{l0:i}})},s=[]},"614a":function(t,e,i){"use strict";var o=i("16e5"),n=i.n(o);n.a},bbb2:function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={data:function(){return{show:!1,inputVal:"",typeModel:"",editItem:{},delItems:{},isOpenId:"",attrList:[],openIndex:"",delType:"",dialogTit:"输入分类名",categoryId:"",goodsList:[],categoryText:""}},computed:{},filters:{sliceMsg:function(t){var e="";if("string"==typeof t){var i=JSON.parse(t);for(var o in i)e+=i[o]+"/"}return e}},onLoad:function(t){this.categoryId=t.id,this.getGategoryList(t.id)},methods:{getGategoryList:function(){var t=this,e=[];this.tui.request("/app/productAttribute/selectByCategoryId","POST",{categoryId:this.categoryId},!1,!0).then((function(i){200==i.code?(e=i.result,i.result.length>0&&e.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.$forceUpdate()):t.tui.toast(res.message)})).catch((function(t){}))}))):t.tui.toast(res.message)})).catch((function(t){})),this.$forceUpdate(),setTimeout((function(){t.attrList=e}),1e3)},getTypeToNum:function(){var t=this,e=this;this.tui.request("/app/stock/getlistByAttributeList","post",{categoryId:this.categoryId,attributeList:this.delItems.attributeName||this.delItems.value},!1,!0).then((function(i){200==i.code&&(""!=i.result?(t.goodsList=i.result,t.$refs.carPopup.open("bottom")):e.show=!0)})).catch((function(t){}))},inputDialogToggle:function(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||"attrAdd"==t?this.dialogTit="输入分类名":"attrValAdd"==t&&(this.dialogTit="输入属性值")):"attrEdit"==t&&(this.inputVal=e.attributeName,this.editItem=e),this.$refs.inputDialog.open("bottom")},handleBlur:function(t){this.categoryText=t.detail.value},dialogInputConfirm:function(e){var i=this;switch(this.typeModel){case"add":this.tui.request("/app/productCategory/save","post",{categoryName:this.categoryText},!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"edit":this.tui.request("/app/productCategory/edit","post",{categoryName:this.categoryText,id:this.editItem.id},!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"attrAdd":for(var o=0;o<this.attrList.length;o++)if(this.attrList[o].attributeName==e)return void t.showToast({title:"请勿重复添加",icon:"none"});this.tui.request("/app/productAttribute/save","post",{attributeName:this.categoryText,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":if(""==e)return void t.showToast({title:"不能为空!",icon:"none"});this.tui.request("/app/productAttributeValue/save","post",{value:this.categoryText,attributeId:this.isOpenId},!1,!0).then((function(e){200==e.code?(i.getGategoryList(),t.showToast({title:"添加成功",icon:"none"}),i.$refs.inputDialog.close()):t.showToast({title:e.message,icon:"none"})})).catch((function(t){}));break;case"attrEdit":this.tui.request("/app/productAttribute/edit","post",{attributeName:this.categoryText,categoryId:this.editItem.categoryId,id:this.editItem.id},!1,!0).then((function(e){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=""},dialogDel:function(){this.delItem(this.editItem,"del")},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){200==i.code?(e.getGategoryList(),t.showToast({title:"删除成功",icon:"none"}),e.$refs.carPopup.close()):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){200==i.code?(e.getGategoryList(),t.showToast({title:"删除成功",icon:"none"}),e.$refs.carPopup.close()):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){200==i.code?(e.getGategoryList(),t.showToast({title:"删除成功",icon:"none"}),e.$refs.carPopup.close()):t.showToast({title:"删除失败",icon:"none"})})).catch((function(t){}))},delItem:function(t,e){this.delType=e,this.delItems=t,this.getTypeToNum()}}};e.default=i}).call(this,i("df3c")["default"])},db49:function(t,e,i){"use strict";(function(t,e){var o=i("47a9");i("7859");o(i("3240"));var n=o(i("e4d0"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},e4d0:function(t,e,i){"use strict";i.r(e);var o=i("3e08"),n=i("f7b9");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("614a");var a=i("828b"),u=Object(a["a"])(n["default"],o["b"],o["c"],!1,null,"41b0bd9c",null,!1,o["a"],void 0);e["default"]=u.exports},f7b9:function(t,e,i){"use strict";i.r(e);var o=i("bbb2"),n=i.n(o);for(var s in o)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(s);e["default"]=n.a}},[["db49","common/runtime","common/vendor"]]]);