Merge remote-tracking branch 'origin/liujun-2024-04-12-一公司人员定位' into liujun-2024-04-12-一公司人员定位
commit
b5aaa3d6d1
|
@ -17,11 +17,16 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model="material.remark" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门:" prop="departmentId">
|
||||
<el-form-item label="负责部门:" prop="departmentId" style="width:300px">
|
||||
<Treeselect
|
||||
:options="dic.deptList"
|
||||
:normalizer="normalizer"
|
||||
|
@ -36,7 +41,7 @@
|
|||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人员:" prop="userInfo">
|
||||
<el-form-item label="负责人员:" prop="userInfo" >
|
||||
<el-select v-model="material.userInfo" style="width:300px" placeholder="请选择" @change="chooseUser">
|
||||
<el-option
|
||||
v-for="item in dic.userList"
|
||||
|
@ -47,34 +52,39 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人手机号:" prop="userPhone">
|
||||
<el-input v-model="material.userPhone" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人身份证:" prop="userCardId">
|
||||
<el-input v-model="material.userCardId" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编号:" prop="deviceId">
|
||||
<el-input v-model="material.deviceId" placeholder="请输入内容"/>
|
||||
<el-input v-model="material.deviceId" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称:" prop="deviceName">
|
||||
<el-input v-model="material.deviceName" placeholder="请输入内容"/>
|
||||
<el-input v-model="material.deviceName" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他系统编号:" prop="id">
|
||||
<el-input v-model="material.id" placeholder="请输入内容"/>
|
||||
<el-input v-model="material.id" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="其他系统编号备注:" prop="id_remark">
|
||||
<el-input v-model="material.idRemark" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注:" prop="id">
|
||||
<el-input v-model="material.remark" placeholder="请输入内容"/>
|
||||
<el-form-item label="其他系统编号备注:" prop="idRemark">
|
||||
<el-input v-model="material.idRemark" style="width: 300px" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -120,7 +130,9 @@ export default {
|
|||
deviceName: '',
|
||||
id: '',
|
||||
idRemark: '',
|
||||
remark: ''
|
||||
remark: '',
|
||||
userCardId: '',
|
||||
userPhone: ''
|
||||
},
|
||||
form: {
|
||||
required: {
|
||||
|
@ -133,9 +145,11 @@ export default {
|
|||
deviceId: '',
|
||||
deviceName: '',
|
||||
id: '',
|
||||
idRemark: ''
|
||||
userCardId: '',
|
||||
userPhone: ''
|
||||
},
|
||||
remark: ''
|
||||
remark: '',
|
||||
idRemark: ''
|
||||
},
|
||||
normalizer(node) {
|
||||
return {
|
||||
|
@ -166,6 +180,12 @@ export default {
|
|||
],
|
||||
idRemark: [
|
||||
{ required: true, message: '请填写其他系统编号备注', trigger: 'change' }
|
||||
],
|
||||
userPhone: [
|
||||
{ required: true, message: '请填写负责人手机号', trigger: 'change' }
|
||||
],
|
||||
userCardId: [
|
||||
{ required: true, message: '请填写负责人身份证', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
heirloom: {},
|
||||
|
@ -182,12 +202,34 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
async init(e) {
|
||||
if (e) {
|
||||
this.heirloom = e
|
||||
}
|
||||
this.visible = true
|
||||
await this.getDepartmentTree()
|
||||
this.getDict()
|
||||
await this.getDict()
|
||||
await this.getPeopleList({ id: e.departmentId })
|
||||
if (e) {
|
||||
await this.initInfo(e)
|
||||
}
|
||||
},
|
||||
initInfo(e) {
|
||||
return new Promise(resolve => {
|
||||
this.heirloom = e
|
||||
this.material.type = e.type
|
||||
this.material.typeName = e.typeName
|
||||
this.material.typeInfo = JSON.stringify({ name: e.typeName, value: e.type })
|
||||
this.material.userId = e.userId
|
||||
this.material.userName = e.userName
|
||||
this.material.departmentId = e.departmentId
|
||||
this.material.departmentName = e.departmentName
|
||||
this.material.userPhone = e.userPhone
|
||||
this.material.userCardId = e.userCardId
|
||||
this.material.deviceId = e.deviceId
|
||||
this.material.deviceName = e.deviceName
|
||||
this.material.id = e.id
|
||||
this.material.idRemark = e.idRemark
|
||||
this.material.userInfo = e.userName
|
||||
this.material.dwUserMapId = e.dwUserMapId
|
||||
this.material.remark = e.remark
|
||||
})
|
||||
},
|
||||
getMenu() {
|
||||
return new Promise(resolve => {
|
||||
|
@ -204,6 +246,7 @@ export default {
|
|||
})
|
||||
},
|
||||
sendMessage(e) {
|
||||
console.log(this.material)
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) {
|
||||
this.$message.error('请填写完整信息')
|
||||
|
@ -217,16 +260,20 @@ export default {
|
|||
this.form.required.deviceId = this.material.deviceId
|
||||
this.form.required.deviceName = this.material.deviceName
|
||||
this.form.required.id = this.material.id
|
||||
this.form.required.idRemark = this.material.idRemark
|
||||
this.form.required.userCardId = this.material.userCardId
|
||||
this.form.required.userPhone = this.material.userPhone
|
||||
this.form.idRemark = this.material.idRemark
|
||||
this.form.remark = this.material.remark
|
||||
this.form.dwUserMapId = this.material.dwUserMapId
|
||||
|
||||
requestFN(
|
||||
'/dingWei/saveOrUpdateMap', { data: JSON.stringify(this.form) }
|
||||
).then((data) => {
|
||||
if (data.code === 0) {
|
||||
if (data.code === 200) {
|
||||
this.$message.success('操作成功')
|
||||
this.handleClose()
|
||||
this.$emit('refresh')
|
||||
this.$emit('flush')
|
||||
this.visible = false
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
|
@ -237,6 +284,7 @@ export default {
|
|||
})
|
||||
},
|
||||
getPeopleList(e) {
|
||||
return new Promise(resolve => {
|
||||
this.material.departmentName = e.name
|
||||
requestFN(
|
||||
'/user/listAll',
|
||||
|
@ -246,8 +294,11 @@ export default {
|
|||
).then((data) => {
|
||||
this.dic.userList = data.userList
|
||||
this.material.userInfo = ''
|
||||
resolve(true)
|
||||
}).catch((e) => {
|
||||
console.log(e)
|
||||
resolve(true)
|
||||
})
|
||||
})
|
||||
},
|
||||
chooseUser(e) {
|
||||
|
@ -256,32 +307,46 @@ export default {
|
|||
this.material.userName = entity.NAME
|
||||
},
|
||||
handleClose() {
|
||||
this.form = {
|
||||
STATUS: '',
|
||||
APPOINT_DEPARTMENT_ID: null,
|
||||
APPOINT_DEPARTMENT_NAME: '',
|
||||
APPOINT_USER_ID: '',
|
||||
APPOINT_USER_NAME: '',
|
||||
OPINION: '',
|
||||
user: '',
|
||||
list: [],
|
||||
tm: new Date().getTime()
|
||||
}
|
||||
this.visible = false
|
||||
this.beforeClose()
|
||||
},
|
||||
beforeClose() {
|
||||
this.visible = false
|
||||
this.form = {
|
||||
STATUS: '',
|
||||
APPOINT_DEPARTMENT_ID: null,
|
||||
APPOINT_DEPARTMENT_NAME: '',
|
||||
APPOINT_USER_ID: '',
|
||||
APPOINT_USER_NAME: '',
|
||||
OPINION: '',
|
||||
user: '',
|
||||
list: [],
|
||||
tm: new Date().getTime()
|
||||
required: {
|
||||
type: '',
|
||||
typeName: '',
|
||||
departmentId: '',
|
||||
departmentName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
deviceId: '',
|
||||
deviceName: '',
|
||||
id: '',
|
||||
userCardId: '',
|
||||
userPhone: ''
|
||||
},
|
||||
remark: '',
|
||||
idRemark: ''
|
||||
}
|
||||
this.material = {
|
||||
typeInfo: '',
|
||||
type: '',
|
||||
typeName: '',
|
||||
deptInfo: '',
|
||||
departmentId: null,
|
||||
departmentName: '',
|
||||
userInfo: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
deviceId: '',
|
||||
deviceName: '',
|
||||
id: '',
|
||||
idRemark: '',
|
||||
remark: '',
|
||||
userCardId: '',
|
||||
userPhone: ''
|
||||
}
|
||||
this.$emit('flush')
|
||||
},
|
||||
saveInfo(e) {
|
||||
const info = JSON.parse(e)
|
||||
|
@ -289,12 +354,16 @@ export default {
|
|||
this.material.typeName = info.name
|
||||
},
|
||||
getDict() {
|
||||
return new Promise(resolve => {
|
||||
requestFN('dingWei/getDictionary').then((data) => {
|
||||
this.dic.alarmStatus = JSON.parse(data.AlarmStatus)
|
||||
this.dic.logType = JSON.parse(data.LogType)
|
||||
this.dic.mapType = JSON.parse(data.MapType)
|
||||
resolve(true)
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
resolve(true)
|
||||
})
|
||||
})
|
||||
},
|
||||
getDepartmentTree() {
|
||||
|
|
|
@ -36,19 +36,19 @@
|
|||
highlight-current-row>
|
||||
<el-table-column :selectable="handleSelectWithDifferentStatus" type="selection" width="55" align="center"/>
|
||||
<el-table-column type="index" label="序号" width="50" align="center"/>
|
||||
<el-table-column prop="USERNAME" label="用户名" align="center"/>
|
||||
<el-table-column prop="NAME" label="姓名" align="center"/>
|
||||
<el-table-column prop="typeName" label="映射类型" align="center"/>
|
||||
<el-table-column prop="userName" label="姓名" align="center"/>
|
||||
<el-table-column prop="departmentName" label="部门名称" align="center"/>
|
||||
<el-table-column prop="userPhone" label="用户手机号" align="center"/>
|
||||
<el-table-column prop="deviceId" label="设备id" align="center"/>
|
||||
<el-table-column prop="deviceName" label="设备名称" align="center"/>
|
||||
<el-table-column prop="id" label="其他系统编号" align="center"/>
|
||||
<el-table-column prop="idRemark" label="其他系统备注" align="center"/>
|
||||
<el-table-column prop="createTime" label="创建时间" align="center"/>
|
||||
<el-table-column prop="createdTime" label="创建时间" align="center"/>
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleDelete(row)">删除</el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleDelete(row)">编辑</el-button>
|
||||
<el-button type="danger" icon="el-icon-edit" size="mini" @click="handleDelete(row)">删除</el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -89,8 +89,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
// this.getList()
|
||||
this.getList()
|
||||
this.hasButton()
|
||||
},
|
||||
methods: {
|
||||
|
@ -118,7 +117,7 @@ export default {
|
|||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.varList = data.list
|
||||
this.total = data.page.total
|
||||
this.listQuery.total = Number(data.page.total)
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
|
@ -155,7 +154,37 @@ export default {
|
|||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('是否删除该条数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.listLoading = true
|
||||
requestFN(
|
||||
'/dingWei/deleteMap', { id: row.dwUserMapId }
|
||||
).then((data) => {
|
||||
this.listLoading = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
this.getList()
|
||||
}).catch((e) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.$refs.info.init(row)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue