(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-680ee201"],{"0bbe":function(t,e,a){"use strict";a("9564")},"5b55":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("el-row",{staticClass:"acea-row row-middle row-center"},[a("el-col",{attrs:{span:24}},[a("el-form",{ref:"formValidate",staticClass:"form",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":"100px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-row",{directives:[{name:"show",rawName:"v-show",value:0===t.current,expression:"current === 0"}]},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"套餐名称:",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入套餐名称",size:"small"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"套餐时间:",prop:1==t.formValidate.is_time?"time":""}},[a("el-radio-group",{attrs:{"element-id":"is_time"},model:{value:t.formValidate.is_time,callback:function(e){t.$set(t.formValidate,"is_time",e)},expression:"formValidate.is_time"}},[a("el-radio",{attrs:{label:0}},[t._v("不限时")]),t._v(" "),a("el-radio",{staticClass:"radio",attrs:{label:1}},[t._v("限时")])],1),t._v(" "),1==t.formValidate.is_time?a("div",{staticClass:"acea-row row-middle",staticStyle:{display:"inline-block","margin-left":"15px"}},[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"}})],1):t._e()],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"套餐类型:",prop:"type","label-for":"type"}},[a("el-radio-group",{attrs:{"element-id":"type"},model:{value:t.formValidate.type,callback:function(e){t.$set(t.formValidate,"type",e)},expression:"formValidate.type"}},[a("el-radio",{staticClass:"radio",attrs:{label:0}},[t._v("固定套餐")]),t._v(" "),a("el-radio",{attrs:{label:1}},[t._v("搭配套餐")])],1),t._v(" "),a("div",{staticClass:"ml100 grey"},[t._v("\n "+t._s(0==t.formValidate.type?"套餐内所有商品打包销售,消费者需成套购买整个套餐":"套餐内主商品必选,搭配商品任意选择1件及以上即可购买套餐")+"\n ")])],1)],1),t._v(" "),1==t.formValidate.type?a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"套餐主商品:",prop:"products","label-for":"products"}},[a("el-table",{staticClass:"table",attrs:{data:t.specsMainData,size:"small"}},[a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"260"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"product-data"},[a("img",{staticClass:"image",attrs:{src:e.row.image}}),t._v(" "),a("div",[t._v(t._s(e.row.store_name))])])]}}],null,!1,338878098)}),t._v(" "),a("el-table-column",{attrs:{label:"参与规格","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.attr,(function(e,i){return a("div",{key:i},[t._v("\n "+t._s(e.sku||"默认")+" | "+t._s(e.active_price||e.price)+"\n ")])}))}}],null,!1,1237844034)}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.editGoods(e.row,e.$index,"Main")}}},[t._v("设置规格")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.deleteGoods(e.$index,"Main")}}},[t._v("删除")])]}}],null,!1,1942046363)})],1),t._v(" "),t.specsMainData.length<1?a("el-button",{staticClass:"mt20",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.addGoods("Main")}}},[t._v("添加商品")]):t._e()],1)],1):t._e(),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:1==t.formValidate.type?"套餐搭配商品:":"套餐商品:",prop:"products","label-for":"products"}},[a("el-table",{staticClass:"table",attrs:{data:t.specsData,size:"small"}},[a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"260"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"product-data"},[a("img",{staticClass:"image",attrs:{src:e.row.image}}),t._v(" "),a("div",[t._v(t._s(e.row.store_name))])])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"参与规格","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.attr,(function(e,i){return a("div",{key:i},[t._v("\n "+t._s(e.sku||"默认")+" | "+t._s(e.active_price||e.price)+"\n ")])}))}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.editGoods(e.row,e.$index,"Other")}}},[t._v("设置规格")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.deleteGoods(e.$index,"Other")}}},[t._v("删除")])]}}])})],1),t._v(" "),t.specsData.length<50?a("el-button",{staticClass:"mr15 mt20",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.addGoods("Other")}}},[t._v("添加商品")]):t._e()],1)],1),t._v(" "),a("el-col",[a("el-form-item",{attrs:{label:"套餐数量:",prop:1==t.formValidate.is_limit?"limit_num":"","label-for":"limit_num"}},[a("el-radio-group",{attrs:{"element-id":"is_limit"},model:{value:t.formValidate.is_limit,callback:function(e){t.$set(t.formValidate,"is_limit",e)},expression:"formValidate.is_limit"}},[a("el-radio",{attrs:{label:0}},[t._v("不限量")]),t._v(" "),a("el-radio",{staticClass:"radio",attrs:{label:1}},[t._v("限量")])],1),t._v(" "),1==t.formValidate.is_limit?a("el-input-number",{staticStyle:{"margin-left":"15px"},attrs:{placeholder:"请输入限量数量",min:0,max:99999,precision:0},model:{value:t.formValidate.limit_num,callback:function(e){t.$set(t.formValidate,"limit_num",e)},expression:"formValidate.limit_num"}}):t._e()],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"排序:","label-for":"sort"}},[a("el-input-number",{attrs:{placeholder:"请输入排序序号",min:0,max:999999,precision:0,size:"small"},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:"套餐包邮:",prop:"free_shipping","label-for":"status"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"是","inactive-text":"否"},model:{value:t.formValidate.free_shipping,callback:function(e){t.$set(t.formValidate,"free_shipping",e)},expression:"formValidate.free_shipping"}}),t._v(" "),a("div",{staticClass:"ml100 grey"},[t._v("\n 不包邮时,将按照商品的运费模板进行计算\n ")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"上架状态:",prop:"status","label-for":"status"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,width:55,"active-text":"上架","inactive-text":"下架"},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}})],1)],1)],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",loading:t.submitOpen},on:{click:function(e){return t.next("formValidate")}}},[t.submitOpen?a("div",[t._v("提交中")]):a("div",[t._v("提交")])])],1)],1)],1)],1)],1),t._v(" "),a("el-dialog",{staticClass:"paymentFooter",attrs:{visible:t.modals,title:"商品列表",width:"900px"},on:{"update:visible":function(e){t.modals=e}}},[t.modals?a("goods-list",{ref:"goodslist",attrs:{ischeckbox:!0,isDiscount:!0},on:{getProductId:t.getProductId,close:t.closeModals}}):t._e()],1),t._v(" "),a("el-dialog",{staticClass:"paymentFooter",attrs:{visible:t.ggModel,title:"规格设置",width:"800px"},on:{"update:visible":function(e){t.ggModel=e}}},[a("div",{staticClass:"df mt15"},[a("el-form",{attrs:{inline:""}},[a("el-form-item",{attrs:{label:"优惠价:"}},[a("el-input-number",{attrs:{min:0},model:{value:t.rate_price,callback:function(e){t.rate_price=e},expression:"rate_price"}}),t._v(" "),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.changeRatePrice()}}},[t._v("批量添加")])],1)],1)],1),t._v(" "),a("el-table",{ref:"multipleSelection",attrs:{data:t.manyFormValidate,"row-key":function(t){return t.unique},height:"420",size:"small"},on:{"selection-change":t.selectOne}},[a("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"图片",width:"100"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("div",{staticClass:"demo-image__preview"},[a("el-image",{attrs:{src:t.row.image,"preview-src-list":[t.row.image]}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"规格",prop:"sku",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.sku||"默认"))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"售价",prop:"price",width:"100"}}),t._v(" "),a("el-table-column",{attrs:{label:"会员价",prop:"is_svip_price",width:"100"}}),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"优惠价","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{staticStyle:{width:"100px"},attrs:{controls:!1,precision:2,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",a)},expression:"scope.row['active_price']"}})]}}])})],1),t._v(" "),a("el-button",{staticClass:"mt10",staticStyle:{width:"100%"},attrs:{type:"primary"},on:{click:t.getAttr}},[a("div",[t._v("提交")])])],1)],1)},s=[],r=a("c80c"),l=(a("96cf"),a("3b8d")),n=(a("7f7f"),a("2d63")),o=(a("ac6a"),a("c4ad")),c=a("83d6"),u=a("b7be"),d={title:[{required:!0,message:"请输入套餐名称",trigger:"blur"}],type:[{required:!0,type:"number",message:"请选择套餐类型",trigger:"change"}],time:[{required:!0,validator:m,trigger:"change"}],limit_num:[{required:!0,type:"number",message:"请输入套餐数量",trigger:"blur"}],image:[{required:!0,message:"请上传套餐主图",trigger:"change"}]};function m(t,e,a){if(console.log(e),Array.isArray(e))e.map((function(t){if(""===t)return a("日期不能为空")}));else if(""===e)return a("日期不能为空");return a()}var p=a("61f7"),f={name:"lotteryCreate",components:{goodsList:o["a"]},data:function(){return{roterPre:c["roterPre"],ggModel:!1,modals:!1,loading:!1,timeVal:"",manyFormValidate:[],multipleSelection:[],submitOpen:!1,spinShow:!1,addGoodsModel:!1,isChoice:"单选",current:0,modalPic:!1,modal_loading:!1,images:[],goodsAddType:"",specsMainData:[],specsData:[],formValidate:{title:"",type:0,is_time:0,is_limit:0,limit_num:0,link_ids:[],time:[],sort:0,free_shipping:1,status:1,products:[]},ruleValidate:d,currentid:"",picTit:"",tableIndex:0,copy:0,editIndex:null,id:"",rate_price:0}},computed:{},mounted:function(){this.$route.params.id&&(this.setTagsViewTitle(),this.id=parseInt(this.$route.params.id),this.current=0,this.copy=this.$route.params.copy||0,this.getInfo())},methods:{setTagsViewTitle:function(){var t="编辑套餐",e=Object.assign({},this.tempRoute,{title:"".concat(t,"-").concat(this.$route.params.id)});this.$store.dispatch("tagsView/updateVisitedView",e)},selectOne:function(t){var e=this;this.multipleSelection=[],t.forEach((function(t,a){t.product_id==e.product_id&&e.multipleSelection.push(t)}))},getAttr:function(){if(!this.multipleSelection.length)return this.$message.warning("请先选择规格");var t;t="Main"===this.goodsAddType?this.specsMainData:this.specsData,this.$set(t[this.tabIndex],"attr",this.multipleSelection);for(var e=[],a=0;a0&&(t.active_price=t.price)},changeRatePrice:function(){var t,e=Object(n["a"])(this.manyFormValidate);try{for(e.s();!(t=e.n()).done;)for(var a=t.value,i=this.multipleSelection,s=0;s1||this.specsMainData.length>0))this.$message.warning("最多添加一个商品");else{for(var a=JSON.parse(JSON.stringify(t)),i=0;i