Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-67a6c601.1df52acd.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
9.7 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-67a6c601"],{"2e59":function(o,e,t){"use strict";t("322c")},"322c":function(o,e,t){},"6c49":function(o,e,t){"use strict";t.d(e,"f",(function(){return a})),t.d(e,"h",(function(){return s})),t.d(e,"i",(function(){return c})),t.d(e,"a",(function(){return r})),t.d(e,"b",(function(){return l})),t.d(e,"g",(function(){return u})),t.d(e,"c",(function(){return p})),t.d(e,"d",(function(){return g})),t.d(e,"e",(function(){return d}));var n=t("b775"),i=t("7323");function a(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.queryShopCoupon",method:"get",params:o}).then(o=>{const t=o.data;e(t)}).catch(o=>{t(o)})})}function s(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.saveShopCoupon",method:"post",data:o}).then(o=>{const n=o.data;0===n.code?e(n):t(n.msg)}).catch(o=>{t(o)})})}function c(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.updateShopCoupon",method:"post",data:o}).then(o=>{const n=o.data;0===n.code?e(n):t(n.msg)}).catch(o=>{t(o)})})}function r(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.deleteShopCoupon",method:"post",data:o}).then(o=>{const n=o.data;0===n.code?e(n):t(n.msg)}).catch(o=>{t(o)})})}function l(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.giveCoupon",method:"post",data:o}).then(o=>{const n=o.data;0===n.code?e(n):t(n.msg)}).catch(o=>{t(o)})})}function u(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.queryUserCoupon",method:"get",params:o}).then(o=>{const t=o.data;e(t)}).catch(o=>{t(o)})})}function p(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.queryCouponGiveLog",method:"get",params:o}).then(o=>{const t=o.data;e(t)}).catch(o=>{t(o)})})}function g(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.queryCouponReceiveLog",method:"get",params:o}).then(o=>{const t=o.data;e(t)}).catch(o=>{t(o)})})}function d(o){return new Promise((e,t)=>{o.shopId=Object(i["f"])(),Object(n["a"])({url:"/coupon.queryCouponUseLog",method:"get",params:o}).then(o=>{const t=o.data;e(t)}).catch(o=>{t(o)})})}},c4c6:function(o,e,t){"use strict";t.r(e);var n=function(){var o=this,e=o._self._c;return e("div",[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:3}},[e("el-card",{staticClass:"list-selector"},[e("ul",{staticClass:"list-selector-list"},[e("li",{class:{selected:""===o.giveLogInfo.conditions.couponId},on:{click:function(e){o.switchCoupon({couponName:o.$t("common.all"),couponId:""})}}},[o._v(" "+o._s(o.$t("common.all"))+" ")]),o._l(o.giveLogInfo.coupons,(function(t,n){return e("li",{key:n,class:{selected:o.giveLogInfo.conditions.couponId==t.couponId},on:{click:function(e){return o.switchCoupon(t)}}},[o._v(" "+o._s(t.couponName)+" ")])}))],2)])],1),e("el-col",{attrs:{span:21}},[e("el-card",[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[o._v(o._s(o.$t("couponManage.queryCondition")))])]),e("el-form",{staticClass:"demo-form-inline text-left",attrs:{inline:!0}},[e("el-form-item",[e("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:o.$t("couponManage.userName"),clearable:""},model:{value:o.giveLogInfo.conditions.userName,callback:function(e){o.$set(o.giveLogInfo.conditions,"userName",e)},expression:"giveLogInfo.conditions.userName"}})],1),e("el-form-item",[e("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:o.$t("couponManage.phoneNumber"),clearable:""},model:{value:o.giveLogInfo.conditions.tel,callback:function(e){o.$set(o.giveLogInfo.conditions,"tel",e)},expression:"giveLogInfo.conditions.tel"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return o._queryGiveLogMethod()}}},[e("i",{staticClass:"el-icon-search"}),o._v(" "+o._s(o.$t("couponManage.query"))+" ")]),e("el-button",{on:{click:function(e){return o._resetGiveLogMethod()}}},[e("i",{staticClass:"el-icon-refresh"}),o._v(" "+o._s(o.$t("common.reset"))+" ")])],1)],1)],1),e("el-card",{staticStyle:{"margin-top":"20px"}},[e("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[o._v(o._s(o.$t("couponManage.giveLogs")))]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return o._openGiveCouponModal()}}},[o._v(" "+o._s(o.$t("couponManage.give"))+" ")])],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:o.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:o.giveLogInfo.giveLogs,border:""}},[e("el-table-column",{attrs:{prop:"giveId",label:o.$t("couponManage.id"),align:"center"}}),e("el-table-column",{attrs:{prop:"couponName",label:o.$t("couponManage.couponName"),align:"center"}}),e("el-table-column",{attrs:{prop:"receiveUserName",label:o.$t("couponManage.userName"),align:"center"}}),e("el-table-column",{attrs:{prop:"receivePhone",label:o.$t("couponManage.phoneNumber"),align:"center"}}),e("el-table-column",{attrs:{prop:"createTime",label:o.$t("couponManage.giveTime"),align:"center"}}),e("el-table-column",{attrs:{prop:"givePersonName",label:o.$t("couponManage.giveUser"),align:"center"}})],1),e("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":o.giveLogInfo.conditions.page,"page-size":o.giveLogInfo.conditions.row,layout:"total, prev, pager, next",total:o.giveLogInfo.total},on:{"current-change":o.handleCurrentChange,"update:currentPage":function(e){return o.$set(o.giveLogInfo.conditions,"page",e)},"update:current-page":function(e){return o.$set(o.giveLogInfo.conditions,"page",e)}}})],1)],1)],1),e("give-coupon-from-list",{ref:"giveCouponFromList",on:{refresh:o._listGiveLogs}})],1)},i=[],a=t("6c49"),s=function(){var o=this,e=o._self._c;return e("el-dialog",{attrs:{title:o.$t("couponManage.giveCoupon"),visible:o.dialogVisible,width:"500px"},on:{"update:visible":function(e){o.dialogVisible=e},close:o.handleClose}},[e("el-form",{ref:"form",attrs:{model:o.giveCouponInfo,"label-width":"100px"}},[e("el-form-item",{attrs:{label:o.$t("couponManage.selectCoupon"),rules:[{required:!0,message:o.$t("couponManage.selectCouponRequired"),trigger:"change"}]}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:o.$t("couponManage.selectCouponRequired")},on:{change:o._changeCoupon},model:{value:o.giveCouponInfo.couponId,callback:function(e){o.$set(o.giveCouponInfo,"couponId",e)},expression:"giveCouponInfo.couponId"}},[e("el-option",{attrs:{disabled:"",value:"",label:o.$t("couponManage.selectCouponRequired")}}),o._l(o.couponList,(function(o){return e("el-option",{key:o.couponId,attrs:{label:o.couponName,value:o.couponId}})}))],2)],1),e("el-form-item",{attrs:{label:o.$t("couponManage.phoneNumber"),rules:[{required:!0,message:o.$t("couponManage.phoneNumberRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{placeholder:o.$t("couponManage.phoneNumberPlaceholder")},model:{value:o.giveCouponInfo.tel,callback:function(e){o.$set(o.giveCouponInfo,"tel",e)},expression:"giveCouponInfo.tel"}})],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){o.dialogVisible=!1}}},[o._v(" "+o._s(o.$t("common.cancel"))+" ")]),e("el-button",{attrs:{type:"primary"},on:{click:o.giveCouponMethod}},[o._v(" "+o._s(o.$t("couponManage.give"))+" ")])],1)],1)},c=[],r=t("7323"),l={name:"GiveCouponFromList",data(){return{dialogVisible:!1,couponList:[],giveCouponInfo:{couponId:"",couponName:"",tel:""}}},methods:{async open(){this.dialogVisible=!0,this._loadCoupons()},async _loadCoupons(){try{const o=await Object(a["f"])({shopId:Object(r["f"])(),page:1,row:100});this.couponList=o.data||[]}catch(o){console.error(o)}},_changeCoupon(){const o=this.couponList.find(o=>o.couponId===this.giveCouponInfo.couponId);o&&(this.giveCouponInfo.couponName=o.couponName)},handleClose(){this.$refs.form.resetFields(),this.giveCouponInfo={couponId:"",couponName:"",tel:""},this.couponList=[]},async giveCouponMethod(){try{this.$refs.form.validate(async o=>{if(o)try{await Object(a["b"])({couponId:this.giveCouponInfo.couponId,tel:this.giveCouponInfo.tel}),this.$message.success(this.$t("couponManage.giveSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(e){this.$message.error(e||this.$t("couponManage.giveFailed"))}})}catch(o){this.$message.error(o),console.error(o)}}}},u=l,p=t("2877"),g=Object(p["a"])(u,s,c,!1,null,null,null),d=g.exports,h={name:"CouponGiveLogManage",components:{GiveCouponFromList:d},data(){return{loading:!1,giveLogInfo:{giveLogs:[],coupons:[],total:0,conditions:{userName:"",tel:"",couponId:"",shopId:"",page:1,row:10}}}},created(){this.giveLogInfo.conditions.shopId=Object(r["f"])(),this._listCoupons(),this._listGiveLogs()},methods:{async _listCoupons(){try{const o=await Object(a["f"])({shopId:Object(r["f"])(),page:1,row:100});this.giveLogInfo.coupons=o.data||[]}catch(o){console.error("获取优惠券列表失败:",o)}},async _listGiveLogs(){this.loading=!0;try{const o=await Object(a["c"])(this.giveLogInfo.conditions);this.giveLogInfo.giveLogs=o.data,this.giveLogInfo.total=o.total}catch(o){console.error("获取赠送记录失败:",o)}finally{this.loading=!1}},_queryGiveLogMethod(){this.giveLogInfo.conditions.page=1,this._listGiveLogs()},_resetGiveLogMethod(){this.giveLogInfo.conditions.userName="",this.giveLogInfo.conditions.tel="",this.giveLogInfo.conditions.page=1,this._listGiveLogs()},handleCurrentChange(o){this.giveLogInfo.conditions.page=o,this._listGiveLogs()},_openGiveCouponModal(){this.$refs.giveCouponFromList.open()},switchCoupon(o){this.giveLogInfo.conditions.couponId=o.couponId||"",this.giveLogInfo.conditions.page=1,this._listGiveLogs()}}},f=h,m=(t("2e59"),Object(p["a"])(f,n,i,!1,null,"39b17d6c",null));e["default"]=m.exports}}]);
//# sourceMappingURL=chunk-67a6c601.1df52acd.js.map