| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1a9d56ef"],{2838:function(t,e,a){"use strict";a.r(e);var n=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;t.index;return[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;e.index;return[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)},r=[],i=a("c964"),o=a("f3f3"),s=(a("96cf"),a("a434"),a("2f62")),c=a("b7be"),u=a("31b4"),l=a("61f7"),d={name:"storeCoupon",filters:{formatDate:function(t){if(0!==t){var e=new Date(1e3*t);return Object(l["a"])(e,"yyyy-MM-dd hh:mm")}}},components:{editFrom:u["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(o["a"])(Object(o["a"])({},Object(s["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,r={title:e,num:a,url:"marketing/coupon/status/".concat(t.id),method:"PUT",ids:""};this.$modalSure(r).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(c["s"])(t.id)).then((function(){return e.getList()}))},couponDel:function(t,e,a){var n=this,r={title:e,num:a,url:"marketing/coupon/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(r).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(c["q"])(this.tableFrom).then(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(a){var n;return regeneratorRuntime.wrap((function(e){while(1)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(c["n"])(t).then(function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!1!==a.data.status){t.next=2;break}return t.abrupt("return",e.$authLapse(a.data));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(c["p"])(t.id)).then((function(){return e.getList()}))},userSearchs:function(){this.tableFrom.page=1,this.getList()},submitFail:function(){this.getList()}}},f=d,m=(a("38d6"),a("2877")),p=Object(m["a"])(f,n,r,!1,null,"91b2cca8",null);e["default"]=p.exports},"2c3e":function(t,e,a){var n=a("da84"),r=a("83ab"),i=a("9f7f").MISSED_STICKY,o=a("c6b6"),s=a("edd0"),c=a("69f3").get,u=RegExp.prototype,l=n.TypeError;r&&i&&s(u,"sticky",{configurable:!0,get:function(){if(this!==u){if("RegExp"===o(this))return!!c(this).sticky;throw l("Incompatible receiver, RegExp required")}}})},"31b4":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.FromData?a("div",[a("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?a("div",{staticClass:"radio acea-row row-middle"},[a("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),a("Radio-group",{on:{"on-change":t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[a("Radio",{attrs:{label:0}},[t._v("通用券")]),a("Radio",{attrs:{label:1}},[t._v("品类券")]),a("Radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],a("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()},r=[],i=a("f3f3"),o=a("9860"),s=a.n(o),c=a("6b6c"),u=a("2f62"),l={name:"edit",components:{formCreate:s.a.$form()},computed:Object(i["a"])({},Object(u["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,a={};a=t,Object(c["a"])({url:this.FromData.action,method:this.FromData.method,data:a}).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}}},d=l,f=(a("3c71"),a("2877")),m=Object(f["a"])(d,n,r,!1,null,"671a3e20",null);e["a"]=m.exports},"38d6":function(t,e,a){"use strict";var n=a("8f55"),r=a.n(n);r.a},"3c71":function(t,e,a){"use strict";var n=a("e23d"),r=a.n(n);r.a},"4d63":function(t,e,a){var n=a("83ab"),r=a("da84"),i=a("e330"),o=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"),w=a("107c"),F=_("match"),$=r.RegExp,D=$.prototype,E=r.SyntaxError,O=i(D.exec),R=i("".charAt),C=i("".replace),S=i("".indexOf),j=i("".slice),M=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,I=/a/g,T=/a/g,L=new $(I)!==I,W=p.MISSED_STICKY,A=p.UNSUPPORTED_Y,P=n&&(!L||W||k||w||b((function(){return T[F]=!1,$(I)!=I||$(T)==T||"/a/i"!=$(I,"i")}))),q=function(t){for(var e,a=t.length,n=0,r="",i=!1;n<=a;n++)e=R(t,n),"\\"!==e?i||"."!==e?("["===e?i=!0:"]"===e&&(i=!1),r+=e):r+="[\\s\\S]":r+=e+R(t,++n);return r},z=function(t){for(var e,a=t.length,n=0,r="",i=[],o={},s=!1,c=!1,u=0,l="";n<=a;n++){if(e=R(t,n),"\\"===e)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(o,l))throw new E("Invalid capture group name");o[l]=!0,i[i.length]=[l,u],c=!1,l="";continue}c?l+=e:r+=e}return[r,i]};if(o("RegExp",P)){for(var Y=function(t,e){var a,n,r,i,o,u,p=l(D,this),h=d(t),g=void 0===e,b=[],v=t;if(!p&&h&&g&&t.constructor===Y)return t;if((h||l(D,t))&&(t=t.source,g&&(e=m(v))),t=void 0===t?"":f(t),e=void 0===e?"":f(e),v=t,k&&"dotAll"in I&&(n=!!e&&S(e,"s")>-1,n&&(e=C(e,/s/g,""))),a=e,W&&"sticky"in I&&(r=!!e&&S(e,"y")>-1,r&&A&&(e=C(e,/y/g,""))),w&&(i=z(t),t=i[0],b=i[1]),o=s($(t,e),p?this:D,Y),(n||r||b.length)&&(u=y(o),n&&(u.dotAll=!0,u.raw=Y(q(t),a)),r&&(u.sticky=!0),b.length&&(u.groups=b)),t!==v)try{c(o,"source",""===v?"(?:)":v)}catch(x){}return o},B=u($),N=0;B.length>N;)h(Y,$,B[N++]);D.constructor=Y,Y.prototype=D,g(r,"RegExp",Y,{constructor:!0})}x("RegExp")},"61f7":function(t,e,a){"use strict";a.d(e,"a",(function(){return i})),a.d(e,"c",(function(){return u})),a.d(e,"b",(function(){return l}));var n=a("fc11"),r=a("f3f3");a("ac1f"),a("00b4"),a("5319"),a("4d63"),a("c607"),a("2c3e"),a("25f0"),a("498a"),a("d3b7"),a("b64b"),a("99af");function i(t,e){/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));var a={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(var n in a)if(new RegExp("(".concat(n,")")).test(e)){var r=a[n]+"";e=e.replace(RegExp.$1,1===RegExp.$1.length?r:o(r))}return e}function o(t){return("00"+t).substr(t.length)}var s={min:"%s最小长度为:min",max:"%s最大长度为:max",length:"%s长度必须为:length",range:"%s长度为:range",pattern:"$s格式错误"};var c=function(t,e){t.message=function(t){return e.replace("%s",t||"")}};function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(r["a"])({required:!0,message:t,type:"string"},e)}function l(t){return d.pattern(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,t)}c(u,"请输入%s"),c(l,"%s格式不正确");var d=Object.keys(s).reduce((function(t,e){return t[e]=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o="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"},o),i)},c(t[e],s[e]),t}),{})},"8f55":function(t,e,a){},c607:function(t,e,a){var n=a("da84"),r=a("83ab"),i=a("fce3"),o=a("c6b6"),s=a("edd0"),c=a("69f3").get,u=RegExp.prototype,l=n.TypeError;r&&i&&s(u,"dotAll",{configurable:!0,get:function(){if(this!==u){if("RegExp"===o(this))return!!c(this).dotAll;throw l("Incompatible receiver, RegExp required")}}})},e23d:function(t,e,a){},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)}}}]);
|