|
@@ -13,7 +13,7 @@
|
|
|
</templateTable>
|
|
</templateTable>
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
:title="dialogTitle"
|
|
:title="dialogTitle"
|
|
|
- width="25%"
|
|
|
|
|
|
|
+ width="30%"
|
|
|
:visible.sync="dialogVisibleadd"
|
|
:visible.sync="dialogVisibleadd"
|
|
|
>
|
|
>
|
|
|
<div class="flex" style="line-height: 50px">
|
|
<div class="flex" style="line-height: 50px">
|
|
@@ -76,7 +76,7 @@
|
|
|
</el-tree>
|
|
</el-tree>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="11" :offset="1" style="height: 500px; ">
|
|
|
|
|
|
|
+ <el-col :span="11" :offset="1" style="height: 500px">
|
|
|
<div>
|
|
<div>
|
|
|
<span>工号:</span>
|
|
<span>工号:</span>
|
|
|
<el-input
|
|
<el-input
|
|
@@ -103,37 +103,34 @@
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
|
<h4>已选中机构名称</h4>
|
|
<h4>已选中机构名称</h4>
|
|
|
- <!-- <div v-for="val in treedatatransfer" :key="val.id">
|
|
|
|
|
- <p>{{ val }} </p>
|
|
|
|
|
- </div> -->
|
|
|
|
|
<div style="height: 460px; overflow-y: auto">
|
|
<div style="height: 460px; overflow-y: auto">
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="(item,index) in treedatatransfer"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- style="
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
- <p>{{ item.name }}</p>
|
|
|
|
|
- <p>{{ item.areaId }}</p>
|
|
|
|
|
- <el-button
|
|
|
|
|
- class="delete"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- circle
|
|
|
|
|
- @click="deleteDept(item,index)"
|
|
|
|
|
- ></el-button>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(item, index) in treedatatransfer"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ style="
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ <p>{{ item.name }}</p>
|
|
|
|
|
+ <!-- <p>{{ item.areaId }}</p> -->
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ class="delete"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ circle
|
|
|
|
|
+ @click="deleteDept(item, index)"
|
|
|
|
|
+ ></el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button size="small" @click="dialogVisible = false,dept = []">取 消</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" @click="(dialogVisible = false), (dept = [])"
|
|
|
|
|
+ >取 消</el-button
|
|
|
|
|
+ >
|
|
|
<el-button type="primary" size="small" @click="sumbitInstitution"
|
|
<el-button type="primary" size="small" @click="sumbitInstitution"
|
|
|
>确 定</el-button
|
|
>确 定</el-button
|
|
|
>
|
|
>
|
|
@@ -255,26 +252,31 @@ export default {
|
|
|
if (res.code == 200 && res.data.length > 0) {
|
|
if (res.code == 200 && res.data.length > 0) {
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- // this.dept = res.data;
|
|
|
|
|
this.treedatatransfer = res.data;
|
|
this.treedatatransfer = res.data;
|
|
|
|
|
+
|
|
|
this.$refs.tree.setCheckedKeys(res.data);
|
|
this.$refs.tree.setCheckedKeys(res.data);
|
|
|
}, 500);
|
|
}, 500);
|
|
|
|
|
+ } else if (res.code == 200 && res.data.length == 0) {
|
|
|
|
|
+ this.$message.error("暂无数据");
|
|
|
|
|
+ this.dialogVisible = true;
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
//删除右侧已选项
|
|
//删除右侧已选项
|
|
|
- deleteDept(dept,index) {
|
|
|
|
|
|
|
+ deleteDept(dept, index) {
|
|
|
this.treedatatransfer = this.treedatatransfer.filter(
|
|
this.treedatatransfer = this.treedatatransfer.filter(
|
|
|
- (item) => item.areaId !== dept.areaId
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
|
|
+ (item) => item.name !== dept.name
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
this.dept = this.dept.filter((item) => item !== dept.areaId);
|
|
this.dept = this.dept.filter((item) => item !== dept.areaId);
|
|
|
},
|
|
},
|
|
|
treeListFun(data) {
|
|
treeListFun(data) {
|
|
|
this.$api.dept.queryTreeList(data).then((res) => {
|
|
this.$api.dept.queryTreeList(data).then((res) => {
|
|
|
this.treedata = res.data;
|
|
this.treedata = res.data;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
this.setDisabled(this.treedata);
|
|
this.setDisabled(this.treedata);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -302,30 +304,34 @@ export default {
|
|
|
return label;
|
|
return label;
|
|
|
},
|
|
},
|
|
|
uthorizedAgency(row) {
|
|
uthorizedAgency(row) {
|
|
|
- this.selectId = ''
|
|
|
|
|
- this.selectName = ''
|
|
|
|
|
|
|
+ this.selectId = "";
|
|
|
|
|
+ this.selectName = "";
|
|
|
this.treeListFun({
|
|
this.treeListFun({
|
|
|
id: "",
|
|
id: "",
|
|
|
name: "",
|
|
name: "",
|
|
|
});
|
|
});
|
|
|
this.rowId = row.id;
|
|
this.rowId = row.id;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.treedatatransfer = [];
|
|
this.treedatatransfer = [];
|
|
|
this.treeSeachId = "";
|
|
this.treeSeachId = "";
|
|
|
this.treeSeachname = "";
|
|
this.treeSeachname = "";
|
|
|
let data = {};
|
|
let data = {};
|
|
|
data.gradeId = row.id;
|
|
data.gradeId = row.id;
|
|
|
this.$api.sys.queryRelation(data).then((res) => {
|
|
this.$api.sys.queryRelation(data).then((res) => {
|
|
|
- this.dept = []
|
|
|
|
|
|
|
+ this.dept = [];
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.treedatatransfer = res.data;
|
|
this.treedatatransfer = res.data;
|
|
|
-
|
|
|
|
|
res.data.forEach((e) => {
|
|
res.data.forEach((e) => {
|
|
|
- this.dept.push(e.areaId);
|
|
|
|
|
|
|
|
|
|
|
|
+ this.treekeys.push(e.areaId);
|
|
|
|
|
+ this.dept.push(e.areaId);
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.tree.setCheckedKeys(this.treekeys);
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
}, 500);
|
|
}, 500);
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
@@ -336,20 +342,21 @@ export default {
|
|
|
//获取选中节点
|
|
//获取选中节点
|
|
|
treechange(item, node, self) {
|
|
treechange(item, node, self) {
|
|
|
if (item.children.length == 0) {
|
|
if (item.children.length == 0) {
|
|
|
- if (node === true) {
|
|
|
|
|
- this.dept.push(item.id);
|
|
|
|
|
- this.treedatatransfer.push({ name: item.name, areaId: item.id });
|
|
|
|
|
- } else {
|
|
|
|
|
- let index = this.dept.indexOf(
|
|
|
|
|
- this.dept.filter((e) => e == item.id)[0]
|
|
|
|
|
- );
|
|
|
|
|
- let name = this.treedatatransfer.indexOf(
|
|
|
|
|
- this.treedatatransfer.filter((e) => e == item.name)[0]
|
|
|
|
|
|
|
+ let temp = [];
|
|
|
|
|
+ this.treedatatransfer.forEach((e) => {
|
|
|
|
|
+ temp.push(e.name);
|
|
|
|
|
+ });
|
|
|
|
|
+ let containsItem = temp.indexOf(item.name);
|
|
|
|
|
+ let strId = String(item.id)
|
|
|
|
|
+ if (containsItem > -1) {
|
|
|
|
|
+ this.dept = this.dept.filter((e) => e !== strId)
|
|
|
|
|
+
|
|
|
|
|
+ this.treedatatransfer = this.treedatatransfer.filter(
|
|
|
|
|
+ (_, index) => index !== containsItem
|
|
|
);
|
|
);
|
|
|
- if (index !== -1) {
|
|
|
|
|
- this.dept.splice(index, 1);
|
|
|
|
|
- this.treedatatransfer.splice(name, 1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.dept.push(item.id);
|
|
|
|
|
+ this.treedatatransfer.push({name:item.name});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -449,17 +456,18 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
sumbitInstitution() {
|
|
sumbitInstitution() {
|
|
|
- this.$api.sys
|
|
|
|
|
- .sysChannelauthorized({ areaIdList: this.dept, id: this.rowId })
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.getList();
|
|
|
|
|
- this.dialogVisible = false;
|
|
|
|
|
- this.dept = []
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(res.msg);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let array = [...new Set( this.dept)]
|
|
|
|
|
+ this.$api.sys
|
|
|
|
|
+ .sysChannelauthorized({ areaIdList: array, id: this.rowId })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
|
+ this.dept = [];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
handleTableUpload(row) {
|
|
handleTableUpload(row) {
|
|
|
this.name = row.name;
|
|
this.name = row.name;
|