Commit 8a38db57 authored by xhx's avatar xhx

9/25

parent a849a9e9
......@@ -39,18 +39,18 @@
<span v-if="record.state!='已禁用'">
<a @click="deploy(record)">调配</a>
<a-divider type="vertical" />
<a @click="() => enable(record.key)">启用</a>
<a @click="() => enable(record.uuid)">启用</a>
</span>
<span v-else>
<a @click="disable(record.key)">禁用</a>
<a @click="disable(record.uuid)">禁用</a>
</span>
<span v-if="record.state==('启用中/在岗')">
<a-divider type="vertical" />
<a @confirm="() => offJob(record.key)">不在岗</a>
<a @confirm="() => offJob(record.uuid)">不在岗</a>
</span>
<span v-else-if="record.state==('启用中/不在岗')">
<a-divider type="vertical" />
<a @click="inJob(record.key)">在岗</a>
<a @click="inJob(record.uuid)">在岗</a>
</span>
</p>
</a-table>
......@@ -72,6 +72,7 @@
import Vue, { PropType } from "vue"
import { firstLevelManager } from '@/mock/index'
import { staff } from '@/types/staff'
import { eUserStatusAction } from '@/types/user'
import { eRole } from "@/types/role"
import { eLevel } from "@/types/level"
import { getColumns } from '@/const/columns/userManagerCol'
......@@ -79,10 +80,15 @@ import { userModal } from './const'
import deplotModal from "@/components/UserManage/deployModal.vue"
import Filter from '@/filter/index'
import { mapActions, mapMutations, mapState } from 'vuex'
import Mixin from "@/views/Root/User/Mixin/index"
// import Mixin from "@/views/Root/User/Mixin/index"
import StaffService from '@/service/StaffService'
import { message } from "ant-design-vue"
const staff = new StaffService()
export default Vue.extend({
mixins: [Mixin],
// mixins: [Mixin],
components:{ deplotModal },
filters: {
filterStatus(val: number) {
......@@ -111,7 +117,8 @@ export default Vue.extend({
title:'',
text:'',
type:userModal.enable,
id: '',
params: {} as any
}
},
computed:{
......@@ -133,13 +140,30 @@ export default Vue.extend({
}
},
methods:{
...mapMutations('platformUserManagement', {
platformSave: 'save',
}),
...mapActions('platformUserManagement', {
platformQuery: 'queryUser',
}),
getRouteQuery() {
const keys = JSON.parse(this.$route.query.rankVal as string)
console.log(keys)
const level = this.$route.query.level
this.params = {
firstBranch: +keys[0]?.value || undefined,
firstSubBranch: +keys[2]?.value || undefined,
secondBranch: +keys[1]?.value || undefined,
secondSubBranch: +keys[3]?.value || undefined,
level
}
},
getLists() {
this.platformSave({
...this.params
})
this.platformQuery()
},
changeHandle(e: any) {
this.platformSave({
page: e.current,
......@@ -151,37 +175,52 @@ export default Vue.extend({
},
enable(key:string){
this.type = userModal.enable
this.id = key
this.title = '启用用户'
this.text = '确定启用该用户?'
this.show = true
},
disable(key:string){
this.type = userModal.disable
this.id = key
this.title = '禁用用户'
this.text = '确定禁用该用户?'
this.show = true
},
inJob(key:string){
this.type = userModal.enable
this.id = key
this.title = '设置在岗'
this.text = '确定将该用户设置为在岗?'
this.show = true
},
offJob(key:string){
this.type = userModal.enable
this.id = key
this.title = '设置不在岗'
this.text = '确定将该用户设置为在岗?'
this.show = true
},
modifyStauts(status: number) {
staff.modifyStaffStatus({
status: status,
uuid: this.id
}).then(res => {
if (res.code === 200) {
message.success('操作成功')
this.getLists()
}
})
},
handleOk(record:any){
if( this.type == userModal.enable ){
this.modifyStauts(eUserStatusAction.enable)
} else if( this.type == userModal.disable ){
this.modifyStauts(eUserStatusAction.disable)
} else if( this.type == userModal.inJob ){
this.modifyStauts(eUserStatusAction.onPosition)
} else if( this.type == userModal.offJob ){
this.modifyStauts(eUserStatusAction.notOnPosition)
}
this.show = false
},
......@@ -235,6 +274,10 @@ export default Vue.extend({
this.$router.push({name:'secondarySubClient',query:{level: key, rankVal: this.$route.query.rankVal}})
},
},
created() {
this.getRouteQuery()
this.getLists()
}
})
</script>
......
......@@ -97,7 +97,11 @@ export default Vue.extend({
const levelList = []
for (let item of this.fooList) {
if (item.value) {
levelList.push(item.value + '')
let name = ''
for (let i of item.options) {
name = item.value === i.ID ? i.Name : ''
}
levelList.push({ value: item.value, name })
} else {
break
}
......@@ -105,13 +109,13 @@ export default Vue.extend({
if( levelList.length==0 && this.search.length == 0 ){
this.$message.info('请通过选择或者输入详细地址搜索')
}else{
const search:string|Array<string> = levelList.length==0? this.search:levelList
const search:string|Array<{value: number, name: string}> = levelList.length==0? this.search:levelList
console.log(search)
this.selectTables(search as Array<string>)
this.selectTables(search)
}
// this.$router.push({name:'firstLevel'})
},
selectTables(arr: Array<string>|string) {
selectTables(arr: Array<{value: number, name: string}>|string) {
if (typeof arr === 'string') {
this.$router.push({path: '/backend/user/secondarySub', query: { rankVal: arr }})
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment