chunk-3be2478e.f44d7407.js 12 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-3be2478e"],{2096:function(t,e,n){},2838:function(t,e,n){"use strict";n.r(e);var r=n("a34a"),a=n.n(r),o=n("2f62"),i=n("b7be"),s=n("31b4"),c=n("61f7");function u(t,e,n,r,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,a)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){u(o,r,a,i,s,"next",t)}function s(t){u(o,r,a,i,s,"throw",t)}i(void 0)}))}}function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={name:"storeCoupon",filters:{formatDate:function(t){if(0!==t){var e=new Date(1e3*t);return Object(c.a)(e,"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:"面值",slot:"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:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(n,!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(o.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:90},labelPosition:function(){return this.isMobile?"top":"left"}}),methods:{couponInvalid:function(t,e,n){var r=this,a={title:e,num:n,url:"marketing/coupon/status/".concat(t.id),method:"PUT",ids:""};this.$modalSure(a).then((function(t){r.$Message.success(t.msg),r.getList()})).catch((function(t){r.$Message.error(t.msg)}))},couponSend:function(t){var e=this;this.$modalForm(Object(i.z)(t.id)).then((function(){return e.getList()}))},couponDel:function(t,e,n){var r=this,a={title:e,num:n,url:"marketing/coupon/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(a).then((function(t){r.$Message.success(t.msg),r.tableList.splice(n,1)})).catch((function(t){r.$Message.error(t.msg)}))},getList:function(){var t=this;this.loading=!0,this.tableFrom.status=this.tableFrom.status||"",Object(i.x)(this.tableFrom).then(function(){var e=l(a.a.mark((function e(n){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=n.data,t.tableList=r.list,t.total=n.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.u)(t).then(function(){var t=l(a.a.mark((function t(n){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==n.data.status){t.next=2;break}return t.abrupt("return",e.$authLapse(n.data));case 2:e.FromData=n.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.w)(t.id)).then((function(){return e.getList()}))},userSearchs:function(){this.tableFrom.page=1,this.getList()},submitFail:function(){this.getList()}}},m=(n("6b9e"),n("2877")),b=Object(m.a)(f,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"i-layout-page-header"},[n("PageHeader",{staticClass:"product_tabs",attrs:{title:"优惠卷模板","hidden-breadcrumb":""}})],1),n("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[n("Form",{ref:"tableFrom",attrs:{model:t.tableFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[n("Row",{attrs:{type:"flex",gutter:24}},[n("Col",t._b({},"Col",t.grid,!1),[n("FormItem",{attrs:{label:"是否有效:","label-for":"status"}},[n("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"}},[n("Option",{attrs:{value:"1"}},[t._v("有效")]),n("Option",{attrs:{value:"0"}},[t._v("无效")])],1)],1)],1),n("Col",t._b({},"Col",t.grid,!1),[n("FormItem",{attrs:{label:"优惠券名称:","label-for":"title"}},[n("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),n("Row",{attrs:{type:"flex"}},[n("Col",t._b({},"Col",t.grid,!1),[n("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),n("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:"coupon_price",fn:function(e){var r=e.row;return[1==r.coupon_type?n("span",[t._v(t._s(r.coupon_price)+"元")]):t._e(),2==r.coupon_type?n("span",[t._v(t._s(parseFloat(r.coupon_price)/10)+"折("+t._s(r.coupon_price.toString().split(".")[0])+"%)")]):t._e()]}},{key:"status",fn:function(t){var e=t.row;return t.index,[1===e.status?n("Icon",{attrs:{type:"md-checkmark",color:"#0092DC",size:"14"}}):n("Icon",{attrs:{type:"md-close",color:"#ed5565",size:"14"}})]}},{key:"add_time",fn:function(e){var r=e.row;return e.index,[n("span",[t._v(" "+t._s(t._f("formatDate")(r.add_time)))])]}},{key:"action",fn:function(e){var r=e.row,a=e.index;return[r.status?n("a",{on:{click:function(e){return t.couponInvalid(r,"修改优惠券",a)}}},[t._v("立即失效")]):t._e(),r.status?n("Divider",{attrs:{type:"vertical"}}):t._e(),r.status?n("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(r)}}},[t._v("发布")]):t._e(),r.status?n("Divider",{attrs:{type:"vertical"}}):t._e(),n("a",{on:{click:function(e){return t.couponDel(r,"删除优惠券",a)}}},[t._v("删除")])]}}])}),n("div",{staticClass:"acea-row row-right page"},[n("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),n("edit-from",{ref:"edits",attrs:{FromData:t.FromData},on:{changeType:t.changeType}})],1)}),[],!1,null,"54cc3c59",null);e.default=b.exports},"31b4":function(t,e,n){"use strict";var r=n("9860"),a=n.n(r),o=n("b6bd"),i=n("2f62");function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={name:"edit",components:{formCreate:a.a.$form()},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(i.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,n=this;(setTimeout((function(){n.isDisable=!1}),1e3),this.isDisable)||(this.isDisable=!0,e=t,Object(o.a)({url:this.FromData.action,method:this.FromData.method,data:e}).then((function(t){n.$parent.getList(),n.$Message.success(t.msg),n.modals=!1,setTimeout((function(){n.$emit("submitFail")}),1e3)})).catch((function(t){n.$Message.error(t.msg)})))},cancel:function(){this.type=0}}},l=(n("cf4e"),n("2877")),d=Object(l.a)(u,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.FromData?n("div",[n("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?n("div",{staticClass:"radio acea-row row-middle"},[n("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),n("Radio-group",{on:{"on-change":t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[n("Radio",{attrs:{label:0}},[t._v("通用券")]),n("Radio",{attrs:{label:1}},[t._v("品类券")]),n("Radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],n("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,"9db30b62",null);e.a=d.exports},"61f7":function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(var r in n)if(new RegExp("(".concat(r,")")).test(e)){var a=n[r]+"";e=e.replace(RegExp.$1,1===RegExp.$1.length?a:s(a))}return e}function s(t){return("00"+t).substr(t.length)}n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return d}));var c={min:"%s最小长度为:min",max:"%s最大长度为:max",length:"%s长度必须为:length",range:"%s长度为:range",pattern:"$s格式错误"},u=function(t,e){t.message=function(t){return e.replace("%s",t||"")}};function l(t){return a({required:!0,message:t,type:"string"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function d(t){return p.pattern(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,t)}u(l,"请输入%s"),u(d,"%s格式不正确");var p=Object.keys(c).reduce((function(t,e){return t[e]=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="range"===e?{min:t[0],max:t[1]}:o({},e,t);return a({message:n.replace(":".concat(e),"range"===e?"".concat(t[0],"-").concat(t[1]):t),type:"string"},i,{},r)},u(t[e],c[e]),t}),{})},"6b9e":function(t,e,n){"use strict";var r=n("2096");n.n(r).a},cf4e:function(t,e,n){"use strict";var r=n("f047");n.n(r).a},f047:function(t,e,n){}}]);