From 988b84d37863f0e6a414a8886a84a8c3a4d4798a Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 19 Aug 2025 18:13:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry-and-exit-manage/person-entry.js | 9 ++ src/components/TableModel/index.vue | 7 +- src/components/ToolbarModel/index.vue | 21 ++- .../sub-base-info/add-or-edit-form.vue | 8 +- .../entry-and-exit-form.vue | 2 +- .../person-entry/index.vue | 133 +++++++++++++++--- .../person-exit/index.vue | 7 + 7 files changed, 158 insertions(+), 29 deletions(-) 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 ce97ea8..86eb993 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 @@ -42,3 +42,12 @@ export const getEntryPersonListAPI = (data) => { params: data, }) } + +// 人员入场 导入人员接口 +export const importEntryPersonAPI = (data) => { + return requestFormData({ + url: '/bmw/worker/workerEinImport', + method: 'post', + data, + }) +} diff --git a/src/components/TableModel/index.vue b/src/components/TableModel/index.vue index 414928c..5603515 100644 --- a/src/components/TableModel/index.vue +++ b/src/components/TableModel/index.vue @@ -125,6 +125,8 @@ :handleShow.sync="handleShow" :indexNumShow.sync="indexNumShow" :selectionShow.sync="selectionShow" + :isSelectShow="isSelectShow" + :showOperation="showOperation" /> @@ -145,10 +147,11 @@ v-if="selectionShow && isSelectShow" /> - + 序号 + 序号 + - + 操作 + 操作 + @@ -71,25 +88,59 @@ @closeDialogOuter="handleCloseDialogOuter" > @@ -99,10 +150,12 @@ import TableModel from '@/components/TableModel' import DialogModel from '@/components/DialogModel' import AddOrEditForm from './add-or-edit-form' +import UploadFileFormData from '@/components/UploadFileFormData' import { formLabel, columnsList, dialogConfig } from './config' import { getEntryPersonListAPI, deleteEntryPersonAPI, + importEntryPersonAPI, } from '@/api/construction-person/entry-and-exit-manage/person-entry' import { @@ -117,6 +170,7 @@ export default { TableModel, DialogModel, AddOrEditForm, + UploadFileFormData, }, data() { @@ -128,6 +182,7 @@ export default { queryDetailsId: '', // 查询详情id einStatus: 1, // 在场状态 formType: 1, // 表单类型 + importFileList: [], // 导入文件列表 } }, methods: { @@ -146,6 +201,9 @@ export default { // 新增或修改 onHandleAddOrEditPersonEntry(type, data) { this.dialogConfig.outerTitle = type === 1 ? '新增人员' : '修改人员' + this.dialogConfig.outerWidth = '90%' + this.dialogConfig.minHeight = '98vh' + this.dialogConfig.maxHeight = '98vh' this.formType = type if (type === 2) { this.queryDetailsId = data.id @@ -195,6 +253,45 @@ export default { this.$refs.addOrEditFormContentRef.resetForm() this.dialogConfig.outerVisible = false }, + + // 导入数据 + onHandleImportData() { + this.dialogConfig.outerTitle = '导入数据' + this.dialogConfig.outerWidth = '50%' + this.dialogConfig.minHeight = '' + this.dialogConfig.maxHeight = '' + this.dialogConfig.outerVisible = true + }, + + // 下载模板 + async onHandleDownloadTemplate() { + // this.download( + // '/bmw/download/workerEinTemplate', + // {}, + // '失信人员导入模板.xlsx', + // ) + }, + + // 取消上传 + onHandleCancelImport() { + this.importFileList = [] + this.dialogConfig.outerVisible = false + }, + + // 确定上传 + async onHandleConfirmImport() { + const formData = new FormData() + formData.append('file', this.importFileList[0].raw) + const res = await importEntryPersonAPI(formData) + if (res.code === 200) { + this.$modal.msgSuccess('导入成功') + this.importFileList = [] + this.dialogConfig.outerVisible = false + this.$refs.dishonestyPersonTableRef.getTableList() + } else { + this.$modal.msgError(res.msg) + } + }, }, async created() { 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 f0f847c..7b88302 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 @@ -186,6 +186,13 @@ export default { // 导出按钮 onHandleExportAllProject(queryParams) { console.log(queryParams, '导出') + this.download( + '/bmw/workerExit/workerExitExport', + { + ...queryParams, + }, + '人员出场.xlsx', + ) }, // 批量出场