2025/07/23 车辆类型 改成数据字典BIANMA
parent
2727a67c2a
commit
553210c7b3
|
@ -183,7 +183,7 @@ export default {
|
|||
const { list } = await getVehicleTypeList();
|
||||
const TYPE_LIST = [];
|
||||
for (let i = 0; i < list.length; i++){
|
||||
TYPE_LIST.push({id: list[i].DICTIONARIES_ID, name: list[i].NAME})
|
||||
TYPE_LIST.push({id: list[i].BIANMA, name: list[i].NAME})
|
||||
}
|
||||
this.VEHICLE_TYPE_LIST = TYPE_LIST;
|
||||
},
|
||||
|
@ -233,56 +233,61 @@ export default {
|
|||
this.userList = resData.data;
|
||||
},
|
||||
async fnSubmit() {
|
||||
try {
|
||||
await this.$refs.formRef.validate()
|
||||
const checkRes = await goCheckLicenceNo({
|
||||
LICENCE_NO: this.form.LICENCE_NO,
|
||||
licenceType: this.form.LICENCE_TYPE,
|
||||
VEHICLE_ID: this.VEHICLE_ID
|
||||
});
|
||||
if (checkRes.exists === '1') {
|
||||
uni.$u.toast('车牌号已存在')
|
||||
return
|
||||
}
|
||||
const vehicleImgs = [];
|
||||
const drivingImgs = [];
|
||||
for (let i = 0; i < this.form.vehicleImgFiles.length; i++) {
|
||||
if (!this.form.vehicleImgFiles[i].imgfilesId) {
|
||||
const { imgUrl } = await uploadSmd({
|
||||
filePath: this.form.vehicleImgFiles[i].url,
|
||||
name: "file",
|
||||
});
|
||||
vehicleImgs.push(imgUrl);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.form.drivingImgFiles.length; i++) {
|
||||
if (!this.form.drivingImgFiles[i].imgfilesId) {
|
||||
const { imgUrl } = await uploadSmd({
|
||||
filePath: this.form.drivingImgFiles[i].url,
|
||||
name: "file",
|
||||
});
|
||||
drivingImgs.push(imgUrl);
|
||||
}
|
||||
}
|
||||
this.form.OLD_LICENCE_NO = this.form.LICENCE_NO;
|
||||
const params = {
|
||||
...this.form,
|
||||
DEPARTMENT_ID: this.userInfo.DEPARTMENT_ID,
|
||||
USER_ID: this.userInfo.USER_ID,
|
||||
USER_NAME: this.userInfo.NAME,
|
||||
VEHICLE_DEPARTMENT_ID: this.userInfo.DEPARTMENT_ID,
|
||||
VEHICLE_DEPARTMENT_NAME: this.userInfo.DEPARTMENT_NAME,
|
||||
vehicleImgs: JSON.stringify(vehicleImgs),
|
||||
drivingImgs: JSON.stringify(drivingImgs),
|
||||
deleteFileIds: JSON.stringify(this.form.deleteFileIds),
|
||||
vehicleImgFiles: null,
|
||||
drivingImgFiles: null,
|
||||
}
|
||||
this.VEHICLE_ID ? await setVehiclemessageUpdate(params) : await setVehiclemessageSave(params)
|
||||
uni.navigateBack(); // 返回上一页
|
||||
} catch {
|
||||
uni.$u.toast('请补全必填项')
|
||||
await this.$refs.formRef.validate()
|
||||
const checkRes = await goCheckLicenceNo({
|
||||
LICENCE_NO: this.form.LICENCE_NO,
|
||||
licenceType: this.form.LICENCE_TYPE,
|
||||
VEHICLE_ID: this.VEHICLE_ID
|
||||
});
|
||||
if (checkRes.exists === '1') {
|
||||
uni.$u.toast('车牌号已存在')
|
||||
return
|
||||
}
|
||||
const vehicleImgs = [];
|
||||
const drivingImgs = [];
|
||||
for (let i = 0; i < this.form.vehicleImgFiles.length; i++) {
|
||||
if (!this.form.vehicleImgFiles[i].imgfilesId) {
|
||||
const { imgUrl } = await uploadSmd({
|
||||
filePath: this.form.vehicleImgFiles[i].url,
|
||||
name: "file",
|
||||
});
|
||||
vehicleImgs.push(imgUrl);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.form.drivingImgFiles.length; i++) {
|
||||
if (!this.form.drivingImgFiles[i].imgfilesId) {
|
||||
const { imgUrl } = await uploadSmd({
|
||||
filePath: this.form.drivingImgFiles[i].url,
|
||||
name: "file",
|
||||
});
|
||||
drivingImgs.push(imgUrl);
|
||||
}
|
||||
}
|
||||
this.form.OLD_LICENCE_NO = this.form.LICENCE_NO;
|
||||
const params = {
|
||||
...this.form,
|
||||
DEPARTMENT_ID: this.userInfo.DEPARTMENT_ID,
|
||||
USER_ID: this.userInfo.USER_ID,
|
||||
USER_NAME: this.userInfo.NAME,
|
||||
VEHICLE_DEPARTMENT_ID: this.userInfo.DEPARTMENT_ID,
|
||||
VEHICLE_DEPARTMENT_NAME: this.userInfo.DEPARTMENT_NAME,
|
||||
vehicleImgs: JSON.stringify(vehicleImgs),
|
||||
drivingImgs: JSON.stringify(drivingImgs),
|
||||
deleteFileIds: JSON.stringify(this.form.deleteFileIds),
|
||||
vehicleImgFiles: null,
|
||||
drivingImgFiles: null,
|
||||
}
|
||||
let resData
|
||||
if(this.VEHICLE_ID){
|
||||
resData = await setVehiclemessageUpdate(params)
|
||||
}else{
|
||||
resData = await setVehiclemessageSave(params);
|
||||
}
|
||||
if (resData.code === '500') {
|
||||
uni.$u.toast(resData.msg)
|
||||
return
|
||||
}
|
||||
uni.navigateBack(); // 返回上一页
|
||||
},
|
||||
fnAfterRead(event, key) {
|
||||
// 统一处理为数组格式 (兼容单文件/多文件上传)
|
||||
|
|
|
@ -147,7 +147,7 @@ export default {
|
|||
const { list } = await getVehicleTypeList();
|
||||
const TYPE_LIST = [];
|
||||
for (let i = 0; i < list.length; i++){
|
||||
TYPE_LIST.push({id: list[i].DICTIONARIES_ID, name: list[i].NAME})
|
||||
TYPE_LIST.push({id: list[i].BIANMA, name: list[i].NAME})
|
||||
}
|
||||
const TYPE_MAP = new Map(TYPE_LIST.map(item => [item.id, item.name]));
|
||||
// 如果你需要将 Map 转换为普通对象
|
||||
|
|
|
@ -96,7 +96,7 @@ export default {
|
|||
const { list } = await getVehicleTypeList();
|
||||
const TYPE_LIST = [];
|
||||
for (let i = 0; i < list.length; i++){
|
||||
TYPE_LIST.push({id: list[i].DICTIONARIES_ID, name: list[i].NAME})
|
||||
TYPE_LIST.push({id: list[i].BIANMA, name: list[i].NAME})
|
||||
}
|
||||
const TYPE_MAP = new Map(TYPE_LIST.map(item => [item.id, item.name]));
|
||||
// 如果你需要将 Map 转换为普通对象
|
||||
|
|
Loading…
Reference in New Issue