(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[414],{7414:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return d}});var n=function(){var t=this,e=t._self._c;return e("div",[e("el-card",{attrs:{"body-style":{padding:"20px 20px 0 20px"}}},[e("div",{staticClass:"goods"},[e("el-form",{ref:"searchForm",attrs:{inline:!0,model:t.searchForm}},[e("el-form-item",{attrs:{label:"商品名称:"}},[e("el-input",{staticStyle:{width:"100px"},attrs:{placeholder:"商品名称"},model:{value:t.searchForm.sku_title,callback:function(e){t.$set(t.searchForm,"sku_title",e)},expression:"searchForm.sku_title"}})],1),e("el-form-item",{attrs:{label:"商品编码:"}},[e("el-input",{staticStyle:{width:"100px"},attrs:{placeholder:"商品编码"},model:{value:t.searchForm.external_sku_id,callback:function(e){t.$set(t.searchForm,"external_sku_id",e)},expression:"searchForm.external_sku_id"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleChoose(1)}}},[t._v("筛选")]),e("el-upload",{ref:"myUpload",staticStyle:{display:"inline-block",margin:"0 10px 0 10px"},attrs:{action:"/api/combination/goods",multiple:!1,name:"combinationGoods","show-file-list":!1,"on-success":t.uploadSuccess,"before-upload":t.beforeUpload,"on-error":t.uploadError}},[e("el-button",{attrs:{type:"primary",plain:""}},[t._v("组合商品导入")])],1)],1)],1)],1)]),e("el-card",{staticStyle:{"margin-top":"10px"}},[e("div",[e("div",{staticClass:"btn"},[e("el-button",{attrs:{type:"primary",plain:""},on:{click:t.addGoodsCombination}},[t._v("新增组合商品")])],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticClass:"table",staticStyle:{width:"100%"},attrs:{data:t.tableData,"tooltip-effect":"dark","row-key":"id","tree-props":{children:"children"}}},[e("el-table-column",{attrs:{label:"商品信息",width:"400"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("div",{staticClass:"commodityimg"},[e("img",{staticClass:"Img",attrs:{src:r.row.img_url}})]),e("div",[e("p",[t._v(t._s(r.row.title))]),e("p",[t._v(t._s(r.row.external_sku_id))]),e("p",[t._v(t._s(r.row.updated_at))])])]}}])}),e("el-table-column",{attrs:{prop:"num",label:"组合数量"}}),e("el-table-column",{attrs:{prop:"reference_price",label:"售价"}}),e("el-table-column",{attrs:{sortable:"",label:"今日7点以后订单"},scopedSlots:t._u([{key:"default",fn:function(n){return[e("div",[e("span",[t._v(t._s(n.row.order_goods_num))])]),0!==n.row.order_detail.length?e("el-popover",{attrs:{placement:"right-start",trigger:"hover"}},[e("div",t._l(n.row.order_detail,(function(r,n){return e("span",{key:n},[e("div",[t._v(t._s(r.shop.name)+":"+t._s(r.number))])])})),0),e("el-button",{staticClass:"btn11",attrs:{slot:"reference",type:"text"},slot:"reference"},[e("img",{attrs:{src:r(5163),alt:""}})])],1):t._e()]}}])}),e("el-table-column",{attrs:{sortable:"",prop:"total_orders_num",label:"累计订单"}}),e("el-table-column",{attrs:{sortable:"",prop:"stock",label:"库存"}}),e("el-table-column",{attrs:{prop:"status",label:"状态"}}),e("el-table-column",{attrs:{label:"操作",width:"130"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleEdit(r.row.id)}}},[t._v("编辑")])]}}])})],1)],1),e("div",{staticClass:"page"},[e("el-pagination",{attrs:{"current-page":t.current_page,"page-sizes":[15,50,100,150,200],"page-size":t.per_page,layout:"total, sizes, prev, pager, next, jumper",total:t.Paginationdata.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)]),e("el-dialog",{attrs:{title:"新增组合商品",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("el-form",{ref:"dynamicValidateForm",staticClass:"demo-dynamic",attrs:{model:t.dynamicValidateForm,"label-width":"100px"}},[e("el-form-item",{attrs:{label:"商品名称",prop:"title",rules:[{required:!0,message:"请输入商品名称",trigger:"blur"}]}},[e("el-input",{model:{value:t.dynamicValidateForm.title,callback:function(e){t.$set(t.dynamicValidateForm,"title",e)},expression:"dynamicValidateForm.title"}})],1),e("el-form-item",{attrs:{label:"商品编码",prop:"external_sku_id",rules:[{required:!0,message:"请输入商品编码",trigger:"blur"}]}},[e("el-input",{model:{value:t.dynamicValidateForm.external_sku_id,callback:function(e){t.$set(t.dynamicValidateForm,"external_sku_id",e)},expression:"dynamicValidateForm.external_sku_id"}})],1),t._l(t.dynamicValidateForm.combination_goods,(function(r,n){return e("el-form-item",{key:r.item_id,attrs:{label:"子商品"+n,prop:"combination_goods."+n+".item_id",rules:{required:!0,message:"子商品不能为空",trigger:"blur"}}},[e("el-col",{attrs:{span:8}},[e("el-select",{attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"请选择子商品","remote-method":t.remoteMethod,loading:t.remoteLoading},model:{value:r.item_id,callback:function(e){t.$set(r,"item_id",e)},expression:"item.item_id"}},t._l(t.skus,(function(t){return e("el-option",{key:t.id,attrs:{label:t.title,value:t.id}})})),1)],1),e("el-col",{attrs:{span:2}},[e("el-input",{attrs:{placeholder:"数量"},model:{value:r.item_num,callback:function(e){t.$set(r,"item_num",e)},expression:"item.item_num"}})],1),e("el-button",{attrs:{type:"danger"},on:{click:function(e){return e.preventDefault(),t.removeItem(n)}}},[t._v("删除")])],1)})),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("dynamicValidateForm")}}},[t._v("提交")]),e("el-button",{on:{click:t.addItem}},[t._v("添加子商品")]),e("el-button",{on:{click:function(e){return t.resetForm("dynamicValidateForm")}}},[t._v("重置")])],1)],2)],1)],1)},a=[],i=(r(4114),r(2109)),o={data(){return{dialogVisible:!1,loading:!1,tableData:[],searchForm:{external_sku_id:"",sku_title:""},Paginationdata:{},current_page:1,per_page:100,dynamicValidateForm:{id:0,title:"",external_sku_id:"",combination_goods:[{item_id:"",item_num:1}]},skus:[{id:"",title:""}],remoteLoading:!1}},methods:{handleEdit(t){this.dialogVisible=!0,(0,i.PN)(t).then((t=>{this.dynamicValidateForm=t.data.data,this.skus=t.data.data.skus}))},handleDelete(t){},getList(t){(0,i.al)(t).then((t=>{this.tableData=t.data.data,this.Paginationdata=t.data.meta,this.currentPage=t.data.meta.current_page,this.per_page=parseInt(t.data.meta.per_page),this.loading=!1}))},handleChoose(){this.searchForm={...this.searchForm,page:this.current_page,per_page:this.per_page},this.getList(this.searchForm)},handleSizeChange(t){this.per_page=t,this.current_page=1,this.handleChoose()},handleCurrentChange(t){this.current_page=t,this.handleChoose()},submitForm(t){this.$refs[t].validate((t=>{if(!t)return!1;(0,i.pY)(this.dynamicValidateForm).then((t=>{this.$message({message:t.data.message,type:"success"}),this.dialogVisible=!1,this.handleCurrentChange(1)}))}))},resetForm(t){this.$refs[t].resetFields()},removeItem(t){this.dynamicValidateForm.combination_goods.splice(t,1)},addItem(){this.dynamicValidateForm.combination_goods.push({item_id:"",item_num:1})},remoteMethod(t){""!==t?(this.remoteLoading=!0,(0,i.NU)(t).then((t=>{this.skus=t.data.data,this.remoteLoading=!1}))):this.skus=[]},addGoodsCombination(){this.dialogVisible=!0,this.dynamicValidateForm={id:0,title:"",external_sku_id:"",combination_goods:[{item_id:"",item_num:1}]}},beforeUpload(){this.loadingModule=this.$loading({lock:!0,text:"表格导入中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"})},uploadSuccess(t){this.$message({message:t.message,type:"success"}),this.loadingModule.close()},uploadError(t){this.$message({message:t.errorMessage,type:"error"}),this.loadingModule.close()}},mounted(){this.handleCurrentChange(1)}},s=o,l=r(1656),u=(0,l.A)(s,n,a,!1,null,"5ba5084c",null),d=u.exports},2109:function(t,e,r){"use strict";r.d(e,{D3:function(){return s},F5:function(){return m},Hk:function(){return o},Jt:function(){return g},MZ:function(){return d},NU:function(){return A},OZ:function(){return i},PN:function(){return k},Pn:function(){return p},al:function(){return b},iJ:function(){return l},pY:function(){return f},t:function(){return a},vh:function(){return c},yo:function(){return u},zl:function(){return h}});var n=r(802);function a(t){return(0,n.A)({url:"/api/goods_skus",method:"get",params:t})}function i(t){return(0,n.A)({url:"/api/goods",method:"post",data:t})}function o(t){return(0,n.A)({url:`/api/goods_skus/${t}`,method:"get"})}function s(t){return(0,n.A)({url:"/api/goods",method:"get",params:t})}function l(t,e){return(0,n.A)({url:`/api/goods_skus/${t}`,method:"patch",data:e})}function u(t){return(0,n.A)({url:"/api/batch/goods_skus",method:"patch",data:t})}function d(t,e){return(0,n.A)({url:`/api/single/goods_skus/${t}`,method:"patch",data:e})}function c(t,e){return(0,n.A)({url:"/api/upload",Headers:e,method:"post",data:t})}function m(t){return(0,n.A)({url:"/api/goodsList",method:"get",params:t})}function p(t){return(0,n.A)({url:"/api/goods_sku_location",method:"get",params:t})}function g(t){return(0,n.A)({url:"/api/goodsSkusList",method:"get",params:{title:t}})}function h(){return(0,n.A)({url:"/api/stock/goods_skus",method:"get"})}function A(t){return(0,n.A)({url:"/api/goods/filter/"+t,method:"get"})}function f(t){return(0,n.A)({url:"/api/goods_combination",method:"post",data:t})}function b(t){return(0,n.A)({url:"/api/goods_combination",method:"get",params:t})}function k(t){return(0,n.A)({url:"/api/goods_combination/"+t,method:"get"})}},5272:function(t,e,r){"use strict";r.d(e,{eF:function(){return i},gf:function(){return a}});const n="admin_token";function a(){return localStorage.getItem("token")}function i(){return localStorage.removeItem(n)}},802:function(t,e,r){"use strict";var n=r(2505),a=r.n(n),i=r(5272),o=r(5947),s=r.n(o),l=r(1052),u=a().create({timeout:36e4});u.interceptors.request.use((t=>(t.headers.Authorization="Bearer "+(0,i.gf)(),s().start(),t)),(t=>Promise.reject(t))),u.interceptors.response.use((t=>{s().done();const e=t.status;if(200===e||201===e)return t}),(t=>(s().done(),400===t.response.status&&(0,l.Message)({message:t.response.data.errorMessage,type:"error"}),500===t.response.status&&(0,l.Message)({message:t.response.data.message,type:"error"}),Promise.reject(t)))),e.A=u},5947:function(t,e,r){var n,a; /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */(function(i,o){n=o,a="function"===typeof n?n.call(e,r,e,t):n,void 0===a||(t.exports=a)})(0,(function(){var t={version:"0.2.0"},e=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'