|
@@ -39,7 +39,7 @@
|
|
|
<el-form-item prop="userId">
|
|
|
<el-select
|
|
|
v-model="filterForm.userId"
|
|
|
- placeholder="请选择人员"
|
|
|
+ placeholder="人员"
|
|
|
clearable
|
|
|
filterable
|
|
|
>
|
|
@@ -56,7 +56,7 @@
|
|
|
<el-form-item prop="categoryType">
|
|
|
<el-select
|
|
|
v-model="filterForm.categoryType"
|
|
|
- placeholder="请选择岗位"
|
|
|
+ placeholder="岗位"
|
|
|
clearable
|
|
|
filterable
|
|
|
>
|
|
@@ -73,7 +73,7 @@
|
|
|
<el-form-item prop="account">
|
|
|
<el-input
|
|
|
v-model="filterForm.account"
|
|
|
- placeholder="请输入账号"
|
|
|
+ placeholder="账号"
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -82,12 +82,12 @@
|
|
|
<el-form-item prop="positionId">
|
|
|
<el-select
|
|
|
v-model="filterForm.positionId"
|
|
|
- placeholder="请选择负责区域"
|
|
|
+ placeholder="负责区域"
|
|
|
clearable
|
|
|
filterable
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in pointList"
|
|
|
+ v-for="item in filterPointList"
|
|
|
:key="item.id"
|
|
|
:label="item.positionName"
|
|
|
:value="item.id"
|
|
@@ -116,6 +116,7 @@
|
|
|
<el-table
|
|
|
v-loading="tableLoading"
|
|
|
:data="tableData"
|
|
|
+ header-row-class-name="table-head"
|
|
|
:height="resizeHeight - 295"
|
|
|
stripe
|
|
|
border
|
|
@@ -163,7 +164,7 @@
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
- width="160"
|
|
|
+ width="100"
|
|
|
align="center"
|
|
|
fixed="right"
|
|
|
class-name="table-flex-column-right"
|
|
@@ -171,14 +172,15 @@
|
|
|
<template #default="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
- type="primary"
|
|
|
+ type="text"
|
|
|
@click="handleEdit(scope.row, 'edit')"
|
|
|
>
|
|
|
编辑
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
- type="danger"
|
|
|
+ type="text"
|
|
|
+ style="color: #F56C6C"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
>
|
|
|
删除
|
|
@@ -222,6 +224,7 @@
|
|
|
placeholder="请选择人员"
|
|
|
clearable
|
|
|
filterable
|
|
|
+ @change="getBuildingList"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in userList"
|
|
@@ -242,6 +245,7 @@
|
|
|
placeholder="请选择岗位"
|
|
|
clearable
|
|
|
filterable
|
|
|
+ @change="getPointList"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in $store.state.categoryTypeList"
|
|
@@ -309,6 +313,7 @@
|
|
|
placeholder="请选择楼层"
|
|
|
clearable
|
|
|
filterable
|
|
|
+ @change="getPointList"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in floorList"
|
|
@@ -321,7 +326,10 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row v-if="detailForm.postCategory != 2">
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col
|
|
|
+ v-if="detailForm.postCategory != 3"
|
|
|
+ :span="12"
|
|
|
+ >
|
|
|
<el-form-item
|
|
|
label="负责点位"
|
|
|
prop="positionId"
|
|
@@ -341,6 +349,30 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col
|
|
|
+ v-else
|
|
|
+ :span="12"
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ label="负责点位"
|
|
|
+ prop="positionList"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="detailForm.positionList"
|
|
|
+ placeholder="请输入负责点位"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in pointList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.positionName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12" />
|
|
|
</el-row>
|
|
|
</el-form>
|
|
@@ -412,6 +444,7 @@ export default {
|
|
|
userList: [],
|
|
|
buildingList: [],
|
|
|
floorList: [],
|
|
|
+ filterPointList: [],
|
|
|
pointList: [],
|
|
|
// 详情
|
|
|
detailFormShow: false,
|
|
@@ -423,7 +456,8 @@ export default {
|
|
|
buildingId: '',
|
|
|
buildingList: [],
|
|
|
floorId: '',
|
|
|
- positionId: ''
|
|
|
+ positionId: '',
|
|
|
+ positionList: []
|
|
|
},
|
|
|
detailFormRules: {
|
|
|
userId: [
|
|
@@ -443,6 +477,9 @@ export default {
|
|
|
],
|
|
|
positionId: [
|
|
|
{ required: true, message: '请选择负责点位', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ positionList: [
|
|
|
+ { required: true, type: 'array', message: '请选择负责点位', trigger: 'change' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
@@ -470,9 +507,10 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- getPointDictionary({}).then(res => {
|
|
|
+ getPointDictionary({
|
|
|
+ }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.pointList = res.data
|
|
|
+ this.filterPointList = res.data
|
|
|
} else {
|
|
|
ElNotification({
|
|
|
title: '获取点位字典失败',
|
|
@@ -491,13 +529,61 @@ export default {
|
|
|
this.handlePageChange(1)
|
|
|
}
|
|
|
},
|
|
|
+ // 获取楼栋
|
|
|
+ getBuildingList () {
|
|
|
+ getBuildingDictionary({
|
|
|
+ projectId: this.$store.state.projectId,
|
|
|
+ noBinded: 1,
|
|
|
+ userId: this.detailForm.userId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.buildingList = res.data
|
|
|
+ this.setFloorList(this.detailForm.buildingId, 'keep')
|
|
|
+ } else {
|
|
|
+ ElNotification({
|
|
|
+ title: '获取楼栋字典失败',
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取楼层列表
|
|
|
setFloorList (val, type) {
|
|
|
if (type != 'keep') {
|
|
|
this.detailForm.floorId = ''
|
|
|
+ this.detailForm.positionId = ''
|
|
|
+ this.detailForm.positionList = []
|
|
|
+ this.pointList = []
|
|
|
+ } else {
|
|
|
+ this.getPointList(this.detailForm.floorId, 'keep')
|
|
|
}
|
|
|
this.floorList = val ? this.buildingList.find(item => item.id == val).floorList : []
|
|
|
},
|
|
|
+ // 获取点位数据
|
|
|
+ getPointList (val, type) {
|
|
|
+ if (type != 'keep') {
|
|
|
+ this.detailForm.positionId = ''
|
|
|
+ this.detailForm.positionList = []
|
|
|
+ this.pointList = []
|
|
|
+ }
|
|
|
+ if (this.detailForm.floorId && this.detailForm.postCategory) {
|
|
|
+ getPointDictionary({
|
|
|
+ floorId: this.detailForm.floorId,
|
|
|
+ positionType: this.detailForm.postCategory
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.pointList = res.data
|
|
|
+ } else {
|
|
|
+ ElNotification({
|
|
|
+ title: '获取点位字典失败',
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取表格数据
|
|
|
getTableList () {
|
|
|
this.tableLoading = true
|
|
@@ -528,7 +614,8 @@ export default {
|
|
|
buildingId: '',
|
|
|
buildingList: [],
|
|
|
floorId: '',
|
|
|
- positionId: ''
|
|
|
+ positionId: '',
|
|
|
+ positionList: []
|
|
|
}
|
|
|
this.detailFormShow = true
|
|
|
this.detailFormType = type
|
|
@@ -546,12 +633,11 @@ export default {
|
|
|
postCategory: JSON.stringify(res.data.postCategory),
|
|
|
buildingId: res.data.postCategory == 2 ? '' : res.data.buildingId,
|
|
|
buildingList: res.data.postCategory == 2 ? res.data.buildingId.split(',') : [],
|
|
|
- floorId: res.data.floorId,
|
|
|
- positionId: res.data.positionId
|
|
|
- }
|
|
|
- if (this.buildingList.length) {
|
|
|
- this.setFloorList(this.detailForm.buildingId, 'keep')
|
|
|
+ floorId: res.data.postCategory == 2 ? '' : res.data.floorId,
|
|
|
+ positionId: res.data.postCategory == 1 ? res.data.positionId : '',
|
|
|
+ positionList: res.data.postCategory == 3 ? res.data.positionId.split(',') : []
|
|
|
}
|
|
|
+ this.getBuildingList()
|
|
|
} else {
|
|
|
ElNotification({
|
|
|
title: '获取详情失败',
|
|
@@ -563,24 +649,6 @@ export default {
|
|
|
} else {
|
|
|
this.detailForm.id = null
|
|
|
}
|
|
|
- getBuildingDictionary({
|
|
|
- projectId: this.$store.state.projectId,
|
|
|
- noBinded: 1,
|
|
|
- userId: type == 'edit' ? row.userId : ''
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.buildingList = res.data
|
|
|
- if (this.detailForm.buildingId) {
|
|
|
- this.setFloorList(this.detailForm.buildingId, 'keep')
|
|
|
- }
|
|
|
- } else {
|
|
|
- ElNotification({
|
|
|
- title: '获取楼栋字典失败',
|
|
|
- message: res.msg,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
},
|
|
|
// 提交表单
|
|
|
submitForm () {
|
|
@@ -589,9 +657,11 @@ export default {
|
|
|
this.buttonLoading = true
|
|
|
submitFormOfPerson({
|
|
|
...this.detailForm,
|
|
|
- buildingId: this.detailForm.postCategory != 2 ? this.detailForm.buildingId : this.detailForm.buildingList.join(',')
|
|
|
+ buildingId: this.detailForm.postCategory != 2 ? this.detailForm.buildingId : this.detailForm.buildingList.join(','),
|
|
|
+ positionId: this.detailForm.postCategory != 3 ? this.detailForm.positionId : this.detailForm.positionList.join(',')
|
|
|
}).then(res => {
|
|
|
this.buttonLoading = false
|
|
|
+ debugger
|
|
|
if (res.code == 200) {
|
|
|
this.detailFormShow = false
|
|
|
ElNotification({
|