| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4a0c3252"],{"055f":function(t,e,o){},"14c6":function(t,e,o){"use strict";o.d(e,"p",(function(){return i})),o.d(e,"z",(function(){return a})),o.d(e,"A",(function(){return r})),o.d(e,"w",(function(){return n})),o.d(e,"E",(function(){return d})),o.d(e,"x",(function(){return l})),o.d(e,"F",(function(){return c})),o.d(e,"D",(function(){return u})),o.d(e,"y",(function(){return g})),o.d(e,"B",(function(){return p})),o.d(e,"C",(function(){return f})),o.d(e,"c",(function(){return m})),o.d(e,"g",(function(){return h})),o.d(e,"h",(function(){return b})),o.d(e,"d",(function(){return v})),o.d(e,"e",(function(){return _})),o.d(e,"f",(function(){return y})),o.d(e,"H",(function(){return w})),o.d(e,"K",(function(){return j})),o.d(e,"I",(function(){return O})),o.d(e,"J",(function(){return x})),o.d(e,"G",(function(){return C})),o.d(e,"O",(function(){return L})),o.d(e,"L",(function(){return D})),o.d(e,"M",(function(){return k})),o.d(e,"N",(function(){return $})),o.d(e,"i",(function(){return S})),o.d(e,"n",(function(){return T})),o.d(e,"j",(function(){return z})),o.d(e,"o",(function(){return G})),o.d(e,"k",(function(){return U})),o.d(e,"m",(function(){return q})),o.d(e,"l",(function(){return A})),o.d(e,"P",(function(){return I})),o.d(e,"S",(function(){return B})),o.d(e,"Q",(function(){return P})),o.d(e,"R",(function(){return J})),o.d(e,"t",(function(){return M})),o.d(e,"s",(function(){return N})),o.d(e,"u",(function(){return F})),o.d(e,"v",(function(){return E})),o.d(e,"r",(function(){return H})),o.d(e,"q",(function(){return K})),o.d(e,"T",(function(){return Q})),o.d(e,"U",(function(){return R})),o.d(e,"V",(function(){return V})),o.d(e,"W",(function(){return W})),o.d(e,"a",(function(){return X})),o.d(e,"b",(function(){return Y})),o.d(e,"Y",(function(){return Z})),o.d(e,"X",(function(){return tt}));var s=o("f175");const i=t=>s.a.post("/goods.goods/add",t),a=t=>s.a.post("/goods.goods/edit",t),r=t=>s.a.get("/goods.goods/lists",{params:t}),n=t=>s.a.get("/goods.goods/commonLists",{params:t}),d=t=>s.a.post("/goods.goods/status",t),l=t=>s.a.post("/goods.goods/del",t),c=t=>s.a.post("/goods.goods/changeCategory",t),u=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}),f=t=>s.a.post("goods.goods/rename ",t),m=t=>s.a.post("/goods.goods_brand/add",t),h=t=>s.a.get("/goods.goods_brand/lists",{params:t}),b=t=>s.a.post("/goods.goods_brand/status",t),v=t=>s.a.post("/goods.goods_brand/del",t),_=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),j=t=>s.a.get("goods.goods_supplier_category/lists",{params:t}),O=t=>s.a.post("goods.goods_supplier_category/del",{id:t}),x=t=>s.a.post("goods.goods_supplier_category/edit",t),C=t=>s.a.post("/goods.goods_supplier/add",t),L=t=>s.a.get("/goods.goods_supplier/lists",{params:t}),D=t=>s.a.post("goods.goods_supplier/del",{id:t}),k=t=>s.a.get("/goods.goods_supplier/detail",{params:{id:t}}),$=t=>s.a.post("/goods.goods_supplier/edit",t),S=t=>s.a.post("/goods.goods_category/add",t),T=t=>s.a.get("/goods.goods_category/lists",{params:t}),z=t=>s.a.get("/goods.goods_category/commonLists",{params:t}),G=t=>s.a.post("/goods.goods_category/status",t),U=t=>s.a.post("goods.goods_category/del",{id:t}),q=t=>s.a.post("/goods.goods_category/edit",t),A=t=>s.a.get("/goods.goods_category/detail",{params:{id:t}}),I=t=>s.a.post("/goods.goods_unit/add",t),B=t=>s.a.get("/goods.goods_unit/lists",{params:t}),P=t=>s.a.post("goods.goods_unit/del",{id:t}),J=t=>s.a.post("/goods.goods_unit/edit",t),M=t=>s.a.get("goods.goods_comment/lists",{params:t}),N=t=>s.a.post("goods.goods_comment/del",t),F=t=>s.a.post("goods.goods_comment/reply",t),E=t=>s.a.post("/goods.goods_comment/status",t),H=t=>s.a.get("goods.goods_comment_assistant/lists",{params:t}),K=t=>s.a.post("goods.goods_comment_assistant/add",t),Q=t=>s.a.get("goods.goodsServiceGuarantee/lists",t),R=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)},"4cef":function(t,e,o){"use strict";o("fc1c")},"4e40":function(t,e,o){"use strict";o("055f")},"5c51":function(t,e,o){"use strict";o.r(e);var s=o("9ab4"),i=o("1b40"),a=o("b3ad"),r=o("14c6");let n=class extends i.e{constructor(){super(...arguments),this.loading=!1,this.form={name:"",image:"",sort:"",is_show:1},this.rules={name:[{required:!0,message:"请输入品牌名称",trigger:["blur","change"]}],image:[{required:!0,message:"请添加品牌图标",trigger:["blur","change"]}]}}handleSave(){this.$refs.form.validate((t,e)=>{if(!t)return!1;if(/[^0-9]/g.test(this.form.sort))return void this.$message.error("排序必须是数字");(this.id?Object(r.f)(this.form):Object(r.c)(this.form)).then(()=>{this.$router.go(-1)})})}getBrandDetail(){this.loading=!0,Object(r.e)(this.id).then(t=>{this.form=t,this.loading=!1})}created(){this.id=this.$route.query.id,this.id&&this.getBrandDetail()}};n=Object(s.a)([Object(i.a)({components:{MaterialSelect:a.a}})],n);var d=n,l=(o("4cef"),o("2877")),c=Object(l.a)(d,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"ls-brand-edit"},[e("div",{staticClass:"ls-card ls-brand-edit__header"},[e("el-page-header",{attrs:{content:t.id?"编辑品牌":"新增品牌"},on:{back:function(e){return t.$router.go(-1)}}})],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"ls-card ls-brand-edit__form m-t-10"},[e("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px",size:"small",rules:t.rules}},[e("el-form-item",{attrs:{label:"品牌名称",required:"",prop:"name"}},[e("el-input",{staticClass:"ls-input",attrs:{maxlength:"8","show-word-limit":"",placeholder:"请输入品牌名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),e("el-form-item",{attrs:{label:"品牌图标",required:"",prop:"image"}},[e("material-select",{attrs:{limit:1},model:{value:t.form.image,callback:function(e){t.$set(t.form,"image",e)},expression:"form.image"}}),e("div",{staticClass:"xs muted"},[t._v("建议尺寸:宽80像素*高80像素的jpg,jpeg,png,gif图片")])],1),e("el-form-item",{attrs:{label:"排序"}},[e("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:""},model:{value:t.form.sort,callback:function(e){t.$set(t.form,"sort",e)},expression:"form.sort"}})],1),e("el-form-item",{attrs:{label:"是否显示",required:""}},[e("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.form.is_show,callback:function(e){t.$set(t.form,"is_show",e)},expression:"form.is_show"}})],1)],1)],1),e("div",{staticClass:"ls-brand-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(e){return t.$router.go(-1)}}},[t._v("取消")]),e("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.handleSave}},[t._v("保存")])],1)])])}),[],!1,null,"3cb943d5",null);e.default=c.exports},b3ad:function(t,e,o){"use strict";o("e9f5"),o("ab43");var s=o("9ab4"),i=o("1b40"),a=o("0a6d"),r=o("c6fe"),n=o("e915"),d=o("b76a"),l=o.n(d);let c=class extends i.e{constructor(){super(...arguments),this.isAdd=!0,this.fileList=[]}get showUpload(){const{fileList:t,limit:e}=this;return e-t.length>0}get meterialLimit(){return this.isAdd?this.limit?this.limit-this.fileList.length:null:1}get tipsText(){switch(this.type){case"image":return"图片";case"video":return"视频"}}get imageUri(){return t=>this.enableDomain?t:this.$getImageUri(t)}valueChange(t){this.fileList=Array.isArray(t)?t:""==t?[]:[t]}showDialog(t=!0,e){var o;this.disabled||(this.isAdd=t,void 0!==e&&(this.currentIndex=e),null===(o=this.$refs.materialDialog)||void 0===o||o.onTrigger())}selectChange(t){this.select=t}handleConfirm(){this.$refs.material.clearSelectList();const t=this.select.map(t=>this.enableDomain?t.uri:t.url);this.isAdd?this.fileList=this.fileList.concat(t):this.fileList.splice(this.currentIndex,1,t.shift()),this.handleChange()}delImage(t){this.fileList.splice(t,1),this.handleChange()}handleChange(){const t=1!=this.limit?this.fileList:this.fileList[0]||"";this.$emit("input",t),this.$emit("change",t),this.fileList=[]}};Object(s.a)([Object(i.c)({default:()=>[]})],c.prototype,"value",void 0),Object(s.a)([Object(i.c)({default:1})],c.prototype,"limit",void 0),Object(s.a)([Object(i.c)({default:"100"})],c.prototype,"size",void 0),Object(s.a)([Object(i.c)({default:!1})],c.prototype,"disabled",void 0),Object(s.a)([Object(i.c)({default:!1})],c.prototype,"dragDisabled",void 0),Object(s.a)([Object(i.c)({default:!1})],c.prototype,"hiddenTrigger",void 0),Object(s.a)([Object(i.c)({default:"image"})],c.prototype,"type",void 0),Object(s.a)([Object(i.c)({default:"transparent"})],c.prototype,"uploadBg",void 0),Object(s.a)([Object(i.c)({default:!0})],c.prototype,"enableDomain",void 0),Object(s.a)([Object(i.c)({default:!0})],c.prototype,"enableDelete",void 0),Object(s.a)([Object(i.f)("value",{immediate:!0})],c.prototype,"valueChange",null),c=Object(s.a)([Object(i.a)({components:{LsDialog:a.a,LsMaterial:r.a,Draggable:l.a,FileItem:n.a}})],c);var u=c,g=(o("4e40"),o("2877")),p=Object(g.a)(u,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("ls-dialog",{ref:"materialDialog",staticClass:"material-select",attrs:{title:"选择"+t.tipsText,width:"1050px",top:"15vh"},on:{confirm:t.handleConfirm}},[t.hiddenTrigger?t._e():e("div",{staticClass:"material-select__trigger clearfix",attrs:{slot:"trigger"},on:{click:function(t){t.stopPropagation()}},slot:"trigger"},[e("draggable",{staticClass:"ls-draggable",attrs:{animation:"300",disabled:t.disabled||t.dragDisabled},on:{update:t.handleChange},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}},t._l(t.fileList,(function(o,s){return e("div",{key:o+s,staticClass:"material-preview ls-del-wrap",class:{"is-disabled":t.disabled,"is-one":1==t.limit},on:{click:function(e){return t.showDialog(!1,s)}}},[t.$scopedSlots.preview?e("div",[t._t("preview",null,{item:t.imageUri(o)})],2):e("file-item",{attrs:{type:t.type,item:{uri:t.imageUri(o)},size:t.size}}),t.enableDelete?e("i",{staticClass:"el-icon-close ls-icon-del",on:{click:function(e){return e.stopPropagation(),t.delImage(s)}}}):t._e()],1)})),0),e("div",{directives:[{name:"show",rawName:"v-show",value:t.showUpload,expression:"showUpload"}],staticClass:"material-upload",class:{"is-disabled":t.disabled,"is-one":1==t.limit},on:{click:function(e){return t.showDialog(!0)}}},[t.$slots.upload?e("div",[t._t("upload")],2):e("div",{staticClass:"upload-btn flex row-center",style:{width:t.size+"px",height:t.size+"px",background:t.uploadBg}},[t._t("default"),t.$slots.default?t._e():e("span",[t._v("添加"+t._s(t.tipsText))])],2)])],1),e("div",{staticClass:"material-wrap"},[e("ls-material",{ref:"material",attrs:{"page-size":15,type:t.type,limit:t.meterialLimit},on:{change:t.selectChange}})],1)])}),[],!1,null,"62c92359",null);e.a=p.exports},fc1c:function(t,e,o){}}]);
|