(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["goods"],{"0151":function(e,t,a){},"03dd1":function(e,t,a){"use strict";a("cc01")},"0b8b":function(e,t,a){},1788:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"商品名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsName"],expression:"['goodsName']"}],attrs:{placeholder:"请输入商品名称"}})],1),t("a-form-item",{attrs:{label:"商品编码"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsNo"],expression:"['goodsNo']"}],attrs:{placeholder:"请输入商品编码"}})],1),t("a-form-item",{attrs:{label:"商品分类"}},[t("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),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),t("div",{staticClass:"row-item-tab clearfix"},[t("div",{staticClass:"tab-list fl-l"},[t("a-radio-group",{attrs:{defaultValue:e.queryParam.listType},on:{change:e.handleTabs}},[t("a-radio-button",{attrs:{value:"all"}},[e._v("全部")]),t("a-radio-button",{attrs:{value:"on_sale"}},[e._v("出售中")]),t("a-radio-button",{attrs:{value:"off_sale"}},[e._v("已下架")]),t("a-radio-button",{attrs:{value:"sold_out"}},[e._v("已售罄")])],1)],1),e.$auth("/goods/create")?t("a-button",{staticClass:"fl-l",attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.handleCreate()}}},[e._v("创建商品")]):e._e(),e.$module("goods-import")&&e.$auth("/goods/import/batch")?t("a-button",{staticClass:"fl-l",attrs:{icon:"arrow-up"},on:{click:function(t){return e.handleImport()}}},[e._v("批量导入")]):e._e(),e.selectedRowKeys.length?t("div",{staticClass:"button-group"},[t("a-button-group",{staticClass:"ml-10"},[t("a-button",{directives:[{name:"action",rawName:"v-action:status",arg:"status"}],attrs:{icon:"arrow-up"},on:{click:function(t){return e.handleUpdateStatus(e.selectedRowKeys,!0)}}},[e._v("上架")]),t("a-button",{directives:[{name:"action",rawName:"v-action:status",arg:"status"}],attrs:{icon:"arrow-down"},on:{click:function(t){return e.handleUpdateStatus(e.selectedRowKeys,!1)}}},[e._v("下架")]),t("a-button",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],attrs:{icon:"delete"},on:{click:function(t){return e.handleDelete(e.selectedRowKeys)}}},[e._v("删除")])],1)],1):e._e()],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"goods_id",loading:e.isLoading,columns:e.columns,data:e.loadData,rowSelection:e.rowSelection,pagination:e.pagination,scroll:{x:1450}},scopedSlots:e._u([{key:"goods_image",fn:function(e){return t("span",{},[t("a",{attrs:{title:"点击查看原图",href:e,target:"_blank"}},[t("img",{attrs:{width:"50",height:"50",src:e,alt:"商品图片"}})])])}},{key:"goods_name",fn:function(a){return t("span",{},[t("p",{staticClass:"twoline-hide",staticStyle:{width:"270px"}},[e._v(e._s(a))])])}},{key:"status",fn:function(a,r){return t("span",{},[t("a-tag",{staticClass:"cur-p",attrs:{color:10==a?"green":"red"},on:{click:function(t){return e.handleUpdateStatus([r.goods_id],10!=a)}}},[e._v(e._s(10==a?"上架":"下架"))])],1)}},{key:"action",fn:function(a,r){return t("div",{staticClass:"actions"},[e.$auth("/goods/update")?t("router-link",{attrs:{to:{path:"/goods/update",query:{goodsId:r.goods_id}}}},[e._v("编辑")]):e._e(),e.$module("goods-copy")&&e.$auth("/goods/copy")?t("router-link",{attrs:{to:{path:"/goods/copy",query:{goodsId:r.goods_id}}}},[e._v("复制")]):e._e(),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete([r.goods_id])}}},[e._v("删除")])],1)}}])})],1)},i=[],o=a("5530"),s=(a("d3b7"),a("d084")),l=a("2af9"),n=a("8243"),u=[{title:"商品ID",dataIndex:"goods_id"},{title:"商品图片",dataIndex:"goods_image",scopedSlots:{customRender:"goods_image"}},{title:"商品名称",dataIndex:"goods_name",width:"302px",scopedSlots:{customRender:"goods_name"}},{title:"商品价格",dataIndex:"goods_price_min",scopedSlots:{customRender:"goods_price_min"}},{title:"成本价",dataIndex:"cost_price",scopedSlots:{customRender:"cost_price"}},{title:"总销量",dataIndex:"sales_actual"},{title:"库存总量",dataIndex:"stock_total"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"添加时间",width:"180px",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"150px",scopedSlots:{customRender:"action"}}],d={name:"Index",components:{ContentHeader:l["a"],STable:l["d"]},data:function(){var e=this;return{searchForm:this.$form.createForm(this),categoryListTree:[],queryParam:{listType:"all"},isLoading:!1,columns:u,selectedRowKeys:[],loadData:function(t){return s["f"](Object(o["a"])(Object(o["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){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 t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(o["a"])(Object(o["a"])({},t.queryParam),a),t.handleRefresh(!0))}))},handleReset:function(){this.searchForm.resetFields()},getCategoryList:function(){var e=this;this.isLoading=!0,n["a"].getListFromScreen().then((function(t){e.categoryListTree=t})).finally((function(){return e.isLoading=!1}))},handleUpdateStatus:function(e){var t=this,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.$auth("/goods/index.status"))return!1;this.isLoading=!0,s["h"]({goodsIds:e,state:a}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){t.isLoading=!1}))},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return s["c"]({goodsIds:e}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.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)}}},c=d,m=(a("03dd1"),a("2877")),p=Object(m["a"])(c,r,i,!1,null,"430dc8c5",null);t["default"]=p.exports},1827:function(e,t,a){"use strict";a.d(t,"c",(function(){return o})),a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return l}));var r=a("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})}},"19d3":function(e,t,a){"use strict";a.d(t,"e",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"a",(function(){return l})),a.d(t,"d",(function(){return n})),a.d(t,"c",(function(){return u}));var r=a("b775"),i={list:"/goods.service/list",all:"/goods.service/all",add:"/goods.service/add",edit:"/goods.service/edit",delete:"/goods.service/delete"};function o(e){return Object(r["b"])({url:i.list,method:"get",params:e})}function s(e){return Object(r["b"])({url:i.all,method:"get",params:e})}function l(e){return Object(r["b"])({url:i.add,method:"post",data:e})}function n(e){return Object(r["b"])({url:i.edit,method:"post",data:e})}function u(e){return Object(r["b"])({url:i.delete,method:"post",data:e})}},"1c6a":function(e,t,a){"use strict";a("ea64")},"1da1":function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));a("d3b7");function r(e,t,a,r,i,o,s){try{var l=e[o](s),n=l.value}catch(u){return void a(u)}l.done?t(n):Promise.resolve(n).then(r,i)}function i(e){return function(){var t=this,a=arguments;return new Promise((function(i,o){var s=e.apply(t,a);function l(e){r(s,i,o,l,n,"next",e)}function n(e){r(s,i,o,l,n,"throw",e)}l(void 0)}))}}},3686:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-button",{directives:[{name:"action",rawName:"v-action:add",arg:"add"}],attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),e.isLoading?e._e():t("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(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"显示":"隐藏"))])],1)}},{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}],null,!1,1032135766)}),t("AddForm",{ref:"AddForm",attrs:{categoryList:e.categoryList},on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",attrs:{categoryList:e.categoryList},on:{handleSubmit:e.handleRefresh}})],1)},i=[],o=(a("d3b7"),a("2f71")),s=a("2af9"),l=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"新增商品分类",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1,destroyOnClose:!0},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"分类名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"上级分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"分类图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["image_id"],expression:"['image_id']"}]})],1),t("a-form-item",{attrs:{label:"是否加入排行榜",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否加入排行榜"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("不加入")]),t("a-radio",{attrs:{value:1}},[e._v("加入")])],1)],1),t("a-form-item",{attrs:{label:"排行榜图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["rank_image_id"],expression:"['rank_image_id']"}]})],1),t("a-form-item",{attrs:{label:"是否热门",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否热门"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否大牌正品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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=(a("99af"),a("8243")),d={components:{SelectImage:s["i"]},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,t=u["a"].formatTreeData(e);this.categoryListTree=[{title:"顶级分类",key:0,value:0}].concat(t)},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,o["a"]({form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},c=d,m=a("2877"),p=Object(m["a"])(c,l,n,!1,null,null,null),v=p.exports,f=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"编辑商品分类",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1,destroyOnClose:!0},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"分类名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"上级分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"分类图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["image_id"],expression:"['image_id']"}],attrs:{defaultList:e.record.image?[e.record.image]:[]}})],1),t("a-form-item",{attrs:{label:"是否加入排行榜",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否加入排行榜"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("不加入")]),t("a-radio",{attrs:{value:1}},[e._v("加入")])],1)],1),t("a-form-item",{attrs:{label:"排行榜图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["rank_image_id"],expression:"['rank_image_id']"}],attrs:{defaultList:e.record.rankimage?[e.record.rankimage]:[]}})],1),t("a-form-item",{attrs:{label:"是否热门",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"是否热门"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否大牌正品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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)},h=[],g=a("2ef0"),_=a.n(g),b={components:{SelectImage:s["i"]},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,t=this.form.setFieldsValue;this.$nextTick((function(){t(_.a.pick(e,["name","parent_id","image_id","status","sort","is_paihang","rank_image_id","is_hot","is_in_store","is_brand"]))}))},getCategoryList:function(){var e=this.categoryList,t=u["a"].formatTreeData(e);this.categoryListTree=[{title:"顶级分类",key:0,value:0}].concat(t)},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,o["c"]({categoryId:this.record["category_id"],form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},C=b,w=Object(m["a"])(C,f,h,!1,null,null,null),y=w.exports,x={name:"Index",components:{STable:s["d"],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 t=this;e&&(this.isLoading=!0),o["d"]().then((function(e){t.categoryList=e.data.list})).finally((function(){return t.isLoading=!1}))},handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return o["b"]({categoryId:e["category_id"]}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){this.getCategoryList()}}},L=x,S=Object(m["a"])(L,r,i,!1,null,null,null);t["default"]=S.exports},4547:function(e,t,a){},"48d0":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.pageTitle))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"导入状态"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:-1}],expression:"['status', { initialValue: -1 }]"}]},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),e._l(e.ImportStatusEnum.data,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.value}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),t("div",{staticClass:"row-item-tab clearfix"},[e.$auth("/goods/import/batch")?t("a-button",{staticClass:"fl-l",attrs:{type:"primary",icon:"arrow-up"},on:{click:function(t){return e.handleImport()}}},[e._v("批量导入")]):e._e()],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"id",loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination},scopedSlots:e._u([{key:"start_time",fn:function(a){return[t("span",[e._v(e._s(a||"--"))])]}},{key:"end_time",fn:function(a){return[t("span",[e._v(e._s(a||"--"))])]}},{key:"status",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:e.ImportStatusColorEnum[a]}},[e._v(e._s(e.ImportStatusEnum[a].name))])],1)}},{key:"action",fn:function(a,r){return t("span",{staticClass:"actions"},[t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")]),r.fail_count>0?t("a",{on:{click:function(t){return e.handleFailLog(r)}}},[e._v("失败日志")]):e._e()])}}])}),t("a-modal",{attrs:{title:"失败日志"},on:{ok:function(t){e.visibleFailLog=!1}},model:{value:e.visibleFailLog,callback:function(t){e.visibleFailLog=t},expression:"visibleFailLog"}},[t("div",{staticClass:"modal-content"},e._l(e.failLogContent,(function(a,r){return t("p",{key:r,staticClass:"log-item"},[t("span",{staticClass:"mr-5"},[e._v("序号["+e._s(a.goodsSn)+"]")]),t("span",[e._v(e._s(a.message))])])})),0)])],1)},i=[],o=a("5530"),s=a("ade3"),l=(a("d3b7"),a("1827")),n=a("2af9"),u=a("59aa"),d=Object(s["a"])(Object(s["a"])({},u["c"].NORMAL.value,""),u["c"].COMPLETED.value,"green"),c={name:"Index",components:{STable:n["d"]},data:function(){var e=this;return{searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,ImportStatusEnum:u["c"],ImportStatusColorEnum:d,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(t){return l["c"](Object(o["a"])(Object(o["a"])({},t),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 t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return l["b"]({id:e["id"]}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.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 t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(o["a"])(Object(o["a"])({},t.queryParam),a),t.handleRefresh(!0))}))}}},m=c,p=(a("b328"),a("2877")),v=Object(p["a"])(m,r,i,!1,null,"fc4eac74",null);t["default"]=v.exports},"540d":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[t("span",[e._v(e._s(e.$route.meta.pageTitle))])]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("div",{staticClass:"container"},[t("div",{staticClass:"upload-dragger"},[t("a-upload-dragger",{attrs:{accept:".xls, .xlsx",multiple:!1,fileList:e.fileList,showUploadList:!1,beforeUpload:e.beforeUpload,remove:e.handleRemove}},[t("p",{staticClass:"ant-upload-drag-icon"},[t("a-icon",{attrs:{type:"cloud-upload"}})],1),e.fileList.length?t("div",[t("p",{staticClass:"ant-upload-text"},[t("span",[e._v(e._s(e.fileList[0].name))]),t("a",{staticClass:"ml-10",attrs:{href:"javascript:void(0);"},on:{click:function(t){return t.stopPropagation(),e.handleRemove(e.fileList[0])}}},[e._v("删除")])]),t("a-button",{staticClass:"mt-20",attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),e.onFormSubmit.apply(null,arguments)}}},[e._v("立即导入")])],1):t("div",[t("p",{staticClass:"ant-upload-text"},[e._v("点击选择文件,或者将文件拖拽至此区域")]),t("p",{staticClass:"ant-upload-hint"},[e._v("仅支持 .xls, .xlsx 格式的excel文件,限2M以内")])])])],1),t("div",{staticClass:"import-explain"},[t("h2",{staticClass:"title"},[e._v("导入说明")]),t("a-timeline",{staticClass:"timeline"},[t("a-timeline-item",{staticClass:"timeline-item"},[t("p",{staticClass:"name"},[e._v("下载模板")]),t("ul",{staticClass:"content"},[t("li",{staticClass:"content-li"},[t("span",[e._v("批量导入商品需要系统开启队列服务,可在超管后台中查看是否开启")])]),t("li",{staticClass:"content-li"},[t("span",{staticClass:"mr-5"},[e._v("商品导入前需要您用Excel整理需要导入的商品资料,请先")]),t("a",{attrs:{href:"static/template/batch-goods.xlsx",target:"_blank"}},[e._v("下载商品导入模板")])])])]),t("a-timeline-item",{staticClass:"timeline-item"},[t("p",{staticClass:"name"},[e._v("使用模板")]),t("ul",{staticClass:"content"},[t("li",{staticClass:"content-li"},[t("span",[e._v("模板中最多不能超过500个商品,如超过500个商品,请分批导入")])]),t("li",{staticClass:"content-li"},[t("span",[e._v("模板中的字段含义以及填写规则,可查看模板文件中标题栏的标注")])])])]),t("a-timeline-item",{staticClass:"timeline-item"},[t("p",{staticClass:"name"},[e._v("上传图片")]),t("ul",{staticClass:"content"},[t("li",{staticClass:"content-li"},[t("span",[e._v('需提前在后台上传商品图片,然后填写到模板文件的 "商品图片" 列中')])]),t("li",{staticClass:"content-li"},[t("span",{staticClass:"mr-5"},[e._v("通过文件库上传图片,并复制图片ID集")]),t("a",{attrs:{href:"javascript:void(0);"},on:{click:function(t){return e.handleSelectImage()}}},[e._v("点击上传图片")])])])])],1)],1),t("FilesModal",{ref:"FilesModal",attrs:{multiple:!0,maxNum:10,actions:["delete","move","copyIds"]}})],1)])],1)},i=[],o=(a("a434"),a("d3b7"),a("1827")),s=a("fd0d"),l={components:{FilesModal:s["e"]},data:function(){return{isLoading:!1,fileList:[],uploadSizeLimit:"2"}},created:function(){},methods:{handleSelectImage:function(){this.$refs.FilesModal.show()},beforeUpload:function(e){var t=e.size/1024/1024;return t>this.uploadSizeLimit?(this.$message.error("上传的文件大小不能超出".concat(this.uploadSizeLimit,"MB")),!1):(this.fileList=[e],!1)},handleRemove:function(e){var t=this.fileList,a=t.indexOf(e);a>-1&&t.splice(a,1)},onFormSubmit:function(){var e=this,t=this.fileList,a=new FormData;a.append("file",t[0]),this.isLoading=!0,o["a"](a).then((function(t){e.fileList=[],e.$message.success(t.message,1.8),setTimeout((function(){return e.$router.push("/goods/import/list")}),1500)})).finally((function(){return e.isLoading=!1}))}}},n=l,u=(a("b753"),a("2877")),d=Object(u["a"])(n,r,i,!1,null,"152bc87a",null);t["default"]=d.exports},5633:function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[t("a-tabs",{attrs:{activeKey:e.tabKey,tabBarStyle:{marginBottom:"30px"}},on:{change:e.handleTabs}},[t("a-tab-pane",{key:0,attrs:{tab:"基本信息"}}),t("a-tab-pane",{key:1,attrs:{tab:"规格/库存"}}),t("a-tab-pane",{key:2,attrs:{tab:"商品详情"}}),t("a-tab-pane",{key:3,attrs:{tab:"更多设置"}})],1),t("div",{staticClass:"tabs-content"},[t("div",{directives:[{name:"show",rawName:"v-show",value:0==e.tabKey,expression:"tabKey == 0"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"商品类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}})],1),t("a-form-item",{attrs:{label:"商品名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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:""}}),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/goods/category/index"}}},[e._v("去新增")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadCategoryList}},[e._v("刷新")])],1)],1),t("a-form-item",{attrs:{label:"商品图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"}},[t("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),t("a-form-item",{attrs:{label:"商品编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_no"],expression:"['goods_no']"}],attrs:{placeholder:"请输入商品编码"}})],1),10==e.form.getFieldValue("goods_type")?t("a-form-item",{attrs:{label:"配送方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:0}},[e._v("系统默认")]),t("a-radio",{attrs:{value:1}},[e._v("单独配置")])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_delivery_type"),expression:"form.getFieldValue('is_ind_delivery_type')"}]},[t("a-form-item",{attrs:{extra:"需在 [设置 - 配送方式] 中,开启支持的配送方式才可生效"}},[t("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")?t("a-form-item",{attrs:{label:"运费模板",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(a,r){return t("a-select-option",{key:r,attrs:{value:a.delivery_id}},[e._v(e._s(a.name))])})),1),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/setting/delivery/template/create"}}},[e._v("新增模板")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadDeliveryList}},[e._v("刷新")])],1)],1):e._e(),t("a-form-item",{attrs:{label:"商品状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:10,rules:[{required:!0}]}],expression:"['status', { initialValue: 10, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("上架")]),t("a-radio",{attrs:{value:20}},[e._v("下架")])],1)],1),t("a-form-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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),t("div",{directives:[{name:"show",rawName:"v-show",value:1==e.tabKey,expression:"tabKey == 1"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"规格类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:10}},[e._v("单规格")]),t("a-radio",{attrs:{value:20}},[e._v("多规格")])],1)],1),20==e.form.getFieldValue("spec_type")?t("div",[t("MultiSpec",{ref:"MultiSpec",attrs:{defaultSpecList:e.formData.goods.specList,defaultSkuList:e.formData.goods.skuList}})],1):e._e(),10==e.form.getFieldValue("spec_type")?t("div",[t("a-form-item",{attrs:{label:"商品价格",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际购买金额,最低0.01"}},[t("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}}),t("span",{staticClass:"ml-10"},[e._v("元")])],1),t("a-form-item",{attrs:{label:"成本价",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"成本价仅用于商品页展示"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["cost_price"],expression:"['cost_price']"}],attrs:{min:0,precision:2}}),t("span",{staticClass:"ml-10"},[e._v("元")])],1),t("a-form-item",{attrs:{label:"当前库存数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际库存数量,为0时用户无法下单"}},[t("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}}),t("span",{staticClass:"ml-10"},[e._v("件")])],1),t("a-form-item",{attrs:{label:"商品重量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际重量,用于计算运费"}},[t("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}}),t("span",{staticClass:"ml-10"},[e._v("千克 (Kg)")])],1)],1):e._e(),t("a-form-item",{attrs:{label:"库存计算方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("下单减库存")]),t("a-radio",{attrs:{value:20}},[e._v("付款减库存")])],1)],1),t("a-form-item",{attrs:{label:"商品限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用于限制每人购买该商品的数量"}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:0}},[e._v("关闭")]),t("a-radio",{attrs:{value:1}},[e._v("开启")])],1),e.form.getFieldValue("is_restrict")?t("div",{staticClass:"mt-10"},[t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("总限购")]),t("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}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1),t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("每单限购")]),t("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}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:2==e.tabKey,expression:"tabKey == 2"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"商品详情",labelCol:e.labelCol,wrapperCol:{span:16}}},[t("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"商品详情不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"}]})],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:3==e.tabKey,expression:"tabKey == 3"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"主图视频",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议视频宽高比19:9,建议时长8-45秒"}},[t("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),t("a-form-item",{attrs:{label:"视频封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750像素*750像素"}},[t("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),t("a-form-item",{attrs:{label:"商品卖点",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"一句话简述,例如:此款商品美观大方 性价比较高 不容错过"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["selling_point"],expression:"['selling_point']"}],attrs:{placeholder:"请输入商品卖点"}})],1),t("a-form-item",{attrs:{label:"服务与承诺",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.formData.serviceList?t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["serviceIds"],expression:"['serviceIds']"}],attrs:{mode:"multiple",placeholder:"请选择服务与承诺"}},e._l(e.formData.serviceList,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.service_id}},[e._v(e._s(a.name))])})),1):e._e(),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/goods/service/index"}}},[e._v("去新增")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadServiceList}},[e._v("刷新")])],1)],1),t("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端展示的销量 = 初始销量 + 实际销量"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sales_initial",{initialValue:0}],expression:"['sales_initial', { initialValue: 0 }]"}]})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("market-points"),expression:"$module('market-points')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("积分设置")]),t("a-form-item",{attrs:{label:"积分赠送",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品将获得积分"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),t("a-form-item",{attrs:{label:"积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品可以使用积分进行抵扣"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("user-grade"),expression:"$module('user-grade')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("会员折扣设置")]),t("a-form-item",{attrs:{label:"会员折扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后会员折扣,会员购买此商品可以享受会员等级折扣价"}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),t("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}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:0}},[e._v("默认等级折扣")]),t("a-radio",{attrs:{value:1}},[e._v("单独设置折扣")])],1),t("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(a){return t("a-form-item",{key:a.grade_id},[t("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["alone_grade_equity[grade_id:".concat(a.grade_id,"]"),{initialValue:e.formData.defaultUserGradeValue[a.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:a.name,addonAfter:"折",inputProps:{min:0,max:9.9}}})],1)})),1),t("div",{staticClass:"form-item-help"},[e.form.getFieldValue("is_alone_grade")?t("p",{staticClass:"extra"},[e._v("单独折扣:折扣率范围0.0-9.9,例如: 9.8代表98折,0代表不折扣")]):t("p",{staticClass:"extra"},[e._v("默认折扣:默认为用户所属会员等级的折扣率")])])],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("apps-dealer"),expression:"$module('apps-dealer')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("分销设置")]),t("a-form-item",{attrs:{label:"分销佣金",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:0}},[e._v("系统默认")]),t("a-radio",{attrs:{value:1}},[e._v("单独设置")])],1),t("div",{staticClass:"form-item-help"},[t("p",{staticClass:"extra"},[e._v("若使用分销功能必须在 [分销中心 - 分销设置] 中开启")])])],1),t("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}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:10}},[e._v("百分比")]),t("a-radio",{attrs:{value:20}},[e._v("固定金额")])],1),e._l(e.formData.dealer.levelList,(function(a,r){return t("a-form-item",{key:r},[t("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:[a.value,{rules:[{required:!0,message:"佣金不能为空"}]}],expression:"[item.value, { rules: [{ required: true, message: '佣金不能为空'}] }]"}],attrs:{addonBefore:a.name,addonAfter:10==e.form.getFieldValue("dealer_money_type")?"%":"元",inputProps:{min:0,precision:2}}})],1)}))],2)],1)],1)]),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},i=[],o=(a("d81d"),a("b64b"),a("d3b7"),a("d084")),s=a("2af9"),l=a("e1fe"),n=a("b78d"),u=a("ca00"),d={components:{GoodsType:n["a"],SelectImage:s["i"],SelectVideo:s["o"],Ueditor:s["p"],InputNumberGroup:s["c"],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["g"])(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,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$forceUpdate(),t&&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 t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){if(e)return t.onTargetTabError(e),!1;if(20===a.spec_type){var r=t.$refs.MultiSpec;if(!r.verifyForm())return t.tabKey=1,!1;a.specData=r.getFromSpecData()}return a.categoryIds=a.categorys.map((function(e){return e.value})),delete a.categorys,t.onFormSubmit(a),!0}))},onTargetTabError:function(e){var t=[["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"]],a=Object.keys(e).shift();for(var r in t)if(t[r].indexOf(a)>-1){this.tabKey=parseInt(r);break}},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,o["a"]({form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){t.$router.push("./index")}),1500)})).catch((function(){t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))}}},c=d,m=(a("82f7"),a("2877")),p=Object(m["a"])(c,r,i,!1,null,"6f06abc4",null);t["default"]=p.exports},"59aa":function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return o})),a.d(t,"a",(function(){return s}));var r=a("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}])),s=new r["a"]([{key:"NORMAL",name:"进行中",value:10},{key:"COMPLETED",name:"采集完成",value:20}])},"6cfa":function(e,t,a){"use strict";a("0b8b")},"7b70":function(e,t,a){"use strict";a("f3b9")},8116:function(e,t,a){},"82f7":function(e,t,a){"use strict";a("0151")},"88bc":function(e,t,a){(function(t){var a=1/0,r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object GeneratorFunction]",l="[object Symbol]",n="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,d=n||u||Function("return this")();function c(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}function m(e,t){var a=-1,r=e?e.length:0,i=Array(r);while(++a0&&a(l)?t>1?w(l,t-1,a,r,i):p(i,l):r||(i[i.length]=l)}return i}function y(e,t){return e=Object(e),x(e,t,(function(t,a){return a in e}))}function x(e,t,a){var r=-1,i=t.length,o={};while(++r-1&&e%1==0&&e<=r}function $(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function O(e){return!!e&&"object"==typeof e}function j(e){return"symbol"==typeof e||O(e)&&h.call(e)==l}var R=L((function(e,t){return null==e?{}:y(e,m(w(t,1),k))}));e.exports=R}).call(this,a("c8ba"))},8951:function(e,t,a){},"967a":function(e,t,a){"use strict";a.d(t,"f",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"d",(function(){return l})),a.d(t,"a",(function(){return n})),a.d(t,"e",(function(){return u})),a.d(t,"c",(function(){return d}));var r=a("b775"),i={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 o(e){return Object(r["b"])({url:i.list,method:"get",params:e})}function s(e){return Object(r["b"])({url:i.all,method:"get",params:e})}function l(e){return Object(r["b"])({url:i.detail,method:"get",params:e})}function n(e){return Object(r["b"])({url:i.add,method:"post",data:e})}function u(e){return Object(r["b"])({url:i.edit,method:"post",data:e})}function d(e){return Object(r["b"])({url:i.delete,method:"post",data:e})}},ac3c:function(e,t,a){"use strict";a("8116")},acbe:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"商品名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsName"],expression:"['goodsName']"}],attrs:{placeholder:"请输入商品名称/编码"}})],1),t("a-form-item",{attrs:{label:"订单号"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["orderNo"],expression:"['orderNo']"}],attrs:{placeholder:"请输入订单号"}})],1),t("a-form-item",{attrs:{label:"会员ID"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["userId"],expression:"['userId']"}],attrs:{placeholder:"请输入会员ID"}})],1),t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:-1}],expression:"['status', { initialValue: -1 }]"}]},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),t("a-select-option",{attrs:{value:1}},[e._v("显示")]),t("a-select-option",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),t("div",{staticClass:"row-item-tab clearfix"},[t("div",{staticClass:"tab-list fl-l"},[t("a-radio-group",{attrs:{defaultValue:e.queryParam.score},on:{change:e.handleTabs}},[t("a-radio-button",{attrs:{value:0}},[e._v("全部")]),t("a-radio-button",{attrs:{value:10}},[e._v("好评")]),t("a-radio-button",{attrs:{value:20}},[e._v("中评")]),t("a-radio-button",{attrs:{value:30}},[e._v("差评")])],1)],1)])],1),t("s-table",{ref:"table",attrs:{rowKey:"comment_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination,scroll:{x:1450}},scopedSlots:e._u([{key:"orderGoods",fn:function(e){return t("span",{},[t("GoodsItem",{attrs:{data:{image:e.goods_image,imageAlt:"商品图片",title:e.goods_name,goodsProps:e.goods_props}}})],1)}},{key:"user",fn:function(e){return t("span",{},[t("UserItem",{attrs:{user:e}})],1)}},{key:"score",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:{10:"green",20:"",30:"red"}[a]}},[e._v(e._s({10:"好评",20:"中评",30:"差评"}[a]))])],1)}},{key:"content",fn:function(a){return t("span",{},[t("p",{staticClass:"twoline-hide",staticStyle:{width:"260px"}},[e._v(e._s(a))])])}},{key:"is_picture",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"是":"否"))])],1)}},{key:"status",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"显示":"隐藏"))])],1)}},{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}])}),t("EditForm",{ref:"EditForm",on:{handleSubmit:e.handleRefresh}})],1)},i=[],o=a("5530"),s=(a("d3b7"),a("b775")),l={list:"/goods.comment/list",detail:"/goods.comment/detail",edit:"/goods.comment/edit",delete:"/goods.comment/delete"};function n(e){return Object(s["b"])({url:l.list,method:"get",params:e})}function u(e){return Object(s["b"])({url:l.detail,method:"get",params:e})}function d(e){return Object(s["b"])({url:l.edit,method:"post",data:e})}function c(e){return Object(s["b"])({url:l.delete,method:"post",data:e})}var m=a("ab09"),p=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1,destroyOnClose:!0},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"评分",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["score",{initialValue:10,rules:[{required:!0}]}],expression:"['score', { initialValue: 10, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("好评")]),t("a-radio",{attrs:{value:20}},[e._v("中评")]),t("a-radio",{attrs:{value:30}},[e._v("差评")])],1)],1),t("a-form-item",{attrs:{label:"评价内容",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["content"],expression:"['content']"}],attrs:{placeholder:"请输入评价内容 (300个字符以内)",autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"评价图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"最多允许6张,可拖拽调整显示顺序"}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["imageIds"],expression:"['imageIds']"}],attrs:{multiple:"",maxNum:6,defaultList:e.record.imageList}})],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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)},v=[],f=a("88bc"),h=a.n(f),g=a("2af9"),_={components:{SelectImage:g["i"]},data:function(){return{title:"编辑评价",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),commentId:null,record:{}}},methods:{edit:function(e){this.visible=!0,this.commentId=e,this.getRecordData()},getRecordData:function(){var e=this;this.confirmLoading=!0,u({commentId:this.commentId}).then((function(t){e.record=t.data.detail,e.setFieldsValue()})).finally((function(t){e.confirmLoading=!1}))},setFieldsValue:function(){var e=this,t=this.form.setFieldsValue;this.$nextTick((function(){t(h()(e.record,["score","content","status","sort","imageIds"]))}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.record={},this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,d({commentId:this.commentId,form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},b=_,C=a("2877"),w=Object(C["a"])(b,p,v,!1,null,null,null),y=w.exports,x=[{title:"ID",dataIndex:"comment_id"},{title:"商品信息",dataIndex:"orderGoods",width:"320px",scopedSlots:{customRender:"orderGoods"}},{title:"买家",dataIndex:"user",width:"180px",scopedSlots:{customRender:"user"}},{title:"评分",dataIndex:"score",scopedSlots:{customRender:"score"}},{title:"评价内容",dataIndex:"content",width:"280px",scopedSlots:{customRender:"content"}},{title:"图片评价",dataIndex:"is_picture",scopedSlots:{customRender:"is_picture"}},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"评价时间",width:"180px",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"150px",fixed:"right",scopedSlots:{customRender:"action"}}],L={name:"Index",components:{STable:m["b"],GoodsItem:m["a"],UserItem:m["d"],EditForm:y},data:function(){var e=this;return{searchForm:this.$form.createForm(this),categoryListTree:[],queryParam:{score:0},isLoading:!1,columns:x,loadData:function(t){return n(Object(o["a"])(Object(o["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleTabs:function(e){this.queryParam.score=e.target.value,this.handleRefresh(!0)},handleSearch:function(e){var t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(o["a"])(Object(o["a"])({},t.queryParam),a),t.handleRefresh(!0))}))},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return c({commentId:e.comment_id}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleEdit:function(e){this.$refs.EditForm.edit(e.comment_id)},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)}}},S=L,k=(a("f0cd"),Object(C["a"])(S,r,i,!1,null,"79141043",null));t["default"]=k.exports},b328:function(e,t,a){"use strict";a("beb5")},b753:function(e,t,a){"use strict";a("8951")},b78d:function(e,t,a){"use strict";a.d(t,"a",(function(){return c})),a.d(t,"b",(function(){return $}));var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"goods-type"},e._l(e.list,(function(a,r){return t("div",{directives:[{name:"show",rawName:"v-show",value:!e.onlyShowChecked||e.value==a.value,expression:"!onlyShowChecked || value == item.value"}],key:r,staticClass:"type-item",class:{checked:e.value==a.value},on:{click:function(t){return e.handleItem(a.value)}}},[t("div",{staticClass:"type-title"},[e._v(e._s(a.title))]),t("div",{staticClass:"type-help"},[e._v(e._s(a.help))]),e.value==a.value?t("a-icon",{staticClass:"icon-checked",attrs:{type:"check"}}):e._e()],1)})),0)},i=[],o=(a("b0c0"),a("4d91")),s=a("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["b"].PHYSICAL.value,list:[{title:s["b"].PHYSICAL.name,help:"物流发货",value:s["b"].PHYSICAL.value},{title:s["b"].VIRTUAL.name,help:"无需物流",value:s["b"].VIRTUAL.value}]}},methods:{handleItem:function(e){this.$emit("change",e)}}},n=l,u=(a("ac3c"),a("2877")),d=Object(u["a"])(n,r,i,!1,null,"7fa6c589",null),c=d.exports,m=function(){var e=this,t=e._self._c;return t("div",[t("a-form-item",{attrs:{label:"商品规格",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("div",{staticClass:"form-item-help",staticStyle:{"line-height":"36px"}},[t("small",[e._v("最多添加3个商品规格组,生成的SKU数量不能超出50个")])]),e._l(e.multiSpecData.specList,(function(a,r){return t("div",{key:r,staticClass:"spec-group"},[t("div",{staticClass:"spec-group-item clearfix"},[t("a-input",{staticClass:"group-item-input",attrs:{readOnly:e.isSpecLocked,placeholder:"请输入规格名称"},on:{change:e.onChangeSpecGroupIpt},model:{value:a.spec_name,callback:function(t){e.$set(a,"spec_name",t)},expression:"item.spec_name"}}),e.isSpecLocked?e._e():t("a",{staticClass:"group-item-delete",attrs:{href:"javascript:;"},on:{click:function(t){return e.handleDeleteSpecGroup(r)}}},[e._v("删除规格组")])],1),t("div",{staticClass:"spec-value clearfix"},[e._l(a.valueList,(function(a,i){return t("div",{key:i,staticClass:"spec-value-item"},[t("a-input",{staticClass:"value-item-input",attrs:{readOnly:e.isSpecLocked,placeholder:"请输入规格值"},on:{change:e.onChangeSpecValueIpt},model:{value:a.spec_value,callback:function(t){e.$set(a,"spec_value",t)},expression:"itm.spec_value"}}),e.isSpecLocked?e._e():t("a-icon",{staticClass:"icon-close",attrs:{theme:"filled",type:"close-circle"},on:{click:function(t){return e.handleDeleteSpecValue(r,i)}}})],1)})),e.isSpecLocked?e._e():t("div",{staticClass:"spec-value-add"},[t("a",{staticClass:"group-item-delete",attrs:{href:"javascript:;"},on:{click:function(t){return e.handleAddSpecValue(r)}}},[e._v("新增规格值")])])],2)])})),!e.isSpecLocked&&e.multiSpecData.specList.length<3?t("a-button",{staticClass:"spec-group-add-btn",attrs:{icon:"plus"},on:{click:e.handleAddSpecGroup}},[e._v("添加规格组")]):e._e()],2),t("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}},[t("a-table",{staticClass:"sku-list",attrs:{columns:e.multiSpecData.skuColumns,dataSource:e.multiSpecData.skuList,scroll:{x:!0},pagination:!1,bordered:""},scopedSlots:e._u([{key:"select_goods",fn:function(a,r){return[t("SelectGoods",{attrs:{multiple:!1},on:{change:function(t){return e.handleSelectGoods(t,r)}}})]}},{key:"goods_price",fn:function(t,a){return[e._v(" "+e._s(a.goods_price)+" ")]}},{key:"cost_price",fn:function(t,a){return[e._v(" "+e._s(a.cost_price)+" ")]}},{key:"stock_num",fn:function(t,a){return[e._v(" "+e._s(a.stock_num)+" ")]}},{key:"goods_weight",fn:function(t,a){return[e._v(" "+e._s(a.goods_weight)+" ")]}},{key:"goods_sku_no",fn:function(t,a){return[e._v(" "+e._s(a.goods_sku_no)+" ")]}},{key:"action",fn:function(a,r){return[r.goods_id?t("router-link",{attrs:{to:{path:"/goods/update",query:{goodsId:r.goods_id}}}},[e._v("去修改")]):e._e()]}}])})],1)],1)},p=[],v=a("c7eb"),f=a("1da1"),h=(a("7db0"),a("d3b7"),a("5530")),g=a("d4ec"),_=a("bee2"),b=(a("99af"),a("a15b"),a("d81d"),a("a434"),a("b64b"),a("159b"),a("2ef0")),C=a.n(b),w=a("ca00"),y=[{title:"选择商品",dataIndex:"select_goods",width:120,scopedSlots:{customRender:"select_goods"}},{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"}},{title:"操作",dataIndex:"action",width:140,scopedSlots:{customRender:"action"}}],x={image_id:0,image:{},goods_id:"",goods_price:"",line_price:"",cost_price:"",stock_num:"",goods_weight:"",goods_sku_no:""},L=function(){function e(){Object(g["a"])(this,e),this.multiSpecData={},this.error="",this.multiSpecData={specList:[],skuList:[],skuColumns:C.a.cloneDeep(y),skuBatchForm:C.a.cloneDeep(x)}}return Object(_["a"])(e,[{key:"getData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length&&(this.multiSpecData.specList=C.a.cloneDeep(e),this.multiSpecData.skuList=C.a.cloneDeep(t));var a=this.specGroupArr(),r=k(a),i=this.rowSpanArr(a,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(t){var a=[];t.valueList.forEach((function(e){a.push(e)})),e.push(a)})),e}},{key:"rowSpanArr",value:function(e,t){for(var a=[],r=t.length,i=0;i0;o--)i(o);this.multiSpecData.skuColumns=a}},{key:"handleAddSpecGroup",value:function(){var e=this.multiSpecData.specList;e.push({key:e.length||0,spec_name:"",valueList:[]});var t=e.length-1;this.handleAddSpecValue(t)}},{key:"handleAddSpecValue",value:function(e){var t=this.multiSpecData.specList[e],a=t.valueList;a.push({key:a.length||0,groupKey:t.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,t){this.multiSpecData.specList[e].valueList.splice(t,1),this.onRefreshSpecValueKey(e),this.onUpdate(!1)}},{key:"onRefreshSpecValueKey",value:function(e){var t=this.multiSpecData.specList[e],a=t.valueList;a.forEach((function(e,t){a[t].key=t}))}},{key:"handleSkuBatch",value:function(){var e=this.getFilterObject(this.multiSpecData.skuBatchForm),t=this.multiSpecData.skuList;for(var a in t)t[a]=Object(h["a"])(Object(h["a"])({},t[a]),e);this.onUpdate(!1)}},{key:"getFilterObject",value:function(e){var t={};for(var a in e){var r=e[a];Object(w["f"])(r)||(t[a]=r)}return t}},{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:"商品重量"}],t=this.multiSpecData.skuList;for(var a in t){var r=t[a];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 t in e){var a=e[t];if(Object(w["f"])(a.spec_name))return this.error="规格组名称不能为空~",!1;var r=a.valueList;if(!r.length)return this.error="还没有添加规格值~",!1;for(var i in r)if(Object(w["f"])(r[i].spec_value))return this.error="规格值不能为空~",!1}return!0}},{key:"getFromSpecData",value:function(){var e=this.multiSpecData,t=e.specList,a=e.skuList,r={specList:C.a.cloneDeep(t),skuList:C.a.cloneDeep(a)};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(w["c"])(S,200)(this):S(this)}}]),e}(),S=function(e){return e.getData()},k=function(e){return e.length?Array.prototype.reduce.call(e,(function(e,t){var a=[];return e.forEach((function(e){t.forEach((function(t){a.push(e.concat([t]))}))})),a}),[[]]):[]},V=a("2af9"),q=a("192b"),N=a("d084"),F={components:{SelectImage:V["i"],SelectGoods:q["a"]},props:{defaultSpecList:o["a"].array.def([]),defaultSkuList:o["a"].array.def([]),isSpecLocked:o["a"].bool.def(!1),checkList:o["a"].array.def([])},data:function(){return{labelCol:{span:3},wrapperCol:{span:21},MultiSpecModel:new L,multiSpecData:{specList:[],skuList:[]},visible:!1}},watch:{defaultSpecList:function(e){e.length&&this.MultiSpecModel.isEmpty()&&this.getData()}},created:function(){this.getData()},methods:{getData:function(){var e=this.defaultSpecList,t=this.defaultSkuList;this.multiSpecData=this.MultiSpecModel.getData(e,t)},getFromSpecData:function(){return this.MultiSpecModel.getFromSpecData()},handleAddSpecGroup:function(){this.checkSkuMaxNum()&&this.MultiSpecModel.handleAddSpecGroup()},handleDeleteSpecGroup:function(e){var t=this,a=this.$confirm({title:"您确定要删除该规格组吗?",content:"删除后不可恢复",onOk:function(){t.MultiSpecModel.handleDeleteSpecGroup(e),a.destroy()}})},handleAddSpecValue:function(e){this.checkSkuMaxNum()&&this.MultiSpecModel.handleAddSpecValue(e)},handleDeleteSpecValue:function(e,t){var a=this,r=this.$confirm({title:"您确定要删除该规格值吗?",content:"删除后不可恢复",onOk:function(){a.MultiSpecModel.handleDeleteSpecValue(e,t),r.destroy()}})},onChangeSpecGroupIpt:function(){this.MultiSpecModel.onUpdate(!0)},onChangeSpecValueIpt:function(e,t){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)},showModal:function(){this.visible=!0},handleSelectGoods:function(e,t){var a=this;return Object(f["a"])(Object(v["a"])().mark((function r(){var i,o;return Object(v["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(i=a.multiSpecData.skuList,o=i.find((function(t){return t.goods_id===e})),!o){r.next=5;break}return a.$message.error("一个商品只能选择一次",2),r.abrupt("return",!1);case 5:a.getGoodsDetail(e).then((function(r){var i=a.$route.query.goodsId;if(20===r.spec_type&&i!==e)return a.$message.error("您选择的商品是多规格商品",2),!1;var o=r.skuList[0];t.goods_price=o.goods_price,t.cost_price=o.cost_price,t.stock_num=o.stock_num,t.goods_weight=o.goods_weight,t.goods_sku_no=o.goods_sku_no,t.goods_id=r.goods_id}));case 6:case"end":return r.stop()}}),r)})))()},getGoodsDetail:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!e&&new Promise((function(t,a){N["d"]({goodsId:e}).then((function(e){t(e.data.goodsInfo)}))}))}}},D=F,I=(a("eb6e"),Object(u["a"])(D,m,p,!1,null,"6adf4663",null)),$=I.exports},beb5:function(e,t,a){},c1df6:function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[t("a-tabs",{attrs:{activeKey:e.tabKey,tabBarStyle:{marginBottom:"30px"}},on:{change:e.handleTabs}},[t("a-tab-pane",{key:0,attrs:{tab:"基本信息"}}),t("a-tab-pane",{key:1,attrs:{tab:"规格/库存"}}),t("a-tab-pane",{key:2,attrs:{tab:"商品详情"}}),t("a-tab-pane",{key:3,attrs:{tab:"更多设置"}})],1),t("div",{staticClass:"tabs-content"},[t("div",{directives:[{name:"show",rawName:"v-show",value:0==e.tabKey,expression:"tabKey == 0"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"商品类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}})],1),t("a-form-item",{attrs:{label:"商品名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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:""}}),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/goods/category/index"}}},[e._v("去新增")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadCategoryList}},[e._v("刷新")])],1)],1),t("a-form-item",{attrs:{label:"商品图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"}},[t("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),t("a-form-item",{attrs:{label:"是否大牌正品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否新品首发",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"商品编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_no"],expression:"['goods_no']"}],attrs:{placeholder:"请输入商品编码"}})],1),t("a-form-item",{attrs:{label:"所属分类排行(0表示不参加排行)",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["paihang"],expression:"['paihang']"}],attrs:{placeholder:"所属分类排行"}})],1),t("a-form-item",{attrs:{label:"热卖指数",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["remaizhishu"],expression:"['remaizhishu']"}],attrs:{placeholder:"热卖指数"}})],1),10==e.form.getFieldValue("goods_type")?t("a-form-item",{attrs:{label:"配送方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:0}},[e._v("系统默认")]),t("a-radio",{attrs:{value:1}},[e._v("单独配置")])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_delivery_type"),expression:"form.getFieldValue('is_ind_delivery_type')"}]},[t("a-form-item",{attrs:{extra:"需在 [设置 - 配送方式] 中,开启支持的配送方式才可生效"}},[t("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")?t("a-form-item",{attrs:{label:"运费模板",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(a,r){return t("a-select-option",{key:r,attrs:{value:a.delivery_id}},[e._v(e._s(a.name))])})),1),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/setting/delivery/template/create"}}},[e._v("新增模板")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadDeliveryList}},[e._v("刷新")])],1)],1):e._e(),t("a-form-item",{attrs:{label:"商品状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:10,rules:[{required:!0}]}],expression:"['status', { initialValue: 10, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("上架")]),t("a-radio",{attrs:{value:20}},[e._v("下架")])],1)],1),t("a-form-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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),t("div",{directives:[{name:"show",rawName:"v-show",value:1==e.tabKey,expression:"tabKey == 1"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"规格类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:10,disabled:e.formData.goods.isSpecLocked}},[e._v("单规格")]),t("a-radio",{attrs:{value:20,disabled:e.formData.goods.isSpecLocked}},[e._v("多规格")])],1),e.formData.goods.isSpecLocked?t("p",{staticClass:"form-item-help"},[t("small",{staticClass:"c-red"},[e._v("注:该商品当前正在参与其他活动,商品规格不允许更改")])]):e._e()],1),20==e.form.getFieldValue("spec_type")?t("div",[t("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")?t("div",[t("a-form-item",{attrs:{label:"商品价格",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际购买金额,最低0.01"}},[t("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}}),t("span",{staticClass:"ml-10"},[e._v("元")])],1),t("a-form-item",{attrs:{label:"成本价",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"成本价仅用于商品页展示"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["cost_price"],expression:"['cost_price']"}],attrs:{min:.01,precision:2}}),t("span",{staticClass:"ml-10"},[e._v("元")])],1),t("a-form-item",{attrs:{label:"当前库存数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际库存数量,为0时用户无法下单"}},[t("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}}),t("span",{staticClass:"ml-10"},[e._v("件")])],1),t("a-form-item",{attrs:{label:"商品重量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际重量,用于计算运费"}},[t("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}}),t("span",{staticClass:"ml-10"},[e._v("千克 (Kg)")])],1)],1):e._e(),t("a-form-item",{attrs:{label:"库存计算方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("下单减库存")]),t("a-radio",{attrs:{value:20}},[e._v("付款减库存")])],1)],1),t("a-form-item",{attrs:{label:"商品限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用于限制每人购买该商品的数量"}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:0}},[e._v("关闭")]),t("a-radio",{attrs:{value:1}},[e._v("开启")])],1),e.form.getFieldValue("is_restrict")?t("div",{staticClass:"mt-10"},[t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("总限购")]),t("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}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1),t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("每单限购")]),t("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}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:2==e.tabKey,expression:"tabKey == 2"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"商品详情",labelCol:e.labelCol,wrapperCol:{span:16}}},[t("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"商品详情不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"}]})],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:3==e.tabKey,expression:"tabKey == 3"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"主图视频",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议视频宽高比19:9,建议时长8-45秒"}},[t("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),t("a-form-item",{attrs:{label:"视频封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750像素*750像素"}},[t("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),t("a-form-item",{attrs:{label:"商品卖点",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"一句话简述,例如:此款商品美观大方 性价比较高 不容错过"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["selling_point"],expression:"['selling_point']"}],attrs:{placeholder:"请输入商品卖点"}})],1),t("a-form-item",{attrs:{label:"服务与承诺",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.formData.serviceList?t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["serviceIds"],expression:"['serviceIds']"}],attrs:{mode:"multiple",placeholder:"请选择服务与承诺"}},e._l(e.formData.serviceList,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.service_id}},[e._v(e._s(a.name))])})),1):e._e(),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/goods/service/index"}}},[e._v("去新增")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadServiceList}},[e._v("刷新")])],1)],1),t("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端展示的销量 = 初始销量 + 实际销量"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sales_initial",{initialValue:0}],expression:"['sales_initial', { initialValue: 0}]"}]})],1),t("div",[t("a-divider",{attrs:{orientation:"left"}},[e._v("销售区域")]),t("a-form-item",{attrs:{label:"销售区域",labelCol:e.labelCol,wrapperCol:{span:15}}},[t("a-table",{directives:[{name:"show",rawName:"v-show",value:e.ruleList.length,expression:"ruleList.length"}],staticClass:"table-rules",attrs:{columns:e.columns,dataSource:e.ruleList,pagination:!1,bordered:""},scopedSlots:e._u([{key:"region_text",fn:function(a,r,i){return[t("p",{staticClass:"content"},e._l(a,(function(a,r){return t("span",{key:r},[t("span",[e._v(e._s(a.name))]),a.citys.length?[t("span",[e._v("(")]),e._l(a.citys,(function(r,i){return t("span",{key:i,staticClass:"city-name"},[e._v(e._s(r.name)+e._s(a.citys.length>i+1?"、":""))])})),t("span",[e._v(")")])]:e._e(),t("span",[e._v(e._s(" "))])],2)})),0),t("p",{staticClass:"operation"},[t("a",{staticClass:"edit",attrs:{href:"javascript:void(0);"},on:{click:function(t){return e.handleEdit(i,r)}}},[e._v("编辑")]),t("a",{staticClass:"delete",attrs:{href:"javascript:void(0);"},on:{click:function(t){return e.handleDelete(i)}}},[e._v("删除")])])]}}])}),0==e.ruleList.length?t("a-button",{attrs:{icon:"environment"},on:{click:e.handleAdd}},[e._v("点击添加销售区域")]):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("market-points"),expression:"$module('market-points')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("积分设置")]),t("a-form-item",{attrs:{label:"积分赠送",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品将获得积分"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),t("a-form-item",{attrs:{label:"积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品可以使用积分进行抵扣"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("user-grade"),expression:"$module('user-grade')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("会员折扣设置")]),t("a-form-item",{attrs:{label:"会员折扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后会员折扣,会员购买此商品可以享受会员等级折扣价"}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),t("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}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:0}},[e._v("默认等级折扣")]),t("a-radio",{attrs:{value:1}},[e._v("单独设置折扣")])],1),t("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(a){return t("a-form-item",{key:a.grade_id},[t("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["alone_grade_equity[grade_id:".concat(a.grade_id,"]"),{initialValue:e.formData.defaultUserGradeValue[a.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:a.name,addonAfter:"折",inputProps:{min:0,max:9.9}}})],1)})),1),t("div",{staticClass:"form-item-help"},[e.form.getFieldValue("is_alone_grade")?t("p",{staticClass:"extra"},[e._v("单独折扣:折扣率范围0.0-9.9,例如: 9.8代表98折,0代表不折扣")]):t("p",{staticClass:"extra"},[e._v("默认折扣:默认为用户所属会员等级的折扣率")])])],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("apps-dealer"),expression:"$module('apps-dealer')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("分销设置")]),t("a-form-item",{attrs:{label:"分销佣金",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:0}},[e._v("系统默认")]),t("a-radio",{attrs:{value:1}},[e._v("单独设置")])],1),t("div",{staticClass:"form-item-help"},[t("p",{staticClass:"extra"},[e._v("若使用分销功能必须在 [分销中心 - 分销设置] 中开启")])])],1),t("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}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:10}},[e._v("百分比")]),t("a-radio",{attrs:{value:20}},[e._v("固定金额")])],1),e._l(e.formData.dealer.levelList,(function(a,r){return t("a-form-item",{key:r},[t("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:[a.value,{rules:[{required:!0,message:"佣金不能为空"}]}],expression:"[item.value, { rules: [{ required: true, message: '佣金不能为空'}] }]"}],attrs:{addonBefore:a.name,addonAfter:10==e.form.getFieldValue("dealer_money_type")?"%":"元",inputProps:{min:0,precision:2}}})],1)}))],2)],1)],1)]),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1),t("AreasModal",{ref:"AreasModal",on:{handleSubmit:e.handleAreaSubmit}})],1)],1)},i=[],o=a("5530"),s=(a("d81d"),a("a434"),a("b64b"),a("d3b7"),a("159b"),a("d084")),l=a("2af9"),n=a("e1fe"),u=a("b78d"),d=a("ca00"),c=a("fd0d"),m={key:0,region:[],region_text:[]},p={components:{GoodsType:u["a"],SelectImage:l["i"],SelectVideo:l["o"],Ueditor:l["p"],InputNumberGroup:l["c"],MultiSpec:u["b"],AreasModal:c["b"]},data:function(){return{tabKey:0,labelCol:{span:3},wrapperCol:{span:10},isLoading:!1,isBtnLoading:!1,form:this.$form.createForm(this),goodsId:null,formData:n["a"].formData,checkList:[],ruleList:[],columns:[{title:"销售区域",dataIndex:"region_text",width:"400px",scopedSlots:{customRender:"region_text"}}],citysCount:null}},watch:{"$route.query.goodsId":function(e){e&&(this.goodsId=e,this.initData(),this.getDataList())}},created:function(){this.initData()},beforeDestroy:function(){n["a"].formData.goods={}},methods:{initData:function(){var e=this;this.goodsId=this.$route.query.goodsId,this.isLoading=!0,n["a"].getFromData(this.goodsId).then((function(){Object(d["g"])(e.form.getFieldsValue())||(e.form.setFieldsValue(n["a"].getFieldsValue()),e.$nextTick((function(){e.form.setFieldsValue(n["a"].getFieldsValue2()),e.ruleList=e.formData.goods.rules?e.formData.goods.rules:[],e.onForceUpdate()}))),e.isLoading=!1}))},onForceUpdate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$forceUpdate(),t&&setTimeout((function(){e.$forceUpdate()}),10)},handleTabs:function(e){this.tabKey=e},onReloadCategoryList:function(){var e=this;this.isLoading=!0,n["a"].getCategoryList().then((function(){e.isLoading=!1}))},onReloadServiceList:function(){var e=this;this.isLoading=!0,n["a"].getServiceList().then((function(){e.isLoading=!1}))},onReloadDeliveryList:function(){var e=this;this.isLoading=!0,n["a"].getDeliveryList().then((function(){e.isLoading=!1}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields,r=this.ruleList;a((function(e,a){if(e)return t.onTargetTabError(e),!1;if(20===a.spec_type){var i=t.$refs.MultiSpec;if(!i.verifyForm())return t.tabKey=1,!1;a.specData=i.getFromSpecData()}return a.rules=r,a.categoryIds=a.categorys.map((function(e){return e.value})),delete a.categorys,t.onFormSubmit(a),!0}))},onTargetTabError:function(e){var t=[["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"]],a=Object.keys(e).shift();for(var r in t)if(t[r].indexOf(a)>-1){this.tabKey=parseInt(r);break}},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,s["e"]({goodsId:this.goodsId,form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){t.$router.push("./index")}),1500)})).catch((function(){t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))},handleAdd:function(){var e=this.ruleList.length,t=Object(o["a"])(Object(o["a"])({},m),{},{key:e}),a=this.getExcludedCityIds();if(a.length===this.citysCount)return this.$message.error("已选择了所有的区域",.8),!1;this.handleAreasModal("add",e,t,a)},handleEdit:function(e,t){var a=this.getExcludedCityIds();this.handleAreasModal("edit",e,t,a)},handleAreaSubmit:function(e){var t=e.custom,a=t.scene,r=t.item;r.region=e.selectedCityIds,r.region_text=e.selectedText,"add"===a&&this.ruleList.push(r)},getExcludedCityIds:function(){var e=[];return this.ruleList.forEach((function(t){t.region.forEach((function(t){e.push(t)}))})),e},handleAreasModal:function(e,t,a,r){this.$refs.AreasModal.handle({scene:e,index:t,item:a},a.region,r)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",onOk:function(){t.ruleList.splice(e,1),a.destroy()}})}}},v=p,f=(a("cf4c"),a("2877")),h=Object(f["a"])(v,r,i,!1,null,"a10dd41e",null);t["default"]=h.exports},c558:function(e,t,a){},c7eb:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));a("a4d3"),a("e01a"),a("b636"),a("d28b"),a("944a"),a("fb6a"),a("b0c0"),a("0c47"),a("23dc"),a("3410"),a("131a"),a("d3b7"),a("3ca3"),a("159b"),a("ddb0");var r=a("53ca");function i(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ i=function(){return t};var e,t={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,a){e[t]=a.value},l="function"==typeof Symbol?Symbol:{},n=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function c(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,a){return e[t]=a}}function m(e,t,a,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),l=new I(r||[]);return s(o,"_invoke",{value:q(e,a,l)}),o}function p(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(e){return{type:"throw",arg:e}}}t.wrap=m;var v="suspendedStart",f="suspendedYield",h="executing",g="completed",_={};function b(){}function C(){}function w(){}var y={};c(y,n,(function(){return this}));var x=Object.getPrototypeOf,L=x&&x(x($([])));L&&L!==a&&o.call(L,n)&&(y=L);var S=w.prototype=b.prototype=Object.create(y);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function V(e,t){function a(i,s,l,n){var u=p(e[i],e,s);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==Object(r["a"])(c)&&o.call(c,"__await")?t.resolve(c.__await).then((function(e){a("next",e,l,n)}),(function(e){a("throw",e,l,n)})):t.resolve(c).then((function(e){d.value=e,l(d)}),(function(e){return a("throw",e,l,n)}))}n(u.arg)}var i;s(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){a(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function q(t,a,r){var i=v;return function(o,s){if(i===h)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw s;return{value:e,done:!0}}for(r.method=o,r.arg=s;;){var l=r.delegate;if(l){var n=N(l,r);if(n){if(n===_)continue;return n}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===v)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var u=p(t,a,r);if("normal"===u.type){if(i=r.done?g:f,u.arg===_)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=g,r.method="throw",r.arg=u.arg)}}}function N(t,a){var r=a.method,i=t.iterator[r];if(i===e)return a.delegate=null,"throw"===r&&t.iterator["return"]&&(a.method="return",a.arg=e,N(t,a),"throw"===a.method)||"return"!==r&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var o=p(i,t.iterator,a.arg);if("throw"===o.type)return a.method="throw",a.arg=o.arg,a.delegate=null,_;var s=o.arg;return s?s.done?(a[t.resultName]=s.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=e),a.delegate=null,_):s:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,_)}function F(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(F,this),this.reset(!0)}function $(t){if(t||""===t){var a=t[n];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function a(){for(;++i=0;--i){var s=this.tryEntries[i],l=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var n=o.call(s,"catchLoc"),u=o.call(s,"finallyLoc");if(n&&u){if(this.prev=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),D(a),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var r=a.completion;if("throw"===r.type){var i=r.arg;D(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,a,r){return this.delegate={iterator:$(t),resultName:a,nextLoc:r},"next"===this.method&&(this.arg=e),_}},t}},ca39:function(e,t,a){"use strict";a.r(t);a("ac1f"),a("841c");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.pageTitle))]),t("div",{staticClass:"table-operator"},[t("a-row",[t("a-col",{attrs:{span:6}}),t("a-col",{attrs:{span:8,offset:10}},[t("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px",float:"right"},attrs:{placeholder:"请输入商品名称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(t){e.$set(e.queryParam,"search",t)},expression:"queryParam.search"}})],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"service_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination,scroll:{x:1300}},scopedSlots:e._u([{key:"type",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"是":"否"))])],1)}},{key:"price_range",fn:function(a,r){return t("span",{},[e._v(" "+e._s(r["min_price"])+" ~ "+e._s(r["max_price"])+" ")])}},{key:"is_face",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"是":"否"))])],1)}},{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}])}),t("AddForm",{ref:"AddForm",on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",on:{handleSubmit:e.handleRefresh}})],1)},i=[],o=a("5530"),s=(a("d3b7"),a("b775")),l={list:"/goods.source/list",all:"/goods.source/all",add:"/goods.source/add",edit:"/goods.source/edit",delete:"/goods.source/delete"};function n(e){return Object(s["b"])({url:l.list,method:"get",params:e})}function u(e){return Object(s["b"])({url:l.delete,method:"post",data:e})}var d=a("2af9"),c=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"服务名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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个字符' }] }]"}],attrs:{placeholder:"请输入服务与承诺的名称"}})],1),t("a-form-item",{attrs:{label:"概述",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["summary"],expression:"['summary']"}],attrs:{placeholder:"请输入概述内容 (300个字符以内)",autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"是否默认",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"新增商品时是否默认勾选"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_default",{initialValue:1,rules:[{required:!0}]}],expression:"['is_default', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("是")]),t("a-radio",{attrs:{value:0}},[e._v("否")])],1)],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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)},m=[],p=a("19d3"),v={data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this)}},methods:{add:function(){this.title="新增记录",this.visible=!0},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,p["a"]({form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},f=v,h=a("2877"),g=Object(h["a"])(f,c,m,!1,null,null,null),_=g.exports,b=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"服务名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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个字符' }] }]"}],attrs:{placeholder:"请输入服务与承诺的名称"}})],1),t("a-form-item",{attrs:{label:"概述",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["summary"],expression:"['summary']"}],attrs:{placeholder:"请输入概述内容 (300个字符以内)",autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"是否默认",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"新增商品时是否默认勾选"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_default",{initialValue:1,rules:[{required:!0}]}],expression:"['is_default', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("是")]),t("a-radio",{attrs:{value:0}},[e._v("否")])],1)],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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)},C=[],w=a("88bc"),y=a.n(w),x={data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{}}},methods:{edit:function(e){this.title="编辑记录",this.visible=!0,this.record=e,this.setFieldsValue()},setFieldsValue:function(){var e=this,t=this.form.setFieldsValue;this.$nextTick((function(){t(y()(e.record,["name","summary","is_default","status","sort"]))}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,p["d"]({serviceId:this.record["service_id"],form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},L=x,S=Object(h["a"])(L,b,C,!1,null,null,null),k=S.exports,V={name:"Index",components:{STable:d["d"],AddForm:_,EditForm:k},data:function(){var e=this;return{queryParam:{},isLoading:!1,columns:[{title:"货源ID",dataIndex:"id",width:"100px"},{title:"商品名称",dataIndex:"goods_name",width:"200px"},{title:"一件代发",dataIndex:"type",width:"200px",scopedSlots:{customRender:"type"}},{title:"交付日期",width:"180px",dataIndex:"deliver_at"},{title:"数量",width:"180px",dataIndex:"num"},{title:"单价区间",width:"180px",scopedSlots:{customRender:"price_range"}},{title:"是否面谈",width:"180px",dataIndex:"is_face",scopedSlots:{customRender:"is_face"}},{title:"创建时间",width:"180px",dataIndex:"created_at"}],loadData:function(t){return n(Object(o["a"])(Object(o["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return u({serviceId:e["service_id"]}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},q=V,N=(a("7b70"),Object(h["a"])(q,r,i,!1,null,"4fe49dc8",null));t["default"]=N.exports},cc01:function(e,t,a){},cf4c:function(e,t,a){"use strict";a("c558")},e1fe:function(e,t,a){"use strict";var r=a("5530"),i=(a("4de4"),a("d81d"),a("d3b7"),a("3ca3"),a("159b"),a("ddb0"),a("2ef0")),o=a.n(i),s=a("8243"),l=a("d084"),n=a("2e1c"),u=a("19d3"),d=a("967a");t["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,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.goodsId=t,new Promise((function(a,r){Promise.all([e.getGoodsDetail(t),e.getCategoryList(),e.getDeliveryList(),e.getServiceList(),e.getUserGradeList()]).then((function(){e.setDefaultData(),a({formData:e.formData})}))}))},getGoodsDetail:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!!t&&new Promise((function(a,r){l["d"]({goodsId:t}).then((function(t){e.formData.goods=t.data.goodsInfo,a()}))}))},getFieldsValue:function(){var e=this.formData.goods;e.categorys=this.formatCategoryIds(e.categoryIds);var t=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"])({},t)},getFieldsValue2:function(){var e=this.formData.goods,t={};if(10==e.goods_type&&(t["delivery_id"]=e["delivery_id"],t["is_ind_delivery_type"]=e["is_ind_delivery_type"],t["delivery_type"]=e["delivery_type"]),10==e.spec_type){var a=o.a.pick(e.skuList[0],["goods_price","line_price","cost_price","stock_num","goods_weight"]);t=Object(r["a"])(Object(r["a"])({},t),a)}return 1==e.is_restrict&&(t["restrict_total"]=e["restrict_total"],t["restrict_single"]=e["restrict_single"]),t},formatCategoryIds:function(e){return e.map((function(e){return{value:e}}))},getCategoryList:function(){var e=this;return new Promise((function(t,a){s["a"].getCategoryTreeSelect().then((function(a){e.formData.categoryList=a,t()}))}))},getDeliveryList:function(){var e=this;return new Promise((function(t,a){d["b"]().then((function(a){e.formData.deliveryList=a.data.list,t()}))}))},getServiceList:function(){var e=this;return new Promise((function(t,a){u["b"]().then((function(a){e.formData.serviceList=a.data.list,t()}))}))},getUserGradeList:function(){var e=this;return new Promise((function(t,a){n["a"]({status:1}).then((function(a){e.formData.userGradeList=a.data.list,t()}))}))},setDefaultData:function(){this.setDefaultServiceIds(),this.setDefaultUserGradeValue()},setDefaultServiceIds:function(){var e=this.formData.serviceList;if(!this.goodsId){var t=e.filter((function(e){return e.is_default}));this.formData.defaultServiceIds=t.map((function(e){return e.service_id}))}},setDefaultUserGradeValue:function(){var e=this.formData.userGradeList,t=this.goodsId&&this.formData.goods.alone_grade_equity?this.formData.goods.alone_grade_equity:{},a={};e.forEach((function(e){a[e.grade_id]=t[e.grade_id]||e.equity.discount})),this.formData.defaultUserGradeValue=Object(r["a"])({},a)}}},e7b5:function(e,t,a){},ea64:function(e,t,a){},eb6e:function(e,t,a){"use strict";a("4547")},ee5f:function(e,t,a){"use strict";a.r(t);a("ac1f"),a("841c");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.pageTitle))]),t("div",{staticClass:"table-operator"},[t("a-row",[t("a-col",{attrs:{span:6}},[t("a-button",{directives:[{name:"action",rawName:"v-action:add",arg:"add"}],attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),t("a-col",{attrs:{span:8,offset:10}},[t("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px",float:"right"},attrs:{placeholder:"请输入服务名称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(t){e.$set(e.queryParam,"search",t)},expression:"queryParam.search"}})],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"service_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pagination:e.pagination,scroll:{x:1300}},scopedSlots:e._u([{key:"summary",fn:function(a){return t("span",{},[t("p",{staticClass:"summary oneline-hide"},[e._v(e._s(a))])])}},{key:"is_default",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"是":"否"))])],1)}},{key:"status",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"显示":"隐藏"))])],1)}},{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}])}),t("AddForm",{ref:"AddForm",on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",on:{handleSubmit:e.handleRefresh}})],1)},i=[],o=a("5530"),s=(a("d3b7"),a("19d3")),l=a("2af9"),n=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"服务名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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个字符' }] }]"}],attrs:{placeholder:"请输入服务与承诺的名称"}})],1),t("a-form-item",{attrs:{label:"概述",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["summary"],expression:"['summary']"}],attrs:{placeholder:"请输入概述内容 (300个字符以内)",autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"是否默认",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"新增商品时是否默认勾选"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_default",{initialValue:1,rules:[{required:!0}]}],expression:"['is_default', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("是")]),t("a-radio",{attrs:{value:0}},[e._v("否")])],1)],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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)},u=[],d={data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this)}},methods:{add:function(){this.title="新增记录",this.visible=!0},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,s["a"]({form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},c=d,m=a("2877"),p=Object(m["a"])(c,n,u,!1,null,null,null),v=p.exports,f=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"服务名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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个字符' }] }]"}],attrs:{placeholder:"请输入服务与承诺的名称"}})],1),t("a-form-item",{attrs:{label:"概述",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["summary"],expression:"['summary']"}],attrs:{placeholder:"请输入概述内容 (300个字符以内)",autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"是否默认",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"新增商品时是否默认勾选"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_default",{initialValue:1,rules:[{required:!0}]}],expression:"['is_default', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("是")]),t("a-radio",{attrs:{value:0}},[e._v("否")])],1)],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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)},h=[],g=a("88bc"),_=a.n(g),b={data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{}}},methods:{edit:function(e){this.title="编辑记录",this.visible=!0,this.record=e,this.setFieldsValue()},setFieldsValue:function(){var e=this,t=this.form.setFieldsValue;this.$nextTick((function(){t(_()(e.record,["name","summary","is_default","status","sort"]))}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,s["d"]({serviceId:this.record["service_id"],form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},C=b,w=Object(m["a"])(C,f,h,!1,null,null,null),y=w.exports,x={name:"Index",components:{STable:l["d"],AddForm:v,EditForm:y},data:function(){var e=this;return{queryParam:{},isLoading:!1,columns:[{title:"服务ID",dataIndex:"service_id"},{title:"服务名称",dataIndex:"name",width:"200px"},{title:"概述",dataIndex:"summary",width:"300px",scopedSlots:{customRender:"summary"}},{title:"是否默认",dataIndex:"is_default",scopedSlots:{customRender:"is_default"}},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"更新时间",width:"180px",dataIndex:"update_time"},{title:"操作",width:"150px",fixed:"right",scopedSlots:{customRender:"action"}}],loadData:function(t){return s["e"](Object(o["a"])(Object(o["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return s["c"]({serviceId:e["service_id"]}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},L=x,S=(a("1c6a"),Object(m["a"])(L,r,i,!1,null,"6f6ccaab",null));t["default"]=S.exports},f0cd:function(e,t,a){"use strict";a("e7b5")},f11f:function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[t("a-tabs",{attrs:{activeKey:e.tabKey,tabBarStyle:{marginBottom:"30px"}},on:{change:e.handleTabs}},[t("a-tab-pane",{key:0,attrs:{tab:"基本信息"}}),t("a-tab-pane",{key:1,attrs:{tab:"规格/库存"}}),t("a-tab-pane",{key:2,attrs:{tab:"商品详情"}}),t("a-tab-pane",{key:3,attrs:{tab:"更多设置"}})],1),t("div",{staticClass:"tabs-content"},[t("div",{directives:[{name:"show",rawName:"v-show",value:0==e.tabKey,expression:"tabKey == 0"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"商品类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}})],1),t("a-form-item",{attrs:{label:"商品名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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),t("a-form-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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:""}}),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/goods/category/index"}}},[e._v("去新增")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadCategoryList}},[e._v("刷新")])],1)],1),t("a-form-item",{attrs:{label:"商品图片",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750*750像素, 最多上传10张, 可拖拽图片调整顺序, 第1张将作为商品首图"}},[t("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),t("a-form-item",{attrs:{label:"是否大牌正品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否新品首发",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"是否店内",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:0}},[e._v("否")]),t("a-radio",{attrs:{value:1}},[e._v("是")])],1)],1),t("a-form-item",{attrs:{label:"商品编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_no"],expression:"['goods_no']"}],attrs:{placeholder:"请输入商品编码"}})],1),t("a-form-item",{attrs:{label:"所属分类排行(0表示不参加排行)",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["paihang"],expression:"['paihang']"}],attrs:{placeholder:"所属分类排行"}})],1),t("a-form-item",{attrs:{label:"热卖指数",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["remaizhishu"],expression:"['remaizhishu']"}],attrs:{placeholder:"热卖指数"}})],1),10==e.form.getFieldValue("goods_type")?t("a-form-item",{attrs:{label:"配送方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:0}},[e._v("系统默认")]),t("a-radio",{attrs:{value:1}},[e._v("单独配置")])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("is_ind_delivery_type"),expression:"form.getFieldValue('is_ind_delivery_type')"}]},[t("a-form-item",{attrs:{extra:"需在 [设置 - 配送方式] 中,开启支持的配送方式才可生效"}},[t("a-checkbox-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["delivery_type",{initialValue:[10,20],rules:[{required:!0,message:"配送方式至少选择一个"}]}],expression:"[\n 'delivery_type',\n { initialValue: [10, 20], rules: [{ required: true, message: '配送方式至少选择一个' }] },\n ]"}],attrs:{options:[{label:"快递配送",value:10},{label:"上门自提",value:20}]}})],1)],1)],1):e._e(),10==e.form.getFieldValue("goods_type")?t("a-form-item",{attrs:{label:"运费模板",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(a,r){return t("a-select-option",{key:r,attrs:{value:a.delivery_id}},[e._v(e._s(a.name))])})),1),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/setting/delivery/template/create"}}},[e._v("新增模板")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadDeliveryList}},[e._v("刷新")])],1)],1):e._e(),t("a-form-item",{attrs:{label:"商品状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:10,rules:[{required:!0}]}],expression:"['status', { initialValue: 10, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("上架")]),t("a-radio",{attrs:{value:20}},[e._v("下架")])],1)],1),t("a-form-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("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),t("div",{directives:[{name:"show",rawName:"v-show",value:1==e.tabKey,expression:"tabKey == 1"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"规格类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:10}},[e._v("单规格")])],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:20==e.form.getFieldValue("spec_type"),expression:"form.getFieldValue('spec_type') == 20"}]},[t("MultiSpec",{ref:"MultiSpec"})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:10==e.form.getFieldValue("spec_type"),expression:"form.getFieldValue('spec_type') == 10"}]},[t("a-form-item",{attrs:{label:"商品价格",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际购买金额,最低0.01"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_price",{initialValue:1,rules:[{required:!0,message:"请输入商品价格"}]}],expression:"[\n 'goods_price',\n { initialValue: 1, rules: [{ required: true, message: '请输入商品价格' }] },\n ]"}],attrs:{min:.01,precision:2}}),t("span",{staticClass:"ml-10"},[e._v("元")])],1),t("a-form-item",{attrs:{label:"成本价",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"成本价仅用于商品页展示"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["cost_price"],expression:"['cost_price']"}],attrs:{min:0,precision:2}}),t("span",{staticClass:"ml-10"},[e._v("元")])],1),t("a-form-item",{attrs:{label:"当前库存数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际库存数量,为0时用户无法下单"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["stock_num",{initialValue:100,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"[\n 'stock_num',\n { initialValue: 100, rules: [{ required: true, message: '请输入库存数量' }] },\n ]"}],attrs:{min:0,precision:0}}),t("span",{staticClass:"ml-10"},[e._v("件")])],1),t("a-form-item",{attrs:{label:"商品重量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商品的实际重量,用于计算运费"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["goods_weight",{initialValue:0,rules:[{required:!0,message:"请输入库存数量"}]}],expression:"[\n 'goods_weight',\n { initialValue: 0, rules: [{ required: true, message: '请输入库存数量' }] },\n ]"}],attrs:{min:0}}),t("span",{staticClass:"ml-10"},[e._v("千克 (Kg)")])],1)],1),t("a-form-item",{attrs:{label:"库存计算方式",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("下单减库存")]),t("a-radio",{attrs:{value:20}},[e._v("付款减库存")])],1)],1),t("a-form-item",{attrs:{label:"商品限购",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用于限制每人购买该商品的数量"}},[t("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(t){return e.onForceUpdate()}}},[t("a-radio",{attrs:{value:0}},[e._v("关闭")]),t("a-radio",{attrs:{value:1}},[e._v("开启")])],1),e.form.getFieldValue("is_restrict")?t("div",{staticClass:"mt-10"},[t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("总限购")]),t("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}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1),t("a-form-item",[t("span",{staticClass:"mr-10"},[e._v("每单限购")]),t("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}}),t("span",{staticClass:"ml-10"},[e._v("件/人")])],1)],1):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:2==e.tabKey,expression:"tabKey == 2"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"商品详情",labelCol:e.labelCol,wrapperCol:{span:16}}},[t("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"商品详情不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"}]})],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:3==e.tabKey,expression:"tabKey == 3"}],staticClass:"tab-pane"},[t("a-form-item",{attrs:{label:"主图视频",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议视频宽高比19:9,建议时长8-45秒"}},[t("SelectVideo",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_id"],expression:"['video_id']"}],attrs:{multiple:!1}})],1),t("a-form-item",{attrs:{label:"视频封面",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"建议尺寸:750像素*750像素"}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["video_cover_id"],expression:"['video_cover_id']"}],attrs:{multiple:!1}})],1),t("a-form-item",{attrs:{label:"商品卖点",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"一句话简述,例如:此款商品美观大方 性价比较高 不容错过"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["selling_point"],expression:"['selling_point']"}],attrs:{placeholder:"请输入商品卖点"}})],1),t("a-form-item",{attrs:{label:"服务与承诺",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[e.formData.serviceList?t("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(a,r){return t("a-select-option",{key:r,attrs:{value:a.service_id}},[e._v(e._s(a.name))])})),1):e._e(),t("div",{staticClass:"form-item-help"},[t("router-link",{attrs:{target:"_blank",to:{path:"/goods/service/index"}}},[e._v("去新增")]),t("a",{attrs:{href:"javascript:;"},on:{click:e.onReloadServiceList}},[e._v("刷新")])],1)],1),t("a-form-item",{attrs:{label:"初始销量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端展示的销量 = 初始销量 + 实际销量"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sales_initial",{initialValue:0}],expression:"['sales_initial', { initialValue: 0 }]"}]})],1),t("div",[t("a-divider",{attrs:{orientation:"left"}},[e._v("销售区域")]),t("a-form-item",{attrs:{label:"销售区域",labelCol:e.labelCol,wrapperCol:{span:15}}},[t("a-table",{directives:[{name:"show",rawName:"v-show",value:e.ruleList.length,expression:"ruleList.length"}],staticClass:"table-rules",attrs:{columns:e.columns,dataSource:e.ruleList,pagination:!1,bordered:""},scopedSlots:e._u([{key:"region_text",fn:function(a,r,i){return[t("p",{staticClass:"content"},e._l(a,(function(a,r){return t("span",{key:r},[t("span",[e._v(e._s(a.name))]),a.citys.length?[t("span",[e._v("(")]),e._l(a.citys,(function(r,i){return t("span",{key:i,staticClass:"city-name"},[e._v(e._s(r.name)+e._s(a.citys.length>i+1?"、":""))])})),t("span",[e._v(")")])]:e._e(),t("span",[e._v(e._s(" "))])],2)})),0),t("p",{staticClass:"operation"},[t("a",{staticClass:"edit",attrs:{href:"javascript:void(0);"},on:{click:function(t){return e.handleEdit(i,r)}}},[e._v("编辑")]),t("a",{staticClass:"delete",attrs:{href:"javascript:void(0);"},on:{click:function(t){return e.handleDelete(i)}}},[e._v("删除")])])]}}])}),0==e.ruleList.length?t("a-button",{attrs:{icon:"environment"},on:{click:e.handleAdd}},[e._v("点击添加销售区域")]):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("market-points"),expression:"$module('market-points')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("积分设置")]),t("a-form-item",{attrs:{label:"积分赠送",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品将获得积分"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),t("a-form-item",{attrs:{label:"积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后用户购买此商品可以使用积分进行抵扣"}},[t("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 }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("user-grade"),expression:"$module('user-grade')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("会员折扣设置")]),t("a-form-item",{attrs:{label:"会员折扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"开启后会员折扣,会员购买此商品可以享受会员等级折扣价"}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:1}},[e._v("开启")]),t("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),e.form.getFieldValue("is_enable_grade")?t("a-form-item",{attrs:{label:"会员折扣设置",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:0}},[e._v("默认等级折扣")]),t("a-radio",{attrs:{value:1}},[e._v("单独设置折扣")])],1),e.form.getFieldValue("is_alone_grade")?t("div",e._l(e.formData.userGradeList,(function(a){return t("a-form-item",{key:a.grade_id},[t("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["alone_grade_equity[grade_id:".concat(a.grade_id,"]"),{initialValue:e.formData.defaultUserGradeValue[a.grade_id],rules:[{required:!0,message:"折扣率不能为空"}]}],expression:"[\n `alone_grade_equity[grade_id:${item.grade_id}]`,\n {\n initialValue: formData.defaultUserGradeValue[item.grade_id],\n rules: [{ required: true, message: '折扣率不能为空' }],\n },\n ]"}],attrs:{addonBefore:a.name,addonAfter:"折",inputProps:{min:0,max:9.9}}})],1)})),1):e._e(),t("div",{staticClass:"form-item-help"},[e.form.getFieldValue("is_alone_grade")?t("p",{staticClass:"extra"},[e._v(" 单独折扣:折扣率范围0.0-9.9,例如: 9.8代表98折,0代表不折扣 ")]):t("p",{staticClass:"extra"},[e._v("默认折扣:默认为用户所属会员等级的折扣率")])])],1):e._e()],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.$module("apps-dealer"),expression:"$module('apps-dealer')"}]},[t("a-divider",{attrs:{orientation:"left"}},[e._v("分销设置")]),t("a-form-item",{attrs:{label:"分销佣金",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:0}},[e._v("系统默认")]),t("a-radio",{attrs:{value:1}},[e._v("单独设置")])],1),t("div",{staticClass:"form-item-help"},[t("p",{staticClass:"extra"},[e._v("若使用分销功能必须在 [分销中心 - 分销设置] 中开启")])])],1),e.form.getFieldValue("is_ind_dealer")?t("a-form-item",{attrs:{label:"分销佣金类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("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(t){return e.onForceUpdate(!0)}}},[t("a-radio",{attrs:{value:10}},[e._v("百分比")]),t("a-radio",{attrs:{value:20}},[e._v("固定金额")])],1),e._l(e.formData.dealer.levelList,(function(a,r){return t("a-form-item",{key:r},[t("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:[a.value,{rules:[{required:!0,message:"佣金不能为空"}]}],expression:"[item.value, { rules: [{ required: true, message: '佣金不能为空' }] }]"}],attrs:{addonBefore:a.name,addonAfter:10==e.form.getFieldValue("dealer_money_type")?"%":"元",inputProps:{min:0,precision:2}}})],1)}))],2):e._e()],1)],1)]),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1),t("AreasModal",{ref:"AreasModal",on:{handleSubmit:e.handleAreaSubmit}})],1)],1)},i=[],o=a("5530"),s=(a("d81d"),a("a434"),a("b64b"),a("d3b7"),a("159b"),a("d084")),l=a("2af9"),n=a("e1fe"),u=a("b78d"),d=a("fd0d"),c={key:0,region:[],region_text:[]},m={components:{GoodsType:u["a"],SelectImage:l["i"],SelectVideo:l["o"],Ueditor:l["p"],InputNumberGroup:l["c"],MultiSpec:u["b"],AreasModal:d["b"]},data:function(){return{tabKey:0,labelCol:{span:3},wrapperCol:{span:10},isLoading:!1,isBtnLoading:!1,form:this.$form.createForm(this),formData:n["a"].formData,checkList:[],ruleList:[],columns:[{title:"销售区域",dataIndex:"region_text",width:"400px",scopedSlots:{customRender:"region_text"}}],citysCount:null}},created:function(){var e=this;this.isLoading=!0,n["a"].getFromData().then((function(){e.isLoading=!1}))},methods:{onForceUpdate:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$forceUpdate(),t&&setTimeout((function(){e.$forceUpdate()}),10)},handleTabs:function(e){this.tabKey=e},onReloadCategoryList:function(){var e=this;this.isLoading=!0,n["a"].getCategoryList().then((function(){e.isLoading=!1}))},onReloadServiceList:function(){var e=this;this.isLoading=!0,n["a"].getServiceList().then((function(){e.isLoading=!1}))},onReloadDeliveryList:function(){var e=this;this.isLoading=!0,n["a"].getDeliveryList().then((function(){e.isLoading=!1}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields,r=this.ruleList;a((function(e,a){if(e)return t.onTargetTabError(e),!1;if(20===a.spec_type){var i=t.$refs.MultiSpec;if(!i.verifyForm())return t.tabKey=1,!1;a.specData=i.getFromSpecData()}return a.rules=r,a.categoryIds=a.categorys.map((function(e){return e.value})),delete a.categorys,t.onFormSubmit(a),!0}))},onTargetTabError:function(e){var t=[["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"]],a=Object.keys(e).shift();for(var r in t)if(t[r].indexOf(a)>-1){this.tabKey=parseInt(r);break}},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,s["a"]({form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){t.$router.push("./index")}),1500)})).catch((function(){t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))},handleAdd:function(){var e=this.ruleList.length,t=Object(o["a"])(Object(o["a"])({},c),{},{key:e}),a=this.getExcludedCityIds();if(a.length===this.citysCount)return this.$message.error("已选择了所有的区域",.8),!1;this.handleAreasModal("add",e,t,a)},handleEdit:function(e,t){var a=this.getExcludedCityIds();this.handleAreasModal("edit",e,t,a)},handleAreaSubmit:function(e){var t=e.custom,a=t.scene,r=t.item;r.region=e.selectedCityIds,r.region_text=e.selectedText,"add"===a&&this.ruleList.push(r)},getExcludedCityIds:function(){var e=[];return this.ruleList.forEach((function(t){t.region.forEach((function(t){e.push(t)}))})),e},handleAreasModal:function(e,t,a,r){this.$refs.AreasModal.handle({scene:e,index:t,item:a},a.region,r)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",onOk:function(){t.ruleList.splice(e,1),a.destroy()}})}}},p=m,v=(a("6cfa"),a("2877")),f=Object(v["a"])(p,r,i,!1,null,"8070109c",null);t["default"]=f.exports},f3b9:function(e,t,a){}}]);