|
- webpackJsonp([53],{"/z76":function(t,e,i){e=t.exports=i("FZ+f")(!0),e.push([t.i,".rightContext[data-v-831c0286]{background-color:#333!important}.rightContext .menuItem[data-v-831c0286]:hover{background-color:#99a9bf!important}","",{version:3,sources:["D:/projects/gitLab/wxpos/posadmin/src/views/stock/retail/categoryTree.vue"],names:[],mappings:"AACA,+BACE,+BAAqC,CACtC,AACD,+CACE,kCAAqC,CACtC",file:"categoryTree.vue",sourcesContent:["\n.rightContext[data-v-831c0286] {\n background-color: #333333 !important;\n}\n.rightContext .menuItem[data-v-831c0286]:hover {\n background-color: #99a9bf !important;\n}\n"],sourceRoot:""}])},NUhv:function(t,e,i){"use strict";var s=i("g45I"),o=i("yYv5");e.a={created:function(){var t=this;"admin"!=this.usertype?i.i(s.a)({org:this.ruleForm.org}).then(function(e){t.shopList=e.result.rows,t.ruleForm.store=t.shopList[0].id,t.selectlist()}):this.selectlist()},data:function(){return{dialogVisible:!1,usertype:this.$store.getters.usertype,ruleForm:{store:"",deleted:0},form:{name:"",parent:null},manageList:[],shopList:[],list:[],dialogFormVisible:!1,rule:{name:[{required:!0,message:"请填写类别名称",trigger:"blur"},{min:1,max:10,message:"最多10个字",trigger:"blur"}]},edit:!1,upid:"",defaultProps:{label:"name"},menuVisible:!1,DATA:null,NODE:null}},methods:{handleRightSelect:function(t){console.log(t),1==t?(this.NodeAdd(this.NODE,this.DATA),this.menuVisible=!1):2==t?(this.NodeEdit(this.NODE,this.DATA),this.menuVisible=!1):3==t?(this.NodeDel(this.NODE,this.DATA),this.menuVisible=!1):4==t&&(console.log("4"),this.addType(),this.menuVisible=!1)},NodeEdit:function(t,e){console.log(t,e),this.updateTable(e)},NodeDel:function(t,e){console.log(t,e);if(e.children&&0!==e.children.length)return this.$message.error("此节点有子级,不可删除!"),!1;this.delTable(e.id)},NodeAdd:function(t,e){if(console.log(t,e),t.level>=3)return this.$message.error("最多只支持三级!"),!1;this.addType(),this.form.parent=e.id},rightClick:function(t,e,i,s){var o=this;this.objectID!==e.id?(this.objectID=e.id,this.menuVisible=!0,this.DATA=e,this.NODE=i):this.menuVisible=!this.menuVisible,document.addEventListener("click",function(t){o.menuVisible=!1});var r=document.querySelector("#rightClickMenu");r.style.left=t.clientX+20+"px",r.style.top=t.clientY-30+"px",r.style.position="absolute",r.style.width="160px"},up:function(t){var e=this.list[t],i=this.list[t-1];this.$set(this.list,t-1,e),this.$set(this.list,t,i),this.updateSore()},down:function(t){var e=this.list[t],i=this.list[t+1];this.$set(this.list,t+1,e),this.$set(this.list,t,i),this.updateSore()},updateSore:function(){var t=this.list.length,e=this.list.map(function(e,i){return{id:e.id,order:t-i}});i.i(o.a)(e).then(function(t){})},shopChange:function(){this.selectlist()},selectlist:function(){var t=this;i.i(o.b)(this.ruleForm).then(function(e){t.list=e.result})},addType:function(){this.edit=!1,this.form={name:""},this.dialogFormVisible=!0},updateTable:function(t){this.edit=!0,this.upid=t.id,this.form={name:t.name,parent:t.parent},this.dialogFormVisible=!0},delTable:function(t){var e=this;this.$confirm("此操作将删除您所选的类别, 是否继续?","",{type:"warning"}).then(function(){i.i(o.c)(t).then(function(t){e.selectlist()})}).catch(function(){})},handleClose:function(){this.$refs.form.clearValidate(),this.dialogFormVisible=!1},subTable:function(){var t=this;this.$refs.form.validate(function(e){if(!e)return!1;"admin"!=t.usertype&&(t.form.store=t.ruleForm.store),t.edit?i.i(o.d)(t.upid,t.form).then(function(e){t.dialogFormVisible=!1,t.selectlist()}):i.i(o.e)(t.form).then(function(e){t.dialogFormVisible=!1,t.selectlist()})})}}}},"Pz+I":function(t,e,i){"use strict";var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},["admin"!=t.usertype?i("el-form",{ref:"ruleForm",attrs:{model:t.ruleForm,"label-width":"20px"}},[i("el-form-item",{attrs:{label:"",prop:"org"}},[i("el-select",{attrs:{placeholder:"门店",filterable:""},on:{change:t.shopChange},model:{value:t.ruleForm.store,callback:function(e){t.$set(t.ruleForm,"store",e)},expression:"ruleForm.store"}},t._l(t.shopList,function(t){return i("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1)],1):t._e(),t._v(" "),i("el-dialog",{attrs:{title:"",visible:t.dialogFormVisible,"before-close":t.handleClose},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[i("el-form",{ref:"form",attrs:{model:t.form,rules:t.rule}},[i("el-form-item",{attrs:{label:"类别名称","label-width":"15%",prop:"name"}},[i("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name","string"==typeof e?e.trim():e)},expression:"form.name"}})],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:t.handleClose}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:t.subTable}},[t._v("确 定")])],1)],1),t._v(" "),i("el-card",{staticClass:"box-card"},[i("div",{attrs:{slot:"header"},slot:"header"},[i("span",{},[t._v("商品分类,请右键点击分类进行操作")])]),t._v(" "),i("el-tree",{ref:"SlotMenuList",attrs:{data:t.list,props:t.defaultProps,"node-key":"id"},on:{"node-contextmenu":t.rightClick}}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.menuVisible,expression:"menuVisible"}]},[i("el-menu",{staticClass:"el-menu-vertical rightContext",attrs:{id:"rightClickMenu","active-text-color":"#fff","text-color":"#fff"},on:{select:t.handleRightSelect}},[i("el-menu-item",{staticClass:"menuItem",attrs:{index:"1"}},[i("span",{attrs:{slot:"title"},slot:"title"},[t._v("添加分类")])]),t._v(" "),i("el-menu-item",{staticClass:"menuItem",attrs:{index:"2"}},[i("span",{attrs:{slot:"title"},slot:"title"},[t._v("修改分类")])]),t._v(" "),i("el-menu-item",{staticClass:"menuItem",attrs:{index:"3"}},[i("span",{attrs:{slot:"title"},slot:"title"},[t._v("删除分类")])]),t._v(" "),i("el-menu-item",{staticClass:"menuItem",attrs:{index:"4"}},[i("span",{attrs:{slot:"title"},slot:"title"},[t._v("添加一级分类")])])],1)],1)],1)],1)},o=[],r={render:s,staticRenderFns:o};e.a=r},WSjM:function(t,e,i){"use strict";function s(t){i("vOQx")}Object.defineProperty(e,"__esModule",{value:!0});var o=i("NUhv"),r=i("Pz+I"),n=i("VU/8"),l=s,a=n(o.a,r.a,l,"data-v-831c0286",null);e.default=a.exports},g45I:function(t,e,i){"use strict";function s(t){return i.i(u.a)({url:"/service-org/shop/list",method:"get",params:t})}function o(t){return i.i(u.a)({url:"/unionService/shop/shop",method:"post",data:t})}function r(t){return i.i(u.a)({url:"/service-org/shop/detail?shopId="+t,method:"get"})}function n(t){return i.i(u.a)({url:"/unionService/shop/shop",method:"put",data:t})}function l(t){return i.i(u.a)({url:"/unionService/device/store",method:"put",data:t})}function a(t){return i.i(u.a)({url:"/service-org/shop/delete?shopId="+t,method:"DELETE"})}e.a=s,e.f=o,e.b=r,e.c=n,e.d=l,e.e=a;var u=i("Vo7i")},vOQx:function(t,e,i){var s=i("/z76");"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);i("rjj0")("3dd74c63",s,!0)},yYv5:function(t,e,i){"use strict";function s(t){return i.i(u.a)({url:"/service-inventory/goods/category/",method:"get",params:t})}function o(t){return i.i(u.a)({url:"/service-inventory/goods/category",method:"post",data:t})}function r(t,e){return i.i(u.a)({url:"/service-inventory/goods/category/"+t,method:"put",data:e})}function n(t){return i.i(u.a)({url:"/service-inventory/goods/category/re-order/",method:"post",data:t})}function l(t){return i.i(u.a)({url:"/service-inventory/goods/category/catering/"+t,method:"delete"})}function a(t){return i.i(u.a)({url:"/service-inventory/goods/category/tree",method:"get",params:t})}e.f=s,e.e=o,e.d=r,e.a=n,e.c=l,e.b=a;var u=i("Vo7i")}});
- //# sourceMappingURL=53.9066079cb0a47cd5f841.js.map
|