Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486d438d49 | ||
|
|
53aa1f66ef | ||
|
|
7def9869ff | ||
|
|
f767296e4d | ||
|
|
b879fd3011 | ||
|
|
db55c3ef00 | ||
|
|
af4a9b6d60 | ||
|
|
d3ba0ce38b | ||
|
|
f5be5245d6 | ||
|
|
baf54efb7b | ||
|
|
7ff2b3fe28 | ||
|
|
17d2766f82 | ||
|
|
32065b9c54 | ||
|
|
799a87641e | ||
|
|
28baa69e8f | ||
|
|
4ed80268b4 | ||
|
|
30c59c2acb | ||
|
|
39560bde79 |
@@ -91,3 +91,14 @@ export const recognizeBaiduOcr = (imageUrl, type, side = '') => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const recognizeQualificationCertificateOcr = imageUrl => {
|
||||||
|
return request({
|
||||||
|
url: '/blade-transport/baidu-ocr/qualification-certificate',
|
||||||
|
method: 'post',
|
||||||
|
timeout: 60000,
|
||||||
|
params: {
|
||||||
|
imageUrl,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -253,16 +253,18 @@ export const option = createCrudOption([
|
|||||||
label: '客商',
|
label: '客商',
|
||||||
prop: 'partyName',
|
prop: 'partyName',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 11,
|
searchOrder: 14,
|
||||||
searchPlaceholder: '请输入',
|
searchPlaceholder: '请输入甲/乙方名称',
|
||||||
hide: true,
|
hide: true,
|
||||||
display: false,
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '合同编号',
|
label: '合同编号',
|
||||||
prop: 'contractNo',
|
prop: 'contractNo',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 6,
|
searchOrder: 8,
|
||||||
searchPlaceholder: '请输入',
|
searchPlaceholder: '请输入',
|
||||||
order: 185,
|
order: 185,
|
||||||
maxlength: 100,
|
maxlength: 100,
|
||||||
@@ -287,7 +289,7 @@ export const option = createCrudOption([
|
|||||||
label: '所属项目',
|
label: '所属项目',
|
||||||
prop: 'projectName',
|
prop: 'projectName',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 8,
|
searchOrder: 11,
|
||||||
searchType: 'select',
|
searchType: 'select',
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
formslot: true,
|
formslot: true,
|
||||||
@@ -334,7 +336,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'contractCategory',
|
prop: 'contractCategory',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 9,
|
searchOrder: 12,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
order: 170,
|
order: 170,
|
||||||
dicData: contractCategoryOptions,
|
dicData: contractCategoryOptions,
|
||||||
@@ -346,7 +348,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'signType',
|
prop: 'signType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 10,
|
searchOrder: 13,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
span: 8,
|
span: 8,
|
||||||
order: 190,
|
order: 190,
|
||||||
@@ -359,7 +361,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'effectiveType',
|
prop: 'effectiveType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 5,
|
searchOrder: 6,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
dicData: effectiveTypeOptions,
|
dicData: effectiveTypeOptions,
|
||||||
hide: true,
|
hide: true,
|
||||||
@@ -630,7 +632,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'hcsSyncStatus',
|
prop: 'hcsSyncStatus',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 6,
|
searchOrder: 7,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
slot: true,
|
slot: true,
|
||||||
dicData: hcsSyncStatusOptions,
|
dicData: hcsSyncStatusOptions,
|
||||||
@@ -660,7 +662,7 @@ export const option = createCrudOption([
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
searchOrder: 7,
|
searchOrder: 9,
|
||||||
dicData: yesNoOptions,
|
dicData: yesNoOptions,
|
||||||
hide: true,
|
hide: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
@@ -672,7 +674,7 @@ export const option = createCrudOption([
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
searchOrder: 8,
|
searchOrder: 10,
|
||||||
dicData: yesNoOptions,
|
dicData: yesNoOptions,
|
||||||
hide: true,
|
hide: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ const formatGoodsInfo = row => {
|
|||||||
const text = Object.entries(groups)
|
const text = Object.entries(groups)
|
||||||
.map(([unit, group]) => {
|
.map(([unit, group]) => {
|
||||||
const quantity = formatGoodsQuantity(group.quantity);
|
const quantity = formatGoodsQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${unit ? ` ${unit}` : ''}`;
|
const typeName = group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
|
return `${typeName} | ${quantity}${unit ? ` ${unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export const searchFields = [
|
|||||||
{ label: '预付结算单号', prop: 'preSettlementNo', type: 'input' },
|
{ label: '预付结算单号', prop: 'preSettlementNo', type: 'input' },
|
||||||
{ label: '正式结算单号', prop: 'formalSettlementNo', type: 'input' },
|
{ label: '正式结算单号', prop: 'formalSettlementNo', type: 'input' },
|
||||||
{ label: '批次号', prop: 'batchNo', type: 'input' },
|
{ label: '批次号', prop: 'batchNo', type: 'input' },
|
||||||
|
{ label: '运单号', prop: 'waybillNo', type: 'input' },
|
||||||
{ label: '车号', prop: 'vehicleNo', type: 'input' },
|
{ label: '车号', prop: 'vehicleNo', type: 'input' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
:data="data"
|
:data="data"
|
||||||
ref="crud"
|
ref="crud"
|
||||||
v-model="form"
|
v-model="form"
|
||||||
|
v-model:page="page"
|
||||||
:permission="permissionList"
|
:permission="permissionList"
|
||||||
:before-open="beforeOpen"
|
:before-open="beforeOpen"
|
||||||
@row-del="rowDel"
|
@row-del="rowDel"
|
||||||
@@ -729,7 +730,9 @@ export default {
|
|||||||
onLoad(page, params = {}) {
|
onLoad(page, params = {}) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
||||||
this.data = res.data.data;
|
const data = res.data.data || {};
|
||||||
|
this.data = data.records || [];
|
||||||
|
this.page.total = data.total || 0;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.selectionClear();
|
this.selectionClear();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3949,9 +3949,9 @@ export default {
|
|||||||
return Object.values(groups)
|
return Object.values(groups)
|
||||||
.map(group => {
|
.map(group => {
|
||||||
const quantity = this.formatDispatchQuantity(group.quantity);
|
const quantity = this.formatDispatchQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
const typeName =
|
||||||
group.unit ? ` ${group.unit}` : ''
|
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
}`;
|
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
},
|
},
|
||||||
@@ -7549,12 +7549,13 @@ export default {
|
|||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
const cargoInfo = Object.values(groups)
|
const cargoInfo = Object.values(groups)
|
||||||
.map(
|
.map(group => {
|
||||||
group =>
|
const typeName =
|
||||||
`${group.cargoType}等${group.count}种货物 | ${this.formatDispatchQuantity(
|
group.count > 1 ? `${group.cargoType}等${group.count}种货物` : group.cargoType;
|
||||||
group.quantity
|
return `${typeName} | ${this.formatDispatchQuantity(group.quantity)}${
|
||||||
)}${group.unit ? ` ${group.unit}` : ''}`
|
group.unit ? ` ${group.unit}` : ''
|
||||||
)
|
}`;
|
||||||
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
return cargoInfo || plan.goodsInfo || '';
|
return cargoInfo || plan.goodsInfo || '';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5018,9 +5018,9 @@ export default {
|
|||||||
return Object.values(groups)
|
return Object.values(groups)
|
||||||
.map(group => {
|
.map(group => {
|
||||||
const quantity = this.formatQuantity(group.quantity);
|
const quantity = this.formatQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
const typeName =
|
||||||
group.unit ? ` ${group.unit}` : ''
|
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
}`;
|
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2545,9 +2545,9 @@ export default {
|
|||||||
Object.values(groups)
|
Object.values(groups)
|
||||||
.map(group => {
|
.map(group => {
|
||||||
const quantity = this.formatGoodsQuantity(group.quantity);
|
const quantity = this.formatGoodsQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
const typeName =
|
||||||
group.unit ? ` ${group.unit}` : ''
|
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
}`;
|
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ') || '-'
|
.join('; ') || '-'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -489,6 +489,12 @@ const NODE_TEMPLATES = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// 过程配置必须覆盖装货端与卸货端各一个节点;货量下限只看装货端——
|
||||||
|
// 到场没有货量开关,不能拿它顶替货量采集
|
||||||
|
const PICKUP_NODE_KEYS = ['arrive_scene', 'load', 'dispatch'];
|
||||||
|
const DELIVERY_NODE_KEYS = ['unload', 'arrival', 'sign', 'return'];
|
||||||
|
const CARGO_NODE_KEYS = ['load', 'dispatch'];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -916,8 +922,24 @@ export default {
|
|||||||
this.$message.warning('备注不能超过500个字符');
|
this.$message.warning('备注不能超过500个字符');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this.enabledNodes.length) {
|
const isEnabledNode = key => this.nodeRows.some(item => item.key === key && item.enabled);
|
||||||
this.$message.warning('请至少选择一个过程节点');
|
if (!PICKUP_NODE_KEYS.some(isEnabledNode)) {
|
||||||
|
this.$message.warning('发货、装货、到场至少选择一个');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!DELIVERY_NODE_KEYS.some(isEnabledNode)) {
|
||||||
|
this.$message.warning('卸货、到货、签收、回单至少选择一个');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 装货端没有节点采集货量时,整条配置在小程序侧等于不采集货量
|
||||||
|
const collectsCargo = CARGO_NODE_KEYS.some(key =>
|
||||||
|
this.nodeRows.some(
|
||||||
|
item =>
|
||||||
|
item.key === key && item.enabled && item.uploadCargo && (item.cargoTypes || []).length
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (!collectsCargo) {
|
||||||
|
this.$message.warning('发货或装货至少勾选一个货量类型');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const transit = this.nodeRows.find(item => item.key === 'transit');
|
const transit = this.nodeRows.find(item => item.key === 'transit');
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in contractOptions"
|
v-for="item in contractOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="formatContractOptionLabel(item)"
|
:label="item.contractName || item.contractNo"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -415,7 +415,8 @@
|
|||||||
><el-input
|
><el-input
|
||||||
v-model="row.description"
|
v-model="row.description"
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
maxlength="200" /></template></el-table-column
|
maxlength="200"
|
||||||
|
placeholder="请输入" /></template></el-table-column
|
||||||
><el-table-column label="文件大小" width="120"
|
><el-table-column label="文件大小" width="120"
|
||||||
><template #default="{ row }">{{
|
><template #default="{ row }">{{
|
||||||
formatAttachmentSize(row)
|
formatAttachmentSize(row)
|
||||||
@@ -732,7 +733,6 @@ import {
|
|||||||
getList as getCustomerArchiveList,
|
getList as getCustomerArchiveList,
|
||||||
} from '@/api/vehicle/customer-archive';
|
} from '@/api/vehicle/customer-archive';
|
||||||
import { readSettlementTransfer, removeSettlementTransfer } from '@/utils/settlement-transfer';
|
import { readSettlementTransfer, removeSettlementTransfer } from '@/utils/settlement-transfer';
|
||||||
import { formatContractOptionLabel } from '@/utils/contract';
|
|
||||||
import { downloadFileByUrl } from '@/utils/util';
|
import { downloadFileByUrl } from '@/utils/util';
|
||||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||||
import {
|
import {
|
||||||
@@ -1140,7 +1140,6 @@ export default {
|
|||||||
this.initialize();
|
this.initialize();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatContractOptionLabel,
|
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.permission?.[code] !== false;
|
return this.permission?.[code] !== false;
|
||||||
},
|
},
|
||||||
@@ -2086,10 +2085,10 @@ export default {
|
|||||||
mergeAutomaticAttachments(
|
mergeAutomaticAttachments(
|
||||||
files,
|
files,
|
||||||
materials,
|
materials,
|
||||||
sourceName,
|
|
||||||
defaultMaterial = null,
|
defaultMaterial = null,
|
||||||
sourceKey = '',
|
sourceKey = '',
|
||||||
keepUnmatched = false
|
keepUnmatched = false,
|
||||||
|
insertIndex = -1
|
||||||
) {
|
) {
|
||||||
const existingUrls = new Set(
|
const existingUrls = new Set(
|
||||||
(this.form.attachments || []).map(file => this.attachmentFileUrl(file)).filter(Boolean)
|
(this.form.attachments || []).map(file => this.attachmentFileUrl(file)).filter(Boolean)
|
||||||
@@ -2113,35 +2112,39 @@ export default {
|
|||||||
url,
|
url,
|
||||||
link: file.link || url,
|
link: file.link || url,
|
||||||
attachmentType: material ? MATERIAL_TYPE_MAP[material.key] : 'other',
|
attachmentType: material ? MATERIAL_TYPE_MAP[material.key] : 'other',
|
||||||
description: file.description || `自动取自${sourceName}`,
|
description: file.description || '',
|
||||||
sourceImported: true,
|
sourceImported: true,
|
||||||
sourceKey: sourceKey || undefined,
|
sourceKey: sourceKey || undefined,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
if (imported.length) this.form.attachments = [...this.form.attachments, ...imported];
|
if (imported.length) {
|
||||||
|
// 回填到被替换附件的原起始位置,避免回显/切换时把用户新传附件顶到前面
|
||||||
|
const attachments = [...this.form.attachments];
|
||||||
|
const insertAt =
|
||||||
|
insertIndex >= 0 ? Math.min(insertIndex, attachments.length) : attachments.length;
|
||||||
|
attachments.splice(insertAt, 0, ...imported);
|
||||||
|
this.form.attachments = attachments;
|
||||||
|
}
|
||||||
return imported;
|
return imported;
|
||||||
},
|
},
|
||||||
/** 移除指定来源的自动关联附件(切换结算单/合同时整批替换) */
|
/** 移除指定来源的自动关联附件(切换结算单/合同时整批替换),返回首个被移除的位置 */
|
||||||
removeAutomaticAttachments(sourceKey, sourceName = '') {
|
removeAutomaticAttachments(sourceKey) {
|
||||||
const previousUrls = new Set(
|
const previousUrls = new Set(
|
||||||
sourceKey === 'settlement' ? this.linkedSettlementAttachmentUrls || [] : []
|
sourceKey === 'settlement' ? this.linkedSettlementAttachmentUrls || [] : []
|
||||||
);
|
);
|
||||||
this.form.attachments = (this.form.attachments || []).filter(file => {
|
let firstRemovedIndex = -1;
|
||||||
|
this.form.attachments = (this.form.attachments || []).filter((file, index) => {
|
||||||
const url = this.attachmentFileUrl(file);
|
const url = this.attachmentFileUrl(file);
|
||||||
if (sourceKey && file.sourceKey === sourceKey) return false;
|
const keep =
|
||||||
if (
|
!(sourceKey && file.sourceKey === sourceKey) &&
|
||||||
sourceName &&
|
!(previousUrls.size && url && previousUrls.has(url));
|
||||||
file.sourceImported &&
|
if (!keep && firstRemovedIndex === -1) firstRemovedIndex = index;
|
||||||
String(file.description || '').includes(`自动取自${sourceName}`)
|
return keep;
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (previousUrls.size && url && previousUrls.has(url)) return false;
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
if (sourceKey === 'settlement') {
|
if (sourceKey === 'settlement') {
|
||||||
this.linkedSettlementAttachmentUrls = [];
|
this.linkedSettlementAttachmentUrls = [];
|
||||||
}
|
}
|
||||||
|
return firstRemovedIndex;
|
||||||
},
|
},
|
||||||
/** 按当前结算单附件整批同步:先清旧关联,再写入新结算单上传的附件 */
|
/** 按当前结算单附件整批同步:先清旧关联,再写入新结算单上传的附件 */
|
||||||
syncSettlementAttachments(settlementRows = []) {
|
syncSettlementAttachments(settlementRows = []) {
|
||||||
@@ -2156,14 +2159,14 @@ export default {
|
|||||||
.map(file => this.attachmentFileUrl(file))
|
.map(file => this.attachmentFileUrl(file))
|
||||||
.filter(url => url && nextUrlSet.has(url));
|
.filter(url => url && nextUrlSet.has(url));
|
||||||
}
|
}
|
||||||
this.removeAutomaticAttachments('settlement', '结算单');
|
const removedAt = this.removeAutomaticAttachments('settlement');
|
||||||
const imported = this.mergeAutomaticAttachments(
|
const imported = this.mergeAutomaticAttachments(
|
||||||
settlementFiles,
|
settlementFiles,
|
||||||
settlementMaterials,
|
settlementMaterials,
|
||||||
'结算单',
|
|
||||||
null,
|
null,
|
||||||
'settlement',
|
'settlement',
|
||||||
true
|
true,
|
||||||
|
removedAt
|
||||||
);
|
);
|
||||||
this.linkedSettlementAttachmentUrls = imported
|
this.linkedSettlementAttachmentUrls = imported
|
||||||
.map(file => this.attachmentFileUrl(file))
|
.map(file => this.attachmentFileUrl(file))
|
||||||
@@ -2214,7 +2217,7 @@ export default {
|
|||||||
this.syncSettlementAttachments(settlementRows);
|
this.syncSettlementAttachments(settlementRows);
|
||||||
if (!this.form.contractId) {
|
if (!this.form.contractId) {
|
||||||
this.firstContractPayment = false;
|
this.firstContractPayment = false;
|
||||||
this.removeAutomaticAttachments('contract', '合同');
|
this.removeAutomaticAttachments('contract');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const contractResponse = await getContractDetail(this.form.contractId);
|
const contractResponse = await getContractDetail(this.form.contractId);
|
||||||
@@ -2226,13 +2229,14 @@ export default {
|
|||||||
this.contractSignatureFileAvailable = contractFiles.some(file =>
|
this.contractSignatureFileAvailable = contractFiles.some(file =>
|
||||||
Boolean(this.attachmentFileUrl(file))
|
Boolean(this.attachmentFileUrl(file))
|
||||||
);
|
);
|
||||||
this.removeAutomaticAttachments('contract', '合同');
|
const contractRemovedAt = this.removeAutomaticAttachments('contract');
|
||||||
this.mergeAutomaticAttachments(
|
this.mergeAutomaticAttachments(
|
||||||
contractFiles,
|
contractFiles,
|
||||||
[ATTACHMENT_MATERIALS.contract],
|
[ATTACHMENT_MATERIALS.contract],
|
||||||
'合同',
|
|
||||||
ATTACHMENT_MATERIALS.contract,
|
ATTACHMENT_MATERIALS.contract,
|
||||||
'contract'
|
'contract',
|
||||||
|
false,
|
||||||
|
contractRemovedAt
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2246,14 +2250,15 @@ export default {
|
|||||||
String(item.id || '') !== String(this.form.id || '') &&
|
String(item.id || '') !== String(this.form.id || '') &&
|
||||||
item.approvalStatus !== 'voided'
|
item.approvalStatus !== 'voided'
|
||||||
);
|
);
|
||||||
this.removeAutomaticAttachments('contract', '合同');
|
const contractRemovedAt = this.removeAutomaticAttachments('contract');
|
||||||
if (this.firstContractPayment) {
|
if (this.firstContractPayment) {
|
||||||
this.mergeAutomaticAttachments(
|
this.mergeAutomaticAttachments(
|
||||||
this.parse(contract.contractFileJson),
|
this.parse(contract.contractFileJson),
|
||||||
[ATTACHMENT_MATERIALS.contract],
|
[ATTACHMENT_MATERIALS.contract],
|
||||||
'合同',
|
|
||||||
ATTACHMENT_MATERIALS.contract,
|
ATTACHMENT_MATERIALS.contract,
|
||||||
'contract'
|
'contract',
|
||||||
|
false,
|
||||||
|
contractRemovedAt
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -84,7 +84,12 @@
|
|||||||
>
|
>
|
||||||
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
|
<span v-else-if="field.money">{{
|
||||||
|
formatMoney(
|
||||||
|
form[field.prop],
|
||||||
|
field.prop === 'settlementAmount' ? settlementCurrencyCode : 'RMB'
|
||||||
|
)
|
||||||
|
}}</span>
|
||||||
<span v-else-if="field.type === 'select'">{{
|
<span v-else-if="field.type === 'select'">{{
|
||||||
formSelectLabel(field, form[field.prop])
|
formSelectLabel(field, form[field.prop])
|
||||||
}}</span>
|
}}</span>
|
||||||
@@ -180,7 +185,7 @@
|
|||||||
'formal-editor__negative-amount': isNegativeAdjustedAmount(row, column.prop),
|
'formal-editor__negative-amount': isNegativeAdjustedAmount(row, column.prop),
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ formatMoney(row[column.prop]) }}
|
{{ formatMoney(row[column.prop], settlementCurrencyCode) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="column.prop === 'feeType'">{{ feeCategoryName(row.feeType) }}</span>
|
<span v-else-if="column.prop === 'feeType'">{{ feeCategoryName(row.feeType) }}</span>
|
||||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||||
@@ -201,7 +206,7 @@
|
|||||||
class="formal-editor__settle-summary"
|
class="formal-editor__settle-summary"
|
||||||
>
|
>
|
||||||
<el-descriptions-item label="结算合计(原金额)">
|
<el-descriptions-item label="结算合计(原金额)">
|
||||||
{{ formatMoney(form.settlementAmount) }}
|
{{ formatMoney(form.settlementAmount, settlementCurrencyCode) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="已付金额(含预付、核销)">
|
<el-descriptions-item label="已付金额(含预付、核销)">
|
||||||
{{ formatMoney(settlePaidTotal) }}
|
{{ formatMoney(settlePaidTotal) }}
|
||||||
@@ -306,7 +311,7 @@
|
|||||||
</el-link>
|
</el-link>
|
||||||
<span v-else-if="item.column.money">{{ formatMoney(row[item.column.prop]) }}</span>
|
<span v-else-if="item.column.money">{{ formatMoney(row[item.column.prop]) }}</span>
|
||||||
<span v-else-if="item.column.prop === 'transportQuantity'">
|
<span v-else-if="item.column.prop === 'transportQuantity'">
|
||||||
{{ formatDetailTransportQuantity(row[item.column.prop]) }}
|
{{ formatDetailTransportQuantity(row) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="item.column.prop === 'mileage'">
|
<span v-else-if="item.column.prop === 'mileage'">
|
||||||
{{ formatDetailMileage(row[item.column.prop]) }}
|
{{ formatDetailMileage(row[item.column.prop]) }}
|
||||||
@@ -362,7 +367,6 @@
|
|||||||
v-model="row.type"
|
v-model="row.type"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择类型"
|
placeholder="请选择类型"
|
||||||
@change="sortAttachments"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in attachmentTypeOptions"
|
v-for="item in attachmentTypeOptions"
|
||||||
@@ -1374,6 +1378,10 @@ export default {
|
|||||||
isLocalCurrencySettlement() {
|
isLocalCurrencySettlement() {
|
||||||
return normalizeCurrencyCode(this.form.currency) === 'RMB';
|
return normalizeCurrencyCode(this.form.currency) === 'RMB';
|
||||||
},
|
},
|
||||||
|
// 结算单据币种:本位币结算固定 RMB,外币结算取归一化后的合同结算币种
|
||||||
|
settlementCurrencyCode() {
|
||||||
|
return this.isLocalCurrencySettlement ? 'RMB' : normalizeCurrencyCode(this.form.currency);
|
||||||
|
},
|
||||||
visibleFields() {
|
visibleFields() {
|
||||||
if (!this.isLocalCurrencySettlement) return this.fields;
|
if (!this.isLocalCurrencySettlement) return this.fields;
|
||||||
return this.fields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
|
return this.fields.filter(field => !LOCAL_CURRENCY_HIDDEN_FIELDS.includes(field.prop));
|
||||||
@@ -1530,7 +1538,6 @@ export default {
|
|||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
this.invoices = data.invoices || [];
|
this.invoices = data.invoices || [];
|
||||||
this.issuedInvoices = data.issuedInvoices || [];
|
this.issuedInvoices = data.issuedInvoices || [];
|
||||||
this.sortAttachments();
|
|
||||||
this.contracts = this.filterContracts(this.allContracts, this.form.projectId);
|
this.contracts = this.filterContracts(this.allContracts, this.form.projectId);
|
||||||
},
|
},
|
||||||
async initialize() {
|
async initialize() {
|
||||||
@@ -1947,12 +1954,13 @@ export default {
|
|||||||
});
|
});
|
||||||
this.refreshFormalSettlementNo();
|
this.refreshFormalSettlementNo();
|
||||||
}
|
}
|
||||||
this.form.settlementAmount = this.sources.reduce(
|
// 来源预结算金额为本位币;外币结算时结算金额按汇率反算,本位币合计保留本位币汇总
|
||||||
|
const sourceTotal = this.sources.reduce(
|
||||||
(sum, item) => sum + Number(item.settlementAmount || 0),
|
(sum, item) => sum + Number(item.settlementAmount || 0),
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
this.form.localSettlementAmount =
|
this.form.settlementAmount = this.convertLocalToSettlementAmount(sourceTotal);
|
||||||
this.form.settlementAmount * Number(this.form.exchangeRate || 1);
|
this.form.localSettlementAmount = Number(sourceTotal).toFixed(2);
|
||||||
this.candidate.visible = false;
|
this.candidate.visible = false;
|
||||||
// 预结算转正式:带出来源预结算已保存的项目预付核销行(后端保存时转移源行,额度单份占用)
|
// 预结算转正式:带出来源预结算已保存的项目预付核销行(后端保存时转移源行,额度单份占用)
|
||||||
const newIds = this.sources
|
const newIds = this.sources
|
||||||
@@ -2102,7 +2110,7 @@ export default {
|
|||||||
if (index === 0) return '合计';
|
if (index === 0) return '合计';
|
||||||
if (!sumProps.includes(column.property)) return '';
|
if (!sumProps.includes(column.property)) return '';
|
||||||
const total = data.reduce((sum, row) => sum + Number(row[column.property] || 0), 0);
|
const total = data.reduce((sum, row) => sum + Number(row[column.property] || 0), 0);
|
||||||
const totalText = this.formatMoney(total);
|
const totalText = this.formatMoney(total, this.settlementCurrencyCode);
|
||||||
if (column.property === 'settlementAmount' && hasNegativeAdjustment) {
|
if (column.property === 'settlementAmount' && hasNegativeAdjustment) {
|
||||||
return h('span', { style: { color: 'var(--el-color-danger)' } }, totalText);
|
return h('span', { style: { color: 'var(--el-color-danger)' } }, totalText);
|
||||||
}
|
}
|
||||||
@@ -3169,16 +3177,16 @@ export default {
|
|||||||
const body = response?.data || response || {};
|
const body = response?.data || response || {};
|
||||||
return body?.data || body;
|
return body?.data || body;
|
||||||
},
|
},
|
||||||
formatMoney(value) {
|
formatMoney(value, currency = 'RMB') {
|
||||||
return `${Number(value || 0).toFixed(2)} RMB`;
|
return `${Number(value || 0).toFixed(2)} ${currency}`;
|
||||||
},
|
},
|
||||||
formatQuantity(value) {
|
formatDetailTransportQuantity(row) {
|
||||||
if (value === undefined || value === null || value === '') return '-';
|
const value = row.transportQuantity;
|
||||||
|
if (this.readonly && Number(value) === -1) return '-';
|
||||||
const quantity = Number(value);
|
const quantity = Number(value);
|
||||||
return Number.isFinite(quantity) ? quantity.toFixed(2) : '-';
|
if (!Number.isFinite(quantity)) return '-';
|
||||||
},
|
// 与预结算编辑器 formatQuantity 保持一致,拼接计量单位
|
||||||
formatDetailTransportQuantity(value) {
|
return `${quantity.toFixed(2)}${row.quantityUnit ? ` ${row.quantityUnit}` : ''}`;
|
||||||
return this.readonly && Number(value) === -1 ? '-' : this.formatQuantity(value);
|
|
||||||
},
|
},
|
||||||
formatDetailMileage(value) {
|
formatDetailMileage(value) {
|
||||||
return this.readonly && Number(value) === -1 ? '-' : this.displayValue(value);
|
return this.readonly && Number(value) === -1 ? '-' : this.displayValue(value);
|
||||||
@@ -3235,7 +3243,6 @@ export default {
|
|||||||
label: item.dictValue,
|
label: item.dictValue,
|
||||||
value: item.dictValue,
|
value: item.dictValue,
|
||||||
}));
|
}));
|
||||||
this.sortAttachments();
|
|
||||||
},
|
},
|
||||||
resolveAttachmentType(fileName) {
|
resolveAttachmentType(fileName) {
|
||||||
const normalizedName = String(fileName || '').toLocaleLowerCase();
|
const normalizedName = String(fileName || '').toLocaleLowerCase();
|
||||||
@@ -3259,25 +3266,6 @@ export default {
|
|||||||
const typeText = String(item?.label || item?.value || '').trim();
|
const typeText = String(item?.label || item?.value || '').trim();
|
||||||
return typeText === '其他' || typeText === '其他附件';
|
return typeText === '其他' || typeText === '其他附件';
|
||||||
},
|
},
|
||||||
getAttachmentTypeOrder(type) {
|
|
||||||
const normalizedType = String(type || '').trim();
|
|
||||||
const index = this.attachmentTypeOptions.findIndex(
|
|
||||||
item =>
|
|
||||||
String(item.value || '').trim() === normalizedType ||
|
|
||||||
String(item.label || '').trim() === normalizedType
|
|
||||||
);
|
|
||||||
return index === -1 ? Number.MAX_SAFE_INTEGER : index;
|
|
||||||
},
|
|
||||||
sortAttachments() {
|
|
||||||
this.attachments = (this.attachments || [])
|
|
||||||
.map((file, index) => ({ file, index }))
|
|
||||||
.sort((a, b) => {
|
|
||||||
const orderDifference =
|
|
||||||
this.getAttachmentTypeOrder(a.file.type) - this.getAttachmentTypeOrder(b.file.type);
|
|
||||||
return orderDifference || a.index - b.index;
|
|
||||||
})
|
|
||||||
.map(item => item.file);
|
|
||||||
},
|
|
||||||
getMissingAttachmentTypes(files = this.attachments) {
|
getMissingAttachmentTypes(files = this.attachments) {
|
||||||
const uploadedTypes = new Set(
|
const uploadedTypes = new Set(
|
||||||
(files || [])
|
(files || [])
|
||||||
@@ -3307,7 +3295,6 @@ export default {
|
|||||||
size: this.formatAttachmentSize(file.size),
|
size: this.formatAttachmentSize(file.size),
|
||||||
url: file.url || file.link || '',
|
url: file.url || file.link || '',
|
||||||
});
|
});
|
||||||
this.sortAttachments();
|
|
||||||
},
|
},
|
||||||
handleAttachmentSelectionChange(rows) {
|
handleAttachmentSelectionChange(rows) {
|
||||||
this.selectedAttachmentRows = rows || [];
|
this.selectedAttachmentRows = rows || [];
|
||||||
|
|||||||
@@ -371,7 +371,6 @@
|
|||||||
v-model="row.type"
|
v-model="row.type"
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@change="sortAttachments"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in attachmentTypeOptions"
|
v-for="item in attachmentTypeOptions"
|
||||||
@@ -1573,7 +1572,6 @@ export default {
|
|||||||
row => !isApprovalSettlementChange(row.changeContent)
|
row => !isApprovalSettlementChange(row.changeContent)
|
||||||
);
|
);
|
||||||
this.attachments = this.parseAttachments(detail.attachmentsJson);
|
this.attachments = this.parseAttachments(detail.attachmentsJson);
|
||||||
this.sortAttachments();
|
|
||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
if (detail.contractId) {
|
if (detail.contractId) {
|
||||||
await this.ensureContractPartyOptions(detail.contractId, {
|
await this.ensureContractPartyOptions(detail.contractId, {
|
||||||
@@ -3099,7 +3097,6 @@ export default {
|
|||||||
uploadTime: existing?.uploadTime || file.uploadTime || uploadTime,
|
uploadTime: existing?.uploadTime || file.uploadTime || uploadTime,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
this.sortAttachments();
|
|
||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
},
|
},
|
||||||
async loadAttachmentTypeOptions() {
|
async loadAttachmentTypeOptions() {
|
||||||
@@ -3115,7 +3112,6 @@ export default {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.attachmentTypeOptions = [];
|
this.attachmentTypeOptions = [];
|
||||||
}
|
}
|
||||||
this.sortAttachments();
|
|
||||||
},
|
},
|
||||||
resolveAttachmentType(fileName) {
|
resolveAttachmentType(fileName) {
|
||||||
const normalizedName = String(fileName || '').toLocaleLowerCase();
|
const normalizedName = String(fileName || '').toLocaleLowerCase();
|
||||||
@@ -3143,25 +3139,6 @@ export default {
|
|||||||
typeText === '其它附件'
|
typeText === '其它附件'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getAttachmentTypeOrder(type) {
|
|
||||||
const normalizedType = String(type || '').trim();
|
|
||||||
const index = this.attachmentTypeOptions.findIndex(
|
|
||||||
item =>
|
|
||||||
String(item.value || '').trim() === normalizedType ||
|
|
||||||
String(item.label || '').trim() === normalizedType
|
|
||||||
);
|
|
||||||
return index === -1 ? Number.MAX_SAFE_INTEGER : index;
|
|
||||||
},
|
|
||||||
sortAttachments() {
|
|
||||||
this.attachments = (this.attachments || [])
|
|
||||||
.map((file, index) => ({ file, index }))
|
|
||||||
.sort((a, b) => {
|
|
||||||
const orderDifference =
|
|
||||||
this.getAttachmentTypeOrder(a.file.type) - this.getAttachmentTypeOrder(b.file.type);
|
|
||||||
return orderDifference || a.index - b.index;
|
|
||||||
})
|
|
||||||
.map(item => item.file);
|
|
||||||
},
|
|
||||||
attachmentTypeName(type) {
|
attachmentTypeName(type) {
|
||||||
const option = this.attachmentTypeOptions.find(
|
const option = this.attachmentTypeOptions.find(
|
||||||
item => String(item.value) === String(type) || String(item.label) === String(type)
|
item => String(item.value) === String(type) || String(item.label) === String(type)
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
<div class="settlement-detail-page__detail-panel-body">
|
<div class="settlement-detail-page__detail-panel-body">
|
||||||
<el-tabs v-model="detailDialog.activeTab" @tab-change="handleDetailTabChange">
|
<el-tabs v-model="detailDialog.activeTab" @tab-change="handleDetailTabChange">
|
||||||
<el-tab-pane label="费用明细" name="fee">
|
<el-tab-pane label="费用明细" name="fee">
|
||||||
<el-table v-loading="detailDialog.loading" :data="feeRows" border>
|
<el-table v-loading="detailDialog.loading" :data="feeRows" :max-height="detailTableMaxHeight" border>
|
||||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="column in feeDetailColumns"
|
v-for="column in feeDetailColumns"
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="变更记录" name="change">
|
<el-tab-pane label="变更记录" name="change">
|
||||||
<el-table v-loading="latestChangeLoading" :data="latestChangeRows" border>
|
<el-table v-loading="latestChangeLoading" :data="latestChangeRows" :max-height="detailTableMaxHeight" border>
|
||||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="column in changeRecordColumns"
|
v-for="column in changeRecordColumns"
|
||||||
@@ -1063,11 +1063,11 @@ import { getContractOptions as getSettlementContractOptions } from '@/api/settle
|
|||||||
import { getList as getCargoTypeList } from '@/api/base/cargo-type';
|
import { getList as getCargoTypeList } from '@/api/base/cargo-type';
|
||||||
import { exportBlob } from '@/api/common';
|
import { exportBlob } from '@/api/common';
|
||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { formatContractOptionLabel } from '@/utils/contract';
|
|
||||||
import { isTierUnitPrice, isUnitPriceAdjustable } from '@/utils/settlement-adjust-rule';
|
import { isTierUnitPrice, isUnitPriceAdjustable } from '@/utils/settlement-adjust-rule';
|
||||||
import { downloadXls } from '@/utils/util';
|
import { downloadXls } from '@/utils/util';
|
||||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||||
import { settlementListPath } from '@/utils/settlement-menu';
|
import { settlementBillLabel, settlementListPath } from '@/utils/settlement-menu';
|
||||||
|
import { getList as getFormalSettlementList } from '@/api/settlement/formalSettlement';
|
||||||
import {
|
import {
|
||||||
contractApprovalStatusOptions,
|
contractApprovalStatusOptions,
|
||||||
contractCategoryOptions,
|
contractCategoryOptions,
|
||||||
@@ -1144,8 +1144,6 @@ export default {
|
|||||||
rule: null,
|
rule: null,
|
||||||
},
|
},
|
||||||
adjustDialog: { visible: false, loading: false, submitting: false, row: null },
|
adjustDialog: { visible: false, loading: false, submitting: false, row: null },
|
||||||
// 表头 + 最多 3 行费用 + 横向滚动条,超出后表体上下滚动
|
|
||||||
adjustTableMaxHeight: 40 + 49 * 3 + 16,
|
|
||||||
adjustRows: [],
|
adjustRows: [],
|
||||||
adjustDynamicFeeColumns: [],
|
adjustDynamicFeeColumns: [],
|
||||||
adjustTextProps: ['specification', 'model', 'billingFactor', 'billingType'],
|
adjustTextProps: ['specification', 'model', 'billingFactor', 'billingType'],
|
||||||
@@ -1223,18 +1221,28 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
adjustTableMaxHeight() {
|
||||||
|
// 面板满高 min(60vh,560) 减去头部(49)、底部(58)、内边距(32);费用行多时表体内部滚动,表头固定
|
||||||
|
if (!this.adjustDialog.visible) return 40 + 49 * 3 + 16;
|
||||||
|
return Math.round(Math.min(window.innerHeight * 0.6, 560)) - 138;
|
||||||
|
},
|
||||||
|
detailTableMaxHeight() {
|
||||||
|
// 同上,另减 body 下内边距(16) 和 tabs 头(55)
|
||||||
|
if (!this.detailDialog.visible) return 40 + 49 * 3 + 16;
|
||||||
|
return Math.round(Math.min(window.innerHeight * 0.6, 560)) - 178;
|
||||||
|
},
|
||||||
generateContractName() {
|
generateContractName() {
|
||||||
const contract = this.contractOptions.find(
|
const contract = this.contractOptions.find(
|
||||||
item => String(item.id) === String(this.generateQuery.contractId)
|
item => String(item.id) === String(this.generateQuery.contractId)
|
||||||
);
|
);
|
||||||
return formatContractOptionLabel(contract);
|
return contract?.contractName || '';
|
||||||
},
|
},
|
||||||
updateContractName() {
|
updateContractName() {
|
||||||
const contractId = this.updateFeeForm.contractId;
|
const contractId = this.updateFeeForm.contractId;
|
||||||
const contract = [...this.updateContractOptions, ...this.contractOptions].find(
|
const contract = [...this.updateContractOptions, ...this.contractOptions].find(
|
||||||
item => String(item.id) === String(contractId)
|
item => String(item.id) === String(contractId)
|
||||||
);
|
);
|
||||||
return formatContractOptionLabel(contract);
|
return contract?.contractName || '';
|
||||||
},
|
},
|
||||||
updateBillingPlanName() {
|
updateBillingPlanName() {
|
||||||
const billingPlanId = this.updateFeeForm.billingPlanId;
|
const billingPlanId = this.updateFeeForm.billingPlanId;
|
||||||
@@ -1921,8 +1929,9 @@ export default {
|
|||||||
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
|
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.settlementType === 'payable' && column.prop === 'formalSettlementNo') {
|
// 正式结算单号:跳转付款/收款结算单表单页并打开详情(与开票申请等入口一致)
|
||||||
this.openSettlementDetail('/settlement/payment-settlement', row.formalSettlementNo);
|
if (column.prop === 'formalSettlementNo') {
|
||||||
|
this.openFormalSettlementDetail(row.formalSettlementNo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.openDetailDialog(row);
|
this.openDetailDialog(row);
|
||||||
@@ -1934,6 +1943,42 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$router.push({ path, query: { detailNo } });
|
this.$router.push({ path, query: { detailNo } });
|
||||||
},
|
},
|
||||||
|
async openFormalSettlementDetail(formalSettlementNo) {
|
||||||
|
const normalizedNo = String(formalSettlementNo || '')
|
||||||
|
.split(/[、,,]/)
|
||||||
|
.map(item => item.trim())
|
||||||
|
.find(Boolean);
|
||||||
|
if (!normalizedNo) {
|
||||||
|
this.$message.info('当前记录未关联结算单详情');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const data = this.unwrapPage(
|
||||||
|
await getFormalSettlementList(1, 10, { formalSettlementNo: normalizedNo })
|
||||||
|
);
|
||||||
|
const row = (data.records || []).find(
|
||||||
|
item => String(item.formalSettlementNo || '').trim() === normalizedNo
|
||||||
|
);
|
||||||
|
if (!row?.id) {
|
||||||
|
this.$message.warning('未找到对应的正式结算单');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const settlementType = row.settlementType || this.settlementType || 'payable';
|
||||||
|
const listPath = settlementListPath(settlementType);
|
||||||
|
await this.$router.push({
|
||||||
|
path: `${listPath}/form`,
|
||||||
|
query: {
|
||||||
|
mode: 'view',
|
||||||
|
id: row.id,
|
||||||
|
settlementType,
|
||||||
|
listPath,
|
||||||
|
name: `查看${settlementBillLabel(settlementType)}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
this.$message.error('正式结算单详情加载失败');
|
||||||
|
}
|
||||||
|
},
|
||||||
async openRouteDetail(detailId = this.$route.query.detailId) {
|
async openRouteDetail(detailId = this.$route.query.detailId) {
|
||||||
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
||||||
const routePath =
|
const routePath =
|
||||||
|
|||||||
@@ -66,17 +66,21 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #dataScopeDeptIds-form>
|
<template #dataScopeDeptIds-form>
|
||||||
<el-tree
|
<!-- 与用户管理「数据管理权限」一致:组织多选级联,数据源同左侧组织树 -->
|
||||||
|
<el-cascader
|
||||||
v-if="Number(form.dataScopeRange) === 3"
|
v-if="Number(form.dataScopeRange) === 3"
|
||||||
ref="dataScopeTree"
|
v-model="dataScopeCascaderValue"
|
||||||
:data="permissionDeptTree"
|
:options="permissionDeptTree"
|
||||||
show-checkbox
|
:props="deptCascaderProps"
|
||||||
node-key="id"
|
:disabled="isViewMode"
|
||||||
:default-checked-keys="form.dataScopeDeptIds || []"
|
clearable
|
||||||
:props="{ label: 'title', children: 'children' }"
|
filterable
|
||||||
@check="handleDataScopeCheck"
|
collapse-tags
|
||||||
|
collapse-tags-tooltip
|
||||||
|
placeholder="请选择数据权限组织(可多选)"
|
||||||
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
<span v-else class="form-tip">选择「自定义」后可勾选数据权限组织</span>
|
<span v-else class="form-tip">选择「自定义」后可选择数据权限组织</span>
|
||||||
</template>
|
</template>
|
||||||
<template #menu="{ row, index }">
|
<template #menu="{ row, index }">
|
||||||
<el-link
|
<el-link
|
||||||
@@ -193,6 +197,26 @@ export default {
|
|||||||
: [];
|
: [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// 自定义数据权限组织:与用户管理数据管理权限相同的多选级联
|
||||||
|
dataScopeCascaderValue: {
|
||||||
|
get() {
|
||||||
|
const ids = Array.isArray(this.form.dataScopeDeptIds)
|
||||||
|
? this.form.dataScopeDeptIds
|
||||||
|
: this.form.dataScopeDeptIds
|
||||||
|
? String(this.form.dataScopeDeptIds).split(',').filter(Boolean)
|
||||||
|
: [];
|
||||||
|
return ids
|
||||||
|
.filter(item => item !== undefined && item !== null && item !== '')
|
||||||
|
.map(item => (typeof item === 'number' ? item : String(item)));
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.form.dataScopeDeptIds = Array.isArray(value)
|
||||||
|
? value.filter(item => item !== undefined && item !== null && item !== '')
|
||||||
|
: value
|
||||||
|
? [value]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.sensitiveManager = sensitive.create({
|
this.sensitiveManager = sensitive.create({
|
||||||
@@ -228,12 +252,6 @@ export default {
|
|||||||
this.permissionDeptTree = res.data.data || [];
|
this.permissionDeptTree = res.data.data || [];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleDataScopeCheck(_, checked) {
|
|
||||||
if (this.isViewMode) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.form.dataScopeDeptIds = checked.checkedKeys || [];
|
|
||||||
},
|
|
||||||
normalizeSubmitRow(row = {}, isUpdate = false) {
|
normalizeSubmitRow(row = {}, isUpdate = false) {
|
||||||
let payload = { ...row };
|
let payload = { ...row };
|
||||||
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
|
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
|
||||||
@@ -278,17 +296,19 @@ export default {
|
|||||||
detail.identities = detail.identities.split(',').filter(Boolean);
|
detail.identities = detail.identities.split(',').filter(Boolean);
|
||||||
}
|
}
|
||||||
const deptIds = func.split(detail.deptId || '');
|
const deptIds = func.split(detail.deptId || '');
|
||||||
|
const dataScopeDeptIds = Array.isArray(detail.dataScopeDeptIds)
|
||||||
|
? detail.dataScopeDeptIds.map(item => String(item))
|
||||||
|
: detail.dataScopeDeptIds
|
||||||
|
? String(detail.dataScopeDeptIds).split(',').filter(Boolean)
|
||||||
|
: [];
|
||||||
this.form = {
|
this.form = {
|
||||||
...detail,
|
...detail,
|
||||||
deptId: Array.isArray(deptIds) ? deptIds : [],
|
deptId: Array.isArray(deptIds) ? deptIds : [],
|
||||||
dataScopeRange: detail.dataScopeRange || 1,
|
dataScopeRange: detail.dataScopeRange || 1,
|
||||||
dataLevelRange: detail.dataLevelRange || 1,
|
dataLevelRange: detail.dataLevelRange || 1,
|
||||||
dataScopeDeptIds: detail.dataScopeDeptIds || [],
|
dataScopeDeptIds,
|
||||||
};
|
};
|
||||||
this.sensitiveManager?.saveInitialData(this.form);
|
this.sensitiveManager?.saveInitialData(this.form);
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.dataScopeTree?.setCheckedKeys?.(this.form.dataScopeDeptIds || []);
|
|
||||||
});
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -689,6 +689,7 @@ import {
|
|||||||
recognitionIDCard,
|
recognitionIDCard,
|
||||||
recognitionTransportCertificates,
|
recognitionTransportCertificates,
|
||||||
recognizeBaiduOcr,
|
recognizeBaiduOcr,
|
||||||
|
recognizeQualificationCertificateOcr,
|
||||||
} from '@/api/transportCapacity/driver';
|
} from '@/api/transportCapacity/driver';
|
||||||
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
@@ -1322,9 +1323,29 @@ export default {
|
|||||||
},
|
},
|
||||||
handleQualificationUploadSuccess(prop, url) {
|
handleQualificationUploadSuccess(prop, url) {
|
||||||
this.setImage(prop, url);
|
this.setImage(prop, url);
|
||||||
this.recognizeBaiduOcr(url, 'general', '', '从业资格证', data => {
|
this.recognizeQualificationCertificate(url);
|
||||||
this.applyQualificationRecognition(data);
|
},
|
||||||
|
recognizeQualificationCertificate(url) {
|
||||||
|
if (!url) {
|
||||||
|
this.$message.warning('从业资格证图片上传成功,未获取到图片地址,无法自动识别');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const loading = ElLoading.service({
|
||||||
|
lock: true,
|
||||||
|
text: '从业资格证识别中',
|
||||||
|
background: 'rgba(255, 255, 255, 0.7)',
|
||||||
});
|
});
|
||||||
|
recognizeQualificationCertificateOcr(url)
|
||||||
|
.then(res => {
|
||||||
|
this.applyQualificationRecognition(res?.data?.data || {});
|
||||||
|
this.$message.success('从业资格证识别完成');
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.warning('从业资格证图片上传成功,自动识别失败,请手动填写相关信息');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.close();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
recognizeBaiduOcr(url, type, side, documentName, applyRecognition) {
|
recognizeBaiduOcr(url, type, side, documentName, applyRecognition) {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@@ -1614,25 +1635,43 @@ export default {
|
|||||||
return typeof value === 'object' ? value.words || value.value || '' : value || '';
|
return typeof value === 'object' ? value.words || value.value || '' : value || '';
|
||||||
},
|
},
|
||||||
applyQualificationRecognition(data = {}) {
|
applyQualificationRecognition(data = {}) {
|
||||||
const qualificationType = this.getQualificationType(data);
|
const fields = this.normalizeQualificationOcrFields(data);
|
||||||
const qualificationNo = this.getQualificationNo(data);
|
const qualificationType = this.getQualificationOcrValue(fields, [
|
||||||
|
'qualification_category',
|
||||||
|
'从业资格类别',
|
||||||
|
'从业资格类型',
|
||||||
|
]).replace(/[,,;;]+$/, '');
|
||||||
|
const qualificationNo = this.getQualificationOcrValue(fields, [
|
||||||
|
'certificate_no',
|
||||||
|
'证号',
|
||||||
|
'从业资格证号',
|
||||||
|
'资格证号',
|
||||||
|
'证书编号',
|
||||||
|
]);
|
||||||
|
const validFrom = this.getQualificationOcrValue(fields, ['valid_from', '有效起始日期']);
|
||||||
|
const validUntil = this.getQualificationOcrValue(fields, ['valid_until', '有效期限', '有效期']);
|
||||||
const matchedType = this.matchQualificationType(qualificationType);
|
const matchedType = this.matchQualificationType(qualificationType);
|
||||||
if (matchedType) {
|
if (matchedType) {
|
||||||
this.driverForm.qualificationType = matchedType;
|
this.driverForm.qualificationType = matchedType;
|
||||||
} else if (qualificationType && !this.qualificationTypeOptions.length) {
|
} else if (qualificationType && !this.qualificationTypeOptions.length) {
|
||||||
this.driverForm.qualificationType = qualificationType;
|
this.driverForm.qualificationType = qualificationType;
|
||||||
}
|
}
|
||||||
if (qualificationNo && !this.driverForm.qualificationNo) {
|
if (qualificationNo) {
|
||||||
this.driverForm.qualificationNo = String(qualificationNo).replace(/\s/g, '');
|
this.driverForm.qualificationNo = String(qualificationNo).replace(/\s/g, '');
|
||||||
}
|
}
|
||||||
const words = this.getBaiduOcrWords(data).join(' ');
|
const startDate = this.normalizeBirthday(validFrom);
|
||||||
const dateList = words.match(/\d{4}[-/.年]\d{1,2}[-/.月]\d{1,2}日?/g) || [];
|
if (startDate) {
|
||||||
if (/(长期|永久有效)/.test(words)) {
|
this.driverForm.qualificationStartDate = startDate;
|
||||||
|
}
|
||||||
|
if (/(长期|永久)/.test(validUntil)) {
|
||||||
this.driverForm.qualificationLongTerm = 1;
|
this.driverForm.qualificationLongTerm = 1;
|
||||||
this.driverForm.qualificationEndDate = '';
|
this.driverForm.qualificationEndDate = '';
|
||||||
} else if (dateList.length) {
|
} else {
|
||||||
this.driverForm.qualificationEndDate = this.normalizeBirthday(dateList[dateList.length - 1]);
|
const endDate = this.normalizeBirthday(validUntil);
|
||||||
this.driverForm.qualificationLongTerm = 0;
|
if (endDate) {
|
||||||
|
this.driverForm.qualificationEndDate = endDate;
|
||||||
|
this.driverForm.qualificationLongTerm = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
['qualificationType', 'qualificationNo', 'qualificationEndDate'].forEach(prop => {
|
['qualificationType', 'qualificationNo', 'qualificationEndDate'].forEach(prop => {
|
||||||
@@ -1640,22 +1679,25 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getQualificationType(data = {}) {
|
normalizeQualificationOcrFields(result = {}) {
|
||||||
const fieldValue = this.getOcrValue(data, ['从业资格类别', '从业资格类型']);
|
if (result.fields && typeof result.fields === 'object' && !Array.isArray(result.fields)) {
|
||||||
if (fieldValue) return String(fieldValue).trim();
|
return result.fields;
|
||||||
const words = this.getBaiduOcrWords(data);
|
|
||||||
const labelIndex = words.findIndex(word => /从业资格类别|从业资格类型/.test(word));
|
|
||||||
if (labelIndex < 0) return '';
|
|
||||||
const firstValue = words[labelIndex].replace(/^.*?(?:从业资格类别|从业资格类型)\s*[::]?/, '').trim();
|
|
||||||
const values = firstValue ? [firstValue] : [];
|
|
||||||
for (let index = labelIndex + 1; index < words.length; index += 1) {
|
|
||||||
const word = String(words[index] || '').trim();
|
|
||||||
if (!word || /^(有效起始日期|有效期限|核发机关|继续教育信息|诚信考核信息)/.test(word)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
values.push(word);
|
|
||||||
}
|
}
|
||||||
return values.join('').replace(/[,,;;]+$/, '').trim();
|
const keyInfos = result.key_info || result.keyInfo || result.keyInfos || [];
|
||||||
|
if (!Array.isArray(keyInfos)) return {};
|
||||||
|
return Object.fromEntries(
|
||||||
|
keyInfos
|
||||||
|
.filter(item => item && item.key)
|
||||||
|
.map(item => [String(item.key).trim(), String(item.value ?? '').trim()])
|
||||||
|
.filter(([, value]) => value)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
getQualificationOcrValue(fields = {}, keys = []) {
|
||||||
|
const normalizedKeys = keys.map(key => String(key).toLowerCase());
|
||||||
|
const entry = Object.entries(fields).find(([key]) =>
|
||||||
|
normalizedKeys.includes(String(key).toLowerCase())
|
||||||
|
);
|
||||||
|
return entry ? String(entry[1] || '').trim() : '';
|
||||||
},
|
},
|
||||||
matchQualificationType(value = '') {
|
matchQualificationType(value = '') {
|
||||||
const text = String(value || '').replace(/\s/g, '');
|
const text = String(value || '').replace(/\s/g, '');
|
||||||
@@ -1673,27 +1715,6 @@ export default {
|
|||||||
);
|
);
|
||||||
return matched?.value || '';
|
return matched?.value || '';
|
||||||
},
|
},
|
||||||
getQualificationNo(data = {}) {
|
|
||||||
const fieldValue = this.getOcrValue(data, ['从业资格证号', '资格证号', '证书编号']);
|
|
||||||
if (fieldValue) return fieldValue;
|
|
||||||
const words = this.getBaiduOcrWords(data);
|
|
||||||
const labelIndex = words.findIndex(word => /^(?:(?:从业)?资格证号?|证书编号)[::]?$/.test(word));
|
|
||||||
if (labelIndex >= 0 && words[labelIndex + 1]) {
|
|
||||||
return words[labelIndex + 1];
|
|
||||||
}
|
|
||||||
const certificateLine = words.find(word => /(?:从业)?资格证号?|证书编号/.test(word));
|
|
||||||
const match = certificateLine?.match(/(?:(?:从业)?资格证号?|证书编号)\s*[::]?\s*([A-Z0-9-]{6,})/i);
|
|
||||||
return match?.[1] || '';
|
|
||||||
},
|
|
||||||
getBaiduOcrWords(data = {}) {
|
|
||||||
const wordsResult = data.words_result || data.wordsResult || {};
|
|
||||||
if (Array.isArray(wordsResult)) {
|
|
||||||
return wordsResult.map(item => item.words || item.value || '').filter(Boolean);
|
|
||||||
}
|
|
||||||
return Object.values(wordsResult)
|
|
||||||
.map(item => (typeof item === 'object' ? item.words || item.value || '' : item || ''))
|
|
||||||
.filter(Boolean);
|
|
||||||
},
|
|
||||||
normalizeNation(value = '') {
|
normalizeNation(value = '') {
|
||||||
const nation = String(value || '').trim();
|
const nation = String(value || '').trim();
|
||||||
if (!nation) return '';
|
if (!nation) return '';
|
||||||
|
|||||||
@@ -1409,9 +1409,10 @@
|
|||||||
<el-form-item label="自评得分" :required="isOfflineScore">
|
<el-form-item label="自评得分" :required="isOfflineScore">
|
||||||
<el-input
|
<el-input
|
||||||
v-if="isOfflineScore"
|
v-if="isOfflineScore"
|
||||||
v-model="currentScore.selfScore"
|
:model-value="formatScoreValue(currentScore.selfScore)"
|
||||||
maxlength="10"
|
maxlength="10"
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
|
placeholder="请输入自评得分"
|
||||||
@input="handleOfflineSelfScoreInput"
|
@input="handleOfflineSelfScoreInput"
|
||||||
@blur="recalculateOfflineScore"
|
@blur="recalculateOfflineScore"
|
||||||
>
|
>
|
||||||
@@ -2489,8 +2490,14 @@ export default {
|
|||||||
];
|
];
|
||||||
const rows = categoryMap.map((category, index) => {
|
const rows = categoryMap.map((category, index) => {
|
||||||
const details = this.getScoreCategoryDetails(category.categoryCode);
|
const details = this.getScoreCategoryDetails(category.categoryCode);
|
||||||
let selfScore = details.reduce((sum, item) => sum + Number(item.selfScore || 0), 0);
|
const sumCategoryScore = prop =>
|
||||||
let reviewScore = details.reduce((sum, item) => sum + Number(item.reviewScore || 0), 0);
|
details.reduce((sum, item) => {
|
||||||
|
if (this.isBlankScore(item[prop])) return sum;
|
||||||
|
const value = Number(item[prop]);
|
||||||
|
return sum + (Number.isFinite(value) ? value : 0);
|
||||||
|
}, 0);
|
||||||
|
let selfScore = sumCategoryScore('selfScore');
|
||||||
|
let reviewScore = sumCategoryScore('reviewScore');
|
||||||
// 暂定:加分/减分合计最高按 15 分计(分类汇总展示封顶后值)
|
// 暂定:加分/减分合计最高按 15 分计(分类汇总展示封顶后值)
|
||||||
if (category.categoryCode === 'plus') {
|
if (category.categoryCode === 'plus') {
|
||||||
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
||||||
@@ -4552,6 +4559,9 @@ export default {
|
|||||||
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
||||||
evaluateMode: score.evaluateMode === 'offline' ? 'offline' : 'online',
|
evaluateMode: score.evaluateMode === 'offline' ? 'offline' : 'online',
|
||||||
nextEvaluateDate: score.nextEvaluateDate || '',
|
nextEvaluateDate: score.nextEvaluateDate || '',
|
||||||
|
selfScore: this.normalizeScoreInputValue(score.selfScore),
|
||||||
|
reviewScore: this.normalizeScoreInputValue(score.reviewScore),
|
||||||
|
finalScore: this.normalizeScoreInputValue(score.finalScore),
|
||||||
applyCreditLimit: this.normalizeOptionalAmount(
|
applyCreditLimit: this.normalizeOptionalAmount(
|
||||||
score.applyCreditLimit === undefined
|
score.applyCreditLimit === undefined
|
||||||
? this.archiveForm.applyCreditLimit
|
? this.archiveForm.applyCreditLimit
|
||||||
@@ -4565,6 +4575,8 @@ export default {
|
|||||||
details: (score.details || []).map(detail => ({
|
details: (score.details || []).map(detail => ({
|
||||||
...detail,
|
...detail,
|
||||||
scoreInput: this.normalizeScoreInputValue(detail.scoreInput),
|
scoreInput: this.normalizeScoreInputValue(detail.scoreInput),
|
||||||
|
selfScore: this.normalizeScoreInputValue(detail.selfScore),
|
||||||
|
reviewScore: this.normalizeScoreInputValue(detail.reviewScore),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -5345,7 +5357,9 @@ export default {
|
|||||||
return this.getScoreDetailCategoryCode(detail) === 'basic';
|
return this.getScoreDetailCategoryCode(detail) === 'basic';
|
||||||
},
|
},
|
||||||
getSignedScore(detail, prop) {
|
getSignedScore(detail, prop) {
|
||||||
const score = Number(detail[prop] || 0);
|
if (this.isBlankScore(detail[prop])) return '';
|
||||||
|
const score = Number(detail[prop]);
|
||||||
|
if (!Number.isFinite(score)) return '';
|
||||||
return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
|
return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
|
||||||
},
|
},
|
||||||
getScoreItemFullScore(detail = {}) {
|
getScoreItemFullScore(detail = {}) {
|
||||||
@@ -5419,7 +5433,12 @@ export default {
|
|||||||
const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic');
|
const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic');
|
||||||
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
||||||
const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus');
|
const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus');
|
||||||
const sumScore = (list, prop) => list.reduce((sum, item) => sum + Number(item[prop] || 0), 0);
|
const sumScore = (list, prop) =>
|
||||||
|
list.reduce((sum, item) => {
|
||||||
|
if (this.isBlankScore(item[prop])) return sum;
|
||||||
|
const value = Number(item[prop]);
|
||||||
|
return sum + (Number.isFinite(value) ? value : 0);
|
||||||
|
}, 0);
|
||||||
const rawPlusSelf = sumScore(plusDetails, 'selfScore');
|
const rawPlusSelf = sumScore(plusDetails, 'selfScore');
|
||||||
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
||||||
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
||||||
@@ -5434,33 +5453,51 @@ export default {
|
|||||||
const hasReviewScore = details.some(
|
const hasReviewScore = details.some(
|
||||||
item => !this.isBlankScore(item.reviewScore)
|
item => !this.isBlankScore(item.reviewScore)
|
||||||
);
|
);
|
||||||
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计
|
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计;-1 视为未填
|
||||||
const isOffline = String(score.evaluateMode || '') === 'offline';
|
const isOffline = String(score.evaluateMode || '') === 'offline';
|
||||||
|
const hasManualSelfScore = isOffline && !this.isBlankScore(score.selfScore);
|
||||||
|
const hasFilledDetail = details.some(item => {
|
||||||
|
if (this.isScoreTypeDetail(item)) {
|
||||||
|
const input = String(item.scoreInput ?? '').trim();
|
||||||
|
return input !== '' && input !== '-' && input !== '.';
|
||||||
|
}
|
||||||
|
return !this.isBlankScore(item.selectedOption);
|
||||||
|
});
|
||||||
const manualSelfScore = Number(score.selfScore);
|
const manualSelfScore = Number(score.selfScore);
|
||||||
const selfScore =
|
const selfScore =
|
||||||
isOffline && Number.isFinite(manualSelfScore) && String(score.selfScore ?? '').trim() !== ''
|
hasManualSelfScore && Number.isFinite(manualSelfScore) ? manualSelfScore : computedSelfScore;
|
||||||
? manualSelfScore
|
|
||||||
: computedSelfScore;
|
|
||||||
const finalScore = hasReviewScore ? reviewScore : selfScore;
|
const finalScore = hasReviewScore ? reviewScore : selfScore;
|
||||||
const fullMark = this.getScoreFullMark(details);
|
const fullMark = this.getScoreFullMark(details);
|
||||||
const scoreRate =
|
const scoreRate =
|
||||||
fullMark > 0 ? Math.max(0, Math.min(100, (finalScore / fullMark) * 100)) : 0;
|
fullMark > 0 ? Math.max(0, Math.min(100, (finalScore / fullMark) * 100)) : 0;
|
||||||
const standard = this.matchCreditStandard(score, scoreRate);
|
const standard = this.matchCreditStandard(score, scoreRate);
|
||||||
const hasStandards = (score.standards || []).some(item => item && item.creditLevel);
|
const hasStandards = (score.standards || []).some(item => item && item.creditLevel);
|
||||||
score.selfScore = Number(Number(selfScore).toFixed(2));
|
// 线下未手工填写且明细未实际填报时保留空,避免默认写出 -1/0
|
||||||
|
const keepOfflineScoreBlank = isOffline && !hasManualSelfScore && !hasFilledDetail;
|
||||||
|
score.selfScore = keepOfflineScoreBlank ? '' : Number(Number(selfScore).toFixed(2));
|
||||||
score.reviewScore = Number(reviewScore.toFixed(2));
|
score.reviewScore = Number(reviewScore.toFixed(2));
|
||||||
score.finalScore = Number(Number(finalScore).toFixed(2));
|
score.finalScore =
|
||||||
score.scoreRate = Number(scoreRate.toFixed(2));
|
keepOfflineScoreBlank && !hasReviewScore ? '' : Number(Number(finalScore).toFixed(2));
|
||||||
|
score.scoreRate = keepOfflineScoreBlank && !hasReviewScore ? '' : Number(scoreRate.toFixed(2));
|
||||||
if (hasStandards) {
|
if (hasStandards) {
|
||||||
score.creditLevel = standard?.creditLevel || '';
|
score.creditLevel = keepOfflineScoreBlank && !hasReviewScore ? '' : standard?.creditLevel || '';
|
||||||
score.maxCreditLimit = standard
|
score.maxCreditLimit =
|
||||||
? this.calculateCreditLimitByStandard(standard, scoreRate)
|
keepOfflineScoreBlank && !hasReviewScore
|
||||||
: '';
|
? ''
|
||||||
|
: standard
|
||||||
|
? this.calculateCreditLimitByStandard(standard, scoreRate)
|
||||||
|
: '';
|
||||||
}
|
}
|
||||||
return score;
|
return score;
|
||||||
},
|
},
|
||||||
isBlankScore(value) {
|
isBlankScore(value) {
|
||||||
return value === undefined || value === null || String(value).trim() === '';
|
return (
|
||||||
|
value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === -1 ||
|
||||||
|
value === '-1' ||
|
||||||
|
String(value).trim() === ''
|
||||||
|
);
|
||||||
},
|
},
|
||||||
hasIncompleteBasicScoreDetail(details = []) {
|
hasIncompleteBasicScoreDetail(details = []) {
|
||||||
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
|
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
|
||||||
@@ -5968,6 +6005,27 @@ export default {
|
|||||||
this.currentScore.evaluateMode = mode === 'offline' ? 'offline' : 'online';
|
this.currentScore.evaluateMode = mode === 'offline' ? 'offline' : 'online';
|
||||||
if (this.isOfflineScore) {
|
if (this.isOfflineScore) {
|
||||||
this.expandedScoreCategoryKeys = [];
|
this.expandedScoreCategoryKeys = [];
|
||||||
|
// 切到线下且明细尚未实际填报时清空自评,避免沿用线上合计或 -1 哨兵值
|
||||||
|
const hasFilledDetail = (this.currentScore.details || []).some(item => {
|
||||||
|
if (this.isScoreTypeDetail(item)) {
|
||||||
|
const input = String(item.scoreInput ?? '').trim();
|
||||||
|
return input !== '' && input !== '-' && input !== '.';
|
||||||
|
}
|
||||||
|
return !this.isBlankScore(item.selectedOption);
|
||||||
|
});
|
||||||
|
if (!hasFilledDetail || this.isBlankScore(this.currentScore.selfScore)) {
|
||||||
|
this.currentScore.selfScore = '';
|
||||||
|
}
|
||||||
|
if (!hasFilledDetail || this.isBlankScore(this.currentScore.finalScore)) {
|
||||||
|
this.currentScore.finalScore = '';
|
||||||
|
}
|
||||||
|
if (!hasFilledDetail) {
|
||||||
|
this.currentScore.scoreRate = '';
|
||||||
|
this.currentScore.creditLevel = '';
|
||||||
|
this.currentScore.maxCreditLimit = '';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.calculateScore(this.currentScore);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleOfflineSelfScoreInput(value) {
|
handleOfflineSelfScoreInput(value) {
|
||||||
@@ -5981,6 +6039,19 @@ export default {
|
|||||||
},
|
},
|
||||||
recalculateOfflineScore() {
|
recalculateOfflineScore() {
|
||||||
if (!this.isOfflineScore) return;
|
if (!this.isOfflineScore) return;
|
||||||
|
if (this.isBlankScore(this.currentScore.selfScore)) {
|
||||||
|
this.currentScore.selfScore = '';
|
||||||
|
const hasReviewScore = (this.currentScore.details || []).some(
|
||||||
|
item => !this.isBlankScore(item.reviewScore)
|
||||||
|
);
|
||||||
|
if (!hasReviewScore) {
|
||||||
|
this.currentScore.finalScore = '';
|
||||||
|
}
|
||||||
|
this.currentScore.scoreRate = '';
|
||||||
|
this.currentScore.creditLevel = '';
|
||||||
|
this.currentScore.maxCreditLimit = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
const selfScore = Number(this.currentScore.selfScore);
|
const selfScore = Number(this.currentScore.selfScore);
|
||||||
if (!Number.isFinite(selfScore)) return;
|
if (!Number.isFinite(selfScore)) return;
|
||||||
this.currentScore.selfScore = Number(selfScore.toFixed(2));
|
this.currentScore.selfScore = Number(selfScore.toFixed(2));
|
||||||
|
|||||||
Reference in New Issue
Block a user