2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-510b3d89"],{"8bb8":function(e,t,l){},b523:function(e,t,l){"use strict";l("8bb8")},f750:function(e,t,l){"use strict";l.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("integralShopRule.queryCondition")))])]),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.ruleNamePlaceholder"),clearable:""},model:{value:e.integralShopRuleInfo.conditions.ruleName,callback:function(t){e.$set(e.integralShopRuleInfo.conditions,"ruleName",t)},expression:"integralShopRuleInfo.conditions.ruleName"}})],1),t("el-col",{attrs:{span:4}},[t("el-button",{attrs:{type:"primary"},on:{click:e._queryIntegralShopRuleMethod}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("integralShopRule.query"))+" ")])],1)],1)],1),t("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"20px"}},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("integralShopRule.ruleTitle")))]),t("el-button",{staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:e._openAddIntegralShopRuleModal}},[e._v(" "+e._s(e.$t("integralShopRule.add"))+" ")])],1),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.integralShopRuleInfo.integralShopRules,border:""}},[t("el-table-column",{attrs:{prop:"ruleId",label:e.$t("integralShopRule.id"),align:"center",width:"100"}}),t("el-table-column",{attrs:{prop:"ruleName",label:e.$t("integralShopRule.ruleName"),align:"center"}}),t("el-table-column",{attrs:{prop:"money",label:e.$t("integralShopRule.money"),align:"center"}}),t("el-table-column",{attrs:{prop:"amount",label:e.$t("integralShopRule.amount"),align:"center"}}),t("el-table-column",{attrs:{prop:"createTime",label:e.$t("integralShopRule.createTime"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("integralShopRule.operation"),align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(l){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e._openEditIntegralShopRuleModel(l.row)}}},[e._v(" "+e._s(e.$t("integralShopRule.edit"))+" ")]),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e._openDeleteIntegralShopRuleModel(l.row)}}},[e._v(" "+e._s(e.$t("integralShopRule.delete"))+" ")])]}}])})],1),t("el-pagination",{staticStyle:{"margin-top":"20px"},attrs:{"current-page":e.integralShopRuleInfo.conditions.page,"page-size":e.integralShopRuleInfo.conditions.row,layout:"total, prev, pager, next",total:e.integralShopRuleInfo.total},on:{"current-change":e.handleCurrentChange}})],1),t("add-integral-shop-rule",{ref:"addIntegralShopRule",on:{refresh:function(t){return e._queryIntegralShopRuleMethod()}}}),t("edit-integral-shop-rule",{ref:"editIntegralShopRule",on:{refresh:function(t){return e._queryIntegralShopRuleMethod()}}}),t("delete-integral-shop-rule",{ref:"deleteIntegralShopRule",on:{refresh:function(t){return e._queryIntegralShopRuleMethod()}}})],1)},o=[],r=l("b775");function n(e){return new Promise((t,l)=>{Object(r["a"])({url:"/integralShopRule.listIntegralShopRule",method:"get",params:e}).then(e=>{const l=e.data;t(l)}).catch(e=>{l(e)})})}function i(e){return new Promise((t,l)=>{Object(r["a"])({url:"/integralShopRule.saveIntegralShopRule",method:"post",data:e}).then(e=>{const l=e.data;t(l)}).catch(e=>{l(e)})})}function s(e){return new Promise((t,l)=>{Object(r["a"])({url:"/integralShopRule.updateIntegralShopRule",method:"post",data:e}).then(e=>{const l=e.data;t(l)}).catch(e=>{l(e)})})}function u(e){return new Promise((t,l)=>{Object(r["a"])({url:"/integralShopRule.deleteIntegralShopRule",method:"post",data:e}).then(e=>{const l=e.data;t(l)}).catch(e=>{l(e)})})}var h=l("7323"),c=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("integralShopRule.add"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("integralShopRule.ruleName"),prop:"ruleName"}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.ruleNamePlaceholder")},model:{value:e.formData.ruleName,callback:function(t){e.$set(e.formData,"ruleName",t)},expression:"formData.ruleName"}})],1),t("el-form-item",{attrs:{label:e.$t("integralShopRule.money"),prop:"money"}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.moneyPlaceholder")},model:{value:e.formData.money,callback:function(t){e.$set(e.formData,"money",t)},expression:"formData.money"}})],1),t("el-form-item",{attrs:{label:e.$t("integralShopRule.amount"),prop:"amount"}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.amountPlaceholder")},model:{value:e.formData.amount,callback:function(t){e.$set(e.formData,"amount",t)},expression:"formData.amount"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("common.save")))])],1)],1)},p=[],m={name:"AddIntegralShopRule",data(){return{dialogVisible:!1,formData:{ruleName:"",money:"",amount:"",shopId:""},rules:{ruleName:[{required:!0,message:this.$t("integralShopRule.ruleNameRequired"),trigger:"blur"},{max:128,message:this.$t("integralShopRule.ruleNameMaxLength"),trigger:"blur"}],money:[{required:!0,message:this.$t("integralShopRule.moneyRequired"),trigger:"blur"},{max:30,message:this.$t("integralShopRule.moneyMaxLength"),trigger:"blur"}],amount:[{required:!0,message:this.$t("integralShopRule.amountRequired"),trigger:"blur"},{max:30,message:this.$t("integralShopRule.amountMaxLength"),trigger:"blur"}]}}},methods:{open(){this.dialogVisible=!0,this.resetForm()},closeDialog(){this.dialogVisible=!1},resetForm(){this.formData={ruleName:"",money:"",amount:"",shopId:Object(h["f"])()},this.$refs.form&&this.$refs.form.resetFields()},submitForm(){this.$refs.form.validate(async e=>{if(e)try{await i(this.formData),this.$message.success(this.$t("integralShopRule.saveSuccess")),this.closeDialog(),this.$emit("refresh")}catch(t){console.error("保存积分规则失败:",t)}})}}},g=m,d=l("2877"),f=Object(d["a"])(g,c,p,!1,null,null,null),S=f.exports,R=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("integralShopRule.edit"),visible:e.dialogVisible,width:"50%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("integralShopRule.ruleName"),prop:"ruleName"}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.ruleNamePlaceholder")},model:{value:e.formData.ruleName,callback:function(t){e.$set(e.formData,"ruleName",t)},expression:"formData.ruleName"}})],1),t("el-form-item",{attrs:{label:e.$t("integralShopRule.money"),prop:"money"}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.moneyPlaceholder")},model:{value:e.formData.money,callback:function(t){e.$set(e.formData,"money",t)},expression:"formData.money"}})],1),t("el-form-item",{attrs:{label:e.$t("integralShopRule.amount"),prop:"amount"}},[t("el-input",{attrs:{placeholder:e.$t("integralShopRule.amountPlaceholder")},model:{value:e.formData.amount,callback:function(t){e.$set(e.formData,"amount",t)},expression:"formData.amount"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("common.save")))])],1)],1)},b=[],$={name:"EditIntegralShopRule",data(){return{dialogVisible:!1,formData:{ruleId:"",ruleName:"",money:"",amount:"",shopId:""},rules:{ruleName:[{required:!0,message:this.$t("integralShopRule.ruleNameRequired"),trigger:"blur"},{max:128,message:this.$t("integralShopRule.ruleNameMaxLength"),trigger:"blur"}],money:[{required:!0,message:this.$t("integralShopRule.moneyRequired"),trigger:"blur"},{max:30,message:this.$t("integralShopRule.moneyMaxLength"),trigger:"blur"}],amount:[{required:!0,message:this.$t("integralShopRule.amountRequired"),trigger:"blur"},{max:30,message:this.$t("integralShopRule.amountMaxLength"),trigger:"blur"}],ruleId:[{required:!0,message:this.$t("integralShopRule.idRequired"),trigger:"blur"}]}}},methods:{open(e){this.dialogVisible=!0,this.formData={...e,shopId:Object(h["f"])()}},closeDialog(){this.dialogVisible=!1},submitForm(){this.$refs.form.validate(async e=>{if(e)try{await s(this.formData),this.$message.success(this.$t("integralShopRule.updateSuccess")),this.closeDialog(),this.$emit("refresh")}catch(t){console.error("更新积分规则失败:",t)}})}}},I=$,y=Object(d["a"])(I,R,b,!1,null,null,null),_=y.exports,D=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("integralShopRule.confirmOperation"),visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("div",{staticStyle:{"text-align":"center"}},[t("p",[e._v(e._s(e.$t("integralShopRule.confirmDeleteRule")))])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("integralShopRule.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.confirmDelete}},[e._v(e._s(e.$t("integralShopRule.confirmDelete")))])],1)])},v=[],x={name:"DeleteIntegralShopRule",data(){return{dialogVisible:!1,deleteData:{ruleId:"",shopId:""}}},methods:{open(e){this.dialogVisible=!0,this.deleteData={ruleId:e.ruleId,shopId:Object(h["f"])()}},closeDialog(){this.dialogVisible=!1},async confirmDelete(){try{await u(this.deleteData),this.$message.success(this.$t("integralShopRule.deleteSuccess")),this.closeDialog(),this.$emit("refresh")}catch(e){console.error("删除积分规则失败:",e)}}}},w=x,N=Object(d["a"])(w,D,v,!1,null,null,null),k=N.exports,q={name:"IntegralShopRule",components:{AddIntegralShopRule:S,EditIntegralShopRule:_,DeleteIntegralShopRule:k},data(){return{integralShopRuleInfo:{integralShopRules:[],total:0,records:1,moreCondition:!1,conditions:{ruleName:"",shopId:"",money:"",page:1,row:10}}}},created(){this._listIntegralShopRules(1,10)},methods:{async _listIntegralShopRules(e,t){this.integralShopRuleInfo.conditions.page=e,this.integralShopRuleInfo.conditions.row=t;let l=await Object(h["f"])();this.integralShopRuleInfo.conditions.shopId=l;try{const e=await n(this.integralShopRuleInfo.conditions);this.integralShopRuleInfo.integralShopRules=e.data,this.integralShopRuleInfo.total=e.total,this.integralShopRuleInfo.records=e.records}catch(a){console.error("获取积分规则列表失败:",a)}},_openAddIntegralShopRuleModal(){this.$refs.addIntegralShopRule.open()},_openEditIntegralShopRuleModel(e){this.$refs.editIntegralShopRule.open(e)},_openDeleteIntegralShopRuleModel(e){this.$refs.deleteIntegralShopRule.open(e)},_queryIntegralShopRuleMethod(){this._listIntegralShopRules(1,10)},handleCurrentChange(e){this._listIntegralShopRules(e,this.integralShopRuleInfo.conditions.row)}}},M=q,V=(l("b523"),Object(d["a"])(M,a,o,!1,null,"93cf2f5c",null));t["default"]=V.exports}}]);
|
|
//# sourceMappingURL=chunk-510b3d89.649109a7.js.map
|