🐛 修复车务非必填-1展示,并完善总单调度与运单表单体验

调度页限制上一段到达后才可调度;司机候选项点击展开;车务多模块-1显示为空;同步配载/总单编辑与导入相关优化。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-27 21:27:14 +08:00
co-authored by Cursor
parent c268d2e64d
commit 98fbf123f5
29 changed files with 1150 additions and 250 deletions
@@ -3173,9 +3173,11 @@ const AMAP_KEY = '653b7cf105ad7fb8ec9b2f5198ade315';
const AMAP_SECURITY_CODE = '5aab65c632e48ebae0d0e28f5b28e21a';
let amapLoader;
const standaloneWaybillFormRoute = '/business/waybill-manage/form';
const standaloneWaybillFormPaths = ['/business/waybill-manage', standaloneWaybillFormRoute];
const standaloneWaybillListRoute = '/business/waybill-manage';
const standaloneWaybillFormPaths = [standaloneWaybillListRoute, standaloneWaybillFormRoute];
const standaloneWaybillDetailRoute = '/business/waybill-manage/detail';
const loadingCreateWaybillsStorageKey = 'loading-manage-create-waybills';
const waybillManageListRefreshKey = 'waybill-manage-list-refresh';
const attachmentViewerPlugins = [
imagePlugin(),
@@ -3692,6 +3694,14 @@ export default {
deactivated() {
this.closeInnerDialogs();
},
activated() {
// 列表实例被 keep-alive 重新激活时,按标记拉取最新数据
if (this.formPageLocked || this.detailPageLocked) return;
if (sessionStorage.getItem(waybillManageListRefreshKey)) {
sessionStorage.removeItem(waybillManageListRefreshKey);
this.onLoad(this.page, this.query);
}
},
beforeUnmount() {
this.closeInnerDialogs();
},
@@ -3999,7 +4009,19 @@ export default {
},
watch: {
$route(to, from) {
if (!this.isStandaloneWaybillFormPage) return;
// 列表实例:从表单/详情返回时刷新,避免 keep-alive 仍显示旧数据
if (!this.formPageLocked && !this.detailPageLocked) {
if (
to.path === standaloneWaybillListRoute &&
(from?.path?.includes('/waybill-manage/form') ||
from?.path?.includes('/waybill-manage/detail'))
) {
sessionStorage.removeItem(waybillManageListRefreshKey);
this.onLoad(this.page, this.query);
}
return;
}
if (!this.formPageLocked || !this.isStandaloneWaybillFormPage) return;
if (
to.query.mode !== from?.query?.mode ||
String(to.query.id || '') !== String(from?.query?.id || '')
@@ -4708,8 +4730,9 @@ export default {
this.waybillTrackInfo = null;
this.waybillTrackHint = '';
if (this.isStandaloneWaybillDetailPage) {
this.markWaybillListNeedRefresh();
this.$router.$avueRouter?.closeTag?.();
this.$router.push({ path: '/business/waybill-manage', query: {} });
this.$router.push({ path: standaloneWaybillListRoute, query: {} });
return;
}
this.detailBox = false;
@@ -5438,6 +5461,12 @@ export default {
if (this.config.saveAsDraft && saveAsDraft) {
submitRow[this.config.draftStatusProp || 'approvalStatus'] =
this.config.draftStatus || 'draft';
} else if (
this.config.draftStatusProp === 'businessStatus' &&
submitRow.businessStatus === (this.config.draftStatus || 'draft')
) {
// 正式提交:清空草稿态,由后端按过程配置校正为待执行/进行中
submitRow.businessStatus = '';
}
delete submitRow.basicInfoTitle;
delete submitRow.templateInfoTitle;
@@ -5675,6 +5704,7 @@ export default {
})
: Promise.resolve();
return after.then(() => {
this.markWaybillListNeedRefresh();
this.onLoad(this.page);
this.$message({ type: 'success', message: '提交成功!' });
done();
@@ -5713,6 +5743,7 @@ export default {
});
return after.then(() => {
this.attachmentUploadMode = false;
this.markWaybillListNeedRefresh();
this.onLoad(this.page);
this.$message({ type: 'success', message: skipMk ? '操作成功!' : '提交成功!' });
done();
@@ -5729,6 +5760,9 @@ export default {
getSaveRequest() {
return this.api.submit;
},
markWaybillListNeedRefresh() {
sessionStorage.setItem(waybillManageListRefreshKey, '1');
},
handleDraftSave() {
const request =
typeof this.api.saveDraft === 'function' ? this.api.saveDraft : this.api.submit;
@@ -5739,6 +5773,7 @@ export default {
request(submitRow)
.then(() => {
this.$message.success(`${this.config.draftSaveText || '保存'}成功`);
this.markWaybillListNeedRefresh();
this.onLoad(this.page, this.query);
this.closeCrudDialog();
})
@@ -5748,8 +5783,10 @@ export default {
},
closeCrudDialog() {
if (this.isStandaloneWaybillPage) {
// 关闭独立表单/详情页时标记列表需刷新(含直接点关闭未保存的场景)
this.markWaybillListNeedRefresh();
this.$router.$avueRouter?.closeTag?.();
this.$router.push({ path: '/business/waybill-manage', query: {} });
this.$router.push({ path: standaloneWaybillListRoute, query: {} });
return;
}
const crud = this.$refs.crud;