(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6bec1307"],{"0a47":function(t,o,e){"use strict";e("bf36")},"14c6":function(t,o,e){"use strict";e.d(o,"p",(function(){return a})),e.d(o,"z",(function(){return r})),e.d(o,"A",(function(){return d})),e.d(o,"w",(function(){return n})),e.d(o,"E",(function(){return i})),e.d(o,"x",(function(){return l})),e.d(o,"F",(function(){return u})),e.d(o,"D",(function(){return c})),e.d(o,"y",(function(){return g})),e.d(o,"B",(function(){return p})),e.d(o,"C",(function(){return m})),e.d(o,"c",(function(){return f})),e.d(o,"g",(function(){return _})),e.d(o,"h",(function(){return h})),e.d(o,"d",(function(){return v})),e.d(o,"e",(function(){return b})),e.d(o,"f",(function(){return y})),e.d(o,"H",(function(){return w})),e.d(o,"K",(function(){return x})),e.d(o,"I",(function(){return C})),e.d(o,"J",(function(){return k})),e.d(o,"G",(function(){return S})),e.d(o,"O",(function(){return $})),e.d(o,"L",(function(){return j})),e.d(o,"M",(function(){return L})),e.d(o,"N",(function(){return G})),e.d(o,"i",(function(){return P})),e.d(o,"n",(function(){return O})),e.d(o,"j",(function(){return D})),e.d(o,"o",(function(){return q})),e.d(o,"k",(function(){return T})),e.d(o,"m",(function(){return z})),e.d(o,"l",(function(){return E})),e.d(o,"P",(function(){return J})),e.d(o,"S",(function(){return M})),e.d(o,"Q",(function(){return N})),e.d(o,"R",(function(){return A})),e.d(o,"t",(function(){return B})),e.d(o,"s",(function(){return F})),e.d(o,"u",(function(){return H})),e.d(o,"v",(function(){return I})),e.d(o,"r",(function(){return K})),e.d(o,"q",(function(){return Q})),e.d(o,"T",(function(){return R})),e.d(o,"U",(function(){return U})),e.d(o,"V",(function(){return V})),e.d(o,"W",(function(){return W})),e.d(o,"a",(function(){return X})),e.d(o,"b",(function(){return Y})),e.d(o,"Y",(function(){return Z})),e.d(o,"X",(function(){return tt}));var s=e("f175");const a=t=>s.a.post("/goods.goods/add",t),r=t=>s.a.post("/goods.goods/edit",t),d=t=>s.a.get("/goods.goods/lists",{params:t}),n=t=>s.a.get("/goods.goods/commonLists",{params:t}),i=t=>s.a.post("/goods.goods/status",t),l=t=>s.a.post("/goods.goods/del",t),u=t=>s.a.post("/goods.goods/changeCategory",t),c=t=>s.a.post("/goods.goods/sort",t),g=t=>s.a.get("/goods.goods/detail",{params:{id:t}}),p=t=>s.a.get("/goods.goods/otherList",{params:t}),m=t=>s.a.post("goods.goods/rename ",t),f=t=>s.a.post("/goods.goods_brand/add",t),_=t=>s.a.get("/goods.goods_brand/lists",{params:t}),h=t=>s.a.post("/goods.goods_brand/status",t),v=t=>s.a.post("/goods.goods_brand/del",t),b=t=>s.a.get("/goods.goods_brand/detail",{params:{id:t}}),y=t=>s.a.post("/goods.goods_brand/edit",t),w=t=>s.a.post("/goods.goods_supplier_category/add",t),x=t=>s.a.get("goods.goods_supplier_category/lists",{params:t}),C=t=>s.a.post("goods.goods_supplier_category/del",{id:t}),k=t=>s.a.post("goods.goods_supplier_category/edit",t),S=t=>s.a.post("/goods.goods_supplier/add",t),$=t=>s.a.get("/goods.goods_supplier/lists",{params:t}),j=t=>s.a.post("goods.goods_supplier/del",{id:t}),L=t=>s.a.get("/goods.goods_supplier/detail",{params:{id:t}}),G=t=>s.a.post("/goods.goods_supplier/edit",t),P=t=>s.a.post("/goods.goods_category/add",t),O=t=>s.a.get("/goods.goods_category/lists",{params:t}),D=t=>s.a.get("/goods.goods_category/commonLists",{params:t}),q=t=>s.a.post("/goods.goods_category/status",t),T=t=>s.a.post("goods.goods_category/del",{id:t}),z=t=>s.a.post("/goods.goods_category/edit",t),E=t=>s.a.get("/goods.goods_category/detail",{params:{id:t}}),J=t=>s.a.post("/goods.goods_unit/add",t),M=t=>s.a.get("/goods.goods_unit/lists",{params:t}),N=t=>s.a.post("goods.goods_unit/del",{id:t}),A=t=>s.a.post("/goods.goods_unit/edit",t),B=t=>s.a.get("goods.goods_comment/lists",{params:t}),F=t=>s.a.post("goods.goods_comment/del",t),H=t=>s.a.post("goods.goods_comment/reply",t),I=t=>s.a.post("/goods.goods_comment/status",t),K=t=>s.a.get("goods.goods_comment_assistant/lists",{params:t}),Q=t=>s.a.post("goods.goods_comment_assistant/add",t),R=t=>s.a.get("goods.goodsServiceGuarantee/lists",t),U=t=>s.a.post("goods.goodsServiceGuarantee/add",t),V=t=>s.a.post("goods.goodsServiceGuarantee/delete",t),W=t=>s.a.post("goods.goodsServiceGuarantee/edit",t),X=()=>s.a.get("goods.GoodsDeliveryTemplate/lists"),Y=t=>s.a.post("goods.GoodsDeliveryTemplate/add",t),Z=t=>s.a.post("goods.GoodsDeliveryTemplate/edit",t),tt=t=>s.a.post("goods.GoodsDeliveryTemplate/delete",t)},"375e":function(t,o,e){"use strict";e.r(o);e("0643"),e("4e3e");var s=e("9ab4"),a=e("1b40"),r=e("b3ad"),d=e("14c6");let n=class extends a.e{constructor(){super(...arguments),this.loading=!1,this.hasPid=0,this.categoryList=[],this.form={name:"",pid:"",image:"",sort:"",is_show:1,is_recommend:0},this.rules={name:[{required:!0,message:"请输入分类名称",trigger:["blur","change"]}]}}handleSave(){this.$refs.form.validate(t=>{if(!t)return!1;this.hasPid||(this.form.pid="");(this.id?Object(d.m)(this.form):Object(d.i)(this.form)).then(()=>{this.$router.go(-1)})})}getCategoryDetail(){this.loading=!0,Object(d.l)(this.id).then(t=>{t.pid&&(this.hasPid=1),this.form=t,this.loading=!1})}getCategoryList(){Object(d.n)({page_type:1}).then(t=>{null==t||t.lists.forEach(t=>{t.sons&&t.sons.forEach(t=>{delete t.sons})}),this.categoryList=null==t?void 0:t.lists})}created(){this.id=this.$route.query.id,this.id&&this.getCategoryDetail(),this.getCategoryList()}};n=Object(s.a)([Object(a.a)({components:{MaterialSelect:r.a}})],n);var i=n,l=(e("0a47"),e("2877")),u=Object(l.a)(i,(function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"ls-category-edit"},[e("div",{staticClass:"ls-card category-edit__header"},[e("el-page-header",{attrs:{content:t.id?"编辑分类":"新增分类"},on:{back:function(o){return t.$router.go(-1)}}})],1),e("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px",size:"small",rules:t.rules}},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"ls-card category-edit__base m-t-16"},[e("div",{staticClass:"nr weight-500 m-b-20"},[t._v("基础信息")]),e("el-form-item",{attrs:{label:"分类名称",prop:"name",required:""}},[e("el-input",{staticClass:"ls-input",attrs:{maxlength:"8","show-word-limit":"",placeholder:"请输入分类名称"},model:{value:t.form.name,callback:function(o){t.$set(t.form,"name",o)},expression:"form.name"}})],1),e("el-form-item",{attrs:{label:"父级分类",required:""}},[e("el-radio-group",{staticClass:"m-r-16",model:{value:t.hasPid,callback:function(o){t.hasPid=o},expression:"hasPid"}},[e("el-radio",{attrs:{label:0}},[t._v("无父级分类")]),e("el-radio",{attrs:{label:1}},[t._v("有父级分类")])],1),e("el-alert",{staticClass:"ls-tips",attrs:{title:"选择无上级分类,则表明此分类为一级分类;选择有上级分类,则表明此分类为选中分类的子分类",type:"warning",closable:!1}})],1),1==t.hasPid?e("el-form-item",{attrs:{label:"",required:""}},[e("el-cascader",{attrs:{options:t.categoryList,props:{checkStrictly:!0,value:"id",label:"name",children:"sons",emitPath:!1},clearable:""},scopedSlots:t._u([{key:"default",fn:function(o){var s=o.node,a=o.data;return a.level<=2?[e("span",[t._v(t._s(a.name))]),s.isLeaf?t._e():e("span",[t._v(" ("+t._s(a.sons.length)+") ")])]:void 0}}],null,!0),model:{value:t.form.pid,callback:function(o){t.$set(t.form,"pid",o)},expression:"form.pid"}})],1):t._e(),e("el-form-item",{attrs:{label:"分类图标",prop:"image"}},[e("material-select",{attrs:{limit:1},model:{value:t.form.image,callback:function(o){t.$set(t.form,"image",o)},expression:"form.image"}}),e("div",{staticClass:"muted xs"},[t._v("建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片")])],1),e("el-form-item",{attrs:{label:"排序"}},[e("el-input",{staticStyle:{width:"220px"},model:{value:t.form.sort,callback:function(o){t.$set(t.form,"sort",o)},expression:"form.sort"}}),e("div",{staticClass:"muted xs"},[t._v("排序值必须为整数;数值越小,越靠前")])],1),e("el-form-item",{attrs:{label:"是否显示"}},[e("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.form.is_show,callback:function(o){t.$set(t.form,"is_show",o)},expression:"form.is_show"}})],1)],1)]),e("div",{staticClass:"category-edit__footer bg-white ls-fixed-footer"},[e("div",{staticClass:"btns row-center flex",staticStyle:{height:"100%"}},[e("el-button",{attrs:{size:"small"},on:{click:function(o){return t.$router.go(-1)}}},[t._v("取消")]),e("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.handleSave}},[t._v("保存")])],1)])],1)}),[],!1,null,"105e4a24",null);o.default=u.exports},bf36:function(t,o,e){}}]);