chunk-68ae348e.1955b7e8.js 36 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-68ae348e"],{"0928":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",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("el-steps",{attrs:{active:t.currentTab,"align-center":"","finish-status":"success"}},[a("el-step",{attrs:{title:"选择拼团商品"}}),t._v(" "),a("el-step",{attrs:{title:"填写基础信息"}}),t._v(" "),a("el-step",{attrs:{title:"修改商品详情"}})],1)],1),t._v(" "),a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.fullscreenLoading,expression:"fullscreenLoading"}],ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":"160px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("div",{directives:[{name:"show",rawName:"v-show",value:0===t.currentTab,expression:"currentTab === 0"}],staticStyle:{overflow:"hidden"}},[a("el-row",{attrs:{gutter:24}},[a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"选择商品:",prop:"image"}},[a("div",{staticClass:"upLoadPicBox",on:{click:function(e){return t.add()}}},[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)],1)],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:1===t.currentTab,expression:"currentTab === 1"}]},[a("el-row",{attrs:{gutter:24}},[a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"商品主图:",prop:"image"}},[a("div",{staticClass:"upLoadPicBox",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,i){return a("div",{key:i,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(i)}}})])})),t._v(" "),t.formValidate.slider_image.length<10?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",{staticClass:"sp100"},[a("el-form-item",{attrs:{label:"拼团名称:",prop:"store_name"}},[a("el-input",{attrs:{placeholder:"请输入商品名称"},model:{value:t.formValidate.store_name,callback:function(e){t.$set(t.formValidate,"store_name",e)},expression:"formValidate.store_name"}})],1)],1)],1),t._v(" "),a("el-row",{attrs:{gutter:24}},[a("el-col",{staticClass:"sp100"},[a("el-form-item",{attrs:{label:"拼团简介:",prop:"store_info"}},[a("el-input",{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._v(" "),a("el-row",{attrs:{gutter:24}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"拼团时间:",required:""}},[a("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",align:"right"},on:{change:t.onchangeTime},model:{value:t.timeVal,callback:function(e){t.timeVal=e},expression:"timeVal"}}),t._v(" "),a("span",{staticClass:"item_desc"},[t._v("设置活动开启结束时间,用户可以在设置时间内发起参与拼团")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"运费模板:",prop:"temp_id"}},[a("div",{staticClass:"acea-row"},[a("el-select",{staticClass:"selWidthd mr20",attrs:{placeholder:"请选择"},model:{value:t.formValidate.temp_id,callback:function(e){t.$set(t.formValidate,"temp_id",e)},expression:"formValidate.temp_id"}},t._l(t.shippingList,(function(t){return a("el-option",{key:t.shipping_template_id,attrs:{label:t.name,value:t.shipping_template_id}})})),1),t._v(" "),a("el-button",{staticClass:"mr15",attrs:{size:"small"},on:{click:t.addTem}},[t._v("添加运费模板")])],1)])],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"拼团时效(单位:小时):",prop:"time"}},[a("el-input-number",{attrs:{min:1,placeholder:"请输入时效"},model:{value:t.formValidate.time,callback:function(e){t.$set(t.formValidate,"time",e)},expression:"formValidate.time"}}),t._v(" "),a("span",{staticClass:"item_desc"},[t._v("用户发起拼团后开始计时,需在设置时间内邀请到规定好友人数参团,超过时效时间,则系统判定拼团失败,自动发起退款")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"拼团人数:",prop:"buying_count_num"}},[a("el-input-number",{attrs:{min:2,placeholder:"请输入人数"},on:{change:t.calFictiCount},model:{value:t.formValidate.buying_count_num,callback:function(e){t.$set(t.formValidate,"buying_count_num",e)},expression:"formValidate.buying_count_num"}}),t._v(" "),a("span",{staticClass:"item_desc"},[t._v("单次拼团需要参与的用户数")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"活动期间限购件数:",prop:"pay_count"}},[a("el-input-number",{attrs:{min:1,placeholder:"请输入数量"},model:{value:t.formValidate.pay_count,callback:function(e){t.$set(t.formValidate,"pay_count",e)},expression:"formValidate.pay_count"}}),t._v(" "),a("span",{staticClass:"item_desc"},[t._v("该商品活动期间内,用户可购买的最大数量。例如设置为4,表示本地活动有效期内,每个用户最多可购买4件")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"单次限购件数:",prop:"once_pay_count"}},[a("el-input-number",{attrs:{min:1,max:t.formValidate.pay_count,placeholder:"请输入数量"},model:{value:t.formValidate.once_pay_count,callback:function(e){t.$set(t.formValidate,"once_pay_count",e)},expression:"formValidate.once_pay_count"}}),t._v(" "),a("span",{staticClass:"item_desc"},[t._v("用户参与拼团时,一次购买最大数量限制。例如设置为2,表示每次参与拼团时,用户一次购买数量最大可选择2个")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"单位:",prop:"unit_name"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{placeholder:"请输入单位"},model:{value:t.formValidate.unit_name,callback:function(e){t.$set(t.formValidate,"unit_name",e)},expression:"formValidate.unit_name"}})],1)],1)],1),t._v(" "),1==t.combinationData.ficti_status?a("el-row",{attrs:{gutter:24}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"虚拟成团:"}},[a("el-switch",{attrs:{"active-text":"开启","inactive-text":"关闭"},model:{value:t.formValidate.ficti_status,callback:function(e){t.$set(t.formValidate,"ficti_status",e)},expression:"formValidate.ficti_status"}})],1)],1),t._v(" "),1==t.formValidate.ficti_status?a("el-col",{attrs:{span:16}},[a("el-form-item",{attrs:{label:"虚拟成团补齐人数:",prop:"ficti_num"}},[a("el-input-number",{attrs:{min:0,max:t.max_ficti_num,placeholder:"请输入数量"},model:{value:t.formValidate.ficti_num,callback:function(e){t.$set(t.formValidate,"ficti_num",e)},expression:"formValidate.ficti_num"}}),t._v(" "),a("span",{staticClass:"item_desc"},[t._v("拼团时效到时,系统自动补齐的最大拼团人数")])],1)],1):t._e()],1):t._e(),t._v(" "),a("el-row",{attrs:{gutter:24}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"排序:",prop:"sort"}},[a("el-input-number",{attrs:{min:0,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:"显示状态"}},[a("el-radio-group",{model:{value:t.formValidate.is_show,callback:function(e){t.$set(t.formValidate,"is_show",e)},expression:"formValidate.is_show"}},[a("el-radio",{staticClass:"radio",attrs:{label:0}},[t._v("关闭")]),t._v(" "),a("el-radio",{attrs:{label:1}},[t._v("开启")])],1)],1)],1)],1),t._v(" "),a("el-row",{attrs:{gutter:24}},[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(" "),a("el-table-column",{attrs:{align:"center",label:"原价","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["price"]))])]}}],null,!1,1703924291)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"拼团价","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"priceBox",attrs:{type:"number",min:0,max:e.row["price"]},on:{blur:function(a){return t.limitPrice(e.row)}},model:{value:e.row["active_price"],callback:function(a){t.$set(e.row,"active_price",t._n(a))},expression:"scope.row['active_price']"}})]}}],null,!1,1431579223)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"成本价","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["cost"]))])]}}],null,!1,4236060069)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"库存","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["old_stock"]))])]}}],null,!1,1655454038)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"限量","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"priceBox",attrs:{type:"number",max:e.row["old_stock"],min:0},on:{change:function(a){return t.limitInventory(e.row)}},model:{value:e.row["stock"],callback:function(a){t.$set(e.row,"stock",t._n(a))},expression:"scope.row['stock']"}})]}}],null,!1,3327557396)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品编号","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["bar_code"]))])]}}],null,!1,2057585133)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"重量(KG)","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["weight"]))])]}}],null,!1,1649766542)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"体积(m³)","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["volume"]))])]}}],null,!1,2118841126)})],1)],1):t._e()],1)],1),t._v(" "),a("el-row",{attrs:{gutter:24}},[1===t.formValidate.spec_type?a("el-form-item",{staticClass:"labeltop",attrs:{label:"规格列表:"}},[a("el-table",{ref:"multipleSelection",attrs:{data:t.ManyAttrValue,"tooltip-effect":"dark","row-key":function(t){return t.id}},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{align:"center",type:"selection","reserve-selection":!0,"min-width":"50"}}),t._v(" "),t.manyTabDate?t._l(t.manyTabDate,(function(e,i){return a("el-table-column",{key:i,attrs:{align:"center",label:t.manyTabTit[i].title,"min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"priceBox",domProps:{textContent:t._s(e.row[i])}})]}}],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",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,3478746955)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"原价","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["price"]))])]}}],null,!1,1703924291)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"拼团价","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"priceBox",attrs:{type:"number",min:0,max:e.row["price"]},on:{blur:function(a){return t.limitPrice(e.row)}},model:{value:e.row["active_price"],callback:function(a){t.$set(e.row,"active_price",t._n(a))},expression:" scope.row['active_price']"}})]}}],null,!1,3314660055)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"成本价","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["cost"]))])]}}],null,!1,4236060069)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"库存","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["old_stock"]))])]}}],null,!1,1655454038)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"限量","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"priceBox",attrs:{type:"number",min:0,max:e.row["old_stock"]},model:{value:e.row["stock"],callback:function(a){t.$set(e.row,"stock",t._n(a))},expression:"scope.row['stock']"}})]}}],null,!1,4025255182)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"商品编号","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["bar_code"]))])]}}],null,!1,2057585133)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"重量(KG)","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["weight"]))])]}}],null,!1,1649766542)}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"体积(m³)","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row["volume"]))])]}}],null,!1,2118841126)})],2)],1):t._e()],1)],1),t._v(" "),a("el-row",{directives:[{name:"show",rawName:"v-show",value:2===t.currentTab,expression:"currentTab === 2"}]},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品详情:"}},[a("ueditorFrom",{attrs:{content:t.formValidate.content},model:{value:t.formValidate.content,callback:function(e){t.$set(t.formValidate,"content",e)},expression:"formValidate.content"}})],1)],1)],1),t._v(" "),a("el-form-item",{staticStyle:{"margin-top":"30px"}},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:t.currentTab>0,expression:"currentTab>0"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:t.handleSubmitUp}},[t._v("上一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:0==t.currentTab,expression:"currentTab == 0"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleSubmitNest1("formValidate")}}},[t._v("下一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==t.currentTab,expression:"currentTab == 1"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleSubmitNest2("formValidate")}}},[t._v("下一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:2===t.currentTab,expression:"currentTab===2"}],staticClass:"submission",attrs:{loading:t.loading,type:"primary",size:"small"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("提交")])],1)],1)],1),t._v(" "),a("goods-list",{ref:"goodsList",on:{getProduct:t.getProduct}})],1)},n=[],r=a("75fc"),o=(a("7f7f"),a("96cf"),a("3b8d")),s=(a("8615"),a("55dd"),a("ac6a"),a("ef0d")),l=a("6625"),c=a.n(l),u=a("7719"),m=a("c4c8"),d=a("b7be"),f=a("83d6"),p={product_id:"",image:"",slider_image:[],store_name:"",store_info:"",start_time:"",end_time:"",time:1,is_show:1,keyword:"",brand_id:"",cate_id:"",mer_cate_id:[],pay_count:1,unit_name:"",sort:0,is_good:0,temp_id:"",buying_count_num:2,ficti_status:!0,ficti_num:1,once_pay_count:1,attrValue:[{image:"",price:null,active_price:null,cost:null,ot_price:null,old_stock:null,stock:null,bar_code:"",weight:null,volume:null}],attr:[],extension_type:0,content:"",spec_type:0,is_gift_bag:0},_=[{name:"店铺推荐",value:"is_good"}],g={name:"ProductProductAdd",components:{ueditorFrom:s["a"],goodsList:u["a"],VueUeditorWrap:c.a},data:function(){return{pickerOptions:{disabledDate:function(t){return t.getTime()>Date.now()}},timeVal:"",max_ficti_num:0,dialogVisible:!1,product_id:"",multipleSelection:[],optionsCate:{value:"store_category_id",label:"cate_name",children:"children",emitPath:!1},roterPre:f["roterPre"],selectRule:"",checkboxGroup:[],recommend:_,tabs:[],fullscreenLoading:!1,props:{emitPath:!1},propsMer:{emitPath:!1,multiple:!0},active:0,OneattrValue:[Object.assign({},p.attrValue[0])],ManyAttrValue:[Object.assign({},p.attrValue[0])],ruleList:[],merCateList:[],categoryList:[],shippingList:[],BrandList:[],formValidate:Object.assign({},p),maxStock:"",addNum:0,singleSpecification:{},multipleSpecifications:[],formDynamics:{template_name:"",template_value:[]},manyTabTit:{},manyTabDate:{},grid2:{lg:10,md:12,sm:24,xs:24},formDynamic:{attrsName:"",attrsVal:""},isBtn:!1,manyFormValidate:[],images:[],currentTab:0,isChoice:"",combinationData:{ficti_status:0,group_buying_rate:""},grid:{xl:8,lg:8,md:12,sm:24,xs:24},loading:!1,ruleValidate:{store_name:[{required:!0,message:"请输入商品名称",trigger:"blur"}],timeVal:[{required:!0,message:"请选择拼团活动日期",trigger:"blur"}],time:[{required:!0,message:"请输入拼团时效",trigger:"blur"}],buying_count_num:[{required:!0,message:"请输入拼团人数",trigger:"blur"}],pay_count:[{required:!0,message:"请输入限购量",trigger:"blur"}],sort:[{required:!0,message:"请输入排序数值",trigger:"blur"}],once_pay_count:[{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"}],ficti_num:[{required:!0,message:"请输入虚拟成团补齐人数",trigger:"blur"}],image:[{required:!0,message:"请上传商品图",trigger:"change"}],slider_image:[{required:!0,message:"请上传商品轮播图",type:"array",trigger:"change"}]},attrInfo:{},keyNum:0,extensionStatus:0,isNew:!1}},computed:{attrValue:function(){var t=Object.assign({},p.attrValue[0]);return delete t.image,t},oneFormBatch:function(){var t=[Object.assign({},p.attrValue[0])];return delete t[0].bar_code,t}},watch:{"formValidate.attr":{handler:function(t){1===this.formValidate.spec_type&&this.watCh(t)},immediate:!1,deep:!0},"formValidate.buying_count_num":{handler:function(t,e){t&&1==this.formValidate.ficti_status&&(this.max_ficti_num=Math.round((1-this.combinationData.group_buying_rate/100)*this.formValidate.buying_count_num),this.isNew&&this.formValidate.ficti_num>this.max_ficti_num&&(this.formValidate.ficti_num=this.max_ficti_num))},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.formValidate.slider_image=[],this.getCombinationData(),this.$route.params.id?(this.setTagsViewTitle(),this.getInfo(this.$route.params.id),this.currentTab=1):this.formValidate.attr.map((function(e){t.$set(e,"inputVisible",!1)})),this.getCategorySelect(),this.getCategoryList(),this.getBrandListApi(),this.getShippingList(),this.$store.dispatch("settings/setEdit",!0)},methods:{getCombinationData:function(){var t=this;Object(d["q"])().then((function(e){t.combinationData=e.data})).catch((function(e){t.$message.error(e.message)}))},calFictiCount:function(){this.max_ficti_num=Math.round((1-this.combinationData.group_buying_rate/100)*this.formValidate.buying_count_num),this.isNew=!0,this.formValidate.ficti_num>this.max_ficti_num&&(this.formValidate.ficti_num=this.max_ficti_num)},limitInventory:function(t){t.stock-t.old_stock>0&&(t.stock=t.old_stock)},limitPrice:function(t){t.active_price-t.price>0&&(t.active_price=t.price)},add:function(){this.$refs.goodsList.dialogVisible=!0},getProduct:function(t){this.formValidate.image=t.src,this.product_id=t.id,console.log(this.product_id)},handleSelectionChange:function(t){this.multipleSelection=t},onchangeTime:function(t){this.timeVal=t,console.log(this.moment(t[0]).format("YYYY-MM-DD HH:mm:ss")),this.formValidate.start_time=t?this.moment(t[0]).format("YYYY-MM-DD HH:mm:ss"):"",this.formValidate.end_time=t?this.moment(t[1]).format("YYYY-MM-DD HH:mm:ss"):""},setTagsViewTitle:function(){var t="编辑商品",e=Object.assign({},this.tempRoute,{title:"".concat(t,"-").concat(this.$route.params.id)});this.$store.dispatch("tagsView/updateVisitedView",e)},watCh:function(t){var e=this,a={},i={};this.formValidate.attr.forEach((function(t,e){a["value"+e]={title:t.value},i["value"+e]=""})),this.ManyAttrValue.forEach((function(t,a){var i=Object.values(t.detail).sort().join("/");e.attrInfo[i]&&(e.ManyAttrValue[a]=e.attrInfo[i])})),this.attrInfo={},this.ManyAttrValue.forEach((function(t){e.attrInfo[Object.values(t.detail).sort().join("/")]=t})),this.manyTabTit=a,this.manyTabDate=i,console.log(this.manyTabTit),console.log(this.manyTabDate)},addTem:function(){var t=this;this.$modalTemplates(0,(function(){t.getShippingList()}))},getCategorySelect:function(){var t=this;Object(m["n"])().then((function(e){t.merCateList=e.data})).catch((function(e){t.$message.error(e.message)}))},getCategoryList:function(){var t=this;Object(m["m"])().then((function(e){t.categoryList=e.data})).catch((function(e){t.$message.error(e.message)}))},getBrandListApi:function(){var t=this;Object(m["l"])().then((function(e){t.BrandList=e.data})).catch((function(e){t.$message.error(e.message)}))},productGetRule:function(){var t=this;Object(m["db"])().then((function(e){t.ruleList=e.data}))},getShippingList:function(){var t=this;Object(m["Q"])().then((function(e){t.shippingList=e.data}))},getInfo:function(t){var e=this;this.fullscreenLoading=!0,this.$route.params.id?Object(d["t"])(t).then(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(a){var i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=a.data,e.formValidate={product_id:i.product_group_id,image:i.product.image,slider_image:i.product.slider_image,store_name:i.product.store_name,store_info:i.product.store_info,unit_name:i.product.unit_name,time:i.time,buying_count_num:i.buying_count_num,ficti_status:!!i.ficti_status,start_time:i.start_time?i.start_time:"",end_time:i.end_time?i.end_time:"",brand_id:i.product.brand_id,cate_id:i.cate_id?i.cate_id:"",mer_cate_id:i.mer_cate_id,pay_count:i.pay_count,once_pay_count:i.once_pay_count,sort:i.product.sort,is_good:i.product.is_good,temp_id:i.product.temp_id,is_show:i.is_show,attr:i.product.attr,extension_type:i.extension_type,content:i.product.content.content,spec_type:i.product.spec_type,is_gift_bag:i.product.is_gift_bag,ficti_num:i.ficti_num},1===e.combinationData.ficti_status&&(e.max_ficti_num=Math.round((1-e.combinationData.group_buying_rate/100)*i.buying_count_num)),0===e.formValidate.spec_type?(e.OneattrValue=i.product.attrValue,e.OneattrValue.forEach((function(t,a){e.attrInfo[Object.values(t.detail).sort().join("/")]=t,e.$set(e.OneattrValue[a],"active_price",t._sku?t._sku.active_price:t.price),e.$set(e.OneattrValue[a],"stock",t._sku?t._sku.stock:t.old_stock)})),e.singleSpecification=JSON.parse(JSON.stringify(i.product.attrValue)),e.formValidate.attrValue=e.OneattrValue):(n=[],e.ManyAttrValue=i.product.attrValue,e.ManyAttrValue.forEach((function(t,a){e.attrInfo[Object.values(t.detail).sort().join("/")]=t,e.$set(e.ManyAttrValue[a],"active_price",t._sku?t._sku.active_price:t.price),e.$set(e.ManyAttrValue[a],"stock",t._sku?t._sku.stock:t.old_stock),t._sku&&(e.multipleSpecifications=JSON.parse(JSON.stringify(i.product.attrValue)),n.push(t))})),e.multipleSpecifications=JSON.parse(JSON.stringify(n)),e.$nextTick((function(){n.forEach((function(t){e.$refs.multipleSelection.toggleRowSelection(t,!0)}))})),e.formValidate.attrValue=e.multipleSelection),console.log(e.ManyAttrValue),e.fullscreenLoading=!1,e.timeVal=[new Date(e.formValidate.start_time),new Date(e.formValidate.end_time)],e.$store.dispatch("settings/setEdit",!0);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1,e.$message.error(t.message)})):Object(m["D"])(t).then(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(a){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=a.data,e.formValidate={product_id:i.product_id,image:i.image,slider_image:i.slider_image,store_name:i.store_name,store_info:i.store_info,unit_name:i.unit_name,time:1,buying_count_num:2,ficti_status:!0,start_time:"",end_time:"",brand_id:i.brand_id,cate_id:i.cate_id,mer_cate_id:i.mer_cate_id,pay_count:1,once_pay_count:1,sort:i.sort?i.sort:0,is_good:i.is_good,temp_id:i.temp_id,is_show:i.is_show,attr:i.attr,extension_type:i.extension_type,content:i.content,spec_type:i.spec_type,is_gift_bag:i.is_gift_bag,ficti_num:1===e.combinationData.ficti_status?Math.round(1-e.combinationData.group_buying_rate/100):""},1===e.combinationData.ficti_status&&(e.max_ficti_num=Math.round(1*(1-e.combinationData.group_buying_rate/100))),e.timeVal=[],0===e.formValidate.spec_type?(e.OneattrValue=i.attrValue,e.OneattrValue.forEach((function(t,a){e.$set(e.OneattrValue[a],"active_price",e.OneattrValue[a].price)})),e.singleSpecification=JSON.parse(JSON.stringify(i.attrValue)),e.formValidate.attrValue=e.OneattrValue):(e.ManyAttrValue=i.attrValue,e.multipleSpecifications=JSON.parse(JSON.stringify(i.attrValue)),e.ManyAttrValue.forEach((function(t,a){e.attrInfo[Object.values(t.detail).sort().join("/")]=t,e.$set(e.ManyAttrValue[a],"active_price",e.ManyAttrValue[a].price)})),e.multipleSelection=i.attrValue,e.$nextTick((function(){i.attrValue.forEach((function(t){e.$refs.multipleSelection.toggleRowSelection(t,!0)}))}))),1===e.formValidate.is_good&&e.checkboxGroup.push("is_good"),e.fullscreenLoading=!1;case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1,e.$message.error(t.message)}))},handleRemove:function(t){this.formValidate.slider_image.splice(t,1)},modalPicTap:function(t,e,a){var i=this,n=[];this.$modalUpload((function(r){"1"!==t||e||(i.formValidate.image=r[0],i.OneattrValue[0].image=r[0]),"2"!==t||e||r.map((function(t){n.push(t.attachment_src),i.formValidate.slider_image.push(t),i.formValidate.slider_image.length>10&&(i.formValidate.slider_image.length=10)})),"1"===t&&"dan"===e&&(i.OneattrValue[0].image=r[0]),"1"===t&&"duo"===e&&(i.ManyAttrValue[a].image=r[0]),"1"===t&&"pi"===e&&(i.oneFormBatch[0].image=r[0])}),t)},handleSubmitUp:function(){this.currentTab--<0&&(this.currentTab=0)},handleSubmitNest1:function(t){this.formValidate.image?(this.currentTab++,this.$route.params.id||this.getInfo(this.product_id)):this.$message.warning("请选择商品!")},handleSubmitNest2:function(t){var e=this;1===this.formValidate.spec_type?this.formValidate.attrValue=this.multipleSelection:this.formValidate.attrValue=this.OneattrValue,console.log(this.formValidate),this.$refs[t].validate((function(t){if(t){if(!e.formValidate.store_name||!e.formValidate.store_info||!e.formValidate.image||!e.formValidate.slider_image)return void e.$message.warning("请填写完整拼团商品信息!");if(!e.formValidate.start_time||!e.formValidate.end_time)return void e.$message.warning("请选择拼团时间!");if(!e.formValidate.attrValue||0===e.formValidate.attrValue.length)return void e.$message.warning("请选择商品规格!");e.currentTab++}}))},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(a){a?(e.$store.dispatch("settings/setEdit",!1),e.fullscreenLoading=!0,e.loading=!0,console.log(e.formValidate),e.$route.params.id?(console.log(e.ManyAttrValue),Object(d["w"])(e.$route.params.id,e.formValidate).then(function(){var a=Object(o["a"])(regeneratorRuntime.mark((function a(i){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success(i.message),e.$router.push({path:e.roterPre+"/marketing/combination/combination_goods"}),e.$refs[t].resetFields(),e.formValidate.slider_image=[],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(d["p"])(e.formValidate).then(function(){var a=Object(o["a"])(regeneratorRuntime.mark((function a(i){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success(i.message),e.$router.push({path:e.roterPre+"/marketing/combination/combination_goods"}),e.$refs[t].resetFields(),e.formValidate.slider_image=[],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)}))):e.formValidate.store_name&&e.formValidate.store_info&&e.formValidate.image&&e.formValidate.slider_image||e.$message.warning("请填写完整商品信息!")}))},validate:function(t,e,a){!1===e&&this.$message.warning(a)},handleDragStart:function(t,e){this.dragging=e},handleDragEnd:function(t,e){this.dragging=null},handleDragOver:function(t){t.dataTransfer.dropEffect="move"},handleDragEnter:function(t,e){if(t.dataTransfer.effectAllowed="move",e!==this.dragging){var a=Object(r["a"])(this.formValidate.slider_image),i=a.indexOf(this.dragging),n=a.indexOf(e);a.splice.apply(a,[n,0].concat(Object(r["a"])(a.splice(i,1)))),this.formValidate.slider_image=a}}}},h=g,b=(a("c084"),a("2877")),v=Object(b["a"])(h,i,n,!1,null,"650019b1",null);e["default"]=v.exports},"504c":function(t,e,a){var i=a("9e1e"),n=a("0d58"),r=a("6821"),o=a("52a7").f;t.exports=function(t){return function(e){var a,s=r(e),l=n(s),c=l.length,u=0,m=[];while(c>u)a=l[u++],i&&!o.call(s,a)||m.push(t?[a,s[a]]:s[a]);return m}}},7719:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.dialogVisible?a("el-dialog",{attrs:{title:"商品信息",visible:t.dialogVisible,width:"1200px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{staticClass:"divBox"},[a("div",{staticClass:"header clearfix"},[a("div",{staticClass:"container"},[a("el-form",{attrs:{size:"small",inline:"","label-width":"100px"}},[a("el-form-item",{staticClass:"width100",attrs:{label:"商品分类:"}},[a("el-select",{staticClass:"filter-item selWidth mr20",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList()}},model:{value:t.tableFrom.mer_cate_id,callback:function(e){t.$set(t.tableFrom,"mer_cate_id",e)},expression:"tableFrom.mer_cate_id"}},t._l(t.merCateList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),a("el-form-item",{staticClass:"width100",attrs:{label:"商品搜索:"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入商品名称,关键字,产品编号",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(e)}},model:{value:t.tableFrom.keyword,callback:function(e){t.$set(t.tableFrom,"keyword",e)},expression:"tableFrom.keyword"}},[a("el-button",{staticClass:"el-button-solt",attrs:{slot:"append",icon:"el-icon-search"},on:{click:t.getList},slot:"append"})],1)],1)],1)],1)]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData.data,size:"mini"}},[a("el-table-column",{attrs:{width:"55"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-radio",{attrs:{label:e.row.product_id},nativeOn:{change:function(a){return t.getTemplateRow(e.row)}},model:{value:t.templateRadio,callback:function(e){t.templateRadio=e},expression:"templateRadio"}},[t._v(" ")])]}}],null,!1,3465899556)}),t._v(" "),a("el-table-column",{attrs:{prop:"product_id",label:"ID","min-width":"50"}}),t._v(" "),a("el-table-column",{attrs:{label:"商品图","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("div",{staticClass:"demo-image__preview"},[a("el-image",{staticStyle:{width:"36px",height:"36px"},attrs:{src:t.row.image,"preview-src-list":[t.row.image]}})],1)]}}],null,!1,2331550732)}),t._v(" "),a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"200"}})],1),t._v(" "),a("div",{staticClass:"block mb20"},[a("el-pagination",{attrs:{"page-sizes":[20,40,60,80],"page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, sizes, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1)]):t._e()},n=[],r=a("c4c8"),o=a("83d6"),s={name:"GoodsList",data:function(){return{dialogVisible:!1,templateRadio:0,merCateList:[],roterPre:o["roterPre"],listLoading:!0,tableData:{data:[],total:0},tableFrom:{page:1,limit:20,cate_id:"",store_name:"",keyword:"",is_gift_bag:0,status:1},multipleSelection:{},checked:[]}},mounted:function(){var t=this;this.getList(),this.getCategorySelect(),window.addEventListener("unload",(function(e){return t.unloadHandler(e)}))},methods:{getTemplateRow:function(t){this.multipleSelection={src:t.image,id:t.product_id},this.dialogVisible=!1,this.$emit("getProduct",this.multipleSelection)},getCategorySelect:function(){var t=this;Object(r["n"])().then((function(e){t.merCateList=e.data})).catch((function(e){t.$message.error(e.message)}))},getList:function(){var t=this;this.listLoading=!0,Object(r["F"])(this.tableFrom).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},pageChange:function(t){this.tableFrom.page=t,this.getList()},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList()}}},l=s,c=(a("a035"),a("2877")),u=Object(c["a"])(l,i,n,!1,null,"068914aa",null);e["a"]=u.exports},8518:function(t,e,a){},8615:function(t,e,a){var i=a("5ca1"),n=a("504c")(!1);i(i.S,"Object",{values:function(t){return n(t)}})},9157:function(t,e,a){},a035:function(t,e,a){"use strict";var i=a("8518"),n=a.n(i);n.a},c084:function(t,e,a){"use strict";var i=a("9157"),n=a.n(i);n.a},ef0d:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("vue-ueditor-wrap",{staticStyle:{width:"90%"},attrs:{config:t.myConfig},on:{beforeInit:t.addCustomDialog},model:{value:t.contents,callback:function(e){t.contents=e},expression:"contents"}})],1)},n=[],r=a("6625"),o=a.n(r),s=a("83d6"),l={name:"Index",components:{VueUeditorWrap:o.a},scrollerHeight:{content:String,default:""},props:{content:{type:String,default:""}},data:function(){return{contents:this.content,myConfig:{autoHeightEnabled:!1,initialFrameHeight:500,initialFrameWidth:"100%",UEDITOR_HOME_URL:"/UEditor/"}}},watch:{content:function(t){this.contents=this.content},contents:function(t){this.$emit("input",t)}},created:function(){},methods:{addCustomDialog:function(t){window.UE.registerUI("test-dialog",(function(t,e){var a=new window.UE.ui.Dialog({iframeUrl:s["roterPre"]+"/setting/uploadPicture?field=dialog",editor:t,name:e,title:"上传图片",cssRules:"width:1000px;height:620px;padding:20px;"});this.dialog=a;var i=new window.UE.ui.Button({name:"dialog-button",title:"上传图片",cssRules:"background-image: url(@/assets/images/icons.png);background-position: -726px -77px;",onclick:function(){a.render(),a.open()}});return i}),37)}}},c=l,u=a("2877"),m=Object(u["a"])(c,i,n,!1,null,"13e22827",null);e["a"]=m.exports}}]);