Merge remote-tracking branch 'origin/master'

This commit is contained in:
2026-10-14 12:45:02 +08:00
3 changed files with 66 additions and 21 deletions
@@ -636,6 +636,12 @@ export default {
} }
const value = row[prop]; const value = row[prop];
if (value === undefined || value === null || value === '') return '-'; if (value === undefined || value === null || value === '') return '-';
if (
(prop === 'usedFundLimit' || prop === 'remainingFundLimit') &&
Number(value) === -1
) {
return '-';
}
return value; return value;
}, },
applyDetail(detail) { applyDetail(detail) {
@@ -164,8 +164,8 @@
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column label="操作" width="120" fixed="right" align="center"> <el-table-column label="操作" width="120" fixed="right" align="center">
<template #default> <template #default="{ row }">
<el-link type="primary" @click="openChangeRecordsDialog">查看详情</el-link> <el-link type="primary" @click="openChangeRecordsDialog(row)">查看详情</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -1049,6 +1049,7 @@ export default {
priceUnitLoading: false, priceUnitLoading: false,
priceUnitRequest: null, priceUnitRequest: null,
changeRows: [], changeRows: [],
changeBatchRecords: [],
changePage: { current: 1, size: 10, total: 0 }, changePage: { current: 1, size: 10, total: 0 },
latestChangeRows: [], latestChangeRows: [],
latestChangeLoading: false, latestChangeLoading: false,
@@ -2030,34 +2031,64 @@ export default {
this.latestChangeLoading = true; this.latestChangeLoading = true;
this.latestChangeRows = []; this.latestChangeRows = [];
try { try {
const res = await api.getChangeRecords(1, 1, { const res = await api.getChangeRecords(1, 1000, {
detailId: this.detailDialog.row.id, detailId: this.detailDialog.row.id,
}); });
const data = this.unwrapPage(res); const data = this.unwrapPage(res);
this.latestChangeRows = (data.records || []).slice(0, 1); this.latestChangeRows = this.buildChangeRecordBatches(data.records || []);
} finally { } finally {
this.latestChangeLoading = false; this.latestChangeLoading = false;
} }
}, },
openChangeRecordsDialog() { buildChangeRecordBatches(records = []) {
const batchMap = new Map();
records.forEach(record => {
const batchKey = record.adjustTime || '';
if (!batchMap.has(batchKey)) {
batchMap.set(batchKey, []);
}
batchMap.get(batchKey).push(record);
});
return Array.from(batchMap.entries()).map(([batchKey, batchRecords]) => {
const first = batchRecords[0] || {};
const lineNos = [
...new Set(batchRecords.map(item => item.lineNo).filter(value => value !== undefined && value !== null && value !== '')),
];
const cargoNames = [
...new Set(
batchRecords.map(item => item.cargoName).filter(value => value !== undefined && value !== null && value !== '')
),
];
const changeContents = batchRecords
.map(item => item.changeContent)
.filter(value => value !== undefined && value !== null && value !== '');
return {
...first,
lineNo: lineNos.join('、'),
cargoName: cargoNames.join('、'),
changeContent: changeContents.join(';'),
adjustUserName: first.adjustUserName,
adjustReason: first.adjustReason,
adjustTime: first.adjustTime || batchKey,
_batchKey: batchKey,
_batchRecords: batchRecords,
};
});
},
openChangeRecordsDialog(row) {
if (!this.detailDialog.row) return; if (!this.detailDialog.row) return;
this.changeBatchRecords = Array.isArray(row?._batchRecords) ? row._batchRecords : [];
this.changeRecordsDialog.visible = true; this.changeRecordsDialog.visible = true;
this.changePage.current = 1; this.changePage.current = 1;
this.loadChangeRecords(); this.loadChangeRecords();
}, },
async loadChangeRecords() { loadChangeRecords() {
if (!this.detailDialog.row) return; const records = this.changeBatchRecords || [];
this.changeRecordsDialog.loading = true; const size = Number(this.changePage.size) || 10;
try { const current = Number(this.changePage.current) || 1;
const res = await api.getChangeRecords(this.changePage.current, this.changePage.size, { const fromIndex = Math.max(0, (current - 1) * size);
detailId: this.detailDialog.row.id, this.changeRows = records.slice(fromIndex, fromIndex + size);
}); this.changePage.total = records.length;
const data = this.unwrapPage(res);
this.changeRows = data.records || [];
this.changePage.total = data.total || 0;
} finally {
this.changeRecordsDialog.loading = false;
}
}, },
handleChangeSizeChange() { handleChangeSizeChange() {
this.changePage.current = 1; this.changePage.current = 1;
+11 -3
View File
@@ -333,9 +333,17 @@ export default {
callback(new Error('上级组织未配置组织编码,请先完善上级组织编码')); callback(new Error('上级组织未配置组织编码,请先完善上级组织编码'));
return; return;
} }
const pattern = new RegExp(`^${escapeRegExp(this.parentDeptCode)}-\\d+$`); // 公司:GWWL+三位数字;部门:所属公司编码+三位数字;其他:上级编码+三位数字(中间不加-)
let expectedPrefix = this.parentDeptCode;
const category = Number(this.form?.deptCategory);
if (category === 2) {
expectedPrefix = 'GWWL';
} else if (category === 3 && this.form?.belongCompanyCode) {
expectedPrefix = String(this.form.belongCompanyCode).trim();
}
const pattern = new RegExp(`^${escapeRegExp(expectedPrefix)}\\d{3}$`);
if (!pattern.test(deptCode)) { if (!pattern.test(deptCode)) {
callback(new Error(`组织编码格式应为:${this.parentDeptCode}-分段数字`)); callback(new Error(`组织编码格式应为:${expectedPrefix}三位数字(不足补零,中间不加-)`));
return; return;
} }
callback(); callback();
@@ -650,7 +658,7 @@ export default {
methods: { methods: {
handleOaOrgFullSync() { handleOaOrgFullSync() {
this.$confirm( this.$confirm(
'全量同步将拉取 OA 全部公司/部门;已存在且 OA 更新时间一致的记录会跳过。是否清除非顶级组织?选择“是”将先删除顶级以外的组织后再同步;选择“否”则直接全量同步。', '全量同步将拉取 OA 全部公司/部门;已存在且 OA 更新时间一致的记录会跳过。是否清除后同步?选择“是”将保留顶级「外部组织」与集团锚点(id=135/GWWL),删除其余组织后再同步;选择“否”则直接全量同步。',
'全量同步', '全量同步',
{ {
confirmButtonText: '是', confirmButtonText: '是',