Browse Source

Merge branch 'dev_org_staff' into test

shibei_master
YUJT 3 years ago
parent
commit
0b2aebe647
  1. 118
      src/views/modules/base/organization/organization.vue

118
src/views/modules/base/organization/organization.vue

@ -686,12 +686,14 @@ export default {
// ID
userAgencyId: localStorage.getItem("agencyId"),
// staffId
userStaffId: '',
// ID
currentAgencyId: localStorage.getItem("agencyId"),
// ID
currentDepartmentId:'',
currentDepartmentId:'14f572e724eecf7668b655505d789cab',
// ID
currentGridOrgId:'',
currentGridOrgId:'63d5ff92ea981b1c58e4914ac894c610',
//
lat:'11',
@ -1169,25 +1171,28 @@ export default {
const url = "/gov/org/staff/editstaff"
let params = {
orgType:this.peoForm.orgType,
staffId:this.userStaffId,
name:this.peoForm.name,
mobile:this.peoForm.mobile,
gender:this.peoForm.gender,
gender:this.peoForm.gender === '男' ? 1 : 0,
workType:this.peoForm.post,
roles:this.peoForm.duty,
orgId:this.submitOrgid,
agencyId:this.userAgencyId,
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0) {
this.$message.success("添加成功")
this.dialogVisiblePeo = false
this.peoForm = []
this.$message.success("修改成功")
this.modifyPeo = false
this.getAgencyList()
this.getDepartmentList()
this.getGridList()
this.getAgencyStaffListData()
this.getDepartmentStaffListData()
this.getGridStaffListData()
} else {
this.$message.error(msg)
}
@ -1445,34 +1450,14 @@ export default {
this.peoForm.orgType = 'agency'
this.submitOrgid = this.currentAgencyId
},
//
xiuPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'agency'
this.submitOrgid = this.currentAgencyId
this.peoForm.name = row.name
this.peoForm.mobile = row.mobile
this.peoForm.gender = row.gender
this.peoForm.post = row.post
this.peoForm.duty = row.roles
},
//
addCommunityPeo(){
this.dialogVisiblePeo = true
this.peoForm.orgType = 'dept'
this.submitOrgid = this.currentDepartmentId
},
//
xiuCommunityPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'dept'
this.submitOrgid = this.currentDepartmentId
this.peoForm.name = row.name
this.peoForm.mobile = row.mobile
this.peoForm.gender = row.gender
this.peoForm.post = row.post
this.peoForm.duty = row.roles
},
//
addGridPeo(){
this.dialogVisiblePeo = true
@ -1484,6 +1469,7 @@ export default {
this.modifyPeo = true
this.peoForm.orgType = 'grid'
this.submitOrgid = this.currentGridOrgId
this.userStaffId = row.staffId
const url = "/gov/org/staff/editstaffinit"
let params = {
@ -1495,7 +1481,7 @@ export default {
this.peoForm.name = data.name
this.peoForm.mobile = data.mobile
this.peoForm.gender = data.gender
this.peoForm.gender = data.gender === 1 ? '男' : '女'
this.peoForm.post = data.workType
//
let existedRoleArr = []
@ -1508,6 +1494,76 @@ export default {
} else {
this.$message.error(msg)
}
},
//
async xiuPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'agency'
this.submitOrgid = this.currentAgencyId
this.userStaffId = row.staffId
const url = "/gov/org/staff/editstaffinit"
let params = {
staffId:row.staffId,
agencyId:this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.peoForm.name = data.name
this.peoForm.mobile = data.mobile
this.peoForm.post = data.workType
this.peoForm.gender = data.gender === 1 ? '男' : '女'
//
let existedRoleArr = []
data.roleList.forEach(function (sysRole) {
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId)
}
})
this.peoForm.duty = existedRoleArr
} else {
this.$message.error(msg)
}
},
//
async xiuCommunityPeo(row){
this.modifyPeo = true
this.peoForm.orgType = 'dept'
this.submitOrgid = this.currentDepartmentId
this.userStaffId = row.staffId
const url = '/gov/org/staff/editstaffinit'
let params = {
staffId:row.staffId,
agencyId:this.currentAgencyId
}
const { data, code, msg } = await requestPost(url,params)
if(code === 0){
this.peoForm.name = data.name
this.peoForm.mobile = data.mobile
this.peoForm.gender = data.gender === 1 ? '男' : '女'
this.peoForm.post = data.workType
//
let existedRoleArr = []
data.roleList.forEach(function (sysRole) {
if (sysRole.selected === true) {
existedRoleArr.push(sysRole.roleId)
}
})
this.peoForm.duty = existedRoleArr
}else {
this.$message.error(msg)
}
},
//
cancelDisable(){

Loading…
Cancel
Save