值班人员只能是系统中的人员

liujun0703-新项目开发
liujun 2024-08-13 14:36:27 +08:00
parent e69847d745
commit d72e37dd8e
4 changed files with 248 additions and 73 deletions

View File

@ -2,32 +2,27 @@
<div class="app-container">
<div class="filter-container">
<el-form inline>
<el-form-item prop="ORGAN_ID" style="width: 250px;">
<Treeselect
:options="DepartmentData"
v-model="ORGAN_ID"
placeholder="请选择单位"
no-options-text="暂无数据"
no-children-text="暂无数据"
@input="handleDepartmentChange"
/>
</el-form-item>
<el-form-item label="月份:" prop="monthvalue">
<el-date-picker
v-model="monthvalue"
type="month"
format="yyyy-MM"
placeholder="选择月"/>
</el-form-item>
<el-form-item>
<el-button class="filter-item" type="primary" icon="el-icon-tickets" @click="tempdown"></el-button>
<el-button class="filter-item" type="primary" icon="el-icon-tickets" @click="tempdown">~~~~</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-top" @click="tolead"></el-button>
<el-button class="filter-item" type="primary" icon="el-icon-refresh" @click="clearmonth"></el-button>
<el-button v-if="false" class="filter-item" type="primary" icon="el-icon-refresh" @click="clearmonth"></el-button>
</el-form-item>
<el-form-item>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="getQuery"></el-button>
@ -54,7 +49,6 @@
prop="name"
label="值班领导"
width="180">
<template v-slot="scope">
<div style="display: flex;justify-content: space-between">
<div >
@ -65,7 +59,9 @@
disable-transitions
style="cursor: pointer;"
@click="peopleDetail(tag.ID,tag.PEOPLE_NAME)"
@close="peopleClose(scope.row.morningShiftForLeader,tag,tag.ID)"> {{ tag.PEOPLE_NAME }}</el-tag>
@close="peopleClose(scope.row.morningShiftForLeader,tag,tag.ID)">
{{ tag.PEOPLE_NAME }}
</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForLeader,scope.row.ID,1,1)"/>
@ -205,12 +201,12 @@
/>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="clearyjDityMain(row.ID)"></el-button>
<el-button v-if="false" type="danger" icon="el-icon-delete" size="mini" @click="clearyjDityMain(row.ID)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="updateMainDity(row.ID)"></el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :visible.sync="dialogPeopleFormEdit" :title="formPeople.PEOPLE_TYPE==1?'值班领导':formPeople.PEOPLE_TYPE==2?'值班员':'值班司机' " width="400px">
<el-dialog :visible.sync="dialogPeopleFormEdit" :title="formPeople.PEOPLE_TYPE===1?'值班领导':formPeople.PEOPLE_TYPE===2?'值班员':'值班司机' " width="400px">
<el-form ref="formPeople" :model="formPeople" label-width="110px" style="width: 300px;">
<el-form-item label="姓名" prop="PEOPLE_NAME">
@ -370,7 +366,7 @@
<el-button type="primary" @click="savePeople2"> </el-button>
</div>
</el-dialog>
<select-zhi-ban-user ref="selectZhiBanUser" @flush="getList()"/>
</div>
</template>
@ -381,8 +377,9 @@ import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import moment from 'moment'
import { upload } from '@/utils/upload'
import SelectZhiBanUser from '../../../emergency_report/duty_management/shift_registration/components/selectZhiBanUser.vue'
export default {
components: { Treeselect, Pagination },
components: { SelectZhiBanUser, Treeselect, Pagination },
data() {
return {
exceltempFormAdd: false,
@ -493,27 +490,13 @@ export default {
this.getAddressList()
},
getTreeNode(node, resolve) {
if (node.level === 0) {
requestFN(
'/yjcommunicate/getCommunicateGroupLevels',
{
regulationsId: ''
}
'department/listAll', {}
).then((data) => {
resolve(data.list)
}).catch((e) => {
console.log(e)
})
} else {
requestFN(
'/yjcommunicate/getCommunicateGroupLevels',
{
regulationsId: node.data.DICTIONARIES_ID
}
).then((data) => {
resolve(data.list)
}).catch((e) => {
})
}
},
filterNode(value, data) {
if (!value) return true
@ -528,18 +511,10 @@ export default {
getAddressList() {
this.listLoading = true
requestFN(
'/yjcommunicate/listAddressBook?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
groupId: this.addressgroupId,
addressName: this.addressName,
addressSex: this.addressSex
}
'department/listTree', {}
).then((data) => {
this.listLoading = false
this.adressvarList = data.varList
this.total = data.page.totalResult
})
.catch((e) => {
}).catch((e) => {
this.listLoading = false
})
},
@ -670,13 +645,12 @@ export default {
this.listLoading = true
requestFN('/workingSchedule/deletePeople', { id: id }).then((data) => {
this.listLoading = false
// this.varList = []
// this.getList()
}).catch((e) => {
this.listLoading = false
})
},
addPeopleTz(dynamicTags, id, type, dity_type) {
console.log('??????')
this.formPeople = {
MAIN_ID: id,
PEOPLE_TYPE: type,
@ -685,7 +659,8 @@ export default {
PEOPLE_SOURCE: '1'
}
this.dynamicTags = dynamicTags
this.dialogPeopleFormEdit = true
console.log('????')
this.$refs.selectZhiBanUser.init(this.formPeople)
},
//
savePeople() {
@ -715,14 +690,11 @@ export default {
this.formPeople.ids = ids
this.formPeople.PEOPLE_SOURCE = 2
// this.listLoading = true
requestFN('/workingSchedule/savePeopleMian2', this.formPeople).then((data) => {
// this.listLoading = false
this.dialogFormAddSysChoiceShow = false
// this.varList = []
this.getList2()
}).catch((e) => {
// this.listLoading = false
console.log(e)
})
},
//* *******************************************
@ -765,7 +737,6 @@ export default {
},
getQuery() {
// this.$refs.multipleTable.clearSelection()
this.getList()
}
}

View File

@ -1,7 +1,7 @@
<template>
<div>
<list v-show="activeName=='list'" ref="list" />
<detail v-if="activeName=='detail'"/>
<list v-show="activeName==='list'" ref="list" />
<detail v-if="activeName==='detail'"/>
</div>
</template>
<script>

View File

@ -16,18 +16,16 @@
</el-form-item>
<el-form-item label="月份:" prop="monthvalue">
<el-date-picker
v-model="monthvalue"
type="month"
format="yyyy-MM"
placeholder="选择月"/>
</el-form-item>
<el-form-item>
<el-button class="filter-item" type="primary" icon="el-icon-tickets" @click="tempdown"></el-button>
<el-button class="filter-item" type="primary" icon="el-icon-top" @click="tolead"></el-button>
<el-button class="filter-item" type="primary" icon="el-icon-refresh" @click="clearmonth"></el-button>
<el-button v-if="false" class="filter-item" type="primary" icon="el-icon-refresh" @click="clearmonth"></el-button>
</el-form-item>
<el-form-item>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="getQuery"></el-button>
@ -68,7 +66,7 @@
@close="peopleClose(scope.row.morningShiftForLeader,tag,tag.ID)"> {{ tag.PEOPLE_NAME }}</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForLeader,scope.row.ID,1,1)"/>
<i class="el-icon-plus" style="cursor: pointer;" @click="addSysChoice(scope.row.morningShiftForLeader,scope.row.ID,1,1)"/>
</div>
</div>
@ -96,7 +94,7 @@
</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForAttendant,scope.row.ID,2,1)"/>
<i class="el-icon-plus" style="cursor: pointer;" @click="addSysChoice(scope.row.morningShiftForAttendant,scope.row.ID,2,1)"/>
</div>
</div>
@ -119,7 +117,7 @@
@close="peopleClose(scope.row.morningShiftForDrivers,tag,tag.ID)"> {{ tag.PEOPLE_NAME }}</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForDrivers,scope.row.ID,3,1)"/>
<i class="el-icon-plus" style="cursor: pointer;" @click="addSysChoice(scope.row.morningShiftForDrivers,scope.row.ID,3,1)"/>
</div>
</div>
@ -145,7 +143,7 @@
@close="peopleClose(scope.row.morningShiftForLeaderForNight,tag,tag.ID)"> {{ tag.PEOPLE_NAME }}</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForLeaderForNight,scope.row.ID,1,2)"/>
<i class="el-icon-plus" style="cursor: pointer;" @click="addSysChoice(scope.row.morningShiftForLeaderForNight,scope.row.ID,1,2)"/>
</div>
</div>
@ -168,7 +166,7 @@
@close="peopleClose(scope.row.morningShiftForAttendantForNight,tag,tag.ID)"> {{ tag.PEOPLE_NAME }}</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForAttendantForNight,scope.row.ID,2,2)"/>
<i class="el-icon-plus" style="cursor: pointer;" @click="addSysChoice(scope.row.morningShiftForAttendantForNight,scope.row.ID,2,2)"/>
</div>
</div>
@ -191,7 +189,7 @@
@close="peopleClose(scope.row.morningShiftForDriversForNight,tag,tag.ID)"> {{ tag.PEOPLE_NAME }}</el-tag>
</div>
<div>
<i class="el-icon-plus" style="cursor: pointer;" @click="addPeopleTz(scope.row.morningShiftForDriversForNight,scope.row.ID,3,2)"/>
<i class="el-icon-plus" style="cursor: pointer;" @click="addSysChoice(scope.row.morningShiftForDriversForNight,scope.row.ID,3,2)"/>
</div>
</div>
@ -205,12 +203,12 @@
/>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="clearyjDityMain(row.ID)"></el-button>
<el-button v-if="false" type="danger" icon="el-icon-delete" size="mini" @click="clearyjDityMain(row.ID)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="updateMainDity(row.ID)"></el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :visible.sync="dialogPeopleFormEdit" :title="formPeople.PEOPLE_TYPE==1?'值班领导':formPeople.PEOPLE_TYPE==2?'值班员':'值班司机' " width="400px">
<el-dialog :visible.sync="dialogPeopleFormEdit" :title="formPeople.PEOPLE_TYPE===1?'值班领导':formPeople.PEOPLE_TYPE===2?'值班员':'值班司机' " width="400px">
<el-form ref="formPeople" :model="formPeople" label-width="110px" style="width: 300px;">
<el-form-item label="姓名" prop="PEOPLE_NAME">
@ -220,7 +218,6 @@
<el-form-item label="电话" prop="PEOPLE_PHONE">
<el-input
v-model="formPeople.PEOPLE_PHONE"
placeholder="请输入电话..."/>
</el-form-item>
@ -370,7 +367,7 @@
<el-button type="primary" @click="savePeople2"> </el-button>
</div>
</el-dialog>
<select-zhi-ban-user ref="selectZhiBanUser"/>
</div>
</template>
@ -381,8 +378,9 @@ import { Treeselect } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import moment from 'moment'
import { upload } from '@/utils/upload'
import SelectZhiBanUser from './selectZhiBanUser.vue'
export default {
components: { Treeselect, Pagination },
components: { SelectZhiBanUser, Treeselect, Pagination },
data() {
return {
exceltempFormAdd: false,
@ -543,10 +541,15 @@ export default {
this.listLoading = false
})
},
addSysChoice() {
this.dialogPeopleFormEdit = false
this.dialogFormAddSysChoiceShow = true
this.getAddressList()
addSysChoice(dynamicTags, id, type, dity_type) {
this.formPeople = {
MAIN_ID: id,
PEOPLE_TYPE: type,
PEOPLE_NAME: '',
DITY_TYPE: dity_type,
PEOPLE_SOURCE: '1'
}
this.$refs.selectZhiBanUser.init(this.formPeople)
},
// *******************************************
handleEditChange(file) {

View File

@ -0,0 +1,201 @@
<template>
<el-dialog v-loading="listLoading" :visible.sync="visible" title="选择人员" width="850px">
<el-container>
<el-aside width="240px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"
/>
</el-aside>
<el-main>
<div class="filter-btn-group">
<el-form label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="用户名">
<el-input v-model="KEYWORDS" style="width: 150px" placeholder="请输入关键字"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="getAddressList()">
搜索
</el-button>
<el-button class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table ref="multipleTable" :data="varList" :header-cell-style="{'font-weight': 'bold','color': '#000'}" style="height:350px" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="USERNAME" width="180" align="center" label="电话号码" />
</el-table>
<div class="page-btn-group">
<div />
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<div slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="savePeople"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { requestFN } from '@/utils/request'
import Pagination from '@/components/Pagination'
import { Treeselect } from '@riophae/vue-treeselect'
export default {
components: { Treeselect, Pagination },
data() {
return {
visible: false,
nodeData: [],
defaultProps: {
value: 'department_ID',
children: 'nodes',
label: 'name'
},
addressName: '',
addressSex: '',
adressvarList: [],
listQuery: {
page: 1,
limit: 10
},
total: 0,
treeLoading: false,
filterText: '',
treeData: [],
form: {
DEPARTMENT_ID: ''
},
varList: [],
KEYWORDS: '',
DEPARTMENT_ID: '',
formPeople: {
ids: '',
PEOPLE_SOURCE: '',
MAIN_ID: '',
PEOPLE_TYPE: '',
PEOPLE_NAME: '',
PEOPLE_PHONE: '',
DITY_TYPE: ''
},
listLoading: false
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
},
methods: {
init(e) {
this.visible = true
this.getTreeList()
this.formPeople = e
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.form.DEPARTMENT_ID = node.id
this.getList(node.id)
},
getAddressList() {
this.getList()
},
goKeyReset() {
this.addressName = ''
this.addressgroupId = ''
this.addressSex = ''
this.getAddressList()
},
savePeople() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length === 0) {
this.$message({
message: '请选择人员...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.USER_ID
}).join(',')
this.formPeople.ids = ids
this.formPeople.PEOPLE_SOURCE = 2
this.listLoading = true
requestFN('/workingSchedule/savePeopleMian2', this.formPeople).then((data) => {
this.listLoading = false
this.visible = false
this.$emit('flush', '')
}).catch((e) => {
this.listLoading = false
})
},
getList(DEPARTMENT_ID) {
this.listLoading = true
if (DEPARTMENT_ID) {
this.DEPARTMENT_ID = DEPARTMENT_ID
}
requestFN(
'/user/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
DEPARTMENT_ID: this.DEPARTMENT_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.userList
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
getTreeList() {
this.treeLoading = true
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
}
}
}
</script>
<style lang="sass" scoped>
.table-ui
td
line-height: 34px
.tbg
width: 200px
.ui-foot
text-align: center
margin-top: 20px
</style>