⚡ 修复运输计划/发货模板列表缓存不刷新,并优化结算导入查看与费用弹窗

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-19 16:56:03 +08:00
parent ccaf944782
commit 5cb7eb16d5
9 changed files with 320 additions and 311 deletions
@@ -135,7 +135,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="结算单上传" prop="file">
<el-form-item v-if="!readonly" label="结算单上传" prop="file">
<div class="settlement-import-create__upload">
<el-upload
ref="uploadRef"
@@ -143,13 +143,13 @@
accept=".xls,.xlsx"
:auto-upload="false"
:limit="1"
:disabled="readonly || !formReady"
:disabled="!formReady"
:file-list="files"
:on-change="onFileChange"
:on-exceed="onFileExceed"
:on-remove="onFileRemove"
>
<el-button type="primary" :disabled="readonly || !formReady">上传 Excel</el-button>
<el-button type="primary" :disabled="!formReady">上传 Excel</el-button>
</el-upload>
<el-link type="primary" :underline="false" @click="downloadTemplate">
下载模板
@@ -298,15 +298,10 @@
</el-table>
</section>
<div class="settlement-import-create__footer">
<div v-if="!readonly" class="settlement-import-create__footer">
<el-button @click="goBack">取消</el-button>
<el-button v-if="!readonly" :loading="draftLoading" @click="saveDraft">保存草稿</el-button>
<el-button
v-if="!readonly"
type="primary"
:loading="confirmLoading"
@click="confirmImport"
>
<el-button :loading="draftLoading" @click="saveDraft">保存草稿</el-button>
<el-button type="primary" :loading="confirmLoading" @click="confirmImport">
确认导入
</el-button>
</div>
@@ -577,6 +572,8 @@ const syncEditedText = (row, column, value) => {
if (column.prop !== 'vehicleNo') return;
applyVehicleNo(row, value);
};
const feeColumn = name => ({
prop: name,
label: name,
editor: 'number',
@@ -1411,12 +1408,18 @@ const loadDetail = async id => {
const detailRows = Array.isArray(detail.rows) ? detail.rows : [];
rows.value = detailRows.map((item, index) => normalizeParsedRow(item, index));
refreshDuplicateFlags();
readonly.value = detail.importStatus && detail.importStatus !== 'draft';
// 查看模式始终只读;编辑时仅草稿可改,已完成/已作废强制只读
readonly.value =
route.query.mode === 'view' ||
Boolean(detail.importStatus && detail.importStatus !== 'draft');
};
const initPage = async () => {
await loadOptions();
const id = route.query.id;
if (route.query.mode === 'view') {
readonly.value = true;
}
if (id) {
await loadDetail(id);
return;