chunk-2d0e13be.9bc70e81.js 6.1 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0e13be"],{"7a20":function(t,e,n){"use strict";n.r(e);var i=n("2f62"),s=n("b7be"),o=n("d708");function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c={name:"piecesDiscount",data:function(){return{roterPre:o.a.roterPre,grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{title:"ID",key:"id",width:80},{title:"活动名称",key:"name",minWidth:100},{title:"参与商品数",key:"product_count",minWidth:100},{title:"活动类型",slot:"n_piece_n_discount",minWidth:100},{title:"支付订单",key:"sum_order",minWidth:100},{title:"参与客户",key:"sum_user",minWidth:100},{title:"实付金额",key:"sum_pay_price",minWidth:100},{title:"是否开启",slot:"status",width:120},{title:"操作",slot:"action",fixed:"right",minWidth:120}],discountFrom:{page:1,limit:15,name:"",status:"",n_piece_n_discount:""},list:[],total:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach((function(e){a(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}({},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:{del:function(t,e,n){var i=this,s={title:e,num:n,url:"marketing/promotions/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(s).then((function(t){i.$Message.success(t.msg),i.list.splice(n,1),i.list.length||(i.discountFrom.page=1==i.discountFrom.page?1:i.discountFrom.page-1),i.getList()})).catch((function(t){i.$Message.error(t.msg)}))},onchangeIsShow:function(t){var e=this;Object(s.D)(t.id,t.status).then((function(t){e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(t.msg)}))},add:function(){this.$router.push({path:this.roterPre+"/marketing/discount/add_pieces/0"})},discountSearchs:function(){this.discountFrom.page=1,this.list=[],this.getList()},getList:function(){var t=this;this.loading=!0,Object(s.C)(2,this.discountFrom).then((function(e){var n=e.data;t.list=n.list,t.total=n.count,t.loading=!1})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.discountFrom.page=t,this.getList()},edit:function(t){this.$router.push({path:this.roterPre+"/marketing/discount/add_pieces/"+t})}}},u=n("2877"),l=Object(u.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[n("div",{staticClass:"new_card_pd"},[n("Form",{ref:"discountFrom",attrs:{inline:"",model:t.discountFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[n("FormItem",{attrs:{label:"是否有效:"}},[n("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.discountSearchs},model:{value:t.discountFrom.status,callback:function(e){t.$set(t.discountFrom,"status",e)},expression:"discountFrom.status"}},[n("Option",{attrs:{value:"1"}},[t._v("是")]),n("Option",{attrs:{value:"0"}},[t._v("否")])],1)],1),n("FormItem",{attrs:{label:"活动类型:"}},[n("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.discountSearchs},model:{value:t.discountFrom.n_piece_n_discount,callback:function(e){t.$set(t.discountFrom,"n_piece_n_discount",e)},expression:"discountFrom.n_piece_n_discount"}},[n("Option",{attrs:{value:"1"}},[t._v("第2件半价")]),n("Option",{attrs:{value:"2"}},[t._v("买1送1")]),n("Option",{attrs:{value:"3"}},[t._v("自定义优惠")])],1)],1),n("FormItem",{attrs:{label:"活动名称:"}},[n("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入活动名称"},on:{"on-search":t.discountSearchs},model:{value:t.discountFrom.name,callback:function(e){t.$set(t.discountFrom,"name",e)},expression:"discountFrom.name"}}),n("Button",{attrs:{type:"primary"},on:{click:function(e){return t.discountSearchs()}}},[t._v("查询")])],1)],1)],1)]),n("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[n("Button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("添加第N件N折")]),n("Table",{ref:"table",staticClass:"ivu-mt",attrs:{columns:t.columns1,data:t.list,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"icons",fn:function(t){var e=t.row;return t.index,[n("viewer",[n("div",{staticClass:"tabBox_img"},[n("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.icon,expression:"row.icon"}]})])])]}},{key:"n_piece_n_discount",fn:function(e){var i=e.row;return e.index,[1==i.n_piece_n_discount?n("div",[t._v("第2件半价")]):t._e(),2==i.n_piece_n_discount?n("div",[t._v("买1送1")]):t._e(),3==i.n_piece_n_discount?n("div",[t._v("自定义优惠")]):t._e()]}},{key:"status",fn:function(e){var i=e.row;return e.index,[n("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(i)}},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}},[n("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),n("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(e){var i=e.row,s=e.index;return[n("a",{on:{click:function(e){return t.edit(i.id)}}},[t._v("编辑")]),n("Divider",{attrs:{type:"vertical"}}),n("a",{on:{click:function(e){return t.del(i,"删除第N件N折活动",s)}}},[t._v("删除")])]}}])}),n("div",{staticClass:"acea-row row-right page"},[n("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.discountFrom.limit},on:{"on-change":t.pageChange}})],1)],1)],1)}),[],!1,null,"39c8a425",null);e.default=l.exports}}]);