Browse Source

1

xiaowang-featrue
mk 11 months ago
parent
commit
82269b799a
  1. 77
      src/views/modules/base/organization/organization.vue

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

@ -497,6 +497,12 @@
:show-all-levels="true" :show-all-levels="true"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="分管部门" prop="manageOrgIds"
:class="{ 'form-item': source === 'visiual' }">
<el-cascader class="cell-width-1" ref="agencyIdArray" filterable clearable :filter-method="filter" v-model.trim="peoForm.manageOrgIds" :options="orgDeptOptions"
:props="orgDeptOptionProps" :show-all-levels="false" @change="handleChangeAgency"></el-cascader>
</el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button @click="cancelPeo"> </el-button> <el-button @click="cancelPeo"> </el-button>
@ -621,6 +627,11 @@
:show-all-levels="true" :show-all-levels="true"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="分管部门" prop="manageOrgIds"
:class="{ 'form-item': source === 'visiual' }">
<el-cascader class="cell-width-1" ref="agencyIdArray" filterable clearable :filter-method="filter" v-model.trim="peoForm.manageOrgIds" :options="orgDeptOptions"
:props="orgDeptOptionProps" :show-all-levels="false" @change="handleChangeAgency"></el-cascader>
</el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button @click="cancelXiugai"> </el-button> <el-button @click="cancelXiugai"> </el-button>
@ -1235,8 +1246,11 @@ export default {
zuzhi: "", zuzhi: "",
disableFlag: "", disableFlag: "",
newRoles: [], newRoles: [],
manageScopes:[] manageScopes:[],
manageOrgIds:[],
orgLevels:''
}, },
manageOrgIds:'',
// //
transferForm: { transferForm: {
name: "", name: "",
@ -1327,8 +1341,16 @@ export default {
addDepartmentName: [ addDepartmentName: [
{ required: true, message: "部门名称必填", trigger: "blur" }, { required: true, message: "部门名称必填", trigger: "blur" },
], ],
}, },
orgDeptOptionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
orgDeptOptions:[],
rulesPeo: { rulesPeo: {
name: [{ required: true, message: "姓名必填", trigger: "blur" }], name: [{ required: true, message: "姓名必填", trigger: "blur" }],
mobile: [{ required: true, message: "联系电话必填", trigger: "blur" }], mobile: [{ required: true, message: "联系电话必填", trigger: "blur" }],
@ -1377,6 +1399,7 @@ export default {
// this.getNavigation() // this.getNavigation()
// //
this.assembleBreadcrumbArr(localStorage.getItem("agencyId"), "agency"); this.assembleBreadcrumbArr(localStorage.getItem("agencyId"), "agency");
this.getAgencyGridDepttree()
}, },
watch: { watch: {
@ -1710,7 +1733,9 @@ export default {
: orgType == "dept" : orgType == "dept"
? this.currentDepartmentId ? this.currentDepartmentId
: this.currentGridOrgId, : this.currentGridOrgId,
manageScopes:manageScopeArray manageScopes:manageScopeArray,
orgLevels:this.peoForm.orgLevels,
manageOrgIds:this.manageOrgIds
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
@ -1766,7 +1791,9 @@ export default {
newRoles: this.peoForm.newRoles, newRoles: this.peoForm.newRoles,
agencyId: this.currentAgencyId, agencyId: this.currentAgencyId,
idCard: this.peoForm.idCard, idCard: this.peoForm.idCard,
manageScopes:manageScopeArray manageScopes:manageScopeArray,
orgLevels:this.peoForm.orgLevels,
manageOrgIds:this.manageOrgIds
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
@ -1893,6 +1920,9 @@ export default {
(this.peoForm.gender = ""), (this.peoForm.gender = ""),
(this.peoForm.post = ""), (this.peoForm.post = ""),
this.peoForm.newRoles = []; this.peoForm.newRoles = [];
this.peoForm.manageOrgIds = [];
this.peoForm.orgLevels ='';
this.manageOrgIds=''
}, },
// //
transferRest () { transferRest () {
@ -2113,6 +2143,9 @@ export default {
this.peoForm.gender = data.gender; this.peoForm.gender = data.gender;
this.peoForm.post = data.workType; this.peoForm.post = data.workType;
this.peoForm.idCard = data.idCard; this.peoForm.idCard = data.idCard;
this.peoForm.manageOrgIds = data.manageOrgIds?data.manageOrgIds.split(','):[];
this.peoForm.orgLevels = data.orgLevels;
this.manageOrgIds = data.manageOrgIds;
// //
let existedRoleArr = []; let existedRoleArr = [];
data.newRoleList.forEach(function (sysRole) { data.newRoleList.forEach(function (sysRole) {
@ -2147,6 +2180,9 @@ export default {
this.peoForm.gender = data.gender; this.peoForm.gender = data.gender;
this.peoForm.idCard = data.idCard; this.peoForm.idCard = data.idCard;
this.peoForm.agencyName=data.agencyName; this.peoForm.agencyName=data.agencyName;
this.peoForm.manageOrgIds = data.manageOrgIds?data.manageOrgIds.split(','):[];
this.peoForm.orgLevels = data.orgLevels;
this.manageOrgIds = data.manageOrgIds;
// //
let existedRoleArr = []; let existedRoleArr = [];
data.newRoleList.forEach(function (sysRole) { data.newRoleList.forEach(function (sysRole) {
@ -2209,6 +2245,9 @@ export default {
this.peoForm.gender = data.gender; this.peoForm.gender = data.gender;
this.peoForm.post = data.workType; this.peoForm.post = data.workType;
this.peoForm.idCard = data.idCard; this.peoForm.idCard = data.idCard;
this.peoForm.manageOrgIds = data.manageOrgIds?data.manageOrgIds.split(','):[];
this.peoForm.orgLevels = data.orgLevels;
this.manageOrgIds = data.manageOrgIds;
// //
let existedRoleArr = []; let existedRoleArr = [];
data.newRoleList.forEach(function (sysRole) { data.newRoleList.forEach(function (sysRole) {
@ -2960,6 +2999,36 @@ export default {
this.$message.err(msg) this.$message.err(msg)
} }
}, },
//
async getAgencyGridDepttree() {
const url = "/gov/org/customeragency/agencyGridDepttree"
let params = {
agencyId: this.$store.state.user.agencyId,
purpose: "query"
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.orgDeptOptions = []
this.orgDeptOptions.push(data)
console.log(this.orgDeptOptions,'seee');
} else {
this.$message.error(msg)
}
},
handleChangeAgency(val) {
this.$nextTick(() => {
let obj = this.$refs["agencyIdArray"].getCheckedNodes()
if (obj) {
this.peoForm.orgLevels =obj[0].pathNodes.map(item=>item.data.level).join(',')
this.manageOrgIds =obj[0].pathNodes.map(item=>item.data.agencyId).join(',')
} else {
this.manageOrgIds = ''
this.peoForm.orgLevels = ''
}
});
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save