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

2 lines
26 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-62dd86cf"],{"0c73":function(o,e,n){"use strict";n("db43")},"6c49":function(o,e,n){"use strict";n.d(e,"f",(function(){return u})),n.d(e,"h",(function(){return i})),n.d(e,"i",(function(){return l})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"g",(function(){return p})),n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return d})),n.d(e,"e",(function(){return m}));var t=n("b775"),a=n("7323");function u(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.queryShopCoupon",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function i(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.saveShopCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function l(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.updateShopCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function s(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.deleteShopCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function c(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.giveCoupon",method:"post",data:o}).then(o=>{const t=o.data;0===t.code?e(t):n(t.msg)}).catch(o=>{n(o)})})}function p(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.queryUserCoupon",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function r(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.queryCouponGiveLog",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function d(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.queryCouponReceiveLog",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}function m(o){return new Promise((e,n)=>{o.shopId=Object(a["f"])(),Object(t["a"])({url:"/coupon.queryCouponUseLog",method:"get",params:o}).then(o=>{const n=o.data;e(n)}).catch(o=>{n(o)})})}},d46c:function(o,e,n){"use strict";n.r(e);var t=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.couponManageInfo.conditions.couponType},on:{click:function(e){o.switchCouponType({label:o.$t("common.all"),value:""})}}},[o._v(" "+o._s(o.$t("common.all"))+" ")]),e("li",{class:{selected:"01"===o.couponManageInfo.conditions.couponType},on:{click:function(e){o.switchCouponType({label:o.$t("couponManage.fullReduction"),value:"01"})}}},[o._v(" "+o._s(o.$t("couponManage.fullReduction"))+" ")]),e("li",{class:{selected:"02"===o.couponManageInfo.conditions.couponType},on:{click:function(e){o.switchCouponType({label:o.$t("couponManage.discount"),value:"02"})}}},[o._v(" "+o._s(o.$t("couponManage.discount"))+" ")])])])],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.selectCouponName"),clearable:""},model:{value:o.couponManageInfo.conditions.couponName,callback:function(e){o.$set(o.couponManageInfo.conditions,"couponName",e)},expression:"couponManageInfo.conditions.couponName"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return o._queryCouponMethod()}}},[e("i",{staticClass:"el-icon-search"}),o._v(" "+o._s(o.$t("couponManage.query"))+" ")]),e("el-button",{on:{click:function(e){return o._resetCouponMethod()}}},[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.coupons")))]),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return o._openAddCouponModal()}}},[o._v(" "+o._s(o.$t("couponManage.add"))+" ")])],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:o.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:o.couponManageInfo.coupons,border:""}},[e("el-table-column",{attrs:{prop:"couponCode",label:o.$t("couponManage.couponCode"),align:"center"}}),e("el-table-column",{attrs:{prop:"couponName",label:o.$t("couponManage.couponName"),align:"center"}}),e("el-table-column",{attrs:{prop:"couponType",label:o.$t("couponManage.couponType"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v(" "+o._s("01"===e.row.couponType?o.$t("couponManage.fullReduction"):o.$t("couponManage.discount"))+" ")]}}])}),e("el-table-column",{attrs:{label:o.$t("couponManage.discountInfo"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(n){return["01"===n.row.couponType?e("span",[o._v(" "+o._s(o.$t("couponManage.reduce"))+"¥"+o._s(n.row.discountAmount)+" ")]):e("span",[o._v(" "+o._s(n.row.discountPercent)+"%"+o._s(o.$t("couponManage.off"))+" ")])]}}])}),e("el-table-column",{attrs:{prop:"minAmount",label:o.$t("couponManage.minAmount"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v(" ¥"+o._s(e.row.minAmount)+" ")]}}])}),e("el-table-column",{attrs:{prop:"totalQuantity",label:o.$t("couponManage.totalQuantity"),align:"center"}}),e("el-table-column",{attrs:{prop:"statusCd",label:o.$t("couponManage.status"),align:"center"},scopedSlots:o._u([{key:"default",fn:function(e){return[o._v(" "+o._s("0"===e.row.statusCd?o.$t("couponManage.inUse"):o.$t("couponManage.invalid"))+" ")]}}])}),e("el-table-column",{attrs:{label:o.$t("couponManage.operation"),align:"center",width:"240"},scopedSlots:o._u([{key:"default",fn:function(n){return[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return o._openEditCouponModel(n.row)}}},[o._v(" "+o._s(o.$t("couponManage.edit"))+" ")]),e("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(e){return o._openDeleteCouponModel(n.row)}}},[o._v(" "+o._s(o.$t("couponManage.delete"))+" ")]),e("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(e){return o._openGiveCouponModal(n.row)}}},[o._v(" "+o._s(o.$t("couponManage.give"))+" ")])]}}])})],1),e("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":o.couponManageInfo.conditions.page,"page-size":o.couponManageInfo.conditions.row,layout:"total, prev, pager, next",total:o.couponManageInfo.total},on:{"current-change":o.handleCurrentChange,"update:currentPage":function(e){return o.$set(o.couponManageInfo.conditions,"page",e)},"update:current-page":function(e){return o.$set(o.couponManageInfo.conditions,"page",e)}}})],1)],1)],1),e("add-shop-coupon",{ref:"addShopCoupon",on:{refresh:o._listCoupons}}),e("edit-shop-coupon",{ref:"editShopCoupon",on:{refresh:o._listCoupons}}),e("delete-shop-coupon",{ref:"deleteShopCoupon",on:{refresh:o._listCoupons}}),e("give-coupon",{ref:"giveCoupon",on:{refresh:o._listCoupons}})],1)},a=[],u=n("6c49"),i=function(){var o=this,e=o._self._c;return e("el-dialog",{attrs:{title:o.$t("couponManage.addCoupon"),visible:o.dialogVisible,width:"70%"},on:{"update:visible":function(e){o.dialogVisible=e},close:o.handleClose}},[e("el-form",{ref:"form",attrs:{model:o.addCouponInfo,"label-width":"120px"}},[e("el-form-item",{attrs:{label:o.$t("couponManage.couponCode"),rules:[{required:!0,message:o.$t("couponManage.couponCodeRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{placeholder:o.$t("couponManage.couponCodeRequired")},model:{value:o.addCouponInfo.couponCode,callback:function(e){o.$set(o.addCouponInfo,"couponCode",e)},expression:"addCouponInfo.couponCode"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.couponName"),rules:[{required:!0,message:o.$t("couponManage.couponNameRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{placeholder:o.$t("couponManage.couponNameRequired")},model:{value:o.addCouponInfo.couponName,callback:function(e){o.$set(o.addCouponInfo,"couponName",e)},expression:"addCouponInfo.couponName"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.couponType"),rules:[{required:!0,message:o.$t("couponManage.couponTypeRequired"),trigger:"change"}]}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:o.$t("couponManage.couponTypeRequired")},on:{change:o._changeCouponType},model:{value:o.addCouponInfo.couponType,callback:function(e){o.$set(o.addCouponInfo,"couponType",e)},expression:"addCouponInfo.couponType"}},[e("el-option",{attrs:{disabled:"",value:"",label:o.$t("couponManage.couponTypeRequired")}}),e("el-option",{attrs:{label:o.$t("couponManage.fullReduction"),value:"01"}}),e("el-option",{attrs:{label:o.$t("couponManage.discount"),value:"02"}})],1)],1),"01"===o.addCouponInfo.couponType?e("el-form-item",{attrs:{label:o.$t("couponManage.discountAmount"),rules:[{required:!0,message:o.$t("couponManage.discountAmountRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.discountAmountRequired")},model:{value:o.addCouponInfo.discountAmount,callback:function(e){o.$set(o.addCouponInfo,"discountAmount",e)},expression:"addCouponInfo.discountAmount"}})],1):o._e(),"02"===o.addCouponInfo.couponType?e("el-form-item",{attrs:{label:o.$t("couponManage.discountPercent"),rules:[{required:!0,message:o.$t("couponManage.discountPercentRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.discountPercentRequired")},model:{value:o.addCouponInfo.discountPercent,callback:function(e){o.$set(o.addCouponInfo,"discountPercent",e)},expression:"addCouponInfo.discountPercent"}})],1):o._e(),e("el-form-item",{attrs:{label:o.$t("couponManage.minAmount")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.minAmountPlaceholder")},model:{value:o.addCouponInfo.minAmount,callback:function(e){o.$set(o.addCouponInfo,"minAmount",e)},expression:"addCouponInfo.minAmount"}})],1),"02"===o.addCouponInfo.couponType?e("el-form-item",{attrs:{label:o.$t("couponManage.maxDiscount")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.maxDiscountPlaceholder")},model:{value:o.addCouponInfo.maxDiscount,callback:function(e){o.$set(o.addCouponInfo,"maxDiscount",e)},expression:"addCouponInfo.maxDiscount"}})],1):o._e(),e("el-form-item",{attrs:{label:o.$t("couponManage.description")}},[e("el-input",{attrs:{type:"textarea",placeholder:o.$t("couponManage.descriptionPlaceholder")},model:{value:o.addCouponInfo.description,callback:function(e){o.$set(o.addCouponInfo,"description",e)},expression:"addCouponInfo.description"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.totalQuantity"),rules:[{required:!0,message:o.$t("couponManage.totalQuantityRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.totalQuantityRequired")},model:{value:o.addCouponInfo.totalQuantity,callback:function(e){o.$set(o.addCouponInfo,"totalQuantity",e)},expression:"addCouponInfo.totalQuantity"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.limitPerUser")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.limitPerUserPlaceholder")},model:{value:o.addCouponInfo.limitPerUser,callback:function(e){o.$set(o.addCouponInfo,"limitPerUser",e)},expression:"addCouponInfo.limitPerUser"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.issueType"),rules:[{required:!0,message:o.$t("couponManage.issueTypeRequired"),trigger:"change"}]}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:o.$t("couponManage.issueTypeRequired")},model:{value:o.addCouponInfo.issueType,callback:function(e){o.$set(o.addCouponInfo,"issueType",e)},expression:"addCouponInfo.issueType"}},[e("el-option",{attrs:{disabled:"",value:"",label:o.$t("couponManage.issueTypeRequired")}}),e("el-option",{attrs:{label:o.$t("couponManage.userReceive"),value:"01"}}),e("el-option",{attrs:{label:o.$t("couponManage.shopGive"),value:"02"}})],1)],1),e("el-form-item",{attrs:{label:o.$t("couponManage.validDays")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.validDaysPlaceholder")},model:{value:o.addCouponInfo.validDays,callback:function(e){o.$set(o.addCouponInfo,"validDays",e)},expression:"addCouponInfo.validDays"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.startTime")}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss",placeholder:o.$t("couponManage.startTimePlaceholder")},model:{value:o.addCouponInfo.startTime,callback:function(e){o.$set(o.addCouponInfo,"startTime",e)},expression:"addCouponInfo.startTime"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.endTime")}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss",placeholder:o.$t("couponManage.endTimePlaceholder")},model:{value:o.addCouponInfo.endTime,callback:function(e){o.$set(o.addCouponInfo,"endTime",e)},expression:"addCouponInfo.endTime"}})],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.saveCouponInfo}},[o._v(" "+o._s(o.$t("common.save"))+" ")])],1)],1)},l=[],s=n("7323"),c={name:"AddShopCoupon",data(){return{dialogVisible:!1,addCouponInfo:{couponCode:"",couponName:"",couponType:"",description:"",discountAmount:"",discountPercent:"",minAmount:"0",maxDiscount:"",totalQuantity:"",limitPerUser:"1",issueType:"",validDays:"",startTime:"",endTime:"",shopId:""}}},methods:{open(){this.dialogVisible=!0,this.addCouponInfo.shopId=Object(s["f"])()},handleClose(){this.$refs.form.resetFields(),this.addCouponInfo={couponCode:"",couponName:"",couponType:"",description:"",discountAmount:"",discountPercent:"",minAmount:"0",maxDiscount:"",totalQuantity:"",limitPerUser:"1",issueType:"",validDays:"",startTime:"",endTime:"",shopId:""}},_changeCouponType(){"01"===this.addCouponInfo.couponType?(this.addCouponInfo.discountPercent="",this.addCouponInfo.maxDiscount=""):this.addCouponInfo.discountAmount=""},async saveCouponInfo(){try{this.$refs.form.validate(async o=>{o&&(await Object(u["h"])(this.addCouponInfo),this.$message.success(this.$t("common.saveSuccess")),this.dialogVisible=!1,this.$emit("refresh"))})}catch(o){this.$message.error(o),console.error(o)}}}},p=c,r=n("2877"),d=Object(r["a"])(p,i,l,!1,null,null,null),m=d.exports,f=function(){var o=this,e=o._self._c;return e("el-dialog",{attrs:{title:o.$t("couponManage.editCoupon"),visible:o.dialogVisible,width:"70%"},on:{"update:visible":function(e){o.dialogVisible=e},close:o.handleClose}},[e("el-form",{ref:"form",attrs:{model:o.editCouponInfo,"label-width":"120px"}},[e("el-form-item",{attrs:{label:o.$t("couponManage.couponCode")}},[e("el-input",{attrs:{disabled:""},model:{value:o.editCouponInfo.couponCode,callback:function(e){o.$set(o.editCouponInfo,"couponCode",e)},expression:"editCouponInfo.couponCode"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.couponName"),rules:[{required:!0,message:o.$t("couponManage.couponNameRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{placeholder:o.$t("couponManage.couponNameRequired")},model:{value:o.editCouponInfo.couponName,callback:function(e){o.$set(o.editCouponInfo,"couponName",e)},expression:"editCouponInfo.couponName"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.couponType")}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:o.$t("couponManage.couponTypeRequired")},on:{change:o._changeCouponType},model:{value:o.editCouponInfo.couponType,callback:function(e){o.$set(o.editCouponInfo,"couponType",e)},expression:"editCouponInfo.couponType"}},[e("el-option",{attrs:{label:o.$t("couponManage.fullReduction"),value:"01"}}),e("el-option",{attrs:{label:o.$t("couponManage.discount"),value:"02"}})],1)],1),"01"===o.editCouponInfo.couponType?e("el-form-item",{attrs:{label:o.$t("couponManage.discountAmount"),rules:[{required:!0,message:o.$t("couponManage.discountAmountRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.discountAmountRequired")},model:{value:o.editCouponInfo.discountAmount,callback:function(e){o.$set(o.editCouponInfo,"discountAmount",e)},expression:"editCouponInfo.discountAmount"}})],1):o._e(),"02"===o.editCouponInfo.couponType?e("el-form-item",{attrs:{label:o.$t("couponManage.discountPercent"),rules:[{required:!0,message:o.$t("couponManage.discountPercentRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.discountPercentRequired")},model:{value:o.editCouponInfo.discountPercent,callback:function(e){o.$set(o.editCouponInfo,"discountPercent",e)},expression:"editCouponInfo.discountPercent"}})],1):o._e(),e("el-form-item",{attrs:{label:o.$t("couponManage.minAmount")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.minAmountPlaceholder")},model:{value:o.editCouponInfo.minAmount,callback:function(e){o.$set(o.editCouponInfo,"minAmount",e)},expression:"editCouponInfo.minAmount"}})],1),"02"===o.editCouponInfo.couponType?e("el-form-item",{attrs:{label:o.$t("couponManage.maxDiscount")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.maxDiscountPlaceholder")},model:{value:o.editCouponInfo.maxDiscount,callback:function(e){o.$set(o.editCouponInfo,"maxDiscount",e)},expression:"editCouponInfo.maxDiscount"}})],1):o._e(),e("el-form-item",{attrs:{label:o.$t("couponManage.description")}},[e("el-input",{attrs:{type:"textarea",placeholder:o.$t("couponManage.descriptionPlaceholder")},model:{value:o.editCouponInfo.description,callback:function(e){o.$set(o.editCouponInfo,"description",e)},expression:"editCouponInfo.description"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.totalQuantity"),rules:[{required:!0,message:o.$t("couponManage.totalQuantityRequired"),trigger:"blur"}]}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.totalQuantityRequired")},model:{value:o.editCouponInfo.totalQuantity,callback:function(e){o.$set(o.editCouponInfo,"totalQuantity",e)},expression:"editCouponInfo.totalQuantity"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.limitPerUser")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.limitPerUserPlaceholder")},model:{value:o.editCouponInfo.limitPerUser,callback:function(e){o.$set(o.editCouponInfo,"limitPerUser",e)},expression:"editCouponInfo.limitPerUser"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.issueType"),rules:[{required:!0,message:o.$t("couponManage.issueTypeRequired"),trigger:"change"}]}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:o.$t("couponManage.issueTypeRequired")},model:{value:o.editCouponInfo.issueType,callback:function(e){o.$set(o.editCouponInfo,"issueType",e)},expression:"editCouponInfo.issueType"}},[e("el-option",{attrs:{label:o.$t("couponManage.userReceive"),value:"01"}}),e("el-option",{attrs:{label:o.$t("couponManage.shopGive"),value:"02"}})],1)],1),e("el-form-item",{attrs:{label:o.$t("couponManage.validDays")}},[e("el-input",{attrs:{type:"number",placeholder:o.$t("couponManage.validDaysPlaceholder")},model:{value:o.editCouponInfo.validDays,callback:function(e){o.$set(o.editCouponInfo,"validDays",e)},expression:"editCouponInfo.validDays"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.startTime")}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss",placeholder:o.$t("couponManage.startTimePlaceholder")},model:{value:o.editCouponInfo.startTime,callback:function(e){o.$set(o.editCouponInfo,"startTime",e)},expression:"editCouponInfo.startTime"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.endTime")}},[e("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss",placeholder:o.$t("couponManage.endTimePlaceholder")},model:{value:o.editCouponInfo.endTime,callback:function(e){o.$set(o.editCouponInfo,"endTime",e)},expression:"editCouponInfo.endTime"}})],1),e("el-form-item",{attrs:{label:o.$t("couponManage.status")}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:o.$t("couponManage.selectStatus")},model:{value:o.editCouponInfo.statusCd,callback:function(e){o.$set(o.editCouponInfo,"statusCd",e)},expression:"editCouponInfo.statusCd"}},[e("el-option",{attrs:{label:o.$t("couponManage.inUse"),value:"0"}}),e("el-option",{attrs:{label:o.$t("couponManage.invalid"),value:"1"}})],1)],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.updateCouponInfo}},[o._v(" "+o._s(o.$t("common.save"))+" ")])],1)],1)},g=[],h={name:"EditShopCoupon",data(){return{dialogVisible:!1,editCouponInfo:{}}},methods:{open(o){this.dialogVisible=!0,this.editCouponInfo={...o}},handleClose(){this.$refs.form.resetFields(),this.editCouponInfo={}},_changeCouponType(){"01"===this.editCouponInfo.couponType?(this.editCouponInfo.discountPercent="",this.editCouponInfo.maxDiscount=""):this.editCouponInfo.discountAmount=""},async updateCouponInfo(){try{this.$refs.form.validate(async o=>{o&&(await Object(u["i"])(this.editCouponInfo),this.$message.success(this.$t("common.saveSuccess")),this.dialogVisible=!1,this.$emit("refresh"))})}catch(o){this.$message.error(o),console.error(o)}}}},C=h,b=Object(r["a"])(C,f,g,!1,null,null,null),$=b.exports,I=function(){var o=this,e=o._self._c;return e("el-dialog",{attrs:{title:o.$t("couponManage.deleteCoupon"),visible:o.dialogVisible,width:"500px"},on:{"update:visible":function(e){o.dialogVisible=e},close:o.handleClose}},[e("div",[e("p",[o._v(o._s(o.$t("couponManage.confirmOperation")))]),e("p",[o._v(o._s(o.$t("couponManage.confirmDeleteCoupon"))+""+o._s(o.deleteCouponInfo.couponName))])]),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:"danger"},on:{click:o.deleteCouponInfoMethod}},[o._v(" "+o._s(o.$t("couponManage.confirmDelete"))+" ")])],1)])},y=[],M={name:"DeleteShopCoupon",data(){return{dialogVisible:!1,deleteCouponInfo:{}}},methods:{open(o){this.dialogVisible=!0,this.deleteCouponInfo={...o}},handleClose(){this.deleteCouponInfo={}},async deleteCouponInfoMethod(){try{await Object(u["a"])({couponId:this.deleteCouponInfo.couponId}),this.$message.success(this.$t("common.deleteSuccess")),this.dialogVisible=!1,this.$emit("refresh")}catch(o){this.$message.error(o),console.error(o)}}}},v=M,_=Object(r["a"])(v,I,y,!1,null,null,null),T=_.exports,x=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.couponName")}},[e("el-input",{attrs:{disabled:""},model:{value:o.giveCouponInfo.couponName,callback:function(e){o.$set(o.giveCouponInfo,"couponName",e)},expression:"giveCouponInfo.couponName"}})],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)},k=[],w={name:"GiveCoupon",data(){return{dialogVisible:!1,giveCouponInfo:{couponId:"",couponName:"",tel:""}}},methods:{open(o){this.dialogVisible=!0,this.giveCouponInfo.couponId=o.couponId,this.giveCouponInfo.couponName=o.couponName,this.giveCouponInfo.tel=""},handleClose(){this.$refs.form.resetFields(),this.giveCouponInfo={couponId:"",couponName:"",tel:""}},async giveCouponMethod(){try{this.$refs.form.validate(async o=>{if(o)try{await Object(u["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)}}}},P=w,q=Object(r["a"])(P,x,k,!1,null,null,null),S=q.exports,A={name:"ShopCouponManage",components:{AddShopCoupon:m,EditShopCoupon:$,DeleteShopCoupon:T,GiveCoupon:S},data(){return{loading:!1,couponManageInfo:{coupons:[],total:0,conditions:{couponName:"",couponType:"",shopId:"",page:1,row:10}}}},created(){this.couponManageInfo.conditions.shopId=Object(s["f"])(),this._listCoupons()},methods:{async _listCoupons(){this.loading=!0;try{const o=await Object(u["f"])(this.couponManageInfo.conditions);this.couponManageInfo.coupons=o.data,this.couponManageInfo.total=o.total}catch(o){console.error("获取优惠券列表失败:",o)}finally{this.loading=!1}},_queryCouponMethod(){this.couponManageInfo.conditions.page=1,this._listCoupons()},_resetCouponMethod(){this.couponManageInfo.conditions.couponName="",this.couponManageInfo.conditions.page=1,this._listCoupons()},handleCurrentChange(o){this.couponManageInfo.conditions.page=o,this._listCoupons()},switchCouponType(o){this.couponManageInfo.conditions.couponType=o.value||"",this.couponManageInfo.conditions.page=1,this._listCoupons()},_openAddCouponModal(){this.$refs.addShopCoupon.open()},_openEditCouponModel(o){this.$refs.editShopCoupon.open(o)},_openDeleteCouponModel(o){this.$refs.deleteShopCoupon.open(o)},_openGiveCouponModal(o){this.$refs.giveCoupon.open(o)}}},R=A,N=(n("0c73"),Object(r["a"])(R,t,a,!1,null,"1a84456c",null));e["default"]=N.exports},db43:function(o,e,n){}}]);
//# sourceMappingURL=chunk-62dd86cf.a60cfa39.js.map