From c5ae97f16c4ae05609e551faabd65424c171fa57 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Thu, 12 Nov 2026 11:37:55 +0800 Subject: [PATCH] 1 --- src/api/app.js | 12 ++ src/api/index.js | 8 + .../app/business/logistics/logistics.vue | 52 ++++++ src/views/app/shop/shop.vue | 168 +++++++++++++++++- 4 files changed, 237 insertions(+), 3 deletions(-) diff --git a/src/api/app.js b/src/api/app.js index c361718..87498dd 100644 --- a/src/api/app.js +++ b/src/api/app.js @@ -499,6 +499,18 @@ export const findShopWorkerByMobile = (params) => { return getRequest('/app/shop/findWorkerByMobile', params) } +export const getShopGateLocationList = (params) => { + return getRequest('/app/shop/gateLocation/list', params) +} + +export const saveShopGateLocation = (params) => { + return postRequest('/app/shop/gateLocation/save', params) +} + +export const deleteShopGateLocation = (params) => { + return postRequest('/app/shop/gateLocation/delete', params) +} + //删除评论 export const deleteComment = (params) => { return postRequest('/app/comment/deleteByOrderId', params) diff --git a/src/api/index.js b/src/api/index.js index 13e957c..cdd1818 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -863,6 +863,14 @@ export const getShopAreaDeliverySwitch = (params) => { export const saveShopAreaDeliverySwitch = (params) => { return postRequest('/app/shopArea/deliverySwitch/update', params) } +// 查询指定校区中转配送开关 +export const getShopAreaTransferDeliverySwitch = (params) => { + return getRequest('/app/shopArea/transferDeliverySwitch/get', params) +} +// 保存指定校区中转配送开关 +export const saveShopAreaTransferDeliverySwitch = (params) => { + return postRequest('/app/shopArea/transferDeliverySwitch/update', params) +} // 查询i/e审核管理配置 export const getIeAuditSetting = (params) => { return getRequest('/app/ie/admin/audit-setting', params) diff --git a/src/views/app/business/logistics/logistics.vue b/src/views/app/business/logistics/logistics.vue index 82ef5a6..c18c9eb 100644 --- a/src/views/app/business/logistics/logistics.vue +++ b/src/views/app/business/logistics/logistics.vue @@ -153,6 +153,20 @@ +
+ + + 开启 + 关闭 + +
+ 开启后,用户可以选择送到宿舍,由中转配送完成;关闭后,只能选择送到大门。 +
+
+ + + +
{ + if (res.success) { + this.transferDeliverySwitchForm.transferDeliveryEnabled = res.result == null ? 1 : Number(res.result); + } + }); + }, + saveTransferDeliverySwitch() { + if (!this.isTargetTransferRegion) return; + this.transferDeliverySwitchLoading = true; + saveShopAreaTransferDeliverySwitch({ + regionId: this.transferDeliverySwitchForm.regionId, + transferDeliveryEnabled: this.transferDeliverySwitchForm.transferDeliveryEnabled + }).then((res) => { + if (res.success) { + this.$Message.success("保存成功"); + } + }).finally(() => { + this.transferDeliverySwitchLoading = false; + }); + }, goTransferOrder(item) { if (!item || !item.workerId) { this.$Message.warning("请选择配送员"); diff --git a/src/views/app/shop/shop.vue b/src/views/app/shop/shop.vue index f7b958e..baa85ad 100644 --- a/src/views/app/shop/shop.vue +++ b/src/views/app/shop/shop.vue @@ -104,6 +104,33 @@ + +
+ + +
+
加载中
+
暂无送达地点
+
+
+ + {{ item.locationName }} + + + + +
+
+
+ +
+
@@ -139,9 +166,13 @@ disableShop, enableShop, getAllShopData, - getShopData + getShopData, + getShopGateLocationList, + saveShopGateLocation, + deleteShopGateLocation } from "@/api/app"; import { SEARCH_HISTORY_KEYS, getSearchHistory, saveSearchHistory } from "@/libs/searchHistory"; + const TARGET_GATE_LOCATION_REGION_ID = "2110300467664916480"; export default { name: "user-manage", components: { @@ -201,6 +232,15 @@ remark: "", }, form: {}, + gateLocationVisible: false, + gateLocationLoading: false, + gateLocationSaving: false, + gateLocationShopId: "", + gateLocationShopName: "", + gateLocationName: "", + gateLocationList: [], + gateLocationEditingId: "", + gateLocationEditingName: "", columns: [ { title: "排名", @@ -293,7 +333,7 @@ { title: "操作", key: "action", - width: 280, + width: String(JSON.parse(this.getStore("userInfo")).departmentId) === TARGET_GATE_LOCATION_REGION_ID ? 360 : 280, align: "center", fixed: "right", render: (h, params) => { @@ -414,7 +454,23 @@ }, "提现记录" ), - ]); + ].concat(String(this.searchForm.regionId) === TARGET_GATE_LOCATION_REGION_ID ? [ + h("Divider", { + props: { + type: "vertical", + }, + }), + h( + "a", { + on: { + click: () => { + this.openGateLocations(params.row); + }, + }, + }, + "送达地点" + ), + ] : [])); }, }, ], @@ -422,6 +478,11 @@ total: 0, }; }, + computed: { + gateLocationTitle() { + return this.gateLocationShopName ? "送达地点 - " + this.gateLocationShopName : "送达地点"; + } + }, methods: { init() { this.getDataList(); @@ -687,6 +748,107 @@ }); }, }); + }, + openGateLocations(row) { + if (String(this.searchForm.regionId) !== TARGET_GATE_LOCATION_REGION_ID) return; + this.gateLocationShopId = row.id; + this.gateLocationShopName = row.shopName || ""; + this.gateLocationName = ""; + this.gateLocationEditingId = ""; + this.gateLocationEditingName = ""; + this.gateLocationVisible = true; + this.loadGateLocations(); + }, + loadGateLocations() { + if (!this.gateLocationShopId) return; + this.gateLocationLoading = true; + getShopGateLocationList({ + shopId: this.gateLocationShopId + }).then((res) => { + if (res.success) { + this.gateLocationList = res.result || []; + } + }).finally(() => { + this.gateLocationLoading = false; + }); + }, + saveGateLocation() { + const locationName = String(this.gateLocationName || "").trim(); + if (!locationName) { + this.$Message.warning("请输入送达地点"); + return; + } + if (locationName.length > 50) { + this.$Message.warning("送达地点不能超过50个字"); + return; + } + this.gateLocationSaving = true; + saveShopGateLocation({ + shopId: this.gateLocationShopId, + locationName: locationName + }).then((res) => { + if (res.success) { + this.gateLocationName = ""; + this.$Message.success("保存成功"); + this.loadGateLocations(); + } + }).finally(() => { + this.gateLocationSaving = false; + }); + }, + startEditGateLocation(item) { + this.gateLocationEditingId = item.id; + this.gateLocationEditingName = item.locationName || ""; + }, + cancelEditGateLocation() { + this.gateLocationEditingId = ""; + this.gateLocationEditingName = ""; + }, + confirmEditGateLocation(item) { + const locationName = String(this.gateLocationEditingName || "").trim(); + if (!locationName) { + this.$Message.warning("请输入送达地点"); + return; + } + if (locationName.length > 50) { + this.$Message.warning("送达地点不能超过50个字"); + return; + } + this.gateLocationSaving = true; + saveShopGateLocation({ + id: item.id, + shopId: this.gateLocationShopId, + locationName: locationName + }).then((res) => { + if (res.success) { + this.cancelEditGateLocation(); + this.$Message.success("保存成功"); + this.loadGateLocations(); + } + }).finally(() => { + this.gateLocationSaving = false; + }); + }, + removeGateLocation(item) { + this.$Modal.confirm({ + title: "确认删除", + content: "确认删除送达地点「" + (item.locationName || "") + "」?", + loading: true, + onOk: () => { + deleteShopGateLocation({ + id: item.id + }).then((res) => { + this.$Modal.remove(); + if (res.success) { + if (this.gateLocationEditingId === item.id) { + this.cancelEditGateLocation(); + } + this.$Message.success("删除成功"); + this.loadGateLocations(); + } + }); + } + }); } }, mounted() {