| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-55c06f49"],{2838:function(t,e,a){"use strict";a.r(e);var n=a("c964"),r=a("f3f3"),o=(a("96cf"),a("a434"),a("2f62")),i=a("b7be"),s=a("31b4"),c=a("61f7");s={name:"storeCoupon",filters:{formatDate:function(t){if(0!==t)return t=new Date(1e3*t),Object(c.a)(t,"yyyy-MM-dd hh:mm")}},components:{editFrom:s.a},data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"优惠券名称",key:"title",minWidth:150},{title:"优惠券类型",key:"type",minWidth:80},{title:"面值",key:"coupon_price",minWidth:100},{title:"最低消费额",key:"use_min_price",minWidth:100},{title:"有效期限(天)",key:"coupon_time",minWidth:120},{title:"排序",key:"sort",minWidth:80},{title:"是否有效",slot:"status",minWidth:90},{title:"添加时间",slot:"add_time",minWidth:150},{title:"操作",slot:"action",fixed:"right",minWidth:170}],tableFrom:{status:"",title:"",page:1,limit:15},tableList:[],total:0,FromData:null}},created:function(){this.getList()},computed:Object(r.a)(Object(r.a)({},Object(o.e)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:90},labelPosition:function(){return this.isMobile?"top":"left"}}),methods:{couponInvalid:function(t,e,a){var n=this;e={title:e,num:a,url:"marketing/coupon/status/".concat(t.id),method:"PUT",ids:""};this.$modalSure(e).then((function(t){n.$Message.success(t.msg),n.getList()})).catch((function(t){n.$Message.error(t.msg)}))},couponSend:function(t){var e=this;this.$modalForm(Object(i.s)(t.id)).then((function(){return e.getList()}))},couponDel:function(t,e,a){var n=this;e={title:e,num:a,url:"marketing/coupon/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){n.$Message.success(t.msg),n.tableList.splice(a,1)})).catch((function(t){n.$Message.error(t.msg)}))},getList:function(){var t=this;this.loading=!0,this.tableFrom.status=this.tableFrom.status||"",Object(i.q)(this.tableFrom).then(function(){var e=Object(n.a)(regeneratorRuntime.mark((function e(a){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.data,t.tableList=n.list,t.total=a.data.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.tableFrom.page=t,this.getList()},changeType:function(t){this.type=t},add:function(){this.addType(0)},addType:function(t){var e=this;Object(i.n)(t).then(function(){var t=Object(n.a)(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1===a.data.status)return t.abrupt("return",e.$authLapse(a.data));t.next=2;break;case 2:e.FromData=a.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)}))},edit:function(t){var e=this;this.$modalForm(Object(i.p)(t.id)).then((function(){return e.getList()}))},userSearchs:function(){this.tableFrom.page=1,this.getList()},submitFail:function(){this.getList()}}},a("38d6"),r=a("2877"),o=Object(r.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"i-layout-page-header"},[a("div",{staticClass:"i-layout-page-header"},[a("span",{staticClass:"ivu-page-header-title"},[t._v(t._s(t.$route.meta.title))])])]),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Form",{ref:"tableFrom",attrs:{model:t.tableFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("Row",{attrs:{type:"flex",gutter:24}},[a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"是否有效:","label-for":"status"}},[a("Select",{attrs:{placeholder:"请选择",clearable:"","element-id":"status"},on:{"on-change":t.userSearchs},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[a("Option",{attrs:{value:"1"}},[t._v("有效")]),a("Option",{attrs:{value:"0"}},[t._v("无效")])],1)],1)],1),a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"优惠券名称:","label-for":"title"}},[a("Input",{attrs:{search:"","enter-button":"",placeholder:"请输入优惠券名称"},on:{"on-search":t.userSearchs},model:{value:t.tableFrom.title,callback:function(e){t.$set(t.tableFrom,"title",e)},expression:"tableFrom.title"}})],1)],1)],1),a("Row",{attrs:{type:"flex"}},[a("Col",t._b({},"Col",t.grid,!1),[a("Button",{directives:[{name:"auth",rawName:"v-auth",value:["admin-marketing-store_coupon-add"],expression:"['admin-marketing-store_coupon-add']"}],attrs:{type:"primary",icon:"md-add"},on:{click:t.add}},[t._v("添加优惠券")])],1)],1)],1),a("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.tableList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"status",fn:function(t){var e=t.row;return t.index,[1===e.status?a("Icon",{attrs:{type:"md-checkmark",color:"#0092DC",size:"14"}}):a("Icon",{attrs:{type:"md-close",color:"#ed5565",size:"14"}})]}},{key:"add_time",fn:function(e){var n=e.row;return e.index,[a("span",[t._v(" "+t._s(t._f("formatDate")(n.add_time)))])]}},{key:"action",fn:function(e){var n=e.row,r=e.index;return[n.status?a("a",{on:{click:function(e){return t.couponInvalid(n,"修改优惠券",r)}}},[t._v("立即失效")]):t._e(),n.status?a("Divider",{attrs:{type:"vertical"}}):t._e(),n.status?a("a",{directives:[{name:"auth",rawName:"v-auth",value:["admin-marketing-store_coupon-push"],expression:"['admin-marketing-store_coupon-push']"}],on:{click:function(e){return t.couponSend(n)}}},[t._v("发布")]):t._e(),n.status?a("Divider",{attrs:{type:"vertical"}}):t._e(),a("a",{on:{click:function(e){return t.couponDel(n,"删除优惠券",r)}}},[t._v("删除")])]}}])}),a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{total:t.total,current:t.tableFrom.page,"show-elevator":"","show-total":"","page-size":t.tableFrom.limit},on:{"on-change":t.pageChange}})],1)],1),a("edit-from",{ref:"edits",attrs:{FromData:t.FromData},on:{changeType:t.changeType}})],1)}),[],!1,null,"91b2cca8",null);e.default=o.exports},"2c3e":function(t,e,a){var n=a("da84"),r=a("83ab"),o=a("9f7f").MISSED_STICKY,i=a("c6b6"),s=a("edd0"),c=a("69f3").get,u=RegExp.prototype,l=n.TypeError;r&&o&&s(u,"sticky",{configurable:!0,get:function(){if(this!==u){if("RegExp"===i(this))return!!c(this).sticky;throw l("Incompatible receiver, RegExp required")}}})},"31b4":function(t,e,a){"use strict";var n=a("f3f3"),r=a("9860"),o=(r=a.n(r),a("6b6c")),i=a("2f62");r={name:"edit",components:{formCreate:r.a.$form()},computed:Object(n.a)({},Object(i.e)("userLevel",["taskId","levelId"])),props:{FromData:{type:Object,default:null},update:{type:Boolean,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)}}}}}}},methods:{couponsType:function(){this.$parent.addType(this.type)},onSubmit:function(t){var e=this;Object(o.a)({url:this.FromData.action,method:this.FromData.method,data:t}).then((function(t){e.update&&e.$parent.getList(),e.$Message.success(t.msg),e.modals=!1,setTimeout((function(){e.$emit("submitFail")}),1e3)})).catch((function(t){e.$Message.error(t.msg)}))},cancel:function(){this.type=0}}},a("3c71"),n=a("2877"),i=Object(n.a)(r,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return t.FromData?e("div",[e("Modal",{attrs:{scrollable:"","footer-hide":"",closable:"",title:t.FromData.title,"z-index":1,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,"671a3e20",null);e.a=i.exports},"38d6":function(t,e,a){"use strict";var n=a("809b");a.n(n).a},"3c71":function(t,e,a){"use strict";var n=a("be2f");a.n(n).a},"4d63":function(t,e,a){var n=a("83ab"),r=a("da84"),o=a("e330"),i=a("94ca"),s=a("7156"),c=a("9112"),u=a("241c").f,l=a("3a9b"),d=a("44e7"),f=a("577e"),m=a("90d8"),p=a("9f7f"),h=a("aeb0"),g=a("cb2d"),b=a("d039"),v=a("1a2d"),y=a("69f3").enforce,x=a("2626"),_=a("b622"),k=a("fce3"),F=a("107c"),w=_("match"),$=r.RegExp,D=$.prototype,E=r.SyntaxError,O=o(D.exec),R=o("".charAt),C=o("".replace),S=o("".indexOf),j=o("".slice),M=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,T=/a/g,L=(a=new $(I)!==I,p.MISSED_STICKY),W=p.UNSUPPORTED_Y;_=n&&(!a||L||k||F||b((function(){return T[w]=!1,$(I)!=I||$(T)==T||"/a/i"!=$(I,"i")})));if(i("RegExp",_)){function A(t,e){var a,n,r=l(D,this),o=d(t),i=void 0===e,u=[],p=t;if(!r&&o&&i&&t.constructor===A)return t;if((o||l(D,t))&&(t=t.source,i&&(e=m(p))),t=void 0===t?"":f(t),e=void 0===e?"":f(e),p=t,o=e=k&&"dotAll"in I&&(a=!!e&&-1<S(e,"s"))?C(e,/s/g,""):e,L&&"sticky"in I&&(n=!!e&&-1<S(e,"y"))&&W&&(e=C(e,/y/g,"")),F&&(t=(i=function(t){for(var e,a=t.length,n=0,r="",o=[],i={},s=!1,c=!1,u=0,l="";n<=a;n++){if("\\"===(e=R(t,n)))e+=R(t,++n);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:O(M,j(t,n+1))&&(n+=2,c=!0),r+=e,u++;continue;case">"===e&&c:if(""===l||v(i,l))throw new E("Invalid capture group name");i[l]=!0,c=!(o[o.length]=[l,u]),l="";continue}c?l+=e:r+=e}return[r,o]}(t))[0],u=i[1]),i=s($(t,e),r?this:D,A),(a||n||u.length)&&(e=y(i),a&&(e.dotAll=!0,e.raw=A(function(t){for(var e,a=t.length,n=0,r="",o=!1;n<=a;n++)"\\"===(e=R(t,n))?r+=e+R(t,++n):o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),r+=e):r+="[\\s\\S]";return r}(t),o)),n&&(e.sticky=!0),u.length&&(e.groups=u)),t!==p)try{c(i,"source",""===p?"(?:)":p)}catch(t){}return i}for(var P=u($),q=0;P.length>q;)h(A,$,P[q++]);(D.constructor=A).prototype=D,g(r,"RegExp",A,{constructor:!0})}x("RegExp")},"61f7":function(t,e,a){"use strict";a.d(e,"a",(function(){return o})),a.d(e,"c",(function(){return c})),a.d(e,"b",(function(){return u}));var n=a("fc11"),r=a("f3f3");function o(t,e){/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));var a,n,r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(a in r)new RegExp("(".concat(a,")")).test(e)&&(n=r[a]+"",e=e.replace(RegExp.$1,1===RegExp.$1.length?n:("00"+n).substr(n.length)));return e}a("ac1f"),a("00b4"),a("5319"),a("4d63"),a("c607"),a("2c3e"),a("25f0"),a("498a"),a("d3b7"),a("b64b"),a("99af");var i={min:"%s最小长度为:min",max:"%s最大长度为:max",length:"%s长度必须为:length",range:"%s长度为:range",pattern:"$s格式错误"};function s(t,e){t.message=function(t){return e.replace("%s",t||"")}}function c(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return Object(r.a)({required:!0,message:t,type:"string"},e)}function u(t){return l.pattern(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,t)}s(c,"请输入%s"),s(u,"%s格式不正确");var l=Object.keys(i).reduce((function(t,e){return t[e]=function(t){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i="range"===e?{min:t[0],max:t[1]}:Object(n.a)({},e,t);return Object(r.a)(Object(r.a)({message:a.replace(":".concat(e),"range"===e?"".concat(t[0],"-").concat(t[1]):t),type:"string"},i),o)},s(t[e],i[e]),t}),{})},"809b":function(t,e,a){},be2f:function(t,e,a){},c607:function(t,e,a){var n=a("da84"),r=a("83ab"),o=a("fce3"),i=a("c6b6"),s=a("edd0"),c=a("69f3").get,u=RegExp.prototype,l=n.TypeError;r&&o&&s(u,"dotAll",{configurable:!0,get:function(){if(this!==u){if("RegExp"===i(this))return!!c(this).dotAll;throw l("Incompatible receiver, RegExp required")}}})},edd0:function(t,e,a){var n=a("13d2"),r=a("9bf2");t.exports=function(t,e,a){return a.get&&n(a.get,e,{getter:!0}),a.set&&n(a.set,e,{setter:!0}),r.f(t,e,a)}}}]);
|