四个搜索处理

master
许宏杰 8 months ago
parent cbbc44f968
commit 55b3c74b68

@ -221,7 +221,7 @@ aside {
margin-top: 6.5vh !important; margin-top: 6.5vh !important;
} }
.dialog-main { .dialog-main {
min-height: 700px; min-height: 650px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #031c3c; background: #031c3c;

@ -1,6 +1,6 @@
<template> <template>
<div class="search-container"> <div class="search-container">
<div class="option-rows"> <div class="option-rows" v-if="show_shequ_xiaoqu">
<el-select <el-select
@change="changeSelect($event, 'xiaoquList')" @change="changeSelect($event, 'xiaoquList')"
v-model="queryParams.shequId" v-model="queryParams.shequId"
@ -67,18 +67,18 @@
> >
<el-option <el-option
v-for="item in buildingList" v-for="item in buildingList"
:key="item.id" :key="item.buildingId"
:label="item.label" :label="item.buildingName"
:value="item.id" :value="item.buildingId"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="queryParams.houseid" placeholder="选择住户" clearable> <el-select v-model="queryParams.houseid" placeholder="选择住户" clearable>
<el-option <el-option
v-for="item in houseList" v-for="item in houseList"
:key="item.id" :key="item.houseId"
:label="item.label" :label="item.houseName"
:value="item.id" :value="item.houseId"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -220,7 +220,7 @@
<script> <script>
import { getLog, exportLog } from "@/api/home/index.js"; // import { getLog, exportLog } from "@/api/home/index.js"; //
import { handleTreeId } from "@/utils/findTreeId.js"; import { handleTreeId } from "@/utils/findTreeId.js";
import { treeselect } from "@/api/system/dept"; // import { treeselect, getsszxBh } from "@/api/system/dept"; //
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import ColorCell from "@/components/ColorCell"; import ColorCell from "@/components/ColorCell";
@ -228,7 +228,7 @@ export default {
// dicts: ["b_color_type"], // dicts: ["b_color_type"],
components: { ColorCell }, components: { ColorCell },
computed: { computed: {
...mapGetters(["leftColor", "rightTopColor", "queryParamsIndex"]), ...mapGetters(["leftColor", "rightTopColor", "queryParamsXiaoqu"]),
}, },
filters: { filters: {
filterType(target) { filterType(target) {
@ -244,7 +244,7 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
show_shequ_xiaoqu: true,
currentIndex: 0, currentIndex: 0,
credentialnoType: 0, credentialnoType: 0,
tabList: [ tabList: [
@ -315,8 +315,8 @@ export default {
], ],
}; };
}, },
mounted() { created() {
this.queryParams.shequId = this.queryParamsIndex.shequId; // this.queryParams.shequId = this.queryParamsIndex.shequId;
this.getDeptList(); this.getDeptList();
}, },
@ -334,11 +334,18 @@ export default {
async getDeptList() { async getDeptList() {
let result = await treeselect(); let result = await treeselect();
this.deptList = result.data[0].children; this.deptList = result.data[0].children;
this.$nextTick(() => {
if (this.$route.path == "/xiaoqu") {
this.queryParams.xiaoquId = this.queryParamsXiaoqu.xiaoquId;
this.changeSelect(this.queryParams.xiaoquId, "netList");
this.show_shequ_xiaoqu = false;
}
});
}, },
/** /**
* 级联筛选 * 级联筛选
*/ */
changeSelect(e, key) { async changeSelect(e, key) {
let list = []; let list = [];
let index = this.objList.findIndex((item) => item.key == key); let index = this.objList.findIndex((item) => item.key == key);
if (index > -1) { if (index > -1) {
@ -347,7 +354,15 @@ export default {
list.map((item) => { list.map((item) => {
this.queryParams[item.value] = undefined; this.queryParams[item.value] = undefined;
}); });
this[key] = handleTreeId(e, this.deptList); if (key == "buildingList" || key == "houseList") {
let res = await getsszxBh({
deptId: this.queryParams.yuanid,
buildingId: this.queryParams.buildingId,
});
this[key] = res.data;
} else {
this[key] = handleTreeId(e, this.deptList);
}
}, },
/** /**

@ -224,7 +224,7 @@ export default {
}, },
data() { data() {
return { return {
show_shequ_xiaoqu: false, show_shequ_xiaoqu: true,
show_net: false, show_net: false,
loading: true, loading: true,
currentIndex: 0, currentIndex: 0,
@ -291,7 +291,7 @@ export default {
], ],
}; };
}, },
mounted() { created() {
// this.show_shequ_xiaoqu = this.$auth.hasRoleOr(["admin", "leader"]); // - // this.show_shequ_xiaoqu = this.$auth.hasRoleOr(["admin", "leader"]); // -
// this.show_net = this.$auth.authRoleNet("network"); // // this.show_net = this.$auth.authRoleNet("network"); //

@ -1,6 +1,6 @@
<template> <template>
<div class="search-container"> <div class="search-container">
<div class="option-rows"> <div class="option-rows" v-if="show_shequ_xiaoqu">
<el-select <el-select
@change="changeSelect($event, 'xiaoquList')" @change="changeSelect($event, 'xiaoquList')"
v-model="queryParams.shequId" v-model="queryParams.shequId"
@ -67,18 +67,18 @@
> >
<el-option <el-option
v-for="item in buildingList" v-for="item in buildingList"
:key="item.id" :key="item.buildingId"
:label="item.label" :label="item.buildingName"
:value="item.id" :value="item.buildingId"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="queryParams.houseid" placeholder="选择住户" clearable> <el-select v-model="queryParams.houseid" placeholder="选择住户" clearable>
<el-option <el-option
v-for="item in houseList" v-for="item in houseList"
:key="item.id" :key="item.houseId"
:label="item.label" :label="item.houseName"
:value="item.id" :value="item.houseId"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -223,19 +223,24 @@ import {
} from "@/api/home/index.js"; // } from "@/api/home/index.js"; //
import { addPerson } from "@/api/taicangpop/person"; import { addPerson } from "@/api/taicangpop/person";
import { handleTreeId } from "@/utils/findTreeId.js"; import { handleTreeId } from "@/utils/findTreeId.js";
import { treeselect } from "@/api/system/dept"; // import { treeselect, getsszxBh } from "@/api/system/dept"; //
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import ColorCell from "@/components/ColorCell"; import ColorCell from "@/components/ColorCell";
export default { export default {
dicts: ["b_color_type"], dicts: ["b_color_type"],
components: { ColorCell }, components: { ColorCell },
computed: { computed: {
...mapGetters(["leftColor", "rightTopColor", "userId", "queryParamsIndex"]), ...mapGetters([
"leftColor",
"rightTopColor",
"userId",
"queryParamsXiaoqu",
]),
}, },
data() { data() {
return { return {
loading: true, loading: true,
show_shequ_xiaoqu: true,
currentIndex: 0, currentIndex: 0,
credentialnoType: 0, credentialnoType: 0,
// tabList: [ // tabList: [
@ -301,8 +306,8 @@ export default {
], ],
}; };
}, },
mounted() { created() {
this.queryParams.shequId = this.queryParamsIndex.shequId; // this.queryParams.shequId = this.queryParamsIndex.shequId;
this.getDeptList(); this.getDeptList();
}, },
methods: { methods: {
@ -340,12 +345,18 @@ export default {
async getDeptList() { async getDeptList() {
let result = await treeselect(); let result = await treeselect();
this.deptList = result.data[0].children; this.deptList = result.data[0].children;
// console.log(result); this.$nextTick(() => {
if (this.$route.path == "/xiaoqu") {
this.queryParams.xiaoquId = this.queryParamsXiaoqu.xiaoquId;
this.changeSelect(this.queryParams.xiaoquId, "netList");
this.show_shequ_xiaoqu = false;
}
});
}, },
/** /**
* 级联筛选 * 级联筛选
*/ */
changeSelect(e, key) { async changeSelect(e, key) {
let list = []; let list = [];
let index = this.objList.findIndex((item) => item.key == key); let index = this.objList.findIndex((item) => item.key == key);
if (index > -1) { if (index > -1) {
@ -354,7 +365,15 @@ export default {
list.map((item) => { list.map((item) => {
this.queryParams[item.value] = undefined; this.queryParams[item.value] = undefined;
}); });
this[key] = handleTreeId(e, this.deptList); if (key == "buildingList" || key == "houseList") {
let res = await getsszxBh({
deptId: this.queryParams.yuanid,
buildingId: this.queryParams.buildingId,
});
this[key] = res.data;
} else {
this[key] = handleTreeId(e, this.deptList);
}
}, },
/** /**

@ -1,6 +1,6 @@
<template> <template>
<div class="search-container"> <div class="search-container">
<div class="option-rows"> <div class="option-rows" v-if="show_shequ_xiaoqu">
<el-select <el-select
@change="changeSelect($event, 'xiaoquList')" @change="changeSelect($event, 'xiaoquList')"
v-model="queryParams.shequId" v-model="queryParams.shequId"
@ -67,18 +67,18 @@
> >
<el-option <el-option
v-for="item in buildingList" v-for="item in buildingList"
:key="item.id" :key="item.buildingId"
:label="item.label" :label="item.buildingName"
:value="item.id" :value="item.buildingId"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model="queryParams.houseid" placeholder="选择住户" clearable> <el-select v-model="queryParams.houseid" placeholder="选择住户" clearable>
<el-option <el-option
v-for="item in houseList" v-for="item in houseList"
:key="item.id" :key="item.houseId"
:label="item.label" :label="item.houseName"
:value="item.id" :value="item.houseId"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -215,7 +215,7 @@
<script> <script>
import { getWarningList } from "@/api/home/index.js"; // import { getWarningList } from "@/api/home/index.js"; //
import { handleTreeId } from "@/utils/findTreeId.js"; import { handleTreeId } from "@/utils/findTreeId.js";
import { treeselect } from "@/api/system/dept"; // import { treeselect, getsszxBh } from "@/api/system/dept"; //
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import ColorCell from "@/components/ColorCell"; import ColorCell from "@/components/ColorCell";
import { exportyujing } from "@/api/home/index.js"; // import { exportyujing } from "@/api/home/index.js"; //
@ -223,12 +223,12 @@ export default {
dicts: ["b_color_type"], dicts: ["b_color_type"],
components: { ColorCell }, components: { ColorCell },
computed: { computed: {
...mapGetters(["leftColor", "rightTopColor", "queryParamsIndex"]), ...mapGetters(["leftColor", "rightTopColor", "queryParamsXiaoqu"]),
}, },
data() { data() {
return { return {
loading: true, loading: true,
show_shequ_xiaoqu: true,
currentIndex: 0, currentIndex: 0,
credentialnoType: 0, credentialnoType: 0,
tabList: [ tabList: [
@ -294,8 +294,7 @@ export default {
], ],
}; };
}, },
mounted() { created() {
this.queryParams.shequId = this.queryParamsIndex.shequId;
this.getDeptList(); this.getDeptList();
}, },
methods: { methods: {
@ -304,11 +303,18 @@ export default {
let result = await treeselect(); let result = await treeselect();
this.deptList = result.data[0].children; this.deptList = result.data[0].children;
// console.log(result); // console.log(result);
this.$nextTick(() => {
if (this.$route.path == "/xiaoqu") {
this.queryParams.xiaoquId = this.queryParamsXiaoqu.xiaoquId;
this.changeSelect(this.queryParams.xiaoquId, "netList");
this.show_shequ_xiaoqu = false;
}
});
}, },
/** /**
* 级联筛选 * 级联筛选
*/ */
changeSelect(e, key) { async changeSelect(e, key) {
let list = []; let list = [];
let index = this.objList.findIndex((item) => item.key == key); let index = this.objList.findIndex((item) => item.key == key);
if (index > -1) { if (index > -1) {
@ -317,7 +323,15 @@ export default {
list.map((item) => { list.map((item) => {
this.queryParams[item.value] = undefined; this.queryParams[item.value] = undefined;
}); });
this[key] = handleTreeId(e, this.deptList); if (key == "buildingList" || key == "houseList") {
let res = await getsszxBh({
deptId: this.queryParams.yuanid,
buildingId: this.queryParams.buildingId,
});
this[key] = res.data;
} else {
this[key] = handleTreeId(e, this.deptList);
}
}, },
/** /**

Loading…
Cancel
Save