This commit is contained in:
parent
271dd7a8de
commit
988b84d378
|
|
@ -42,3 +42,12 @@ export const getEntryPersonListAPI = (data) => {
|
|||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 人员入场 导入人员接口
|
||||
export const importEntryPersonAPI = (data) => {
|
||||
return requestFormData({
|
||||
url: '/bmw/worker/workerEinImport',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@
|
|||
:handleShow.sync="handleShow"
|
||||
:indexNumShow.sync="indexNumShow"
|
||||
:selectionShow.sync="selectionShow"
|
||||
:isSelectShow="isSelectShow"
|
||||
:showOperation="showOperation"
|
||||
/>
|
||||
</el-row>
|
||||
<!-- 表格 -->
|
||||
|
|
@ -145,10 +147,11 @@
|
|||
v-if="selectionShow && isSelectShow"
|
||||
/>
|
||||
<el-table-column
|
||||
fixed
|
||||
width="55"
|
||||
align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
:index="
|
||||
indexContinuation(queryParams.pageNum, queryParams.pageSize)
|
||||
"
|
||||
|
|
@ -318,7 +321,7 @@ export default {
|
|||
// 搜索区域是否隐藏
|
||||
showSearch: true,
|
||||
// 是否显示复选框
|
||||
selectionShow: this.isSelectShow,
|
||||
selectionShow: true,
|
||||
// 是否显示序号
|
||||
indexNumShow: true,
|
||||
// 是否显示操作列
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
>
|
||||
<el-button size="mini" circle icon="el-icon-menu" />
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item>
|
||||
<el-dropdown-item v-if="isSelectShow">
|
||||
<el-checkbox
|
||||
:checked="selectionShow"
|
||||
@change="
|
||||
|
|
@ -67,10 +67,11 @@
|
|||
)
|
||||
}
|
||||
"
|
||||
>序号</el-checkbox
|
||||
>
|
||||
序号
|
||||
</el-checkbox>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-dropdown-item v-if="showOperation">
|
||||
<el-checkbox
|
||||
:checked="handleShow"
|
||||
@change="
|
||||
|
|
@ -81,8 +82,9 @@
|
|||
)
|
||||
}
|
||||
"
|
||||
>操作</el-checkbox
|
||||
>
|
||||
操作
|
||||
</el-checkbox>
|
||||
</el-dropdown-item>
|
||||
|
||||
<template v-for="(item, index) in columns">
|
||||
|
|
@ -156,6 +158,17 @@ export default {
|
|||
type: Number,
|
||||
default: 10,
|
||||
},
|
||||
|
||||
/* 是否显示复选框 */
|
||||
isSelectShow: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/* 是否显示复选框 */
|
||||
showOperation: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
style() {
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ export default {
|
|||
return {
|
||||
id: e.id,
|
||||
url: e.lsUrl,
|
||||
name: e.fileName,
|
||||
name: e.originFileName,
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ export default {
|
|||
return {
|
||||
id: e.id,
|
||||
url: e.lsUrl,
|
||||
name: e.fileName,
|
||||
name: e.originFileName,
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ export default {
|
|||
return {
|
||||
id: e.id,
|
||||
url: e.lsUrl,
|
||||
name: e.fileName,
|
||||
name: e.originFileName,
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ export default {
|
|||
return {
|
||||
id: e.id,
|
||||
url: e.lsUrl,
|
||||
name: e.fileName,
|
||||
name: e.originFileName,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ export default {
|
|||
newVal.contractFile.map((e) => {
|
||||
return {
|
||||
url: e.lsUrl,
|
||||
name: e.fileName,
|
||||
name: e.originFileName,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,23 @@
|
|||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
size="mini"
|
||||
icon="el-icon-upload"
|
||||
@click="onHandleImportData()"
|
||||
>
|
||||
导入数据
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="onHandleDownloadTemplate()"
|
||||
>
|
||||
模板下载
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 出入场状态 -->
|
||||
|
|
@ -71,25 +88,59 @@
|
|||
@closeDialogOuter="handleCloseDialogOuter"
|
||||
>
|
||||
<template slot="outerContent">
|
||||
<AddOrEditForm
|
||||
:formType="formType"
|
||||
:einStatus="einStatus"
|
||||
ref="addOrEditFormContentRef"
|
||||
:queryDetailsId="queryDetailsId"
|
||||
/>
|
||||
<template
|
||||
v-if="
|
||||
dialogConfig.outerTitle === '新增人员' ||
|
||||
dialogConfig.outerTitle === '修改人员'
|
||||
"
|
||||
>
|
||||
<AddOrEditForm
|
||||
:formType="formType"
|
||||
:einStatus="einStatus"
|
||||
ref="addOrEditFormContentRef"
|
||||
:queryDetailsId="queryDetailsId"
|
||||
/>
|
||||
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button size="medium" @click="handleCloseDialogOuter">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="primary"
|
||||
@click="onHandleConfirmAddOrEdit"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="handleCloseDialogOuter"
|
||||
>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="primary"
|
||||
@click="onHandleConfirmAddOrEdit"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<UploadFileFormData
|
||||
:limit="1"
|
||||
:file-size="50"
|
||||
:multiple="false"
|
||||
:file-type="['xls', 'xlsx']"
|
||||
uploadTip="请导入xls、xlsx格式文件"
|
||||
:file-list.sync="importFileList"
|
||||
/>
|
||||
|
||||
<el-row class="dialog-footer-btn">
|
||||
<el-button size="medium" @click="onHandleCancelImport">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
type="primary"
|
||||
@click="onHandleConfirmImport"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</template>
|
||||
</DialogModel>
|
||||
</div>
|
||||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -186,6 +186,13 @@ export default {
|
|||
// 导出按钮
|
||||
onHandleExportAllProject(queryParams) {
|
||||
console.log(queryParams, '导出')
|
||||
this.download(
|
||||
'/bmw/workerExit/workerExitExport',
|
||||
{
|
||||
...queryParams,
|
||||
},
|
||||
'人员出场.xlsx',
|
||||
)
|
||||
},
|
||||
|
||||
// 批量出场
|
||||
|
|
|
|||
Loading…
Reference in New Issue