🐛 修复车务非必填-1展示,并完善总单调度与运单表单体验
调度页限制上一段到达后才可调度;司机候选项点击展开;车务多模块-1显示为空;同步配载/总单编辑与导入相关优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1549,6 +1549,10 @@ import SectionCard from '@/components/section-card/main.vue';
|
||||
import PdfPreview from '@/components/pdf-preview/main.vue';
|
||||
import ChangeRecordDetailDialog from '@/components/change-record-detail-dialog/main.vue';
|
||||
|
||||
const customerArchiveListRoute = '/vehicle/customer-archive';
|
||||
const customerArchiveFormRoute = '/vehicle/customer-archive/form';
|
||||
const customerArchiveListRefreshKey = 'customer-archive-list-refresh';
|
||||
|
||||
const createTimeRangeMap = {
|
||||
createTimeRange: ['createTimeStart', 'createTimeEnd'],
|
||||
};
|
||||
@@ -1646,6 +1650,8 @@ export default {
|
||||
readonly: false,
|
||||
reviewMode: false,
|
||||
listActivated: false,
|
||||
// 表单页实例标记:创建时按路由落定,避免 keep-alive 缓存后随全局 $route 翻转
|
||||
isFormPageInstance: false,
|
||||
originalAccessType: '',
|
||||
activeTab: 'scores',
|
||||
archiveForm: this.emptyArchive(),
|
||||
@@ -2033,6 +2039,7 @@ export default {
|
||||
this.openArchive({ id }, true);
|
||||
return;
|
||||
}
|
||||
this.isFormPageInstance = this.$route.path === customerArchiveFormRoute;
|
||||
this.initDeptTree();
|
||||
this.initRegionOptions();
|
||||
this.initBusinessDictionaries();
|
||||
@@ -2046,7 +2053,13 @@ export default {
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
if (this.isArchivePage || this.isPublicViewPage) return;
|
||||
if (this.isFormPageInstance || this.isPublicViewPage) return;
|
||||
if (sessionStorage.getItem(customerArchiveListRefreshKey)) {
|
||||
sessionStorage.removeItem(customerArchiveListRefreshKey);
|
||||
this.onLoad(this.page, this.query);
|
||||
this.listActivated = true;
|
||||
return;
|
||||
}
|
||||
if (!this.listActivated) {
|
||||
this.listActivated = true;
|
||||
return;
|
||||
@@ -2065,9 +2078,7 @@ export default {
|
||||
};
|
||||
},
|
||||
isArchivePage() {
|
||||
return (
|
||||
this.$route.path === '/vehicle/customer-archive/form' || this.isPublicViewPage
|
||||
);
|
||||
return this.isFormPageInstance || this.isPublicViewPage;
|
||||
},
|
||||
isPublicViewPage() {
|
||||
return (
|
||||
@@ -2256,6 +2267,16 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
if (this.isFormPageInstance || this.isPublicViewPage) return;
|
||||
if (
|
||||
to.path === customerArchiveListRoute &&
|
||||
from?.path?.includes('/customer-archive/form')
|
||||
) {
|
||||
sessionStorage.removeItem(customerArchiveListRefreshKey);
|
||||
this.onLoad(this.page, this.query);
|
||||
}
|
||||
},
|
||||
'archiveForm.registeredDetailAddress'() {
|
||||
this.$nextTick(() => this.checkOverflow('registeredDetailInput', 'registeredDetailOverflow'));
|
||||
},
|
||||
@@ -2264,6 +2285,9 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
markCustomerArchiveListNeedRefresh() {
|
||||
sessionStorage.setItem(customerArchiveListRefreshKey, '1');
|
||||
},
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission[code], false);
|
||||
},
|
||||
@@ -4016,27 +4040,28 @@ export default {
|
||||
openArchivePage(row) {
|
||||
const isEdit = Boolean(row?.id);
|
||||
this.$router.push({
|
||||
path: '/vehicle/customer-archive/form',
|
||||
path: customerArchiveFormRoute,
|
||||
query: isEdit ? { id: row.id, name: '编辑客商档案' } : { name: '新增客商档案' },
|
||||
});
|
||||
},
|
||||
viewArchive(row) {
|
||||
this.$router.push({
|
||||
path: '/vehicle/customer-archive/form',
|
||||
path: customerArchiveFormRoute,
|
||||
query: { id: row.id, name: '查看客商档案', view: '1' },
|
||||
});
|
||||
},
|
||||
openReview(row) {
|
||||
this.$router.push({
|
||||
path: '/vehicle/customer-archive/form',
|
||||
path: customerArchiveFormRoute,
|
||||
query: { id: row.id, name: '客商复评', review: '1' },
|
||||
});
|
||||
},
|
||||
closeArchive() {
|
||||
if (this.isPublicViewPage) return;
|
||||
this.archiveBox = false;
|
||||
this.markCustomerArchiveListNeedRefresh();
|
||||
this.$router.$avueRouter?.closeTag?.();
|
||||
this.$router.push('/vehicle/customer-archive');
|
||||
this.$router.push(customerArchiveListRoute);
|
||||
},
|
||||
openArchive(row, readonly = false) {
|
||||
this.readonly = readonly;
|
||||
|
||||
Reference in New Issue
Block a user