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

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

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-27 21:26:55 +08:00
parent c268d2e64d
commit 98fbf123f5
29 changed files with 1150 additions and 250 deletions
+45 -12
View File
@@ -1034,6 +1034,11 @@ import { fallbackPlugin, imagePlugin, officePlugin, textPlugin } from '@open-fil
import '@open-file-viewer/core/style.css';
import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.mjs?url';
const contractManageListRoute = '/business/contract-manage';
const contractManageFormRoute = '/business/contract-manage/form';
const contractManageDetailRoute = '/business/contract-manage/detail';
const contractManageListRefreshKey = 'contract-manage-list-refresh';
const clone = value => JSON.parse(JSON.stringify(value));
const normalizeOptionalInteger = (value, emptyValue = null) => {
if (value === undefined || value === null || value === '' || Number(value) < 0) {
@@ -1296,6 +1301,9 @@ export default {
flowBox: false,
flowUrl: '',
processInstanceId: '',
// 页面形态在实例创建时锁定,避免 keep-alive 缓存后随全局 $route 翻转
formPageLocked: false,
detailPageLocked: false,
};
},
computed: {
@@ -1313,15 +1321,13 @@ export default {
return this.hasPermission(`${this.config.permission}_add`);
},
isListPage() {
return !this.isFormPage && !this.isDetailPage;
return !this.formPageLocked && !this.detailPageLocked && !this.isPublicViewPage;
},
isFormPage() {
return this.$route.path === '/business/contract-manage/form';
return this.formPageLocked;
},
isDetailPage() {
return (
this.$route.path === '/business/contract-manage/detail' || this.isPublicViewPage
);
return this.detailPageLocked || this.isPublicViewPage;
},
isPublicViewPage() {
return this.$route.path === '/business/contract-manage/public-view';
@@ -1484,9 +1490,21 @@ export default {
},
},
watch: {
'$route.fullPath'() {
if (this.isFormPage) this.initFormPage();
if (this.isDetailPage) this.initDetailPage();
$route(to, from) {
if (this.isListPage) {
if (
to.path === contractManageListRoute &&
(from?.path?.includes('/contract-manage/form') ||
from?.path?.includes('/contract-manage/detail') ||
from?.path?.includes('/contract-manage/change'))
) {
sessionStorage.removeItem(contractManageListRefreshKey);
this.onLoad(this.page, this.query);
}
return;
}
if (this.formPageLocked && to.path === contractManageFormRoute) this.initFormPage();
if (this.detailPageLocked && to.path === contractManageDetailRoute) this.initDetailPage();
},
settlementConfigTab(tab, oldTab) {
if (tab === oldTab) return;
@@ -1498,6 +1516,9 @@ export default {
},
},
created() {
this.formPageLocked = this.$route.path === contractManageFormRoute;
this.detailPageLocked =
this.$route.path === contractManageDetailRoute || this.isPublicViewPage;
if (!this.isPublicViewPage) {
this.loadProjectOptions();
this.loadSettlementDictionaries();
@@ -1506,7 +1527,17 @@ export default {
if (this.isFormPage) this.initFormPage();
if (this.isDetailPage) this.initDetailPage();
},
activated() {
if (!this.isListPage) return;
if (sessionStorage.getItem(contractManageListRefreshKey)) {
sessionStorage.removeItem(contractManageListRefreshKey);
this.onLoad(this.page, this.query);
}
},
methods: {
markContractManageListNeedRefresh() {
sessionStorage.setItem(contractManageListRefreshKey, '1');
},
buildTableOption() {
return {
...option,
@@ -1648,7 +1679,7 @@ export default {
},
openForm(mode, row = {}) {
this.$router.push({
path: '/business/contract-manage/form',
path: contractManageFormRoute,
query:
mode === 'edit'
? { mode, id: row.id, name: '编辑合同管理' }
@@ -1741,8 +1772,9 @@ export default {
this.$nextTick(() => this.$refs.contractForm?.clearValidate());
},
closeForm() {
this.markContractManageListNeedRefresh();
this.$router.$avueRouter?.closeTag?.();
this.$router.push('/business/contract-manage');
this.$router.push(contractManageListRoute);
},
validateBase(action) {
if (action === 'temporary') {
@@ -2532,8 +2564,9 @@ export default {
});
},
closeDetail() {
this.markContractManageListNeedRefresh();
this.$router.$avueRouter?.closeTag?.();
this.$router.push('/business/contract-manage');
this.$router.push(contractManageListRoute);
},
applyDetailState(detail = {}) {
this.detailRow = {
@@ -2876,7 +2909,7 @@ export default {
},
handleCopy(row) {
this.$router.push({
path: '/business/contract-manage/form',
path: contractManageFormRoute,
query: { mode: 'add', copyId: row.id, name: '新增合同管理' },
});
},