修复业务模块bug

This commit is contained in:
2026-08-13 14:07:04 +08:00
parent 6554ad80dd
commit f62e36e846
15 changed files with 941 additions and 186 deletions
+35 -21
View File
@@ -46,7 +46,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="运输类型">
<el-form-item label="运输方式">
<el-select
v-model="searchForm.transportType"
clearable
@@ -300,7 +300,7 @@
</el-table-column>
<el-table-column label="承运商" prop="carrierName" min-width="160" show-overflow-tooltip />
<el-table-column
label="运输类型"
label="运输方式"
prop="transportType"
min-width="150"
show-overflow-tooltip
@@ -555,7 +555,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="运输类型">
<el-form-item label="运输方式">
<el-select
v-model="candidateQuery.transportType"
clearable
@@ -621,7 +621,7 @@
/>
<el-table-column
prop="transportType"
label="运输类型"
label="运输方式"
min-width="130"
show-overflow-tooltip
/>
@@ -947,6 +947,7 @@ import {
import { ElMessage, ElMessageBox } from 'element-plus';
import { Location, Rank, Refresh, Setting } from '@element-plus/icons-vue';
import dayjs from 'dayjs';
import { isMobile } from '@/utils/validate';
const defaultTransportType = '';
const defaultCandidateTransportType = '';
@@ -1253,26 +1254,30 @@ export default {
formatRouteAddress(row, type) {
const prefix = type === 'departure' ? 'departure' : type === 'arrival' ? 'arrival' : 'transit';
const values = [
row[`${prefix}Name`],
row[`${prefix}RegionName`],
row[`${prefix}DistrictName`],
row[`${prefix}Address`],
]
.filter(Boolean)
.flatMap(value => this.splitText(value));
const addressType = [
row[`${prefix}AddressType`],
row[`${prefix}Type`],
row.addressType,
]
.filter(Boolean)
.join('');
const isStation = /港口|码头|机场|铁路|车站|空港/.test(`${addressType}${values[0] || ''}`);
const displayValues = values.filter(
(value, index) => index === 0 || isStation || !row[`${prefix}Name`] || value !== row[`${prefix}Address`]
);
if (type === 'transit') return displayValues.join(',') || '-';
return (isStation ? displayValues[0] : row[`${prefix}Name`] || displayValues[0]) || '-';
.flatMap(value => this.splitText(value))
.map(value => this.formatCityDistrict(value))
.filter(Boolean);
return [...new Set(values)].join(',') || '-';
},
formatCityDistrict(value) {
const text = String(value || '').trim();
if (!text) return '';
const cityIndex = text.indexOf('市');
const provinceIndex = Math.max(text.lastIndexOf('省', cityIndex), text.lastIndexOf('自治区', cityIndex));
const cityStart = provinceIndex > -1 ? provinceIndex + 1 : 0;
const districtStart = cityIndex > -1 ? cityIndex + 1 : cityStart;
const districtMatch = text
.slice(districtStart)
.match(/(?:自治县|自治旗|林区|矿区|新区|开发区|区|县|旗)/);
if (districtMatch) {
return text.slice(cityStart, districtStart + districtMatch.index + districtMatch[0].length);
}
return cityIndex > -1 ? text.slice(cityStart, cityIndex + 1) : text;
},
rowActions(row) {
const status = row.businessStatus;
@@ -1804,7 +1809,8 @@ export default {
planDate: item.planDate || waybill.startDate || '',
unitPrice: item.unitPrice || waybill.unitPrice || '',
materialCode: item.materialCode || '',
equipmentCode: item.equipmentCode || '',
equipmentCode:
item.equipmentCode || item.deviceCode || waybill.equipmentCode || waybill.deviceCode || '',
brand: item.brand || item.brandName || waybill.brand || '',
specificationModel:
item.specificationModel || item.specModel || item.specification || waybill.specificationModel || '',
@@ -1840,7 +1846,15 @@ export default {
return false;
}
if (!this.dialogForm.transportType) {
ElMessage.warning('请选择运输类型');
ElMessage.warning('请选择运输方式');
return false;
}
const invalidPhone = [
[this.dialogForm.driverPhone, '手机号'],
[this.dialogForm.escortPhone, '押运人手机号'],
].find(([value]) => String(value || '').trim() && !isMobile(value));
if (invalidPhone) {
ElMessage.warning(`${invalidPhone[1]}格式不正确`);
return false;
}
if (draftMode) {