1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0b2725"],{"23c1":function(t,e,i){"use strict";i.r(e);var n=i("2f62"),s=i("b7be"),o=i("d708");function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,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:"threshold_type",minWidth:100},{title:"活动详情",key:"desc",minWidth:200},{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:"",threshold_type:""},list:[],total:0}},computed:function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(i,!0).forEach((function(e){a(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},Object(n.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,i){var n=this,s={title:e,num:i,url:"marketing/promotions/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(s).then((function(t){n.$Message.success(t.msg),n.list.splice(i,1),n.list.length||(n.discountFrom.page=1==n.discountFrom.page?1:n.discountFrom.page-1),n.getList()})).catch((function(t){n.$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)}))},orderSearch:function(){this.discountFrom.page=1,this.getList()},add:function(){this.$router.push({path:this.roterPre+"/marketing/discount/add_give/0"})},discountSearchs:function(){this.discountFrom.page=1,this.list=[],this.getList()},getList:function(){var t=this;this.loading=!0,Object(s.C)(4,this.discountFrom).then((function(e){var i=e.data;t.list=i.list,t.total=i.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_give/"+t})}}},l=i("2877"),u=Object(l.a)(c,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("Card",{staticClass:"mt15 ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[i("div",{staticClass:"new_card_pd"},[i("Form",{ref:"discountFrom",attrs:{inline:"",model:t.discountFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[i("FormItem",{attrs:{label:"是否有效:"}},[i("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"}},[i("Option",{attrs:{value:"1"}},[t._v("是")]),i("Option",{attrs:{value:"0"}},[t._v("否")])],1)],1),i("FormItem",{attrs:{label:"条件类型:"}},[i("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.discountSearchs},model:{value:t.discountFrom.threshold_type,callback:function(e){t.$set(t.discountFrom,"threshold_type",e)},expression:"discountFrom.threshold_type"}},[i("Option",{attrs:{value:"1"}},[t._v("满N元")]),i("Option",{attrs:{value:"2"}},[t._v("满N件")])],1)],1),i("FormItem",{attrs:{label:"活动名称:"}},[i("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"}}),i("Button",{attrs:{type:"primary"},on:{click:function(e){return t.discountSearchs()}}},[t._v("查询")])],1)],1)],1)]),i("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[i("Button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("添加满送活动")]),i("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,[i("viewer",[i("div",{staticClass:"tabBox_img"},[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.icon,expression:"row.icon"}]})])])]}},{key:"threshold_type",fn:function(e){var n=e.row;return e.index,[1==n.threshold_type?i("div",[t._v("满N元")]):t._e(),2==n.threshold_type?i("div",[t._v("满N件")]):t._e()]}},{key:"status",fn:function(e){var n=e.row;return e.index,[i("i-switch",{attrs:{"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"}},[i("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),i("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(e){var n=e.row,s=e.index;return[i("a",{on:{click:function(e){return t.edit(n.id)}}},[t._v("编辑")]),i("Divider",{attrs:{type:"vertical"}}),i("a",{on:{click:function(e){return t.del(n,"删除满送活动",s)}}},[t._v("删除")])]}}])}),i("div",{staticClass:"acea-row row-right page"},[i("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"","page-size":t.discountFrom.limit},on:{"on-change":t.pageChange}})],1)],1)],1)}),[],!1,null,"092f91d1",null);e.default=u.exports}}]);
|