From 5352d799af576fb76d79b5ddff1e070d4dbc6757 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Wed, 23 Sep 2026 14:49:09 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=BF=90=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=B7=B2=E5=AE=8C=E6=88=90=E9=9A=90=E8=97=8F=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=B7=AF=E7=BA=BF=E5=B9=B6=E7=A7=BB=E9=99=A4=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已完成运单不再展示变更运输路线入口,变更弹窗去掉拖拽路线编辑区。 Co-authored-by: Cursor --- .../components/business-crud-page.vue | 71 ++----- .../components/waybill-manage-page.vue | 174 ++++++++++++------ 2 files changed, 128 insertions(+), 117 deletions(-) diff --git a/src/views/business/components/business-crud-page.vue b/src/views/business/components/business-crud-page.vue index 16ce010..f6c27e2 100644 --- a/src/views/business/components/business-crud-page.vue +++ b/src/views/business/components/business-crud-page.vue @@ -2478,7 +2478,7 @@ {{ formatTransportPlanDetailTransportType(waybillTransportMode(detailRow)) }} - - -
-
- - {{ waybillRouteChangeTypeText(index) }} - - {{ node.address }} - - {{ tag }} - - -
-
- -
{{ item[1] }} - + + {{ formatDetailValue(detailRow, item[0]) }} + + {{ formatDetailValue(detailRow, item[0]) }} @@ -2423,35 +2434,6 @@ - - -
-
- - {{ waybillRouteChangeTypeText(index) }} - - {{ node.address }} - - {{ tag }} - - -
-
- -
this.waybillDetailCustomerLabel(item) === name) || + customers.find(item => { + const label = this.waybillDetailCustomerLabel(item); + return label && (name.includes(label) || label.includes(name)); + }); + const id = this.waybillDetailCustomerId(matched); + if (id) return id; + } catch (error) { + // 项目客户解析失败时回退到客商档案检索 + } + } + try { + const res = await getCustomerArchiveList(1, 20, { fullName: name }); + const records = res.data?.data?.records || []; + const exact = + records.find(item => item.fullName === name || item.shortName === name) || records[0]; + return exact?.id || ''; + } catch (error) { + return ''; + } + }, + async openWaybillDetailCustomer() { + if (!this.detailRow?.customerName) return; + const customerId = await this.resolveWaybillDetailCustomerId(); + if (!customerId) { + this.$message.warning('未找到对应客商档案,无法打开'); + return; + } + this.$router.push({ + path: '/vehicle/customer-archive/form', + query: { id: String(customerId), name: '查看客商档案', view: '1' }, + }); + }, + openWaybillDetailContract() { + if (!this.detailRow?.contractId) { + this.$message.warning('合同信息缺失,无法打开'); + return; + } + this.$router.push({ + path: '/business/contract-manage/detail', + query: { id: this.detailRow.contractId, name: '合同详情' }, + }); + }, + openWaybillDetailProject() { + if (!this.detailRow?.projectId) { + this.$message.warning('项目信息缺失,无法打开'); + return; + } + this.$router.push({ + path: '/business/project-apply/form', + query: { mode: 'view', id: this.detailRow.projectId, name: '查看项目管理' }, + }); + }, loadWaybillDetailProcessNodes(projectId) { this.waybillDetailProcessNodes = []; if (!projectId) return Promise.resolve([]); @@ -4854,7 +4919,7 @@ export default { : []; }, openWaybillRouteChangeDialog() { - if (!this.detailRow.id) return; + if (!this.detailRow.id || !this.canChangeWaybillRoute(this.detailRow)) return; this.restoreWaybillRouteChangeRecords(); this.waybillRouteChangeTab = 'change'; this.waybillRouteChangeRemark = ''; @@ -4871,22 +4936,11 @@ export default { this.waybillRouteChangeNodes = this.buildWaybillRouteNodes(this.waybillRouteChangeRows); this.waybillRouteChangeBox = true; }, - waybillRouteChangeTypeText(index) { - if (index === 0) return '起'; - if (index === this.waybillRouteChangeNodes.length - 1) return '终'; - return '经'; - }, - handleWaybillRouteChangeDragStart(index) { - this.waybillRouteChangeDragIndex = index; - }, - handleWaybillRouteChangeDrop(index) { - if (this.waybillRouteChangeDragIndex < 0 || this.waybillRouteChangeDragIndex === index) - return; - const nodes = [...this.waybillRouteChangeNodes]; - const [node] = nodes.splice(this.waybillRouteChangeDragIndex, 1); - nodes.splice(index, 0, node); - this.waybillRouteChangeNodes = nodes; - this.waybillRouteChangeDragIndex = -1; + canChangeWaybillRoute(row = {}) { + const status = String(this.statusValue(row) || row.businessStatus || row.status || ''); + if (status === 'completed') return false; + const statusName = String(row.businessStatusName || row.statusName || ''); + return !statusName.includes('已完成'); }, updateWaybillRouteChangeNodes() { this.waybillRouteChangeNodes = this.buildWaybillRouteNodes(this.waybillRouteChangeRows); @@ -4935,9 +4989,8 @@ export default { row.departureAddress !== row.originalDepartureAddress || row.arrivalAddress !== row.originalArrivalAddress; const routeJson = JSON.stringify(this.waybillRouteChangeNodes); - const originalRouteJson = this.detailRow.routeJson || ''; - if (!changed && routeJson === originalRouteJson && !this.waybillRouteChangeRemark) { - this.$message.warning('请修改地址、调整路线或填写变更备注'); + if (!changed && !this.waybillRouteChangeRemark) { + this.$message.warning('请修改地址或填写变更备注'); return; } if (typeof this.api.changeRoute !== 'function') { @@ -4945,11 +4998,9 @@ export default { return; } - const content = changed - ? `${row.waybillNo || '运单'}:发货地 ${row.originalDepartureAddress || '-'} → ${ - row.departureAddress || '-' - };到货地 ${row.originalArrivalAddress || '-'} → ${row.arrivalAddress || '-'}` - : '调整运输路线顺序'; + const content = `${row.waybillNo || '运单'}:发货地 ${row.originalDepartureAddress || '-'} → ${ + row.departureAddress || '-' + };到货地 ${row.originalArrivalAddress || '-'} → ${row.arrivalAddress || '-'}`; const records = [ { changeTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss'), @@ -9814,7 +9865,12 @@ export default { white-space: nowrap; &.is-link { + display: inline; + justify-content: flex-start; + max-width: 100%; color: #409eff; + font-weight: 500; + vertical-align: baseline; } }