wangfukang 3 days ago
parent
commit
c5ae97f16c
  1. 12
      src/api/app.js
  2. 8
      src/api/index.js
  3. 52
      src/views/app/business/logistics/logistics.vue
  4. 168
      src/views/app/shop/shop.vue

12
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)

8
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)

52
src/views/app/business/logistics/logistics.vue

@ -153,6 +153,20 @@
<Button type="primary" :loading="deliverySwitchLoading" @click="saveDeliverySwitch">保存</Button>
</FormItem>
</Form>
<Form v-if="isTargetTransferRegion" ref="transferDeliverySwitchForm" :model="transferDeliverySwitchForm" :label-width="130" style="width: 520px;">
<FormItem label="中转配送设置">
<i-switch v-model="transferDeliverySwitchForm.transferDeliveryEnabled" size="large" :true-value="1" :false-value="0">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
<div style="color: #999; font-size: 12px; line-height: 22px; margin-top: 8px;">
开启后,用户可以选择送到宿舍,由中转配送完成;关闭后,只能选择送到大门。
</div>
</FormItem>
<FormItem>
<Button type="primary" :loading="transferDeliverySwitchLoading" @click="saveTransferDeliverySwitch">保存</Button>
</FormItem>
</Form>
</div>
<Row v-if="isOrderTab" v-show="openSearch">
<Form ref="searchForm" :model="activeSearchForm" inline :label-width="90" autocomplete="off"
@ -284,12 +298,15 @@
saveBaseDeliveryFeeSetting as saveBaseDeliveryFeeSettingApi,
getShopAreaDeliverySwitch,
saveShopAreaDeliverySwitch,
getShopAreaTransferDeliverySwitch,
saveShopAreaTransferDeliverySwitch,
} from "@/api/index";
import addEdit from "./addEdit.vue";
import logisticsAddress from "@/views/app/business/logistics/logisticsAddress";
import shopAreaTreeChoose from "@/views/my-components/hiver/shopArea-tree-choose";
import { SEARCH_HISTORY_KEYS, getSearchHistory, saveSearchHistory } from "@/libs/searchHistory";
const TARGET_TRANSFER_DELIVERY_REGION_ID = "2110300467664916480";
const HALL_TYPE_MAP = {
waimai: 1,
kuaidi: 2,
@ -335,6 +352,7 @@
customerServiceLoading: false,
baseDeliveryFeeLoading: false,
deliverySwitchLoading: false,
transferDeliverySwitchLoading: false,
transferOrder: false,
workerOrderVisible: false,
workerOrderTab: "daiqu",
@ -396,6 +414,10 @@
regionId: regionId,
deliveryEnabled: 1
},
transferDeliverySwitchForm: {
regionId: regionId,
transferDeliveryEnabled: 1
},
workerOrderForm: {
pageNum: 1,
pageSize: 10
@ -453,6 +475,9 @@
deliveryTotalCount() {
return this.toNumber(this.deliveryCounts.daiqu) + this.toNumber(this.deliveryCounts.daisong);
},
isTargetTransferRegion() {
return String(this.currentRegionId) === TARGET_TRANSFER_DELIVERY_REGION_ID;
},
workerOrderTitle() {
const name = this.selectedWorker.workerName || "配送员";
const phone = this.selectedWorker.workerPhone ? "(" + this.selectedWorker.workerPhone + ")" : "";
@ -470,6 +495,7 @@
this.getCustomerServiceSetting();
this.getBaseDeliveryFeeSetting();
this.getDeliverySwitch();
this.getTransferDeliverySwitch();
},
loadSearchHistory() {
this.searchHistory.shopName = getSearchHistory(SEARCH_HISTORY_KEYS.shopName);
@ -499,6 +525,7 @@
this.getBaseDeliveryFeeSetting();
} else if (this.tabName === "deliverySwitch") {
this.getDeliverySwitch();
this.getTransferDeliverySwitch();
}
},
buildWorkerColumns() {
@ -695,6 +722,7 @@
}
if (v === "deliverySwitch") {
this.getDeliverySwitch();
this.getTransferDeliverySwitch();
return;
}
this.total = 0;
@ -1221,6 +1249,30 @@
this.deliverySwitchLoading = false;
});
},
getTransferDeliverySwitch() {
if (!this.isTargetTransferRegion) return;
getShopAreaTransferDeliverySwitch({
regionId: this.transferDeliverySwitchForm.regionId
}).then((res) => {
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("请选择配送员");

168
src/views/app/shop/shop.vue

@ -104,6 +104,33 @@
<check-password ref="checkPass" @on-success="resetPass" />
<withdraw-record-modal ref="withdrawRecordModal" :table-size="tableSize" />
<Modal :title="gateLocationTitle" v-model="gateLocationVisible" :mask-closable="false" :width="640">
<div style="display: flex; margin-bottom: 16px;">
<Input v-model="gateLocationName" clearable placeholder="请输入送达地点" style="width: 360px"
@on-enter="saveGateLocation" />
<Button type="primary" style="margin-left: 8px" :loading="gateLocationSaving" @click="saveGateLocation">新增</Button>
</div>
<div v-if="gateLocationLoading" style="padding: 24px 0; text-align: center; color: #999;">加载中</div>
<div v-else-if="!gateLocationList.length" style="padding: 24px 0; text-align: center; color: #999;">暂无送达地点</div>
<div v-else>
<div v-for="item in gateLocationList" :key="item.id"
style="display: flex; align-items: center; margin-bottom: 10px;">
<Input v-if="gateLocationEditingId === item.id" v-model="gateLocationEditingName" style="flex: 1;" />
<span v-else style="flex: 1;">{{ item.locationName }}</span>
<Button v-if="gateLocationEditingId === item.id" type="primary" size="small" style="margin-left: 8px"
:loading="gateLocationSaving" @click="confirmEditGateLocation(item)">保存</Button>
<Button v-if="gateLocationEditingId === item.id" size="small" style="margin-left: 8px"
@click="cancelEditGateLocation">取消</Button>
<Button v-if="gateLocationEditingId !== item.id" size="small" style="margin-left: 8px"
@click="startEditGateLocation(item)">编辑</Button>
<Button v-if="gateLocationEditingId !== item.id" type="error" size="small" style="margin-left: 8px"
@click="removeGateLocation(item)">删除</Button>
</div>
</div>
<div slot="footer">
<Button type="text" @click="gateLocationVisible = false">关闭</Button>
</div>
</Modal>
<addEdit :data="form" :type="showType" v-model="showUser" @on-submit="getDataList" />
<mernage :data="form" ref="dialog" :type="showTypeMe" v-model="showmernage" @on-submit="getDataList" />
@ -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() {

Loading…
Cancel
Save