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; } }