BUG优化

dev
xiepeng 2024-07-02 10:19:32 +08:00
parent f06cc86d7f
commit 56b3e8f052
6 changed files with 79 additions and 37 deletions

View File

@ -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();

View File

@ -36,11 +36,15 @@
</el-col>
<el-col :span="5">
<el-form-item label="归属部门" prop="DEPARTMENT_NAME">
<el-input
<layout-department
v-model="searchForm.DEPARTMENT_NAME"
@update:model-value="data.form.POST_ID = ''"
/>
<!-- <el-input
v-model="searchForm.DEPARTMENT_NAME"
placeholder="请输入归属部门"
clearable
/>
/>-->
</el-form-item>
</el-col>
<el-col :span="3">
@ -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,

View File

@ -250,7 +250,7 @@
<el-radio-button
v-for="(item, index) in data.periodList"
:key="index"
:label="item.periodStr"
:value="item.periodStr"
>
{{ item.period.WORKSTATUS === "1" ? "上班" : "休班" }}
</el-radio-button>
@ -276,24 +276,24 @@
<el-col :span="8">
<el-form-item label="是否安全管理人员" prop="IS_SAFETY">
<el-radio-group v-model="data.form.IS_SAFETY">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
<el-radio :value="1"></el-radio>
<el-radio :value="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否主要负责人" prop="ISHEAD">
<el-radio-group v-model="data.form.ISHEAD">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否部门领导" prop="ISLEADER">
<el-radio-group v-model="data.form.ISLEADER">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
<!-- <el-tooltip
content="温馨提示:部门领导可以审核离岗申请,查看同部门清单数据"
@ -893,12 +893,12 @@ const data = reactive({
oldDepartId: "",
fileForm: {
//
ID_CARD_FRONT: "",
ID_CARD_BACK: "",
ID_CARD_FRONT: [],
ID_CARD_BACK: [],
//
DRIVER_LICENSE: "",
DRIVER_LICENSE: [],
//
QUALIFICATION_CERTIFICATE: "",
QUALIFICATION_CERTIFICATE: [],
},
form: {
USERNAME: "",
@ -998,6 +998,7 @@ const fnSelectPersonSubmit = (selectionData) => {
const names = selectionData.map((item) => item.NAME).join(",");
data.form.PERSON_ID = userIds;
data.form.NAME = names;
data.form.faceFile = "";
fnGetData(userIds);
};
@ -1282,7 +1283,11 @@ const fnSubmit = debounce(
// return;
// }
formData.append("choice", "choice");
await setPractitionerAdd(formData);
const flag = await setPractitionerAdd(formData);
if (flag.msg === "1") {
ElMessage.warning("人脸图像不符合要求,请重新上传");
return;
}
} else {
if (
data.oldDepartId !== data.form.DEPARTMENT_ID ||

View File

@ -64,7 +64,6 @@ import { debounce } from "throttle-debounce";
import useListData from "@/assets/js/useListData.js";
import { reactive, watch } from "vue";
import { serialNumber } from "@/assets/js/utils.js";
import { differenceWith } from "lodash-es";
import { getUserNoCorpinfoListAll } from "@/request/user_practitioner.js";
import { layoutFnGetPersonnelTypeTraffic } from "@/assets/js/data_dictionary.js";
@ -74,11 +73,6 @@ const props = defineProps({
required: true,
default: false,
},
listData: {
type: Array,
required: true,
default: () => [],
},
});
const emits = defineEmits(["update:visible", "submit", "submitall"]);
const visible = useVModel(props, "visible", emits);
@ -113,13 +107,8 @@ const fnSubmit = debounce(
1000,
() => {
const selectionData = tableRef.value.getSelectionRows();
const listData = differenceWith(
selectionData,
props.listData,
(a, b) => a.RISKCHECKITEM_ID === b.RISKCHECKITEM_ID
);
fnClose();
emits("submit", listData);
emits("submit", selectionData);
},
{ atBegin: true }
);

View File

@ -12,17 +12,17 @@
<el-descriptions :column="3" border>
<el-descriptions-item label="申请类别">
<template v-if="data.statusInfo.APPLY_TYPE === '1'"
>入职申请</template
>
>入职申请
</template>
<template v-else-if="data.statusInfo.APPLY_TYPE === '2'"
>企业入职</template
>
>企业入职
</template>
<template v-else-if="data.statusInfo.APPLY_TYPE === '3'"
>离职申请</template
>
>离职申请
</template>
<template v-else-if="data.statusInfo.APPLY_TYPE === '4'"
>企业解聘</template
>
>企业解聘
</template>
</el-descriptions-item>
<el-descriptions-item label="备注">
{{ data.statusInfo.REVIEW_COMMENTS }}
@ -96,6 +96,7 @@
width="100"
height="100"
class="ml-10"
alt=""
/>
</el-descriptions-item>
<el-descriptions-item label="身份证(背面)">
@ -179,6 +180,20 @@
}}
</el-descriptions-item>
</el-descriptions>
<el-divider content-position="left">人员认证</el-divider>
<el-descriptions :column="1" border>
<el-descriptions-item label="人脸照片">
<img
v-if="data.info.faceFile !== null"
v-viewer
:src="data.info.faceFile"
width="100"
height="100"
class="ml-10"
/>
</el-descriptions-item>
</el-descriptions>
<!-- <div v-for="(item, index) in data.certificateList" :key="index">
<el-divider content-position="left">
{{
@ -279,7 +294,7 @@
</el-descriptions>
</div>-->
<div class="tc mt-10">
<el-button type="primary" @click="router.back"> </el-button>
<el-button type="primary" @click="router.back"> </el-button>
</div>
</layout-card>
</template>
@ -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) {

View File

@ -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;