徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
39 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6fb26800"],{"31b4":function(t,e,r){"use strict";var n=r("9860"),i=r.n(n),a=r("b6bd"),o=r("2f62");function s(t){return(s="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})(t)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u={name:"edit",components:{formCreate:i.a.$form()},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(o.e)("admin/userLevel",["taskId","levelId"])),props:{FromData:{type:Object,default:null},userEdit:{type:Number,default:0}},data:function(){return{modals:!1,type:0,config:{global:{upload:{props:{onSuccess:function(t,e){200===t.status?e.url=t.data.src:this.Message.error(t.msg)}}}}},isDisable:!1}},methods:{couponsType:function(){this.$parent.addType(this.type)},onSubmit:function(t){var e,r=this;(setTimeout((function(){r.isDisable=!1}),1e3),this.isDisable)||(this.isDisable=!0,e=t,Object(a.a)({url:this.FromData.action,method:this.FromData.method,data:e}).then((function(t){r.$parent.getList(),r.$Message.success(t.msg),r.modals=!1,setTimeout((function(){r.$emit("submitFail")}),1e3)})).catch((function(t){r.$Message.error(t.msg)})))},cancel:function(){this.type=0}}},h=(r("c262"),r("2877")),f=Object(h.a)(u,(function(){var t=this,e=t._self._c;return t.FromData?e("div",[e("Modal",{class:t.userEdit?"userEdit":"",attrs:{scrollable:"","footer-hide":"",closable:"",title:t.FromData.title,width:"700"},on:{"on-cancel":t.cancel},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[["/marketing/coupon/save.html"===t.FromData.action?e("div",{staticClass:"radio acea-row row-middle"},[e("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),e("Radio-group",{on:{"on-change":t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[e("Radio",{attrs:{label:0}},[t._v("通用券")]),e("Radio",{attrs:{label:1}},[t._v("品类券")]),e("Radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],e("form-create",{ref:"fc",staticClass:"formBox",attrs:{option:t.config,rule:Array.from(t.FromData.rules),handleIcon:"false"},on:{"on-submit":t.onSubmit}})],2)],1):t._e()}),[],!1,null,"2850396f",null);e.a=f.exports},"3fe8":function(t,e,r){"use strict";r("c0f0")},"6d76":function(t,e,r){"use strict";r("ed00")},a8e0:function(t,e,r){"use strict";var n=r("c24f");function i(t){return(i="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})(t)}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),s=new D(n||[]);return o(a,"_invoke",{value:F(t,r,s)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var m="suspendedStart",p="suspendedYield",v="executing",b="completed",g={};function y(){}function w(){}function _(){}var x={};h(x,l,(function(){return this}));var L=Object.getPrototypeOf,k=L&&L(L(P([])));k&&k!==r&&n.call(k,l)&&(x=k);var O=_.prototype=y.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(a,o,s,l){var c=d(t[a],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==i(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,l)}),(function(t){r("throw",t,s,l)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,l)}))}l(c.arg)}var a;o(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function F(e,r,n){var i=m;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===b){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=C(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===m)throw i=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?b:p,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=b,n.method="throw",n.arg=c.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function E(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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(i(e)+" is not iterable")}return w.prototype=_,o(O,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=h(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,h(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},S(j.prototype),h(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new j(f(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},S(O),h(O,u,"Generator"),h(O,l,(function(){return this})),h(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function o(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var s={name:"send",props:{userIds:{type:String,default:""},isAll:{type:Number|String,default:0},where:{type:Object,default:function(){return{}}}},created:function(){},data:function(){return{modals:!1,loading:!1,couponList:[],columns:[{title:"优惠券名称",key:"title",align:"center",minWidth:100},{title:"优惠券面值",slot:"coupon_price",align:"center",minWidth:80},{title:"优惠券最低消费",key:"use_min_price",align:"center",minWidth:150},{title:"优惠券有效期限",key:"coupon_time",align:"center",minWidth:120},{title:"操作",slot:"action",align:"center",width:120}],page:{page:1,limit:15,coupon_title:"",type:"send"},total:0}},methods:{getList:function(t){var e=this;this.loading=!0,Object(n.d)(this.page).then(function(){var t,r=(t=a().mark((function t(r){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:200===r.status?(n=r.data,e.couponList=n.list,e.total=n.count,e.loading=!1):(e.loading=!1,e.$Message.error(r.msg));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function s(t){o(a,n,i,s,l,"next",t)}function l(t){o(a,n,i,s,l,"throw",t)}s(void 0)}))});return function(t){return r.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$Message.error(t.msg)}))},userSearchs:function(){this.getList()},pageChange:function(t){this.page.page=t,this.getList()},sendGrant:function(t,e,r){var n=this,i={title:e,info:"发送优惠券后将无法撤回,请谨慎操作!",num:r,url:"marketing/coupon/user/grant",method:"post",ids:{id:t.id,all:this.isAll}};0==this.isAll?i.ids.uid=this.userIds:1==this.isAll&&(i.ids.uid=this.userIds,i.ids.where={city:this.where.city,country:this.where.country,field_key:this.where.field_key,group_id:this.where.group_id,isMember:this.where.isMember,is_promoter:this.where.is_promoter,label_id:this.where.label_id,level:this.where.level,nickname:this.where.nickname,pay_count:this.where.pay_count,province:this.where.province,sex:this.where.sex,status:this.where.status,user_time:this.where.user_time,user_time_type:this.where.user_time_type,user_type:this.where.user_type}),this.$modalSure(i).then((function(t){n.$Message.success(t.msg)})).catch((function(t){n.$Message.error(t.msg)}))}}},l=(r("3fe8"),r("2877")),c=Object(l.a)(s,(function(){var t=this,e=t._self._c;return e("div",[e("Modal",{attrs:{"z-index":100,scrollable:"","footer-hide":"",closable:"",title:"发送优惠券","mask-closable":!1,width:"900"},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[e("div",{staticClass:"acea-row"},[e("span",{staticClass:"sp"},[t._v("优惠券名称:")]),e("Input",{staticStyle:{width:"60%"},attrs:{search:"","enter-button":"",placeholder:"请输入优惠券名称"},on:{"on-search":t.userSearchs},model:{value:t.page.coupon_title,callback:function(e){t.$set(t.page,"coupon_title",e)},expression:"page.coupon_title"}})],1),e("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns,data:t.couponList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"coupon_price",fn:function(r){var n=r.row;return[1==n.coupon_type?e("span",[t._v(t._s(n.coupon_price)+"元")]):t._e(),2==n.coupon_type?e("span",[t._v(t._s(parseFloat(n.coupon_price)/10)+"折("+t._s(n.coupon_price.toString().split(".")[0])+"%)")]):t._e()]}},{key:"action",fn:function(r){var n=r.row,i=r.index;return[e("a",{on:{click:function(e){return t.sendGrant(n,"发送优惠券",i)}}},[t._v("发送")])]}}])}),e("div",{staticClass:"acea-row row-right page"},[e("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.page.limit},on:{"on-change":t.pageChange}})],1)],1)],1)}),[],!1,null,"ea8d1cf8",null);e.a=c.exports},c0f0:function(t,e,r){},c262:function(t,e,r){"use strict";r("c54c")},c54c:function(t,e,r){},ccf8:function(t,e,r){"use strict";r.r(e);var n=r("2f62"),i=r("c297"),a=r("9b41"),o=r("c24f"),s=r("0b65"),l=r("a716"),c=r("a8e0"),u=r("31b4");function h(t){return(h="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})(t)}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new D(n||[]);return i(o,"_invoke",{value:F(t,r,s)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var m="suspendedStart",p="suspendedYield",v="executing",b="completed",g={};function y(){}function w(){}function _(){}var x={};c(x,o,(function(){return this}));var L=Object.getPrototypeOf,k=L&&L(L(P([])));k&&k!==r&&n.call(k,o)&&(x=k);var O=_.prototype=y.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(i,a,o,s){var l=d(t[i],t,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==h(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return a=a?a.then(i,i):i()}})}function F(e,r,n){var i=m;return function(a,o){if(i===v)throw Error("Generator is already running");if(i===b){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=C(s,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===m)throw i=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=v;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?b:p,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=b,n.method="throw",n.arg=c.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=d(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function E(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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(h(e)+" is not iterable")}return w.prototype=_,i(O,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=c(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,c(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},S(j.prototype),c(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new j(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},S(O),c(O,l,"Generator"),c(O,o,(function(){return this})),c(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function d(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){d(a,n,i,o,s,"next",t)}function s(t){d(a,n,i,o,s,"throw",t)}o(void 0)}))}}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){b(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function b(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==h(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var g={name:"",data:function(){return{loading:!1,formInline:{},options:s.a,columns1:[{type:"selection",width:60,align:"center"},{title:"客户信息",slot:"avatar",minWidth:120},{title:"所属客服",slot:"followOne",minWidth:80},{title:"客服所属部门",slot:"external_userid",minWidth:80},{title:"标签",slot:"corp_id",minWidth:120},{title:"性别",slot:"gender",minWidth:80},{title:"客户类型",slot:"type",minWidth:80},{title:"备注",key:"remark",minWidth:110},{title:"添加时间",key:"create_time",minWidth:110},{title:"操作",slot:"action",minWidth:130}],columns2:[{type:"selection",width:60,align:"center"},{title:"客户信息",slot:"avatars",minWidth:120},{title:"付费会员",slot:"isMember",minWidth:90},{title:"用户等级",key:"level",minWidth:90},{title:"分组",key:"group_id",minWidth:100},{title:"手机号",key:"phone",minWidth:100},{title:"用户类型",key:"user_type",minWidth:100},{title:"内部联系人",slot:"follow_list",minWidth:100},{title:"余额",key:"now_money",minWidth:100},{title:"操作",slot:"action",minWidth:80}],tableData:[],tableData1:[],tabIndex:0,grid:{xl:7,lg:10,md:12,sm:24,xs:24},timeVal:[],labelList:[],labelShow:!1,activeLabel:{add_tag:[],removeTag:[],userid:[],is_all:0},activeLabel2:{label_id:[],uids:[],all:0},tableFrom:{userid:[],label:[],time:"",name:"",page:1,limit:15},labelIds:[],usersName:"",activeDepartment:{},isSite:!0,onlyDepartment:!1,openType:"",userList:[],selectGroup:[],selectUser:[],groupList:[],user_ids:"",dataLabel:[],setLabelIndex:null,labelFormList:[],markShow:!1,remark:"",selectRow:{},FromData:null}},components:{department:i.a,userDetails:l.a,sendFrom:c.a,editFrom:u.a},filters:{genderFilter:function(t){return 0==t?"未知":1==t?"男":2==t?"女":void 0}},watch:{usersName:function(t,e){t||(this.tableFrom.userid=[])}},computed:v(v({},Object(n.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:80},labelPosition:function(){return this.isMobile?"top":"left"}}),created:function(){this.getList(),this.userGroup(),this.getWorkLabel(),this.getUserList()},methods:{selectAll:function(t){t.length&&(this.selectGroup=t)},handleSelectRow:function(t){this.selectGroup=t},userAll:function(t){t.length&&(this.selectUser=t)},userSelectRow:function(t){this.selectUser=t},getList:function(){var t=this;this.loading=!0,Object(a.i)(this.tableFrom).then((function(e){t.tableData=e.data,t.loading=!1})).catch((function(e){t.$Message.error(e.msg),t.loading=!1}))},onchangeTime:function(t){this.timeVal=t,this.tableFrom.time=this.timeVal.join("-")},dateChange:function(){this.tableFrom.page=1,this.getList()},clientSynch:function(){var t=this;Object(a.D)().then((function(e){t.$Message.success(e.msg)}))},searchData:function(){this.tableFrom.page=1,0==this.tabIndex?(this.tableFrom.label=this.labelFormList.map((function(t){return t.value})),this.getList()):this.getUserList()},pageChange:function(t){this.tableFrom.page=t,0==this.tabIndex?this.getList():this.getUserList()},getWorkLabel:function(){var t=this;Object(a.P)().then((function(e){t.labelList=e.data.map((function(e){return t.mapTree(e)}))}))},mapTree:function(t){var e=this,r=Array.isArray(t.children)&&t.children.length>0;return{title:t.label,expand:!0,value:t.value,id:t.id,selected:!1,checked:!1,children:r?t.children.map((function(t){return e.mapTree(t)})):[]}},addUser:function(){this.$refs.department.memberStatus=!0},changeMastart:function(t,e){this.tableFrom.userid=t.map((function(t){return t.userid}));var r=t.map((function(t){return t.name}));this.usersName=r.toString()},getUserList:function(){var t=this;this.loading=!0,Object(o.X)({page:this.tableFrom.page,limit:this.tableFrom.limit,user_time_type:"all",user_time:this.tableFrom.time,nickname:this.tableFrom.name,label_ids:this.labelIds.toString()}).then((function(e){var r=e.data;t.tableData1=r,t.loading=!1})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},changeMenu:function(t,e){switch(e){case"2":this.getOtherFrom(t.uid);break;case"3":this.giveLevelTime(t.uid)}},getOtherFrom:function(t){var e=this;Object(o.h)(t).then(function(){var t=m(f().mark((function t(r){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==r.data.status){t.next=2;break}return t.abrupt("return",e.$authLapse(r.data));case 2:r.data.rules[1].props.max=999999,e.FromData=r.data,e.$refs.edits.modals=!0;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},submitFail:function(t){this.$refs.userDetails.modals&&this.$refs.userDetails.getDetails(this.selectRow.uid)},giveLevelTime:function(t){var e=this;Object(o.o)(t).then(function(){var t=m(f().mark((function t(r){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==r.data.status){t.next=2;break}return t.abrupt("return",e.$authLapse(r.data));case 2:e.FromData=r.data,e.$refs.edits.modals=!0;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},onChangeType:function(){this.selectGroup=[],this.selectUser=[],this.dataLabel=[],this.tableFrom.time="",this.tableFrom.name=""},selectLabel:function(t){if(t.selected){var e=this.dataLabel.indexOf(this.dataLabel.filter((function(e){return e.id==t.id}))[0]);this.dataLabel.splice(e,1),this.activeLabel.removeTag.push(t.value),t.selected=!1}else this.dataLabel.push({id:t.id,value:t.value,title:t.title}),t.selected=!0},onSend:function(){if(0===this.selectUser.length)this.$Message.warning("请选择要发送优惠券的用户");else{var t=this.selectUser.map((function(t){return t.uid}));this.user_ids=t.join(),this.$refs.sends.modals=!0,this.$refs.sends.getList()}},setLabel:function(t){this.setLabelIndex=t,this.labelShow=!0},labeSet:function(t){var e=this;t.followOne&&t.followOne.tags.length&&this.labelList.forEach((function(r){r.children.forEach((function(r){t.followOne.tags.forEach((function(t){t.tag_id==r.value&&(r.selected=!0,e.dataLabel.push({id:r.id,value:r.value,title:r.title}))}))}))})),this.labelShow=!0,this.selectGroup[0]=t},labelConfirm:function(){var t=this;0==this.setLabelIndex?(this.labelFormList=this.dataLabel,this.labelIds=this.labelFormList.map((function(t){return t.id})),this.labelShow=!1):0==this.tabIndex?(this.activeLabel.userid=this.selectGroup.map((function(t){return t.external_userid})),this.activeLabel.add_tag=this.dataLabel.map((function(t){return t.value})),this.activeLabel.add_tag.forEach((function(e){t.activeLabel.removeTag.forEach((function(r){e==r&&t.activeLabel.add_tag.splice(e,1)}))})),Object(a.A)(this.activeLabel).then((function(e){t.$Message.success(e.msg),t.labelShow=!1})).catch((function(e){t.$Message.error(e.msg),t.labelShow=!1}))):(this.activeLabel2.uids=this.selectUser.map((function(t){return t.uid})),this.activeLabel2.label_id=this.dataLabel.map((function(t){return t.id})),Object(o.G)(this.activeLabel2).then((function(e){t.$Message.success(e.msg),t.labelShow=!1})).catch((function(e){t.$Message.error(e.msg),t.labelShow=!1})))},labelCancel:function(){this.labelShow=!1,0==this.tabIndex?this.getList():this.getUserList(),this.getWorkLabel()},handleClose2:function(t,e){var r=this.labelFormList.indexOf(e);this.labelFormList.splice(r,1),this.tableFrom.label.splice(r,1),this.labelIds.splice(r,1)},userGroup:function(){var t=this;Object(o.R)({page:1,limit:""}).then((function(e){t.groupList=e.data.list}))},changeInfo:function(t){this.$refs.userDetails.modals=!0,this.$refs.userDetails.activeName="info",this.$refs.userDetails.getDetails(t.uid)},workInfo:function(t){this.selectRow=t,this.$refs.userDetails.modals=!0,this.$refs.userDetails.activeName="info",this.$refs.userDetails.getDetails(t.uid)},editMark:function(t){this.remark=t.remark,this.selectRow=t,this.markShow=!0},editMaekConfirm:function(){var t=this;Object(a.C)(this.selectRow.id,{remark:this.remark}).then((function(e){t.$Message.success(e.msg),t.getList()})).catch((function(e){t.$Message.error(e.msg)}))},editMarkCancel:function(){this.remark=""}}},y=(r("6d76"),r("2877")),w=Object(y.a)(g,(function(){var t=this,e=t._self._c;return e("div",[e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[e("div",{staticClass:"new_card_pd"},[e("Form",{attrs:{"label-width":96,inline:"","label-colon":!0}},[e("FormItem",{attrs:{label:0==t.tabIndex?"创建时间":"访问时间"}},[e("DatePicker",{staticClass:"input-add",attrs:{editable:!1,value:t.timeVal,format:"yyyy/MM/dd HH:mm",type:"datetimerange",placement:"bottom-start",placeholder:"自定义时间",options:t.options},on:{"on-change":t.onchangeTime}})],1),e("FormItem",{directives:[{name:"show",rawName:"v-show",value:0==t.tabIndex,expression:"tabIndex == 0"}],attrs:{label:"选择客服"}},[e("Input",{staticClass:"input-add",attrs:{placeholder:"请输入",clearable:!0},on:{"on-focus":t.addUser},model:{value:t.usersName,callback:function(e){t.usersName=e},expression:"usersName"}})],1),e("FormItem",{attrs:{label:"客户标签"}},[e("div",{staticClass:"check_label acea-row row-middle",on:{click:function(e){return t.setLabel(0)}}},t._l(t.labelFormList,(function(r,n){return e("Tag",{key:n,attrs:{name:r.title,closable:""},on:{"on-close":t.handleClose2}},[t._v(t._s(r.title))])})),1)]),e("FormItem",{attrs:{label:"客户名称"}},[e("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入客户名称"},model:{value:t.tableFrom.name,callback:function(e){t.$set(t.tableFrom,"name",e)},expression:"tableFrom.name"}}),e("Button",{attrs:{type:"primary"},on:{click:function(e){return t.searchData()}}},[t._v("查询")])],1)],1)],1)]),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("div",{staticClass:"new_tab"},[e("Tabs",{on:{"on-click":t.onChangeType},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},[e("TabPane",{attrs:{label:"企微客户",name:"0"}}),e("TabPane",{attrs:{label:"非企微客户",name:"1"}})],1)],1),e("div",{staticClass:"acea-row"},[e("Button",{directives:[{name:"show",rawName:"v-show",value:0==t.tabIndex,expression:"tabIndex == 0"}],staticClass:"mr-12",attrs:{type:"primary"},on:{click:function(e){return t.clientSynch()}}},[t._v("同步企业微信客户")]),e("Button",{directives:[{name:"show",rawName:"v-show",value:0==t.tabIndex,expression:"tabIndex == 0"}],attrs:{disabled:!t.selectGroup.length},on:{click:function(e){return t.setLabel(1)}}},[t._v("批量设置标签")]),e("div",{directives:[{name:"show",rawName:"v-show",value:1==t.tabIndex,expression:"tabIndex == 1"}]},[e("Button",{directives:[{name:"auth",rawName:"v-auth",value:["admin-user-coupon"],expression:"['admin-user-coupon']"}],staticClass:"mr-12",attrs:{disabled:!t.selectUser.length},on:{click:t.onSend}},[t._v("发送优惠券")]),e("Button",{directives:[{name:"show",rawName:"v-show",value:1==t.tabIndex,expression:"tabIndex == 1"}],attrs:{disabled:!t.selectUser.length},on:{click:function(e){return t.setLabel(2)}}},[t._v("批量设置标签")])],1)],1),0==t.tabIndex?e("Table",{ref:"selection",staticClass:"ivu-mt",attrs:{columns:t.columns1,data:t.tableData.list,loading:t.loading},on:{"on-select-all":t.selectAll,"on-select-all-cancel":t.selectAll,"on-selection-change":t.handleSelectRow},scopedSlots:t._u([{key:"avatar",fn:function(r){var n=r.row;return[e("viewer",{staticClass:"acea-row"},[e("div",{staticClass:"tabBox_img mr-12"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:n.avatar,expression:"row.avatar"}]})]),e("div",{staticClass:"acea-row row-column row-center"},[e("span",[t._v(t._s(n.name))]),e("span",[t._v("ID:"+t._s(n.id))])])])]}},{key:"gender",fn:function(r){var n=r.row;return[e("span",[t._v(t._s(t._f("genderFilter")(n.gender)))])]}},{key:"followOne",fn:function(r){var n=r.row;return[n.followOne?e("span",[t._v(t._s(n.followOne.member.name))]):t._e()]}},{key:"corp_id",fn:function(r){var n=r.row;return[n.followOne?e("div",t._l(n.followOne.tags,(function(r,n){return e("Tag",{key:n,attrs:{size:"medium"}},[t._v(t._s(r.tag_name))])})),1):t._e()]}},{key:"external_userid",fn:function(r){var n=r.row;return[n.followOne?e("span",[t._v(t._s(n.followOne.member.mastare_department_name))]):t._e()]}},{key:"type",fn:function(r){return[1==r.row.type?e("Tag",{attrs:{color:"blue",size:"medium"}},[t._v("微信用户")]):e("Tag",{attrs:{color:"gold",size:"medium"}},[t._v("企微用户")])]}},{key:"action",fn:function(r){var n=r.row;return[e("a",{attrs:{disabled:0==n.uid},on:{click:function(e){return t.workInfo(n)}}},[t._v("详情")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.editMark(n)}}},[t._v("备注")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.labeSet(n)}}},[t._v("设置标签")])]}}],null,!1,3998433359)}):t._e(),1==t.tabIndex?e("Table",{ref:"table",staticClass:"ivu-mt",attrs:{columns:t.columns2,data:t.tableData1.list,"highlight-row":"",loading:t.loading,"no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},on:{"on-select-all":t.userAll,"on-select-all-cancel":t.userAll,"on-selection-change":t.userSelectRow},scopedSlots:t._u([{key:"avatars",fn:function(r){var n=r.row;return[e("viewer",{staticClass:"acea-row"},[e("div",{staticClass:"tabBox_img mr-12"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:n.avatar,expression:"row.avatar"}]})]),e("div",{staticClass:"acea-row row-column row-center"},[e("span",[t._v(t._s(n.nickname))]),e("span",[t._v("UID:"+t._s(n.uid))])])])]}},{key:"nickname",fn:function(r){var n=r.row;return[e("div",{staticClass:"acea-row"},[e("Icon",{directives:[{name:"show",rawName:"v-show",value:"男"===n.sex,expression:"row.sex === '男'"}],staticClass:"mr5",attrs:{type:"md-male",color:"#2db7f5",size:"15"}}),e("Icon",{directives:[{name:"show",rawName:"v-show",value:"女"===n.sex,expression:"row.sex === '女'"}],staticClass:"mr5",attrs:{type:"md-female",color:"#ed4014",size:"15"}}),e("div",{domProps:{textContent:t._s(n.nickname)}})],1)]}},{key:"isMember",fn:function(r){var n=r.row;return[e("div",[t._v(t._s(n.isMember?"是":"否"))])]}},{key:"follow_list",fn:function(r){var n=r.row;return[n.follow_list?e("div",t._l(n.follow_list,(function(r,n){return e("span",{key:n},[t._v(t._s(r.member.name))])})),0):t._e()]}},{key:"action",fn:function(r){var n=r.row;return[e("a",{on:{click:function(e){return t.changeInfo(n)}}},[t._v("详情")])]}}],null,!1,3129353630)}):t._e(),e("div",{staticClass:"acea-row row-right page"},[e("Page",{attrs:{total:0==t.tabIndex?t.tableData.count:t.tableData1.count,current:t.tableFrom.page,"show-elevator":"","show-total":"","page-size":t.tableFrom.limit},on:{"on-change":t.pageChange}})],1)],1),e("department",{ref:"department",attrs:{"active-department":t.activeDepartment,"is-site":t.isSite,"only-department":t.onlyDepartment},on:{changeMastart:t.changeMastart}}),e("Modal",{attrs:{scrollable:"",title:"选择用户标签",closable:!0,width:"540","footer-hide":!0},on:{"on-cancel":t.labelCancel},model:{value:t.labelShow,callback:function(e){t.labelShow=e},expression:"labelShow"}},[e("div",{staticClass:"label-wrapper"},[e("div",{staticClass:"list-box"},[t._l(t.labelList,(function(r,n){return e("div",{key:n,staticClass:"label-box"},[r.children&&r.children.length?e("div",{staticClass:"title"},[t._v("\n "+t._s(r.title)+"\n ")]):t._e(),r.children&&r.children.length?e("div",{staticClass:"list"},t._l(r.children,(function(r,n){return e("div",{key:n,staticClass:"label-item",class:{on:r.selected},on:{click:function(e){return t.selectLabel(r)}}},[t._v("\n "+t._s(r.title)+"\n ")])})),0):t._e()])})),t.labelList?t._e():e("div",[t._v("暂无标签")])],2),e("div",{staticClass:"footer"},[e("Button",{staticClass:"btns",attrs:{type:"primary"},on:{click:function(e){return t.labelConfirm()}}},[t._v("确定")]),e("Button",{staticClass:"btns",attrs:{type:"primary",ghost:""},on:{click:function(e){return t.labelCancel()}}},[t._v("取消")])],1)])]),e("user-details",{ref:"userDetails",attrs:{"group-list":t.groupList}}),e("send-from",{ref:"sends",attrs:{userIds:t.user_ids}}),e("Modal",{attrs:{title:"设置备注",width:"400",closable:!1,"class-name":"vertical-center-modal"},on:{"on-ok":function(e){return t.editMaekConfirm()},"on-cancel":function(e){return t.editMarkCancel()}},model:{value:t.markShow,callback:function(e){t.markShow=e},expression:"markShow"}},[e("Form",{attrs:{"label-width":75,"label-position":"right"},model:{value:t.markShow,callback:function(e){t.markShow=e},expression:"markShow"}},[e("FormItem",{attrs:{label:"备注:",required:""}},[e("Input",{staticClass:"input-add",attrs:{type:"textarea",placeholder:"请输入备注"},model:{value:t.remark,callback:function(e){t.remark=e},expression:"remark"}})],1)],1)],1),e("edit-from",{ref:"edits",attrs:{FromData:t.FromData,userEdit:1},on:{submitFail:t.submitFail}})],1)}),[],!1,null,"085728d0",null);e.default=w.exports},ed00:function(t,e,r){}}]);