diff --git a/src/views/enterprise_management/basics_info_management/freight_trailer/edit.vue b/src/views/enterprise_management/basics_info_management/freight_trailer/edit.vue index ad2add2..5d123e1 100644 --- a/src/views/enterprise_management/basics_info_management/freight_trailer/edit.vue +++ b/src/views/enterprise_management/basics_info_management/freight_trailer/edit.vue @@ -233,6 +233,7 @@ import { getFreightTrailerView, setFreightTrailerAdd, setFreightTrailerEdit, + findTrailerByPlateNumber, } from "@/request/enterprise_management.js"; import { setUploadImg } from "@/request/api.js"; import { ElMessage } from "element-plus"; @@ -243,6 +244,7 @@ const route = useRoute(); const router = useRouter(); const FREIGHTTRAILER_ID = route.query.FREIGHTTRAILER_ID; const formRef = ref(null); +let plateNumber = ''; const form = ref({ NUM: "", PLATE_NUMBER: "", @@ -269,6 +271,19 @@ const form = ref({ OPER_CERTIFICATE_IMG: [], TRAILER_INFO: [], }); +const isPlateNumberRepetition = async (rule, vehicleNumber, callback) => { + if (vehicleNumber) { + const vehicleCount = await findTrailerByPlateNumber({ vehicleNumber }); + if (vehicleCount.pd) { + if (vehicleCount.pd.PLATE_NUMBER === plateNumber) { + callback(); + } else { + callback(new Error("车辆已存在")); + } + } else callback(); + } +}; + const isVehicleNumber = (rule, vehicleNumber, callback) => { if (vehicleNumber) { const xreg = @@ -279,6 +294,7 @@ const isVehicleNumber = (rule, vehicleNumber, callback) => { if (creg.test(vehicleNumber) === false) { callback(new Error("格式错误")); } else callback(); + } else if (vehicleNumber.length === 8) { if (xreg.test(vehicleNumber) === false) { callback(new Error("格式错误")); @@ -292,6 +308,7 @@ const rules = { PLATE_NUMBER: [ { required: true, message: "请输入", trigger: "blur" }, { validator: isVehicleNumber, trigger: "blur" }, + { validator: isPlateNumberRepetition, trigger: "blur" }, ], VIN: [{ required: true, message: "请输入", trigger: "blur" }], TRAILER_TYPE: [{ required: true, message: "请输入", trigger: "blur" }], @@ -321,6 +338,7 @@ const fnGetData = async () => { resData.operCertificateImgs ); form.value.TRAILER_INFO = addingPrefixToFile(resData.trailerInfoImgs); + plateNumber = form.value.PLATE_NUMBER }; fnGetData(); diff --git a/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue b/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue index e961fe7..dea9fcc 100644 --- a/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue +++ b/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue @@ -36,11 +36,15 @@ - + @@ -168,6 +172,7 @@ import { debounce } from "throttle-debounce"; import { ElMessageBox, ElMessage } from "element-plus"; import LayoutImportFile from "@/components/import_file/index.vue"; import { reactive } from "vue"; +import LayoutDepartment from "@/components/department/index.vue"; const router = useRouter(); const data = reactive({ importDialogVisible: false, diff --git a/src/views/enterprise_management/user_practitioner/choiceadd.vue b/src/views/enterprise_management/user_practitioner/choiceadd.vue index 4a17484..a70fbe5 100644 --- a/src/views/enterprise_management/user_practitioner/choiceadd.vue +++ b/src/views/enterprise_management/user_practitioner/choiceadd.vue @@ -250,7 +250,7 @@ {{ item.period.WORKSTATUS === "1" ? "上班" : "休班" }} @@ -276,24 +276,24 @@ - - + + - - + + - - + +
- 返回 + 返回
@@ -288,12 +303,15 @@ import { getPractitionerInfo } from "@/request/user_practitioner.js"; import { reactive } from "vue"; import { useRoute, useRouter } from "vue-router"; + const FILE_URL = import.meta.env.VITE_FILE_URL; const route = useRoute(); const router = useRouter(); const { USER_ID } = route.query; const data = reactive({ - info: {}, + info: { + faceFile: {}, + }, certificateList: [], statusInfo: {}, dispose: "", @@ -301,11 +319,17 @@ const data = reactive({ drivingLicence: [], qualificationCertificate: [], }); + const fnGetData = async () => { if (!USER_ID) return; const resData = await getPractitionerInfo({ USER_ID }); data.info = resData.pd; data.statusInfo = resData.statusInfo; + if (data.info.USERAVATARURL_CONVERT) { + data.info.faceFile = [ + { url: data.info.USERAVATARPREFIX + data.info.USERAVATARURL_CONVERT }, + ]; + } resData.certificateList.forEach((item) => { item.ID_PHOTO_FRONT = FILE_URL + item.ID_PHOTO_FRONT; if (item.ID_PHOTO_BACK) { diff --git a/src/views/enterprise_management/user_practitioner/edit.vue b/src/views/enterprise_management/user_practitioner/edit.vue index ff68b23..bbf513e 100644 --- a/src/views/enterprise_management/user_practitioner/edit.vue +++ b/src/views/enterprise_management/user_practitioner/edit.vue @@ -955,10 +955,11 @@ const fnGetData = async () => { form.PASSWORD = "Aa@123456"; form.periodStr = resData.periodStr; form.ISSTUDENT = resData.pd.ISSTUDENT.toString(); - if (form.USERAVATARURL_CONVERT) + if (form.USERAVATARURL_CONVERT) { form.faceFile = [ { url: form.USERAVATARPREFIX + form.USERAVATARURL_CONVERT }, ]; + } data.scheduleInfo = resData.period; data.oldPostId = form.POST_ID; data.oldDepartId = form.DEPARTMENT_ID;