Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

2 рядки
8.2 KiB

  1. webpackJsonp([55],{"/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 r=i("g45I"),o=i("yYv5");e.a={created:function(){var t=this;"admin"!=this.usertype?i.i(r.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,cardLoad:!1,usertype:this.$store.getters.usertype,ruleForm:{store:"",deleted:0},form:{name:"",parent:null},manageList:[],shopList:[],list:[],orderedList:[],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){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&&(this.addType(),this.menuVisible=!1)},NodeEdit:function(t,e){this.updateTable(e)},NodeDel:function(t,e){if(e.children&&0!==e.children.length)return this.$message.error("此分类有子级,不可删除!"),!1;this.delTable(e.id)},NodeAdd:function(t,e){if(t.level>=3)return this.$message.error("最多只支持三级!"),!1;this.addType(),this.form.parent=e.id},rightClick:function(t,e,i,r){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 s=document.querySelector("#rightClickMenu");s.style.left=t.clientX+20+"px",s.style.top=t.clientY-30+"px",s.style.position="absolute",s.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;this.cardLoad=!0;var e=this.orderedList.length,r=this.orderedList.map(function(t,i){return{id:t.id,order:e-i}});i.i(o.b)(r).then(function(e){t.cardLoad=!1})},shopChange:function(){this.selectlist()},selectlist:function(){var t=this;i.i(o.a)(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()})})},allowDrop:function(t,e,i){if(t.level===e.level)return"inner"!==i},handleDrop:function(t,e,i,r){var o=this;this.orderedList=[],e.parent.childNodes.forEach(function(t,e){console.log(t.data.name),o.orderedList.push({id:t.data.id,order:e})}),this.orderedList=this.orderedList.reverse(),this.updateSore()}}}},"Pz+I":function(t,e,i){"use strict";var r=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",{directives:[{name:"loading",rawName:"v-loading.body",value:t.cardLoad,expression:"cardLoad",modifiers:{body:!0}}],staticClass:"box-card",attrs:{"element-loading-text":"拼命加载中"}},[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",draggable:"","allow-drop":t.allowDrop},on:{"node-contextmenu":t.rightClick,"node-drop":t.handleDrop}}),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=[],s={render:r,staticRenderFns:o};e.a=s},WSjM:function(t,e,i){"use strict";function r(t){i("vOQx")}Object.defineProperty(e,"__esModule",{value:!0});var o=i("NUhv"),s=i("Pz+I"),n=i("VU/8"),a=r,l=n(o.a,s.a,a,"data-v-831c0286",null);e.default=l.exports},g45I:function(t,e,i){"use strict";function r(t){return i.i(d.a)({url:"/service-org/shop/list",method:"get",params:t})}function o(t){return i.i(d.a)({url:"/unionService/shop/shop",method:"post",data:t})}function s(t){return i.i(d.a)({url:"/unionService/shop/detail?shopId="+t,method:"get"})}function n(t){return i.i(d.a)({url:"/unionService/shop/shop",method:"put",data:t})}function a(t){return i.i(d.a)({url:"/unionService/device/store",method:"put",data:t})}function l(t){return i.i(d.a)({url:"/service-org/shop/delete?shopId="+t,method:"DELETE"})}e.a=r,e.f=o,e.b=s,e.c=n,e.d=a,e.e=l;var d=i("Vo7i")},vOQx:function(t,e,i){var r=i("/z76");"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);i("rjj0")("3dd74c63",r,!0)},yYv5:function(t,e,i){"use strict";function r(t){return i.i(d.a)({url:"/service-inventory/goods/category/",method:"get",params:t})}function o(t){return i.i(d.a)({url:"/service-inventory/goods/category",method:"post",data:t})}function s(t,e){return i.i(d.a)({url:"/service-inventory/goods/category/"+t,method:"put",data:e})}function n(t){return i.i(d.a)({url:"/service-inventory/goods/category/re-order/",method:"post",data:t})}function a(t){return i.i(d.a)({url:"/service-inventory/goods/category/catering/"+t,method:"delete"})}function l(t){return i.i(d.a)({url:"/service-inventory/goods/category/tree",method:"get",params:t})}e.f=r,e.e=o,e.d=s,e.b=n,e.c=a,e.a=l;var d=i("Vo7i")}});
  2. //# sourceMappingURL=55.41f06539a45dbe6e9068.js.map