From e1d87f57881b919ee180874d06b9e2aba53c914a Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Mon, 26 Oct 2026 10:50:58 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E7=BB=93=E7=AE=97=E6=B1=87?= =?UTF-8?q?=E7=8E=87=E5=8F=8D=E7=AE=97=E3=80=81=E5=BC=80=E7=A5=A8=E5=90=88?= =?UTF-8?q?=E8=AE=A1=E5=A1=AB=E6=8A=A5=E3=80=81=E9=85=8D=E8=BD=BD=E6=89=BF?= =?UTF-8?q?=E8=BF=90=E5=95=86=E4=BA=A4=E9=9B=86=E4=B8=8E=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=82=AC=E5=81=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外币结算按本位币/汇率反算;开票改填合计金额并反算不含税单价;配载展示承运商合同并按乙方交集限选;评分加减分封顶15分;车辆所有组织/使用部门悬停显示完整路径。 Co-authored-by: Cursor --- src/api/business/loading-manage.js | 9 +- .../transportCapacity/transport-vehicle.js | 3 + src/views/business/contract-manage-change.vue | 38 +++- src/views/business/loading-manage.vue | 55 +++++- .../payment/invoice-application-form.vue | 50 +++-- .../components/formal-settlement-editor.vue | 62 +++++-- .../components/pre-settlement-editor.vue | 60 ++++-- src/views/transportCapacity/vehicle.vue | 172 +++++++++++++++--- .../vehicle/credit-score-quantification.vue | 49 +++-- src/views/vehicle/customer-archive.vue | 64 ++++--- 10 files changed, 431 insertions(+), 131 deletions(-) diff --git a/src/api/business/loading-manage.js b/src/api/business/loading-manage.js index 5d116bc..2fef6a5 100644 --- a/src/api/business/loading-manage.js +++ b/src/api/business/loading-manage.js @@ -24,11 +24,16 @@ export const getDetail = id => }, }); -export const getCarrierContracts = projectIds => +export const getCarrierContracts = (projectIds, waybillIds = []) => request({ url: `${baseUrl}/carrier-contracts`, method: 'get', - params: { projectIds: (projectIds || []).join(',') }, + params: { + projectIds: (projectIds || []).join(','), + ...(waybillIds || []).filter(Boolean).length + ? { waybillIds: (waybillIds || []).filter(Boolean).join(',') } + : {}, + }, }); export const saveDraft = row => diff --git a/src/option/transportCapacity/transport-vehicle.js b/src/option/transportCapacity/transport-vehicle.js index ffe1bae..c5762d7 100644 --- a/src/option/transportCapacity/transport-vehicle.js +++ b/src/option/transportCapacity/transport-vehicle.js @@ -48,6 +48,7 @@ export const option = { searchOrder: 1, searchslot: true, slot: true, + overHidden: true, minWidth: 150, }, { @@ -55,6 +56,8 @@ export const option = { prop: 'useDepartment', search: true, searchOrder: 3, + slot: true, + overHidden: true, minWidth: 140, }, { diff --git a/src/views/business/contract-manage-change.vue b/src/views/business/contract-manage-change.vue index 63f5f88..feb942b 100644 --- a/src/views/business/contract-manage-change.vue +++ b/src/views/business/contract-manage-change.vue @@ -27,8 +27,14 @@ /> - - + + { + if (this.isSettlementRuleChange) { + return callback(); + } + const contractNo = String(value || '').trim(); + if (!contractNo) { + return callback(new Error('请输入合同编号')); + } + if (contractNo.length > 100) { + return callback(new Error('合同编号不能超过100个字符')); + } + callback(); + }, + trigger: 'blur', + }, + ], contractName: [{ required: true, message: '请输入合同名称', trigger: 'blur' }], contractAmount: [ { required: true, message: '请输入合同金额', trigger: 'blur' }, @@ -956,6 +980,16 @@ export default { } await this.$refs.formRef.validate(); if (!this.isSettlementRuleChange) { + const contractNo = String(this.form.contractNo || '').trim(); + if (!contractNo) { + this.$message.warning('请输入合同编号'); + return; + } + if (contractNo.length > 100) { + this.$message.warning('合同编号不能超过100个字符'); + return; + } + this.form.contractNo = contractNo; const total = this.paymentRatioRows.reduce((sum, row) => sum + Number(row.ratioLimit || 0), 0); if (this.paymentRatioRows.length && Math.abs(total - 100) > 0.0001) { this.$message.warning('付款比例上限合计必须等于100%'); diff --git a/src/views/business/loading-manage.vue b/src/views/business/loading-manage.vue index a4ef296..28147fa 100644 --- a/src/views/business/loading-manage.vue +++ b/src/views/business/loading-manage.vue @@ -901,7 +901,7 @@
可配载条件
- 同时满足以下条件的运单可被配载:运输方式为「公路」;运单状态为「待执行」或「进行中」;未关联其他有效配载单。 + 同时满足以下条件的运单可被配载:运输方式为「公路」;运单状态为「待执行」或「进行中」;未关联其他有效配载单;同一配载单的子运单须属同一项目,且承运商合同乙方须存在共同可选值(按各子单客户合同甲方匹配后取交集)。
配载后状态说明
@@ -1193,6 +1193,16 @@ min-width="160" show-overflow-tooltip /> + + + row.projectId).find(Boolean); const query = { ...this.buildQueryParams(this.candidateQuery), // 公路、待执行、未配载的判定都在后端可配载开关内 @@ -3905,6 +3916,10 @@ export default { // 其余账户限定本组织(不展开下级) allDept: 0, }; + // 已选运单后,候选列表优先限定同一项目,便于再按承运商合同乙方交集筛选 + if (selectedProjectId && !query.projectId && !query.projectName) { + query.projectId = selectedProjectId; + } const res = await getWaybillList( this.candidatePage.currentPage, this.candidatePage.pageSize, @@ -3966,7 +3981,10 @@ export default { ]; if (projectIds.length) { try { - const response = await loadingApi.getCarrierContracts(projectIds); + const waybillIds = [...this.selectedWaybillRows, ...selectedRows] + .map(row => row.id) + .filter(Boolean); + const response = await loadingApi.getCarrierContracts(projectIds, waybillIds); const contracts = response?.data?.data || response?.data || []; const stillAllowed = (Array.isArray(contracts) ? contracts : []).some( item => String(item.id) === String(contractId) @@ -4015,6 +4033,19 @@ export default { exists.add(key); } }); + // 承运商类型:新增后须仍存在共同的承运商合同乙方(按客户合同甲方匹配后取交集) + if ( + String(this.dialogForm.carrierType || '').trim() === '承运商' && + nextRows.length > this.selectedWaybillRows.length + ) { + const compatible = await this.hasCompatibleCarrierContracts(nextRows); + if (!compatible) { + this.$message.warning( + '所选运单在同一项目下没有共同的承运商合同乙方,不能加入同一配载单' + ); + return; + } + } const prevRouteNodes = [...this.routeNodes]; this.selectedWaybillRows = nextRows; if (this.isRunningEdit) { @@ -4028,6 +4059,18 @@ export default { this.candidateAdding = false; } }, + async hasCompatibleCarrierContracts(rows = []) { + const projectId = (rows || []).map(row => row.projectId).find(Boolean); + const waybillIds = (rows || []).map(row => row.id).filter(Boolean); + if (!projectId || waybillIds.length < 2) return true; + try { + const response = await loadingApi.getCarrierContracts([projectId], waybillIds); + const contracts = response?.data?.data || response?.data || []; + return (Array.isArray(contracts) ? contracts : []).length > 0; + } catch (error) { + return true; + } + }, async addSelectedWaybills() { await this.addWaybillRows(this.candidateSelection); }, @@ -4711,9 +4754,13 @@ export default { } this.taskCarrierLoading = true; try { - // 配载单只有一个项目,承运商合同也必须属于该项目 + // 配载单只有一个项目;传入子运单后按客户合同甲方匹配并取承运商合同乙方交集 const projectId = this.selectedWaybillRows.map(row => row.projectId).find(Boolean); - const response = await loadingApi.getCarrierContracts(projectId ? [projectId] : []); + const waybillIds = this.selectedWaybillRows.map(row => row.id).filter(Boolean); + const response = await loadingApi.getCarrierContracts( + projectId ? [projectId] : [], + waybillIds + ); if (requestId !== this.taskCarrierRequestId) return []; const contracts = response.data?.data || response.data || []; if (this.dialogForm.carrierType !== '自运') { diff --git a/src/views/payment/invoice-application-form.vue b/src/views/payment/invoice-application-form.vue index d4ed32a..ec8ee8f 100644 --- a/src/views/payment/invoice-application-form.vue +++ b/src/views/payment/invoice-application-form.vue @@ -251,10 +251,10 @@ /> - + - - - - - + + - - + + + + + +