|
@@ -234,20 +234,28 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 新增部门 -->
|
|
|
- <el-dialog :title="depTitle" :visible.sync="departmentVisible" width="400px" >
|
|
|
- <el-form ref="depForm" :model="depForm" :rules="depRules" label-width="80px">
|
|
|
+ <el-dialog :title="depTitle" :visible.sync="departmentVisible" width="500px" >
|
|
|
+ <el-form ref="depForm" :model="depForm" :rules="depRules" label-width="100px">
|
|
|
<el-form-item label="部门名称" prop="name">
|
|
|
- <el-input v-model="depForm.name" placeholder="请输入部门名称" clearable></el-input>
|
|
|
+ <el-input v-model="depForm.name" placeholder="请输入部门名称" clearable style="width: 100%"></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="负责人" prop="managerId">
|
|
|
- <el-select v-model="depForm.managerId" filterable clearable placeholder="请选择部门负责人" >
|
|
|
+ <!-- 主要负责人 -->
|
|
|
+ <el-form-item label="主要负责人" prop="managerId">
|
|
|
+ <el-select v-model="depForm.managerId" filterable clearable placeholder="请选择主要负责人" style="width: 100%">
|
|
|
+ <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <!-- 其他负责人 -->
|
|
|
+ <el-form-item label="其他负责人" prop="managerId">
|
|
|
+ <el-select v-model="depForm.otherManagerIds" filterable clearable multiple style="width: 100%" placeholder="请选择其他负责人" >
|
|
|
<el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<!-- 直属领导 -->
|
|
|
<el-form-item label="直属领导" prop="reportAuditUserid">
|
|
|
- <el-select v-model="depForm.reportAuditUserid" filterable clearable placeholder="请选择直属领导" >
|
|
|
+ <el-select v-model="depForm.reportAuditUserid" filterable clearable placeholder="请选择直属领导" style="width: 100%">
|
|
|
<el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -2424,7 +2432,6 @@ export default {
|
|
|
|
|
|
// 部门列表点击
|
|
|
handleNodeClick(data) {
|
|
|
- // console.log(data, 999)
|
|
|
if (this.depData == null || data.id != this.depData.id) {
|
|
|
this.depData = data;
|
|
|
this.page = 1;
|
|
@@ -2434,6 +2441,7 @@ export default {
|
|
|
|
|
|
// 新增、修改部门
|
|
|
createDepartment(i) {
|
|
|
+ console.log(i, '看看')
|
|
|
setTimeout(() => {
|
|
|
var that = this;
|
|
|
if (i == -2) {
|
|
@@ -2458,6 +2466,7 @@ export default {
|
|
|
};
|
|
|
that.depTitle = "新增部门";
|
|
|
} else {
|
|
|
+ console.log(that.depData, '看看值')
|
|
|
if (that.depData.managerId == "null") {
|
|
|
that.depData.managerId = "";
|
|
|
}
|
|
@@ -2470,7 +2479,14 @@ export default {
|
|
|
parentId: that.depData.parentId,
|
|
|
managerId: that.depData.managerId,
|
|
|
reportAuditUserid: that.depData.reportAuditUserid,
|
|
|
- };
|
|
|
+ }
|
|
|
+ if(that.depData.otherManagerIds) {
|
|
|
+ this.$set(that.depForm, 'otherManagerIds', that.depData.otherManagerIds)
|
|
|
+ } else {
|
|
|
+ this.$set(that.depForm, 'otherManagerIds', [])
|
|
|
+
|
|
|
+ }
|
|
|
+ // console.log('点击编辑的时候', that.depData)
|
|
|
// if(that.depData.reportAuditUserid != null && that.depData.reportAuditUserid != "null" && that.depData.reportAuditUserid.length > 0) {
|
|
|
// that.depForm.reportAuditUserid = that.depData.reportAuditUserid
|
|
|
// }
|
|
@@ -2538,6 +2554,10 @@ export default {
|
|
|
if (this.depForm.reportAuditUserid) {
|
|
|
form.reportAuditUserid = this.depForm.reportAuditUserid;
|
|
|
}
|
|
|
+ // 其他负责人
|
|
|
+ if(this.depForm.otherManagerIds) {
|
|
|
+ form.otherManagerIds = this.depForm.otherManagerIds.toString();
|
|
|
+ }
|
|
|
this.http.post(
|
|
|
this.depForm.id == null
|
|
|
? this.port.manage.add
|
|
@@ -2553,6 +2573,7 @@ export default {
|
|
|
if (this.depForm.id != null) {
|
|
|
this.depData.label = form.name;
|
|
|
this.depData.managerId = form.managerId;
|
|
|
+ this.depData.otherManagerIds = form.otherManagerIds;
|
|
|
}
|
|
|
|
|
|
this.getDepartment();
|