chunk-50586bd2.769ede03.js 10 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-50586bd2"],{"0cd7":function(t,e,r){},"0d42":function(t,e,r){"use strict";r.d(e,"d",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return o}));var n=r("b6bd");function a(t){return Object(n.a)({url:"marketing/discounts/save",method:"post",data:t})}function i(t){return Object(n.a)({url:"marketing/discounts/list",method:"get",params:t})}function s(t){return Object(n.a)({url:"marketing/discounts/set_status/".concat(t.id,"/").concat(t.status),method:"get",params:t})}function o(t){return Object(n.a)({url:"marketing/discounts/info/"+t,method:"get"})}},"179a":function(t,e,r){"use strict";var n=r("0cd7");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){i(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 i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(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:o(a))}return e}function o(t){return("00"+t).substr(t.length)}r.d(e,"a",(function(){return s})),r.d(e,"c",(function(){return l})),r.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 m.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 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]:{},s="range"===e?{min:t[0],max:t[1]}:i({},e,t);return a({message:r.replace(":".concat(e),"range"===e?"".concat(t[0],"-").concat(t[1]):t),type:"string"},s,{},n)},u(t[e],c[e]),t}),{})},dbb4:function(t,e,r){"use strict";r.r(e);var n=r("a34a"),a=r.n(n),i=r("2f62"),s=r("0d42"),o=r("61f7"),c=r("d708");function u(t,e,r,n,a,i,s){try{var o=t[i](s),c=o.value}catch(t){return void r(t)}o.done?e(c):Promise.resolve(c).then(n,a)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function s(t){u(i,n,a,s,o,"next",t)}function o(t){u(i,n,a,s,o,"throw",t)}s(void 0)}))}}function d(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 f={name:"storeBargain",filters:{formatDate:function(t){if(0!==t){var e=new Date(1e3*t);return Object(o.a)(e,"yyyy-MM-dd hh:mm")}}},data:function(){return{roterPre:c.a.roterPre,loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"套餐名称",key:"title",minWidth:90},{title:"套餐类型",slot:"type",minWidth:90},{title:"上架状态",slot:"status",minWidth:100},{title:"限时",slot:"time",minWidth:100},{title:"创建时间",key:"add_time",minWidth:110},{title:"剩余数量",slot:"limit_num",minWidth:80},{title:"操作",slot:"action",fixed:"right",minWidth:130}],tableList:[],tableFrom:{status:"",title:"",page:1,type:"",limit:15},total:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(r,!0).forEach((function(e){m(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(i.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getList()},methods:{add:function(){this.$router.push({path:this.roterPre+"/marketing/store_discounts/create"})},edit:function(t){this.$router.push({name:"marketing_store_discounts_create",query:{id:t.id}})},copy:function(t){this.$router.push({name:"marketing_store_discounts_create",query:{id:t.id,copy:1}})},del:function(t,e,r){var n=this,a={title:e,num:r,url:"marketing/discounts/del/".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.type=this.tableFrom.type,this.tableFrom.status=this.tableFrom.status,Object(s.c)(this.tableFrom).then(function(){var e=l(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()},onchangeIsShow:function(t){var e=this,r={id:t.id,status:t.status};Object(s.a)(r).then(function(){var t=l(a.a.mark((function t(r){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg),e.getList();case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg),e.getList()}))}}},p=(r("179a"),r("2877")),g=Object(p.a)(f,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("Card",{staticClass:"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:"套餐类型:",clearable:""}},[r("Select",{staticClass:"input-add",attrs:{placeholder:"请选择套餐类型",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.tableFrom.type,callback:function(e){t.$set(t.tableFrom,"type",e)},expression:"tableFrom.type"}},[r("Option",{attrs:{value:"0"}},[t._v("固定套餐")]),r("Option",{attrs:{value:"1"}},[t._v("搭配套餐")])],1)],1),r("FormItem",{attrs:{label:"套餐状态:"}},[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:"''"}},[t._v("全部")]),r("Option",{attrs:{value:"1"}},[t._v("上架")]),r("Option",{attrs:{value:"0"}},[t._v("下架")])],1)],1),r("FormItem",{attrs:{label:"套餐搜索:","label-for":"title"}},[r("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入套餐名称"},on:{"on-search":t.userSearchs},model:{value:t.tableFrom.title,callback:function(e){t.$set(t.tableFrom,"title",e)},expression:"tableFrom.title"}}),r("Button",{attrs:{type:"primary"},on:{click:function(e){return t.userSearchs()}}},[t._v("查询")])],1)],1)],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Button",{directives:[{name:"auth",rawName:"v-auth",value:["marketing-store_bargain-create"],expression:"['marketing-store_bargain-create']"}],staticClass:"mr10",attrs:{type:"primary"},on:{click:t.add}},[t._v("添加套餐")]),r("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:"is_fail",fn:function(t){var e=t.row;return t.index,[1===e.is_fail?r("Icon",{attrs:{type:"md-checkmark",color:"#0092DC",size:"14"}}):r("Icon",{attrs:{type:"md-close",color:"#ed5565",size:"14"}})]}},{key:"image",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.image,expression:"row.image"}]})])])]}},{key:"type",fn:function(e){var r=e.row;return e.index,[t._v("\r\n "+t._s(0==r.type?"固定套餐":"搭配套餐")+"\r\n ")]}},{key:"time",fn:function(e){var n=e.row;return e.index,[0==n.start_time?r("div",[t._v("不限时")]):r("div",[r("div",[t._v("起:"+t._s(n.start_time||"--"))]),r("div",[t._v("止:"+t._s(n.stop_time||"--"))])])]}},{key:"status",fn:function(e){var n=e.row;return e.index,[r("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(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:"limit_num",fn:function(e){var r=e.row;return e.index,[t._v("\r\n "+t._s(r.is_limit?r.limit_num:"不限量")+"\r\n ")]}},{key:"action",fn:function(e){var n=e.row,a=e.index;return[r("a",{on:{click:function(e){return t.edit(n)}}},[t._v("编辑")]),r("Divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(e){return t.del(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)],1)}),[],!1,null,"43b2d912",null);e.default=g.exports}}]);