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