预警后台-部分模块搭建及调试-d5
This commit is contained in:
parent
b136e53057
commit
a85cba77ce
|
|
@ -29,3 +29,14 @@ export const deletePersonApi = (id) => {
|
|||
export const queryInfoApi = (id) => {
|
||||
return request.get(`/base/tbPeople/${id}`)
|
||||
}
|
||||
|
||||
/** 文件上传 */
|
||||
export const personFileUpLoad = (data) => {
|
||||
/* const formData = new FormData()
|
||||
formData.append('file', param.fileData.file) */
|
||||
return request({
|
||||
url: '/base/tbPeople/importData',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,12 +76,12 @@ export const deleteTowerApi = (id) => {
|
|||
}
|
||||
|
||||
/** 文件上传 */
|
||||
export const towerFileUpLoad = (param) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
export const towerFileUpLoad = (data) => {
|
||||
/* const formData = new FormData()
|
||||
formData.append('file', param.fileData.file) */
|
||||
return request({
|
||||
url: '/base/tbProPower/importData',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,13 +361,13 @@ export default {
|
|||
])
|
||||
}
|
||||
})
|
||||
/* if(this.sendParams !== null) {
|
||||
if(this.sendParams !== null) {
|
||||
Object.assign(this.queryParams, this.sendParams)
|
||||
for(let key in this.sendParams) {
|
||||
/* for(let key in this.sendParams) {
|
||||
console.log(key, this.sendParams[key])
|
||||
this.$set(this.queryParams, key, this.sendParams[key])
|
||||
}
|
||||
} */
|
||||
}
|
||||
if(this.sendId !== null) this.queryParams.id = this.sendId
|
||||
this.getTableList()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,6 +34,12 @@
|
|||
<template slot="sex" slot-scope="{ data }">
|
||||
{{ data.sex === 1 ? '男' : '女' }}
|
||||
</template>
|
||||
<template slot="idCard" slot-scope="{ data }">
|
||||
{{ idCardCrypto(data.idCard) }}
|
||||
</template>
|
||||
<template slot="relPhone" slot-scope="{ data }">
|
||||
{{ phoneCrypto(data.relPhone) }}
|
||||
</template>
|
||||
<template slot="relName" slot-scope="{ data }">
|
||||
{{ data.relName }}
|
||||
<el-tag
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const formLabel = [
|
|||
export const columnsList = [
|
||||
{ t_props: 'teamName', t_label: '班组名称', },
|
||||
{ t_props: 'proName', t_label: '所属工程', },
|
||||
{ t_props: 'relName', t_label: '班组长', },
|
||||
{ t_props: 'relName', t_label: '班组长', t_slot: 'relName' },
|
||||
{ t_props: 'peopleCount', t_label: '班组成员', t_slot: 'peopleCount' },
|
||||
{ t_props: 'teamStatus', t_label: '班组状态', t_slot: 'teamStatus' },
|
||||
{ t_props: 'createTime', t_label: '创建日期', },
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@
|
|||
>
|
||||
<!-- <span v-else>-</span>-->
|
||||
</template>
|
||||
<template slot="relName" slot-scope="{ data }">
|
||||
{{ data.relName.split('/')[0] }}/{{ phoneCrypto(data.relName.split('/')[1]) }}
|
||||
</template>
|
||||
<template slot="peopleCount" slot-scope="{ data }">
|
||||
<span
|
||||
:class="[{ peopleCount: data.teamStatus === '正常' }]"
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ export const formLabelCrewTab = [
|
|||
]
|
||||
export const columnsListCrewTab = [
|
||||
{ t_props: 'relName', t_label: '姓名', t_slot: 'relName' },
|
||||
{ t_props: 'idCard', t_label: '身份证', },
|
||||
{ t_props: 'relPhone', t_label: '电话', },
|
||||
{ t_props: 'idCard', t_label: '身份证', t_slot: 'idCard' },
|
||||
{ t_props: 'relPhone', t_label: '电话', t_slot: 'relPhone' },
|
||||
{ t_props: 'sex', t_label: '性别', t_slot: 'sex' },
|
||||
{ t_props: 'devName', t_label: '智能安全帽', t_slot: 'devName' },
|
||||
]
|
||||
|
|
|
|||
|
|
@ -23,11 +23,7 @@
|
|||
size="mini"
|
||||
>数据模板下载</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
>导入数据</el-button
|
||||
>
|
||||
|
||||
<el-button
|
||||
@click="handleExportData(
|
||||
exportList,
|
||||
|
|
@ -39,6 +35,21 @@
|
|||
size="mini"
|
||||
>导出数据</el-button
|
||||
>
|
||||
<el-upload
|
||||
:http-request="(obj) => uploadData(obj)"
|
||||
action="#"
|
||||
:file-list="fileList"
|
||||
:on-exceed="fileExceed"
|
||||
accept=".xls, .xlsx"
|
||||
:limit="1"
|
||||
>
|
||||
<el-button
|
||||
style="margin-top: 10px"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
>导入数据</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</template>
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
<el-button
|
||||
|
|
@ -89,7 +100,8 @@ import { formLabel, columnsList, dialogConfig } from './config'
|
|||
import { commonMixin } from '../mixins/common'
|
||||
import {
|
||||
queryPersonListApi,
|
||||
deletePersonApi
|
||||
deletePersonApi,
|
||||
personFileUpLoad
|
||||
} from '@/api/base/person'
|
||||
import FormPerson from './components/form-person.vue'
|
||||
export default {
|
||||
|
|
@ -123,7 +135,22 @@ export default {
|
|||
case '0900106':
|
||||
return '特种作业人员'
|
||||
}
|
||||
},
|
||||
/** 上传图片/文件 */
|
||||
uploadData(param) {
|
||||
console.log(param)
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
personFileUpLoad(formData).then(res => {
|
||||
if(res.code === 200) {
|
||||
this.$modal.msgSuccess('上传成功')
|
||||
this.$refs.tableRef.getTableList()
|
||||
}
|
||||
}).catch(err => {})
|
||||
},
|
||||
fileExceed() {
|
||||
this.$modal.msgError('最多上传1个文件!')
|
||||
},
|
||||
},
|
||||
mixins: [commonMixin],
|
||||
components: {
|
||||
|
|
@ -146,6 +173,7 @@ export default {
|
|||
addDialogTitle: '新增人员',
|
||||
// 修改时弹框标题
|
||||
editDialogTitle: '修改人员',
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
:formLabel="formLabelTower"
|
||||
:columnsList="columnsListTower"
|
||||
:request-api="queryTowerListApi"
|
||||
:send-params="sendParams"
|
||||
ref="tableRef"
|
||||
@transIdList="getIdList"
|
||||
:show-sel="false"
|
||||
|
|
@ -146,9 +147,15 @@ export default {
|
|||
},
|
||||
/** 上传图片/文件 */
|
||||
uploadData(param) {
|
||||
console.log(param)
|
||||
towerFileUpLoad(param).then(res => {
|
||||
console.log(res)
|
||||
console.log(param, this.sendData)
|
||||
const formData = new FormData()
|
||||
formData.append('id', this.sendData.id)
|
||||
formData.append('file', param.file)
|
||||
towerFileUpLoad(formData).then(res => {
|
||||
if(res.code === 200) {
|
||||
this.$modal.msgSuccess('上传成功')
|
||||
this.$refs.tableRef.getTableList()
|
||||
}
|
||||
}).catch(err => {})
|
||||
},
|
||||
fileExceed() {
|
||||
|
|
@ -160,7 +167,9 @@ export default {
|
|||
TableTowerAdd
|
||||
},
|
||||
created() {
|
||||
|
||||
this.sendParams = {
|
||||
id: this.sendData.id
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.sendData, '-----------')
|
||||
|
|
@ -180,6 +189,7 @@ export default {
|
|||
// 修改时弹框标题
|
||||
editDialogTitle: '修改项目部',
|
||||
fileList: [],
|
||||
sendParams: undefined,
|
||||
sendAddData: undefined
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export const formLabel = [
|
|||
{ label: '线路工程', value: '2' },
|
||||
{ label: '电缆工程', value: '3' },
|
||||
] },
|
||||
{ f_label: '项目部名称', f_model: 'departId', f_type: 'ipt' },
|
||||
{ f_label: '项目部名称', f_model: 'departName', f_type: 'ipt' },
|
||||
]
|
||||
export const columnsList = [
|
||||
{ t_props: 'departName', t_label: '所属项目部', },
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export const columnsList = [
|
|||
{ t_props: 'departType', t_label: '项目部类型' },
|
||||
{ t_props: 'areaName', t_label: '地区' },
|
||||
{ t_props: 'headUser', t_label: '负责人', },
|
||||
{ t_props: 'headUserPhone', t_label: '电话', },
|
||||
{ t_props: 'headUserPhone', t_label: '电话', t_slot: 'headUserPhone' },
|
||||
{ t_props: 'remarks', t_label: '备注', },
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@
|
|||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
<!-- <template slot="isMatch" slot-scope="{ data }">
|
||||
{{ data.proId == null ? '不匹配' : '匹配' }}
|
||||
</template>-->
|
||||
<template slot="headUserPhone" slot-scope="{ data }">
|
||||
{{ phoneCrypto(data.headUserPhone) }}
|
||||
</template>
|
||||
</TableModel>
|
||||
|
||||
<!-- 新增以及修改时的弹框 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue