1、车船模块fix bug
2、运力模块fix bug 3、新增设备台账 4、其他bug 修复 5、调整组织、人员模块
This commit is contained in:
@@ -41,23 +41,23 @@
|
||||
>批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<template #menu-right>
|
||||
<el-radio-group
|
||||
v-model="query.expireStatus"
|
||||
class="driver-stat"
|
||||
@change="handleExpireChange"
|
||||
>
|
||||
<el-radio-button label="">全部({{ expiryStat.total }})</el-radio-button>
|
||||
<el-radio-button label="within30"
|
||||
>30天内到期({{ expiryStat.within30 }})</el-radio-button
|
||||
<template #expireStatus-search>
|
||||
<div class="driver-page__expiry-tags">
|
||||
<el-check-tag
|
||||
v-for="item in expiryTagOptions"
|
||||
:key="item.value"
|
||||
:checked="query.expireStatus === item.value"
|
||||
@change="handleExpireChange(item.value)"
|
||||
>
|
||||
<el-radio-button label="expired">已到期({{ expiryStat.expired }})</el-radio-button>
|
||||
</el-radio-group>
|
||||
{{ item.label }}({{ expiryStat[item.statKey] || 0 }})
|
||||
</el-check-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #driverName="{ row }">
|
||||
<el-button type="primary" link @click="openDriver(row, true)">
|
||||
{{ row.driverName }}
|
||||
</el-button>
|
||||
<div class="driver-page__identity">
|
||||
<el-link type="primary" @click="openDriver(row, true)">{{ row.driverName }}</el-link>
|
||||
<span>{{ row.idCardNo || '-' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<el-tag :type="row.status === 1 ? 'primary' : 'info'">
|
||||
@@ -124,7 +124,7 @@
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="司机姓名" prop="driverName">
|
||||
<el-input v-model="driverForm.driverName" maxlength="20" show-word-limit />
|
||||
<el-input v-model="driverForm.driverName" maxlength="10" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -345,8 +345,6 @@
|
||||
v-model="driverForm.qualificationType"
|
||||
clearable
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
>
|
||||
<el-option
|
||||
v-for="item in qualificationTypeOptions"
|
||||
@@ -418,32 +416,35 @@
|
||||
|
||||
<section-card title="司机联系信息">
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="司机类型" prop="driverType">
|
||||
<el-select v-model="driverForm.driverType" filterable>
|
||||
<el-option label="自有" value="自有" />
|
||||
<el-option label="外协" value="外协" />
|
||||
<el-option label="承运管理员" value="承运管理员" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input v-model="driverForm.mobile" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="紧急联系人姓名" prop="emergencyContactName">
|
||||
<el-input v-model="driverForm.emergencyContactName" maxlength="20" />
|
||||
<el-input
|
||||
v-model="driverForm.emergencyContactName"
|
||||
maxlength="20"
|
||||
@input="driverForm.emergencyContactName = removeDigits($event)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="紧急联系人手机号" prop="emergencyContactMobile">
|
||||
<el-input v-model="driverForm.emergencyContactMobile" maxlength="20" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="与联系人关系" prop="contactRelation">
|
||||
<el-select
|
||||
v-model="driverForm.contactRelation"
|
||||
@@ -461,7 +462,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="所属组织" prop="organizationName">
|
||||
<el-select v-model="driverForm.organizationName" clearable filterable>
|
||||
<el-option
|
||||
@@ -502,6 +503,7 @@ import {
|
||||
recognitionTransportCertificates,
|
||||
} from '@/api/transportCapacity/driver';
|
||||
import { getDeptTree } from '@/api/system/dept';
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { getLazyTree } from '@/api/base/region';
|
||||
import { exportBlob } from '@/api/common';
|
||||
import { getToken } from '@/utils/auth';
|
||||
@@ -639,18 +641,8 @@ export default {
|
||||
],
|
||||
educationOptions: ['初中', '高中', '中专', '大专', '本科', '硕士及以上'],
|
||||
drivingTypeOptions: ['A1', 'A2', 'A3', 'B1', 'B2', 'C1', 'C2'],
|
||||
qualificationTypeOptions: [
|
||||
'放射品押运员',
|
||||
'道路运输从业资格证',
|
||||
'危险货物运输从业资格证',
|
||||
'A1',
|
||||
'A2',
|
||||
'B1',
|
||||
'B2',
|
||||
'C1',
|
||||
'C2',
|
||||
],
|
||||
relationOptions: ['父母', '配偶', '子女', '兄弟姐妹', '朋友', '同事'],
|
||||
qualificationTypeOptions: [],
|
||||
relationOptions: ['父母', '配偶', '子女', '兄弟姐妹', '朋友', '同事', '其他'],
|
||||
organizationOptions: [],
|
||||
regionOptions: [],
|
||||
formRules: {
|
||||
@@ -686,6 +678,7 @@ export default {
|
||||
mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
||||
emergencyContactName: [
|
||||
{ required: true, message: '请输入紧急联系人姓名', trigger: 'blur' },
|
||||
{ validator: this.validateEmergencyContactName, trigger: 'blur' },
|
||||
],
|
||||
emergencyContactMobile: [
|
||||
{ required: true, message: '请输入紧急联系人手机号', trigger: 'blur' },
|
||||
@@ -726,10 +719,18 @@ export default {
|
||||
emitPath: true,
|
||||
};
|
||||
},
|
||||
expiryTagOptions() {
|
||||
return [
|
||||
{ label: '全部', value: '', statKey: 'total' },
|
||||
{ label: '30天内到期', value: 'within30', statKey: 'within30' },
|
||||
{ label: '已到期', value: 'expired', statKey: 'expired' },
|
||||
];
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initDeptTree();
|
||||
this.initRegionOptions();
|
||||
this.initQualificationTypeOptions();
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -740,6 +741,16 @@ export default {
|
||||
this.organizationOptions = this.formatDeptOptions(res.data.data || []);
|
||||
const column = this.findColumn(this.option.column, 'organizationName');
|
||||
column.dicData = this.organizationOptions;
|
||||
if (this.driverBox && !this.driverForm.id && !this.driverForm.organizationName) {
|
||||
this.driverForm.organizationName = this.getCurrentOrganizationName();
|
||||
}
|
||||
});
|
||||
},
|
||||
initQualificationTypeOptions() {
|
||||
getDictionary({ code: 'type_of_cert' }).then(res => {
|
||||
this.qualificationTypeOptions = (res.data.data || [])
|
||||
.map(item => item.dictValue)
|
||||
.filter(Boolean);
|
||||
});
|
||||
},
|
||||
formatDeptOptions(tree = [], level = 0) {
|
||||
@@ -749,6 +760,8 @@ export default {
|
||||
result.push({
|
||||
label: `${' '.repeat(level)}${label}`,
|
||||
value: label,
|
||||
rawLabel: label,
|
||||
id: item.id || item.value,
|
||||
});
|
||||
if (item.children && item.children.length) {
|
||||
result.push(...this.formatDeptOptions(item.children, level + 1));
|
||||
@@ -756,6 +769,13 @@ export default {
|
||||
});
|
||||
return result;
|
||||
},
|
||||
getCurrentOrganizationName() {
|
||||
const currentDeptId = this.userInfo.deptId || this.userInfo.dept_id;
|
||||
const currentDept = this.organizationOptions.find(
|
||||
item => String(item.id) === String(currentDeptId)
|
||||
);
|
||||
return currentDept?.rawLabel || this.userInfo.deptName || this.userInfo.dept_name || '';
|
||||
},
|
||||
initRegionOptions() {
|
||||
getLazyTree().then(res => {
|
||||
const regions = this.buildRegionTree(res.data.data || []);
|
||||
@@ -885,10 +905,21 @@ export default {
|
||||
}
|
||||
callback();
|
||||
},
|
||||
validateEmergencyContactName(rule, value, callback) {
|
||||
if (/\d/.test(value || '')) {
|
||||
callback(new Error('紧急联系人姓名不能包含数字'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
removeDigits(value = '') {
|
||||
return String(value).replace(/\d/g, '');
|
||||
},
|
||||
openDriver(row, readonly = false) {
|
||||
this.readonly = readonly;
|
||||
if (!row?.id) {
|
||||
this.driverForm = emptyForm();
|
||||
this.driverForm.organizationName = this.getCurrentOrganizationName();
|
||||
this.driverBox = true;
|
||||
return;
|
||||
}
|
||||
@@ -921,9 +952,9 @@ export default {
|
||||
this.setImage(prop, url);
|
||||
this.recognizeIdCard(url);
|
||||
},
|
||||
handleDrivingLicenseUploadSuccess(prop, url, file = {}) {
|
||||
handleDrivingLicenseUploadSuccess(prop, url) {
|
||||
this.setImage(prop, url);
|
||||
this.drivingLicenseUploads[prop] = this.getUploadRecognitionKey(file, url);
|
||||
this.drivingLicenseUploads[prop] = url;
|
||||
this.recognizeDrivingLicense();
|
||||
},
|
||||
recognizeIdCard(url = '') {
|
||||
@@ -976,10 +1007,10 @@ export default {
|
||||
buildDrivingLicenseRecognitionCertificates() {
|
||||
return ['drivingLicenseFront', 'drivingLicenseBack']
|
||||
.map(prop => {
|
||||
const objectKey = this.drivingLicenseUploads[prop] || this.driverForm[prop];
|
||||
if (!objectKey) return null;
|
||||
const url = this.drivingLicenseUploads[prop] || this.driverForm[prop];
|
||||
if (!url) return null;
|
||||
return {
|
||||
driverLicenseUrl: objectKey,
|
||||
driverLicenseUrl: url,
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
@@ -1046,19 +1077,6 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
getUploadRecognitionKey(file = {}, url = '') {
|
||||
return (
|
||||
file.objectKey ||
|
||||
file.key ||
|
||||
file.fileName ||
|
||||
file.name ||
|
||||
file.link ||
|
||||
file.url ||
|
||||
file.domain ||
|
||||
url ||
|
||||
''
|
||||
);
|
||||
},
|
||||
applyIdCardRecognition(data = {}) {
|
||||
const driverName = data.name || data.driverName || this.getOcrValue(data, ['name', '姓名']);
|
||||
const idCardNo = String(
|
||||
@@ -1206,7 +1224,8 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleExpireChange() {
|
||||
handleExpireChange(expireStatus) {
|
||||
this.query.expireStatus = expireStatus;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
@@ -1322,8 +1341,24 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.driver-page {
|
||||
.driver-stat {
|
||||
flex-shrink: 0;
|
||||
&__identity {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
&__expiry-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-check-tag) {
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table th .cell),
|
||||
@@ -1409,9 +1444,8 @@ export default {
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.driver-page {
|
||||
.driver-stat {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
&__expiry-tags {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user