You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/public/admin/js/goods.f14d1e00.js

1 lines
110 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["goods"],{"01d7":function(e,a,t){},"02a9":function(e,a,t){},"0758":function(e,a,t){"use strict";t("6b8c")},1827:function(e,a,t){"use strict";t.d(a,"c",(function(){return o})),t.d(a,"a",(function(){return s})),t.d(a,"b",(function(){return l}));var r=t("b775"),i={list:"/goods.import/list",batch:"/goods.import/batch",delete:"/goods.import/delete"};function o(e){return Object(r["b"])({url:i.list,method:"get",params:e})}function s(e){return Object(r["b"])({url:i.batch,method:"post",data:e})}function l(e){return Object(r["b"])({url:i.delete,method:"post",data:e})}},"1d19b":function(e,a,t){"use strict";t.r(a);var r=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("content-header",{attrs:{title:e.$route.meta.title}}),a("div",{staticClass:"table-operator"},[a("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),e.isLoading?e._e():a("a-table",{attrs:{rowKey:"category_id",columns:e.columns,dataSource:e.categoryList,defaultExpandAllRows:!0,expandIconColumnIndex:1,pagination:!1,loading:e.isLoading},scopedSlots:e._u([{key:"status",fn:function(t){return a("span",{},[a("a-tag",{attrs:{color:t?"green":""}},[e._v(e._s(t?"显示":"隐藏"))])],1)}},{key:"action",fn:function(t,r){return a("span",{},[a("a",{staticStyle:{"margin-right":"8px"},on:{click:function(a){return e.handleEdit(r)}}},[e._v("编辑")]),a("a",{on:{click:function(a){return e.handleDelete(r)}}},[e._v("删除")])])}}],null,!1,1485366870)}),a("AddForm",{ref:"AddForm",attrs:{categoryList:e.categoryList},on:{handleSubmit:e.handleRefresh}}),a("EditForm",{ref:"EditForm",attrs:{categoryList:e.categoryList},on:{handleSubmit:e.handleRefresh}})],1)},i=[],o=(t("d3b7"),t("2f71")),s=t("2af9"),l=function(){var e=this,a=e._self._c;return a("a-modal",{attrs:{title:"新增商品分类",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1,destroyOnClose:!0},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form",{attrs:{form:e.form}},[a("a-form-item",{attrs:{label:"分类名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),a("a-form-item",{attrs:{label:"上级分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id",{initialValue:0}],expression:"['parent_id', { initialValue: 0}]"}],attrs:{treeData:e.categoryListTree,dropdownStyle:{maxHeight:"400px",overflow:"auto"},allowClear:""}})],1),a("a-form-item",{attrs:{label:"分类图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["image_id"],expression:"['image_id']"}]})],1),a("a-form-item",{attrs:{label:"是否加入排行榜",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否加入排行榜"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_paihang",{initialValue:0,rules:[{required:!0}]}],expression:"['is_paihang', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("不加入")]),a("a-radio",{attrs:{value:1}},[e._v("加入")])],1)],1),a("a-form-item",{attrs:{label:"是否热门",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否热门"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_hot",{initialValue:0,rules:[{required:!0}]}],expression:"['is_hot', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_in_store",{initialValue:0,rules:[{required:!0}]}],expression:"['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("显示")]),a("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),a("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},n=[],u=(t("99af"),t("8243")),d={components:{SelectImage:s["f"]},props:{categoryList:{type:Array,required:!0}},data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),categoryListTree:[]}},methods:{add:function(){this.visible=!0,this.getCategoryList()},getCategoryList:function(){var e=this.categoryList,a=u["a"].formatTreeData(e);this.categoryListTree=[{title:"顶级分类",key:0,value:0}].concat(a)},handleSubmit:function(e){var a=this;e.preventDefault();var t=this.form.validateFields;t((function(e,t){e||a.onFormSubmit(t)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var a=this;this.confirmLoading=!0,o["a"]({form:e}).then((function(t){a.$message.success(t.message,1.5),a.handleCancel(),a.$emit("handleSubmit",e)})).finally((function(e){a.confirmLoading=!1}))}}},c=d,p=t("2877"),m=Object(p["a"])(c,l,n,!1,null,null,null),v=m.exports,f=function(){var e=this,a=e._self._c;return a("a-modal",{attrs:{title:"编辑商品分类",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1,destroyOnClose:!0},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form",{attrs:{form:e.form}},[a("a-form-item",{attrs:{label:"分类名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),a("a-form-item",{attrs:{label:"上级分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],attrs:{treeData:e.categoryListTree,dropdownStyle:{maxHeight:"400px",overflow:"auto"},allowClear:""}})],1),a("a-form-item",{attrs:{label:"分类图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["image_id"],expression:"['image_id']"}],attrs:{defaultList:e.record.image?[e.record.image]:[]}})],1),a("a-form-item",{attrs:{label:"是否加入排行榜",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否加入排行榜"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_paihang",{initialValue:0,rules:[{required:!0}]}],expression:"['is_paihang', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("不加入")]),a("a-radio",{attrs:{value:1}},[e._v("加入")])],1)],1),a("a-form-item",{attrs:{label:"是否热门",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否热门"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_hot",{initialValue:0,rules:[{required:!0}]}],expression:"['is_hot', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_in_store",{initialValue:0,rules:[{required:!0}]}],expression:"['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("显示")]),a("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),a("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},g=[],_=t("2ef0"),h=t.n(_),b={components:{SelectImage:s["f"]},props:{categoryList:{type:Array,required:!0}},data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),categoryListTree:[],record:{}}},methods:{edit:function(e){this.visible=!0,this.record=e,this.getCategoryList(),this.setFieldsValue()},setFieldsValue:function(){var e=this.record,a=this.form.setFieldsValue;this.$nextTick((function(){a(h.a.pick(e,["name","parent_id","image_id","status","sort","is_paihang","is_hot","is_in_store"]))}))},getCategoryList:function(){var e=this.categoryList,a=u["a"].formatTreeData(e);this.categoryListTree=[{title:"顶级分类",key:0,value:0}].concat(a)},handleSubmit:function(e){var a=this;e.preventDefault();var t=this.form.validateFields;t((function(e,t){e||a.onFormSubmit(t)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var a=this;this.confirmLoading=!0,o["c"]({categoryId:this.record["category_id"],form:e}).then((function(t){a.$message.success(t.message,1.5),a.handleCancel(),a.$emit("handleSubmit",e)})).finally((function(e){a.confirmLoading=!1}))}}},C=b,w=Object(p["a"])(C,f,g,!1,null,null,null),y=w.exports,x={name:"Index",components:{ContentHeader:s["a"],STable:s["e"],AddForm:v,EditForm:y},data:function(){return{categoryList:[],queryParam:{},isLoading:!1,columns:[{title:"分类ID",dataIndex:"category_id"},{title:"分类名称",dataIndex:"name"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"添加时间",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"180px",scopedSlots:{customRender:"action"}}]}},created:function(){this.getCategoryList(!0)},methods:{getCategoryList:function(e){var a=this;e&&(this.isLoading=!0),o["d"]().then((function(e){a.categoryList=e.data.list})).finally((function(){return a.isLoading=!1}))},handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var a=this,t=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return o["b"]({categoryId:e["category_id"]}).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(e){return t.destroy()}))}})},handleRefresh:function(){this.getCategoryList()}}},k=x,L=Object(p["a"])(k,r,i,!1,null,null,null);a["default"]=L.exports},"4b95":function(e,a,t){"use strict";t("9d6b")},"54d6":function(e,a,t){"use strict";t("01d7")},"59aa":function(e,a,t){"use strict";t.d(a,"a",(function(){return i})),t.d(a,"b",(function(){return o}));var r=t("5c06"),i=new r["a"]([{key:"PHYSICAL",name:"实物商品",value:10},{key:"VIRTUAL",name:"虚拟商品",value:20}]),o=(new r["a"]([{key:"SINGLE",name:"单规格",value:10},{key:"MULTI",name:"多规格",value:20}]),new r["a"]([{key:"NORMAL",name:"进行中",value:10},{key:"COMPLETED",name:"导入完成",value:20}]));new r["a"]([{key:"NORMAL",name:"进行中",value:10},{key:"COMPLETED",name:"采集完成",value:20}])},"66d4":function(e,a,t){"use strict";t("90ce")},"6b8c":function(e,a,t){},"704a":function(e,a,t){"use strict";t.r(a);t("b0c0");var r=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),a("a-spin",{attrs:{spinning:e.isLoading}},[a("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[a("a-tabs",{attrs:{activeKey:e.tabKey,tabBarStyle:{marginBottom:"30px"}},on:{change:e.handleTabs}},[a("a-tab-pane",{key:0,attrs:{tab:"基本信息"}}),a("a-tab-pane",{key:1,attrs:{tab:"规格/库存"}}),a("a-tab-pane",{key:2,attrs:{tab:"商品详情"}}),a("a-tab-pane",{key:3,attrs:{tab:"更多设置"}})],1),a("div",{staticClass:"tabs-content"},[a("div",{directives:[{name:"show",rawName:"v-show",value:0==e.tabKey,expression:"tabKey == 0"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"商品类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("GoodsType",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_type",{initialValue:10,rules:[{required:!0}]}],expression:"['goods_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}})],1),a("a-form-item",{attrs:{label:"商品名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['goods_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入商品名称"}})],1),a("a-form-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["categorys",{rules:[{required:!0,message:"请至少选择1个商品分类"}]}],expression:"['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"}],attrs:{placeholder:"请选择商品分类",dropdownStyle:{maxHeight:"500px",overflow:"auto"},treeData:e.formData.categoryList,treeCheckable:"",treeCheckStrictly:"",allowClear:""}}),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/goods/category/index"}}},[e._v("去新增")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadCategoryList}},[e._v("刷新")])],1)],1),a("a-form-item",{attrs:{label:"商品图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["imagesIds",{rules:[{required:!0,message:"请至少上传1张商品图片"}]}],expression:"['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]"}],attrs:{multiple:"",maxNum:10}})],1),a("a-form-item",{attrs:{label:"是否大牌正品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_brand",{initialValue:0,rules:[{required:!0}]}],expression:"['is_brand', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"是否新品首发",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_new",{initialValue:0,rules:[{required:!0}]}],expression:"['is_new', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_in_store",{initialValue:0,rules:[{required:!0}]}],expression:"['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"商品编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_no"],expression:"['goods_no']"}],attrs:{placeholder:"请输入商品编码"}})],1),a("a-form-item",{attrs:{label:"所属分类排行(0表示不参加排行)",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["paihang"],expression:"['paihang']"}],attrs:{placeholder:"所属分类排行"}})],1),a("a-form-item",{attrs:{label:"热卖指数",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["remaizhishu"],expression:"['remaizhishu']"}],attrs:{placeholder:"热卖指数"}})],1),10==e.form.getFieldValue("goods_type")?a("a-form-item",{attrs:{label:"配送方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_ind_delivery_type",{initialValue:0,rules:[{required:!0}]}],expression:"['is_ind_delivery_type', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:0}},[e._v("系统默认")]),a("a-radio",{attrs:{value:1}},[e._v("单独配置")])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_delivery_type"),expression:"form.getFieldValue('is_ind_delivery_type')"}]},[a("a-form-item",{attrs:{extra:"需在 [设置 - 配送方式] 中,开启支持的配送方式才可生效"}},[a("a-checkbox-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_type",{initialValue:[10,20],rules:[{required:!0,message:"配送方式至少选择一个"}]}],expression:"['delivery_type', { initialValue: [10, 20], rules: [{ required: true, message: '配送方式至少选择一个' }] }]"}],attrs:{options:[{label:"快递配送",value:10},{label:"上门自提",value:20}]}})],1)],1)],1):e._e(),10==e.form.getFieldValue("goods_type")?a("a-form-item",{attrs:{label:"运费模板",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_id",{rules:[{required:!0,message:"请选择运费模板"}]}],expression:"['delivery_id', { rules: [{ required: true, message: '请选择运费模板' }] }]"}],staticStyle:{width:"300px"},attrs:{placeholder:"请选择运费模板"}},e._l(e.formData.deliveryList,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.delivery_id}},[e._v(e._s(t.name))])})),1),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/setting/delivery/template/create"}}},[e._v("新增模板")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadDeliveryList}},[e._v("刷新")])],1)],1):e._e(),a("a-form-item",{attrs:{label:"商品状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:10,rules:[{required:!0}]}],expression:"['status', { initialValue: 10, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:10}},[e._v("上架")]),a("a-radio",{attrs:{value:20}},[e._v("下架")])],1)],1),a("a-form-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true }] }]"}],attrs:{min:0}})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:1==e.tabKey,expression:"tabKey == 1"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"规格类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["spec_type",{initialValue:10,rules:[{required:!0}]}],expression:"['spec_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:10}},[e._v("单规格")]),a("a-radio",{attrs:{value:20}},[e._v("多规格")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:20==e.form.getFieldValue("spec_type"),expression:"form.getFieldValue('spec_type') == 20"}]},[a("MultiSpec",{ref:"MultiSpec"})],1),a("div",{directives:[{name:"show",rawName:"v-show",value:10==e.form.getFieldValue("spec_type"),expression:"form.getFieldValue('spec_type') == 10"}]},[a("a-form-item",{attrs:{label:"商品价格",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际购买金额,最低0.01"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_price",{initialValue:1,rules:[{required:!0,message:"请输入商品价格"}]}],expression:"['goods_price', { initialValue: 1, rules: [{ required: true, message: '请输入商品价格' }] }]"}],attrs:{min:.01,precision:2}}),a("span",{staticClass:"ml-10"},[e._v("元")])],1),a("a-form-item",{attrs:{label:"成本价",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"成本价仅用于商品页展示"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["cost_price"],expression:"['cost_price']"}],attrs:{min:0,precision:2}}),a("span",{staticClass:"ml-10"},[e._v("元")])],1),a("a-form-item",{attrs:{label:"当前库存数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际库存数量,为0时用户无法下单"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["stock_num",{initialValue:100,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"['stock_num', { initialValue: 100, rules: [{ required: true, message: '请输入库存数量' }] }]"}],attrs:{min:0,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件")])],1),a("a-form-item",{attrs:{label:"商品重量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际重量,用于计算运费"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_weight",{initialValue:0,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"['goods_weight', { initialValue: 0, rules: [{ required: true, message: '请输入库存数量' }] }]"}],attrs:{min:0}}),a("span",{staticClass:"ml-10"},[e._v("千克 (Kg)")])],1)],1),a("a-form-item",{attrs:{label:"库存计算方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["deduct_stock_type",{initialValue:10,rules:[{required:!0}]}],expression:"['deduct_stock_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:10}},[e._v("下单减库存")]),a("a-radio",{attrs:{value:20}},[e._v("付款减库存")])],1)],1),a("a-form-item",{attrs:{label:"商品限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用于限制每人购买该商品的数量"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_restrict",{initialValue:0,rules:[{required:!0}]}],expression:"['is_restrict', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:0}},[e._v("关闭")]),a("a-radio",{attrs:{value:1}},[e._v("开启")])],1),e.form.getFieldValue("is_restrict")?a("div",{staticClass:"mt-10"},[a("a-form-item",[a("span",{staticClass:"mr-10"},[e._v("总限购")]),a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_total",{rules:[{required:!0,message:"请输入总限购数量"}]}],expression:"['restrict_total', { rules: [{ required: true, message: '请输入总限购数量' }] }]"}],attrs:{min:1,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件/人")])],1),a("a-form-item",[a("span",{staticClass:"mr-10"},[e._v("每单限购")]),a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_single",{rules:[{required:!0,message:"请输入每单限购数量"}]}],expression:"['restrict_single', { rules: [{ required: true, message: '请输入每单限购数量' }] }]"}],attrs:{min:1,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.tabKey,expression:"tabKey == 2"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"商品详情",labelCol:e.labelCol,wrapperCol:{span:16}}},[a("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"商品详情不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"}]})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:3==e.tabKey,expression:"tabKey == 3"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"主图视频",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议视频宽高比19:9,建议时长8-45秒"}},[a("SelectVideo",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_id"],expression:"['video_id']"}],attrs:{multiple:!1}})],1),a("a-form-item",{attrs:{label:"视频封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750像素*750像素"}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_cover_id"],expression:"['video_cover_id']"}],attrs:{multiple:!1}})],1),a("a-form-item",{attrs:{label:"商品卖点",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"一句话简述,例如:此款商品美观大方 性价比较高 不容错过"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["selling_point"],expression:"['selling_point']"}],attrs:{placeholder:"请输入商品卖点"}})],1),a("a-form-item",{attrs:{label:"服务与承诺",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.formData.serviceList?a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["serviceIds",{initialValue:e.formData.defaultServiceIds}],expression:"['serviceIds', { initialValue: formData.defaultServiceIds }]"}],attrs:{mode:"multiple",placeholder:"请选择服务与承诺"}},e._l(e.formData.serviceList,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.service_id}},[e._v(e._s(t.name))])})),1):e._e(),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/goods/service/index"}}},[e._v("去新增")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadServiceList}},[e._v("刷新")])],1)],1),a("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端展示的销量 = 初始销量 + 实际销量"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sales_initial",{initialValue:0}],expression:"['sales_initial', { initialValue: 0}]"}]})],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("积分设置")]),a("a-form-item",{attrs:{label:"积分赠送",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品将获得积分"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_points_gift",{initialValue:1,rules:[{required:!0}]}],expression:"['is_points_gift', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),a("a-form-item",{attrs:{label:"积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品可以使用积分进行抵扣"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_points_discount",{initialValue:1,rules:[{required:!0}]}],expression:"['is_points_discount', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1)],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("会员折扣设置")]),a("a-form-item",{attrs:{label:"会员折扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后会员折扣,会员购买此商品可以享受会员等级折扣价"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_enable_grade",{initialValue:1,rules:[{required:!0}]}],expression:"['is_enable_grade', { initialValue: 1, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),e.form.getFieldValue("is_enable_grade")?a("a-form-item",{attrs:{label:"会员折扣设置",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_alone_grade",{initialValue:0,rules:[{required:!0}]}],expression:"['is_alone_grade', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:0}},[e._v("默认等级折扣")]),a("a-radio",{attrs:{value:1}},[e._v("单独设置折扣")])],1),e.form.getFieldValue("is_alone_grade")?a("div",e._l(e.formData.userGradeList,(function(t){return a("a-form-item",{key:t.grade_id},[a("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["alone_grade_equity[grade_id:".concat(t.grade_id,"]"),{initialValue:e.formData.defaultUserGradeValue[t.grade_id],rules:[{required:!0,message:"折扣率不能为空"}]}],expression:"[`alone_grade_equity[grade_id:${item.grade_id}]`, {\n initialValue: formData.defaultUserGradeValue[item.grade_id], rules: [{ required: true, message: '折扣率不能为空' }]\n }]"}],attrs:{addonBefore:t.name,addonAfter:"折",inputProps:{min:0,max:9.9}}})],1)})),1):e._e(),a("div",{staticClass:"form-item-help"},[e.form.getFieldValue("is_alone_grade")?a("p",{staticClass:"extra"},[e._v("单独折扣:折扣率范围0.0-9.9,例如: 9.8代表98折,0代表不折扣")]):a("p",{staticClass:"extra"},[e._v("默认折扣:默认为用户所属会员等级的折扣率")])])],1):e._e()],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("分销设置")]),a("a-form-item",{attrs:{label:"分销佣金",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_ind_dealer",{initialValue:0,rules:[{required:!0}]}],expression:"['is_ind_dealer', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:0}},[e._v("系统默认")]),a("a-radio",{attrs:{value:1}},[e._v("单独设置")])],1),a("div",{staticClass:"form-item-help"},[a("p",{staticClass:"extra"},[e._v("若使用分销功能必须在 [分销中心 - 分销设置] 中开启")])])],1),e.form.getFieldValue("is_ind_dealer")?a("a-form-item",{attrs:{label:"分销佣金类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["dealer_money_type",{initialValue:10,rules:[{required:!0}]}],expression:"['dealer_money_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:10}},[e._v("百分比")]),a("a-radio",{attrs:{value:20}},[e._v("固定金额")])],1),e._l(e.formData.dealer.levelList,(function(t,r){return a("a-form-item",{key:r},[a("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:[t.value,{rules:[{required:!0,message:"佣金不能为空"}]}],expression:"[item.value, { rules: [{ required: true, message: '佣金不能为空' }] }]"}],attrs:{addonBefore:t.name,addonAfter:10==e.form.getFieldValue("dealer_money_type")?"%":"元",inputProps:{min:0,precision:2}}})],1)}))],2):e._e()],1)],1)]),a("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[a("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},i=[],o=(t("d81d"),t("b64b"),t("d3b7"),t("d084")),s=t("2af9"),l=t("e1fe4"),n=t("a119"),u={components:{GoodsType:n["a"],SelectImage:s["f"],SelectVideo:s["g"],Ueditor:s["h"],InputNumberGroup:s["d"],MultiSpec:n["b"]},data:function(){return{tabKey:0,labelCol:{span:3},wrapperCol:{span:10},isLoading:!1,isBtnLoading:!1,form:this.$form.createForm(this),formData:l["a"].formData}},created:function(){var e=this;this.isLoading=!0,l["a"].getFromData().then((function(){e.isLoading=!1}))},methods:{onForceUpdate:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$forceUpdate(),a&&setTimeout((function(){e.$forceUpdate()}),10)},handleTabs:function(e){this.tabKey=e},onReloadCategoryList:function(){var e=this;this.isLoading=!0,l["a"].getCategoryList().then((function(){e.isLoading=!1}))},onReloadServiceList:function(){var e=this;this.isLoading=!0,l["a"].getServiceList().then((function(){e.isLoading=!1}))},onReloadDeliveryList:function(){var e=this;this.isLoading=!0,l["a"].getDeliveryList().then((function(){e.isLoading=!1}))},handleSubmit:function(e){var a=this;e.preventDefault();var t=this.form.validateFields;t((function(e,t){if(e)return a.onTargetTabError(e),!1;if(20===t.spec_type){var r=a.$refs.MultiSpec;if(!r.verifyForm())return a.tabKey=1,!1;t.specData=r.getFromSpecData()}return t.categoryIds=t.categorys.map((function(e){return e.value})),delete t.categorys,a.onFormSubmit(t),!0}))},onTargetTabError:function(e){var a=[["goods_type","goods_name","categorys","imagesIds","delivery_id","is_ind_delivery_type","delivery_type"],["spec_type","goods_price","is_restrict","restrict_total","restrict_single"],["content"],["alone_grade_equity","first_money","second_money","third_money"]],t=Object.keys(e).shift();for(var r in a)if(a[r].indexOf(t)>-1){this.tabKey=parseInt(r);break}},onFormSubmit:function(e){var a=this;this.isLoading=!0,this.isBtnLoading=!0,o["a"]({form:e}).then((function(e){a.$message.success(e.message,1.5),setTimeout((function(){a.$router.push("./index")}),1500)})).catch((function(){a.isBtnLoading=!1})).finally((function(){return a.isLoading=!1}))}}},d=u,c=(t("66d4"),t("2877")),p=Object(c["a"])(d,r,i,!1,null,"b4cfece0",null);a["default"]=p.exports},"73f5":function(e,a,t){"use strict";t.d(a,"e",(function(){return o})),t.d(a,"j",(function(){return s})),t.d(a,"h",(function(){return l})),t.d(a,"a",(function(){return n})),t.d(a,"g",(function(){return u})),t.d(a,"b",(function(){return d})),t.d(a,"f",(function(){return c})),t.d(a,"c",(function(){return p})),t.d(a,"d",(function(){return m})),t.d(a,"i",(function(){return v}));var r=t("f6ae"),i=t("b775");function o(e){return Object(i["b"])({url:r["a"].store.list,method:"get",params:e})}function s(e){var a=e.storeId;return Object(i["b"])({url:r["a"].store.superLogin,method:"get",params:{storeId:a}})}function l(e){return Object(i["b"])({url:r["a"].store.recycle,method:"get",params:e})}function n(e){return Object(i["b"])({url:r["a"].store.add,method:"post",data:e})}function u(e){return Object(i["b"])({url:r["a"].store.recovery,method:"post",data:e})}function d(e){return Object(i["b"])({url:r["a"].store.delete,method:"post",data:e})}function c(e){return Object(i["b"])({url:r["a"].store.move,method:"post",data:e})}function p(e){return Object(i["b"])({url:r["a"].store.module.dataList,method:"post",data:e})}function m(e){return Object(i["b"])({url:r["a"].store.module.getStorePlatform,method:"get",params:e})}function v(e){return Object(i["b"])({url:r["a"].store.module.setStorePlatform,method:"post",data:e})}},"85b5":function(e,a,t){},"8d47":function(e,a,t){},"90ce":function(e,a,t){},"90f4":function(e,a,t){"use strict";t.r(a);t("b0c0");var r=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"card-title"},[a("span",[e._v(e._s(e.$route.meta.pageTitle))])]),a("a-spin",{attrs:{spinning:e.isLoading}},[a("div",{staticClass:"container"},[a("div",{staticClass:"upload-dragger"},[a("a-upload-dragger",{attrs:{accept:".xls, .xlsx",multiple:!1,fileList:e.fileList,showUploadList:!1,beforeUpload:e.beforeUpload,remove:e.handleRemove}},[a("p",{staticClass:"ant-upload-drag-icon"},[a("a-icon",{attrs:{type:"cloud-upload"}})],1),e.fileList.length?a("div",[a("p",{staticClass:"ant-upload-text"},[a("span",[e._v(e._s(e.fileList[0].name))]),a("a",{staticClass:"ml-10",attrs:{href:"javascript:void(0);"},on:{click:function(a){return a.stopPropagation(),e.handleRemove(e.fileList[0])}}},[e._v("删除")])]),a("a-button",{staticClass:"mt-20",attrs:{type:"primary"},on:{click:function(a){return a.stopPropagation(),e.onFormSubmit.apply(null,arguments)}}},[e._v("立即导入")])],1):a("div",[a("p",{staticClass:"ant-upload-text"},[e._v("点击选择文件,或者将文件拖拽至此区域")]),a("p",{staticClass:"ant-upload-hint"},[e._v("仅支持 .xls, .xlsx 格式的excel文件,限2M以内")])])])],1),a("div",{staticClass:"import-explain"},[a("h2",{staticClass:"title"},[e._v("导入说明")]),a("a-timeline",{staticClass:"timeline"},[a("a-timeline-item",{staticClass:"timeline-item"},[a("p",{staticClass:"name"},[e._v("下载模板")]),a("ul",{staticClass:"content"},[a("li",{staticClass:"content-li"},[a("span",[e._v("批量导入商品需要系统开启队列服务,可在超管后台中查看是否开启")])]),a("li",{staticClass:"content-li"},[a("span",{staticClass:"mr-5"},[e._v("商品导入前需要您用Excel整理需要导入的商品资料,请先")]),a("a",{attrs:{href:"static/template/batch-admin-goods.xlsx",target:"_blank"}},[e._v("下载商品导入模板")])])])]),a("a-timeline-item",{staticClass:"timeline-item"},[a("p",{staticClass:"name"},[e._v("使用模板")]),a("ul",{staticClass:"content"},[a("li",{staticClass:"content-li"},[a("span",[e._v("模板中最多不能超过500个商品,如超过500个商品,请分批导入")])]),a("li",{staticClass:"content-li"},[a("span",[e._v("模板中的字段含义以及填写规则,可查看模板文件中标题栏的标注")])])])])],1)],1),a("FilesModal",{ref:"FilesModal",attrs:{multiple:!0,maxNum:10,actions:["delete","move","copyIds"]}})],1)])],1)},i=[],o=(t("a434"),t("d3b7"),t("1827")),s=t("fd0d"),l={components:{FilesModal:s["a"]},data:function(){return{isLoading:!1,fileList:[],uploadSizeLimit:"2"}},created:function(){},methods:{handleSelectImage:function(){this.$refs.FilesModal.show()},beforeUpload:function(e){var a=e.size/1024/1024;return a>this.uploadSizeLimit?(this.$message.error("上传的文件大小不能超出".concat(this.uploadSizeLimit,"MB")),!1):(this.fileList=[e],!1)},handleRemove:function(e){var a=this.fileList,t=a.indexOf(e);t>-1&&a.splice(t,1)},onFormSubmit:function(){var e=this,a=this.fileList,t=new FormData;t.append("file",a[0]),this.isLoading=!0,o["a"](t).then((function(a){e.fileList=[],e.$message.success(a.message,1.8),setTimeout((function(){return e.$router.push("/goods/import/list")}),1500)})).finally((function(){return e.isLoading=!1}))}}},n=l,u=(t("cca8"),t("2877")),d=Object(u["a"])(n,r,i,!1,null,"6090134a",null);a["default"]=d.exports},"9d6b":function(e,a,t){},a119:function(e,a,t){"use strict";t.d(a,"a",(function(){return c})),t.d(a,"b",(function(){return F}));var r=function(){var e=this,a=e._self._c;return a("div",{staticClass:"goods-type"},e._l(e.list,(function(t,r){return a("div",{directives:[{name:"show",rawName:"v-show",value:!e.onlyShowChecked||e.value==t.value,expression:"!onlyShowChecked || value == item.value"}],key:r,staticClass:"type-item",class:{checked:e.value==t.value},on:{click:function(a){return e.handleItem(t.value)}}},[a("div",{staticClass:"type-title"},[e._v(e._s(t.title))]),a("div",{staticClass:"type-help"},[e._v(e._s(t.help))]),e.value==t.value?a("a-icon",{staticClass:"icon-checked",attrs:{type:"check"}}):e._e()],1)})),0)},i=[],o=(t("b0c0"),t("4d91")),s=t("59aa"),l={name:"GoodsType",model:{prop:"value",event:"change"},props:{value:o["a"].any,onlyShowChecked:o["a"].bool.def(!1)},data:function(){return{defaultValue:s["a"].PHYSICAL.value,list:[{title:s["a"].PHYSICAL.name,help:"物流发货",value:s["a"].PHYSICAL.value},{title:s["a"].VIRTUAL.name,help:"无需物流",value:s["a"].VIRTUAL.value}]}},methods:{handleItem:function(e){this.$emit("change",e)}}},n=l,u=(t("4b95"),t("2877")),d=Object(u["a"])(n,r,i,!1,null,"72a598ae",null),c=d.exports,p=function(){var e=this,a=e._self._c;return a("div",[a("a-form-item",{attrs:{label:"商品规格",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("div",{staticClass:"form-item-help",staticStyle:{"line-height":"36px"}},[a("small",[e._v("最多添加3个商品规格组,生成的SKU数量不能超出50个")])]),e._l(e.multiSpecData.specList,(function(t,r){return a("div",{key:r,staticClass:"spec-group"},[a("div",{staticClass:"spec-group-item clearfix"},[a("a-input",{staticClass:"group-item-input",attrs:{readOnly:e.isSpecLocked,placeholder:"请输入规格名称"},on:{change:e.onChangeSpecGroupIpt},model:{value:t.spec_name,callback:function(a){e.$set(t,"spec_name",a)},expression:"item.spec_name"}}),e.isSpecLocked?e._e():a("a",{staticClass:"group-item-delete",attrs:{href:"javascript:;"},on:{click:function(a){return e.handleDeleteSpecGroup(r)}}},[e._v("删除规格组")])],1),a("div",{staticClass:"spec-value clearfix"},[e._l(t.valueList,(function(t,i){return a("div",{key:i,staticClass:"spec-value-item"},[a("a-input",{staticClass:"value-item-input",attrs:{readOnly:e.isSpecLocked,placeholder:"请输入规格值"},on:{change:e.onChangeSpecValueIpt},model:{value:t.spec_value,callback:function(a){e.$set(t,"spec_value",a)},expression:"itm.spec_value"}}),e.isSpecLocked?e._e():a("a-icon",{staticClass:"icon-close",attrs:{theme:"filled",type:"close-circle"},on:{click:function(a){return e.handleDeleteSpecValue(r,i)}}})],1)})),e.isSpecLocked?e._e():a("div",{staticClass:"spec-value-add"},[a("a",{staticClass:"group-item-delete",attrs:{href:"javascript:;"},on:{click:function(a){return e.handleAddSpecValue(r)}}},[e._v("新增规格值")])])],2)])})),!e.isSpecLocked&&e.multiSpecData.specList.length<3?a("a-button",{staticClass:"spec-group-add-btn",attrs:{icon:"plus"},on:{click:e.handleAddSpecGroup}},[e._v("添加规格组")]):e._e()],2),a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.multiSpecData.skuList.length,expression:"multiSpecData.skuList.length"}],attrs:{label:"SKU列表",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.multiSpecData.skuList.length>1?a("div",{staticClass:"sku-batch"},[a("span",{staticClass:"title"},[e._v("批量设置:")]),a("a-input-number",{attrs:{placeholder:"商品价格",min:.01,precision:2},model:{value:e.multiSpecData.skuBatchForm.goods_price,callback:function(a){e.$set(e.multiSpecData.skuBatchForm,"goods_price",a)},expression:"multiSpecData.skuBatchForm.goods_price"}}),a("a-input-number",{attrs:{placeholder:"成本价",min:0,precision:2},model:{value:e.multiSpecData.skuBatchForm.cost_price,callback:function(a){e.$set(e.multiSpecData.skuBatchForm,"cost_price",a)},expression:"multiSpecData.skuBatchForm.cost_price"}}),a("a-input-number",{attrs:{placeholder:"库存数量",min:0,precision:0},model:{value:e.multiSpecData.skuBatchForm.stock_num,callback:function(a){e.$set(e.multiSpecData.skuBatchForm,"stock_num",a)},expression:"multiSpecData.skuBatchForm.stock_num"}}),a("a-input-number",{attrs:{placeholder:"商品重量",min:0,precision:2},model:{value:e.multiSpecData.skuBatchForm.goods_weight,callback:function(a){e.$set(e.multiSpecData.skuBatchForm,"goods_weight",a)},expression:"multiSpecData.skuBatchForm.goods_weight"}}),a("a-input",{attrs:{placeholder:"sku编码"},model:{value:e.multiSpecData.skuBatchForm.goods_sku_no,callback:function(a){e.$set(e.multiSpecData.skuBatchForm,"goods_sku_no",a)},expression:"multiSpecData.skuBatchForm.goods_sku_no"}}),a("a-button",{on:{click:e.handleSkuBatch}},[e._v("立即设置")])],1):e._e(),a("a-table",{staticClass:"sku-list",attrs:{columns:e.multiSpecData.skuColumns,dataSource:e.multiSpecData.skuList,scroll:{x:!0},pagination:!1,bordered:""},scopedSlots:e._u([{key:"image",fn:function(t,r){return[a("SelectImage",{attrs:{defaultList:r.image_id>0&&r.image?[r.image]:[],width:50},model:{value:r.image_id,callback:function(a){e.$set(r,"image_id",a)},expression:"item.image_id"}})]}},{key:"goods_price",fn:function(t,r){return[a("a-input-number",{attrs:{size:"small",min:.01,precision:2},model:{value:r.goods_price,callback:function(a){e.$set(r,"goods_price",a)},expression:"item.goods_price"}})]}},{key:"cost_price",fn:function(t,r){return[a("a-input-number",{attrs:{size:"small",min:0,precision:2},model:{value:r.cost_price,callback:function(a){e.$set(r,"cost_price",a)},expression:"item.cost_price"}})]}},{key:"stock_num",fn:function(t,r){return[a("a-input-number",{attrs:{size:"small",min:0,precision:0},model:{value:r.stock_num,callback:function(a){e.$set(r,"stock_num",a)},expression:"item.stock_num"}})]}},{key:"goods_weight",fn:function(t,r){return[a("a-input-number",{attrs:{size:"small",min:0,precision:2},model:{value:r.goods_weight,callback:function(a){e.$set(r,"goods_weight",a)},expression:"item.goods_weight"}})]}},{key:"goods_sku_no",fn:function(t,r){return[a("a-input",{attrs:{size:"small"},model:{value:r.goods_sku_no,callback:function(a){e.$set(r,"goods_sku_no",a)},expression:"item.goods_sku_no"}})]}}])})],1)],1)},m=[],v=t("5530"),f=t("d4ec"),g=t("bee2"),_=t("ade3"),h=(t("d3b7"),t("159b"),t("a15b"),t("d81d"),t("99af"),t("7db0"),t("b64b"),t("a434"),t("2ef0")),b=t.n(h),C=t("ca00"),w=[{title:"预览图",dataIndex:"image",width:90,scopedSlots:{customRender:"image"}},{title:"商品价格",dataIndex:"goods_price",width:120,scopedSlots:{customRender:"goods_price"}},{title:"成本价",dataIndex:"cost_price",width:120,scopedSlots:{customRender:"cost_price"}},{title:"库存数量",dataIndex:"stock_num",width:120,scopedSlots:{customRender:"stock_num"}},{title:"商品重量 (KG)",dataIndex:"goods_weight",width:120,scopedSlots:{customRender:"goods_weight"}},{title:"SKU编码",dataIndex:"goods_sku_no",width:140,scopedSlots:{customRender:"goods_sku_no"}}],y={image_id:0,image:{},goods_price:"",line_price:"",cost_price:"",stock_num:"",goods_weight:"",goods_sku_no:""},x=function(){function e(){Object(f["a"])(this,e),Object(_["a"])(this,"multiSpecData",{}),Object(_["a"])(this,"error",""),this.multiSpecData={specList:[],skuList:[],skuColumns:b.a.cloneDeep(w),skuBatchForm:b.a.cloneDeep(y)}}return Object(g["a"])(e,[{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length&&(this.multiSpecData.specList=b.a.cloneDeep(e),this.multiSpecData.skuList=b.a.cloneDeep(a));var t=this.specGroupArr(),r=L(t),i=this.rowSpanArr(t,r);return this.buildSkuColumns(i),this.buildSkuList(r),this.multiSpecData}},{key:"isEmpty",value:function(){return 0===this.multiSpecData.specList.length}},{key:"getError",value:function(){return this.error}},{key:"specGroupArr",value:function(){var e=[];return this.multiSpecData.specList.forEach((function(a){var t=[];a.valueList.forEach((function(e){t.push(e)})),e.push(t)})),e}},{key:"rowSpanArr",value:function(e,a){for(var t=[],r=a.length,i=0;i<e.length;i++)t[i]=parseInt(r/e[i].length),r=t[i];return t}},{key:"buildSkuList",value:function(e){for(var a=[],t=function(){var t=Object(v["a"])(Object(v["a"])({},y),{},{key:r,tempId:e[r].map((function(e){return e.spec_value})).join("_"),skuKeys:e[r].map((function(e){return{groupKey:e.groupKey,valueKey:e.key}}))});e[r].forEach((function(e,a){t["spec_value_".concat(a)]=e.spec_value})),a.push(t)},r=0;r<e.length;r++)t();this.multiSpecData.skuList=this.oldSkuList(a)}},{key:"oldSkuList",value:function(e){var a=this.multiSpecData.skuList.concat();if(!a.length||!e.length)return e;var t=function(t){var r={};r=a.length===e.length?b.a.cloneDeep(a[t]):a.find((function(a){return a.tempId===e[t].tempId})),r&&(e[t]=Object(v["a"])(Object(v["a"])({},e[t]),b.a.pick(r,Object.keys(y))))};for(var r in e)t(r);return e}},{key:"buildSkuColumns",value:function(e){for(var a=this.multiSpecData.specList,t=w.concat(),r=function(a,t,r,i){var o={children:t,attrs:{}},s=e[a-1];return o.attrs.rowSpan=i%s===0?s:0,o},i=function(e){var i=a[e-1];t.unshift({title:i.spec_name,dataIndex:"spec_value_".concat(e-1),customRender:function(a,t,i){return r(e,a,t,i)}})},o=a.length;o>0;o--)i(o);this.multiSpecData.skuColumns=t}},{key:"handleAddSpecGroup",value:function(){var e=this.multiSpecData.specList;e.push({key:e.length||0,spec_name:"",valueList:[]});var a=e.length-1;this.handleAddSpecValue(a)}},{key:"handleAddSpecValue",value:function(e){var a=this.multiSpecData.specList[e],t=a.valueList;t.push({key:t.length||0,groupKey:a.key,spec_value:""}),this.onRefreshSpecValueKey(e)}},{key:"handleDeleteSpecGroup",value:function(e){this.multiSpecData.specList.splice(e,1),this.onUpdate(!1)}},{key:"handleDeleteSpecValue",value:function(e,a){this.multiSpecData.specList[e].valueList.splice(a,1),this.onRefreshSpecValueKey(e),this.onUpdate(!1)}},{key:"onRefreshSpecValueKey",value:function(e){var a=this.multiSpecData.specList[e],t=a.valueList;t.forEach((function(e,a){t[a].key=a}))}},{key:"handleSkuBatch",value:function(){var e=this.getFilterObject(this.multiSpecData.skuBatchForm),a=this.multiSpecData.skuList;for(var t in a)a[t]=Object(v["a"])(Object(v["a"])({},a[t]),e);this.onUpdate(!1)}},{key:"getFilterObject",value:function(e){var a={};for(var t in e){var r=e[t];Object(C["e"])(r)||(a[t]=r)}return a}},{key:"verifyForm",value:function(){return!!this.verifySpec()&&!!this.verifySkuList()}},{key:"verifySkuList",value:function(){var e=[{field:"goods_price",name:"商品价格"},{field:"stock_num",name:"库存数量"},{field:"goods_weight",name:"商品重量"}],a=this.multiSpecData.skuList;for(var t in a){var r=a[t];for(var i in e){var o=r[e[i].field];if(""===o||null===o)return this.error="".concat(e[i].name,"不能为空"),!1}}return!0}},{key:"verifySpec",value:function(){var e=this.multiSpecData.specList;if(!e.length)return this.error="亲,还没有添加规格组~",!1;for(var a in e){var t=e[a];if(Object(C["e"])(t.spec_name))return this.error="规格组名称不能为空~",!1;var r=t.valueList;if(!r.length)return this.error="还没有添加规格值~",!1;for(var i in r)if(Object(C["e"])(r[i].spec_value))return this.error="规格值不能为空~",!1}return!0}},{key:"getFromSpecData",value:function(){var e=this.multiSpecData,a=e.specList,t=e.skuList,r={specList:b.a.cloneDeep(a),skuList:b.a.cloneDeep(t)};for(var i in r.skuList){var o=r.skuList[i];delete o.image,delete o.key}return r}},{key:"onUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e?Object(C["c"])(k,200)(this):k(this)}}]),e}(),k=function(e){return e.getData()},L=function(e){return e.length?Array.prototype.reduce.call(e,(function(e,a){var t=[];return e.forEach((function(e){a.forEach((function(a){t.push(e.concat([a]))}))})),t}),[[]]):[]},S=t("2af9"),V={components:{SelectImage:S["f"]},props:{defaultSpecList:o["a"].array.def([]),defaultSkuList:o["a"].array.def([]),isSpecLocked:o["a"].bool.def(!1)},data:function(){return{labelCol:{span:3},wrapperCol:{span:21},MultiSpecModel:new x,multiSpecData:{specList:[],skuList:[]}}},watch:{defaultSpecList:function(e){e.length&&this.MultiSpecModel.isEmpty()&&this.getData()}},created:function(){this.getData()},methods:{getData:function(){var e=this.defaultSpecList,a=this.defaultSkuList;this.multiSpecData=this.MultiSpecModel.getData(e,a)},getFromSpecData:function(){return this.MultiSpecModel.getFromSpecData()},handleAddSpecGroup:function(){this.checkSkuMaxNum()&&this.MultiSpecModel.handleAddSpecGroup()},handleDeleteSpecGroup:function(e){var a=this,t=this.$confirm({title:"您确定要删除该规格组吗?",content:"删除后不可恢复",onOk:function(){a.MultiSpecModel.handleDeleteSpecGroup(e),t.destroy()}})},handleAddSpecValue:function(e){this.checkSkuMaxNum()&&this.MultiSpecModel.handleAddSpecValue(e)},handleDeleteSpecValue:function(e,a){var t=this,r=this.$confirm({title:"您确定要删除该规格值吗?",content:"删除后不可恢复",onOk:function(){t.MultiSpecModel.handleDeleteSpecValue(e,a),r.destroy()}})},onChangeSpecGroupIpt:function(){this.MultiSpecModel.onUpdate(!0)},onChangeSpecValueIpt:function(e,a){this.MultiSpecModel.onUpdate(!0)},checkSkuMaxNum:function(){var e=this.multiSpecData.skuList;return!(e.length>=50)||(this.$message.error("生成的sku列表数量不能大于50个,当前数量:".concat(e.length,"个"),2.5),!1)},handleSkuBatch:function(){this.MultiSpecModel.handleSkuBatch()},verifyForm:function(){return!!this.MultiSpecModel.verifyForm()||(this.$message.error(this.MultiSpecModel.getError(),2),!1)}}},q=V,D=(t("e1f6"),Object(u["a"])(q,p,m,!1,null,"33b24b06",null)),F=D.exports},b3cc:function(e,a,t){"use strict";t.r(a);t("b0c0");var r,i=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("content-header",{attrs:{title:e.$route.meta.title}}),a("div",{staticClass:"table-operator"},[a("a-row",{staticClass:"row-item-search"},[a("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[a("a-form-item",{attrs:{label:"导入状态"}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:-1}],expression:"['status', { initialValue: -1 }]"}]},[a("a-select-option",{attrs:{value:-1}},[e._v("全部")]),e._l(e.ImportStatusEnum.data,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.value}},[e._v(e._s(t.name))])}))],2)],1),a("a-form-item",{staticClass:"search-btn"},[a("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),a("div",{staticClass:"row-item-tab clearfix"},[a("a-button",{staticClass:"fl-l",attrs:{type:"primary",icon:"arrow-up"},on:{click:function(a){return e.handleImport()}}},[e._v("批量导入")])],1)],1),a("s-table",{ref:"table",attrs:{rowKey:"id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"start_time",fn:function(t){return[a("span",[e._v(e._s(t||"--"))])]}},{key:"end_time",fn:function(t){return[a("span",[e._v(e._s(t||"--"))])]}},{key:"status",fn:function(t){return a("span",{},[a("a-tag",{attrs:{color:e.ImportStatusColorEnum[t]}},[e._v(e._s(e.ImportStatusEnum[t].name))])],1)}},{key:"action",fn:function(t,r){return a("span",{staticClass:"actions"},[a("a",{on:{click:function(a){return e.handleDelete(r)}}},[e._v("删除")]),r.fail_count>0?a("a",{on:{click:function(a){return e.handleFailLog(r)}}},[e._v("失败日志")]):e._e()])}}])}),a("a-modal",{attrs:{title:"失败日志"},on:{ok:function(a){e.visibleFailLog=!1}},model:{value:e.visibleFailLog,callback:function(a){e.visibleFailLog=a},expression:"visibleFailLog"}},[a("div",{staticClass:"modal-content"},e._l(e.failLogContent,(function(t,r){return a("p",{key:r,staticClass:"log-item"},[a("span",{staticClass:"mr-5"},[e._v("序号["+e._s(t.goodsSn)+"]")]),a("span",[e._v(e._s(t.message))])])})),0)])],1)},o=[],s=t("5530"),l=t("ade3"),n=(t("d3b7"),t("1827")),u=t("2af9"),d=t("59aa"),c=(r={},Object(l["a"])(r,d["b"].NORMAL.value,""),Object(l["a"])(r,d["b"].COMPLETED.value,"green"),r),p={name:"Index",components:{STable:u["e"],ContentHeader:u["a"]},data:function(){var e=this;return{searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,ImportStatusEnum:d["b"],ImportStatusColorEnum:c,columns:[{title:"记录ID",dataIndex:"id"},{title:"导入总数量",dataIndex:"total_count"},{title:"导入成功数量",dataIndex:"success_count"},{title:"导入失败数量",dataIndex:"fail_count"},{title:"开始时间",dataIndex:"start_time",scopedSlots:{customRender:"start_time"}},{title:"结束时间",dataIndex:"end_time",scopedSlots:{customRender:"end_time"}},{title:"导入状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"操作",dataIndex:"action",width:"180px",scopedSlots:{customRender:"action"}}],loadData:function(a){return n["c"](Object(s["a"])(Object(s["a"])({},a),e.queryParam)).then((function(e){return e.data.list}))},visibleFailLog:!1,failLogContent:[]}},created:function(){},methods:{handleImport:function(){this.$router.push("/goods/import/batch")},handleDelete:function(e){var a=this,t=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return n["b"]({id:e["id"]}).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(e){return t.destroy()}))}})},handleFailLog:function(e){this.visibleFailLog=!0,this.failLogContent=e.fail_log},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},handleSearch:function(e){var a=this;e.preventDefault(),this.searchForm.validateFields((function(e,t){e||(a.queryParam=Object(s["a"])(Object(s["a"])({},a.queryParam),t),a.handleRefresh(!0))}))}}},m=p,v=(t("54d6"),t("2877")),f=Object(v["a"])(m,i,o,!1,null,"014c6a30",null);a["default"]=f.exports},c075:function(e,a,t){"use strict";t("85b5")},cca8:function(e,a,t){"use strict";t("8d47")},e1f6:function(e,a,t){"use strict";t("ec28")},e1fe4:function(e,a,t){"use strict";var r=t("5530"),i=(t("d3b7"),t("3ca3"),t("ddb0"),t("d81d"),t("4de4"),t("159b"),t("2ef0")),o=t.n(i),s=t("8243"),l=t("d084"),n=t("2e1c"),u=t("b775"),d={list:"/goods.service/list",all:"/goods.service/all",add:"/goods.service/add",edit:"/goods.service/edit",delete:"/goods.service/delete"};function c(e){return Object(u["b"])({url:d.all,method:"get",params:e})}var p={list:"/setting.delivery/list",all:"/setting.delivery/all",detail:"/setting.delivery/detail",add:"/setting.delivery/add",edit:"/setting.delivery/edit",delete:"/setting.delivery/delete"};function m(e){return Object(u["b"])({url:p.all,method:"get",params:e})}a["a"]={goodsId:null,formData:{goods:{},categoryList:[],deliveryList:[],serviceList:[],defaultServiceIds:[],userGradeList:[],defaultUserGradeValue:{},dealer:{levelList:[{name:"一级佣金",value:"first_money"},{name:"二级佣金",value:"second_money"},{name:"三级佣金",value:"third_money"}]}},getFromData:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.goodsId=a,new Promise((function(t,r){Promise.all([e.getGoodsDetail(a),e.getCategoryList(),e.getDeliveryList(),e.getServiceList(),e.getUserGradeList()]).then((function(){e.setDefaultData(),t({formData:e.formData})}))}))},getGoodsDetail:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!a&&new Promise((function(t,r){l["c"]({goodsId:a}).then((function(a){e.formData.goods=a.data.goodsInfo,t()}))}))},getFieldsValue:function(){var e=this.formData.goods;e.categorys=this.formatCategoryIds(e.categoryIds);var a=o.a.pick(e,["goods_type","goods_name","categorys","goods_no","sort","is_brand","is_new","paihang","remaizhishu","status","spec_type","deduct_stock_type","is_restrict","content","selling_point","serviceIds","sales_initial","is_points_gift","is_points_discount","is_enable_grade","is_alone_grade","is_ind_dealer","dealer_money_type","first_money","second_money","third_money"]);return Object(r["a"])({},a)},getFieldsValue2:function(){var e=this.formData.goods,a={};if(10==e.goods_type&&(a["delivery_id"]=e["delivery_id"],a["is_ind_delivery_type"]=e["is_ind_delivery_type"],a["delivery_type"]=e["delivery_type"]),10==e.spec_type){var t=o.a.pick(e.skuList[0],["goods_price","line_price","cost_price","stock_num","goods_weight"]);a=Object(r["a"])(Object(r["a"])({},a),t)}return 1==e.is_restrict&&(a["restrict_total"]=e["restrict_total"],a["restrict_single"]=e["restrict_single"]),a},formatCategoryIds:function(e){return e.map((function(e){return{value:e}}))},getCategoryList:function(){var e=this;return new Promise((function(a,t){s["a"].getCategoryTreeSelect().then((function(t){e.formData.categoryList=t,a()}))}))},getDeliveryList:function(){var e=this;return new Promise((function(a,t){m().then((function(t){e.formData.deliveryList=t.data.list,a()}))}))},getServiceList:function(){var e=this;return new Promise((function(a,t){c().then((function(t){e.formData.serviceList=t.data.list,a()}))}))},getUserGradeList:function(){var e=this;return new Promise((function(a,t){n["a"]({status:1}).then((function(t){e.formData.userGradeList=t.data.list,a()}))}))},setDefaultData:function(){this.setDefaultServiceIds(),this.setDefaultUserGradeValue()},setDefaultServiceIds:function(){var e=this.formData.serviceList;if(!this.goodsId){var a=e.filter((function(e){return e.is_default}));this.formData.defaultServiceIds=a.map((function(e){return e.service_id}))}},setDefaultUserGradeValue:function(){var e=this.formData.userGradeList,a=this.goodsId&&this.formData.goods.alone_grade_equity?this.formData.goods.alone_grade_equity:{},t={};e.forEach((function(e){t[e.grade_id]=a[e.grade_id]||e.equity.discount})),this.formData.defaultUserGradeValue=Object(r["a"])({},t)}}},eb68:function(e,a,t){"use strict";t.r(a);t("b0c0");var r=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),a("a-spin",{attrs:{spinning:e.isLoading}},[a("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[a("a-tabs",{attrs:{activeKey:e.tabKey,tabBarStyle:{marginBottom:"30px"}},on:{change:e.handleTabs}},[a("a-tab-pane",{key:0,attrs:{tab:"基本信息"}}),a("a-tab-pane",{key:1,attrs:{tab:"规格/库存"}}),a("a-tab-pane",{key:2,attrs:{tab:"商品详情"}}),a("a-tab-pane",{key:3,attrs:{tab:"更多设置"}})],1),a("div",{staticClass:"tabs-content"},[a("div",{directives:[{name:"show",rawName:"v-show",value:0==e.tabKey,expression:"tabKey == 0"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"商品类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("GoodsType",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_type",{rules:[{required:!0}]}],expression:"['goods_type', { rules: [{ required: true }] }]"}],attrs:{onlyShowChecked:!0},on:{change:function(a){return e.onForceUpdate(!0)}}})],1),a("a-form-item",{attrs:{label:"商品名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['goods_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入商品名称"}})],1),a("a-form-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["categorys",{rules:[{required:!0,message:"请至少选择1个商品分类"}]}],expression:"['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"}],attrs:{placeholder:"请选择商品分类",dropdownStyle:{maxHeight:"500px",overflow:"auto"},treeData:e.formData.categoryList,treeCheckable:"",treeCheckStrictly:"",allowClear:""}}),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/goods/category/index"}}},[e._v("去新增")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadCategoryList}},[e._v("刷新")])],1)],1),a("a-form-item",{attrs:{label:"商品图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["imagesIds",{rules:[{required:!0,message:"请至少上传1张商品图片"}]}],expression:"['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]"}],attrs:{multiple:"",maxNum:10,defaultList:e.formData.goods.goods_images}})],1),a("a-form-item",{attrs:{label:"是否大牌正品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_brand",{initialValue:0,rules:[{required:!0}]}],expression:"['is_brand', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"是否新品首发",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_new",{initialValue:0,rules:[{required:!0}]}],expression:"['is_new', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_in_store",{initialValue:0,rules:[{required:!0}]}],expression:"['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:0}},[e._v("否")]),a("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),a("a-form-item",{attrs:{label:"商品编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_no"],expression:"['goods_no']"}],attrs:{placeholder:"请输入商品编码"}})],1),a("a-form-item",{attrs:{label:"所属分类排行(0表示不参加排行)",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["paihang"],expression:"['paihang']"}],attrs:{placeholder:"所属分类排行"}})],1),a("a-form-item",{attrs:{label:"热卖指数",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["remaizhishu"],expression:"['remaizhishu']"}],attrs:{placeholder:"热卖指数"}})],1),10==e.form.getFieldValue("goods_type")?a("a-form-item",{attrs:{label:"配送方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_ind_delivery_type",{initialValue:0,rules:[{required:!0}]}],expression:"['is_ind_delivery_type', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:0}},[e._v("系统默认")]),a("a-radio",{attrs:{value:1}},[e._v("单独配置")])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_delivery_type"),expression:"form.getFieldValue('is_ind_delivery_type')"}]},[a("a-form-item",{attrs:{extra:"需在 [设置 - 配送方式] 中,开启支持的配送方式才可生效"}},[a("a-checkbox-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_type",{initialValue:[10,20],rules:[{required:!0,message:"配送方式至少选择一个"}]}],expression:"['delivery_type', { initialValue: [10, 20], rules: [{ required: true, message: '配送方式至少选择一个' }] }]"}],attrs:{options:[{label:"快递配送",value:10},{label:"上门自提",value:20}]}})],1)],1)],1):e._e(),10==e.form.getFieldValue("goods_type")?a("a-form-item",{attrs:{label:"运费模板",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_id",{rules:[{required:!0,message:"请选择运费模板"}]}],expression:"['delivery_id', { rules: [{ required: true, message: '请选择运费模板' }] }]"}],staticStyle:{width:"300px"},attrs:{placeholder:"请选择运费模板"}},e._l(e.formData.deliveryList,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.delivery_id}},[e._v(e._s(t.name))])})),1),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/setting/delivery/template/create"}}},[e._v("新增模板")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadDeliveryList}},[e._v("刷新")])],1)],1):e._e(),a("a-form-item",{attrs:{label:"商品状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:10,rules:[{required:!0}]}],expression:"['status', { initialValue: 10, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:10}},[e._v("上架")]),a("a-radio",{attrs:{value:20}},[e._v("下架")])],1)],1),a("a-form-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true }] }]"}],attrs:{min:0}})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:1==e.tabKey,expression:"tabKey == 1"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"规格类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["spec_type",{initialValue:10,rules:[{required:!0}]}],expression:"['spec_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:10,disabled:e.formData.goods.isSpecLocked}},[e._v("单规格")]),a("a-radio",{attrs:{value:20,disabled:e.formData.goods.isSpecLocked}},[e._v("多规格")])],1),e.formData.goods.isSpecLocked?a("p",{staticClass:"form-item-help"},[a("small",{staticClass:"c-red"},[e._v("注:该商品当前正在参与其他活动,商品规格不允许更改")])]):e._e()],1),20==e.form.getFieldValue("spec_type")?a("div",[a("MultiSpec",{ref:"MultiSpec",attrs:{isSpecLocked:e.formData.goods.isSpecLocked,defaultSpecList:e.formData.goods.specList,defaultSkuList:e.formData.goods.skuList}})],1):e._e(),10==e.form.getFieldValue("spec_type")?a("div",[a("a-form-item",{attrs:{label:"商品价格",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际购买金额,最低0.01"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_price",{rules:[{required:!0,message:"请输入商品价格"}]}],expression:"['goods_price', { rules: [{ required: true, message: '请输入商品价格' }] }]"}],attrs:{min:.01,precision:2}}),a("span",{staticClass:"ml-10"},[e._v("元")])],1),a("a-form-item",{attrs:{label:"成本价",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"成本价仅用于商品页展示"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["cost_price"],expression:"['cost_price']"}],attrs:{min:0,precision:2}}),a("span",{staticClass:"ml-10"},[e._v("元")])],1),a("a-form-item",{attrs:{label:"当前库存数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际库存数量,为0时用户无法下单"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["stock_num",{initialValue:100,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"['stock_num', { initialValue: 100, rules: [{ required: true, message: '请输入库存数量' }] }]"}],attrs:{min:0,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件")])],1),a("a-form-item",{attrs:{label:"商品重量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际重量,用于计算运费"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_weight",{initialValue:0,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"['goods_weight', { initialValue: 0, rules: [{ required: true, message: '请输入库存数量' }] }]"}],attrs:{min:0}}),a("span",{staticClass:"ml-10"},[e._v("千克 (Kg)")])],1)],1):e._e(),a("a-form-item",{attrs:{label:"库存计算方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["deduct_stock_type",{initialValue:10,rules:[{required:!0}]}],expression:"['deduct_stock_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:10}},[e._v("下单减库存")]),a("a-radio",{attrs:{value:20}},[e._v("付款减库存")])],1)],1),a("a-form-item",{attrs:{label:"商品限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用于限制每人购买该商品的数量"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_restrict",{initialValue:0,rules:[{required:!0}]}],expression:"['is_restrict', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:0}},[e._v("关闭")]),a("a-radio",{attrs:{value:1}},[e._v("开启")])],1),e.form.getFieldValue("is_restrict")?a("div",{staticClass:"mt-10"},[a("a-form-item",[a("span",{staticClass:"mr-10"},[e._v("总限购")]),a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_total",{rules:[{required:!0,message:"请输入总限购数量"}]}],expression:"['restrict_total', { rules: [{ required: true, message: '请输入总限购数量' }] }]"}],attrs:{min:1,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件/人")])],1),a("a-form-item",[a("span",{staticClass:"mr-10"},[e._v("每单限购")]),a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_single",{rules:[{required:!0,message:"请输入每单限购数量"}]}],expression:"['restrict_single', { rules: [{ required: true, message: '请输入每单限购数量' }] }]"}],attrs:{min:1,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.tabKey,expression:"tabKey == 2"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"商品详情",labelCol:e.labelCol,wrapperCol:{span:16}}},[a("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"商品详情不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"}]})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:3==e.tabKey,expression:"tabKey == 3"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"主图视频",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议视频宽高比19:9,建议时长8-45秒"}},[a("SelectVideo",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_id"],expression:"['video_id']"}],attrs:{multiple:!1,defaultList:e.formData.goods.video?[e.formData.goods.video]:[]}})],1),a("a-form-item",{attrs:{label:"视频封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750像素*750像素"}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_cover_id"],expression:"['video_cover_id']"}],attrs:{multiple:!1,defaultList:e.formData.goods.videoCover?[e.formData.goods.videoCover]:[]}})],1),a("a-form-item",{attrs:{label:"商品卖点",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"一句话简述,例如:此款商品美观大方 性价比较高 不容错过"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["selling_point"],expression:"['selling_point']"}],attrs:{placeholder:"请输入商品卖点"}})],1),a("a-form-item",{attrs:{label:"服务与承诺",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.formData.serviceList?a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["serviceIds"],expression:"['serviceIds']"}],attrs:{mode:"multiple",placeholder:"请选择服务与承诺"}},e._l(e.formData.serviceList,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.service_id}},[e._v(e._s(t.name))])})),1):e._e(),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/goods/service/index"}}},[e._v("去新增")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadServiceList}},[e._v("刷新")])],1)],1),a("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端展示的销量 = 初始销量 + 实际销量"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sales_initial",{initialValue:0}],expression:"['sales_initial', { initialValue: 0}]"}]})],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("积分设置")]),a("a-form-item",{attrs:{label:"积分赠送",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品将获得积分"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_points_gift",{initialValue:1,rules:[{required:!0}]}],expression:"['is_points_gift', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),a("a-form-item",{attrs:{label:"积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品可以使用积分进行抵扣"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_points_discount",{initialValue:1,rules:[{required:!0}]}],expression:"['is_points_discount', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1)],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("会员折扣设置")]),a("a-form-item",{attrs:{label:"会员折扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后会员折扣,会员购买此商品可以享受会员等级折扣价"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_enable_grade",{initialValue:1,rules:[{required:!0}]}],expression:"['is_enable_grade', { initialValue: 1, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_enable_grade"),expression:"form.getFieldValue('is_enable_grade')"}],attrs:{label:"会员折扣设置",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_alone_grade",{initialValue:0,rules:[{required:!0}]}],expression:"['is_alone_grade', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:0}},[e._v("默认等级折扣")]),a("a-radio",{attrs:{value:1}},[e._v("单独设置折扣")])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_alone_grade"),expression:"form.getFieldValue('is_alone_grade')"}]},e._l(e.formData.userGradeList,(function(t){return a("a-form-item",{key:t.grade_id},[a("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["alone_grade_equity[grade_id:".concat(t.grade_id,"]"),{initialValue:e.formData.defaultUserGradeValue[t.grade_id],rules:[{required:!0,message:"折扣率不能为空"}]}],expression:"[`alone_grade_equity[grade_id:${item.grade_id}]`, {\n initialValue: formData.defaultUserGradeValue[item.grade_id], rules: [{ required: true, message: '折扣率不能为空'}]\n }]"}],attrs:{addonBefore:t.name,addonAfter:"折",inputProps:{min:0,max:9.9}}})],1)})),1),a("div",{staticClass:"form-item-help"},[e.form.getFieldValue("is_alone_grade")?a("p",{staticClass:"extra"},[e._v("单独折扣:折扣率范围0.0-9.9,例如: 9.8代表98折,0代表不折扣")]):a("p",{staticClass:"extra"},[e._v("默认折扣:默认为用户所属会员等级的折扣率")])])],1)],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("分销设置")]),a("a-form-item",{attrs:{label:"分销佣金",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_ind_dealer",{initialValue:0,rules:[{required:!0}]}],expression:"['is_ind_dealer', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:0}},[e._v("系统默认")]),a("a-radio",{attrs:{value:1}},[e._v("单独设置")])],1),a("div",{staticClass:"form-item-help"},[a("p",{staticClass:"extra"},[e._v("若使用分销功能必须在 [分销中心 - 分销设置] 中开启")])])],1),a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_dealer"),expression:"form.getFieldValue('is_ind_dealer')"}],attrs:{label:"分销佣金类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["dealer_money_type",{initialValue:10,rules:[{required:!0}]}],expression:"['dealer_money_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:10}},[e._v("百分比")]),a("a-radio",{attrs:{value:20}},[e._v("固定金额")])],1),e._l(e.formData.dealer.levelList,(function(t,r){return a("a-form-item",{key:r},[a("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:[t.value,{rules:[{required:!0,message:"佣金不能为空"}]}],expression:"[item.value, { rules: [{ required: true, message: '佣金不能为空'}] }]"}],attrs:{addonBefore:t.name,addonAfter:10==e.form.getFieldValue("dealer_money_type")?"%":"元",inputProps:{min:0,precision:2}}})],1)}))],2)],1)],1)]),a("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[a("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},i=[],o=(t("d81d"),t("b64b"),t("d3b7"),t("d084")),s=t("2af9"),l=t("e1fe4"),n=t("a119"),u=t("ca00"),d={components:{GoodsType:n["a"],SelectImage:s["f"],SelectVideo:s["g"],Ueditor:s["h"],InputNumberGroup:s["d"],MultiSpec:n["b"]},data:function(){return{tabKey:0,labelCol:{span:3},wrapperCol:{span:10},isLoading:!1,isBtnLoading:!1,form:this.$form.createForm(this),goodsId:null,formData:l["a"].formData}},created:function(){this.initData()},beforeDestroy:function(){l["a"].formData.goods={}},methods:{initData:function(){var e=this;this.goodsId=this.$route.query.goodsId,this.isLoading=!0,l["a"].getFromData(this.goodsId).then((function(){Object(u["f"])(e.form.getFieldsValue())||(e.form.setFieldsValue(l["a"].getFieldsValue()),e.$nextTick((function(){e.form.setFieldsValue(l["a"].getFieldsValue2()),e.onForceUpdate()}))),e.isLoading=!1}))},onForceUpdate:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$forceUpdate(),a&&setTimeout((function(){e.$forceUpdate()}),10)},handleTabs:function(e){this.tabKey=e},onReloadCategoryList:function(){var e=this;this.isLoading=!0,l["a"].getCategoryList().then((function(){e.isLoading=!1}))},onReloadServiceList:function(){var e=this;this.isLoading=!0,l["a"].getServiceList().then((function(){e.isLoading=!1}))},onReloadDeliveryList:function(){var e=this;this.isLoading=!0,l["a"].getDeliveryList().then((function(){e.isLoading=!1}))},handleSubmit:function(e){var a=this;e.preventDefault();var t=this.form.validateFields;t((function(e,t){if(e)return a.onTargetTabError(e),!1;if(20===t.spec_type){var r=a.$refs.MultiSpec;if(!r.verifyForm())return a.tabKey=1,!1;t.specData=r.getFromSpecData()}return t.categoryIds=t.categorys.map((function(e){return e.value})),delete t.categorys,a.onFormSubmit(t),!0}))},onTargetTabError:function(e){var a=[["goods_type","goods_name","categorys","imagesIds","delivery_id","is_ind_delivery_type","delivery_type","is_brand","is_in_store"],["spec_type","goods_price","is_restrict","restrict_total","restrict_single","cost_price"],["content"],["alone_grade_equity","first_money","second_money","third_money"]],t=Object.keys(e).shift();for(var r in a)if(a[r].indexOf(t)>-1){this.tabKey=parseInt(r);break}},onFormSubmit:function(e){var a=this;this.isLoading=!0,this.isBtnLoading=!0,o["d"]({goodsId:this.goodsId,form:e}).then((function(e){a.$message.success(e.message,1.5),setTimeout((function(){a.$router.push("./index")}),1500)})).catch((function(){a.isBtnLoading=!1})).finally((function(){return a.isLoading=!1}))}}},c=d,p=(t("c075"),t("2877")),m=Object(p["a"])(c,r,i,!1,null,"3e5e725c",null);a["default"]=m.exports},ec28:function(e,a,t){},ecf0:function(e,a,t){"use strict";t.r(a);t("b0c0");var r=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),a("a-spin",{attrs:{spinning:e.isLoading}},[a("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[a("a-tabs",{attrs:{activeKey:e.tabKey,tabBarStyle:{marginBottom:"30px"}},on:{change:e.handleTabs}},[a("a-tab-pane",{key:0,attrs:{tab:"基本信息"}}),a("a-tab-pane",{key:1,attrs:{tab:"规格/库存"}}),a("a-tab-pane",{key:2,attrs:{tab:"商品详情"}}),a("a-tab-pane",{key:3,attrs:{tab:"更多设置"}})],1),a("div",{staticClass:"tabs-content"},[a("div",{directives:[{name:"show",rawName:"v-show",value:0==e.tabKey,expression:"tabKey == 0"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"商品类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("GoodsType",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_type",{rules:[{required:!0}]}],expression:"['goods_type', { rules: [{ required: true }] }]"}],attrs:{onlyShowChecked:!0},on:{change:function(a){return e.onForceUpdate(!0)}}})],1),a("a-form-item",{attrs:{label:"商品名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['goods_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入商品名称"}})],1),a("a-form-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["categorys",{rules:[{required:!0,message:"请至少选择1个商品分类"}]}],expression:"['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"}],attrs:{placeholder:"请选择商品分类",dropdownStyle:{maxHeight:"500px",overflow:"auto"},treeData:e.formData.categoryList,treeCheckable:"",treeCheckStrictly:"",allowClear:""}}),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/goods/category/index"}}},[e._v("去新增")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadCategoryList}},[e._v("刷新")])],1)],1),a("a-form-item",{attrs:{label:"商品图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["imagesIds",{rules:[{required:!0,message:"请至少上传1张商品图片"}]}],expression:"['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]"}],attrs:{multiple:"",maxNum:10,defaultList:e.formData.goods.goods_images}})],1),a("a-form-item",{attrs:{label:"商品编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_no"],expression:"['goods_no']"}],attrs:{placeholder:"请输入商品编码"}})],1),10==e.form.getFieldValue("goods_type")?a("a-form-item",{attrs:{label:"配送方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_ind_delivery_type",{initialValue:0,rules:[{required:!0}]}],expression:"['is_ind_delivery_type', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:0}},[e._v("系统默认")]),a("a-radio",{attrs:{value:1}},[e._v("单独配置")])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_delivery_type"),expression:"form.getFieldValue('is_ind_delivery_type')"}]},[a("a-form-item",{attrs:{extra:"需在 [设置 - 配送方式] 中,开启支持的配送方式才可生效"}},[a("a-checkbox-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_type",{initialValue:[10,20],rules:[{required:!0,message:"配送方式至少选择一个"}]}],expression:"['delivery_type', { initialValue: [10, 20], rules: [{ required: true, message: '配送方式至少选择一个' }] }]"}],attrs:{options:[{label:"快递配送",value:10},{label:"上门自提",value:20}]}})],1)],1)],1):e._e(),10==e.form.getFieldValue("goods_type")?a("a-form-item",{attrs:{label:"运费模板",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_id",{rules:[{required:!0,message:"请选择运费模板"}]}],expression:"['delivery_id', { rules: [{ required: true, message: '请选择运费模板' }] }]"}],staticStyle:{width:"300px"},attrs:{placeholder:"请选择运费模板"}},e._l(e.formData.deliveryList,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.delivery_id}},[e._v(e._s(t.name))])})),1),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/setting/delivery/template/create"}}},[e._v("新增模板")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadDeliveryList}},[e._v("刷新")])],1)],1):e._e(),a("a-form-item",{attrs:{label:"商品状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:10,rules:[{required:!0}]}],expression:"['status', { initialValue: 10, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:10}},[e._v("上架")]),a("a-radio",{attrs:{value:20}},[e._v("下架")])],1)],1),a("a-form-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true }] }]"}],attrs:{min:0}})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:1==e.tabKey,expression:"tabKey == 1"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"规格类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["spec_type",{initialValue:10,rules:[{required:!0}]}],expression:"['spec_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:10}},[e._v("单规格")]),a("a-radio",{attrs:{value:20}},[e._v("多规格")])],1)],1),20==e.form.getFieldValue("spec_type")?a("div",[a("MultiSpec",{ref:"MultiSpec",attrs:{defaultSpecList:e.formData.goods.specList,defaultSkuList:e.formData.goods.skuList}})],1):e._e(),10==e.form.getFieldValue("spec_type")?a("div",[a("a-form-item",{attrs:{label:"商品价格",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际购买金额,最低0.01"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_price",{rules:[{required:!0,message:"请输入商品价格"}]}],expression:"['goods_price', { rules: [{ required: true, message: '请输入商品价格' }] }]"}],attrs:{min:.01,precision:2}}),a("span",{staticClass:"ml-10"},[e._v("元")])],1),a("a-form-item",{attrs:{label:"成本价",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"成本价仅用于商品页展示"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["cost_price"],expression:"['cost_price']"}],attrs:{min:0,precision:2}}),a("span",{staticClass:"ml-10"},[e._v("元")])],1),a("a-form-item",{attrs:{label:"当前库存数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际库存数量,为0时用户无法下单"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["stock_num",{initialValue:100,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"['stock_num', { initialValue: 100, rules: [{ required: true, message: '请输入库存数量' }] }]"}],attrs:{min:0,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件")])],1),a("a-form-item",{attrs:{label:"商品重量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际重量,用于计算运费"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_weight",{initialValue:0,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"['goods_weight', { initialValue: 0, rules: [{ required: true, message: '请输入库存数量' }] }]"}],attrs:{min:0}}),a("span",{staticClass:"ml-10"},[e._v("千克 (Kg)")])],1)],1):e._e(),a("a-form-item",{attrs:{label:"库存计算方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["deduct_stock_type",{initialValue:10,rules:[{required:!0}]}],expression:"['deduct_stock_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:10}},[e._v("下单减库存")]),a("a-radio",{attrs:{value:20}},[e._v("付款减库存")])],1)],1),a("a-form-item",{attrs:{label:"商品限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用于限制每人购买该商品的数量"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_restrict",{initialValue:0,rules:[{required:!0}]}],expression:"['is_restrict', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate()}}},[a("a-radio",{attrs:{value:0}},[e._v("关闭")]),a("a-radio",{attrs:{value:1}},[e._v("开启")])],1),e.form.getFieldValue("is_restrict")?a("div",{staticClass:"mt-10"},[a("a-form-item",[a("span",{staticClass:"mr-10"},[e._v("总限购")]),a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_total",{rules:[{required:!0,message:"请输入总限购数量"}]}],expression:"['restrict_total', { rules: [{ required: true, message: '请输入总限购数量' }] }]"}],attrs:{min:1,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件/人")])],1),a("a-form-item",[a("span",{staticClass:"mr-10"},[e._v("每单限购")]),a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["restrict_single",{rules:[{required:!0,message:"请输入每单限购数量"}]}],expression:"['restrict_single', { rules: [{ required: true, message: '请输入每单限购数量' }] }]"}],attrs:{min:1,precision:0}}),a("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.tabKey,expression:"tabKey == 2"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"商品详情",labelCol:e.labelCol,wrapperCol:{span:16}}},[a("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"商品详情不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"}]})],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:3==e.tabKey,expression:"tabKey == 3"}],staticClass:"tab-pane"},[a("a-form-item",{attrs:{label:"主图视频",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议视频宽高比19:9,建议时长8-45秒"}},[a("SelectVideo",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_id"],expression:"['video_id']"}],attrs:{multiple:!1,defaultList:e.formData.goods.video?[e.formData.goods.video]:[]}})],1),a("a-form-item",{attrs:{label:"视频封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750像素*750像素"}},[a("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_cover_id"],expression:"['video_cover_id']"}],attrs:{multiple:!1,defaultList:e.formData.goods.videoCover?[e.formData.goods.videoCover]:[]}})],1),a("a-form-item",{attrs:{label:"商品卖点",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"一句话简述,例如:此款商品美观大方 性价比较高 不容错过"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["selling_point"],expression:"['selling_point']"}],attrs:{placeholder:"请输入商品卖点"}})],1),a("a-form-item",{attrs:{label:"服务与承诺",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.formData.serviceList?a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["serviceIds"],expression:"['serviceIds']"}],attrs:{mode:"multiple",placeholder:"请选择服务与承诺"}},e._l(e.formData.serviceList,(function(t,r){return a("a-select-option",{key:r,attrs:{value:t.service_id}},[e._v(e._s(t.name))])})),1):e._e(),a("div",{staticClass:"form-item-help"},[a("router-link",{attrs:{target:"_blank",to:{path:"/goods/service/index"}}},[e._v("去新增")]),a("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadServiceList}},[e._v("刷新")])],1)],1),a("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端展示的销量 = 初始销量 + 实际销量"}},[a("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sales_initial",{initialValue:0}],expression:"['sales_initial', { initialValue: 0 }]"}]})],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("积分设置")]),a("a-form-item",{attrs:{label:"积分赠送",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品将获得积分"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_points_gift",{initialValue:1,rules:[{required:!0}]}],expression:"['is_points_gift', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),a("a-form-item",{attrs:{label:"积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品可以使用积分进行抵扣"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_points_discount",{initialValue:1,rules:[{required:!0}]}],expression:"['is_points_discount', { initialValue: 1, rules: [{ required: true }] }]"}]},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1)],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("会员折扣设置")]),a("a-form-item",{attrs:{label:"会员折扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后会员折扣,会员购买此商品可以享受会员等级折扣价"}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_enable_grade",{initialValue:1,rules:[{required:!0}]}],expression:"['is_enable_grade', { initialValue: 1, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:1}},[e._v("开启")]),a("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_enable_grade"),expression:"form.getFieldValue('is_enable_grade')"}],attrs:{label:"会员折扣设置",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_alone_grade",{initialValue:0,rules:[{required:!0}]}],expression:"['is_alone_grade', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:0}},[e._v("默认等级折扣")]),a("a-radio",{attrs:{value:1}},[e._v("单独设置折扣")])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_alone_grade"),expression:"form.getFieldValue('is_alone_grade')"}]},e._l(e.formData.userGradeList,(function(t){return a("a-form-item",{key:t.grade_id},[a("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["alone_grade_equity[grade_id:".concat(t.grade_id,"]"),{initialValue:e.formData.defaultUserGradeValue[t.grade_id],rules:[{required:!0,message:"折扣率不能为空"}]}],expression:"[`alone_grade_equity[grade_id:${item.grade_id}]`, {\n initialValue: formData.defaultUserGradeValue[item.grade_id], rules: [{ required: true, message: '折扣率不能为空' }]\n }]"}],attrs:{addonBefore:t.name,addonAfter:"折",inputProps:{min:0,max:9.9}}})],1)})),1),a("div",{staticClass:"form-item-help"},[e.form.getFieldValue("is_alone_grade")?a("p",{staticClass:"extra"},[e._v("单独折扣:折扣率范围0.0-9.9,例如: 9.8代表98折,0代表不折扣")]):a("p",{staticClass:"extra"},[e._v("默认折扣:默认为用户所属会员等级的折扣率")])])],1)],1),a("div",[a("a-divider",{attrs:{orientation:"left"}},[e._v("分销设置")]),a("a-form-item",{attrs:{label:"分销佣金",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_ind_dealer",{initialValue:0,rules:[{required:!0}]}],expression:"['is_ind_dealer', { initialValue: 0, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:0}},[e._v("系统默认")]),a("a-radio",{attrs:{value:1}},[e._v("单独设置")])],1),a("div",{staticClass:"form-item-help"},[a("p",{staticClass:"extra"},[e._v("若使用分销功能必须在 [分销中心 - 分销设置] 中开启")])])],1),a("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_dealer"),expression:"form.getFieldValue('is_ind_dealer')"}],attrs:{label:"分销佣金类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[a("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["dealer_money_type",{initialValue:10,rules:[{required:!0}]}],expression:"['dealer_money_type', { initialValue: 10, rules: [{ required: true }] }]"}],on:{change:function(a){return e.onForceUpdate(!0)}}},[a("a-radio",{attrs:{value:10}},[e._v("百分比")]),a("a-radio",{attrs:{value:20}},[e._v("固定金额")])],1),e._l(e.formData.dealer.levelList,(function(t,r){return a("a-form-item",{key:r},[a("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:[t.value,{rules:[{required:!0,message:"佣金不能为空"}]}],expression:"[item.value, { rules: [{ required: true, message: '佣金不能为空'}] }]"}],attrs:{addonBefore:t.name,addonAfter:10==e.form.getFieldValue("dealer_money_type")?"%":"元",inputProps:{min:0,precision:2}}})],1)}))],2)],1)],1)]),a("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[a("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},i=[],o=(t("d81d"),t("b64b"),t("d3b7"),t("d084")),s=t("2af9"),l=t("e1fe4"),n=t("a119"),u=t("ca00"),d={components:{GoodsType:n["a"],SelectImage:s["f"],SelectVideo:s["g"],Ueditor:s["h"],InputNumberGroup:s["d"],MultiSpec:n["b"]},data:function(){return{tabKey:0,labelCol:{span:3},wrapperCol:{span:10},isLoading:!1,isBtnLoading:!1,form:this.$form.createForm(this),goodsId:null,formData:l["a"].formData}},created:function(){this.initData()},beforeDestroy:function(){l["a"].formData.goods={}},methods:{initData:function(){var e=this;this.goodsId=this.$route.query.goodsId,this.isLoading=!0,l["a"].getFromData(this.goodsId).then((function(){Object(u["f"])(e.form.getFieldsValue())||(e.form.setFieldsValue(l["a"].getFieldsValue()),e.$nextTick((function(){e.form.setFieldsValue(l["a"].getFieldsValue2()),e.onForceUpdate()}))),e.isLoading=!1}))},onForceUpdate:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$forceUpdate(),a&&setTimeout((function(){e.$forceUpdate()}),10)},handleTabs:function(e){this.tabKey=e},onReloadCategoryList:function(){var e=this;this.isLoading=!0,l["a"].getCategoryList().then((function(){e.isLoading=!1}))},onReloadServiceList:function(){var e=this;this.isLoading=!0,l["a"].getServiceList().then((function(){e.isLoading=!1}))},onReloadDeliveryList:function(){var e=this;this.isLoading=!0,l["a"].getDeliveryList().then((function(){e.isLoading=!1}))},handleSubmit:function(e){var a=this;e.preventDefault();var t=this.form.validateFields;t((function(e,t){if(e)return a.onTargetTabError(e),!1;if(20===t.spec_type){var r=a.$refs.MultiSpec;if(!r.verifyForm())return a.tabKey=1,!1;t.specData=r.getFromSpecData()}return t.categoryIds=t.categorys.map((function(e){return e.value})),delete t.categorys,a.onFormSubmit(t),!0}))},onTargetTabError:function(e){var a=[["goods_type","goods_name","categorys","imagesIds","delivery_id","is_ind_delivery_type","delivery_type"],["spec_type","goods_price","is_restrict","restrict_total","restrict_single"],["content"],["alone_grade_equity","first_money","second_money","third_money"]],t=Object.keys(e).shift();for(var r in a)if(a[r].indexOf(t)>-1){this.tabKey=parseInt(r);break}},onFormSubmit:function(e){var a=this;this.isLoading=!0,this.isBtnLoading=!0,o["a"]({form:e}).then((function(e){a.$message.success(e.message,1.5),setTimeout((function(){a.$router.push("./index")}),1500)})).catch((function(){a.isBtnLoading=!1})).finally((function(){return a.isLoading=!1}))}}},c=d,p=(t("0758"),t("2877")),m=Object(p["a"])(c,r,i,!1,null,"b748eeb6",null);a["default"]=m.exports},f09f:function(e,a,t){"use strict";t.r(a);t("b0c0");var r=function(){var e=this,a=e._self._c;return a("a-card",{attrs:{bordered:!1}},[a("content-header",{attrs:{title:e.$route.meta.title}}),a("div",{staticClass:"table-operator"},[a("a-row",{staticClass:"row-item-search"},[a("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[a("a-form-item",{attrs:{label:"渠道"}},[a("a-select",{staticStyle:{width:"120px"},attrs:{placeholder:"请选择"},on:{change:e.getChannel}},e._l(e.checkList,(function(t){return a("a-select-option",{key:t.id,attrs:{value:t.id}},[e._v(" "+e._s(t.name)+" ")])})),1)],1),a("a-form-item",{attrs:{label:"商品名称"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsName"],expression:"['goodsName']"}],attrs:{placeholder:"请输入商品名称"}})],1),a("a-form-item",{attrs:{label:"商品编码"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsNo"],expression:"['goodsNo']"}],attrs:{placeholder:"请输入商品编码"}})],1),a("a-form-item",{attrs:{label:"商品分类"}},[a("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["categoryId",{initialValue:0}],expression:"['categoryId', { initialValue: 0 }]"}],attrs:{treeData:e.categoryListTree,dropdownStyle:{maxHeight:"500px",overflow:"auto"},allowClear:""}})],1),a("a-form-item",{staticClass:"search-btn"},[a("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),a("div",{staticClass:"row-item-tab clearfix"},[a("div",{staticClass:"tab-list fl-l"},[a("a-radio-group",{attrs:{defaultValue:e.queryParam.listType},on:{change:e.handleTabs}},[a("a-radio-button",{attrs:{value:"all"}},[e._v("全部")]),a("a-radio-button",{attrs:{value:"on_sale"}},[e._v("出售中")]),a("a-radio-button",{attrs:{value:"off_sale"}},[e._v("已下架")]),a("a-radio-button",{attrs:{value:"sold_out"}},[e._v("已售罄")])],1)],1),a("a-button",{staticClass:"fl-l",attrs:{type:"primary",icon:"plus"},on:{click:function(a){return e.handleCreate()}}},[e._v("创建商品")]),a("a-button",{staticClass:"fl-l",attrs:{icon:"arrow-up"},on:{click:function(a){return e.handleImport()}}},[e._v("批量导入")]),e.selectedRowKeys.length?a("div",{staticClass:"button-group"},[a("a-button-group",{staticClass:"ml-10"},[a("a-button",{attrs:{icon:"arrow-up"},on:{click:function(a){return e.handleUpdateStatus(e.selectedRowKeys,!0)}}},[e._v("上架")]),a("a-button",{attrs:{icon:"arrow-down"},on:{click:function(a){return e.handleUpdateStatus(e.selectedRowKeys,!1)}}},[e._v("下架")]),a("a-button",{attrs:{icon:"delete"},on:{click:function(a){return e.handleDelete(e.selectedRowKeys)}}},[e._v("删除")])],1)],1):e._e()],1)],1),a("s-table",{ref:"table",attrs:{rowKey:"goods_id",loading:e.isLoading,columns:e.columns,data:e.loadData,rowSelection:e.rowSelection,pageSize:15},scopedSlots:e._u([{key:"goods_image",fn:function(e){return a("span",{},[a("a",{attrs:{title:"点击查看原图",href:e,target:"_blank"}},[a("img",{attrs:{width:"50",height:"50",src:e,alt:"商品图片"}})])])}},{key:"goods_name",fn:function(t){return a("span",{},[a("p",{staticClass:"twoline-hide",staticStyle:{width:"270px"}},[e._v(e._s(t))])])}},{key:"status",fn:function(t,r){return a("span",{},[a("a-tag",{staticClass:"cur-p",attrs:{color:10==t?"green":"red"},on:{click:function(a){return e.handleUpdateStatus([r.goods_id],10!=t)}}},[e._v(e._s(10==t?"上架":"下架"))])],1)}},{key:"action",fn:function(t,r){return a("div",{staticClass:"actions"},[a("router-link",{attrs:{to:{path:"/goods/update",query:{goodsId:r.goods_id}}}},[e._v("编辑")]),a("router-link",{attrs:{to:{path:"/goods/copy",query:{goodsId:r.goods_id}}}},[e._v("复制")]),a("a",{on:{click:function(a){return e.handleDelete([r.goods_id])}}},[e._v("删除")])],1)}}])})],1)},i=[],o=t("5530"),s=(t("4e82"),t("d3b7"),t("159b"),t("b64b"),t("d084")),l=t("2af9"),n=t("8243"),u=t("73f5"),d=[{title:"商品ID",dataIndex:"goods_id",sorter:!0},{title:"渠道",dataIndex:"channel_name",width:"60px"},{title:"商品图片",dataIndex:"goods_image",scopedSlots:{customRender:"goods_image"}},{title:"商品名称",dataIndex:"goods_name",width:"270px",scopedSlots:{customRender:"goods_name"}},{title:"商品价格",dataIndex:"goods_price_min",scopedSlots:{customRender:"goods_price_min"},sorter:!0},{title:"商品利润",dataIndex:"profit",sorter:!0},{title:"商品利润率",dataIndex:"profit_rate",sorter:!0},{title:"库存总量",dataIndex:"stock_total",sorter:!0},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"添加时间",width:"180px",dataIndex:"create_time",sorter:!0},{title:"操作",dataIndex:"action",width:"150px",scopedSlots:{customRender:"action"}}],c={name:"Index",components:{ContentHeader:l["a"],STable:l["e"]},data:function(){var e=this;return{searchForm:this.$form.createForm(this),categoryListTree:[],queryParam:{listType:"all",channel:""},isLoading:!1,columns:d,selectedRowKeys:[],loadData:function(a){var t=Object(o["a"])(Object(o["a"])({},a),e.queryParam),r={ascend:"asc",descend:"desc"};return t.sortField&&t.sortOrder&&r[t.sortOrder]?(t.sort=t.sortField,t.order=r[t.sortOrder],delete t.sortField,delete t.sortOrder):(delete t.sortField,delete t.sortOrder),s["e"](t).then((function(e){return e.data.list}))},checkList:[]}},created:function(){this.getDataList(),this.$route.query.listType&&(this.queryParam.listType=this.$route.query.listType),this.getCategoryList()},computed:{rowSelection:function(){return{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}}},methods:{onSelectChange:function(e){this.selectedRowKeys=e},handleTabs:function(e){this.queryParam.listType=e.target.value,this.handleRefresh(!0)},handleSearch:function(e){var a=this;e.preventDefault(),this.searchForm.validateFields((function(e,t){e||(a.queryParam=Object(o["a"])(Object(o["a"])({},a.queryParam),t),a.handleRefresh(!0))}))},handleReset:function(){this.searchForm.resetFields()},getDataList:function(){var e=this;return u["c"]().then((function(a){var t=a.data;Object.keys(t).forEach((function(a){e.checkList.push({id:a,name:t[a]})}))}))},getChannel:function(e){this.queryParam.channel=e},getCategoryList:function(){var e=this;this.isLoading=!0,n["a"].getListFromScreen().then((function(a){e.categoryListTree=a})).finally((function(){return e.isLoading=!1}))},handleUpdateStatus:function(e){var a=this,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.isLoading=!0,s["f"]({goodsIds:e,state:t}).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(e){a.isLoading=!1}))},handleDelete:function(e){var a=this,t=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return s["b"]({goodsIds:e}).then((function(e){a.$message.success(e.message,1.5),a.handleRefresh()})).finally((function(e){return t.destroy()}))}})},handleCreate:function(){this.$router.push("/goods/create")},handleImport:function(){this.$router.push("/goods/import/batch")},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.selectedRowKeys=[],this.$refs.table.refresh(e)}}},p=c,m=(t("f7cf"),t("2877")),v=Object(m["a"])(p,r,i,!1,null,"00f58ecd",null);a["default"]=v.exports},f7cf:function(e,a,t){"use strict";t("02a9")}}]);