(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-063630d8"],{"2a52":function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox relative"},[a("el-card",{staticClass:"box-card"},[a("div",{ref:"headerBox",staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("div",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:coupon:page:list"],expression:"['platform:coupon:page:list']"}],staticClass:"container"},[a("el-form",{attrs:{size:"small",inline:""}},[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.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[a("el-option",{attrs:{label:"开启",value:1}}),t._v(" "),a("el-option",{attrs:{label:"关闭",value:0}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"领取方式:"}},[a("el-select",{staticClass:"filter-item selWidth mr20",attrs:{clearable:"",placeholder:"请选择领取方式"},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.receiveType,callback:function(e){t.$set(t.tableFrom,"receiveType",e)},expression:"tableFrom.receiveType"}},[a("el-option",{attrs:{label:"手动领取",value:1}}),t._v(" "),a("el-option",{attrs:{label:"平台自动发放",value:3}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"使用范围:"}},[a("el-select",{staticClass:"filter-item selWidth mr20",attrs:{clearable:"",placeholder:"请选择使用范围"},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.category,callback:function(e){t.$set(t.tableFrom,"category",e)},expression:"tableFrom.category"}},[a("el-option",{attrs:{label:"商品",value:2}}),t._v(" "),a("el-option",{attrs:{label:"通用",value:3}}),t._v(" "),a("el-option",{attrs:{label:"品类",value:4}}),t._v(" "),a("el-option",{attrs:{label:"品牌",value:5}}),t._v(" "),a("el-option",{attrs:{label:"跨店",value:6}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"优惠券名称:"}},[a("el-input",{staticStyle:{width:"350px"},attrs:{placeholder:"请输入优惠券名称",clearable:""},model:{value:t.name,callback:function(e){t.name="string"===typeof e?e.trim():e},expression:"name"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-search",size:"small"},on:{click:function(e){return t.getList(1)}},slot:"append"})],1)],1)],1)],1),t._v(" "),a("router-link",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:coupon:add"],expression:"['platform:coupon:add']"}],attrs:{to:{path:"/marketing/platformCoupon/creatCoupon"}}},[a("el-button",{staticClass:"mr10",attrs:{size:"small",type:"primary"}},[t._v("添加优惠券")])],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.tableData.data,size:"small","header-cell-style":{fontWeight:"bold"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID","min-width":"50"}}),t._v(" "),a("el-table-column",{attrs:{prop:"name","show-overflow-tooltip":!0,label:"优惠券名称","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{prop:"category",label:"使用范围","min-width":"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t._f("couponCategory")(e.row.category)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"money",label:"面值","min-width":"90"}}),t._v(" "),a("el-table-column",{attrs:{prop:"minPrice",label:"使用门槛","min-width":"90"}}),t._v(" "),a("el-table-column",{attrs:{prop:"receiveType",label:"领取方式","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t._f("receiveType")(e.row.receiveType)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"receiveStartTime",label:"领取日期","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.receiveEndTime?a("div",[t._v("\n "+t._s(e.row.receiveStartTime)+" -"),a("br"),t._v("\n "+t._s(e.row.receiveEndTime)+"\n ")]):a("span",[t._v("不限时")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"issuedNum",label:"使用/发放数量","min-width":"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.usedNum)+"/"+t._s(e.row.issuedNum))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"isLimited",label:"发布数量","min-width":"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.isLimited?e.row.total:"不限量"))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"是否开启",fixed:"right","min-width":"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.checkPermi(["platform:coupon:switch"])?a("el-switch",{attrs:{"active-text":"开启","inactive-text":"关闭"},on:{change:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}}):a("div",[t._v(t._s(e.row.status?"开启":"关闭"))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160",fixed:"right",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.checkPermi(["platform:coupon:detail"])?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.look(e.row.id)}}},[t._v("详情")]):t._e(),t._v(" "),a("el-divider",{attrs:{direction:"vertical"}}),t._v(" "),a("el-dropdown",{attrs:{trigger:"click"}},[a("span",{staticClass:"el-dropdown-link"},[t._v(" 更多"),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:coupon:detail","platform:coupon:update"],expression:"['platform:coupon:detail', 'platform:coupon:update']"}]},[a("router-link",{attrs:{to:{path:"/marketing/platformCoupon/creatCoupon/"+e.row.id}}},[t._v("\n 编辑\n ")])],1),t._v(" "),a("el-dropdown-item",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:coupon:detail","platform:coupon:add"],expression:"['platform:coupon:detail', 'platform:coupon:add']"}]},[a("router-link",{attrs:{to:{path:"/marketing/platformCoupon/creatCoupon/"+e.row.id+"/1"}}},[t._v("\n 复制\n ")])],1),t._v(" "),a("el-dropdown-item",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:coupon:delete"],expression:"['platform:coupon:delete']"}],nativeOn:{click:function(a){return t.handleDelete(e.row.id)}}},[t._v("\n 删除\n ")])],1)],1)]}}])})],1),t._v(" "),a("div",{staticClass:"block"},[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._v(" "),a("el-drawer",{attrs:{title:"优惠券详情",size:"800px",visible:t.showInfo,direction:"rtl","before-close":t.handleClose},on:{"update:visible":function(e){t.showInfo=e}}},[t.showTab?a("el-tabs",{model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},[a("el-tab-pane",{attrs:{label:"基础信息",name:"one"}}),t._v(" "),a("el-tab-pane",{attrs:{label:t.tabPaneName,name:"two"}})],1):t._e(),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:"one"==t.activeNames,expression:"activeNames == 'one'"}],staticClass:"px20"},[a("div",{staticClass:"section"},[a("div",{staticClass:"title"},[t._v("优惠券信息")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("优惠券名称:"+t._s(t.cell.name))]),t._v(" "),a("div",{staticClass:"cell"},[t._v("使用范围:"+t._s(t._f("couponCategory")(t.cell.category)))]),t._v(" "),a("div",{staticClass:"cell"},[t._v("优惠券面值:"+t._s(t.cell.money)+"元")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("使用门槛:"+t._s(t.cell.minPrice)+"元")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("领取方式:"+t._s(t._f("receiveType")(t.cell.receiveType)))]),t._v(" "),a("div",{staticClass:"cell"},[t._v("\n 领取时间:"+t._s(t.cell.isTimeReceive?t.cell.receiveStartTime+" - "+t.cell.receiveEndTime:"不限时")+"\n ")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("\n 使用有效期:"+t._s(t.cell.isFixedTime?t.cell.useStartTime+" - "+t.cell.useEndTime+" 有效":"领取后"+t.cell.day+"天内有效")+"\n ")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("发布数量:"+t._s(t.cell.isLimited?t.cell.total:"不限量"))]),t._v(" "),a("div",{staticClass:"cell"},[t._v("重复领取:"+t._s(t.cell.isRepeated?"可重复领取":"不可重复领取"))]),t._v(" "),a("div",{staticClass:"cell"},[t._v("是否开启:"+t._s(t.cell.status?"开启":"关闭"))]),t._v(" "),a("div",{staticClass:"title mt20"},[t._v("优惠券情况")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("已发放数量:"+t._s(t.cell.issuedNum))]),t._v(" "),a("div",{staticClass:"cell"},[t._v("已使用数量:"+t._s(t.cell.usedNum))]),t._v(" "),4==t.cell.category&&t.cell.linkedDataStr?[a("div",{staticClass:"title mt20"},[t._v("优惠券商品品类")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("适用品类:"+t._s(t.cell.linkedDataStr))])]:t._e(),t._v(" "),5==t.cell.category&&t.cell.linkedDataStr?[a("div",{staticClass:"title mt20"},[t._v("优惠券商品品牌")]),t._v(" "),a("div",{staticClass:"cell"},[t._v("适用品牌:"+t._s(t.cell.linkedDataStr))])]:t._e()],2)]),t._v(" "),2==t.cell.category&&"two"==t.activeNames?a("div",{staticClass:"px20"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"tableList",staticClass:"mt20",attrs:{data:t.cell.productList,size:"mini"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",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)]}}],null,!1,1825039654)}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,prop:"name",label:"商品名称","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{prop:"price",label:"售价","min-width":"90"}}),t._v(" "),a("el-table-column",{attrs:{prop:"stock",label:"库存","min-width":"70"}})],1)],1):t._e(),t._v(" "),6==t.cell.category&&"two"==t.activeNames?a("div",{staticClass:"px20"},[a("el-table",{ref:"tableList",staticClass:"mt20",attrs:{data:t.cell.merchantList,size:"mini"}},[a("el-table-column",{attrs:{prop:"categoryId",label:"ID","min-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.avatar,"preview-src-list":[t.row.avatar]}})],1)]}}],null,!1,4159822182)}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,prop:"name",label:"商户名称","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{label:"商户类别","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t._f("selfTypeFilter")(e.row.isSelf)))])]}}],null,!1,611084893)})],1)],1):t._e()],1),t._v(" "),a("el-dialog",{attrs:{title:"删除",visible:t.delShow,width:"430px","before-close":t.handleClose},on:{"update:visible":function(e){t.delShow=e}}},[a("div",[a("el-radio",{attrs:{label:0},model:{value:t.loseEfficacyStatus,callback:function(e){t.loseEfficacyStatus=e},expression:"loseEfficacyStatus"}},[t._v("已领取的优惠券仍可正常使用")]),a("br"),t._v(" "),a("el-radio",{staticClass:"mt20",attrs:{label:1},model:{value:t.loseEfficacyStatus,callback:function(e){t.loseEfficacyStatus=e},expression:"loseEfficacyStatus"}},[t._v("同步删除已领取的优惠券,已领取的优惠券展示为已失效")])],1),t._v(" "),a("div",{staticClass:"acea-row row-right mt20"},[a("el-button",{attrs:{size:"mini"},on:{click:function(e){t.delShow=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return t.confirmDelete()}}},[t._v("删除")])],1)])],1)},o=[],n=a("b7be"),i=a("e350");function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var t,e={},a=Object.prototype,r=a.hasOwnProperty,o=Object.defineProperty||function(t,e,a){t[e]=a.value},n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",c=n.asyncIterator||"@@asyncIterator",u=n.toStringTag||"@@toStringTag";function v(t,e,a){return Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{v({},"")}catch(t){v=function(t,e,a){return t[e]=a}}function p(t,e,a,r){var n=e&&e.prototype instanceof w?e:w,i=Object.create(n.prototype),l=new j(r||[]);return o(i,"_invoke",{value:N(t,a,l)}),i}function d(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var f="suspendedStart",m="suspendedYield",h="executing",b="completed",_={};function w(){}function y(){}function g(){}var x={};v(x,i,(function(){return this}));var C=Object.getPrototypeOf,k=C&&C(C(O([])));k&&k!==a&&r.call(k,i)&&(x=k);var L=g.prototype=w.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){v(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function a(o,n,i,s){var c=d(t[o],t,n);if("throw"!==c.type){var u=c.arg,v=u.value;return v&&"object"==l(v)&&r.call(v,"__await")?e.resolve(v.__await).then((function(t){a("next",t,i,s)}),(function(t){a("throw",t,i,s)})):e.resolve(v).then((function(t){u.value=t,i(u)}),(function(t){return a("throw",t,i,s)}))}s(c.arg)}var n;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){a(t,r,e,o)}))}return n=n?n.then(o,o):o()}})}function N(e,a,r){var o=f;return function(n,i){if(o===h)throw new Error("Generator is already running");if(o===b){if("throw"===n)throw i;return{value:t,done:!0}}for(r.method=n,r.arg=i;;){var l=r.delegate;if(l){var s=T(l,r);if(s){if(s===_)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=d(e,a,r);if("normal"===c.type){if(o=r.done?b:m,c.arg===_)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=b,r.method="throw",r.arg=c.arg)}}}function T(e,a){var r=a.method,o=e.iterator[r];if(o===t)return a.delegate=null,"throw"===r&&e.iterator.return&&(a.method="return",a.arg=t,T(e,a),"throw"===a.method)||"return"!==r&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var n=d(o,e.iterator,a.arg);if("throw"===n.type)return a.method="throw",a.arg=n.arg,a.delegate=null,_;var i=n.arg;return i?i.done?(a[e.resultName]=i.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,_):i:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,_)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function O(e){if(e||""===e){var a=e[i];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,n=function a(){for(;++o=0;--n){var i=this.tryEntries[n],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),F(a),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var r=a.completion;if("throw"===r.type){var o=r.arg;F(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,r){return this.delegate={iterator:O(e),resultName:a,nextLoc:r},"next"===this.method&&(this.arg=t),_}},e}function c(t,e,a,r,o,n,i){try{var l=t[n](i),s=l.value}catch(c){return void a(c)}l.done?e(s):Promise.resolve(s).then(r,o)}function u(t){return function(){var e=this,a=arguments;return new Promise((function(r,o){var n=t.apply(e,a);function i(t){c(n,r,o,i,l,"next",t)}function l(t){c(n,r,o,i,l,"throw",t)}i(void 0)}))}}var v={name:"platformCoupon",data:function(){return{listLoading:!1,tableData:{data:[],total:0},tableFrom:{page:1,limit:20,category:"",name:"",status:"",receiveType:""},name:"",fromList:this.$constants.fromList,showInfo:!1,delShow:!1,cell:{},loseEfficacyStatus:0,tabPaneName:"更多",activeNames:"one",showTab:!1}},filters:{receiveType:function(t){var e={1:"手动领取",2:"商品赠送券",3:"平台自动发放"};return e[t]}},mounted:function(){Object(i["a"])(["platform:coupon:page:list"])&&this.getList(1),localStorage.getItem("adminProductClassify")||this.$store.dispatch("product/getAdminProductClassify")},methods:{checkPermi:i["a"],onchangeIsShow:function(t){var e=this;Object(n["m"])(t.id).then(u(s().mark((function t(){return s().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$message.success("修改成功");case 1:case"end":return t.stop()}}),t)})))).catch((function(){t.status=!t.status}))},look:function(t){var e=this;this.showTab=!1,this.activeNames="one",Object(n["k"])(t).then((function(t){6==t.category?(e.tabPaneName="商户列表",e.showTab=!0):2==t.category&&(e.tabPaneName="商品列表",e.showTab=!0),e.cell=t,e.showInfo=!0}))},handleDelete:function(t){this.rowId=t,this.delShow=!0},getList:function(t){var e=this;this.tableFrom.page=t||this.tableFrom.page,this.tableFrom.name=encodeURIComponent(this.name),this.listLoading=!0,Object(n["G"])(this.tableFrom).then((function(t){e.tableData.data=t.list,e.tableData.total=t.total,e.listLoading=!1})).catch((function(t){e.listLoading=!1}))},pageChange:function(t){this.tableFrom.page=t,this.getList()},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList()},handleClose:function(){this.showInfo=!1,this.delShow=!1},confirmDelete:function(){var t=this;Object(n["j"])({id:this.rowId,loseEfficacyStatus:this.loseEfficacyStatus}).then((function(){t.$message.success("删除成功"),t.delShow=!1,1===t.tableData.data.length&&t.tableFrom.page>1&&(t.tableFrom.page=t.tableFrom.page-1),t.getList(1)}))}}},p=v,d=(a("591c"),a("2877")),f=Object(d["a"])(p,r,o,!1,null,"4bf1f2d5",null);e["default"]=f.exports},"591c":function(t,e,a){"use strict";a("b0dc")},b0dc:function(t,e,a){}}]);