(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-dc853660"],{"43fa":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("custom-bread",{attrs:{breadList:t.breadList}}),a("div",[a("a-layout",{style:{marginTop:"24px"}},[a("a-layout-content",{style:{background:"#fff",marginBottom:"16px",padding:"24px"}},[a("a-button",{directives:[{name:"permission",rawName:"v-permission",value:"product:/admin/sales_product/batch/create",expression:"'product:/admin/sales_product/batch/create'"}],staticClass:"mr8",on:{click:t.addProduct}},[t._v("\n 批量新建简单商品\n ")]),a("a-button",{directives:[{name:"permission",rawName:"v-permission",value:"product:/admin/sales_product/bulk/update",expression:"'product:/admin/sales_product/bulk/update'"}],staticClass:"mr8",on:{click:t.importEditProduct}},[t._v("\n 批量编辑商品\n ")]),a("a-button",{directives:[{name:"permission",rawName:"v-permission",value:"product:/admin/sales_product/images/import",expression:"'product:/admin/sales_product/images/import'"}],staticClass:"mr8",on:{click:t.addImport}},[t._v("\n 批量导入图片文件\n ")]),a("a-button",{directives:[{name:"permission",rawName:"v-permission",value:"product:/admin/sales_product/bulk/shelf",expression:"'product:/admin/sales_product/bulk/shelf'"}],staticClass:"mr8",on:{click:t.shelfImport}},[t._v("\n 批量上下架\n ")]),a("a-button",{directives:[{name:"permission",rawName:"v-permission",value:"product:/admin/sales_product/bulk/detail_gallery",expression:"'product:/admin/sales_product/bulk/detail_gallery'"}],staticClass:"mr8",on:{click:t.productDetailImport}},[t._v("\n 批量生成商详图片\n ")])],1),a("a-layout-content",{staticClass:"couponContent",style:{background:"#fff",padding:"24px"}},[a("a-table",{ref:"table",attrs:{dataSource:t.dataSource,columns:t.columns,pagination:t.paginationSet,loading:t.loading,rowKey:"id"},scopedSlots:t._u([{key:"file_name",fn:function(e){return[e?[a("a-tooltip",[a("template",{slot:"title"},[t._v("\n "+t._s(e)+"\n ")]),a("p",{staticClass:"line_table_hidden"},[t._v(t._s(t._f("stringFilter")(e)))])],2)]:[a("p",{staticClass:"line_table_hidden",staticStyle:{height:"14px","line-height":"14px"}},[t._v(t._s(t._f("stringFilter")(e)))])]]}},{key:"status",fn:function(e,i){return[a("span",{domProps:{innerHTML:t._s(t.transStatus(e))}}),a("div",{staticStyle:{width:"90px"}},[t.showProgress?a("a-progress",{attrs:{percent:Math.round(i.done/i.total*100),size:"small",status:"active"}}):t._e()],1)]}},{key:"operation",fn:function(e,i){return[0!==i.status&&1!==i.status?a("span",[1===i.has_import_file?a("a",{staticStyle:{"margin-right":"1em"},attrs:{href:"javascript:void(0)"},on:{click:function(e){return t.downLoadTemplate(i.file_name,i.id,1)}}},[t._v("下载文件")]):t._e(),1===i.has_error_file?a("a",{attrs:{href:"javascript:void(0)"},on:{click:function(e){return t.downLoadTemplate(i.file_name,i.id,2)}}},[t._v("下载错误文件")]):t._e()]):a("span",[t._v("- -")])]}}])}),a("p-agination",{attrs:{total:t.pageTotal,currentPage:t.query.page,computedPageNumber:t.computedPageNumber,pageSize:t.query.limit},on:{jumpTableChange:t.jumpTableChange,selectPageSizeChange:t.selectPageSizeChange}})],1),a("import-modal",{ref:"importModal",on:{uploadSuccess:t.uploadSuccess}}),a("import-component",{ref:"importModal2",on:{uploadSuccess:t.uploadSuccess}},[a("p",[t._v("1、导入时请严格按模板导入,不要对模板格式做任何修改;")]),a("p",[t._v("2、Sheet1中的第一行和第二行禁止删除和修改;")]),a("p",[t._v("3、模板内容请参考Sheet2中的示例进行填写;")]),a("p",[t._v("4、单次导入最多10000条数据,文件最大20M;")])]),a("import-component",{ref:"importModalForPriceRule",attrs:{templateType:8},on:{uploadSuccess:t.uploadSuccess}},[a("p",[t._v("1、导入时请严格按模板导入,不要对模板格式做任何修改;")]),a("p",[t._v("2、Sheet1中的第一行和第二行禁止删除和修改;")]),a("p",[t._v("3、模板内容请参考Sheet2中的示例进行填写;")]),a("p",[t._v("4、单次导入最多10000条数据,文件最大20M;")]),a("p",{staticClass:"errorColor"},[t._v("5.价格下调幅度建议不超过50%,请注意亏损情况。")])]),a("import-component",{ref:"importEditProduct",attrs:{templateType:9},on:{uploadSuccess:t.uploadSuccess}},[a("p",[t._v("1、导入时请严格按模板导入,不要对模板格式做任何修改;")]),a("p",[t._v("2、Sheet1中的第一行和第二行禁止删除和修改;")]),a("p",[t._v("3、模板内容请参考Sheet2中的示例进行填写;")]),a("p",[t._v("4、单次导入最多10000条数据,文件最大20M")]),a("p",{staticClass:"errorColor"},[t._v("5.选填字段,不填写表示不编辑修改")])]),a("import-component",{ref:"importMultipleShelf",attrs:{templateType:10},on:{uploadSuccess:t.uploadSuccess}},[a("p",[t._v("1、导入时请严格按模板导入,不要对模板格式做任何修改;")]),a("p",[t._v("2、Sheet1中的第一行和第二行禁止删除和修改;")]),a("p",[t._v("3、模板内容请参考Sheet2中的示例进行填写;")]),a("p",[t._v("4、单次导入最多10000条数据,文件最大20M")])]),a("import-component",{ref:"importProductDetail",attrs:{templateType:11},on:{uploadSuccess:t.uploadSuccess}},[a("p",[t._v("1、导入时请严格按模板导入,不要对模板格式做任何修改;")]),a("p",[t._v("2、Sheet1中的第一行和第二行禁止删除和修改;")]),a("p",[t._v("3、模板内容请参考Sheet2中的示例进行填写;")]),a("p",[t._v("4、单次导入最多10000条数据,文件最大20M")])])],1)],1)],1)},r=[],o=a("bf43"),s=a("5633"),n=a("680a"),l=a("782b"),c=a("6b5c"),u=a("ac0d"),p=a("c1df"),d=a.n(p),m=a("2a9b"),h=a("d769"),f=[{title:"导入类型",dataIndex:"action_name",width:"18%"},{title:"导入文件名称",dataIndex:"file_name",width:"24%",scopedSlots:{customRender:"file_name"}},{title:"导入时间",dataIndex:"import_time",width:"18%",scopedSlots:{customRender:"import_time"}},{title:"操作人",dataIndex:"operator",width:"10%",scopedSlots:{customRender:"operator"}},{title:"状态",dataIndex:"status",width:"10%",scopedSlots:{customRender:"status"}},{title:"操作",scopedSlots:{customRender:"operation"},width:"25%"}],v={components:{customBread:s["a"],importModal:m["a"],importComponent:h["a"],PageView:n["c"],PAgination:o["a"]},mixins:[u["h"]],data:function(){return{breadList:{current:"批量导入",loopBread:[{name:"1",title:"工作台",href:"/dashboard"},{name:"2",title:"商品"},{name:"3",title:"商品工具"},{name:"5",title:"批量导入"}]},loading:!1,columns:f,downLink:"",queryParam:{action_id:"6,7,8,9,10,11"}}},methods:{moment:d.a,transStatus:function(t){switch(t){case 0:return this.showProgress=!0,"任务处理中";case 1:return this.showProgress=!0,"任务处理中";case 2:return this.showProgress=!1,'任务成功';case 3:return this.showProgress=!1,'任务部分失败';case 4:return this.showProgress=!1,'任务失败'}},getTableList:function(){var t=this;this.loading=!0;var e=Object.assign(this.query,this.queryParam);Object(l["d"])(e).then((function(e){0===e.status&&(t.dataSource=e.data.task,t.pageTotal=e.data.total)})).finally((function(){t.loading=!1,t.pollingMethod()}))},downLoadTemplate:function(t,e,a){var i={file_name:t,id:e,file_type:a};Object(c["n"])(i).then((function(t){t&&window.open(t.data.url)}))},pollingMethod:function(){var t=this.dataSource.filter((function(t){return 0===t.status||1===t.status}));if(t.length>0){var e=this;setTimeout((function(){e.getTableList()}),3e3)}},uploadSuccess:function(){this.getTableList()},addImport:function(){this.$refs.importModal.powerShow()},addProduct:function(){this.$refs.importModal2.powerShow()},priceRuleImport:function(){this.$refs.importModalForPriceRule.powerShow("批量新建调价规则")},importEditProduct:function(){this.$refs.importEditProduct.powerShow("批量编辑商品")},shelfImport:function(){this.$refs.importMultipleShelf.powerShow("批量上下架")},productDetailImport:function(){this.$refs.importProductDetail.powerShow("批量生成商详图片")}}},b=v,_=a("2877"),g=Object(_["a"])(b,i,r,!1,null,null,null);e["default"]=g.exports},7002:function(t,e,a){},"7ea0":function(t,e,a){"use strict";a("7002")},d769:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{display:"inline-block"}},[a("a-modal",{attrs:{title:t.modalTitle,destroyOnClose:!0,okText:"确定",cancelText:"取消"},on:{ok:t.handleOk,cancel:t.handleCancel},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[a("a-form",{attrs:{form:t.form,"label-col":t.labelCol,"wrapper-col":t.wrapperCol},on:{submit:t.handleSubmit}},[a("a-form-item",{attrs:{label:"商户"}},[a("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["merchant_id",{rules:[{required:!0,message:"请选择商户"}]}],expression:"[\n 'merchant_id',\n { rules: [{ required: true, message: '请选择商户' }] },\n ]"}],staticStyle:{width:"210px"},attrs:{placeholder:t.$t("message.PleaSeselect"),getPopupContainer:function(t){return t.parentNode},showSearch:"",filterOption:t.filterOption},on:{change:t.merchantChange}},t._l(t.merchantData,(function(e){return a("a-select-option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1),a("a-form-item",{staticClass:"form-item-hide-margin-bottom",attrs:{label:"文件",required:""}},[a("div",{staticClass:"flex-layout"},[a("a-upload",{attrs:{name:"file",action:t.uploadPath,headers:t.headers,remove:t.removeUpload,fileList:t.fileList,beforeUpload:t.beforeUpload},on:{change:t.handleChange}},[a("a-button",[a("a-icon",{attrs:{type:"upload"}}),t._v(" 选择文件 ")],1)],1),a("a",{staticClass:"down",attrs:{href:t.templatePath,download:""}},[t._v("下载模板")])],1),a("div",{staticClass:"customizeErrorRight"},[t._v(t._s(t.importDecideInfo))])]),a("a-form-item",{staticClass:"upload-intro form-item-hide-margin-bottom",attrs:{label:"说明"}},[a("div",{staticStyle:{"line-height":"27px","margin-top":"6px"}},[t._t("default")],2)])],1)],1)],1)},r=[],o=(a("8e6e"),a("ac6a"),a("456d"),a("7f7f"),a("2909")),s=(a("96cf"),a("1da1")),n=a("ade3"),l=a("2f62");function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function u(t){for(var e=1;e=0},powerShow:function(t,e){this.modalTitle=t||"批量新建普通商品",this.attrs=e||{},this.visible=!0},handleOk:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.handleSubmit(),this.fileId){t.next=4;break}return this.confirmMessage(),t.abrupt("return");case 4:if(this.merchant_id){t.next=6;break}return t.abrupt("return");case 6:if(!this.throttle){t.next=8;break}return t.abrupt("return");case 8:return this.throttle=!0,t.next=11,this.startImport(this.fileId);case 11:a=t.sent,a&&(this.$store.commit("Decide_toggleLanguage_success"),this.$emit("uploadSuccess"),this.handleCancel()),this.throttle=!1;case 14:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),handleChange:function(t){var e=Object(o["a"])(t.fileList);if(e=e.slice(-1),this.fileList=e,t.fileList=e,"done"===t.file.status){var a=t.file.response;0===a.status?(this.fileId=a.data.file_id,this.fileName=t.file.name,this.resetUploadStatus()):(this.fileId="",this.importDecideStatus=!0,this.importDecideInfo=a.message)}},startImport:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(e){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return");case 2:return a=Object.assign(this.attrs,{file_id:e,name:this.fileName,merchant_id:this.merchant_id}),t.abrupt("return",this.submitMethod(a));case 4:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),removeUpload:function(t){this.resetUploadStatus(),this.fileId=null,this.fileList=[]},confirmMessage:function(){this.importDecideStatus||(this.importDecideStatus=!0,this.importDecideInfo="文件不能为空")},resetUploadStatus:function(){this.importDecideStatus=!1,this.importDecideInfo=""},handleCancel:function(){this.visible=!1,this.merchant_id=void 0,this.removeUpload(),this.resetUploadStatus()},beforeUpload:function(t){var e=t.size<20971520;return e||(this.importDecideStatus=!0,this.importDecideInfo="请选择小于20M的文件"),e}}},d=p,m=(a("7ea0"),a("2877")),h=Object(m["a"])(d,i,r,!1,null,null,null);e["a"]=h.exports}}]);