Merge remote-tracking branch 'origin/master' into feature/hcs-api-p0-web

This commit is contained in:
刘泉佳
2026-10-22 09:43:02 +08:00
108 changed files with 7779 additions and 1683 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/accident-record';
@@ -550,7 +550,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
handleTemplate() {
exportBlob(
@@ -468,7 +468,11 @@ import {
publish,
changeStatus,
} from '@/api/vehicle/credit-score-quantification';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import {
applyIncomingSearch,
normalizeSearchRangeParams,
omitInvalidListStatus,
} from '@/utils/search-range';
import { mapGetters } from 'vuex';
import { isAdministrator } from '@/utils/auth';
@@ -1324,7 +1328,9 @@ export default {
});
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return omitInvalidListStatus(
normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap)
);
},
},
};
+76 -26
View File
@@ -231,7 +231,7 @@
v-if="
hasPermission('customer_archive_sync') &&
row.approvalStatus === 'approved' &&
row.kingdeeStatus === 'failed'
!['synced', 'exist'].includes(row.kingdeeStatus)
"
@click="handleSyncKingdee(row)"
>
@@ -521,7 +521,7 @@
:options="deptTree"
:props="deptCascaderProps"
disabled
placeholder="桂物物流集团"
placeholder="广西现代物流集团有限公司"
/>
</el-form-item>
</el-col>
@@ -1624,7 +1624,7 @@ const customerArchiveListRoute = '/vehicle/customer-archive';
const customerArchiveFormRoute = '/vehicle/customer-archive/form';
const customerArchiveListRefreshKey = 'customer-archive-list-refresh';
/** 客商所属组织固定为顶层组织 */
const FIXED_OWNER_DEPT_NAME = '桂物物流集团';
const FIXED_OWNER_DEPT_NAME = '广西现代物流集团有限公司';
const createTimeRangeMap = {
createTimeRange: ['createTimeStart', 'createTimeEnd'],
@@ -1830,6 +1830,8 @@ export default {
},
/** 业务字典 mk_template「开启MK」=1 */
mkEnabled: false,
/** 是否已完成 MK 开关加载,避免提交时误判 */
_mkEnabledResolved: false,
formRules: {
customerCode: [{ max: 20, message: '客商编号最多20个字符', trigger: 'blur' }],
fullName: [{ required: true, message: '请输入客商名称', trigger: 'blur' }],
@@ -1910,7 +1912,7 @@ export default {
editBtn: false,
selection: true,
dialogClickModal: false,
menuWidth: 320,
menuWidth: 400,
column: [
{
label: '客商编号',
@@ -2086,7 +2088,6 @@ export default {
search: true,
searchOrder: 6,
searchValue: '',
dataType: 'number',
minWidth: 100,
dicData: [
{ label: '全部', value: '' },
@@ -2385,7 +2386,13 @@ export default {
sessionStorage.setItem(customerArchiveListRefreshKey, '1');
},
hasPermission(code) {
return this.isAdmin || this.validData(this.permission[code], false);
if (this.isAdmin) {
return true;
}
const permission = this.permission || {};
const value = permission[code];
// 不依赖 Avue validData,避免权限值为 true 以外的真值时被误判
return value === true || value === 'true' || value === 1 || value === '1';
},
mergeSelectOptions(target, values) {
const list = Array.isArray(values) ? values : values ? [values] : [];
@@ -3146,12 +3153,15 @@ export default {
});
},
initMkEnabled() {
this._mkEnabledResolved = false;
loadMkEnabled()
.then(enabled => {
this.mkEnabled = !!enabled;
this._mkEnabledResolved = true;
})
.catch(() => {
this.mkEnabled = false;
this._mkEnabledResolved = true;
});
},
initScoreQuantificationOptions() {
@@ -3251,7 +3261,7 @@ export default {
);
},
/**
* 客商所属组织固定为顶层「桂物物流集团」,表单不可编辑。
* 客商所属组织固定为顶层「广西现代物流集团有限公司」,表单不可编辑。
*/
applyFixedOwnerDept() {
if (!this.isArchivePage || this.readonly) {
@@ -4530,15 +4540,34 @@ export default {
});
},
/**
* 列表 / 新增 / 编辑提交共用:开启 MK 时提交审核流,并更新客商审批状态
* 列表 / 新增 / 编辑提交共用:
* 未开启 MK 时仅走本地提交审批(与新增一致,不请求 MK 流程);
* 开启 MK 时先提交审核流,再更新客商审批状态。
*/
submitCustomerApproval(id, fullName = '', approvalStatus = '') {
return submitMkApprovalFlow({
bizType: 'customer-archive',
bizId: id,
subjectName: fullName,
approvalStatus,
}).then(() => submitApproval(id));
const submitLocal = () => submitApproval(id);
const run = enabled => {
this.mkEnabled = !!enabled;
this._mkEnabledResolved = true;
if (!this.mkEnabled) {
return submitLocal();
}
return submitMkApprovalFlow({
bizType: 'customer-archive',
bizId: id,
subjectName: fullName,
approvalStatus,
mkEnabled: true,
}).then(submitLocal);
};
// 与列表按钮一致:以页面 mkEnabled 为准,未开启时不请求 MK
if (this._mkEnabledResolved) {
return run(this.mkEnabled);
}
return loadMkEnabled()
.then(enabled => run(enabled))
.catch(() => run(false));
},
openReviewScore() {
const scores = this.archiveForm.scores || [];
@@ -5316,19 +5345,9 @@ export default {
this.onLoad(this.page);
},
searchChange(params, done) {
// 搜索区所属组织级联返回的是 ID 路径数组,取末级 ID 转成部门名称传给后端(与列表接口 deptName 字段一致)
if (Array.isArray(params.deptName)) {
const path = params.deptName.filter(
item => item !== undefined && item !== null && item !== ''
);
const deptId = path.length ? path[path.length - 1] : '';
params.deptName = deptId
? this.deptOptions.find(item => String(item.value) === String(deptId))?.rawLabel || ''
: '';
}
this.query = this.buildQuery(params);
this.page.currentPage = 1;
this.onLoad(this.page);
this.onLoad(this.page, this.query);
done();
},
selectionChange(list) {
@@ -5429,7 +5448,38 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
// 新条件覆盖旧条件;本次显式清空的字段必须从查询里去掉,避免第二次搜索仍带着上一次的客商名称。
const merged = { ...this.query, ...params };
Object.keys(params).forEach(key => {
const value = params[key];
if (
value === '' ||
value === null ||
value === undefined ||
(Array.isArray(value) && value.length === 0)
) {
delete merged[key];
}
});
if (Array.isArray(merged.deptName)) {
const path = merged.deptName.filter(
item => item !== undefined && item !== null && item !== ''
);
const deptId = path.length ? path[path.length - 1] : '';
merged.deptName = deptId
? this.deptOptions.find(item => String(item.value) === String(deptId))?.rawLabel || ''
: '';
if (!merged.deptName) {
delete merged.deptName;
}
}
const values = normalizeSearchRangeParams(merged, createTimeRangeMap);
// 状态下拉「全部」会被数字类型转成 0/-1,二次搜索会把列表滤空。
const status = values.status;
if (status === 0 || status === '0' || status === -1 || status === '-1') {
delete values.status;
}
return values;
},
},
};
+2 -2
View File
@@ -220,7 +220,7 @@ import { downloadXls } from '@/utils/util';
import { handleImportExcel } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { getUploadHeaders } from '@/utils/upload';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import { mapGetters } from 'vuex';
import { ElLoading } from 'element-plus';
import { excelOption, exportColumns, option } from '@/option/vehicle/insurance-record';
@@ -409,7 +409,7 @@ export default {
: integerPart;
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
validateRow(row) {
if (row.startDate && row.endDate && row.endDate < row.startDate) {
+2 -2
View File
@@ -195,7 +195,7 @@ import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
@@ -903,7 +903,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+4 -6
View File
@@ -168,7 +168,7 @@ import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { formatUpdateUserName } from '@/utils/audit';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
@@ -371,9 +371,8 @@ export default {
placeholder: '日期时间选择器',
},
{
label: '里程/航程数(公里)',
label: '里程/航程数',
prop: 'mileage',
renderHeader: () => '里程/航程数',
type: 'input',
minWidth: 130,
slot: true,
@@ -391,6 +390,7 @@ export default {
],
value: '公里',
hide: true,
display: false,
},
{
label: '备注',
@@ -565,12 +565,10 @@ export default {
const mileageUnit = vehicleType === '船舶' ? '海里' : '公里';
const vehicleTypeColumn = this.findColumn(this.option.column, 'vehicleType');
const vehicleNoColumn = this.findColumn(this.option.column, 'vehicleNo');
const mileageColumn = this.findColumn(this.option.column, 'mileage');
const mileageUnitColumn = this.findColumn(this.option.column, 'mileageUnit');
vehicleNoColumn.placeholder =
vehicleType === '船舶' ? '请选择船号' : '请选择车牌号';
vehicleTypeColumn.disabled = Boolean(this.form.id);
mileageColumn.label = `里程/航程数(${mileageUnit})`;
mileageUnitColumn.value = mileageUnit;
this.form.mileageUnit = mileageUnit;
if (!this.isDetailLoading && oldValue && vehicleType !== oldValue) {
@@ -833,7 +831,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+2 -2
View File
@@ -210,7 +210,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/mileage-record';
@@ -607,7 +607,7 @@ export default {
},
buildQuery(params = {}) {
return normalizeSearchRangeParams(
{ ...params, ...this.query, vehicleType: '车辆' },
{ ...applyIncomingSearch(this.query, params), vehicleType: '车辆' },
createTimeRangeMap
);
},
@@ -155,7 +155,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/tire-replacement-record';
@@ -500,7 +500,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
handleTemplate() {
exportBlob(
@@ -130,7 +130,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
import { excelOption, exportColumns, option } from '@/option/vehicle/transport-change-record';
@@ -478,7 +478,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
handleTemplate() {
exportBlob(
+2 -2
View File
@@ -197,7 +197,7 @@ import { exportBlob } from '@/api/common';
import { downloadXls } from '@/utils/util';
import { openImportDialog } from '@/utils/import-excel';
import { getToken, isAdministrator } from '@/utils/auth';
import { normalizeSearchRangeParams } from '@/utils/search-range';
import { applyIncomingSearch, normalizeSearchRangeParams } from '@/utils/search-range';
import AddressMapPicker from '@/components/address-map-picker/main.vue';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { mapGetters } from 'vuex';
@@ -673,7 +673,7 @@ export default {
};
},
buildQuery(params = {}) {
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
return normalizeSearchRangeParams(applyIncomingSearch(this.query, params), createTimeRangeMap);
},
handleTemplate() {
exportBlob(