(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3f4a3ba5"],{"02b0":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",[t.headTab.length>0?a("el-tabs",{model:{value:t.currentTab,callback:function(e){t.currentTab=e},expression:"currentTab"}},t._l(t.headTab,(function(t,e){return a("el-tab-pane",{key:e,attrs:{name:t.name,label:t.title}})})),1):t._e()],1),t._v(" "),a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.fullscreenLoading,expression:"fullscreenLoading"}],key:t.currentTab,ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":"160px"},nativeOn:{submit:function(t){t.preventDefault()}}},["1"==t.currentTab?a("el-row",{attrs:{gutter:24}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品标题:",prop:"store_name"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入商品标题"},model:{value:t.formValidate.store_name,callback:function(e){t.$set(t.formValidate,"store_name",e)},expression:"formValidate.store_name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品分类:",prop:"cate_id"}},[a("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择"},model:{value:t.formValidate.cate_id,callback:function(e){t.$set(t.formValidate,"cate_id",e)},expression:"formValidate.cate_id"}},t._l(t.categoryList,(function(t){return a("el-option",{key:t.store_category_id,attrs:{label:t.cate_name,value:t.store_category_id}})})),1)],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品封面图:",prop:"image"}},[a("div",{staticClass:"upLoadPicBox",attrs:{title:"750*750px"},on:{click:function(e){return t.modalPicTap("1")}}},[t.formValidate.image?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.formValidate.image}})]):a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])])],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品轮播图:",prop:"slider_image"}},[a("div",{staticClass:"acea-row"},[t._l(t.formValidate.slider_image,(function(e,n){return a("div",{key:n,staticClass:"pictrue",attrs:{draggable:"false"},on:{dragstart:function(a){return t.handleDragStart(a,e)},dragover:function(a){return a.preventDefault(),t.handleDragOver(a,e)},dragenter:function(a){return t.handleDragEnter(a,e)},dragend:function(a){return t.handleDragEnd(a,e)}}},[a("img",{attrs:{src:e}}),t._v(" "),a("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(n)}}})])})),t._v(" "),t.formValidate.slider_image.length<10?a("div",{staticClass:"uploadCont",attrs:{title:"750*750px"}},[a("div",{staticClass:"upLoadPicBox",on:{click:function(e){return t.modalPicTap("2")}}},[a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])]):t._e()],2)])],1),t._v(" "),a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"用户兑换总数量限制:",prop:"once_max_count"}},[a("el-input-number",{staticStyle:{width:"200px"},attrs:{min:1,placeholder:"请输入排序序号"},model:{value:t.formValidate.once_max_count,callback:function(e){t.$set(t.formValidate,"once_max_count",e)},expression:"formValidate.once_max_count"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"单位:",prop:"unit_name"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入单位"},model:{value:t.formValidate.unit_name,callback:function(e){t.$set(t.formValidate,"unit_name",e)},expression:"formValidate.unit_name"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"排序:"}},[a("el-input-number",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入排序序号"},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"上架状态:",props:"is_used",required:""}},[a("el-radio-group",{model:{value:t.formValidate.is_used,callback:function(e){t.$set(t.formValidate,"is_used",e)},expression:"formValidate.is_used"}},[a("el-radio",{staticClass:"radio",attrs:{label:1}},[t._v("开启")]),t._v(" "),a("el-radio",{attrs:{label:0}},[t._v("关闭")])],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"好物精选:",props:"is_hot",required:""}},[a("el-radio-group",{model:{value:t.formValidate.is_hot,callback:function(e){t.$set(t.formValidate,"is_hot",e)},expression:"formValidate.is_hot"}},[a("el-radio",{staticClass:"radio",attrs:{label:1}},[t._v("开启")]),t._v(" "),a("el-radio",{attrs:{label:0}},[t._v("关闭")])],1)],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品关键字:"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入商品关键字"},model:{value:t.formValidate.keyword,callback:function(e){t.$set(t.formValidate,"keyword",e)},expression:"formValidate.keyword"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品简介:",prop:"store_info"}},[a("el-input",{staticClass:"selWidth",attrs:{type:"textarea",rows:3,placeholder:"请输入商品简介"},model:{value:t.formValidate.store_info,callback:function(e){t.$set(t.formValidate,"store_info",e)},expression:"formValidate.store_info"}})],1)],1)],1):t._e(),t._v(" "),"2"==t.currentTab?a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品规格:",props:"spec_type"}},[a("el-radio-group",{on:{change:function(e){return t.onChangeSpec(t.formValidate.spec_type)}},model:{value:t.formValidate.spec_type,callback:function(e){t.$set(t.formValidate,"spec_type",e)},expression:"formValidate.spec_type"}},[a("el-radio",{staticClass:"radio",attrs:{label:0}},[t._v("单规格")]),t._v(" "),a("el-radio",{attrs:{label:1}},[t._v("多规格")])],1)],1)],1),t._v(" "),1===t.formValidate.spec_type?a("el-col",{staticClass:"noForm",attrs:{span:24}},[t.formValidate.attr.length>0?a("el-form-item",t._l(t.formValidate.attr,(function(e,n){return a("div",{key:n},[a("div",{staticClass:"acea-row row-middle"},[a("span",{staticClass:"mr5"},[t._v(t._s(e.value))]),t._v(" "),a("i",{staticClass:"el-icon-circle-close",on:{click:function(e){return t.handleRemoveAttr(n)}}})]),t._v(" "),a("div",{staticClass:"rulesBox"},[t._l(e.detail,(function(n,r){return a("el-tag",{key:r,staticClass:"mb5 mr10",attrs:{closable:"",size:"medium","disable-transitions":!1},on:{close:function(a){return t.handleClose(e.detail,r)}}},[t._v(t._s(n)+"\n ")])})),t._v(" "),e.inputVisible?a("el-input",{ref:"saveTagInput",refInFor:!0,staticClass:"input-new-tag",attrs:{size:"small"},on:{blur:function(a){return t.createAttr(e.detail.attrsVal,n)}},nativeOn:{keyup:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")?null:t.createAttr(e.detail.attrsVal,n)}},model:{value:e.detail.attrsVal,callback:function(a){t.$set(e.detail,"attrsVal",a)},expression:"item.detail.attrsVal"}}):a("el-button",{staticClass:"button-new-tag",attrs:{size:"small"},on:{click:function(a){return t.showInput(e)}}},[t._v("+ 添加")])],2)])})),0):t._e(),t._v(" "),t.isBtn?a("el-col",[a("el-col",{attrs:{xl:6,lg:9,md:9,sm:24,xs:24}},[a("el-form-item",{attrs:{label:"规格:"}},[a("el-input",{attrs:{placeholder:"请输入规格"},model:{value:t.formDynamic.attrsName,callback:function(e){t.$set(t.formDynamic,"attrsName",e)},expression:"formDynamic.attrsName"}})],1)],1),t._v(" "),a("el-col",{attrs:{xl:6,lg:9,md:9,sm:24,xs:24}},[a("el-form-item",{attrs:{label:"规格值:"}},[a("el-input",{attrs:{placeholder:"请输入规格值"},model:{value:t.formDynamic.attrsVal,callback:function(e){t.$set(t.formDynamic,"attrsVal",e)},expression:"formDynamic.attrsVal"}})],1)],1),t._v(" "),a("el-col",{attrs:{xl:12,lg:6,md:6,sm:24,xs:24}},[a("el-form-item",{staticClass:"noLeft"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.createAttrName}},[t._v("确定")]),t._v(" "),a("el-button",{attrs:{size:"small"},on:{click:t.offAttrName}},[t._v("取消")])],1)],1)],1):t._e(),t._v(" "),t.isBtn?t._e():a("el-form-item",{attrs:{label:"设置规格:"}},[a("el-button",{attrs:{type:"primary",icon:"md-add",size:"small"},on:{click:t.addBtn}},[t._v("添加新规格")]),t._v(" "),a("el-button",{attrs:{type:"success",icon:"md-add",size:"small"},on:{click:t.generate}},[t._v("立即生成")])],1)],1):t._e(),t._v(" "),1===t.formValidate.spec_type&&t.formValidate.attr.length>0&&t.$route.params.id||!t.$route.params.id&&t.createProduct?a("el-col",{staticClass:"noForm",attrs:{span:24}},[a("el-form-item",{staticClass:"labeltop",attrs:{label:"批量设置:"}},[a("el-table",{staticClass:"tabNumWidth",attrs:{data:t.oneFormBatch,border:"",size:"mini"}},[a("el-table-column",{attrs:{align:"center",label:"商品规格","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"acea-row row-between-wrapper",staticStyle:{cursor:"pointer"},on:{click:t.batchAttr}},[a("div",{staticStyle:{width:"45px"}},[t._v(t._s(t.oneFormBatch[0]["attr"]))]),t._v(" "),a("i",{staticClass:"el-icon-arrow-down"})])]}}],null,!1,552951624)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"图片","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"upLoadPicBox",attrs:{title:"750*750px"},on:{click:function(e){return t.modalPicTap("1","pi")}}},[e.row.image?a("div",{staticClass:"pictrue tabPic"},[a("img",{attrs:{src:e.row.image}})]):a("div",{staticClass:"upLoad tabPic"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])]}}],null,!1,772438934)}),t._v(" "),t._l(t.attrValue,(function(e,n){return a("el-table-column",{key:n,attrs:{label:t.formThead[n].title,align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",["商品编号"===t.formThead[n].title?a("el-input",{staticClass:"priceBox",attrs:{type:"text"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,a)},expression:"scope.row[iii]"}}):"兑换积分"===t.formThead[n].title?a("el-input",{staticClass:"priceBox",attrs:{type:"number",oninput:"value=value.replace(/[^0-9]/g,'')"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,t._n(a))},expression:"scope.row[iii]"}}):a("el-input",{staticClass:"priceBox",attrs:{type:"number",min:"0"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,a)},expression:"scope.row[iii]"}})],1)]}}],null,!0)})})),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作","min-width":"80"}},[[a("el-button",{staticClass:"submission",attrs:{type:"text",size:"small"},on:{click:t.batchAdd}},[t._v("批量添加")])]],2)],2)],1)],1):t._e(),t._v(" "),a("el-col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[0===t.formValidate.spec_type?a("el-form-item",[a("el-table",{staticClass:"tabNumWidth",attrs:{data:t.OneattrValue,border:"",size:"mini"}},[a("el-table-column",{attrs:{align:"center",label:"图片","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"upLoadPicBox",on:{click:function(e){return t.modalPicTap("1","dan","pi")}}},[t.formValidate.image?a("div",{staticClass:"pictrue tabPic"},[a("img",{attrs:{src:e.row.image}})]):a("div",{staticClass:"upLoad tabPic"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])]}}],null,!1,1357914119)}),t._v(" "),t._l(t.attrValue,(function(e,n){return a("el-table-column",{key:n,attrs:{label:t.formThead[n].title,align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",["商品编号"===t.formThead[n].title?a("el-input",{staticClass:"priceBox",attrs:{type:"text"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,a)},expression:"scope.row[iii]"}}):"兑换积分"===t.formThead[n].title?a("el-input",{staticClass:"priceBox",attrs:{type:"number",oninput:"value=value.replace(/[^0-9]/g,'')"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,t._n(a))},expression:"scope.row[iii]"}}):a("el-input",{staticClass:"priceBox",attrs:{type:"number",min:0},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,a)},expression:"scope.row[iii]"}})],1)]}}],null,!0)})}))],2)],1):t._e(),t._v(" "),1===t.formValidate.spec_type&&t.formValidate.attr.length>0&&t.$route.params.id||!t.$route.params.id&&t.createProduct?a("el-form-item",{staticClass:"labeltop",attrs:{label:"规格列表:"}},[a("el-table",{key:"2",staticClass:"tabNumWidth",attrs:{data:t.ManyAttrValue,border:"",size:"mini"}},[t.manyTabDate?t._l(t.manyTabDate,(function(e,n){return a("el-table-column",{key:n,attrs:{align:"center",label:t.manyTabTit[n].title,"min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"priceBox",class:e.row.select?"selectOn":"",domProps:{textContent:t._s(e.row[n])}})]}}],null,!0)})})):t._e(),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"图片","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"upLoadPicBox",attrs:{title:"750*750px"},on:{click:function(a){return t.modalPicTap("1","duo",e.$index)}}},[e.row.image?a("div",{staticClass:"pictrue tabPic"},[a("img",{attrs:{src:e.row.image}})]):a("div",{staticClass:"upLoad tabPic"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])]}}],null,!1,1344940579)}),t._v(" "),t._l(t.attrValue,(function(e,n){return a("el-table-column",{key:n,attrs:{label:t.formThead[n].title,align:"center","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",["商品编号"===t.formThead[n].title?a("el-input",{staticClass:"priceBox",attrs:{type:"text"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,a)},expression:"scope.row[iii]"}}):"兑换积分"===t.formThead[n].title?a("el-input",{staticClass:"priceBox",attrs:{type:"number",oninput:"value=value.replace(/[^0-9]/g,'')"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,t._n(a))},expression:"scope.row[iii]"}}):a("el-input",{staticClass:"priceBox",attrs:{min:0,type:"number"},model:{value:e.row[n],callback:function(a){t.$set(e.row,n,a)},expression:"scope.row[iii]"}})],1)]}}],null,!0)})})),t._v(" "),a("el-table-column",{key:"3",attrs:{align:"center",label:"操作","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{staticClass:"submission",attrs:{type:"text",size:"small"},on:{click:function(a){return t.delAttrTable(e.$index)}}},[t._v("删除")])]}}],null,!1,4286827297)})],2)],1):t._e()],1)],1):t._e(),t._v(" "),"3"==t.currentTab?a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品详情:"}},[a("vue-ueditor-wrap",{attrs:{config:t.myConfig},on:{beforeInit:t.addCustomDialog},model:{value:t.formValidate.content,callback:function(e){t.$set(t.formValidate,"content",e)},expression:"formValidate.content"}})],1)],1)],1):t._e(),t._v(" "),a("el-form-item",{staticStyle:{"margin-top":"30px"}},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:t.currentTab>1,expression:"currentTab > 1"}],attrs:{type:"primary",size:"small"},on:{click:t.handleSubmitUp}},[t._v("上一步\n ")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:t.currentTab<3,expression:"currentTab < 3"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleSubmitNest("formValidate")}}},[t._v("下一步\n ")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"3"==t.currentTab||t.$route.params.id,expression:"currentTab == '3' || $route.params.id"}],staticClass:"submission",attrs:{loading:t.loading,type:"primary",size:"small"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("提交\n ")])],1)],1)],1),t._v(" "),t.attrShow?a("el-dialog",{attrs:{visible:t.attrShow,title:"请选择商品规格",width:"320px"},on:{"update:visible":function(e){t.attrShow=e}}},[t.attrShow?a("attr-list",{attrs:{attrs:t.attrsList},on:{activeData:t.activeAttr,close:t.labelAttr,subAttrs:t.subAttrs}}):t._e()],1):t._e(),t._v(" "),t.previewVisible?a("div",[a("div",{staticClass:"bg",on:{click:function(e){e.stopPropagation(),t.previewVisible=!1}}}),t._v(" "),t.previewVisible?a("preview-box",{ref:"previewBox",attrs:{"preview-key":t.previewKey}}):t._e()],1):t._e()],1)},r=[],i=a("75fc"),o=a("c80c"),s=(a("96cf"),a("3b8d")),c=(a("a481"),a("c5f6"),a("6b54"),a("bd86")),l=(a("8615"),a("55dd"),a("28a5"),a("7f7f"),a("ac6a"),a("2d63")),u=a("ef0d"),d=a("6625"),f=a.n(d),m=a("53fe"),p=a.n(m),h=a("b7be"),g=a("83d6"),b=a("8c98"),v=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"label-wrapper"},[a("div",{staticClass:"list-box"},t._l(t.attrs,(function(e,n){return a("div",{key:n,staticClass:"label-box"},[a("div",{staticClass:"title"},[t._v(t._s(e.value))]),t._v(" "),a("div",{staticClass:"list"},t._l(e.details,(function(e,n){return a("div",{key:n,staticClass:"label-item",class:e.select?"on":"",on:{click:function(a){return t.selectAttr(e,n)}}},[t._v(t._s(e.name))])})),0)])})),0),t._v(" "),a("div",{staticClass:"footer"},[a("el-button",{staticClass:"btns",attrs:{type:"primary",plain:"",size:"mini"},on:{click:t.cancel}},[t._v("取消")]),t._v(" "),a("el-button",{staticClass:"btns",attrs:{type:"primary",plain:"",size:"mini"},on:{click:t.reset}},[t._v("重置")]),t._v(" "),a("el-button",{staticClass:"btns",attrs:{type:"primary",size:"mini"},on:{click:t.subBtn}},[t._v("确定")])],1)])},_=[],y={name:"attrList",props:{attrs:{type:Array,default:function(){return[]}}},data:function(){return{}},mounted:function(){},methods:{selectAttr:function(t,e){t.select=!t.select,this.$emit("activeData",JSON.parse(JSON.stringify(this.attrs)))},cancel:function(){this.$emit("close")},reset:function(){var t=this.attrs;t.map((function(t){t.details.map((function(t){t.select=!1}))})),this.attrs=t},subBtn:function(){this.$emit("subAttrs")}}},w=y,V=(a("28b7"),a("2877")),k=Object(V["a"])(w,v,_,!1,null,"c1c87f2c",null),x=k.exports,C=a("bbcc"),$=a("5f87"),A=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.showRecord?a("el-dialog",{attrs:{title:"复制记录",visible:t.showRecord,width:"900px"},on:{"update:visible":function(e){t.showRecord=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"table",staticStyle:{width:"100%"},attrs:{data:t.tableData.data,size:"mini","highlight-current-row":""}},[a("el-table-column",{attrs:{label:"ID",prop:"mer_id","min-width":"50"}}),t._v(" "),a("el-table-column",{attrs:{label:"使用次数",prop:"num","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"复制商品平台名称",prop:"type","min-width":"120"}}),t._v(" "),a("el-table-column",{attrs:{label:"剩余次数",prop:"number","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"商品复制链接",prop:"info","min-width":"180"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作时间",prop:"create_time","min-width":"120"}})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{"page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1)]):t._e()},O=[],B=a("c4c8"),T={name:"CopyRecord",data:function(){return{showRecord:!1,loading:!1,tableData:{data:[],total:0},tableFrom:{page:1,limit:10}}},methods:{getRecord:function(){var t=this;this.showRecord=!0,this.loading=!0,Object(B["productCopyRecordApi"])(this.tableFrom).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.loading=!1})).catch((function(e){t.$message.error(e.message),t.listLoading=!1}))},pageChange:function(t){this.tableFrom.page=t,this.getRecord()},pageChangeLog:function(t){this.tableFromLog.page=t,this.getRecord()},handleSizeChange:function(t){this.tableFrom.limit=t,this.getRecord()}}},j=T,F=(a("b5e4"),Object(V["a"])(j,A,O,!1,null,"236da352",null)),L=F.exports,D=a("ed08"),S={image:"",slider_image:[],store_name:"",store_info:"",keyword:"",cate_id:"",param_temp_id:[],unit_name:"",sort:0,once_max_count:0,is_hot:0,is_used:0,attrValue:[{image:"",price:null,cost:null,ot_price:null,select:!1,stock:null,bar_code:"",weight:null,volume:null}],attr:[],content:"",spec_type:0,type:0,product_type:0},E={cost:{title:"成本价"},ot_price:{title:"兑换积分"},price:{title:"兑换金额"},stock:{title:"库存"},bar_code:{title:"商品编号"},weight:{title:"重量(KG)"},volume:{title:"体积(m³)"}},P={name:"IntegralProductAdd",components:{ueditorFrom:u["a"],VueUeditorWrap:f.a,previewBox:b["a"],attrList:x,copyRecord:L},data:function(){var t=C["a"].https+"/upload/image/0/file?ueditor=1&token="+Object($["a"])();return{myConfig:{autoHeightEnabled:!1,initialFrameHeight:500,initialFrameWidth:"100%",enableAutoSave:!1,UEDITOR_HOME_URL:"/UEditor/",serverUrl:t,imageUrl:t,imageFieldName:"file",imageUrlPrefix:"",imageActionName:"upfile",imageMaxSize:2048e3,imageAllowFiles:[".png",".jpg",".jpeg",".gif",".bmp"]},roterPre:g["roterPre"],selectRule:"",checkboxGroup:[],tabs:[],fullscreenLoading:!1,props:{emitPath:!1},propsMer:{emitPath:!0},active:0,deduction_set:-1,OneattrValue:[Object.assign({},S.attrValue[0])],ManyAttrValue:[Object.assign({},S.attrValue[0])],ruleList:[],categoryList:[],deliveryList:[],labelList:[],formThead:Object.assign({},E),formValidate:Object.assign({},S),picValidate:!0,formDynamics:{template_name:"",template_value:[]},manyTabTit:{},manyTabDate:{},grid2:{xl:10,lg:12,md:12,sm:24,xs:24},formDynamic:{attrsName:"",attrsVal:""},isBtn:!1,images:[],currentTab:"1",grid:{xl:8,lg:8,md:12,sm:24,xs:24},loading:!1,ruleValidate:{store_name:[{required:!0,message:"请输入商品名称",trigger:"blur"}],cate_id:[{required:!0,message:"请选择商品分类",trigger:"change"}],keyword:[{required:!0,message:"请输入商品关键字",trigger:"blur"}],unit_name:[{required:!0,message:"请输入单位",trigger:"blur"}],store_info:[{required:!0,message:"请输入商品简介",trigger:"blur"}],temp_id:[{required:!0,message:"请选择运费模板",trigger:"change"}],once_max_count:[{required:!0,message:"请输入限购数量",trigger:"change"}],image:[{required:!0,message:"请上传商品图",trigger:"change"}],slider_image:[{required:!0,message:"请上传商品轮播图",type:"array",trigger:"change"}],spec_type:[{required:!0,message:"请选择商品规格",trigger:"change"}],delivery_way:[{required:!0,message:"请选择送货方式",trigger:"change"}]},attrInfo:{},previewVisible:!1,previewKey:"",headTab:[{title:"商品信息",name:"1"},{title:"规格设置",name:"2"},{title:"商品详情",name:"3"}],type:0,attrVal:{price:null,cost:null,ot_price:null,stock:null,bar_code:"",weight:null,volume:null},attrs:[],attrsList:[],activeAtter:[],attrShow:!1,isGenerate:!1,createProduct:!1,generateArr:[],createCount:this.$route.params.id?0:-10}},computed:{attrValue:function(){var t=Object.assign({},this.attrVal);return t},oneFormBatch:function(){var t=[Object.assign({},S.attrValue[0])];return this.OneattrValue[0]&&this.OneattrValue[0]["image"]&&(t[0]["image"]=this.OneattrValue[0]["image"]),t[0]["attr"]="全部",delete t[0].bar_code,t}},watch:{"formValidate.attr":{handler:function(t){this.createCount+=1,1===this.formValidate.spec_type&&this.watCh(t)},immediate:!1,deep:!0}},created:function(){this.tempRoute=Object.assign({},this.$route),this.$route.params.id&&1===this.formValidate.spec_type&&this.$watch("formValidate.attr",this.watCh)},mounted:function(){var t=this;this.getCategoryList(),this.$route.params.id?(this.setTagsViewTitle(),this.$nextTick((function(){t.getInfo()}))):this.formValidate.slider_image=[],this.formValidate.attr.map((function(e){t.$set(e,"inputVisible",!1)})),this.type=this.$route.query.type||0},destroyed:function(){window.removeEventListener("popstate",this.goBack,!1)},methods:{setSort:function(){var t=this,e=this.$refs.tableParameter.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0];this.sortable=p.a.create(e,{ghostClass:"sortable-ghost",setData:function(t){t.setData("Text","")},onEnd:function(e){t.elChangeExForArray(e.oldIndex,e.newIndex,t.formValidate.params)}})},elChangeExForArray:function(t,e,a){var n=a[t];return a[t]=a[e],a[e]=n,a},goBack:function(){sessionStorage.clear(),window.history.back()},doCombination:function(t){var e=t.length-1,a=[],n=[];return r(t,0);function r(t,i){var o,s=Object(l["a"])(t[i]);try{for(s.s();!(o=s.n()).done;){var c=o.value;a[i]=c,i1)t.forEach((function(a,r){0===r&&(e=t[r]["detail"]);var i=[];e.forEach((function(e){t[r+1]&&t[r+1]["detail"]&&t[r+1]["detail"].forEach((function(a){var o=(0!==r?"":t[r]["value"]+"_$_")+e+"-$-"+t[r+1]["value"]+"_$_"+a;if(i.push(o),r===t.length-2){var s={image:"",price:0,cost:0,ot_price:0,select:!0,sku:e.sku,stock:0,bar_code:"",weight:0,volume:0,brokerage:0,brokerage_two:0};o.split("-$-").forEach((function(t,e){var a=t.split("_$_");s["detail"]||(s["detail"]={}),s["detail"][a[0]]=a.length>1?a[1]:""})),Object.values(s.detail).forEach((function(t,e){s["value"+e]=t})),n.push(s)}}))})),e=i.length?i:[]}));else{var r=[];t.forEach((function(t,e){t["detail"].forEach((function(e,a){r[a]=t["value"]+"_"+e,n[a]={image:"",price:0,cost:0,ot_price:0,select:!0,sku:"",stock:0,bar_code:"",weight:0,volume:0,brokerage:0,brokerage_two:0,detail:Object(c["a"])({},t["value"],e)},Object.values(n[a].detail).forEach((function(t,e){n[a]["value"+e]=t}))}))})),e.push(r.join("$&"))}return a.generateArr.length>0&&a.generateArr.forEach((function(t,e){n[e]["sku"]=t.sku})),n}},onChangeSpec:function(t){},changeIntergral:function(t){this.formValidate.integral_rate=-1==t?-1:this.formValidate.integral_rate},confirm:function(){var t=this;if(!this.selectRule)return this.$message.warning("请选择属性");this.ruleList.forEach((function(e){e.attr_template_id===t.selectRule&&(t.formValidate.attr=e.template_value,t.attrs=e.template_value)})),this.addmanyData(this.ManyAttrValue),this.getAttr()},addmanyData:function(t){t.forEach((function(t){t.select=!0})),this.ManyAttrValue=t},batchAttr:function(){this.attrShow=!0},activeAttr:function(t){this.attrsList=t},labelAttr:function(){this.attrShow=!1},getAttr:function(){this.oneFormBatch[0].attr="全部";var t=this.attrs;t.map((function(t){t.details=[],t.detail.map((function(e){t.details.push({name:e,select:!1})}))})),this.attrsList=t},getCategoryList:function(){var t=this;Object(h["xb"])().then((function(e){t.categoryList=e.data})).catch((function(e){t.$message.error(e.message)}))},productGetRule:function(){var t=this;Object(h["templateLsitApi"])().then((function(e){t.ruleList=e.data}))},showInput:function(t){this.$set(t,"inputVisible",!0)},addcustom:function(){this.formValidate.extend.length>9?this.$message.warning("最多添加10条"):this.formValidate.extend.push({title:"",key:"text",value:"",require:!1})},accMul:function(t,e){var a=0,n=t.toString(),r=e.toString();try{a+=n.split(".")[1].length}catch(i){}try{a+=r.split(".")[1].length}catch(i){}return Number(n.replace(".",""))*Number(r.replace(".",""))/Math.pow(10,a)},delAttrTable:function(t){this.ManyAttrValue.splice(t,1)},batchAdd:function(){var t,e=Object(l["a"])(this.ManyAttrValue);try{for(e.s();!(t=e.n()).done;){var a=t.value;a.select&&(""!=this.oneFormBatch[0].attr&&this.$set(a,"attr",this.oneFormBatch[0].attr),""!=this.oneFormBatch[0].image&&this.$set(a,"image",this.oneFormBatch[0].image),null!=this.oneFormBatch[0].price&&this.$set(a,"price",this.oneFormBatch[0].price),null!=this.oneFormBatch[0].cost&&this.$set(a,"cost",this.oneFormBatch[0].cost),null!=this.oneFormBatch[0].ot_price&&this.$set(a,"ot_price",this.oneFormBatch[0].ot_price),null!=this.oneFormBatch[0].svip_price&&this.$set(a,"svip_price",this.oneFormBatch[0].svip_price),null!=this.oneFormBatch[0].stock&&this.$set(a,"stock",this.oneFormBatch[0].stock),null!=this.oneFormBatch[0].bar_code&&this.$set(a,"bar_code",this.oneFormBatch[0].bar_code),null!=this.oneFormBatch[0].weight&&this.$set(a,"weight",this.oneFormBatch[0].weight),null!=this.oneFormBatch[0].volume&&this.$set(a,"volume",this.oneFormBatch[0].volume),null!=this.oneFormBatch[0].extension_one&&this.$set(a,"extension_one",this.oneFormBatch[0].extension_one),null!=this.oneFormBatch[0].extension_two&&this.$set(a,"extension_two",this.oneFormBatch[0].extension_two))}}catch(n){e.e(n)}finally{e.f()}},addBtn:function(){this.clearAttr(),this.isBtn=!0},offAttrName:function(){this.isBtn=!1},clearAttr:function(){this.formDynamic.attrsName="",this.formDynamic.attrsVal=""},handleRemoveAttr:function(t){this.formValidate.attr.splice(t,1),this.ManyAttrValue.splice(t,1)},handleClose:function(t,e){t.splice(e,1),this.attrs=this.formValidate.attr},createAttrName:function(){if(this.formDynamic.attrsName&&this.formDynamic.attrsVal){var t={value:this.formDynamic.attrsName,detail:[this.formDynamic.attrsVal]};this.formValidate.attr.push(t);var e={};this.formValidate.attr=this.formValidate.attr.reduce((function(t,a){return!e[a.value]&&(e[a.value]=t.push(a)),t}),[]),this.clearAttr(),this.attrs=this.formValidate.attr,this.isGenerate=!0,this.isBtn=!1}else this.$message.warning("请添加完整的规格!")},createAttr:function(t,e){if(t){this.formValidate.attr[e].detail.push(t);var a={};this.formValidate.attr[e].detail=this.formValidate.attr[e].detail.reduce((function(t,e){return!a[e]&&(a[e]=t.push(e)),t}),[]),this.formValidate.attr[e].inputVisible=!1}else this.$message.warning("请添加属性")},generate:function(){var t=this,e=this.$route.params.id||0;Object(h["eb"])(e,{attrs:this.attrs,product_type:this.formValidate.product_type}).then((function(e){var a=e.data;t.generateArr=e.data.value,t.formValidate.attr=e.data.attr,t.createProduct=!0,t.isGenerate=!0,"0"!==t.$route.params.id&&t.addmanyData(a.value),t.getAttr()})).catch((function(e){t.$message.error(e.message)}))},getInfo:function(){var t=this;this.fullscreenLoading=!0,Object(h["zb"])(this.$route.params.id).then(function(){var e=Object(s["a"])(Object(o["a"])().mark((function e(a){var n;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:n=a.data,t.infoData(n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.fullscreenLoading=!1,t.$message.error(e.message)}))},infoData:function(t){var e=this;this.deduction_set=-1==t.integral_rate?-1:1,this.attrs=t.attr||[],t.attrValue.forEach((function(t){t.select=!0})),this.formValidate={product_type:t.product_type||0,image:t.image,attrValue:t.attrValue,slider_image:t.slider_image,store_name:t.store_name,store_info:t.store_info,keyword:t.keyword,cate_id:1==this.type?"":Object(D["b"])(this.categoryList,"store_category_id",t.cate_id),is_used:t.is_used,unit_name:t.unit_name,sort:t.sort,once_max_count:t.once_max_count||1,is_hot:t.is_hot,attr:t.attr,content:t.content,spec_type:Number(t.spec_type),type:t.type||0},0===this.formValidate.spec_type?this.OneattrValue=t.attrValue:(this.ManyAttrValue=t.attrValue,this.ManyAttrValue.forEach((function(t){"undefined"!==t.detail&&null!==t.detail&&(e.attrInfo[Object.values(t.detail).sort().join("/")]=t)}))),this.getAttr(),this.fullscreenLoading=!1},handleRemove:function(t){this.formValidate.slider_image.splice(t,1)},modalPicTap:function(t,e,a){var n=this,r=[];this.$modalUpload((function(i){"1"!==t||e||(n.formValidate.image=i[0],n.OneattrValue[0].image=i[0]),"2"!==t||e||i.map((function(t){r.push(t.attachment_src),n.formValidate.slider_image.push(t),n.formValidate.slider_image.length>10&&(n.formValidate.slider_image.length=10)})),"1"===t&&"dan"===e&&(n.OneattrValue[0].image=i[0]),"1"===t&&"duo"===e&&(n.ManyAttrValue[a].image=i[0]),"1"===t&&"pi"===e&&(n.oneFormBatch[0].image=i[0])}),t)},handleSubmitUp:function(){this.currentTab=(Number(this.currentTab)-1).toString()},handleSubmitNest:function(t){var e=this;this.$refs[t].validate((function(t){t&&(e.currentTab=(Number(e.currentTab)+1).toString())}))},handleSubmit:function(t){var e=this;1===this.formValidate.spec_type?this.formValidate.attrValue=this.ManyAttrValue:(this.formValidate.attrValue=this.OneattrValue,this.formValidate.attr=[]),this.$refs[t].validate((function(a){if(a){e.fullscreenLoading=!0,e.loading=!0;var n=e.$route.params.id&&!e.$route.query.type;n?Object(h["Bb"])(e.$route.params.id,e.formValidate).then(function(){var a=Object(s["a"])(Object(o["a"])().mark((function a(n){return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success(n.message),e.$refs[t].resetFields(),e.formValidate.slider_image=[],e.$router.push({path:e.roterPre+"/marketing/integral/proList"}),e.loading=!1;case 6:case"end":return a.stop()}}),a)})));return function(t){return a.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1,e.loading=!1,e.$message.error(t.message)})):Object(h["Z"])(e.formValidate).then(function(){var a=Object(s["a"])(Object(o["a"])().mark((function a(n){return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success(n.message),e.$refs[t].resetFields(),e.formValidate.slider_image=[],e.$router.push({path:e.roterPre+"/marketing/integral/proList"}),e.loading=!1;case 6:case"end":return a.stop()}}),a)})));return function(t){return a.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1,e.loading=!1,e.$message.error(t.message)}))}else{if(!e.formValidate.store_name.trim())return e.$message.warning("商品名称不能为空");if(!e.formValidate.unit_name)return e.$message.warning("单位不能为空");if(!e.formValidate.cate_id)return e.$message.warning("商品分类不能为空");if(!e.formValidate.image)return e.$message.warning("商品封面图不能为空");if(e.formValidate.slider_image.length<0)return e.$message.warning("商品轮播图不能为空")}}))},handlePreview:function(t){var e=this;1===this.formValidate.spec_type?this.formValidate.attrValue=this.ManyAttrValue:(this.formValidate.attrValue=this.OneattrValue,this.formValidate.attr=[]),Object(h["productPreviewApi"])(this.formValidate).then(function(){var t=Object(s["a"])(Object(o["a"])().mark((function t(a){return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.previewVisible=!0,e.previewKey=a.data.preview_key;case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.message)}))},validate:function(t,e,a){!1===e&&this.$message.warning(a)},specPicValidate:function(t){for(var e=0;e