Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-876866c2.8cbbe298.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
16 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-876866c2"],{"442a":function(e,t,r){},"8ab3":function(e,t,r){"use strict";r("ebf9")},c7a8:function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e._self._c;return t("div",[t("el-card",{staticClass:"ibox"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("div",[e._v(e._s(e.$t("partnerPool.queryCondition")))])]),t("div",{},[t("el-form",{staticClass:"flex justify-start",attrs:{inline:!0,model:e.partnerPoolInfo.conditions}},[t("el-form-item",[t("el-input",{attrs:{placeholder:e.$t("partnerPool.selectName"),clearable:""},model:{value:e.partnerPoolInfo.conditions.partnerName,callback:function(t){e.$set(e.partnerPoolInfo.conditions,"partnerName",t)},expression:"partnerPoolInfo.conditions.partnerName"}})],1),t("el-form-item",[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("partnerPool.selectPartner")},model:{value:e.partnerPoolInfo.conditions.partnerType,callback:function(t){e.$set(e.partnerPoolInfo.conditions,"partnerType",t)},expression:"partnerPoolInfo.conditions.partnerType"}},e._l(e.partnerPoolInfo.partnerTypes,(function(e,r){return t("el-option",{key:r,attrs:{label:e.name,value:e.partnerType}})})),1)],1),t("el-form-item",[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("partnerPool.selectStatus")},model:{value:e.partnerPoolInfo.conditions.state,callback:function(t){e.$set(e.partnerPoolInfo.conditions,"state",t)},expression:"partnerPoolInfo.conditions.state"}},[t("el-option",{attrs:{label:e.$t("partnerPool.enable"),value:"Y"}}),t("el-option",{attrs:{label:e.$t("partnerPool.disable"),value:"N"}})],1)],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._queryPartnerPoolMethod()}}},[t("i",{staticClass:"el-icon-search"}),t("span",[e._v(e._s(e.$t("partnerPool.query")))])])],1)],1)],1)]),t("el-card",{staticClass:"margin-top-sm"},[t("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[t("div",[e._v(e._s(e.$t("partnerPool.partner")))]),t("div",{},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openAddPartnerPoolModal()}}},[e._v(" "+e._s(e.$t("partnerPool.add"))+" ")])],1)]),t("div",{},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.partnerPoolInfo.partnerPools,border:""}},[t("el-table-column",{attrs:{prop:"partnerName",label:e.$t("partnerPool.name"),align:"center"}}),t("el-table-column",{attrs:{prop:"partnerTypeName",label:e.$t("partnerPool.partner"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("partnerPool.status"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s("Y"==t.row.state?e.$t("partnerPool.enable"):e.$t("partnerPool.disable"))+" ")]}}])}),t("el-table-column",{attrs:{prop:"createTime",label:e.$t("partnerPool.createTime"),align:"center"}}),t("el-table-column",{attrs:{prop:"remark",label:e.$t("partnerPool.usage"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("partnerPool.operation"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openEditPartnerPoolModel(r.row)}}},[e._v(" "+e._s(e.$t("partnerPool.edit"))+" ")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openDeletePartnerPoolModel(r.row)}}},[e._v(" "+e._s(e.$t("partnerPool.delete"))+" ")])]}}])})],1),t("el-pagination",{attrs:{"current-page":e.partnerPoolInfo.conditions.page,"page-size":e.partnerPoolInfo.conditions.row,layout:"total, prev, pager, next",total:e.partnerPoolInfo.total},on:{"current-change":e.handleCurrentChange}})],1)]),t("add-partner-pool",{ref:"addPartnerPool",on:{refresh:e._queryPartnerPoolMethod}}),t("edit-partner-pool",{ref:"editPartnerPool",on:{refresh:e._queryPartnerPoolMethod}}),t("delete-partner-pool",{ref:"deletePartnerPool",on:{refresh:e._queryPartnerPoolMethod}})],1)},a=[],n=r("b775"),l=r("7323");function s(e){return new Promise((t,r)=>{Object(n["a"])({url:"/partner.listPartnerPool",method:"get",params:{...e,shopId:Object(l["f"])()}}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function i(e){return new Promise((t,r)=>{Object(n["a"])({url:"/partner.listPartnerAdapt",method:"get",params:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function d(e){return new Promise((t,r)=>{Object(n["a"])({url:"/partner.listPartnerKey",method:"get",params:e}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function p(e){return new Promise((t,r)=>{Object(n["a"])({url:"/partner.savePartnerPool",method:"post",data:{...e,shopId:Object(l["f"])()}}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function c(e){return new Promise((t,r)=>{Object(n["a"])({url:"/partner.updatePartnerPool",method:"post",data:{...e,shopId:Object(l["f"])()}}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}function P(e){return new Promise((t,r)=>{Object(n["a"])({url:"/partner.deletePartnerPool",method:"post",data:{...e,shopId:Object(l["f"])()}}).then(e=>{const r=e.data;t(r)}).catch(e=>{r(e)})})}var f=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("partnerPool.add"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("partnerPool.name"),required:""}},[t("el-input",{attrs:{placeholder:e.$t("partnerPool.requiredName")},model:{value:e.addPartnerPoolInfo.partnerName,callback:function(t){e.$set(e.addPartnerPoolInfo,"partnerName",t)},expression:"addPartnerPoolInfo.partnerName"}})],1),t("el-form-item",{attrs:{label:e.$t("partnerPool.partner"),required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("partnerPool.requiredPartner")},on:{change:e._addChangeToType},model:{value:e.addPartnerPoolInfo.partnerType,callback:function(t){e.$set(e.addPartnerPoolInfo,"partnerType",t)},expression:"addPartnerPoolInfo.partnerType"}},e._l(e.addPartnerPoolInfo.partnerTypes,(function(e,r){return t("el-option",{key:r,attrs:{label:e.name,value:e.partnerType}})})),1)],1),e._l(e.addPartnerPoolInfo.partnerKeys,(function(r,o){return t("el-form-item",{key:o,attrs:{label:r.name}},[t("el-input",{attrs:{type:"textarea",placeholder:r.remark},model:{value:r.columnValue,callback:function(t){e.$set(r,"columnValue",t)},expression:"item.columnValue"}})],1)})),t("el-form-item",{attrs:{label:e.$t("partnerPool.usage")}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("partnerPool.optionalUsage")},model:{value:e.addPartnerPoolInfo.remark,callback:function(t){e.$set(e.addPartnerPoolInfo,"remark",t)},expression:"addPartnerPoolInfo.remark"}})],1)],2),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.savePartnerPoolInfo}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},u=[],h={name:"AddPartnerPool",data(){return{dialogVisible:!1,addPartnerPoolInfo:{partnerName:"",partnerType:"",state:"Y",remark:"",partnerTypes:[],partnerKeys:[]}}},methods:{open(){this._loadAddPartnerAdapt(),this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1,this.clearAddPartnerPoolInfo()},async savePartnerPoolInfo(){if(this.addPartnerPoolValidate()){this.addPartnerPoolInfo.shopId=Object(l["f"])();try{const e=await p(this.addPartnerPoolInfo);0===e.code?(this.$message.success(this.$t("partnerPool.saveSuccess")),this.closeDialog(),this.$emit("refresh")):this.$message.error(e.msg)}catch(e){this.$message.error(this.$t("partnerPool.saveFailed"))}}else this.$message.error(this.$t("partnerPool.validateError"))},clearAddPartnerPoolInfo(){const e=this.addPartnerPoolInfo.partnerTypes;this.addPartnerPoolInfo={partnerName:"",partnerType:"",partnerTypes:e,partnerKeys:[],state:"Y",remark:""}},addPartnerPoolValidate(){return!!this.addPartnerPoolInfo.partnerName&&!!this.addPartnerPoolInfo.partnerType},async _addChangeToType(){if(this.addPartnerPoolInfo.partnerType)try{const e=await d({partnerType:this.addPartnerPoolInfo.partnerType,page:1,row:100});this.addPartnerPoolInfo.partnerKeys=e.data.map(e=>({...e,columnValue:""}))}catch(e){console.error("请求失败处理",e)}},async _loadAddPartnerAdapt(){try{const e=await i({page:1,row:100});this.addPartnerPoolInfo.partnerTypes=e.data}catch(e){console.error("请求失败处理",e)}}}},m=h,b=r("2877"),y=Object(b["a"])(m,f,u,!1,null,null,null),I=y.exports,g=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("partnerPool.edit"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{attrs:{"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("partnerPool.name"),required:""}},[t("el-input",{attrs:{placeholder:e.$t("partnerPool.requiredName")},model:{value:e.editPartnerPoolInfo.partnerName,callback:function(t){e.$set(e.editPartnerPoolInfo,"partnerName",t)},expression:"editPartnerPoolInfo.partnerName"}})],1),t("el-form-item",{attrs:{label:e.$t("partnerPool.partner"),required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("partnerPool.requiredPartner"),disabled:""},model:{value:e.editPartnerPoolInfo.partnerType,callback:function(t){e.$set(e.editPartnerPoolInfo,"partnerType",t)},expression:"editPartnerPoolInfo.partnerType"}},e._l(e.editPartnerPoolInfo.partnerTypes,(function(e,r){return t("el-option",{key:r,attrs:{label:e.name,value:e.partnerType}})})),1)],1),e._l(e.editPartnerPoolInfo.partnerKeys,(function(r,o){return t("el-form-item",{key:o,attrs:{label:r.name}},[t("el-input",{attrs:{type:"textarea",placeholder:r.remark},model:{value:r.columnValue,callback:function(t){e.$set(r,"columnValue",t)},expression:"item.columnValue"}})],1)})),t("el-form-item",{attrs:{label:e.$t("partnerPool.status"),required:""}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("partnerPool.requiredStatus")},model:{value:e.editPartnerPoolInfo.state,callback:function(t){e.$set(e.editPartnerPoolInfo,"state",t)},expression:"editPartnerPoolInfo.state"}},[t("el-option",{attrs:{label:e.$t("partnerPool.enable"),value:"Y"}}),t("el-option",{attrs:{label:e.$t("partnerPool.disable"),value:"N"}})],1)],1),t("el-form-item",{attrs:{label:e.$t("partnerPool.usage")}},[t("el-input",{attrs:{type:"textarea",placeholder:e.$t("partnerPool.optionalUsage")},model:{value:e.editPartnerPoolInfo.remark,callback:function(t){e.$set(e.editPartnerPoolInfo,"remark",t)},expression:"editPartnerPoolInfo.remark"}})],1)],2),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.editPartnerPool}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},$=[],_={name:"EditPartnerPool",data(){return{dialogVisible:!1,editPartnerPoolInfo:{ppId:"",partnerName:"",partnerType:"",state:"",remark:"",partnerTypes:[],partnerKeys:[],configIds:[]}}},methods:{open(e){this.refreshEditPartnerPoolInfo(),Object.assign(this.editPartnerPoolInfo,e),this._loadEditPartnerAdapt(),this._editChangeToType(),this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1,this.refreshEditPartnerPoolInfo()},async editPartnerPool(){if(this.editPartnerPoolValidate()){this.editPartnerPoolInfo.shopId=Object(l["f"])();try{const e=await c(this.editPartnerPoolInfo);0===e.code?(this.$message.success(this.$t("partnerPool.saveSuccess")),this.closeDialog(),this.$emit("refresh")):this.$message.error(e.msg)}catch(e){this.$message.error(this.$t("partnerPool.saveFailed"))}}else this.$message.error(this.$t("partnerPool.validateError"))},refreshEditPartnerPoolInfo(){const e=this.editPartnerPoolInfo.partnerTypes;console.log(e),this.editPartnerPoolInfo={ppId:"",partnerName:"",partnerType:"",partnerTypes:e,state:"",remark:"",partnerKeys:[],configIds:[]}},editPartnerPoolValidate(){return!!this.editPartnerPoolInfo.partnerName&&(!!this.editPartnerPoolInfo.partnerType&&(!!this.editPartnerPoolInfo.state&&!!this.editPartnerPoolInfo.ppId))},async _editChangeToType(){if(this.editPartnerPoolInfo.partnerType)try{const e=await d({partnerType:this.editPartnerPoolInfo.partnerType,page:1,row:100});this.editPartnerPoolInfo.partnerKeys=e.data.map(e=>({...e,columnValue:""})),await this._editLoadPartnerData()}catch(e){console.error("请求失败处理",e)}},async _loadEditPartnerAdapt(){try{const e=await i({page:1,row:100});this.editPartnerPoolInfo.partnerTypes=e.data}catch(e){console.error("请求失败处理",e)}},async _editLoadPartnerData(){try{const e=await s({page:1,row:1,shopId:Object(l["f"])(),ppId:this.editPartnerPoolInfo.ppId}),t=e.data[0].values;t.forEach(e=>{this.editPartnerPoolInfo.partnerKeys.forEach(t=>{e.columnKey===t.columnKey&&(t.columnValue=e.columnValue)})});const r=e.data[0].configs||[];this.editPartnerPoolInfo.configIds=r.map(e=>e.configId)}catch(e){console.error("请求失败处理",e)}}}},v=_,T=Object(b["a"])(v,g,$,!1,null,null,null),w=T.exports,k=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("partnerPool.confirmOperation"),visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("div",{staticClass:"text-center"},[t("p",[e._v(e._s(e.$t("partnerPool.confirmDelete")))])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("partnerPool.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.deletePartnerPool}},[e._v(" "+e._s(e.$t("partnerPool.confirmDeleteBtn"))+" ")])],1)])},x=[],V={name:"DeletePartnerPool",data(){return{dialogVisible:!1,deletePartnerPoolInfo:{}}},methods:{open(e){this.deletePartnerPoolInfo={...e},this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1,this.deletePartnerPoolInfo={}},async deletePartnerPool(){this.deletePartnerPoolInfo.shopId=Object(l["f"])();try{const e=await P(this.deletePartnerPoolInfo);0===e.code?(this.$message.success(this.$t("partnerPool.deleteSuccess")),this.closeDialog(),this.$emit("refresh")):this.$message.error(e.msg)}catch(e){this.$message.error(this.$t("partnerPool.deleteFailed"))}}}},D=V,A=(r("fb34"),Object(b["a"])(D,k,x,!1,null,"c9ebc1de",null)),O=A.exports,j={name:"PartnerPool",components:{AddPartnerPool:I,EditPartnerPool:w,DeletePartnerPool:O},data(){return{DEFAULT_PAGE:1,DEFAULT_ROWS:10,partnerPoolInfo:{partnerPools:[],partnerTypes:[],total:0,records:1,moreCondition:!1,ppId:"",conditions:{partnerName:"",partnerType:"",state:"",page:1,row:10,shopId:""}}}},created(){this._loadListPaymentAdapt(),this._listPartnerPools(this.DEFAULT_PAGE,this.DEFAULT_ROWS)},methods:{handleCurrentChange(e){this._listPartnerPools(e,this.DEFAULT_ROWS)},async _listPartnerPools(e,t){this.partnerPoolInfo.conditions.page=e,this.partnerPoolInfo.conditions.row=t,this.partnerPoolInfo.conditions.shopId=Object(l["f"])();try{const e=await s(this.partnerPoolInfo.conditions);this.partnerPoolInfo.total=e.total,this.partnerPoolInfo.records=e.records,this.partnerPoolInfo.partnerPools=e.data}catch(r){console.error("请求失败处理",r)}},_openAddPartnerPoolModal(){this.$refs.addPartnerPool.open()},_openEditPartnerPoolModel(e){this.$refs.editPartnerPool.open(e)},_openDeletePartnerPoolModel(e){this.$refs.deletePartnerPool.open(e)},_queryPartnerPoolMethod(){this._listPartnerPools(this.DEFAULT_PAGE,this.DEFAULT_ROWS)},async _loadListPaymentAdapt(){try{const e=await i({page:1,row:100});this.partnerPoolInfo.partnerTypes=e.data}catch(e){console.error("请求失败处理",e)}}}},E=j,N=(r("8ab3"),Object(b["a"])(E,o,a,!1,null,"fdb0b206",null));t["default"]=N.exports},ebf9:function(e,t,r){},fb34:function(e,t,r){"use strict";r("442a")}}]);
//# sourceMappingURL=chunk-876866c2.8cbbe298.js.map