diff --git a/src/api/construction-person/entry-and-exit-manage/person-entry.js b/src/api/construction-person/entry-and-exit-manage/person-entry.js index 7ea3df9..ca517e7 100644 --- a/src/api/construction-person/entry-and-exit-manage/person-entry.js +++ b/src/api/construction-person/entry-and-exit-manage/person-entry.js @@ -21,7 +21,7 @@ export const deleteEntryPersonAPI = (data) => { // 人员入场 获取人员详情接口 export const getEntryPersonDetailAPI = (data) => { return request({ - url: `/bmw/worker/select/${data.id}`, + url: `/bmw/worker/select/${data.id}/${data.proId}`, method: 'post', }) } @@ -68,3 +68,30 @@ export const checkFaceImageAPI = (data) => { data, }) } + +// 根据身份证号码查询上海工程接口 +export const getShanghaiProByIdNumberAPI = (data) => { + return request({ + url: `/bmw/worker/selectByIdNumber/${data.idNumber}`, + method: 'POST', + data, + }) +} + +// 根据人员ID获取上海工程列表 +export const getShanghaiProListByWorkerIdAPI = (data) => { + return request({ + url: '/bmw/worker/einListByWorkerId', + method: 'GET', + params: data, + }) +} + +// 上海人员入场新工程接口 +export const addShanghaiProEinAPI = (data) => { + return request({ + url: '/bmw/worker/insertProEin', + method: 'POST', + data, + }) +} diff --git a/src/components/TableModel/index.vue b/src/components/TableModel/index.vue index 5d1afb7..4aac322 100644 --- a/src/components/TableModel/index.vue +++ b/src/components/TableModel/index.vue @@ -429,6 +429,12 @@ export default { this.getTableList() }, + // 根据传递的参数进行查询 + getTableListByParams(data) { + Object.assign(this.queryParams, data) + this.getTableList() + }, + /** 重置按钮 */ resetQuery() { this.$refs.queryFormRef.resetFields() diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue b/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue index c58a71b..cf7ca6c 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue @@ -436,7 +436,7 @@ v-model="contractInfoForm.wageApprovedWay" > - + @@ -605,6 +605,7 @@ import { editEntryPersonAPI, getEntryPersonDetailAPI, updatePersonLightStatusAPI, + getShanghaiProByIdNumberAPI, } from '@/api/construction-person/entry-and-exit-manage/person-entry' import { getSubSelectListByConditionAPI, @@ -627,6 +628,10 @@ export default { type: Number, default: 1, }, + proId: { + type: [String, Number], + default: '', + }, }, components: { UploadImgFormData, @@ -1439,6 +1444,7 @@ export default { async getEntryPersonDetail() { const { data: res } = await getEntryPersonDetailAPI({ id: this.queryDetailsId, + proId: this.proId, }) // 身份证基本信息 @@ -1612,6 +1618,47 @@ export default { // 根据身份证号码计算年龄 const age = new Date().getFullYear() - birthday.slice(0, 4) this.idCardInfoForm.age = age + + this.checkShanghaiPro() + }, + + // 判断当前身份证人员是否有入场工程 + async checkShanghaiPro() { + const { data: res } = await getShanghaiProByIdNumberAPI({ + idNumber: this.idCardInfoForm.idNumber, + }) + // return res + + console.log(res, 'res身份证人员是否有入场工程') + + if ( + res && + Object.keys(res).length > 0 && + res.isShanghai == 1 && + this.formType == 1 + ) { + this.$modal.msgError( + '当前人员已经入场上海工程,请前往上海多工程设置模块进行设置,正在跳转...', + ) + + setTimeout(() => { + this.$emit('onOpenShanghaiProSetting', res.idNumber) + }, 1000) + } + if ( + res && + Object.keys(res).length > 0 && + res.isShanghai == 0 && + this.formType == 1 + ) { + this.$modal.msgError( + '当前人员已经存在入场工程,可直接编辑,正在跳转...', + ) + + setTimeout(() => { + this.$emit('onOpenAddOrEdit', res.idNumber) + }, 1000) + } }, // 建立一个websocket连接 @@ -1661,6 +1708,7 @@ export default { const birthdayYear = Birthday.slice(0, 4) const currentYear = new Date().getFullYear() _this.idCardInfoForm.age = currentYear - birthdayYear + _this.checkShanghaiPro() } } this.webSocket.onerror = function (evt) { diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue b/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue index e5724d3..0a87441 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/index.vue @@ -106,8 +106,13 @@ :formType="formType" :workerId="workerId" :einStatus="einStatus" + :proId="proId" ref="addOrEditFormContentRef" :queryDetailsId="queryDetailsId" + @onOpenAddOrEdit="onHandleOpenAddOrEdit" + @onOpenShanghaiProSetting=" + onHandleOpenShanghaiProSetting + " /> @@ -153,6 +158,7 @@ @@ -198,10 +204,12 @@ export default { columnsList, dialogConfig, workerId: '', // 人员id + proId: '', // 工程id formType: 1, // 表单类型 einStatus: 1, // 在场状态 queryDetailsId: '', // 查询详情id importFileList: [], // 导入文件列表 + idNumber: '', // 身份证号码 getEntryPersonListAPI, } }, @@ -229,9 +237,13 @@ export default { this.queryDetailsId = data.id this.workerId = data.workerId this.einStatus = data.einStatus + if (data.proId) { + this.proId = data.proId + } this.dialogConfig.outerVisible = true } else { this.workerId = '' + this.proId = '' this.queryDetailsId = '' this.dialogConfig.outerVisible = true } @@ -276,6 +288,7 @@ export default { // 关闭弹框 handleCloseDialogOuter() { // this.$refs.addOrEditFormContentRef.resetForm() + this.idNumber = '' this.importFileList = [] this.dialogConfig.outerVisible = false }, @@ -349,6 +362,21 @@ export default { this.dialogConfig.maxHeight = '90vh' this.dialogConfig.outerVisible = true }, + + // 打开修改 + onHandleOpenAddOrEdit(idNumber) { + this.dialogConfig.outerVisible = false + this.$refs.personEntryTableRef.getTableListByParams({ + idNumber: idNumber, + }) + }, + + // 打开上海人员多工程设置 + onHandleOpenShanghaiProSetting(idNumber) { + this.dialogConfig.outerVisible = false + this.onHandleShanghaiPersonMultiEngineSetting() + this.idNumber = idNumber + }, }, async created() { diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/shanghai-pro-setting.vue b/src/views/construction-person/entry-and-exit-manage/person-entry/shanghai-pro-setting.vue index b9c54f3..d5831b9 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/shanghai-pro-setting.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/shanghai-pro-setting.vue @@ -2,13 +2,18 @@
- - + + @@ -101,6 +106,7 @@ @@ -108,6 +114,7 @@ @@ -208,6 +215,11 @@ diff --git a/src/views/construction-person/red-green-light-mange/contract-witness/contract-witness-upload.vue b/src/views/construction-person/red-green-light-mange/contract-witness/contract-witness-upload.vue index 37169e8..49815d5 100644 --- a/src/views/construction-person/red-green-light-mange/contract-witness/contract-witness-upload.vue +++ b/src/views/construction-person/red-green-light-mange/contract-witness/contract-witness-upload.vue @@ -96,7 +96,7 @@ v-model="contractInfoForm.wageApprovedWay" > - +