chunk-db6480e8.957d0c80.js 13 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-db6480e8"],{"507e":function(t,e,r){"use strict";var n=r("fd02");r.n(n).a},"61f7":function(t,e,r){"use strict";function n(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 a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(r,!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));var r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds()};for(var n in r)if(new RegExp("(".concat(n,")")).test(e)){var a=r[n]+"";e=e.replace(RegExp.$1,1===RegExp.$1.length?a:s(a))}return e}function s(t){return("00"+t).substr(t.length)}r.d(e,"a",(function(){return i})),r.d(e,"c",(function(){return u})),r.d(e,"b",(function(){return p}));var c={min:"%s最小长度为:min",max:"%s最大长度为:max",length:"%s长度必须为:length",range:"%s长度为:range",pattern:"$s格式错误"},l=function(t,e){t.message=function(t){return e.replace("%s",t||"")}};function u(t){return a({required:!0,message:t,type:"string"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function p(t){return m.pattern(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,t)}l(u,"请输入%s"),l(p,"%s格式不正确");var m=Object.keys(c).reduce((function(t,e){return t[e]=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i="range"===e?{min:t[0],max:t[1]}:o({},e,t);return a({message:r.replace(":".concat(e),"range"===e?"".concat(t[0],"-").concat(t[1]):t),type:"string"},i,{},n)},l(t[e],c[e]),t}),{})},fd02:function(t,e,r){},fd8e:function(t,e,r){"use strict";r.r(e);var n=r("a34a"),a=r.n(n),o=r("2f62"),i=r("b7be"),s=r("61f7"),c=r("d708");function l(t,e,r,n,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,a)}function u(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){l(o,n,a,i,s,"next",t)}function s(t){l(o,n,a,i,s,"throw",t)}i(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 m(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d={name:"storeCouponIssue",filters:{formatDate:function(t){if(0!==t){var e=new Date(1e3*t);return Object(s.a)(e,"yyyy-MM-dd hh:mm")}}},data:function(){return{roterPre:c.a.roterPre,modals2:!1,grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"优惠券名称",slot:"coupon_title",minWidth:150},{title:"优惠券类型",slot:"coupon_type",minWidth:80},{title:"适用类型",slot:"type",minWidth:80},{title:"面值",slot:"coupon_price",minWidth:100},{title:"领取方式",slot:"receive_type",minWidth:100},{title:"领取时间",slot:"start_time",minWidth:250},{title:"使用时间",slot:"start_use_time",minWidth:250},{title:"发布数量",slot:"count",minWidth:90},{title:"是否开启",slot:"status",minWidth:90},{title:"操作",slot:"action",fixed:"right",minWidth:200}],tableFrom:{status:"",coupon_title:"",receive_type:"",coupon_type:"",page:1,limit:15},receive_type:"",tableList:[],total:0,FromData:null,receiveList:[],loading2:!1,columns2:[{title:"ID",key:"uid",minWidth:80},{title:"用户名",key:"nickname",minWidth:150},{title:"用户头像",slot:"avatar",minWidth:100},{title:"领取时间",key:"add_time",minWidth:140}],total2:0,receiveFrom:{page:1,limit:15},rows:{}}},created:function(){this.getList()},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(r,!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(o.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),methods:{couponInvalid:function(t,e,r){this.delfromData={title:e,num:r,url:"marketing/coupon/status/".concat(t.id),method:"PUT",ids:""},this.$refs.modelSure.modals=!0},receive:function(t){this.modals2=!0,this.rows=t,this.getReceivelist(t)},getReceivelist:function(t){var e=this;this.loading2=!0,Object(i.ob)(t.id,this.receiveFrom).then(function(){var t=u(a.a.mark((function t(r){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.data,e.receiveList=n.list,e.total2=r.data.count,e.loading2=!1;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading2=!1,e.$Message.error(t.msg)}))},receivePageChange:function(t){this.receiveFrom.page=t,this.getReceivelist(this.rows)},couponDel:function(t,e,r){var n=this,a={title:e,num:r,url:"marketing/coupon/released/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(a).then((function(t){n.$Message.success(t.msg),n.tableList.splice(r,1),n.tableList.length||(n.tableFrom.page=1==n.tableFrom.page?1:n.tableFrom.page-1),n.getList()})).catch((function(t){n.$Message.error(t.msg)}))},getList:function(){var t=this;this.loading=!0,this.tableFrom.receive_type="all"===this.receive_type?"":this.receive_type,this.tableFrom.status=this.tableFrom.status||"",Object(i.nb)(this.tableFrom).then(function(){var e=u(a.a.mark((function e(r){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.data,t.tableList=n.list,t.total=r.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()},userSearchs:function(){this.tableFrom.page=1,this.getList()},orderSearch:function(){this.tableFrom.page=1,this.getList()},add:function(){this.$router.push({path:this.roterPre+"/marketing/store_coupon_issue/create"})},copy:function(t){this.$router.push({path:"".concat(this.roterPre,"/marketing/store_coupon_issue/create/").concat(t.id)})},openChange:function(t){var e=this;Object(i.A)(t).then((function(){return e.getList()}))}}},v=(r("507e"),r("2877")),f=Object(v.a)(d,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"mt15 ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[r("div",{staticClass:"new_card_pd"},[r("Form",{ref:"tableFrom",attrs:{inline:"",model:t.tableFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[r("FormItem",{attrs:{label:"优惠券类型:","label-for":"status"}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.tableFrom.coupon_type,callback:function(e){t.$set(t.tableFrom,"coupon_type",e)},expression:"tableFrom.coupon_type"}},[r("Option",{attrs:{value:"1"}},[t._v("满减券")]),r("Option",{attrs:{value:"2"}},[t._v("折扣券")])],1)],1),r("FormItem",{attrs:{label:"领取方式:","label-for":"status"}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.receive_type,callback:function(e){t.receive_type=e},expression:"receive_type"}},[r("Option",{attrs:{value:"1"}},[t._v("手动领取")]),r("Option",{attrs:{value:"3"}},[t._v("后台发放")])],1)],1),r("FormItem",{attrs:{label:"是否有效:","label-for":"status"}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[r("Option",{attrs:{value:"1"}},[t._v("正常")]),r("Option",{attrs:{value:"0"}},[t._v("未开启")])],1)],1),r("FormItem",{attrs:{label:"优惠券名称:","label-for":"coupon_title"}},[r("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入优惠券名称"},on:{"on-search":t.userSearchs},model:{value:t.tableFrom.coupon_title,callback:function(e){t.$set(t.tableFrom,"coupon_title",e)},expression:"tableFrom.coupon_title"}}),r("Button",{staticClass:"mr14",attrs:{type:"primary"},on:{click:function(e){return t.orderSearch()}}},[t._v("查询")])],1)],1)],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Button",{directives:[{name:"auth",rawName:"v-auth",value:["admin-marketing-store_coupon-add"],expression:"['admin-marketing-store_coupon-add']"}],attrs:{type:"primary"},on:{click:t.add}},[t._v("添加优惠券")]),r("Table",{ref:"table",staticClass:"ivu-mt",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 n=e.row;return[1==n.coupon_type?r("span",[t._v(t._s(n.coupon_price)+"元")]):t._e(),2==n.coupon_type?r("span",[t._v(t._s(parseFloat(n.coupon_price)/10)+"折("+t._s(n.coupon_price.toString().split(".")[0])+"%)")]):t._e()]}},{key:"count",fn:function(e){var n=e.row;return[n.is_permanent?r("span",[t._v("不限量")]):r("div",[r("span",{staticClass:"fa"},[t._v("发布:"+t._s(n.total_count))]),r("span",{staticClass:"sheng"},[t._v("剩余:"+t._s(n.remain_count))])])]}},{key:"coupon_type",fn:function(e){return[1===e.row.coupon_type?r("span",[t._v("满减券")]):r("span",[t._v("折扣券")])]}},{key:"type",fn:function(e){var n=e.row;return[1===n.type?r("span",[t._v("品类券")]):2===n.type?r("span",[t._v("商品券")]):3===n.type?r("span",[t._v("品牌券")]):r("span",[t._v("通用券")])]}},{key:"coupon_title",fn:function(e){var n=e.row;return[r("Tooltip",{attrs:{"max-width":"200",placement:"bottom"}},[r("span",{staticClass:"line2"},[t._v(t._s(n.coupon_title))]),r("p",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(n.coupon_title))])])]}},{key:"receive_type",fn:function(e){var n=e.row;return[1===n.receive_type?r("span",[t._v("手动领取")]):3===n.receive_type?r("span",[t._v("后台发放")]):t._e()]}},{key:"start_time",fn:function(e){var n=e.row;return[n.start_time?r("div",[t._v("\r\n "+t._s(t._f("formatDate")(n.start_time))+" - "+t._s(t._f("formatDate")(n.end_time))+"\r\n ")]):r("span",[t._v("不限时")])]}},{key:"start_use_time",fn:function(e){var n=e.row;return[n.start_use_time?r("div",[t._v("\r\n "+t._s(t._f("formatDate")(n.start_use_time))+" - "+t._s(t._f("formatDate")(n.end_use_time))+"\r\n ")]):r("div",[t._v("\r\n "+t._s(n.coupon_time)+"天\r\n ")])]}},{key:"status",fn:function(e){var n=e.row;return[r("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.openChange(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("a",{on:{click:function(e){return t.receive(n)}}},[t._v("领取记录")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.copy(n)}}},[t._v("复制")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.couponDel(n,"删除发布的优惠券",a)}}},[t._v("删除")])]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("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),r("Modal",{attrs:{scrollable:"","footer-hide":"",closable:"",title:"领取记录","mask-closable":!1,width:"700"},model:{value:t.modals2,callback:function(e){t.modals2=e},expression:"modals2"}},[r("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns2,data:t.receiveList,loading:t.loading2,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"avatar",fn:function(t){var e=t.row;return t.index,[r("viewer",[r("div",{staticClass:"tabBox_img"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.avatar,expression:"row.avatar"}]})])])]}}])}),r("div",{staticClass:"acea-row row-right page"},[r("Page",{attrs:{total:t.total2,"show-elevator":"","show-total":"","page-size":t.receiveFrom.limit},on:{"on-change":t.receivePageChange}})],1)],1)],1)}),[],!1,null,"75ae7f35",null);e.default=f.exports}}]);