diff --git a/src/api/index.js b/src/api/index.js index 6358676..6060e55 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -684,13 +684,18 @@ export const getWorkerListData = (params) => { return postBodyRequest('/worker/getByCondition', params) } +// 获取匹配配送员 +export const getMatchingWorkerListData = (params) => { + return postBodyRequest('/worker/getMatchingWorkerList', params) +} + // 创建订单 export const addWorker = (params) => { return postRequest('/worker/admin/add', params) } // 编辑订单 export const editWorker = (params) => { - return postRequest('/worker/admin/edit', params) + return postBodyRequest('/worker/admin/edit', params) } // 删除订单 @@ -717,6 +722,11 @@ export const offLineWorker = (params) => { return postRequest(`/worker/offLine`, params) } +// 查询配送员接单规则 +export const getWorkerRelaPriceByWorkerId = (params) => { + return getRequest('/app/workerRelaPrice/getByWorkerId', params) +} + // 解绑订单操作 export const unbindOrder = (id, params) => { return postRequest(`/order/unbind/order/${id}`, params) @@ -731,6 +741,10 @@ export const runshOrder = (params) => { export const getOrderDetail = (id,params) => { return getRequest(`/mall/order/detail/${id}`, params) } +// 拼团详情 +export const getGroupOrdersByOrderId = (id, params) => { + return getRequest(`/mall/order/selectAllOrderByOrderId/${id}`, params) +} // 售后订单详情 export const getReturnOrderList = (params) => { return postBodyRequest('/mall/refund/page', params) @@ -741,6 +755,10 @@ export const getReturnOrderList = (params) => { export const getOwListData = (params) => { return postBodyRequest('/mall/delivery/page', params) } +// 后台抢单大厅查询(直查数据库) +export const getAdminDeliveryHallData = (params) => { + return postBodyRequest('/mall/delivery/admin/page', params) +} // 获取订单 export const getOrderList = (params) => { return postBodyRequest('/mall/order/page', params) @@ -749,6 +767,10 @@ export const getOrderList = (params) => { export const orderScheduling = (params) => { return postBodyRequest('/mall/delivery/pagebyworker', params) } +// 后台订单调度查询(直查数据库) +export const orderSchedulingAdmin = (params) => { + return postBodyRequest('/mall/delivery/admin/pagebyworker', params) +} // 查询区域配送时长 export const getDeliveryTimeSetting = (params) => { return getRequest('/mall/admin/seckillGroup/deliveryTime/get', params) diff --git a/src/views/app/business/courier/courier.less b/src/views/app/business/courier/courier.less index e69de29..b2d1fd3 100644 --- a/src/views/app/business/courier/courier.less +++ b/src/views/app/business/courier/courier.less @@ -0,0 +1,7 @@ +.rule-info { + display: flex; + flex-wrap: wrap; + gap: 12px 24px; + margin-bottom: 16px; + line-height: 24px; +} diff --git a/src/views/app/business/courier/courier.vue b/src/views/app/business/courier/courier.vue index 44b2c52..c261b88 100644 --- a/src/views/app/business/courier/courier.vue +++ b/src/views/app/business/courier/courier.vue @@ -7,19 +7,23 @@
- + + + + - - @@ -67,12 +71,25 @@ size="small" show-total show-elevator show-sizer> - +
+ +
+ 配送员:{{ ruleInfo.workerName || '-' }} + 手机号:{{ ruleInfo.mobile || '-' }} + 是否接指派:{{ formatPushOrder(ruleInfo.getPushOrder) }} + 3楼以上额外费用:{{ ruleInfo.highFloorFee || 0 }} 元 + 送达地点:{{ formatDeliveryLocation(ruleInfo.deliveryLocation) }} +
+
+
+ +
+
@@ -85,6 +102,7 @@ deleteWorker, offLineWorker, onLineWorker, + getWorkerRelaPriceByWorkerId, } from "@/api/index"; import { shortcuts @@ -124,6 +142,8 @@ Visiable: false, importLoading: false, loadingExport: true, + ruleVisible: false, + ruleLoading: false, exportModalVisible: false, importModalVisible: false, drop: false, @@ -146,11 +166,14 @@ searchForm: { region:JSON.parse(this.getStore("user")).departmentId, workerName:'', + mobile:'', isOnLine:'', //0:下线;1:上线 getPushOrder:'', //0不接指派 1接收 pageNum: 1, pageSize: 10 }, + ruleInfo: {}, + ruleData: [], selectDate: null, options: { shortcuts: shortcuts, @@ -316,36 +339,46 @@ { title: "操作", key: "action", - width: 170, + width: 260, align: "center", fixed: "right", render: (h, params) => { let enableOrDisable = ""; - if (params.row.workerStatus == 1) { + if (params.row.workerStatus == 3) { enableOrDisable = h( "a", { on: { click: () => { - this.disable(params.row); + this.enable(params.row); }, }, }, - "禁用" + "恢复" ); } else { enableOrDisable = h( "a", { on: { click: () => { - this.enable(params.row); + this.disable(params.row); }, }, }, - "恢复" + "禁用" ); } let onOrOffLine = ""; - if (params.row.isOnLine == 1) { + if (params.row.workerStatus == 3) { + onOrOffLine = h( + "span", + { + style: { + color: "#c5c8ce", + }, + }, + "已禁用" + ); + } else if (params.row.isOnLine == 1) { onOrOffLine = h( "a", { on: { @@ -415,7 +448,7 @@ "a", { on: { click: () => { - this.remove(params.row); + this.viewWorkerRules(params.row); }, }, }, @@ -426,6 +459,45 @@ }, ], exportColumns: exportColumn, + ruleColumns: [ + { + type: "index", + width: 60, + align: "center", + }, + { + title: "接单类型", + key: "orderType", + minWidth: 100, + render: (h, params) => h("span", this.formatOrderType(params.row.orderType)), + }, + { + title: "取货区域", + key: "getAreaName", + minWidth: 160, + }, + { + title: "送货区域", + key: "putAreaName", + minWidth: 160, + }, + { + title: "配送佣金(元)", + key: "orderBkge", + minWidth: 130, + }, + { + title: "是否接指派", + key: "getPushOrder", + minWidth: 120, + render: (h, params) => h("span", this.formatPushOrder(params.row.getPushOrder)), + }, + { + title: "备注", + key: "remark", + minWidth: 180, + }, + ], chooseColumns: [], filename: "配送员数据", exportTitle: "确认导出", @@ -459,9 +531,6 @@ this.searchForm.pageSize = v; this.getDataList(); }, - checkStatusLine(v){ - this.searchForm.isOnLine = v - }, showPic(v) { let image = new Image(); image.src = v; @@ -472,9 +541,6 @@ }); viewer.show(); }, - checkStatus(v){ - this.searchForm.getPushOrder = v - }, selectDateRange(v) { if (v) { this.searchForm.startDate = v[0]; @@ -513,13 +579,12 @@ }, handleReset() { this.$refs.searchForm.resetFields(); + this.searchForm.region = JSON.parse(this.getStore("user")).departmentId; this.searchForm.pageNum = 1; this.searchForm.pageSize = 10; this.selectDate = null; this.searchForm.startDate = ""; this.searchForm.endDate = ""; - this.$refs.dep.clearSelect(); - this.searchForm.departmentId = ""; // 重新加载数据 this.getDataList(); }, @@ -579,19 +644,54 @@ this.showWorker = true; }, edit(v) { - this.$Message.warning("暂未开放");return - // 转换null为"" - for (let attr in v) { - if (v[attr] == null) { - v[attr] = ""; - } - } let str = JSON.stringify(v); let data = JSON.parse(str); this.form = data; this.showType = "1"; this.showWorker = true; }, + viewWorkerRules(v) { + this.ruleVisible = true; + this.ruleLoading = true; + this.ruleInfo = {}; + this.ruleData = []; + getWorkerRelaPriceByWorkerId({ + workerId: v.workerId + }).then((res) => { + this.ruleLoading = false; + if (res.success) { + this.ruleInfo = res.result || {}; + this.ruleData = this.ruleInfo.workerRelaPriceList || []; + } + }); + }, + formatOrderType(v) { + if (v == 0) { + return "外卖"; + } + if (v == 1) { + return "快递"; + } + return "-"; + }, + formatPushOrder(v) { + if (v == 1) { + return "接指派"; + } + if (v == 0) { + return "不接"; + } + return "-"; + }, + formatDeliveryLocation(v) { + if (v == 0) { + return "送上楼"; + } + if (v == 1) { + return "送到宿舍门口"; + } + return "-"; + }, enable(v) { this.$Modal.confirm({ title: "确认恢复", diff --git a/src/views/app/business/logistics/logistics.vue b/src/views/app/business/logistics/logistics.vue index e3509f4..97fa381 100644 --- a/src/views/app/business/logistics/logistics.vue +++ b/src/views/app/business/logistics/logistics.vue @@ -1,4 +1,4 @@ - @@ -6,25 +6,24 @@