You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
24 KiB
1 lines
24 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c43671d"],{"0424":function(t,e,a){"use strict";a("9ee8")},"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:"mt30 acea-row row-middle row-center"},[a("el-col",{attrs:{span:24}},[a("el-form",{ref:"formValidate",staticClass:"form mt30",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":"150px"},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:"请输入套餐名称"},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",{attrs:{data:t.specsMainData}},[a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"200"},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":"80"},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":"120"},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:"submission mr15 mt20",attrs:{type:"primary"},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",{attrs:{data:t.specsData}},[a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"200"},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":"80"},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":"120"},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:"submission mr15 mt20",attrs:{type:"primary"},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},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,"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",{staticClass:"submission",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},on:{getProductId:t.getProductId}}):t._e()],1),t._v(" "),a("el-dialog",{staticClass:"paymentFooter",attrs:{visible:t.ggModel,title:"规格设置",width:"900px"},on:{"update:visible":function(e){t.ggModel=e}}},[a("div",{staticClass:"df"},[a("span",{staticStyle:{width:"75px"}},[t._v(" 优惠价:")]),t._v(" "),a("el-input-number",{staticClass:"m10",staticStyle:{width:"300px","text-align":"left"},attrs:{min:0},model:{value:t.rate_price,callback:function(e){t.rate_price=e},expression:"rate_price"}}),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.changeRatePrice()}}},[a("div",[t._v("批量添加")])])],1),t._v(" "),a("el-table",{ref:"multipleSelection",attrs:{data:t.manyFormValidate,"row-key":function(t){return t.unique},height:"500"},on:{"selection-change":t.selectOne}},[a("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55"}}),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",{attrs:{src:t.row.image,"preview-src-list":[t.row.image]}})],1)]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"规格",prop:"sku","min-width":"80"},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","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"会员价",prop:"is_svip_price","min-width":"80"}}),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']"}})]}}])})],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("2f62"),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(){console.log(this.$route.params),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;a<this.multipleSelection.length;a++){if(""==this.multipleSelection[a]["active_price"]||!this.multipleSelection[a]["active_price"])return this.$message.warning("请填写优惠价格");e.push({active_price:this.multipleSelection[a]["active_price"],unique:this.multipleSelection[a]["unique"]})}this.$set(t[this.tabIndex],"items",e),console.log(t[this.tabIndex]),this.ggModel=!1},clearOne:function(t){console.log(t)},limitPrice:function(t){t.active_price-t.price>0&&(t.active_price=t.price)},changeRatePrice:function(){var t,e=Object(n["a"])(this.manyFormValidate);try{for(e.s();!(t=e.n()).done;){var a=t.value;this.$set(a,"active_price",this.rate_price);for(var i=this.multipleSelection,s=0;s<i.length;s++)a.value===i[s].value&&this.$set(a,"_checked",!0)}}catch(r){e.e(r)}finally{e.f()}},generate:function(t,e){var a=this;this.product_id=t,Object(u["Y"])(t).then((function(t){a.ggModel=!0;var e=JSON.parse(JSON.stringify(t.data));console.log(e);var i="Main"===a.goodsAddType?a.specsMainData[a.tabIndex].attr||[]:a.specsData[a.tabIndex].attr||[],s=[];if(i.length)for(var r=0;r<e.length;r++)for(var l=0;l<i.length;l++){var n=i[l];n.sku===e[r].sku&&(a.$set(e[l],"active_price",n.productSku&&n.productSku.active_price||n.active_price),s.push(e[l]))}a.$nextTick((function(){s.forEach((function(t){a.$refs.multipleSelection.toggleRowSelection(t,!0)})),a.multipleSelection=s})),a.manyFormValidate=e,console.log(a.manyFormValidate)})).catch((function(t){a.$message.error(t.message)}))},getProductId:function(t){var e=this;if("Main"===this.goodsAddType&&(t.length>1||this.specsMainData.length>0))this.$message.warning("最多添加一个商品");else{for(var a=JSON.parse(JSON.stringify(t)),i=0;i<a.length;i++)a[i].attr=[];this.$nextTick((function(t){if("Main"===e.goodsAddType){var i=e.concat_arr(e.specsData,a);if(console.log(i),i.length)return e.$message.warning("已存在搭配商品");e.specsMainData=e.specsMainData.concat(a)}else{console.log(e.specsData,a);var s=e.concat_arr(e.specsData,a),r=e.concat_arr(e.specsMainData,a);if(console.log(s),s.length||r.length)return e.$message.warning("已存在相同主商品/搭配商品");e.specsData=e.specsData.concat(a),console.log(e.specsData)}e.modals=!1}))}},onchangeTime:function(t){console.log(t),this.timeVal=t,this.formValidate.time[0]=t?this.moment(t[0]).format("YYYY-MM-DD HH:mm:ss"):"",this.formValidate.time[1]=t?this.moment(t[1]).format("YYYY-MM-DD HH:mm:ss"):""},getInfo:function(){var t=this;Object(u["N"])(this.id).then((function(e){t.formValidate=e.data,t.timeVal=[new Date(t.formValidate.time[0]),new Date(t.formValidate.time[1])];for(var a=0;a<e.data.discountsProduct.length;a++){var i=e.data.discountsProduct[a];i.attr=[],i.items=[];for(var s=i["product"]&&i["product"]["attrValue"]||[],r=0;r<s.length;r++){var l=s[r];l.productSku&&(l["active_price"]=l["productSku"]["active_price"],i.attr.push(l),i.items.push({active_price:l["productSku"]["active_price"],unique:l["unique"]}))}1==i.type?t.specsMainData.push(i):t.specsData.push(i)}}))},next:function(t){var e,a=this;if(1===this.formValidate.type&&!this.specsMainData.length)return this.$Message.warning("请选择主商品");if(0===this.formValidate.type&&!this.specsData.length)return this.$message.warning("请选择套餐商品");if(this.specsMainData.forEach((function(t){t.type=1})),this.specsData.forEach((function(t){t.type=0})),1==this.formValidate.type?(console.log(this.specsMainData),e=this.specsMainData.concat(this.specsData)):e=this.specsData,e.length<2)return this.$message.warning("套餐内商品不能少于2个");for(var i=0;i<e.length;i++){e[i].temp_id=0;var s=e[i];if(!s.items)return console.log(s),this.$message.warning("请选择 ".concat(s.store_name," 的规格"))}if(this.formValidate.products=e,this.formValidate.temp_id=0,this.submitOpen)return!1;this.$refs[t].validate((function(t){if(!t)return!1;a.submitOpen=!0,a.id&&!a.copy?Object(u["Q"])(a.id,a.formValidate).then(function(){var t=Object(l["a"])(Object(r["a"])().mark((function t(e){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:a.$message.success(e.message),setTimeout((function(){a.submitOpen=!1,a.$router.push({path:"".concat(c["roterPre"],"/marketing/discounts/list")})}),500);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){a.submitOpen=!1,a.$message.error(t.message)})):Object(u["P"])(a.formValidate).then(function(){var t=Object(l["a"])(Object(r["a"])().mark((function t(e){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:console.log(e),a.$message.success(e.message),setTimeout((function(){a.submitOpen=!1,a.$router.push({path:"".concat(c["roterPre"],"/marketing/discounts/list")})}),500);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){a.submitOpen=!1,a.$message.error(t.message)}))}))},concat_arr:function(t,e){for(var a=[],i=0;i<t.length;i++){for(var s=t[i],r=s.product_id,l=!1,n=0;n<e.length;n++){var o=e[n],c=o.product_id;if(c==r){l=!0;break}}l&&a.push(s)}return a},modalPicTap:function(t,e,a){var i=this;this.$modalUpload((function(a){"1"!=t||e||(i.formValidate.image=a[0])}),t)},handleRemove:function(){this.formValidate.image=""},validate:function(t,e,a){return!1!==e||(this.$message.error(a),!1)},addGoods:function(t){this.goodsAddType=t,this.modals=!0},editGoods:function(t,e,a){this.goodsAddType=a,this.tabIndex=e,this.rate_price=0,this.generate(t.product_id,0)},deleteGoods:function(t,e){"Main"===e?this.specsMainData.splice(t,1):this.specsData.splice(t,1)},formatDate:function(t){if(t){var e=new Date(1e3*t);return Object(p["formatDate"])(e,"yyyy-MM-dd hh:mm")}return""}}},h=f,g=(a("0424"),a("2877")),v=Object(g["a"])(h,i,s,!1,null,"eb5cad02",null);e["default"]=v.exports},"9ee8":function(t,e,a){},c4ad:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"goodList"},[a("el-form",{attrs:{size:"small",inline:"","label-width":"150px"}},[a("el-form-item",{attrs:{label:"商品分类:"}},[a("el-select",{staticClass:"filter-item selWidth mr20",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},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",{attrs:{label:"商品搜索:"}},[a("el-input",{staticStyle:{width:"240px"},attrs:{placeholder:"请输入商品名称,关键字,编号"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},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:function(e){return t.getList(1)}},slot:"append"})],1)],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"table",attrs:{data:t.tableData.data},on:{"selection-change":t.changeCheckbox}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),t._v(" "),a("el-table-column",{attrs:{prop:"product_id",label:"商品id","min-width":"80"}}),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)]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"200"}}),t._v(" "),a("el-table-column",{attrs:{label:"售价",prop:"price","min-width":"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"会员价",prop:"svip_price","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[0==e.row.svip_price_type?a("span",[t._v("未设置")]):a("span",[t._v(t._s(e.row.svip_price))])]}}])})],1),t._v(" "),a("div",{staticClass:"acea-row row-right page"},[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),t._v(" "),"many"!==t.many||t.diy?t._e():a("div",{staticClass:"footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",size:"large",loading:t.modal_loading},on:{click:t.ok}},[t._v("提交")])],1)],1)},s=[],r=a("c80c"),l=(a("96cf"),a("3b8d")),n=(a("ac6a"),a("7f7f"),a("2f62"),a("c4c8")),o={name:"index",props:{is_new:{type:String,default:""},diy:{type:Boolean,default:!1},isdiy:{type:Boolean,default:!1},ischeckbox:{type:Boolean,default:!1},liveStatus:{type:Boolean,default:!1},isLive:{type:Boolean,default:!1},datas:{type:Object,default:function(){return{}}}},data:function(){return{cateIds:[],merCateList:[],modal_loading:!1,treeSelect:[],props:{emitPath:!1},tableFrom:{mer_cate_id:"",keyword:"",is_gift_bag:0,page:1,limit:15,is_ficti:0},total:0,modals:!1,loading:!1,tableData:{total:0,data:[]},currentid:0,productRow:{},images:[],diyVal:[],many:"",idKey:"product_id",multipleSelectionAll:[]}},computed:{},created:function(){var t="";t=this.ischeckbox?"many":this.$route.query.type,this.many=t},mounted:function(){this.getCategorySelect(),this.getList("")},methods:{handleSelectAll:function(){this.$refs.table.selectAll(!1)},changeCheckbox:function(t){var e=[];t.forEach((function(t){var a={image:t.image,product_id:t.product_id,store_name:t.store_name,temp_id:t.temp_id};e.push(a)})),this.images=e,this.diyVal=t,this.$emit("getProductDiy",t)},goodsCategory:function(){var t=this;Object(n["q"])(1).then((function(e){t.treeSelect=e.data})).catch((function(e){t.$message.error(e.message)}))},getCategorySelect:function(){var t=this;Object(n["r"])().then((function(e){t.merCateList=e.data})).catch((function(e){t.$message.error(e.message)}))},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")},getList:function(t){var e=this;e.loading=!0,e.tableFrom.page=t||e.tableFrom.page,Object(n["w"])(e.tableFrom).then(function(){var t=Object(l["a"])(Object(r["a"])().mark((function t(a){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.tableData.data=a.data.list,e.tableData.total=a.data.count,e.$nextTick((function(){e.setSelectRow()})),e.loading=!1;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$message.error(t.message)}))},setSelectRow:function(){if(this.multipleSelectionAll&&!(this.multipleSelectionAll.length<=0)){var t=this.idKey,e=[];this.multipleSelectionAll.forEach((function(a){e.push(a[t])})),this.$refs.table.clearSelection();for(var a=0;a<this.tableData.data.length;a++)e.indexOf(this.tableData.data[a][t])>=0&&this.$refs.table.toggleRowSelection(this.tableData.data[a],!0)}},ok:function(){if(this.images.length>0)if("image"===this.$route.query.fodder){var t=form_create_helper.get("image");form_create_helper.set("image",t.concat(this.images)),form_create_helper.close("image")}else this.isdiy?this.$emit("getProductId",this.diyVal):this.$emit("getProductId",this.images);else this.$message.warning("请先选择商品")},treeSearchs:function(t){this.cateIds=t,this.tableFrom.page=1,this.getList("")},userSearchs:function(){this.tableFrom.page=1,this.getList("")},clear:function(){this.productRow.id="",this.currentid=""}}},c=o,u=(a("ea29"),a("2877")),d=Object(u["a"])(c,i,s,!1,null,"4442b510",null);e["a"]=d.exports},d292:function(t,e,a){},ea29:function(t,e,a){"use strict";a("d292")}}]); |