增加入场多人员导入
This commit is contained in:
parent
ace08af8ca
commit
1ac66499a5
Binary file not shown.
|
|
@ -53,6 +53,15 @@ export const importEntryPersonAPI = (data) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 人员入场 入场导入接口
|
||||||
|
export const importEntryPersonImportAPI = (data) => {
|
||||||
|
return requestFormData({
|
||||||
|
url: '/bmw/worker/workerManyEinImport',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 修改人员的红绿灯状态
|
// 修改人员的红绿灯状态
|
||||||
export const updatePersonLightStatusAPI = (data) => {
|
export const updatePersonLightStatusAPI = (data) => {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,27 @@
|
||||||
>
|
>
|
||||||
上海人员多工程设置
|
上海人员多工程设置
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-upload"
|
||||||
|
v-hasPermi="['worker:ein:admin']"
|
||||||
|
@click="onHandleEntryImportData()"
|
||||||
|
>
|
||||||
|
入场导入
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-download"
|
||||||
|
v-hasPermi="['worker:ein:admin']"
|
||||||
|
@click="onHandleDownloadEntryTemplate()"
|
||||||
|
>
|
||||||
|
入场多数据模板下载
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 出入场状态 -->
|
<!-- 出入场状态 -->
|
||||||
|
|
@ -142,7 +163,12 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else-if="dialogConfig.outerTitle === '导入数据'">
|
<template
|
||||||
|
v-else-if="
|
||||||
|
dialogConfig.outerTitle === '导入数据' ||
|
||||||
|
dialogConfig.outerTitle === '入场导入'
|
||||||
|
"
|
||||||
|
>
|
||||||
<UploadFileFormData
|
<UploadFileFormData
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:file-size="50"
|
:file-size="50"
|
||||||
|
|
@ -189,6 +215,7 @@ import {
|
||||||
getEntryPersonListAPI,
|
getEntryPersonListAPI,
|
||||||
deleteEntryPersonAPI,
|
deleteEntryPersonAPI,
|
||||||
importEntryPersonAPI,
|
importEntryPersonAPI,
|
||||||
|
importEntryPersonImportAPI,
|
||||||
} from '@/api/construction-person/entry-and-exit-manage/person-entry'
|
} from '@/api/construction-person/entry-and-exit-manage/person-entry'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -337,6 +364,15 @@ export default {
|
||||||
this.dialogConfig.outerVisible = true
|
this.dialogConfig.outerVisible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 入场导入
|
||||||
|
onHandleEntryImportData() {
|
||||||
|
this.dialogConfig.outerTitle = '入场导入'
|
||||||
|
this.dialogConfig.outerWidth = '50%'
|
||||||
|
this.dialogConfig.minHeight = ''
|
||||||
|
this.dialogConfig.maxHeight = ''
|
||||||
|
this.dialogConfig.outerVisible = true
|
||||||
|
},
|
||||||
|
|
||||||
// 下载模板
|
// 下载模板
|
||||||
async onHandleDownloadTemplate() {
|
async onHandleDownloadTemplate() {
|
||||||
// 判断是否为测试环境
|
// 判断是否为测试环境
|
||||||
|
|
@ -349,6 +385,20 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 入场多数据模板下载
|
||||||
|
|
||||||
|
async onHandleDownloadEntryTemplate() {
|
||||||
|
if (process.env.VUE_APP_ENV === 'production') {
|
||||||
|
window.open(
|
||||||
|
window.origin +
|
||||||
|
'/hd-realname' +
|
||||||
|
'/人员入场多数据-模版.xlsx',
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
window.open(window.origin + '/人员入场多数据-模版.xlsx')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 取消上传
|
// 取消上传
|
||||||
onHandleCancelImport() {
|
onHandleCancelImport() {
|
||||||
this.importFileList = []
|
this.importFileList = []
|
||||||
|
|
@ -360,7 +410,13 @@ export default {
|
||||||
if (this.importFileList.length > 0) {
|
if (this.importFileList.length > 0) {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', this.importFileList[0].raw)
|
formData.append('file', this.importFileList[0].raw)
|
||||||
const res = await importEntryPersonAPI(formData)
|
|
||||||
|
const API =
|
||||||
|
this.dialogConfig.outerTitle === '导入数据'
|
||||||
|
? importEntryPersonAPI
|
||||||
|
: importEntryPersonImportAPI
|
||||||
|
|
||||||
|
const res = await API(formData)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$modal.msgSuccess('导入成功')
|
this.$modal.msgSuccess('导入成功')
|
||||||
this.importFileList = []
|
this.importFileList = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue