From 7eda414846be38b3bc66b2054729fcc38daff694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Wed, 24 Jun 2026 13:30:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(wms/delivery/waybill):=20=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E8=AE=A2=E5=8D=95=E7=BC=96=E5=8F=B7=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E4=B8=BA=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构运单页面的订单编号选择模块,将原有的自动补全输入框+弹窗选择的方式改为远程搜索下拉选择器,移除冗余的订单选择对话框、绑定解绑切换相关逻辑,优化代码结构并统一订单数据处理流程 --- klp-ui/src/router/index.js | 25 --- .../src/views/wms/delivery/waybill/index.vue | 206 +++++------------- 2 files changed, 54 insertions(+), 177 deletions(-) diff --git a/klp-ui/src/router/index.js b/klp-ui/src/router/index.js index fb940d53..cbf559ee 100644 --- a/klp-ui/src/router/index.js +++ b/klp-ui/src/router/index.js @@ -151,19 +151,6 @@ export const constantRoutes = [ } ], }, - // { - // path: '/wms/seal', - // component: Layout, - // hidden: true, - // children: [ - // { - // path: 'sealDetail/:bizId', - // component: () => import('@/views/wms/seal/sealDetail'), - // name: 'WmsSealDetail', - // meta: { title: '用印详情' } - // } - // ] - // } ] // 动态路由,基于用户权限动态去加载 @@ -182,18 +169,6 @@ export const dynamicRoutes = [ } ] }, - { - path: '/ems/assisted/statistics', - component: Layout, - children: [ - { - path: '', - component: () => import('@/views/ems/assisted/statistics.vue'), - name: 'AuxiliaryStatistics', - meta: { title: '公辅消耗统计', icon: 'chart' } - } - ] - }, { path: '/system/role-auth', component: Layout, diff --git a/klp-ui/src/views/wms/delivery/waybill/index.vue b/klp-ui/src/views/wms/delivery/waybill/index.vue index 669b1932..f76a0bbc 100644 --- a/klp-ui/src/views/wms/delivery/waybill/index.vue +++ b/klp-ui/src/views/wms/delivery/waybill/index.vue @@ -175,55 +175,30 @@ placeholder="请选择发货时间"> - - -
- + + - - - 绑定订单 -
+ {{ item.orderCode }} + {{ item.companyName }} + {{ item.salesman }} + +
- -
- - 解绑 - 切换订单 -
-
- - - - - - - - - - - - - @@ -357,13 +332,7 @@ export default { // 订单列表 orderList: [], orderLoading: false, - // 订单选择对话框 - orderDialogVisible: false, - // 订单搜索关键词 - orderQuery: '', orderId: '', - // 订单自动补全 - orderSuggestLoading: false, }; }, created() { @@ -391,7 +360,7 @@ export default { /** 加载订单列表 */ loadOrderList() { this.orderLoading = true; - listOrder({ pageNum: 1, pageSize: 100, keyword: this.orderQuery }).then(response => { + listOrder({ pageNum: 1, pageSize: 100 }).then(response => { this.orderList = response.rows || []; this.orderLoading = false; }).catch(error => { @@ -638,78 +607,41 @@ export default { planId: this.selectedPlan.planId }, `deliveryPlan_${new Date().getTime()}.xlsx`) }, - /** 绑定订单 */ - bindOrder() { - this.orderDialogVisible = true; - }, - /** 解绑订单 */ - unbindOrder() { - this.form.orderId = undefined; - this.form.orderCode = undefined; - this.form.consigneeUnit = undefined; - this.form.principal = undefined; - }, - /** 切换订单 */ - changeOrder() { - this.orderDialogVisible = true; - }, - /** 订单搜索 */ - handleOrderSearch() { - // 搜索逻辑已在computed中处理 - }, - /** 选择订单 */ - handleOrderSelect(row) { - this.form.orderId = row.orderId; - this.form.orderCode = row.orderCode; - this.form.consigneeUnit = row.companyName; - this.form.principal = row.salesman; - this.orderDialogVisible = false; - }, - /** 订单编号自动补全 */ - queryOrderSuggestions(queryString, callback) { - if (!queryString || queryString.trim() === '') { - callback([]); + /** 订单下拉选择变更 */ + onOrderSelectChange(orderId) { + if (!orderId) { + this.form.orderCode = undefined; + this.form.consigneeUnit = undefined; + this.form.principal = undefined; return; } - this.orderSuggestLoading = true; - listOrder({ pageNum: 1, pageSize: 10, keyword: queryString }).then(response => { - const suggestions = (response.rows || []).map(item => ({ - ...item, - value: item.orderCode - })); - this.orderSuggestLoading = false; - callback(suggestions); - }).catch(() => { - this.orderSuggestLoading = false; - callback([]); - }); - }, - /** 自动补全选择订单 */ - onOrderAutoSelect(item) { - const existing = this.deliveryWaybillList.find( - d => d.orderId === item.orderId || d.orderCode === item.orderCode - ); - if (existing) { - this.$confirm( - `订单"${item.orderCode}"已绑定在发货单"${existing.waybillName}"中,确定继续绑定?`, - '提示', - { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' } - ).then(() => { - this.doBindOrder(item); - }).catch(() => { - this.form.principalPhone = item.orderCode; - }); - } else { - this.doBindOrder(item); + const order = this.orderList.find(o => o.orderId === orderId); + if (order) { + this.form.orderCode = order.orderCode; + this.form.consigneeUnit = order.companyName; + this.form.principal = order.salesman; } }, - /** 执行订单绑定并填写信息 */ - doBindOrder(item) { - this.form.orderId = item.orderId; - this.form.orderCode = item.orderCode; - this.form.consigneeUnit = item.companyName; - this.form.principal = item.salesman; - this.form.principalPhone = item.orderCode; + /** 远程搜索订单 */ + remoteSearchOrders(query) { + if (query) { + this.orderLoading = true; + listOrder({ pageNum: 1, pageSize: 20, keyword: query }).then(response => { + this.orderList = response.rows || []; + this.orderLoading = false; + }).catch(() => { + this.orderLoading = false; + }); + } else { + // 无查询词时加载默认列表 + this.orderLoading = true; + listOrder({ pageNum: 1, pageSize: 100 }).then(response => { + this.orderList = response.rows || []; + this.orderLoading = false; + }).catch(() => { + this.orderLoading = false; + }); + } }, /** 打印发货单 */ handlePrint(row, printType) { @@ -947,33 +879,3 @@ export default { font-size: 12px; } - -