|
@@ -34,7 +34,7 @@
|
|
|
v-for="dict in dict.type.sys_org_type"
|
|
v-for="dict in dict.type.sys_org_type"
|
|
|
:key="dict.value"
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
:label="dict.label"
|
|
|
- :value="`${dict.value}`"
|
|
|
|
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
></el-option>
|
|
></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -63,7 +63,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { deptTreeSelect } from "@/api/system/public";
|
|
|
|
|
|
|
+import {deptTreeSelect} from "@/api/system/public";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
dicts: ["sys_org_type"],
|
|
dicts: ["sys_org_type"],
|
|
@@ -77,6 +77,11 @@ export default {
|
|
|
default: false,
|
|
default: false,
|
|
|
required: false,
|
|
required: false,
|
|
|
},
|
|
},
|
|
|
|
|
+ queryData: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: null,
|
|
|
|
|
+ required: false,
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -128,97 +133,107 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- // queryForm: {
|
|
|
|
|
- // deep: true,
|
|
|
|
|
- // handler(n, o) {
|
|
|
|
|
|
|
+ queryData: {
|
|
|
|
|
+ handler(n) {
|
|
|
|
|
+ if (n) {
|
|
|
|
|
+ this.queryForm.type = parseInt(n);
|
|
|
|
|
+ this.serchTreeHandler();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // queryForm: {
|
|
|
|
|
+ // deep: true,
|
|
|
|
|
+ // handler(n, o) {
|
|
|
|
|
|
|
|
- // if(!n.value&&!n.type){
|
|
|
|
|
- // this.$refs.tree.filter({});
|
|
|
|
|
- // }else{
|
|
|
|
|
|
|
+ // if(!n.value&&!n.type){
|
|
|
|
|
+ // this.$refs.tree.filter({});
|
|
|
|
|
+ // }else{
|
|
|
|
|
|
|
|
- // this.$refs.tree.filter(n);
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
- // },
|
|
|
|
|
- },
|
|
|
|
|
- // computed: {
|
|
|
|
|
- // defaultNode:
|
|
|
|
|
- // //pv: sync("value"),
|
|
|
|
|
- // },
|
|
|
|
|
- model: {
|
|
|
|
|
- prop: "defaultNode",
|
|
|
|
|
- event: "change",
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- clear() {
|
|
|
|
|
- this.sNodeList = [];
|
|
|
|
|
- this.$refs.tree.setCheckedKeys([]);
|
|
|
|
|
- this.$refs.tree.setCurrentKey(null);
|
|
|
|
|
- this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
- },
|
|
|
|
|
- //筛选条件变化
|
|
|
|
|
- serchTreeHandler() {
|
|
|
|
|
- this.$refs.tree.filter(this.queryForm);
|
|
|
|
|
|
|
+ // this.$refs.tree.filter(n);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
|
|
+ // },
|
|
|
},
|
|
},
|
|
|
- /** 查询机构树 */
|
|
|
|
|
- getDeptTree() {
|
|
|
|
|
- deptTreeSelect().then((response) => {
|
|
|
|
|
- this.orgTree = response.data;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- filterNode(value, data, node) {
|
|
|
|
|
- if (this.queryForm.value && this.queryForm.type) {
|
|
|
|
|
- return (
|
|
|
|
|
- data.name.indexOf(this.queryForm.value) !== -1 &&
|
|
|
|
|
- data.type == this.queryForm.type
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- if (this.queryForm.value) {
|
|
|
|
|
- return data.name.indexOf(this.queryForm.value) !== -1;
|
|
|
|
|
- }
|
|
|
|
|
- if (this.queryForm.type) {
|
|
|
|
|
- return data.type == this.queryForm.type;
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ // computed: {
|
|
|
|
|
+ // defaultNode:
|
|
|
|
|
+ // //pv: sync("value"),
|
|
|
|
|
+ // },
|
|
|
|
|
+ model: {
|
|
|
|
|
+ prop: "defaultNode",
|
|
|
|
|
+ event: "change",
|
|
|
},
|
|
},
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ clear() {
|
|
|
|
|
+ this.sNodeList = [];
|
|
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
|
|
+ this.$refs.tree.setCurrentKey(null);
|
|
|
|
|
+ this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
+ },
|
|
|
|
|
+ //筛选条件变化
|
|
|
|
|
+ serchTreeHandler() {
|
|
|
|
|
+ this.$refs.tree.filter(this.queryForm);
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 查询机构树 */
|
|
|
|
|
+ getDeptTree() {
|
|
|
|
|
+ deptTreeSelect().then((response) => {
|
|
|
|
|
+ this.orgTree = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ filterNode(value, data, node) {
|
|
|
|
|
+ if (this.queryForm.value && this.queryForm.type) {
|
|
|
|
|
+ return (
|
|
|
|
|
+ data.name.indexOf(this.queryForm.value) !== -1 &&
|
|
|
|
|
+ data.type == this.queryForm.type
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.queryForm.value) {
|
|
|
|
|
+ return data.name.indexOf(this.queryForm.value) !== -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.queryForm.type) {
|
|
|
|
|
+ return data.type == this.queryForm.type;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
- handleNodeClick() {},
|
|
|
|
|
- onCheck(data, checked, tree) {
|
|
|
|
|
- if (this.checked) {
|
|
|
|
|
- //当前按过滤机构类型勾选
|
|
|
|
|
-
|
|
|
|
|
- //递归查询
|
|
|
|
|
- this.recursionTreeHandler(this.queryForm.type, [data]);
|
|
|
|
|
- }
|
|
|
|
|
- // debugger;
|
|
|
|
|
- this.sNodeList = this.$refs.tree.getCheckedNodes();
|
|
|
|
|
- this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
- },
|
|
|
|
|
- recursionTreeHandler(type, tree) {
|
|
|
|
|
- tree.forEach((item) => {
|
|
|
|
|
- if (type == item.type) {
|
|
|
|
|
- this.$refs.tree.setCheckedKeys([item.id])
|
|
|
|
|
|
|
+ handleNodeClick() {
|
|
|
|
|
+ },
|
|
|
|
|
+ onCheck(data, checked, tree) {
|
|
|
|
|
+ if (this.checked) {
|
|
|
|
|
+ //当前按过滤机构类型勾选
|
|
|
|
|
|
|
|
|
|
+ //递归查询
|
|
|
|
|
+ this.recursionTreeHandler(this.queryForm.type, [data]);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- if (tree.children && tree.children.length > 0) {
|
|
|
|
|
- this.recursionTreeHandler(type,tree.children)
|
|
|
|
|
- } else {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- getSubOrgIdsByOrgType(topOrg, orgType, orgIdList) {
|
|
|
|
|
- if (!topOrg) return;
|
|
|
|
|
- if (topOrg.type == orgType) {
|
|
|
|
|
- orgIdList.push(topOrg);
|
|
|
|
|
- }
|
|
|
|
|
- if (topOrg.children && topOrg.children.length > 0) {
|
|
|
|
|
- topOrg.children.forEach((item) => {
|
|
|
|
|
- this.getSubOrgIdsByOrgType(item, orgType, orgIdList);
|
|
|
|
|
|
|
+ // debugger;
|
|
|
|
|
+ this.sNodeList = this.$refs.tree.getCheckedNodes();
|
|
|
|
|
+ this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
+ },
|
|
|
|
|
+ recursionTreeHandler(type, tree) {
|
|
|
|
|
+ tree.forEach((item) => {
|
|
|
|
|
+ if (type == item.type) {
|
|
|
|
|
+ this.$refs.tree.setCheckedKeys([item.id])
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ if (tree.children && tree.children.length > 0) {
|
|
|
|
|
+ this.recursionTreeHandler(type, tree.children)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getSubOrgIdsByOrgType(topOrg, orgType, orgIdList) {
|
|
|
|
|
+ if (!topOrg) return;
|
|
|
|
|
+ if (topOrg.type == orgType) {
|
|
|
|
|
+ orgIdList.push(topOrg);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (topOrg.children && topOrg.children.length > 0) {
|
|
|
|
|
+ topOrg.children.forEach((item) => {
|
|
|
|
|
+ this.getSubOrgIdsByOrgType(item, orgType, orgIdList);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|