canyin-project/ybcy/views/channel/index/static/js/chunk-8fb8296e.db253dcb.js
2024-11-01 16:07:54 +08:00

1 line
27 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8fb8296e"],{"0c89":function(e,t,a){},2835:function(e,t,a){"use strict";var r=a("0c89"),s=a.n(r);s.a},"2b21":function(e,t,a){},"6ea5":function(e,t,a){"use strict";var r=a("798c"),s=a.n(r);s.a},"798c":function(e,t,a){},"919c":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"selectgood"},[a("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"1200px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close}},[a("div",{},[a("el-form",{staticClass:"demo-form-inline searchform",attrs:{inline:!0,model:e.formInline,"label-width":"120px"}},[a("div",{staticClass:"mar_b20"},[a("el-form-item",{attrs:{label:"按门店名称:"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{size:"medium",placeholder:"请输入门店名称搜索"},on:{input:e.onSearch},model:{value:e.formInline.keyword,callback:function(t){e.$set(e.formInline,"keyword",t)},expression:"formInline.keyword"}})],1),a("el-form-item",{attrs:{label:"按门店类别:"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.onSearch},model:{value:e.formInline.type,callback:function(t){e.$set(e.formInline,"type",t)},expression:"formInline.type"}},e._l(e.typeOptions,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"mar_l20",attrs:{label:"按门店区域:"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.onSearch},model:{value:e.formInline.areaId,callback:function(t){e.$set(e.formInline,"areaId",t)},expression:"formInline.areaId"}},e._l(e.qyOptions,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"mar_t20",attrs:{label:"按门店分组:"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.onSearch},model:{value:e.formInline.typeId,callback:function(t){e.$set(e.formInline,"typeId",t)},expression:"formInline.typeId"}},e._l(e.fzOptions,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"mar_t20",attrs:{label:"按门店标签:"}},[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.onSearch},model:{value:e.formInline.label,callback:function(t){e.$set(e.formInline,"label",t)},expression:"formInline.label"}},e._l(e.labelOptions,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"mar_t20"},[a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.onSearch}},[e._v("搜索")])],1)],1)]),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,stripe:""},on:{"selection-change":e.setSelectRows}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"name",label:"商家名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex flex-y-top"},[a("div",{},[a("img",{staticClass:"goodlogo bor_rad5",attrs:{src:t.row.icon}})]),a("div",{staticClass:"mar_l10"},[a("div",{staticClass:"flex"},[a("div",{},[e._v(e._s(t.row.name))]),a("el-tag",{staticClass:"mar_l5",attrs:{size:"mini",type:"info"}},[e._v("ID:"+e._s(t.row.id)+"")])],1)])])]}}])}),a("el-table-column",{attrs:{prop:"address",label:"门店地址&联系电话",width:"400"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(t.row.address))]),a("div",[e._v(e._s(t.row.storeTel))])]}}])})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}})],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"medium"},on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.save}},[e._v("确 定")])],1)])],1)},s=[],o=(a("99af"),a("d81d"),a("96cf"),a("1da1")),i=a("e692"),n={name:"labelSave",created:function(){},data:function(){return{formInline:{keyword:"",typeId:"",type:"",areaId:"",label:""},title:"",dialogFormVisible:!1,list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1},typeOptions:[{id:"0",name:"全部"},{id:"1",name:"直营店"},{id:"2",name:"加盟店"}],qyOptions:[],fzOptions:[],labelOptions:[],storeIds:[],storeId:""}},components:{},methods:{init:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,s,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={page:e.page.currentPage,typeId:e.formInline.typeId,keyword:e.formInline.keyword,type:e.formInline.type,areaId:e.formInline.areaId,label:e.formInline.label,storeIds:e.storeIds},t.next=3,Object(i["q"])(a);case 3:r=t.sent,s=r.data,o=r.count,e.list=s,e.page.total=o;case 8:case"end":return t.stop()}}),t)})))()},onSearch:function(){this.init()},setStoreId:function(e){this.storeId=e},handleCurrentChange:function(e){this.page.currentPage=e,this.init()},setSelectRows:function(e){this.selectRows=e},selectStoreCategory:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["u"])();case 2:a=t.sent,r=a.data,e.qyOptions=r.area?r.area:[],e.fzOptions=r.type?r.type:[],e.labelOptions=r.label?r.label:[];case 7:case"end":return t.stop()}}),t)})))()},search:function(){this.init()},showEdit:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:e?(t.title="编辑门店",console.log(e,t.storeIds),t.storeIds=e,t.init(),t.selectStoreCategory()):(t.title="选择门店",t.init(),t.selectStoreCategory()),t.dialogFormVisible=!0;case 2:case"end":return a.stop()}}),a)})))()},close:function(){this.dialogFormVisible=!1},save:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,s,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.selectRows.length>0)){t.next=12;break}return a=e.selectRows.map((function(e){return e.id})),e.storeIds&&(r=a.concat(e.storeIds)),t.next=5,Object(i["q"])({ids:r});case 5:s=t.sent,s.msg,o=s.data,e.$emit("fetchData",o),e.close(),t.next=14;break;case 12:return e.$baseMessage("未选中任何门店","error"),t.abrupt("return",!1);case 14:case"end":return t.stop()}}),t)})))()}}},l=n,c=(a("a552"),a("2877")),u=Object(c["a"])(l,r,s,!1,null,null,null);t["a"]=u.exports},a434:function(e,t,a){"use strict";var r=a("23e7"),s=a("23cb"),o=a("a691"),i=a("50c4"),n=a("7b0b"),l=a("65f0"),c=a("8418"),u=a("1dde"),d=a("ae40"),m=u("splice"),f=d("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,b=Math.min,g=9007199254740991,h="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!m||!f},{splice:function(e,t){var a,r,u,d,m,f,v=n(this),y=i(v.length),x=s(e,y),_=arguments.length;if(0===_?a=r=0:1===_?(a=0,r=y-x):(a=_-2,r=b(p(o(t),0),y-x)),y+a-r>g)throw TypeError(h);for(u=l(v,r),d=0;d<r;d++)m=x+d,m in v&&c(u,d,v[m]);if(u.length=r,a<r){for(d=x;d<y-r;d++)m=d+r,f=d+a,m in v?v[f]=v[m]:delete v[f];for(d=y;d>y-r+a;d--)delete v[d-1]}else if(a>r)for(d=y-r;d>x;d--)m=d+r-1,f=d+a-1,m in v?v[f]=v[m]:delete v[f];for(d=0;d<a;d++)v[d+x]=arguments[d+2];return v.length=y-r+a,u}})},a552:function(e,t,a){"use strict";var r=a("2b21"),s=a.n(r);s.a},ad18:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"baiduUe"},[a("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"180px"}},[a("el-form-item",{attrs:{label:"排序"}},[a("el-input",{attrs:{placeholder:"请输入排序"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),a("el-form-item",{attrs:{label:"优惠券名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入优惠券名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"使用门槛",required:!0}},[a("el-radio-group",{model:{value:e.form.isFull,callback:function(t){e.$set(e.form,"isFull",t)},expression:"form.isFull"}},[a("el-radio",{attrs:{label:"1"}},[e._v("无门槛")]),a("el-radio",{attrs:{label:"2"}},[e._v("有门槛")])],1),"2"==e.form.isFull?[a("span",{staticClass:"mar_r10"},[e._v("订单满")]),"1"==e.form.isFull?a("el-input-number",{attrs:{disabled:"","controls-position":"right",min:1,max:1e6},model:{value:e.form.fullMoney,callback:function(t){e.$set(e.form,"fullMoney",t)},expression:"form.fullMoney"}}):a("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e6},model:{value:e.form.fullMoney,callback:function(t){e.$set(e.form,"fullMoney",t)},expression:"form.fullMoney"}}),a("span",{staticClass:"mar_l10"},[e._v("元才可用")])]:e._e()],2),a("el-form-item",{attrs:{label:"优惠内容",required:!0}},[a("div",{staticClass:"time_item"},[a("span",{staticClass:"mar_r10"},[e._v("减免")]),a("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e6},model:{value:e.form.money,callback:function(t){e.$set(e.form,"money",t)},expression:"form.money"}}),a("span",{staticClass:"mar_l10"},[e._v(e._s("1"==e.type?"元":"折"))])],1)]),a("el-form-item",{attrs:{label:"适用门店",required:!0}},[a("el-radio-group",{model:{value:e.form.storeType,callback:function(t){e.$set(e.form,"storeType",t)},expression:"form.storeType"}},[a("el-radio",{attrs:{label:"2"}},[e._v("全店通用")]),a("el-radio",{attrs:{label:"3"}},[e._v("指定门店可用")])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:"3"==e.form.storeType,expression:"form.storeType=='3'"}]},[a("el-scrollbar",[a("div",{staticClass:"recordBox"},[a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.shopTable,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"name",label:"门店名称"}}),a("el-table-column",{attrs:{prop:"address",label:"门店地址"}}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"textbutton"},[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(a){return e.open2(t.row,t.$index)}}},[e._v("删除")])],1)]}}])})],1)],1)]),a("div",{staticClass:"addgoods textbutton"},[a("i",{staticClass:"el-icon-plus subjectcolor2"}),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.addshop(e.shopTable)}}},[e._v("添加门店")])],1)],1)],1),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"2"==e.form.storeType||"3"==e.form.storeType,expression:"form.storeType=='2' || form.storeType=='3'"}],attrs:{label:"平台补贴"}},[a("el-input",{attrs:{placeholder:"请输入平台补贴"},model:{value:e.form.subsidy,callback:function(t){e.$set(e.form,"subsidy",t)},expression:"form.subsidy"}}),a("span",{staticClass:"mar_l10"},[e._v("元")])],1),a("el-form-item",{attrs:{label:"适用商品",required:!0}},[a("el-radio-group",{model:{value:e.form.goodsType,callback:function(t){e.$set(e.form,"goodsType",t)},expression:"form.goodsType"}},[a("el-radio",{attrs:{label:"1"}},[e._v("全部商品可用")]),a("el-radio",{attrs:{label:"2"}},[e._v("部分商品可用")]),a("el-radio",{attrs:{label:"3"}},[e._v("部分商品不可用")]),a("el-radio",{attrs:{label:"4"}},[e._v("指定商品分类")])],1),"4"==e.form.goodsType?[a("el-select",{staticClass:"mar_t10",attrs:{clearable:"",multiple:"",filterable:"","allow-create":"",placeholder:"请选择商品分类"},model:{value:e.goodsArr,callback:function(t){e.goodsArr=t},expression:"goodsArr"}},e._l(e.typeOptions,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)]:e._e(),"2"==e.form.goodsType||"3"==e.form.goodsType?[a("el-scrollbar",[a("div",{staticClass:"recordBox"},[a("el-table",{ref:"multipleTable",staticClass:"tablecenter",staticStyle:{width:"100%"},attrs:{data:e.tableData3,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"name",label:"商品"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[a("div",{staticClass:"flex-g-0"},[a("el-image",{staticStyle:{width:"60px",height:"60px","border-radius":"10px"},attrs:{src:t.row.icon,fit:"cover"}})],1),a("div",{staticClass:"flex-g-1 t_l"},[a("div",{staticClass:"mar_l10"},[e._v(e._s(t.row.name))])])])]}}],null,!1,8072705)}),a("el-table-column",{attrs:{prop:"price",label:"价格"}}),a("el-table-column",{attrs:{prop:"stock",label:"库存"}}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"textbutton"},[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(a){return e.open1(t.row,t.$index)}}},[e._v("删除")])],1)]}}],null,!1,3198782318)})],1)],1)]),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.addgood(e.tableData3)}}},[a("i",{staticClass:"el-icon-plus subjectcolor2"}),a("span",[e._v("添加商品")])])]:e._e()],2),a("el-form-item",{attrs:{label:"适用场景",required:!0}},[a("el-checkbox-group",{model:{value:e.form.useType,callback:function(t){e.$set(e.form,"useType",t)},expression:"form.useType"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("外卖")]),a("el-checkbox",{attrs:{label:"2"}},[e._v("堂食")]),a("el-checkbox",{attrs:{label:"3"}},[e._v("快餐")])],1)],1),a("el-form-item",{attrs:{label:"优惠券主题色",required:!0}},[a("el-color-picker",{model:{value:e.form.color,callback:function(t){e.$set(e.form,"color",t)},expression:"form.color"}})],1),a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("基本规则")])])]),a("el-form-item",{attrs:{label:"使用时间",required:!0}},[a("el-radio",{attrs:{label:"2"},model:{value:e.form.timeType,callback:function(t){e.$set(e.form,"timeType",t)},expression:"form.timeType"}},[e._v("领券后")]),a("el-input-number",{attrs:{size:"mini","controls-position":"right",min:1,max:1e6},model:{value:e.form.day,callback:function(t){e.$set(e.form,"day",t)},expression:"form.day"}}),a("span",{staticClass:"mar_l10"},[e._v("日内有效")]),"2"==e.form.timeType?[a("el-checkbox-group",{staticStyle:{display:"inline-block","margin-left":"10px"},model:{value:e.form.isNextDay,callback:function(t){e.$set(e.form,"isNextDay",t)},expression:"form.isNextDay"}},[a("el-checkbox",{attrs:{"true-label":"1","false-label":"2"},model:{value:e.form.isNextDay,callback:function(t){e.$set(e.form,"isNextDay",t)},expression:"form.isNextDay"}},[e._v("次日起")])],1)]:e._e(),a("div",{staticClass:"yb_margin lh16"},[e._v("默认从今日起,如需次日有效请勾选次日起选项")])],2),a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("使用说明")])])]),a("el-form-item",{attrs:{label:"分享图片"}},[e.form.shareImg?a("div",{staticClass:"uploadSource bor_de rel flex"},[a("label",{staticClass:"statusLabel curs",on:{mouseenter:function(t){return e.enter(1)},mouseleave:function(t){return e.leave(1)}}},[a("i",{ref:"imgicon1",staticClass:"el-icon-check"}),a("i",{staticClass:"el-icon-close",on:{click:function(t){return e.deleteMultiImage(e.form.shareImg,1)}}})]),a("img",{staticClass:"wid",attrs:{src:e.form.shareImg},on:{click:function(t){return e.test(1)}}})]):a("div",{staticClass:"uploadSource flex-center curs",on:{click:function(t){return e.test(1)}}},[a("i",{staticClass:"el-icon-plus fon_40 color_d9"})])]),a("el-form-item",{attrs:{label:"分享自定义标题"}},[a("el-input",{attrs:{placeholder:"请输入分享自定义标题"},model:{value:e.form.shareTitle,callback:function(t){e.$set(e.form,"shareTitle",t)},expression:"form.shareTitle"}})],1),a("el-form-item",{attrs:{label:"券说明"}},[a("baidu-ueditor",{attrs:{content:e.form.details},on:{ueditor:e.getUeditor}})],1)],1)],1),a("attachment-img",{ref:"img1",attrs:{type:"img"},on:{attachment:e.imgadd1}}),a("div",{staticClass:"mar_t20 ba_f pad_20 t_c"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("立即创建")])],1),a("edit",{ref:"edit",on:{fetchData:e.tableData}}),a("shopEdit",{ref:"ShopEdit",on:{fetchData:e.shopListData}})],1)},s=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("创建满减优惠券")])])])}],o=(a("c975"),a("d81d"),a("a434"),a("96cf"),a("1da1")),i=a("7cb7"),n=a("9893"),l=a("fc6e"),c=a("df58"),u=a("919c"),d={components:{baiduUeditor:n["a"],attachmentImg:l["a"],Edit:c["a"],shopEdit:u["a"]},created:function(){this.init(),this.$route.query.type&&(this.type=this.$route.query.type),this.$route.query.id&&(this.id=this.$route.query.id,this.edit())},data:function(){return{rules:{name:[{required:!0,message:"请输入优惠券名称",trigger:"blur"},{min:2,max:15,message:"长度在 2 到 15 个字符",trigger:"blur"}],time:[{required:!0,message:"请选择活动时间",trigger:"blur"}]},type:"1",id:"",isNextDay:[],form:{sort:"1",name:"",isFull:"1",fullMoney:"",money:"",discount:"",timeType:"2",isNextDay:"1",useType:["1"],goodsType:"1",memberType:"1",storeType:"2",details:"",maxNum:"",shareImg:"",shareTitle:"",display:"1",color:"#EE472B",subsidy:""},goodsArr:[],memberLabel:[],plugin:[],labelOptions:[],typeOptions:[],tableData3:[],shopTable:[]}},methods:{changeIsNextDay:function(e){e.length?this.form.isNextDay=1:this.form.isNextDay=2},tableData:function(e){this.tableData3=e},shopListData:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:console.log(22,e),t.shopTable=e||[];case 2:case"end":return a.stop()}}),a)})))()},open1:function(e,t){console.log("删除",e,t),this.$delete(this.tableData3,t)},open2:function(e,t){this.$delete(this.shopTable,t)},enter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="none"},leave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="inline-block"},test:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["img"+e].dialogVisible=!0},imgadd1:function(e){this.form.shareImg=e.str},deleteMultiImage:function(e,t,a){if(Array.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.splice(t,1)},"multigraph"==a)switch(t){case 2:this.form2.environment.remove(e);break}else switch(t){case 1:this.form.shareImg="";break}},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},getUeditor:function(e){this.form.details=e},init:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["Ec"])();case 2:a=t.sent,r=a.data,e.typeOptions=r.category?r.category:[],e.labelOptions=r.label?r.label:[];case 6:case"end":return t.stop()}}),t)})))()},edit:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["Ec"])({id:e.id});case 2:a=t.sent,r=a.data,Object.assign(e.form,r),"2"!=r.goodsType&&"3"!=r.goodsType||(e.tableData3=r.goodsArr?r.goodsArr:[]),"4"==r.goodsType&&(e.goodsArr=r.goodsArr?r.goodsArr:[]),"3"==r.memberType&&(e.memberLabel=r.memberLabel?r.memberLabel:[]),r.storeInfo&&(e.shopTable=r.storeInfo?r.storeInfo:[]);case 9:case"end":return t.stop()}}),t)})))()},addgood:function(e){if(e){var t=e.map((function(e){return e.id}));this.$refs["edit"].showEdit(t)}else this.$refs["edit"].showEdit();this.$refs["edit"].isSpec("")},addshop:function(e){if(e){var t=e.map((function(e){return e.id}));this.$refs["ShopEdit"].showEdit(t)}else this.$refs["ShopEdit"].showEdit()},submitForm:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(a){var r,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=12;break}return e.form.type=e.type,"2"!=e.form.goodsType&&"3"!=e.form.goodsType||e.tableData3&&(e.form.goodsArr=e.tableData3.map((function(e){return e.id}))),"4"==e.form.goodsType&&(e.form.goodsArr=e.goodsArr),"3"==e.form.memberType&&(e.form.memberLabel=e.memberLabel),e.shopTable&&(e.form.storeArr=e.shopTable.map((function(e){return e.id}))),t.next=8,Object(i["Gc"])(e.form);case 8:r=t.sent,s=r.msg,e.$baseMessage(s,"success"),e.$router.go(-1);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}},m=d,f=(a("2835"),a("2877")),p=Object(f["a"])(m,r,s,!1,null,null,null);t["default"]=p.exports},df58:function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"selectgood"},[a("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"1000px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close}},[a("div",{staticClass:"flex-bet flex-y-top selected"},[a("div",{staticClass:"flex-g-0 leftType"},[a("el-scrollbar",[a("div",{staticClass:"leftborder",staticStyle:{"max-height":"600px"}},e._l(e.categoryList,(function(t,r){return a("p",{key:r,staticClass:"curs pad_l_10 lh40",class:{current:r==e.current},on:{click:function(a){return e.clickCategory(r,t)}}},[e._v(e._s(t.name))])})),0)])],1),a("div",{staticClass:"flex-g-1"},[a("div",{staticClass:"search mar_b20 mar_l10"},[a("div",{staticClass:"filter_wrapper_edit flex"},[a("div",{staticClass:"flex"},[a("el-input",{staticClass:"elinput",attrs:{placeholder:"请输入商品名称"},model:{value:e.goodName,callback:function(t){e.goodName=t},expression:"goodName"}})],1),a("el-button",{staticClass:"mar_l20",attrs:{type:"primary",size:"medium"},on:{click:function(t){return e.search()}}},[e._v("搜索")])],1)]),a("div",[a("el-scrollbar",[a("div",{staticClass:"wid flex flex-wrap",staticStyle:{"max-height":"600px"}},e._l(e.goodList,(function(t,r){return a("div",{key:r,staticClass:"goods flex-bet"},[a("div",{staticClass:"flex-g-0"},[a("el-image",{staticStyle:{width:"90px",height:"80px","border-radius":"10px"},attrs:{src:t.icon,fit:"cover"}})],1),a("div",{staticClass:"pad_l_10 flex-g-1"},[a("div",{staticClass:"fon_12 color_6"},[e._v(e._s(t.name))]),1==t.goodsType?a("el-tag",{staticClass:"mar_t10",attrs:{size:"mini",type:"success",effect:"dark"}},[e._v("外卖")]):e._e(),2==t.goodsType?a("el-tag",{staticClass:"mar_t10",attrs:{size:"mini",type:"",effect:"dark"}},[e._v("店内")]):e._e(),a("div",{staticClass:"flex-bet mar_t10"},[a("div",{staticClass:"color_f6c"},[e._v("库存:"+e._s(t.stock))]),a("div",[1==t.type?a("el-button",{attrs:{size:"mini",round:""},on:{click:function(a){return e.open(t,r)}}},[e._v("选取")]):a("el-button",{attrs:{size:"mini",round:"",type:"primary"},on:{click:function(a){return e.open(t,r)}}},[e._v("取消")])],1)])],1)])})),0)])],1)])]),a("div",{staticStyle:{"margin-left":"190px"}},[a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}})],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"medium"},on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.save}},[e._v("确 定")])],1)])],1)},s=[],o=(a("b0c0"),a("96cf"),a("1da1")),i=a("5530"),n=a("7cb7"),l=a("2f62"),c={name:"labelSave",created:function(){},computed:Object(i["a"])({},Object(l["d"])(["storeData"])),data:function(){return{title:"",goodName:"",dialogFormVisible:!1,yhtableData:[],selection:"选取",list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1},tableData3:[],tableData4:[],ids:[],category:"",categoryList:[],goodList:[],current:0,storeId:"",isSpecs:"",goodsType:"",startTime:"",endTime:"",goodsInfo:"",danxuan:""}},components:{},methods:{goodType:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function a(){var r,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(n["xc"])({item:e,storeId:t.storeId,goodsInfo:t.goodsInfo});case 2:r=a.sent,s=r.data,t.categoryList=s||[],t.categoryList.unshift({id:"",name:"全部"});case 6:case"end":return a.stop()}}),a)})))()},clickCategory:function(e,t){this.current=e,this.category=t.id,this.init()},init:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(n["wc"])({startTime:e.startTime,endTime:e.endTime,goodsType:e.goodsType,page:e.page.currentPage,keyword:e.goodName,idArr:e.ids,typeId:e.category,isSpecs:e.isSpecs,goodsInfo:e.goodsInfo,storeId:e.storeId,goodsModel:e.storeData.goodsModel});case 2:a=t.sent,r=a.data,s=a.count,e.goodList=r||[],e.page.total=s;case 7:case"end":return t.stop()}}),t)})))()},setStoreId:function(e){this.storeId=e},handleCurrentChange:function(e){this.page.currentPage=e,this.init()},search:function(){this.init()},showEdit:function(e,t,a,r){var s=this;return Object(o["a"])(regeneratorRuntime.mark((function o(){return regeneratorRuntime.wrap((function(o){while(1)switch(o.prev=o.next){case 0:s.goodsType=t||"",a&&(s.startTime=s.$moment(a[0]).format("YYYY-MM-DD HH:mm:ss"),s.endTime=s.$moment(new Date(a[1])).format("YYYY-MM-DD HH:mm:ss")),console.log(s.startTime),console.log(s.endTime),s.goodType(r),e?(s.title="编辑商品",s.ids=e,s.init()):s.title="添加商品",s.dialogFormVisible=!0;case 7:case"end":return o.stop()}}),o)})))()},isSpec:function(e){this.isSpecs=e},isGoodsInfo:function(e){this.goodsInfo=e},isDanXuan:function(e){this.danxuan=e},open:function(e,t){if(1==e.type){this.goodList[t].type=2;var a={name:e.name,stock:e.stock,price:e.price,icon:e.icon,id:e.id,type:e.type};"1"==this.goodsInfo?this.$set(this.tableData3,this.tableData3.length,a):"2"==this.goodsInfo?this.$set(this.tableData4,this.tableData4.length,a):this.$set(this.tableData3,this.tableData3.length,a)}else this.goodList[t].type=1;"1"==this.danxuan&&(this.dialogFormVisible=!1,this.save())},close:function(){this.dialogFormVisible=!1},save:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:"1"==e.goodsInfo?e.$emit("fetchData",e.tableData3):"2"==e.goodsInfo?e.$emit("fetchData2",e.tableData4):e.$emit("fetchData",e.tableData3),e.close();case 2:case"end":return t.stop()}}),t)})))()}}},u=c,d=(a("6ea5"),a("2877")),m=Object(d["a"])(u,r,s,!1,null,null,null);t["a"]=m.exports}}]);