zx/public/mer/js/chunk-31b3611d.c1b8a2fd.js

1 line
17 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-31b3611d"],{"777e":function(t,e,a){"use strict";a("83ec")},"83ec":function(t,e,a){},b055:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"divBox"},[i("div",{staticClass:"selCard"},[i("el-form",{ref:"searchForm",attrs:{model:t.tableFrom,size:"small","label-width":"95px",inline:!0}},[i("el-form-item",{attrs:{label:"优惠券状态:",prop:"status"}},[i("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[i("el-option",{attrs:{label:"未开启",value:0}}),t._v(" "),i("el-option",{attrs:{label:"开启",value:1}})],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"优惠券类型:",prop:"type"}},[i("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.type,callback:function(e){t.$set(t.tableFrom,"type",e)},expression:"tableFrom.type"}},[i("el-option",{attrs:{label:"全部",value:""}}),t._v(" "),i("el-option",{attrs:{label:"店铺券",value:0}}),t._v(" "),i("el-option",{attrs:{label:"商品券",value:1}})],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"获取方式:",prop:"send_type"}},[i("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.send_type,callback:function(e){t.$set(t.tableFrom,"send_type",e)},expression:"tableFrom.send_type"}},[i("el-option",{attrs:{label:"全部",value:""}}),t._v(" "),i("el-option",{attrs:{label:"手动获取",value:0}}),t._v(" "),i("el-option",{attrs:{label:"新人",value:2}}),t._v(" "),i("el-option",{attrs:{label:"买赠",value:3}})],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"优惠券名称:",prop:"coupon_name"}},[i("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入优惠券名称",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.tableFrom.coupon_name,callback:function(e){t.$set(t.tableFrom,"coupon_name",e)},expression:"tableFrom.coupon_name"}})],1),t._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.getList(1)}}},[t._v("搜索")]),t._v(" "),i("el-button",{attrs:{size:"small"},on:{click:function(e){return t.searchReset()}}},[t._v("重置")])],1)],1)],1),t._v(" "),i("el-card",{staticClass:"mt14"},[i("div",{staticClass:"mb20"},[i("router-link",{attrs:{to:{path:t.roterPre+"/marketing/coupon/creatCoupon"}}},[i("el-button",{attrs:{size:"small",type:"primary"}},[t._v("添加优惠劵")])],1)],1),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small","highlight-current-row":""}},[i("el-table-column",{attrs:{prop:"coupon_id",label:"ID","min-width":"50"}}),t._v(" "),i("el-table-column",{attrs:{prop:"title",label:"优惠劵名称","min-width":"120"}}),t._v(" "),i("el-table-column",{attrs:{label:"优惠劵类型","min-width":"90"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("span",[t._v(t._s(t._f("couponTypeFilter")(a.type)))])]}}])}),t._v(" "),i("el-table-column",{attrs:{"min-width":"150",label:"领取日期"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.start_time?i("div",[t._v("\n "+t._s(a.start_time)+" "),i("br"),t._v("- "+t._s(a.end_time)+"\n ")]):i("span",[t._v("不限时")])]}}])}),t._v(" "),i("el-table-column",{attrs:{"min-width":"150",label:"使用时间"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.use_start_time&&a.use_end_time?i("div",[t._v("\n "+t._s(a.use_start_time)+" "),i("br"),t._v("- "+t._s(a.use_end_time)+"\n ")]):i("span",[t._v(t._s(a.coupon_time)+"天")])]}}])}),t._v(" "),i("el-table-column",{attrs:{"min-width":"120",label:"发布数量"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[0===a.is_limited?i("span",[t._v("不限量")]):i("div",[i("span",{staticClass:"fa"},[t._v("发布:"+t._s(a.total_count))]),t._v(" "),i("span",{staticClass:"sheng"},[t._v("剩余:"+t._s(a.remain_count))])])]}}])}),t._v(" "),i("el-table-column",{attrs:{"min-width":"120",label:"使用数量"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("div",[i("span",[t._v("已领取/发放总数:"+t._s(a.send_num))]),t._v(" "),i("span",{staticClass:"sheng"},[t._v("已使用总数:"+t._s(a.used_num))])])]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"状态","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"显示","inactive-text":"隐藏",width:55},nativeOn:{click:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),t._v(" "),i("el-table-column",{attrs:{label:"操作","min-width":"150",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.details(e.row.coupon_id)}}},[t._v("详情")]),t._v(" "),i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.receive(e.row.coupon_id)}}},[t._v("领取/发放记录")]),t._v(" "),i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.onEdit(e.row.coupon_id)}}},[t._v("编辑")]),t._v(" "),i("router-link",{attrs:{to:{path:t.roterPre+"/marketing/coupon/creatCoupon/"+e.row.coupon_id}}},[i("el-button",{staticClass:"ml14 mr14",attrs:{type:"text",size:"small"}},[t._v("复制")])],1),t._v(" "),i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row.coupon_id,e.$index)}}},[t._v("删除")])]}}])})],1),t._v(" "),i("div",{staticClass:"block"},[i("el-pagination",{attrs:{background:"","page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)],1),t._v(" "),t.detailDialog?i("el-drawer",{attrs:{title:"优惠券详情",visible:t.detailDialog,size:"800px"},on:{"update:visible":function(e){t.detailDialog=e}}},[i("div",[i("el-tabs",{attrs:{type:"border-card"},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[i("el-tab-pane",{attrs:{label:"基本信息",name:"basic"}},[i("div",{staticClass:"section"},[i("div",{staticClass:"title"},[t._v("优惠券信息")]),t._v(" "),i("ul",{staticClass:"list"},[i("li",{staticClass:"item"},[i("div",[t._v("优惠券名称:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(t.couponDetail.title))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("优惠券类型:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(t._f("couponTypeFilter")(t.couponDetail.type)))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("优惠券面值:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(t.couponDetail.coupon_price))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("使用门槛:")]),t._v(" "),i("div",{staticClass:"value"},[t._v("\n "+t._s("0.00"==t.couponDetail.use_min_price?"无门槛":"最低消费"+t.couponDetail.use_min_price)+"\n ")])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("使用有效期:")]),t._v(" "),t.couponDetail.coupon_time&&0==t.couponDetail.coupon_type?i("div",{staticClass:"value"},[t._v(t._s(t.couponDetail.coupon_time)+"天")]):1==t.couponDetail.coupon_type?i("div",{staticClass:"value"},[t._v("\n "+t._s(t.couponDetail.use_start_time+" - "+t.couponDetail.use_end_time)+"\n ")]):t._e()]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("领取时间:")]),t._v(" "),1==t.couponDetail.is_timeout?i("div",{staticClass:"value"},[t._v("\n "+t._s(t.couponDetail.start_time)+" - "+t._s(t.couponDetail.end_time)+"\n ")]):i("div",{staticClass:"value"},[t._v("不限时")])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("获取方式:")]),t._v(" "),0==t.couponDetail.send_type?i("div",{staticClass:"value"},[t._v("手动领取")]):1==t.couponDetail.send_type?i("div",{staticClass:"value"},[t._v("消费满赠券")]):2==t.couponDetail.send_type?i("div",{staticClass:"value"},[t._v("新人券")]):3==t.couponDetail.send_type?i("div",{staticClass:"value"},[t._v("买赠券")]):4==t.couponDetail.send_type?i("div",{staticClass:"value"},[t._v("首单赠送券")]):5==t.couponDetail.send_type?i("div",{staticClass:"value"},[t._v("会员赠送券")]):t._e()]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("是否限量:")]),t._v(" "),i("div",{staticClass:"value theme"},[t._v(t._s(t._f("filterClose")(t.couponDetail.is_limited)))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("已发布总数:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(0==t.couponDetail.is_limited?"不限量":t.couponDetail.total_count))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("剩余总数:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(0==t.couponDetail.is_limited?"不限量":t.couponDetail.remain_count))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("创建时间:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(t.couponDetail.create_time))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("状态:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(t.couponDetail.status?"开启":"关闭"))])]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("排序:")]),t._v(" "),i("div",{staticClass:"value"},[t._v(t._s(t.couponDetail.sort))])])])]),t._v(" "),i("div",{staticClass:"section"},[i("div",{staticClass:"title"},[t._v("优惠券情况")]),t._v(" "),i("ul",{staticClass:"list"},[i("li",{staticClass:"item"},[i("div",[t._v("已领取/发放总数:")]),t._v(" "),i("div",{staticClass:"value"},[t._v("\n "+t._s(t.couponDetail.send_num)+"\n "),i("el-button",{staticClass:"ml20",attrs:{size:"small",type:"text"},on:{click:function(e){return t.receive(t.couponDetail.coupon_id)}}},[t._v("已领取/发放记录")])],1)]),t._v(" "),i("li",{staticClass:"item"},[i("div",[t._v("已使用总数:")]),t._v(" "),i("div",{staticClass:"value"},[t._v("\n "+t._s(t.couponDetail.used_num)+"\n "),i("el-button",{staticClass:"ml20",attrs:{size:"small",type:"text"},on:{click:function(e){return t.usedRecord(t.couponDetail.coupon_id)}}},[t._v("已领取/使用记录")])],1)])])])]),t._v(" "),1==t.type?i("el-tab-pane",{attrs:{label:"商品信息",name:"product"}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.relateData.data}},[i("el-table-column",{attrs:{prop:"product.product_id",label:"ID","min-width":"50"}}),t._v(" "),i("el-table-column",{attrs:{label:"商品图","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(t){return[t.row.product.image?i("div",{staticClass:"demo-image__preview"},[i("img",{staticStyle:{width:"36px",height:"36px"},attrs:{src:t.row.product.image}})]):i("div",{staticClass:"demo-image__preview"},[i("img",{staticStyle:{width:"36px",height:"36px"},attrs:{src:a("cdfe")}})])]}}],null,!1,1223246422)}),t._v(" "),i("el-table-column",{attrs:{prop:"product.store_name",label:"商品名称","min-width":"150"}}),t._v(" "),i("el-table-column",{attrs:{prop:"product.stock",label:"库存","min-width":"50"}}),t._v(" "),i("el-table-column",{attrs:{prop:"product.price",label:"商品售价","min-width":"50"}}),t._v(" "),i("el-table-column",{attrs:{prop:"product.sales",label:"销售数量","min-width":"50"}})],1),t._v(" "),i("div",{staticClass:"block mb20"},[i("el-pagination",{attrs:{"page-size":t.tableFromRelate.limit,"current-page":t.tableFromRelate.page,layout:"prev, pager, next, jumper",total:t.relateData.total},on:{"size-change":t.handleSizeChangeRelate,"current-change":t.pageChangeRelate}})],1)],1):t._e()],1)],1)]):t._e(),t._v(" "),i("el-dialog",{staticClass:"modalbox",attrs:{title:t.title,visible:t.dialogVisible,width:"660px","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.Loading,expression:"Loading"}],staticStyle:{width:"100%"},attrs:{data:t.issueData.data,size:"small","highlight-current-row":""}},[i("el-table-column",{attrs:{prop:"user.nickname",label:"用户名","min-width":"150"}}),t._v(" "),i("el-table-column",{attrs:{label:"用户头像","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(t){return[t.row.user&&t.row.user.avatar?i("div",{staticClass:"demo-image__preview"},[i("img",{staticStyle:{width:"36px",height:"36px"},attrs:{src:t.row.user.avatar}})]):i("div",{staticClass:"demo-image__preview"},[i("img",{staticStyle:{width:"36px",height:"36px"},attrs:{src:a("cdfe")}})])]}}])}),t._v(" "),0==t.receiveType?i("el-table-column",{key:"1",attrs:{label:"领取方式","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return["receive"==e.row.type?i("span",[t._v("自己领取")]):"send"==e.row.type?i("span",[t._v("后台发送")]):"give"==e.row.type?i("span",[t._v("满赠券")]):"new"==e.row.type?i("span",[t._v("新人券")]):"buy"==e.row.type?i("span",[t._v("买赠送")]):t._e()]}}],null,!1,2368871115)}):t._e(),t._v(" "),i("el-table-column",{attrs:{label:t.receiveTime,"min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===t.receiveType?i("span",[t._v(t._s(e.row.create_time))]):i("span",[t._v(t._s(e.row.use_time))])]}}])})],1),t._v(" "),i("div",{staticClass:"block"},[i("el-pagination",{attrs:{"page-size":t.tableFromIssue.limit,"current-page":t.tableFromIssue.page,layout:" prev, pager, next, jumper",total:t.issueData.total},on:{"size-change":t.handleSizeChangeIssue,"current-change":t.pageChangeIssue}})],1)],1)],1)},s=[],l=a("b7be"),n=a("83d6"),o={name:"CouponList",data:function(){return{Loading:!1,dialogVisible:!1,detailDialog:!1,roterPre:n["roterPre"],listLoading:!0,title:"领取/发放记录",receiveTime:"领取时间",activeName:"basic",receiveType:0,id:"",tableData:{data:[],total:0},tableFrom:{page:1,limit:20,status:"",coupon_name:"",type:"",send_type:""},tableFromIssue:{page:1,limit:10,coupon_id:0},issueData:{data:[],total:0},relateData:{data:[],total:0},tableFromRelate:{page:1,limit:5},couponDetail:{},type:0}},mounted:function(){this.getList(1)},methods:{searchReset:function(){this.$refs.searchForm.resetFields(),this.getList(1)},handleDelete:function(t,e){var a=this;this.$modalSure().then((function(){Object(l["A"])(t).then((function(t){var i=t.message;a.$message.success(i),a.tableData.data.splice(e,1)})).catch((function(t){var e=t.message;a.$message.error(e)}))}))},handleClose:function(){this.dialogVisible=!1},details:function(t){var e=this;this.detailDialog=!0,this.type=0,Object(l["B"])(t).then((function(a){e.couponDetail=a.data,e.type=a.data.type,e.id=t,1==a.data.type&&e.getRelateList(t)})).catch((function(t){var a=t.message;e.$message.error(a)}))},onEdit:function(t){var e=this;this.$modalForm(Object(l["J"])(t)).then((function(){return e.getList("")}))},receive:function(t){this.dialogVisible=!0,this.title="领取/发放记录",this.receiveTime="领取时间",this.receiveType=0,this.tableFromIssue.coupon_id=t,this.getIssueList("")},usedRecord:function(t){this.dialogVisible=!0,this.title="使用记录",this.receiveTime="使用时间",this.receiveType=1,this.tableFromIssue.coupon_id=t,this.getIssueList(1)},getIssueList:function(t){var e=this;this.Loading=!0,this.tableFromIssue.status=t,Object(l["X"])(this.tableFromIssue).then((function(t){e.issueData.data=t.data.list,e.issueData.total=t.data.count,e.Loading=!1})).catch((function(t){e.Loading=!1,e.$message.error(t.message)}))},pageChangeIssue:function(t){this.tableFromIssue.page=t;var e=1==this.receiveType?1:"";this.getIssueList(e)},handleSizeChangeIssue:function(t){this.tableFromIssue.limit=t;var e=1==this.receiveType?1:"";this.getIssueList(e)},getRelateList:function(t){var e=this;this.Loading=!0,this.relateData.data=[],Object(l["F"])(t,this.tableFromRelate).then((function(t){e.relateData.data=t.data.list,e.relateData.total=t.data.count,e.Loading=!1})).catch((function(t){e.Loading=!1,e.$message.error(t.message)}))},pageChangeRelate:function(t){this.tableFromRelate.page=t,this.getRelateList(this.id)},handleSizeChangeRelate:function(t){this.tableFromRelate.limit=t,this.getRelateList(this.id)},getList:function(t){var e=this;this.listLoading=!0,this.tableFrom.page=t||this.tableFrom.page,Object(l["C"])(this.tableFrom).then((function(t){e.tableData.data=t.data.list,e.tableData.total=t.data.count,e.listLoading=!1})).catch((function(t){e.listLoading=!1,e.$message.error(t.message)}))},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")},onchangeIsShow:function(t){var e=this;Object(l["E"])(t.coupon_id,t.status).then((function(t){var a=t.message;e.$message.success(a),e.getList("")})).catch((function(t){var a=t.message;e.$message.error(a)}))}}},r=o,c=(a("777e"),a("2877")),u=Object(c["a"])(r,i,s,!1,null,"624a72ac",null);e["default"]=u.exports},cdfe:function(t,e,a){t.exports=a.p+"mer/img/f.5aa43cd3.png"}}]);