mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-12 19:12:49 +00:00
1 line
19 KiB
JavaScript
1 line
19 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4c9da206","chunk-2d0e488e"],{"1d84":function(t,e,r){"use strict";r.r(e),r("a4d3"),r("e01a"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("d9e2"),r("159b"),r("b0c0"),r("131a"),r("fb6a");var n=r("0122"),a=r("c964"),o=r("f3f3"),i=(r("99af"),r("d3b7"),r("2f62")),s=r("9144"),c=r("c24f"),l=r("3f2a");function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(e){l=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o,i,s,c;e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new k(n||[]);return a(e,"_invoke",{value:(o=t,i=r,s=n,c="suspendedStart",function(t,e){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===t)throw e;return O()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var n=r.method,a=e.iterator[n];return void 0===a?(r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f):(n=h(a,e.iterator,r.arg),"throw"===n.type?(r.method="throw",r.arg=n.arg,r.delegate=null,f):(a=n.arg,a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)))}(r,s),r)){if(r===f)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===c)throw c="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(c="executing",r=h(o,i,s),"normal"===r.type){if(c=s.done?"completed":"suspendedYield",r.arg===f)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(c="completed",s.method="throw",s.arg=r.arg)}})}),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=d;var f={};function m(){}function p(){}function g(){}o={};var v=(l(o,i,(function(){return this})),Object.getPrototypeOf),b=(v=v&&v(v(M([]))),v&&v!==e&&r.call(v,i)&&(o=v),g.prototype=m.prototype=Object.create(o));function y(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;a(this,"_invoke",{value:function(a,i){function s(){return new e((function(o,s){!function a(o,i,s,c){var l;o=h(t[o],t,i);if("throw"!==o.type)return(i=(l=o.arg).value)&&"object"==Object(n.a)(i)&&r.call(i,"__await")?e.resolve(i.__await).then((function(t){a("next",t,s,c)}),(function(t){a("throw",t,s,c)})):e.resolve(i).then((function(t){l.value=t,s(l)}),(function(t){return a("throw",t,s,c)}));c(o.arg)}(a,i,o,s)}))}return o=o?o.then(s,s):s()}})}function x(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function M(t){if(t){var e,n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(n=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n}).next=n}return{next:O}}function O(){return{value:void 0,done:!0}}return a(b,"constructor",{value:p.prototype=g,configurable:!0}),a(g,"constructor",{value:p,configurable:!0}),p.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(w.prototype),l(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new w(d(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},y(b),l(b,c,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=M,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;0<=a;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,a=this.tryEntries[e];if(a.tryLoc===t)return"throw"===(r=a.completion).type&&(n=r.arg,_(a)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:M(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}s={name:"index",components:{cardList:s.default},data:function(){var t=this;return{cardModal:!1,id:0,grid:{xl:7,lg:7,md:12,sm:24,xs:24},columns:[{title:"编号",key:"id"},{title:"批次名称",key:"title"},{title:"体验天数",key:"use_day"},{title:"发卡总数量",key:"total_num"},{title:"使用数量",key:"use_num"},{title:"制卡时间",key:"add_time"},{title:"是否激活",slot:"status"},{title:"备注",key:"remark"},{title:"操作",slot:"action",fixed:"right"}],tbody:[],total:0,gradeFrom:{title:"",page:1,limit:15},loading:!1,modal:!1,rule:[{type:"input",field:"title",title:"批次名称",validate:[{required:!0,message:"请输入批次名称",trigger:"blur"}]},{type:"InputNumber",field:"total_num",title:"制卡数量",value:1,props:{min:1,precision:0,max:1e5},on:{"on-change":function(e){1e5<e&&t.$nextTick((function(e){t.rule[1].value=1e5}))}}},{type:"InputNumber",field:"use_day",title:"体验天数",value:1,props:{min:1,precision:0,max:1e5},on:{"on-change":function(e){1e5<e&&t.$nextTick((function(e){t.rule[2].value=1e5}))}}},{type:"radio",field:"status",title:"是否激活",value:"0",options:[{value:"0",label:"冻结"},{value:"1",label:"激活"}]},{type:"input",field:"remark",title:"备注",props:{type:"textarea"}}],modal2:!1,rule2:[{type:"hidden",field:"id",value:""},{type:"input",field:"title",title:"批次名称",value:"",validate:[{required:!0,message:"请输入批次名称",trigger:"blur"}]}],modal3:!1,qrcode:null,fapi:{}}},computed:Object(o.a)(Object(o.a)({},Object(i.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getMemberBatch(this.gradeFrom)},methods:{getMemberBatch:function(){var t=this;this.loading=!0,Object(c.S)(this.gradeFrom).then((function(e){t.loading=!1,t.tbody=e.data.list,t.total=e.data.count})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},userSearchs:function(){this.gradeFrom.page=1,this.getMemberBatch()},onchangeIsShow:function(t){var e=this;Object(c.t)(t.id,{field:"status",value:t.status}).then((function(t){e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(t.msg)}))},export:function(t){var e=this;return Object(a.a)(u().mark((function r(){var n,a,o,i,s;return u().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=[],a=[],o=[],i="",r.next=3,e.getExcelData(t.id);case 3:s=r.sent,i=i||s.filename,a.length||(a=s.fileKey),n.length||(n=s.header),o=o.concat(s.export),e.$exportExcel(n,a,i,o);case 9:case"end":return r.stop()}}),r)})))()},getExcelData:function(t){return new Promise((function(e,r){Object(l.g)(t).then((function(t){e(t.data)}))}))},changeMenu:function(t,e){switch(e){case"1":this.rule2[0].value=t.id,this.rule2[1].value=t.title,this.modal2=!0;break;case"2":this.id=t.id,this.cardModal=!0;break;case"3":this.export(t)}},pageChange:function(t){this.gradeFrom.page=t,this.getMemberBatch()},addBatch:function(){this.fapi.resetFields(),this.modal=!0},onSubmit:function(t){var e=this;Object(c.s)(0,t).then((function(t){e.modal=!1,e.$Message.success(t.msg),e.getMemberBatch(),e.fapi.resetFields()})).catch((function(t){e.$Message.error(t.msg)}))},onSubmit2:function(t){var e=this;Object(c.t)(t.id,{field:"title",value:t.title}).then((function(t){e.modal2=!1,e.$Message.success(t.msg),e.getMemberBatch()})).catch((function(t){e.$Message.error(t.msg)}))},getMemberScan:function(){var t=this;this.$Spin.show(),Object(c.U)().then((function(e){t.$Spin.hide(),t.qrcode=e.data,t.modal3=!0})).catch((function(e){t.$Spin.hide(),t.$Message.error(e.msg)}))}}},r("c744"),o=r("2877"),i=Object(o.a)(s,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Form",{attrs:{model:t.gradeFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[r("Row",{attrs:{type:"flex",gutter:24}},[r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"批次名称:","label-for":"title"}},[r("Input",{attrs:{search:"","enter-button":"",placeholder:"请输入批次名称"},on:{"on-search":t.userSearchs},model:{value:t.gradeFrom.title,callback:function(e){t.$set(t.gradeFrom,"title",e)},expression:"gradeFrom.title"}})],1)],1)],1),r("Row",{attrs:{type:"flex"}},[r("Col",t._b({},"Col",t.grid,!1),[r("Button",{staticClass:"mr20",attrs:{type:"primary",icon:"md-add"},on:{click:t.addBatch}},[t._v("添加批次")]),r("Button",{on:{click:t.getMemberScan}},[t._v("下载二维码")])],1)],1)],1),r("Table",{staticClass:"mt25",attrs:{columns:t.columns,data:t.tbody,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.row;return e.index,[r("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[r("span",{attrs:{slot:"open"},slot:"open"},[t._v("激活")]),r("span",{attrs:{slot:"close"},slot:"close"},[t._v("冻结")])])]}},{key:"action",fn:function(e){var n=e.row,a=e.index;return[[r("Dropdown",{attrs:{transfer:!0},on:{"on-click":function(e){return t.changeMenu(n,e,a)}}},[r("a",{attrs:{href:"javascript:void(0)"}},[t._v("\n 更多\n "),r("Icon",{attrs:{type:"ios-arrow-down"}})],1),r("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[r("DropdownItem",{attrs:{name:"1"}},[t._v("编辑批次名")]),r("DropdownItem",{attrs:{name:"2"}},[t._v("查看卡列表")]),r("DropdownItem",{attrs:{name:"3"}},[t._v("导出")])],1)],1)]]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("Page",{attrs:{total:t.total,current:t.gradeFrom.page,"page-size":t.gradeFrom.limit,"show-elevator":"","show-total":""},on:{"on-change":t.pageChange}})],1)],1),r("Modal",{attrs:{title:"添加批次","footer-hide":""},model:{value:t.modal,callback:function(e){t.modal=e},expression:"modal"}},[r("form-create",{attrs:{rule:t.rule},on:{submit:t.onSubmit},model:{value:t.fapi,callback:function(e){t.fapi=e},expression:"fapi"}})],1),r("Modal",{attrs:{title:"卡列表","footer-hide":"",width:"1000"},model:{value:t.cardModal,callback:function(e){t.cardModal=e},expression:"cardModal"}},[t.cardModal?r("cardList",{attrs:{id:t.id}}):t._e()],1),r("Modal",{attrs:{title:"编辑批次名","footer-hide":""},model:{value:t.modal2,callback:function(e){t.modal2=e},expression:"modal2"}},[r("form-create",{attrs:{rule:t.rule2},on:{submit:t.onSubmit2}})],1),r("Modal",{attrs:{title:"二维码","footer-hide":""},model:{value:t.modal3,callback:function(e){t.modal3=e},expression:"modal3"}},[t.qrcode?r("div",{staticClass:"acea-row row-around"},[t.qrcode&&t.qrcode.wechat_img?r("div",{staticClass:"acea-row row-column-around row-between-wrapper"},[r("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"QRpic"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.qrcode.wechat_img,expression:"qrcode.wechat_img"}]})]),r("span",{staticClass:"mt10"},[t._v("公众号二维码")])]):t._e(),t.qrcode&&t.qrcode.routine?r("div",{staticClass:"acea-row row-column-around row-between-wrapper"},[r("div",{directives:[{name:"viewer",rawName:"v-viewer"}],staticClass:"QRpic"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.qrcode.routine,expression:"qrcode.routine"}]})]),r("span",{staticClass:"mt10"},[t._v("小程序二维码")])]):t._e()]):r("Spin")],1)],1)}),[],!1,null,"04e9e2ff",null),e.default=i.exports},"3f2a":function(t,e,r){"use strict";r.d(e,"f",(function(){return a})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return i})),r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return c})),r.d(e,"e",(function(){return l})),r.d(e,"g",(function(){return u}));var n=r("6b6c");function a(t){return Object(n.a)({url:"/export/user_list",method:"get",params:t})}function o(t){return Object(n.a)({url:"/export/order_list",method:"get",params:t})}function i(t){return Object(n.a)({url:"/export/product_list",method:"get",params:t})}function s(t){return Object(n.a)({url:"/export/bargain_list",method:"get",params:t})}function c(t){return Object(n.a)({url:"/export/combination_list",method:"get",params:t})}function l(t){return Object(n.a)({url:"/export/seckill_list",method:"get",params:t})}function u(t){return Object(n.a)({url:"/export/member_card/".concat(t),method:"get"})}},"7fd6":function(t,e,r){},9144:function(t,e,r){"use strict";r.r(e);var n=r("f3f3"),a=r("c24f"),o=r("2f62");n={name:"card",props:{id:{default:0}},data:function(){return{columns1:[{title:"编号",key:"id",minWidth:100,align:"center"},{title:"卡号",key:"card_number",minWidth:105,align:"center"},{title:"密码",key:"card_password",align:"center",minWidth:100},{title:"领取人名称",key:"username",align:"center",minWidth:100},{title:"领取人电话",key:"phone",align:"center",minWidth:100},{title:"领取时间",key:"use_time",align:"center",minWidth:100},{title:"是否激活",slot:"status",minWidth:100}],data1:[],loading:!1,total:0,table:{page:1,limit:15,card_number:"",phone:"",is_use:""}}},computed:Object(n.a)(Object(n.a)({},Object(o.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getMemberCard()},methods:{onchangeIsShow:function(t){var e=this;t={card_id:t.id,status:t.status};Object(a.v)(t).then((function(t){e.$Message.success(t.msg),e.getMemberCard()})).catch((function(t){e.$Message.error(t.msg)}))},getMemberCard:function(){var t=this;this.loading=!0,Object(a.T)(this.id,this.table).then((function(e){t.loading=!1,t.data1=e.data.list,t.total=e.data.count})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},formSubmit:function(){this.table.page=1,this.getMemberCard()},pageChange:function(t){this.table.page=t,this.getMemberCard()}}},o=r("2877"),r=Object(o.a)(n,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Form",{ref:"formData",attrs:{model:t.table,"label-width":t.labelWidth,"label-position":t.labelPosition,inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[r("FormItem",{staticStyle:{width:"200px"},attrs:{label:"卡号:"}},[r("Input",{attrs:{placeholder:"请输入卡号"},model:{value:t.table.card_number,callback:function(e){t.$set(t.table,"card_number",e)},expression:"table.card_number"}})],1),r("FormItem",{staticStyle:{width:"200px"},attrs:{label:"手机号:"}},[r("Input",{attrs:{placeholder:"请输入手机号"},model:{value:t.table.phone,callback:function(e){t.$set(t.table,"phone",e)},expression:"table.phone"}})],1),r("FormItem",{staticStyle:{width:"200px"},attrs:{label:"是否领取:"}},[r("Select",{attrs:{clearable:""},model:{value:t.table.is_use,callback:function(e){t.$set(t.table,"is_use",e)},expression:"table.is_use"}},[r("Option",{attrs:{value:"1"}},[t._v("已领取")]),r("Option",{attrs:{value:"0"}},[t._v("未领取")])],1)],1),r("FormItem",[r("Button",{attrs:{type:"primary"},on:{click:t.formSubmit}},[t._v("搜索")])],1)],1),r("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.data1,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.row;return e.index,[r("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"status",e)},expression:"row.status"}},[r("span",{attrs:{slot:"open"},slot:"open"},[t._v("激活")]),r("span",{attrs:{slot:"close"},slot:"close"},[t._v("冻结")])])]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("Page",{attrs:{total:t.total,current:t.table.page,"page-size":t.table.limit,"show-elevator":"","show-total":""},on:{"on-change":t.pageChange}})],1)],1)],1)}),[],!1,null,null,null);e.default=r.exports},c744:function(t,e,r){"use strict";var n=r("7fd6");r.n(n).a}}]); |