1 line
30 KiB
JavaScript
1 line
30 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-72118ce6"],{"2b21":function(e,t,a){},"39d7":function(e,t,a){},"3bbe":function(e,t,a){var r=a("861d");e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"578d":function(e,t,a){"use strict";var r=a("39d7"),n=a.n(r);n.a},"6ea5":function(e,t,a){"use strict";var r=a("798c"),n=a.n(r);n.a},7156:function(e,t,a){var r=a("861d"),n=a("d2bb");e.exports=function(e,t,a){var s,o;return n&&"function"==typeof(s=t.constructor)&&s!==a&&r(o=s.prototype)&&o!==a.prototype&&n(e,o),e}},"798c":function(e,t,a){},"894e":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",[a("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),a("div",{staticClass:"mar_t20 flex-bet flex-y-top"},[a("div",{staticClass:"flex-g-1"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"180px"}},[a("el-form-item",{attrs:{label:"活动名称",required:!0,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-date-picker",{attrs:{type:"datetimerange",align:"right","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["08:00:00","20:00:00"]},model:{value:e.timeData,callback:function(t){e.timeData=t},expression:"timeData"}})],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:"1"}},[e._v("仅本店可用")]),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),a("div",{staticClass:"yb_margin lh16"},[e._v("全店通用、指定门店可用不适用于门店模式三")])],1),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("div",{staticClass:"time_item"},[a("el-radio",{attrs:{label:"1"},model:{value:e.form.limitType,callback:function(t){e.$set(e.form,"limitType",t)},expression:"form.limitType"}},[e._v("不限次数")]),a("el-radio",{attrs:{label:"2"},model:{value:e.form.limitType,callback:function(t){e.$set(e.form,"limitType",t)},expression:"form.limitType"}},[e._v("每天换购")]),"2"==e.form.limitType?a("span",[a("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e6},model:{value:e.form.num,callback:function(t){e.$set(e.form,"num",t)},expression:"form.num"}}),a("span",{staticClass:"mar_l10"},[e._v("次")])],1):e._e(),a("div",{staticClass:"yb_margin lh16"},[e._v("每个用户每天换购的次数")])],1)]),e.form.useType.indexOf("1")>-1?a("el-form-item",{attrs:{label:"选择换购外卖商品",prop:"username"}},[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:"money",label:"换购价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"kucun"},[a("el-input",{attrs:{placeholder:"请输入换购价"},model:{value:t.row.money,callback:function(a){e.$set(t.row,"money",a)},expression:"scope.row.money"}},[a("template",{slot:"append"},[e._v("元")])],2)],1)]}}],null,!1,843955322)}),a("el-table-column",{attrs:{prop:"stock",label:"库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"kucun"},[a("el-input",{attrs:{placeholder:"请输入活动库存量"},model:{value:t.row.stock,callback:function(a){e.$set(t.row,"stock",a)},expression:"scope.row.stock"}},[a("template",{slot:"append"},[e._v("份")])],2)],1)]}}],null,!1,2851555707)}),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,1097737358)})],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.addgood(e.tableData3)}}},[e._v("添加商品")])],1)],1):e._e(),e.form.useType.indexOf("2")>-1||e.form.useType.indexOf("3")>-1?a("el-form-item",{attrs:{label:"选择换购店内商品"}},[a("el-table",{ref:"multipleTable",staticClass:"tablecenter",staticStyle:{width:"100%"},attrs:{data:e.tableData4,"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:"money",label:"换购价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"kucun"},[a("el-input",{attrs:{placeholder:"请输入换购价"},model:{value:t.row.money,callback:function(a){e.$set(t.row,"money",a)},expression:"scope.row.money"}},[a("template",{slot:"append"},[e._v("元")])],2)],1)]}}],null,!1,843955322)}),a("el-table-column",{attrs:{prop:"stock",label:"库存"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"kucun"},[a("el-input",{attrs:{placeholder:"请输入活动库存量"},model:{value:t.row.stock,callback:function(a){e.$set(t.row,"stock",a)},expression:"scope.row.stock"}},[a("template",{slot:"append"},[e._v("份")])],2)],1)]}}],null,!1,2851555707)}),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.open4(t.row,t.$index)}}},[e._v("删除 ")])],1)]}}],null,!1,3010284267)})],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.addgood4(e.tableData4)}}},[e._v("添加商品")])],1)],1):e._e()],1)],1),a("div",{staticClass:"flex-g-0 pad_lr_20"},[a("div",{staticClass:"fon_16"},[e._v("常见问题")]),a("el-collapse",{staticClass:"mar_tb10",staticStyle:{width:"260px"},attrs:{accordion:""},model:{value:e.collapseName,callback:function(t){e.collapseName=t},expression:"collapseName"}},[a("el-collapse-item",{attrs:{title:"什么是超级换购?",name:"1"}},[a("div",[e._v("针对门店用户进行的超级换购活动,用户在下单时可选择超级换购商品活动。")])]),a("el-collapse-item",{attrs:{title:"为什么要做超级换购?",name:"2"}},[a("div",[e._v("提高新客转化:设置超级换购活动后,可提升新用户下单转化率")])]),a("el-collapse-item",{attrs:{title:"哪些用户可以享受超级换购",name:"3"}},[a("div",[e._v("可自行设置哪些用户享受该优惠")])])],1),a("div",{staticClass:"fon_16 mar_t20"},[e._v("活动规则")]),e._m(1)],1)])]),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,fetchData2:e.tableData2}}),a("shopEdit",{ref:"ShopEdit",on:{fetchData:e.shopListData}})],1)},n=[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("创建超级换购活动")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"color_9 mar_t10 lh30 fon_13"},[a("div",[e._v("1.活动仅限在线支付订单;")]),a("div",[e._v("2.活动成本由商家承担,与店铺其他活动默认同享")])])}],s=(a("c975"),a("d81d"),a("a434"),a("96cf"),a("1da1")),o=a("7cb7"),i=a("ed08"),l=a("919c"),c=a("df58"),u={components:{Edit:c["a"],shopEdit:l["a"]},created:function(){this.$route.query.id&&(this.id=this.$route.query.id,this.edit())},data:function(){return{form:{name:"",storeType:"1",useType:["1"],goodsType:"1",limitType:"1",num:""},tableData3:[],tableData4:[],timeData:[new Date,(new Date).setMonth((new Date).getMonth()+3)],collapseName:"",shopTable:[]}},methods:{shopListData:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.shopTable=e||[];case 1:case"end":return a.stop()}}),a)})))()},open2:function(e,t){this.$delete(this.shopTable,t)},addshop:function(e){if(e){var t=e.map((function(e){return e.id}));this.$refs["ShopEdit"].showEdit(t)}else this.$refs["ShopEdit"].showEdit()},tableData:function(e){this.tableData3=e,this.id},tableData2:function(e){this.tableData4=e},open1:function(e,t){this.$delete(this.tableData3,t)},open4:function(e,t){this.$delete(this.tableData4,t)},addgood:function(e){if(this.$refs["edit"].isGoodsInfo("1"),e){var t=e.map((function(e){return e.id}));this.$refs["edit"].showEdit(t)}else this.$refs["edit"].showEdit();this.$refs["edit"].isSpec("2")},addgood4:function(e){if(this.$refs["edit"].isGoodsInfo("2"),e){var t=e.map((function(e){return e.id}));this.$refs["edit"].showEdit(t)}else this.$refs["edit"].showEdit();this.$refs["edit"].isSpec("")},edit:function(){var e=this;return Object(s["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(o["H"])({id:e.id});case 2:a=t.sent,r=a.data,e.form2=e.form,e.form=Object.assign(e.form2,r),r.startTime&&(e.timeData=[r.startTime,r.endTime]),r.goodsArr&&(e.tableData3=r.goodsArr,e.tableData4=r.goodsArr2?r.goodsArr2:[]),r.storeInfo&&(e.shopTable=r.storeInfo?r.storeInfo:[]);case 9:case"end":return t.stop()}}),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;console.log(this.$refs,e),this.$refs["img"+e].dialogVisible=!0},imgadd1:function(e){this.form.icon=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.icon="";break}},submitForm:function(){var e=this;return Object(s["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(s["a"])(regeneratorRuntime.mark((function t(a){var r,n,s,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=39;break}if(e.timeData&&(e.form.startTime=Object(i["a"])(e.timeData[0]),e.form.endTime=Object(i["a"])(e.timeData[1])),!e.tableData3){t.next=15;break}r=0;case 4:if(!(r<e.tableData3.length)){t.next=15;break}if(console.log(e.tableData3[r]),!(+e.tableData3[r].money>+e.tableData3[r].price)){t.next=9;break}return e.$baseMessage("换购价应大于原价","error"),t.abrupt("return");case 9:if(e.tableData3[r].money&&"0"!=e.tableData3[r].money&&"NaN"!=e.tableData3[r].money){t.next=12;break}return e.$baseMessage("换购价不能为空或零","error"),t.abrupt("return");case 12:r++,t.next=4;break;case 15:if(!e.tableData4){t.next=28;break}n=0;case 17:if(!(n<e.tableData4.length)){t.next=28;break}if(console.log(e.tableData4[n]),!(+e.tableData4[n].money>+e.tableData4[n].price)){t.next=22;break}return e.$baseMessage("换购价应大于原价","error"),t.abrupt("return");case 22:if(e.tableData4[n].money&&"0"!=e.tableData4[n].money&&"NaN"!=e.tableData4[n].money){t.next=25;break}return e.$baseMessage("换购价不能为空或零","error"),t.abrupt("return");case 25:n++,t.next=17;break;case 28:return e.shopTable&&(e.form.storeArr=e.shopTable.map((function(e){return e.id}))),e.form.goodsArr=e.tableData3,e.form.goodsArr2=e.tableData4,t.next=33,Object(o["Vb"])(e.form);case 33:s=t.sent,l=s.msg,e.$baseMessage(l,"success"),e.$router.go(-1),t.next=40;break;case 39:return t.abrupt("return",!1);case 40:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}},d=u,f=(a("578d"),a("2877")),p=Object(f["a"])(d,r,n,!1,null,null,null);t["default"]=p.exports},"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)},n=[],s=(a("99af"),a("d81d"),a("96cf"),a("1da1")),o=a("e692"),i={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(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n,s;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(o["q"])(a);case 3:r=t.sent,n=r.data,s=r.count,e.list=n,e.page.total=s;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(s["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(o["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(s["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(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n,s;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(o["q"])({ids:r});case 5:n=t.sent,n.msg,s=n.data,e.$emit("fetchData",s),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=i,c=(a("a552"),a("2877")),u=Object(c["a"])(l,r,n,!1,null,null,null);t["a"]=u.exports},a434:function(e,t,a){"use strict";var r=a("23e7"),n=a("23cb"),s=a("a691"),o=a("50c4"),i=a("7b0b"),l=a("65f0"),c=a("8418"),u=a("1dde"),d=a("ae40"),f=u("splice"),p=d("splice",{ACCESSORS:!0,0:0,1:2}),m=Math.max,b=Math.min,g=9007199254740991,h="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!f||!p},{splice:function(e,t){var a,r,u,d,f,p,v=i(this),y=o(v.length),_=n(e,y),x=arguments.length;if(0===x?a=r=0:1===x?(a=0,r=y-_):(a=x-2,r=b(m(s(t),0),y-_)),y+a-r>g)throw TypeError(h);for(u=l(v,r),d=0;d<r;d++)f=_+d,f in v&&c(u,d,v[f]);if(u.length=r,a<r){for(d=_;d<y-r;d++)f=d+r,p=d+a,f in v?v[p]=v[f]:delete v[p];for(d=y;d>y-r+a;d--)delete v[d-1]}else if(a>r)for(d=y-r;d>_;d--)f=d+r-1,p=d+a-1,f in v?v[p]=v[f]:delete v[p];for(d=0;d<a;d++)v[d+_]=arguments[d+2];return v.length=y-r+a,u}})},a552:function(e,t,a){"use strict";var r=a("2b21"),n=a.n(r);n.a},a9e3:function(e,t,a){"use strict";var r=a("83ab"),n=a("da84"),s=a("94ca"),o=a("6eeb"),i=a("5135"),l=a("c6b6"),c=a("7156"),u=a("c04e"),d=a("d039"),f=a("7c73"),p=a("241c").f,m=a("06cf").f,b=a("9bf2").f,g=a("58a8").trim,h="Number",v=n[h],y=v.prototype,_=l(f(y))==h,x=function(e){var t,a,r,n,s,o,i,l,c=u(e,!1);if("string"==typeof c&&c.length>2)if(c=g(c),t=c.charCodeAt(0),43===t||45===t){if(a=c.charCodeAt(2),88===a||120===a)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,n=49;break;case 79:case 111:r=8,n=55;break;default:return+c}for(s=c.slice(2),o=s.length,i=0;i<o;i++)if(l=s.charCodeAt(i),l<48||l>n)return NaN;return parseInt(s,r)}return+c};if(s(h,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var w,k=function(e){var t=arguments.length<1?0:e,a=this;return a instanceof k&&(_?d((function(){y.valueOf.call(a)})):l(a)!=h)?c(new v(x(t)),a,k):x(t)},C=r?p(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),I=0;C.length>I;I++)i(v,w=C[I])&&!i(k,w)&&b(k,w,m(v,w));k.prototype=y,y.constructor=k,o(n,h,k)}},bf19:function(e,t,a){"use strict";var r=a("23e7");r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},d2bb:function(e,t,a){var r=a("825a"),n=a("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,a={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(a,[]),t=a instanceof Array}catch(s){}return function(a,s){return r(a),n(s),t?e.call(a,s):a.__proto__=s,a}}():void 0)},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)},n=[],s=(a("b0c0"),a("96cf"),a("1da1")),o=a("5530"),i=a("7cb7"),l=a("2f62"),c={name:"labelSave",created:function(){},computed:Object(o["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(s["a"])(regeneratorRuntime.mark((function a(){var r,n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(i["xc"])({item:e,storeId:t.storeId,goodsInfo:t.goodsInfo});case 2:r=a.sent,n=r.data,t.categoryList=n||[],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(s["a"])(regeneratorRuntime.mark((function t(){var a,r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(i["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,n=a.count,e.goodList=r||[],e.page.total=n;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 n=this;return Object(s["a"])(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:n.goodsType=t||"",a&&(n.startTime=n.$moment(a[0]).format("YYYY-MM-DD HH:mm:ss"),n.endTime=n.$moment(new Date(a[1])).format("YYYY-MM-DD HH:mm:ss")),console.log(n.startTime),console.log(n.endTime),n.goodType(r),e?(n.title="编辑商品",n.ids=e,n.init()):n.title="添加商品",n.dialogFormVisible=!0;case 7:case"end":return s.stop()}}),s)})))()},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(s["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")),f=Object(d["a"])(u,r,n,!1,null,null,null);t["a"]=f.exports},ed08:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return s}));a("a9e3"),a("ac1f"),a("5319"),a("bf19");function r(e){var t=new Date(e).toJSON(),a=new Date(+new Date(t)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"");return a}function n(e){var t=new Date(e),a=t.getFullYear(),r=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,n=t.getDate()<10?"0"+t.getDate():t.getDate(),s=t.getHours()<10?"0"+t.getHours():t.getHours(),o=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),i=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return a+"-"+r+"-"+n+" "+s+":"+o+":"+i}function s(e){var t=new Date(1e3*Number(e)),a=t.getFullYear()+"-",r=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",n=(t.getDate()<10?"0"+t.getDate():t.getDate())+" ",s=(t.getHours()<10?"0"+t.getHours():t.getHours())+":",o=(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":",i=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds(),l=a+r+n+s+o+i;return l}}}]); |