diff --git a/src/api/common.js b/src/api/common.js index 5c806e2..1bc9425 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -49,3 +49,10 @@ export const getTeamSelectListAPI = () => { method: 'GET', }) } +// 获取工种下拉列表 +export const getPostTypeSelectListAPI = () => { + return request({ + url: '/bmw/postType/listAll', + method: 'GET', + }) +} diff --git a/src/api/construction-person/attendance-manage/attendance-machine.js b/src/api/construction-person/attendance-manage/attendance-machine.js new file mode 100644 index 0000000..ee7e408 --- /dev/null +++ b/src/api/construction-person/attendance-manage/attendance-machine.js @@ -0,0 +1,37 @@ +import request from '@/utils/request' +import requestFormData from '@/utils/request_formdata' + +// 新增考勤机 +export const addAttendanceMachineAPI = (data) => { + return request({ + url: '/bmw/pmAttDevice/addPmAttDevice', + method: 'POST', + data, + }) +} +// 修改考勤机 +export const editAttendanceMachineAPI = (data) => { + return request({ + url: '/bmw/pmAttDevice/updatePmAttDevice', + method: 'POST', + data, + }) +} + +// 删除考勤机 +export const deleteAttendanceMachineAPI = (data) => { + return request({ + url: '/bmw/pmAttDevice/delPmAttDevice', + method: 'POST', + data, + }) +} + +// 获取考勤机列表 +export const getAttendanceMachineListAPI = (data) => { + return request({ + url: '/bmw/pmAttDevice/list', + method: 'GET', + params: data, + }) +} diff --git a/src/api/construction-person/entry-and-exit-manage/person-exit.js b/src/api/construction-person/entry-and-exit-manage/person-exit.js index 4bd7098..8b27245 100644 --- a/src/api/construction-person/entry-and-exit-manage/person-exit.js +++ b/src/api/construction-person/entry-and-exit-manage/person-exit.js @@ -10,6 +10,32 @@ export const addEntryPersonAPI = (data) => { }) } +// 人员出场 批量出场 +export const batchExitPersonAPI = (data) => { + return requestFormData({ + url: '/bmw/workerExit/exit/batchExit', + method: 'POST', + data, + }) +} + +// 获取人员出入场记录记录 +export const getPersonEntryAndExitRecordAPI = (data) => { + return requestFormData({ + url: '/bmw/workerExit/workerList', + method: 'GET', + params: data, + }) +} +// 已出场且未上传工资单 然后单独上传接口 +export const uploadExitFileAPI = (data) => { + return requestFormData({ + url: '/bmw/workerExit/exitFile', + method: 'POST', + data, + }) +} + // 人员出场 删除人员接口 export const deleteEntryPersonAPI = (data) => { return request({ diff --git a/src/store/modules/common.js b/src/store/modules/common.js index 334d0df..385ce20 100644 --- a/src/store/modules/common.js +++ b/src/store/modules/common.js @@ -12,6 +12,8 @@ const common = { subSelectList: [], // 班组下拉列表 teamSelectList: [], + // 工种下拉列表 + postTypeSelectList: [], }, mutations: { SET_COMPANY_SELECT_LIST(state, companySelectList) { @@ -32,6 +34,9 @@ const common = { SET_TEAM_SELECT_LIST(state, teamSelectList) { state.teamSelectList = teamSelectList }, + SET_POST_TYPE_SELECT_LIST(state, postTypeSelectList) { + state.postTypeSelectList = postTypeSelectList + }, }, } diff --git a/src/utils/getCommonData.js b/src/utils/getCommonData.js index e58d34a..a079e94 100644 --- a/src/utils/getCommonData.js +++ b/src/utils/getCommonData.js @@ -6,6 +6,7 @@ import { getLotProjectSelectListAPI, getSubSelectListAPI, getTeamSelectListAPI, + getPostTypeSelectListAPI, } from '@/api/common' // 获取公司下拉列表 @@ -90,3 +91,16 @@ export async function getTeamSelectListCommonFun() { } return [] } +// 获取工种下拉列表 +export async function getPostTypeSelectListCommonFun() { + const { postTypeSelectList } = store.state.common + if (postTypeSelectList.length > 0) { + return postTypeSelectList + } + const res = await getPostTypeSelectListAPI() + if (res.code === 200) { + store.commit('SET_POST_TYPE_SELECT_LIST', res.rows) + return res.rows + } + return [] +} diff --git a/src/views/construction-person/attendance-manage/attendance-machine/add-and-bind.form.vue b/src/views/construction-person/attendance-manage/attendance-machine/add-and-bind.form.vue new file mode 100644 index 0000000..c9fb938 --- /dev/null +++ b/src/views/construction-person/attendance-manage/attendance-machine/add-and-bind.form.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/views/construction-person/attendance-manage/attendance-machine/config.js b/src/views/construction-person/attendance-manage/attendance-machine/config.js new file mode 100644 index 0000000..921c4fe --- /dev/null +++ b/src/views/construction-person/attendance-manage/attendance-machine/config.js @@ -0,0 +1,60 @@ +export const formLabel = [ + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '考勤机编号', + f_model: 'deviceCode', + }, + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '考勤机名称', + f_model: 'deviceName', + }, + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '所属工程', + f_model: 'proName', + }, + { + isShow: false, // 是否展示label + f_type: 'sel', + f_label: '考勤机状态', + f_model: 'onLine', + f_selList: [ + { + label: '在线', + value: 1, + }, + { + label: '离线', + value: 0, + }, + ], + }, +] + +export const columnsList = [ + { t_props: 'deviceCode', t_label: '考勤机编号' }, + { t_props: 'deviceName', t_label: '考勤机名称' }, + { t_props: 'proName', t_label: '工程名称' }, + { t_slot: 'isShanghai', t_label: '工程类型' }, + { + t_label: '状态', + t_slot: 'onLine', + }, + { t_label: '绑定人', t_props: 'updateUser' }, + { + t_label: '绑定时间', + t_props: 'updateTime', + }, +] + +export const dialogConfig = { + outerTitle: '', + minHeight: '', + maxHeight: '', + outerWidth: '40%', + outerVisible: false, +} diff --git a/src/views/construction-person/attendance-manage/attendance-machine/index.vue b/src/views/construction-person/attendance-manage/attendance-machine/index.vue index 4e7496b..3e5393a 100644 --- a/src/views/construction-person/attendance-manage/attendance-machine/index.vue +++ b/src/views/construction-person/attendance-manage/attendance-machine/index.vue @@ -1,11 +1,264 @@ +import TableModel from '@/components/TableModel' +import DialogModel from '@/components/DialogModel' +import AddAndBindForm from './add-and-bind.form.vue' +import { formLabel, columnsList, dialogConfig } from './config' +import { + deleteAttendanceMachineAPI, + getAttendanceMachineListAPI, + editAttendanceMachineAPI, +} from '@/api/construction-person/attendance-manage/attendance-machine' +export default { + name: 'SubBaseInfo', + components: { + TableModel, + DialogModel, + AddAndBindForm, + }, - + data() { + return { + formLabel, + columnsList, + dialogConfig, + editFormData: {}, // 修改时回显的数据 + getAttendanceMachineListAPI, // 获取分包商列表的API + + // 营业执照身份证等信息是否上传的插槽 + slots: [ + { + type: 1, + name: 'businessLicense', + }, + { + type: 2, + name: 'idCard', + }, + { + type: 3, + name: 'electronicSeal', + }, + { + type: 4, + name: 'corporateSeal', + }, + ], + } + }, + methods: { + // 导出按钮 + onHandleExportAttendanceMachine(queryParams) { + this.download( + '/bmw/pmAttDevice/export', + { + ...queryParams, + }, + `考勤机列表.xlsx`, + ) + }, + + // 新增或修改 + onHandleAddOrBindAttendanceMachine(type, data) { + this.dialogConfig.outerTitle = + type === 1 ? '新增考勤机' : '绑定考勤机' + + if (type === 2) { + const { proId, deviceCode, deviceName } = data + + this.editFormData = { + isUpdate: true, + proId, + deviceCode, + deviceName, + } + } else { + this.editFormData = {} + } + this.dialogConfig.outerVisible = true + }, + + // 解绑 + onHandleUnBindAttendanceMachine(data) { + this.$confirm('是否确定解绑该考勤机?', '温馨提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + .then(async () => { + const res = await editAttendanceMachineAPI({ + deviceCode: data.deviceCode, + }) + if (res.code === 200) { + this.$modal.msgSuccess('解绑成功') + this.$refs.attendanceMachineTableRef.getTableList() // 更新列表 + } + }) + .catch(() => { + // console.log('取消') + }) + }, + + // 删除 + onHandleDeleteSubBaseInfo(data) { + this.$confirm('确定删除该考勤机吗?', '温馨提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }) + .then(async () => { + const res = await deleteAttendanceMachineAPI({ + deviceCode: data.deviceCode, + }) + if (res.code === 200) { + this.$modal.msgSuccess('删除成功') + this.$refs.attendanceMachineTableRef.getTableList() // 更新列表 + } + }) + .catch(() => { + // console.log('取消') + }) + }, + + // 确定按钮 + async onHandleConfirmAddOrEdit() { + try { + await this.$refs.addOrEditSubBaseInfoRef.onHandleConfirmAddOrEditFun() + this.handleCloseDialogOuter() + this.$refs.attendanceMachineTableRef.getTableList() + } catch (error) { + // console.log('表单提交失败', error) + } + }, + + // 关闭弹框 + handleCloseDialogOuter() { + this.$refs.addOrEditSubBaseInfoRef.resetForm() + this.dialogConfig.outerVisible = false + }, + + // 初始化是否上传 + initIsUpload(data, type) { + if (data.contractFile.length > 0) { + const isUpload = data.contractFile.some( + (item) => item.sourceType == type, + ) + return isUpload ? '已上传' : '未上传' + } + return '未上传' + }, + }, +} + 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 c1bf48f..2151591 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 @@ -187,8 +187,8 @@ export default { async onHandleConfirmAddOrEdit() { try { await this.$refs.addOrEditFormContentRef.onHandleConfirmAddOrEditFun() - // this.$refs.personEntryTableRef.getTableList() - // this.handleCloseDialogOuter() + this.$refs.personEntryTableRef.getTableList() + this.handleCloseDialogOuter() } catch (error) { console.log('表单提交失败', error) } diff --git a/src/views/construction-person/entry-and-exit-manage/person-exit/config.js b/src/views/construction-person/entry-and-exit-manage/person-exit/config.js index ec25900..3336667 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-exit/config.js +++ b/src/views/construction-person/entry-and-exit-manage/person-exit/config.js @@ -1,57 +1,81 @@ export const formLabel = [ { - f_label: '关键词', - f_model: 'keyword', + f_label: '姓名', + f_model: 'name', f_type: 'ipt', isShow: false, // 是否展示label }, { f_label: '身份证', - f_model: 'keyword', + f_model: 'idNumber', f_type: 'ipt', isShow: false, // 是否展示label }, { f_label: '联系方式', - f_model: 'keyword', + f_model: 'phone', f_type: 'ipt', isShow: false, // 是否展示label }, { f_label: '选择工程', - f_model: 'keyword', - f_type: 'ipt', + f_model: 'proId', + f_type: 'sel', isShow: false, // 是否展示label + f_selList: [], }, { f_label: '选择工种', - f_model: 'keyword', - f_type: 'ipt', + f_model: 'postId', + f_type: 'sel', isShow: false, // 是否展示label + f_selList: [], }, { f_label: '选择分包', - f_model: 'keyword', - f_type: 'ipt', + f_model: 'subId', + f_type: 'sel', isShow: false, // 是否展示label + f_selList: [], }, { f_label: '选择班组', - f_model: 'keyword', - f_type: 'ipt', + f_model: 'teamId', + f_type: 'sel', isShow: false, // 是否展示label + f_selList: [], }, { f_label: '出入场状态', - f_model: 'keyword', - f_type: 'ipt', + f_model: 'einStatus', + f_type: 'sel', isShow: false, // 是否展示label + f_selList: [ + { + label: '在场', + value: 1, + }, + { + label: '出场', + value: 2, + }, + ], }, { f_label: '结算单状态', - f_model: 'keyword', - f_type: 'ipt', + f_model: 'isUploadFile', + f_type: 'sel', isShow: false, // 是否展示label + f_selList: [ + { + label: '未上传', + value: 0, + }, + { + label: '已上传', + value: 1, + }, + ], }, ] @@ -70,8 +94,9 @@ export const columnsList = [ t_label: '出场时间', }, { - t_props: 'electronicSignature', + t_slot: 'isUploadFile', t_label: '离场人员工资结算确认单', + t_width: '200px', }, { t_props: 'subName', diff --git a/src/views/construction-person/entry-and-exit-manage/person-exit/entry-exit-record.vue b/src/views/construction-person/entry-and-exit-manage/person-exit/entry-exit-record.vue index 12b685f..fd5eb01 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-exit/entry-exit-record.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-exit/entry-exit-record.vue @@ -2,26 +2,118 @@
- - - - - - - - + + + + + + + + + + +
diff --git a/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue b/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue index 218572c..f810a32 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-exit/index.vue @@ -8,6 +8,7 @@ :isSelectShow="true" ref="personExitTableRef" :columnsList="columnsList" + :selectable="(row) => row.einStatus === 1" :request-api="getExitPersonListAPI" > +