1、车船模块fix bug
2、运力模块fix bug 3、新增设备台账 4、其他bug 修复 5、调整组织、人员模块
This commit is contained in:
@@ -41,18 +41,17 @@
|
||||
>批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<template #menu-right>
|
||||
<el-radio-group
|
||||
v-model="query.expireStatus"
|
||||
class="vehicle-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="transport-vehicle-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 #plateNo="{ row }">
|
||||
<el-button type="primary" link @click="openVehicle(row, true)">
|
||||
@@ -64,6 +63,14 @@
|
||||
{{ row.status === 1 ? '启用' : '停用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #boundDriver>
|
||||
<span>-</span>
|
||||
</template>
|
||||
<template #certificationStatus="{ row }">
|
||||
<el-tag :type="getCertificationStatus(row).type">
|
||||
{{ getCertificationStatus(row).label }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #drivingLicenseEndDate="{ row }">
|
||||
<span :class="getDateClass(row, 'drivingLicenseEndDate', 'drivingLicenseLongTerm')">
|
||||
{{ formatEndDate(row.drivingLicenseEndDate, row.drivingLicenseLongTerm) }}
|
||||
@@ -94,6 +101,10 @@
|
||||
>
|
||||
修改
|
||||
</el-link>
|
||||
<el-link type="primary" @click="openVehicleLedger(row)">综合台账</el-link>
|
||||
<el-link type="primary" v-if="row.certificationStatus === 0" @click="openCertificationAudit(row)">
|
||||
审核
|
||||
</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
v-if="hasPermission('transport_vehicle_status')"
|
||||
@@ -104,6 +115,26 @@
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<vehicle-ledger v-model="vehicleLedgerBox" :vehicle="ledgerVehicle" />
|
||||
|
||||
<el-dialog v-model="certificationAuditBox" title="车辆认证审核" width="92%" top="4vh">
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item v-for="item in auditDetailItems" :key="item.label" :label="item.label">
|
||||
{{ formatAuditValue(item) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-form v-if="showRejectReason" class="certification-audit__reason" label-position="right" label-width="auto">
|
||||
<el-form-item label="驳回原因" required>
|
||||
<el-input v-model="certificationRejectReason" type="textarea" maxlength="200" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="certificationAuditBox = false">取消</el-button>
|
||||
<el-button type="danger" @click="handleCertificationReject">认证驳回</el-button>
|
||||
<el-button type="primary" @click="handleCertificationApprove">认证通过</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
append-to-body
|
||||
@@ -201,29 +232,26 @@
|
||||
<div class="dimension-group">
|
||||
<div class="dimension-group__item">
|
||||
<span class="dimension-group__label">长</span>
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="vehicleForm.outerLength"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
inputmode="numeric"
|
||||
@input="vehicleForm.outerLength = digitsOnly($event)"
|
||||
/>
|
||||
</div>
|
||||
<div class="dimension-group__item">
|
||||
<span class="dimension-group__label">宽</span>
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="vehicleForm.outerWidth"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
inputmode="numeric"
|
||||
@input="vehicleForm.outerWidth = digitsOnly($event)"
|
||||
/>
|
||||
</div>
|
||||
<div class="dimension-group__item">
|
||||
<span class="dimension-group__label">高</span>
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="vehicleForm.outerHeight"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
inputmode="numeric"
|
||||
@input="vehicleForm.outerHeight = digitsOnly($event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -233,21 +261,19 @@
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="核定载质量(KG)" prop="approvedLoadKg">
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="vehicleForm.approvedLoadKg"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
inputmode="numeric"
|
||||
@input="vehicleForm.approvedLoadKg = digitsOnly($event)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="准牵引总质量(KG)" prop="tractionMassKg">
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="vehicleForm.tractionMassKg"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
inputmode="numeric"
|
||||
@input="vehicleForm.tractionMassKg = digitsOnly($event)"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -509,6 +535,7 @@ import {
|
||||
submit,
|
||||
remove,
|
||||
changeStatus,
|
||||
auditCertification,
|
||||
getExpiryStat,
|
||||
recognitionTransportCertificates,
|
||||
} from '@/api/transportCapacity/transport-vehicle';
|
||||
@@ -518,6 +545,7 @@ import { getToken } from '@/utils/auth';
|
||||
import { getUploadHeaders } from '@/utils/upload';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
import ImageUploadField from '@/components/image-upload-field/main.vue';
|
||||
import VehicleLedger from './components/vehicle-ledger.vue';
|
||||
|
||||
const emptyForm = () => ({
|
||||
id: '',
|
||||
@@ -599,6 +627,7 @@ const plateColorOptions = ['黄牌', '蓝牌', '绿牌'].map(item => ({ label: i
|
||||
export default {
|
||||
components: {
|
||||
ImageUploadField,
|
||||
VehicleLedger,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -607,7 +636,9 @@ export default {
|
||||
query: {
|
||||
expireStatus: '',
|
||||
},
|
||||
searchForm: {},
|
||||
searchForm: {
|
||||
businessRelation: '',
|
||||
},
|
||||
loading: true,
|
||||
submitLoading: false,
|
||||
data: [],
|
||||
@@ -624,6 +655,12 @@ export default {
|
||||
expired: 0,
|
||||
},
|
||||
vehicleBox: false,
|
||||
vehicleLedgerBox: false,
|
||||
ledgerVehicle: {},
|
||||
certificationAuditBox: false,
|
||||
certificationAuditForm: {},
|
||||
certificationRejectReason: '',
|
||||
showRejectReason: false,
|
||||
readonly: false,
|
||||
vehicleForm: emptyForm(),
|
||||
vehicleCertificateUploads: {},
|
||||
@@ -643,7 +680,10 @@ export default {
|
||||
energyTypeOptions: ['柴油', '汽油', '新能源', '天然气'],
|
||||
formRules: {
|
||||
organizationName: [{ required: true, message: '请选择所属组织', trigger: 'change' }],
|
||||
plateNo: [{ validator: this.validatePlateNo, trigger: 'change' }],
|
||||
plateNo: [
|
||||
{ required: true, message: '请输入车牌号', trigger: 'change' },
|
||||
{ validator: this.validatePlateNo, trigger: 'change' },
|
||||
],
|
||||
vehicleType: [{ required: true, message: '请选择车辆类型', trigger: 'change' }],
|
||||
approvedLoadKg: [{ required: true, message: '请输入核定载质量', trigger: 'blur' }],
|
||||
businessRelation: [{ required: true, message: '请选择业务关系', trigger: 'change' }],
|
||||
@@ -681,6 +721,25 @@ export default {
|
||||
}
|
||||
return this.vehicleForm.id ? '修改车辆' : '新增车辆';
|
||||
},
|
||||
auditDetailItems() {
|
||||
return [
|
||||
['所属组织', 'organizationName'], ['车牌号', 'plateNo'], ['车牌颜色', 'plateColor'],
|
||||
['车辆类型', 'vehicleType'], ['外廓长度(mm)', 'outerLength'], ['外廓宽度(mm)', 'outerWidth'],
|
||||
['外廓高度(mm)', 'outerHeight'], ['核定载质量(KG)', 'approvedLoadKg'], ['准牵引总质量(KG)', 'tractionMassKg'],
|
||||
['业务关系', 'businessRelation'], ['能源类型', 'energyType'], ['强制报废日期', 'compulsoryScrapDate'],
|
||||
['海关备案号', 'customsRecordNo'], ['行驶证档案编号', 'drivingLicenseNo'], ['行驶证有效期起', 'drivingLicenseStartDate'],
|
||||
['行驶证有效期止', 'drivingLicenseEndDate'], ['道路运输证号', 'roadTransportCertNo'], ['道路运输证有效期起', 'roadTransportCertStartDate'],
|
||||
['道路运输证有效期止', 'roadTransportCertEndDate'], ['道路运输年审有效期', 'annualReviewEndDate'],
|
||||
['机动车登记编号', 'registrationNo'], ['机动车登记日期', 'registrationDate'], ['备注', 'remark'],
|
||||
].map(([label, prop]) => ({ label, prop }));
|
||||
},
|
||||
expiryTagOptions() {
|
||||
return [
|
||||
{ label: '全部', value: '', statKey: 'total' },
|
||||
{ label: '30天内到期', value: 'within30', statKey: 'within30' },
|
||||
{ label: '已到期', value: 'expired', statKey: 'expired' },
|
||||
];
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initDeptTree();
|
||||
@@ -694,6 +753,9 @@ export default {
|
||||
this.organizationOptions = this.flattenDeptOptions(res.data.data || []);
|
||||
const column = this.findColumn(this.option.column, 'organizationName');
|
||||
column.dicData = this.organizationOptions;
|
||||
if (this.vehicleBox && !this.vehicleForm.id && !this.vehicleForm.organizationName) {
|
||||
this.vehicleForm.organizationName = this.getCurrentOrganizationName();
|
||||
}
|
||||
});
|
||||
},
|
||||
flattenDeptOptions(tree = [], level = 0) {
|
||||
@@ -703,6 +765,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.flattenDeptOptions(item.children, level + 1));
|
||||
@@ -710,6 +774,16 @@ 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 || '';
|
||||
},
|
||||
digitsOnly(value = '') {
|
||||
return String(value).replace(/\D/g, '');
|
||||
},
|
||||
validatePlateNo(rule, value, callback) {
|
||||
const plateProvince = String(this.vehicleForm.plateProvince || '').trim();
|
||||
const plateNoBody = String(this.vehicleForm.plateNoBody || '')
|
||||
@@ -737,6 +811,7 @@ export default {
|
||||
this.readonly = readonly;
|
||||
if (!row?.id) {
|
||||
this.vehicleForm = emptyForm();
|
||||
this.vehicleForm.organizationName = this.getCurrentOrganizationName();
|
||||
this.syncPlateNo(false);
|
||||
this.vehicleBox = true;
|
||||
return;
|
||||
@@ -751,6 +826,38 @@ export default {
|
||||
this.vehicleBox = true;
|
||||
});
|
||||
},
|
||||
openVehicleLedger(row) {
|
||||
this.ledgerVehicle = { ...row };
|
||||
this.vehicleLedgerBox = true;
|
||||
},
|
||||
openCertificationAudit(row) {
|
||||
getDetail(row.id).then(res => {
|
||||
this.certificationAuditForm = { ...(res.data.data || {}) };
|
||||
this.certificationRejectReason = '';
|
||||
this.showRejectReason = false;
|
||||
this.certificationAuditBox = true;
|
||||
});
|
||||
},
|
||||
formatAuditValue(item) {
|
||||
const value = this.certificationAuditForm[item.prop];
|
||||
return value === undefined || value === null || value === '' ? '-' : value;
|
||||
},
|
||||
handleCertificationApprove() {
|
||||
auditCertification(this.certificationAuditForm.id, 1).then(() => {
|
||||
this.$message.success('认证已通过');
|
||||
this.certificationAuditBox = false;
|
||||
this.onLoad(this.page);
|
||||
});
|
||||
},
|
||||
handleCertificationReject() {
|
||||
if (!this.showRejectReason) { this.showRejectReason = true; return; }
|
||||
if (!this.certificationRejectReason.trim()) { this.$message.warning('请输入认证驳回原因'); return; }
|
||||
auditCertification(this.certificationAuditForm.id, 2, this.certificationRejectReason).then(() => {
|
||||
this.$message.success('认证已驳回');
|
||||
this.certificationAuditBox = false;
|
||||
this.onLoad(this.page);
|
||||
});
|
||||
},
|
||||
resetVehicle() {
|
||||
this.vehicleForm = emptyForm();
|
||||
this.vehicleCertificateUploads = {};
|
||||
@@ -762,9 +869,9 @@ export default {
|
||||
this.vehicleForm[prop] = url;
|
||||
this.$refs.vehicleForm?.validateField(prop);
|
||||
},
|
||||
handleVehicleCertificateUploadSuccess(prop, url, file = {}) {
|
||||
handleVehicleCertificateUploadSuccess(prop, url) {
|
||||
this.setImage(prop, url);
|
||||
this.vehicleCertificateUploads[prop] = this.getUploadRecognitionKey(file, url);
|
||||
this.vehicleCertificateUploads[prop] = url;
|
||||
this.recognizeVehicleCertificates();
|
||||
},
|
||||
recognizeVehicleCertificates() {
|
||||
@@ -845,19 +952,6 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
getUploadRecognitionKey(file = {}, url = '') {
|
||||
return (
|
||||
file.objectKey ||
|
||||
file.key ||
|
||||
file.fileName ||
|
||||
file.name ||
|
||||
file.link ||
|
||||
file.url ||
|
||||
file.domain ||
|
||||
url ||
|
||||
''
|
||||
);
|
||||
},
|
||||
normalizeDate(value = '') {
|
||||
const dateValue = String(value || '').trim();
|
||||
const match = dateValue.match(/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?$/);
|
||||
@@ -948,7 +1042,8 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleExpireChange() {
|
||||
handleExpireChange(expireStatus) {
|
||||
this.query.expireStatus = expireStatus;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
@@ -962,7 +1057,9 @@ export default {
|
||||
});
|
||||
},
|
||||
searchReset() {
|
||||
this.searchForm = {};
|
||||
this.searchForm = {
|
||||
businessRelation: '',
|
||||
};
|
||||
this.query = {
|
||||
expireStatus: this.query.expireStatus,
|
||||
};
|
||||
@@ -1063,14 +1160,44 @@ export default {
|
||||
}
|
||||
return '';
|
||||
},
|
||||
getCertificationStatus(row) {
|
||||
if (row.certificationStatus === 0) return { label: '认证中', type: 'warning' };
|
||||
if (row.certificationStatus === 1) return { label: '已认证', type: 'success' };
|
||||
if (row.certificationStatus === 2) return { label: '已驳回', type: 'danger' };
|
||||
const today = this.$dayjs().startOf('day');
|
||||
const certificateDates = [
|
||||
[row.drivingLicenseEndDate, row.drivingLicenseLongTerm],
|
||||
[row.roadTransportCertEndDate, row.roadTransportCertLongTerm],
|
||||
];
|
||||
if (certificateDates.some(([date, longTerm]) => longTerm !== 1 && !date)) {
|
||||
return { label: '未认证', type: 'info' };
|
||||
}
|
||||
if (
|
||||
certificateDates.some(
|
||||
([date, longTerm]) => longTerm !== 1 && this.$dayjs(date).isBefore(today, 'day')
|
||||
)
|
||||
) {
|
||||
return { label: '已过期', type: 'danger' };
|
||||
}
|
||||
return { label: '已认证', type: 'success' };
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.transport-vehicle-page {
|
||||
.vehicle-stat {
|
||||
flex-shrink: 0;
|
||||
&__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),
|
||||
@@ -1193,7 +1320,7 @@ export default {
|
||||
}
|
||||
|
||||
.date-warning {
|
||||
color: #f56c6c;
|
||||
color: #d40000;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user