|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4a5ed58d"],{"09cc":function(t,e,r){"use strict";r.r(e);var s=function(){var t=this,e=t._self._c;return e("div",[e("div",[e("div",{staticClass:"main-content"},[t._m(0),e("div",{staticClass:"content"},[e("div",{staticClass:"btn"},[e("el-button",{staticClass:"init-button",attrs:{size:"small"},on:{click:function(e){return t.add()}}},[t._v("新增类目")])],1),e("div",{staticClass:"category"},[e("el-row",[e("el-col",{attrs:{span:4}},[e("ul",{staticStyle:{"border-right":"1px solid #e6e6fa"}},t._l(this.options,(function(r,s){return e("li",{key:s,class:{red:t.changeRed==s},on:{click:function(e){return t.change(s)}}},[e("span",{staticClass:"cateName",on:{click:function(e){return t.getChild(r)}}},[t._v(" "+t._s(r.name)+" ")]),[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t.handleEdit(r)}}},[t._v("编辑")]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.handleDelete(r)}}},[t._v("删除")])]],2)})),0)]),e("el-col",{attrs:{span:10}},[e("ul",{staticStyle:{"margin-left":"30px"}},t._l(this.childrenOptions,(function(r,s){return e("li",{key:s},[e("span",{staticClass:"cateName"},[t._v(" "+t._s(r.name)+" ")]),[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return t.handleEdit(r)}}},[t._v("编辑")]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.handleDelete(r)}}},[t._v("删除")])]],2)})),0)])],1)],1),e("Drawer",{attrs:{drawerTitle:"新增分类",drawerVrisible:t.add_vrisible},on:{drawerClose:t.addClose}},[e("div",{staticStyle:{padding:"30px"}},[e("FromCard",[e("template",{slot:"title"},[t._v("填写分类信息")]),[e("VueForm",{ref:"addForm",attrs:{formObj:t.addForm},on:{ruleSuccess:t.addRuleSuccess}},[e("template",{slot:"imgUrls"},[[e("el-upload",{attrs:{action:t.$baseUrl+"upload/uploadShoppingCategory","on-success":t.ImgeSuccess,"file-list":t.imglist,"on-exceed":t.handleExceed,limit:1,accept:".jpg,.png,.JPG,.PNG","before-upload":t.beforeAvatarUpload}},[e("el-button",{attrs:{icon:"el-icon-edit",size:"small"}},[t._v("上传图片")]),e("span",{staticStyle:{"margin-left":"10px","font-size":"12px",color:"#444444"}},[t._v("建议比例:3:2")]),e("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e("span",[t._v("支持扩展名:png,jpg")])])],1)]],2)],2)]],2)],1),e("div",{attrs:{slot:"footer"},slot:"footer"},[e("button",{staticClass:"btn-orange",on:{click:function(e){return t.addSubmit()}}},[e("span",[e("i",{staticClass:"el-icon-circle-check"}),t._v("提交")])]),e("button",{staticClass:"btn-gray",on:{click:t.addClose}},[e("span",[t._v("取消")])])])]),e("Drawer",{attrs:{drawerTitle:"修改分类名称",drawerVrisible:t.edit_vrisible},on:{drawerClose:t.editClose}},[e("div",{staticStyle:{padding:"30px"}},[e("FromCard",[e("template",{slot:"title"},[t._v("填写分类名称")]),[e("VueForm",{ref:"editForm",attrs:{formObj:t.editForm}},[e("template",{slot:"imgUrls"},[[e("el-upload",{attrs:{action:t.$baseUrl+"upload/uploadShoppingCategory","on-success":t.ImgeSuccess,"file-list":t.imglist,"on-exceed":t.handleExceed,limit:1,accept:".jpg,.png,.JPG,.PNG","before-upload":t.beforeAvatarUpload}},[e("el-button",{attrs:{icon:"el-icon-edit",size:"small"}},[t._v("上传图片")]),e("span",{staticStyle:{"margin-left":"10px","font-size":"12px",color:"#444444"}},[t._v("建议比例:3:2")]),e("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e("span",[t._v("支持扩展名:png,jpg")])])],1)]],2)],2)]],2)],1),e("div",{attrs:{slot:"footer"},slot:"footer"},[e("button",{staticClass:"btn-orange",on:{click:function(e){return t.editSubmit()}}},[e("span",[e("i",{staticClass:"el-icon-circle-check"}),t._v("提交")])]),e("button",{staticClass:"btn-gray",on:{click:t.editClose}},[e("span",[t._v("取消")])])])])],1)])])])},i=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-titel"},[e("span",[t._v("产品类型系列")])])}],n=r("e692"),a={data(){return{changeRed:-1,edit_vrisible:!1,add_vrisible:!1,imglist:[],options:[],childrenOptions:[],editForm:{ruleForm:{name:null,id:null,parentId:null,imgUrls:[],idPath:null},form_item:[{type:"Input",label:"分类名称",placeholder:"请输入",width:"100%",prop:"name"},{type:"Slot",label:"图片上传",placeholder:"请输入",width:"100%",prop:"imgUrls",slotName:"imgUrls"}]},addForm:{ruleForm:{name:null,parentId:null,imgUrls:[],idPath:null},rules:{parentId:[{required:!0,message:"请输入",trigger:"change"}],name:[{required:!0,message:"请输入",trigger:"change"}]},form_item:[{type:"Select",label:"所属类别",placeholder:"请输入",width:"100%",prop:"parentId",options:[{label:"顶层类",value:"0"}]},{type:"Input",label:"分类名称",placeholder:"请输入",width:"100%",prop:"name"},{type:"Slot",label:"图片上传",placeholder:"请输入",width:"100%",prop:"imgUrls",slotName:"imgUrls"}]}}},mounted(){this.getDate()},methods:{change:function(t){this.changeRed=t},add(){this.add_vrisible=!0,this.addForm.form_item[0].options=[{label:"顶层类",value:"0"}],Object(n["e"])({parentId:0}).then(t=>{t.data.forEach(t=>{let e={value:t.id,label:t.name};this.addForm.form_item[0].options.push(e)})})},addClose(){this.$refs.addForm.reset(),this.add_vrisible=!1,this.imglist=[]},addRuleSuccess(){let t={name:this.addForm.ruleForm.name,parentId:this.addForm.ruleForm.parentId,imgUrls:this.addForm.ruleForm.imgUrls,idPath:this.addForm.ruleForm.idPath};Object(n["d"])(t).then(t=>{t.status&&(this.$message({message:t.message,type:"success"}),this.addClose(),this.getDate())})},addSubmit(){this.$refs.addForm.submitForm()},handleEdit(t){if(console.log(t),this.edit_vrisible=!0,this.editForm.ruleForm.name=t.name,this.editForm.ruleForm.id=t.id,t.imgList.length){let e={name:t.imgList[0].url,url:t.imgList[0].url};this.editForm.ruleForm.imgUrls=[t.imgList[0].url],this.$set(this.imglist,0,e)}else this.editForm.ruleForm.imgUrls=[];console.log(this.editForm.ruleForm)},getDate(){Object(n["e"])({parentId:0}).then(t=>{console.log(t),this.options=t.data})},getChild(t){console.log(t.id),Object(n["e"])({parentId:t.id}).then(t=>{console.log(t),this.childrenOptions=t.data})},editClose(){this.$refs.editForm.reset(),this.edit_vrisible=!1,this.imglist=[]},editSubmit(){let t={...this.editForm.ruleForm,id:this.editForm.ruleForm.id,imgUrls:this.addForm.ruleForm.imgUrls};Object(n["f"])(t).then(e=>{e.status&&(this.$message({message:e.message,type:"success"}),this.getDate(),this.editClose(),this.getChild(t.id))})},ImgeSuccess(t,e){this.addForm.ruleForm.imgUrls[0]=e.response.url},beforeAvatarUpload(t){const e=t.size/1024/1024<2,r="image/png"===t.type,s="image/jpeg"===t.type;return r||s||this.$message.error("上传头像图片只能是 JPG/PNG 格式!"),e||this.$message.error("上传头像图片大小不能超过 2MB!"),(r||s)&&e},handleExceed(t,e){this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${t.length} 个文件,共选择了 ${t.length+e.length} 个文件`)},handleDelete(t){console.log(t.id),this.$confirm("是否确认删除?删除不可恢复","删除",{confirmButtonText:"确定",cancelButtonText:"取消",confirmButtonClass:"confirmButton",cancelButtonClass:"cancelButton"}).then(()=>{Object(n["c"])({categoryId:t.id}).then(e=>{0!=e.status&&(this.$message({message:e.message,type:"success"}),this.getDate(),this.getChild(t.id))})}).catch(t=>{})}},watch:{"addForm.ruleForm.parentId":{handler(t){console.log(t),this.addForm.ruleForm.idPath=0==t?"0::":"0::"+t+"::",console.log(this.addForm.ruleForm.idPath)},immediate:!0}}},o=a,l=(r("3f27"),r("2877")),d=Object(l["a"])(o,s,i,!1,null,"7bfde2ee",null);e["default"]=d.exports},"24f4":function(t,e,r){},"3f27":function(t,e,r){"use strict";r("24f4")},e692:function(t,e,r){"use strict";r.d(e,"m",(function(){return i})),r.d(e,"h",(function(){return n})),r.d(e,"n",(function(){return a})),r.d(e,"a",(function(){return o})),r.d(e,"e",(function(){return l})),r.d(e,"f",(function(){return d})),r.d(e,"c",(function(){return u})),r.d(e,"d",(function(){return c})),r.d(e,"i",(function(){return m})),r.d(e,"j",(function(){return p})),r.d(e,"k",(function(){return h})),r.d(e,"b",(function(){return g})),r.d(e,"l",(function(){return f})),r.d(e,"g",(function(){return b}));var s=r("b775");r("2c37");function i(t){return s["a"].request({method:"POST",url:"shop/supplier/insert",data:t})}function n(t){return s["a"].request({method:"POST",url:"shop/goods/insert",data:t})}function a(t){return s["a"].request({method:"GET",url:"shop/supplier/list",params:t})}function o(t){return s["a"].request({method:"POST",url:"shop/order/arrivalGoods",data:t})}function l(t){return s["a"].request({method:"GET",url:"shop/category/list",params:t})}function d(t){return s["a"].request({method:"POST",url:"shop/category/update",data:t})}function u(t){return s["a"].request({method:"GET",url:"shop/category/delete",params:t})}function c(t){return s["a"].request({method:"POST",url:"shop/category/insert",data:t})}function m(t){return s["a"].request({method:"GET",url:"shop/goods/loading",params:t})}function p(t){return s["a"].request({method:"GET",url:"shop/goods/unloading",params:t})}function h(t){return s["a"].request({method:"POST",url:"shop/order/deliverGoods",data:t})}function g(t){return s["a"].request({method:"GET",url:"shop/refund/exchangeGoods",params:t})}function f(t){return s["a"].request({method:"POST",url:"shop/refund/examine",data:t})}function b(t){return s["a"].request({method:"POST",url:"shop/evaluation/reply",data:t})}}}]);
|