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

2 lines
16 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c1305c78"],{"020c":function(e,t,o){},"67f8":function(e,t,o){"use strict";o("b07a")},"7df1":function(e,t,o){"use strict";o.r(t);var r=function(){var e=this,t=e._self._c;return t("div",[t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("merchantShop.queryCondition")))])]),t("div",{staticClass:"filter-container"},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputShopCode"),clearable:""},model:{value:e.merchantShopInfo.conditions.shopId,callback:function(t){e.$set(e.merchantShopInfo.conditions,"shopId",t)},expression:"merchantShopInfo.conditions.shopId"}})],1),t("el-col",{attrs:{span:6}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputShopName"),clearable:""},model:{value:e.merchantShopInfo.conditions.name,callback:function(t){e.$set(e.merchantShopInfo.conditions,"name",t)},expression:"merchantShopInfo.conditions.name"}})],1),t("el-col",{attrs:{span:4}},[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e._queryShopMethod()}}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("merchantShop.query"))+" ")])],1)],1)],1)])],1)],1),t("el-row",[t("el-col",{attrs:{span:24}},[t("el-card",{staticClass:"box-card"},[t("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[t("span",[e._v(e._s(e.$t("merchantShop.merchantShop")))]),t("div",{staticStyle:{float:"right"}},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e._openAddMerchantShopModal()}}},[t("i",{staticClass:"el-icon-plus"}),e._v(" "+e._s(e.$t("merchantShop.addShop"))+" ")]),t("el-button",{attrs:{size:"small"},on:{click:e._goBack}},[e._v(" "+e._s(e.$t("merchantShop.back"))+" ")])],1)]),t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.merchantShopInfo.shops,border:""}},[t("el-table-column",{attrs:{prop:"shopLogo",label:e.$t("merchantShop.shopLogo"),align:"center",width:"120"},scopedSlots:e._u([{key:"default",fn:function(e){return[e.row.shopLogo?t("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:e.row.shopLogo}}):t("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:"/img/noPhoto.jpg"}})]}}])}),t("el-table-column",{attrs:{prop:"shopName",label:e.$t("merchantShop.shopName"),align:"center"}}),t("el-table-column",{attrs:{prop:"shopTypeName",label:e.$t("merchantShop.shopType"),align:"center"}}),t("el-table-column",{attrs:{prop:"storeName",label:e.$t("merchantShop.merchantName"),align:"center"}}),t("el-table-column",{attrs:{prop:"returnAddress",label:e.$t("merchantShop.merchantAddress"),align:"center"}}),t("el-table-column",{attrs:{prop:"returnLink",label:e.$t("merchantShop.contactNumber"),align:"center"}}),t("el-table-column",{attrs:{prop:"stateName",label:e.$t("merchantShop.shopStatus"),align:"center"}}),t("el-table-column",{attrs:{prop:"createTime",label:e.$t("merchantShop.createTime"),align:"center"}}),t("el-table-column",{attrs:{label:e.$t("merchantShop.operation"),align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(o){return[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e._openEditMerchantShopModel(o.row)}}},[e._v(" "+e._s(e.$t("merchantShop.edit"))+" ")]),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e._openDeleteMerchantShopModel(o.row)}}},[e._v(" "+e._s(e.$t("merchantShop.delete"))+" ")])]}}])})],1),t("el-pagination",{staticStyle:{"margin-top":"20px","text-align":"right"},attrs:{"current-page":e.merchantShopInfo.conditions.page,"page-size":e.merchantShopInfo.conditions.row,layout:"total, prev, pager, next",total:e.merchantShopInfo.total},on:{"current-change":e.handleCurrentChange}})],1)],1)],1),t("add-merchant-shop-info",{ref:"addMerchantShopInfo",on:{refresh:e.queryShop}}),t("edit-merchant-shop-info",{ref:"editMerchantShopInfo",on:{refresh:e.queryShop}}),t("delete-merchant-shop",{ref:"deleteMerchantShop",on:{refresh:e.queryShop}})],1)},s=[],a=o("b775");function n(e){return new Promise((t,o)=>{Object(a["a"])({url:"/shop.queryShopsByAdmin",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function h(e){return new Promise((t,o)=>{Object(a["a"])({url:"/shop.adminAddShop",method:"post",data:e}).then(e=>{const r=e.data;0===r.code?t(r):o(new Error(r.msg))}).catch(e=>{o(e)})})}function i(e){return new Promise((t,o)=>{Object(a["a"])({url:"/shop.adminUpdateShop",method:"post",data:e}).then(e=>{const r=e.data;0===r.code?t(r):o(new Error(r.msg))}).catch(e=>{o(e)})})}function l(e){return new Promise((t,o)=>{Object(a["a"])({url:"/shop.deleteShop",method:"post",data:e}).then(e=>{const r=e.data;0===r.code?t(r):o(new Error(r.msg))}).catch(e=>{o(e)})})}function c(e){return new Promise((t,o)=>{Object(a["a"])({url:"/shopType.queryShopType",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}function p(e){return new Promise((t,o)=>{Object(a["a"])({url:"/area.listAreas",method:"get",params:e}).then(e=>{const o=e.data;t(o)}).catch(e=>{o(e)})})}var d=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("merchantShop.addShop"),visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px","label-position":"right"}},[t("el-form-item",{attrs:{label:e.$t("merchantShop.shopType"),prop:"shopType"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("merchantShop.selectShopType")},model:{value:e.form.shopType,callback:function(t){e.$set(e.form,"shopType",t)},expression:"form.shopType"}},e._l(e.shopTypes,(function(e){return t("el-option",{key:e.shopTypeId,attrs:{label:e.typeName,value:e.shopTypeId}})})),1)],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.shopArea"),prop:"selectProv"}},[t("el-row",{attrs:{gutter:10}},[t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("merchantShop.selectProvince")},on:{change:e.getProv},model:{value:e.form.selectProv,callback:function(t){e.$set(e.form,"selectProv",t)},expression:"form.selectProv"}},e._l(e.provs,(function(e){return t("el-option",{key:e.areaCode,attrs:{label:e.areaName,value:e.areaCode}})})),1)],1),t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("merchantShop.selectCity"),disabled:!e.form.selectProv},on:{change:e.getCity},model:{value:e.form.selectCity,callback:function(t){e.$set(e.form,"selectCity",t)},expression:"form.selectCity"}},e._l(e.citys,(function(e){return t("el-option",{key:e.areaCode,attrs:{label:e.areaName,value:e.areaCode}})})),1)],1),t("el-col",{attrs:{span:6}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("merchantShop.selectArea"),disabled:!e.form.selectCity},on:{change:e.getArea},model:{value:e.form.selectArea,callback:function(t){e.$set(e.form,"selectArea",t)},expression:"form.selectArea"}},e._l(e.areas,(function(e){return t("el-option",{key:e.areaCode,attrs:{label:e.areaName,value:e.areaCode}})})),1)],1)],1)],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.shopName"),prop:"shopName"}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputShopName")},model:{value:e.form.shopName,callback:function(t){e.$set(e.form,"shopName",t)},expression:"form.shopName"}})],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.address"),prop:"address"}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputAddress")},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.phone"),prop:"tel"}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputPhone")},model:{value:e.form.tel,callback:function(t){e.$set(e.form,"tel",t)},expression:"form.tel"}})],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.saveMerchantShopInfo}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},m=[],u={name:"AddMerchantShopInfo",data(){return{dialogVisible:!1,form:{storeId:"",shopName:"",areaAddress:"",address:"",tel:"",areaCode:"",shopType:"",selectProv:"",selectCity:"",selectArea:""},shopTypes:[],provs:[],citys:[],areas:[],rules:{shopType:[{required:!0,message:this.$t("merchantShop.selectShopType"),trigger:"change"}],selectProv:[{required:!0,message:this.$t("merchantShop.selectProvince"),trigger:"change"}],shopName:[{required:!0,message:this.$t("merchantShop.inputShopName"),trigger:"blur"},{max:200,message:this.$t("merchantShop.shopNameMaxLength"),trigger:"blur"}],address:[{required:!0,message:this.$t("merchantShop.inputAddress"),trigger:"blur"},{max:200,message:this.$t("merchantShop.addressMaxLength"),trigger:"blur"}],tel:[{required:!0,message:this.$t("merchantShop.inputPhone"),trigger:"blur"},{pattern:/^1[3-9]\d{9}$/,message:this.$t("merchantShop.phoneFormat"),trigger:"blur"}]}}},methods:{open(e){this.dialogVisible=!0,this.form.storeId=e.storeId,this._initArea("101","0"),this._listShopTypes()},closeDialog(){this.dialogVisible=!1,this.$refs.form.resetFields(),this.form={storeId:"",shopName:"",areaAddress:"",address:"",tel:"",areaCode:"",shopType:"",selectProv:"",selectCity:"",selectArea:""}},async saveMerchantShopInfo(){this.$refs.form.validate(async e=>{if(e)try{await h(this.form),this.$emit("refresh"),this.closeDialog(),this.$message.success(this.$t("merchantShop.addSuccess"))}catch(t){console.error("添加商铺失败:",t),this.$message.error(t.message||this.$t("merchantShop.addFailed"))}})},getProv(e){this._initArea("202",e)},getCity(e){this._initArea("303",e)},getArea(e){if(this.form.areaCode=e,this.form.areaAddress="",this.provs){const e=this.provs.find(e=>e.areaCode===this.form.selectProv);e&&(this.form.areaAddress+=e.areaName)}if(this.citys){const e=this.citys.find(e=>e.areaCode===this.form.selectCity);e&&(this.form.areaAddress+=e.areaName)}if(this.areas){const e=this.areas.find(e=>e.areaCode===this.form.selectArea);e&&(this.form.areaAddress+=e.areaName)}},async _initArea(e,t){try{const o=await p({areaLevel:e,parentAreaCode:t});"101"===e?this.provs=o.data:"202"===e?this.citys=o.data:this.areas=o.data}catch(o){console.error("获取地区失败:",o),this.$message.error(this.$t("merchantShop.getAreaFailed"))}},async _listShopTypes(){try{const e=await c({page:1,row:100});this.shopTypes=e.data}catch(e){console.error("获取商铺类型失败:",e)}}}},f=u,S=o("2877"),g=Object(S["a"])(f,d,m,!1,null,null,null),b=g.exports,y=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("merchantShop.editShop"),visible:e.dialogVisible,width:"60%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px","label-position":"right"}},[t("el-form-item",{attrs:{label:e.$t("merchantShop.shopType"),prop:"shopType"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("merchantShop.selectShopType")},model:{value:e.form.shopType,callback:function(t){e.$set(e.form,"shopType",t)},expression:"form.shopType"}},e._l(e.shopTypes,(function(e){return t("el-option",{key:e.shopTypeId,attrs:{label:e.typeName,value:e.shopTypeId}})})),1)],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.shopName"),prop:"shopName"}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputShopName")},model:{value:e.form.shopName,callback:function(t){e.$set(e.form,"shopName",t)},expression:"form.shopName"}})],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.address"),prop:"returnAddress"}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputAddress")},model:{value:e.form.returnAddress,callback:function(t){e.$set(e.form,"returnAddress",t)},expression:"form.returnAddress"}})],1),t("el-form-item",{attrs:{label:e.$t("merchantShop.phone"),prop:"returnLink"}},[t("el-input",{attrs:{placeholder:e.$t("merchantShop.inputPhone")},model:{value:e.form.returnLink,callback:function(t){e.$set(e.form,"returnLink",t)},expression:"form.returnLink"}})],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._editMerchantShopInfo}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},$=[],v={name:"EditMerchantShopInfo",data(){return{dialogVisible:!1,form:{storeId:"",shopId:"",shopName:"",returnAddress:"",returnLink:"",shopType:""},shopTypes:[],rules:{shopType:[{required:!0,message:this.$t("merchantShop.selectShopType"),trigger:"change"}],shopName:[{required:!0,message:this.$t("merchantShop.inputShopName"),trigger:"blur"},{max:200,message:this.$t("merchantShop.shopNameMaxLength"),trigger:"blur"}],returnAddress:[{required:!0,message:this.$t("merchantShop.inputAddress"),trigger:"blur"}],returnLink:[{required:!0,message:this.$t("merchantShop.inputPhone"),trigger:"blur"}]}}},methods:{open(e){this.dialogVisible=!0,Object.assign(this.form,e),this._listShopTypes()},closeDialog(){this.dialogVisible=!1,this.$refs.form.resetFields(),this.form={storeId:"",shopId:"",shopName:"",returnAddress:"",returnLink:"",shopType:""}},async _editMerchantShopInfo(){this.$refs.form.validate(async e=>{if(e)try{await i(this.form),this.$emit("refresh"),this.closeDialog(),this.$message.success(this.$t("merchantShop.editSuccess"))}catch(t){console.error("修改商铺失败:",t),this.$message.error(t.message||this.$t("merchantShop.editFailed"))}})},async _listShopTypes(){try{const e=await c({page:1,row:100});this.shopTypes=e.data}catch(e){console.error("获取商铺类型失败:",e)}}}},_=v,I=Object(S["a"])(_,y,$,!1,null,null,null),w=I.exports,k=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("merchantShop.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("merchantShop.confirmDeleteShop")))])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("merchantShop.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.deleteMerchantShop}},[e._v(" "+e._s(e.$t("merchantShop.confirmDelete"))+" ")])],1)])},A=[],x={name:"DeleteMerchantShop",data(){return{dialogVisible:!1,shopInfo:{}}},methods:{open(e){this.dialogVisible=!0,this.shopInfo=e},closeDialog(){this.dialogVisible=!1,this.shopInfo={}},async deleteMerchantShop(){try{await l(this.shopInfo),this.$emit("refresh"),this.closeDialog(),this.$message.success(this.$t("merchantShop.deleteSuccess"))}catch(e){console.error("删除商铺失败:",e),this.$message.error(e.message||this.$t("merchantShop.deleteFailed"))}}}},C=x,T=(o("67f8"),Object(S["a"])(C,k,A,!1,null,"426aeca2",null)),N=T.exports,M={name:"MerchantShop",components:{AddMerchantShopInfo:b,EditMerchantShopInfo:w,DeleteMerchantShop:N},data(){return{merchantShopInfo:{shops:[],total:0,records:1,conditions:{name:"",merchantId:"",shopId:"",page:1,row:10}}}},created(){this.merchantShopInfo.conditions.merchantId=this.$route.query.storeId,this._listShops(this.merchantShopInfo.conditions.page,this.merchantShopInfo.conditions.row),console.log(this.merchantShopInfo.records)},methods:{handleCurrentChange(e){this._listShops(e,this.merchantShopInfo.conditions.row)},queryShop(){this._listShops(1,this.merchantShopInfo.conditions.row)},async _listShops(e,t){this.merchantShopInfo.conditions.page=e,this.merchantShopInfo.conditions.row=t;try{const e=await n(this.merchantShopInfo.conditions);this.merchantShopInfo.total=e.total,this.merchantShopInfo.records=e.records,this.merchantShopInfo.shops=e.data}catch(o){console.error("获取商铺列表失败:",o)}},_openAddMerchantShopModal(){this.$refs.addMerchantShopInfo.open({storeId:this.$route.query.storeId})},_openEditMerchantShopModel(e){this.$refs.editMerchantShopInfo.open(e)},_openDeleteMerchantShopModel(e){this.$refs.deleteMerchantShop.open(e)},_queryShopMethod(){this._listShops(1,this.merchantShopInfo.conditions.row)},_goBack(){this.$router.back()}}},P=M,q=(o("a8a6"),Object(S["a"])(P,r,s,!1,null,"01aef0e4",null));t["default"]=q.exports},a8a6:function(e,t,o){"use strict";o("020c")},b07a:function(e,t,o){}}]);
//# sourceMappingURL=chunk-c1305c78.5e0f85ab.js.map