Commit b3fb305a authored by “yiyousong”'s avatar “yiyousong”

perf: 优化搜索

parent 62be24dd
...@@ -446,33 +446,35 @@ export default { ...@@ -446,33 +446,35 @@ export default {
// 业务搜索 // 业务搜索
handleSearch(type, form) { handleSearch(type, form) {
if (type == "business") { const { businessName, deptName, windowNum } = form;
let { businessName } = form;
if (businessName) { const setupSearch = (searchObj, listKey, value, searchMethod) => {
this.businessSearch.page = 1; searchObj.page = 1;
this.businessSearch.businessList = [businessName]; searchObj[listKey] = value ? [value] : [];
} else { searchMethod();
this.businessSearch.businessList = []; };
}
this.getBusinessEva(); if (type === "business") {
} else if (type == "dept") { setupSearch(
let { deptName } = form; this.businessSearch,
if (deptName) { "businessList",
this.deptSearch.page = 1; businessName,
this.deptSearch.sectionNameList = [deptName]; this.getBusinessEva
} else { );
this.deptSearch.sectionNameList = []; } else if (type === "dept") {
} setupSearch(
this.getDeptEva(); this.deptSearch,
} else if (type == "window") { "sectionNameList",
let { windowNum } = form; deptName,
if (windowNum) { this.getDeptEva
this.windowSearch.page = 1; );
this.windowSearch.windowFromnumList = [windowNum]; } else if (type === "window") {
} else { setupSearch(
this.windowSearch.windowFromnumList = []; this.windowSearch,
} "windowFromnumList",
this.getWindowEva(); windowNum,
this.getWindowEva
);
} }
}, },
}, },
......
...@@ -451,32 +451,21 @@ export default { ...@@ -451,32 +451,21 @@ export default {
// 业务搜索 // 业务搜索
handleSearch(type, form) { handleSearch(type, form) {
if (type == "business") { let { businessName, deptName, windowNum } = form;
let { businessName } = form;
if (businessName) { const setupSearch = (searchObj, listKey, value) => {
this.businessSearch.page = 1; searchObj.page = 1;
this.businessSearch.businessList = [businessName]; searchObj[listKey] = value ? [value] : [];
} else { };
this.businessSearch.businessList = [];
} if (type === "business") {
setupSearch(this.businessSearch, "businessList", businessName);
this.getBusinessQueue(); this.getBusinessQueue();
} else if (type == "dept") { } else if (type === "dept") {
let { deptName } = form; setupSearch(this.deptSearch, "sectionNameList", deptName);
if (deptName) {
this.deptSearch.page = 1;
this.deptSearch.sectionNameList = [deptName];
} else {
this.deptSearch.sectionNameList = [];
}
this.getDeptQueue(); this.getDeptQueue();
} else if (type == "window") { } else if (type === "window") {
let { windowNum } = form; setupSearch(this.windowSearch, "windowFromnumList", windowNum);
if (windowNum) {
this.windowSearch.page = 1;
this.windowSearch.windowFromnumList = [windowNum];
} else {
this.windowSearch.windowFromnumList = [];
}
this.getWindowQueue(); this.getWindowQueue();
} }
}, },
......
...@@ -183,44 +183,36 @@ export default { ...@@ -183,44 +183,36 @@ export default {
this.selectionRows = rows; this.selectionRows = rows;
}, },
handleSearch(form) { handleSearch(form) {
let { type, pjOption, deptName, windowName, year, month, day } = form; let { type, pjOption, deptName, windowNum, year, month, day } = form;
if (type == "year") {
this.searchForm.year = "";
this.searchForm.month = "";
this.searchForm.day = "";
if (type === "year") {
this.searchForm.groupList = ["year"]; this.searchForm.groupList = ["year"];
this.searchForm.year = year; this.searchForm.year = year;
} else if (type == "month") { } else if (type === "month") {
this.searchForm.groupList = ["year", "month"]; this.searchForm.groupList = ["year", "month"];
if (month) { if (month) {
let monthNum = month.split("-"); [this.searchForm.year, this.searchForm.month] = month.split("-");
this.searchForm.year = monthNum[0];
this.searchForm.month = monthNum[1];
} }
} else { } else {
this.searchForm.groupList = ["year", "month", "day"]; this.searchForm.groupList = ["year", "month", "day"];
if (day) { if (day) {
let dayNum = day.split("-"); [this.searchForm.year, this.searchForm.month, this.searchForm.day] =
this.searchForm.year = dayNum[0]; day.split("-");
this.searchForm.month = dayNum[1];
this.searchForm.day = dayNum[2];
}
} }
if (pjOption) {
this.searchForm.pjOptionList = [pjOption];
} else {
this.searchForm.pjOptionList = [];
}
if (deptName) {
this.searchForm.sectionNameList = [deptName];
} else {
this.searchForm.sectionNameList = [];
}
if (windowName) {
this.searchForm.windowFromnumList = [windowName];
} else {
this.searchForm.windowFromnumList = [];
} }
this.searchForm.pjOptionList = pjOption ? [pjOption] : [];
this.searchForm.sectionNameList = deptName ? [deptName] : [];
this.searchForm.windowFromnumList = windowNum ? [windowNum] : [];
this.current = 1; this.current = 1;
this.getEvaStatList(); this.getEvaStatList();
}, },
// 导出表格 // 导出表格
exportExcel() { exportExcel() {
this.exportLoading = true; this.exportLoading = true;
......
...@@ -187,41 +187,29 @@ export default { ...@@ -187,41 +187,29 @@ export default {
this.selectionRows = rows; this.selectionRows = rows;
}, },
handleSearch(form) { handleSearch(form) {
let { type, businessName, deptName, windowName, year, month, day } = form; let { type, businessName, deptName, windowNum, year, month, day } = form;
this.searchForm.year = "";
this.searchForm.month = "";
this.searchForm.day = "";
if (type == "year") { if (type == "year") {
this.searchForm.groupList = ["year"]; this.searchForm.groupList = ["year"];
this.searchForm.year = year; this.searchForm.year = year;
} else if (type == "month") { } else if (type == "month") {
this.searchForm.groupList = ["year", "month"]; this.searchForm.groupList = ["year", "month"];
if (month) { if (month) {
let monthNum = month.split("-"); [this.searchForm.year, this.searchForm.month] = month.split("-");
this.searchForm.year = monthNum[0];
this.searchForm.month = monthNum[1];
} }
} else { } else {
this.searchForm.groupList = ["year", "month", "day"]; this.searchForm.groupList = ["year", "month", "day"];
if (day) { if (day) {
let dayNum = day.split("-"); [this.searchForm.year, this.searchForm.month, this.searchForm.day] =
this.searchForm.year = dayNum[0]; day.split("-");
this.searchForm.month = dayNum[1];
this.searchForm.day = dayNum[2];
} }
} }
if (businessName) { this.searchForm.businessList = businessName ? [businessName] : [];
this.searchForm.businessList = [businessName]; this.searchForm.sectionNameList = deptName ? [deptName] : [];
} else { this.searchForm.windowFromnumList = windowNum ? [windowNum] : [];
this.searchForm.businessList = [];
}
if (deptName) {
this.searchForm.sectionNameList = [deptName];
} else {
this.searchForm.sectionNameList = [];
}
if (windowName) {
this.searchForm.windowFromnumList = [windowName];
} else {
this.searchForm.windowFromnumList = [];
}
this.current = 1; this.current = 1;
this.getQueueStatList(); this.getQueueStatList();
}, },
......
...@@ -101,10 +101,10 @@ ...@@ -101,10 +101,10 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="windowName"> <el-form-item prop="windowNum">
<el-select <el-select
style="width: 150px" style="width: 150px"
v-model="form.windowName" v-model="form.windowNum"
placeholder="请选择窗口" placeholder="请选择窗口"
clearable clearable
filterable filterable
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
type: "year", type: "year",
businessName: "", businessName: "",
deptName: "", deptName: "",
windowName: "", windowNum: "",
year: "", year: "",
month: "", month: "",
day: "", day: "",
......
...@@ -75,7 +75,10 @@ ...@@ -75,7 +75,10 @@
></el-input> ></el-input>
</el-popover> </el-popover>
</div> </div>
<div class="item border"> <div
class="item border"
v-if="$route.path == '/enginesearch/queueupdata'"
>
<span class="pl-[15px] text-[14px]">选择业务</span> <span class="pl-[15px] text-[14px]">选择业务</span>
<el-popover <el-popover
trigger="click" trigger="click"
...@@ -100,7 +103,7 @@ ...@@ -100,7 +103,7 @@
</div> </div>
<el-input <el-input
size="small" size="small"
placeholder="暂未选择" placeholder="请输入"
slot="reference" slot="reference"
v-model="form.businessName" v-model="form.businessName"
clearable clearable
...@@ -108,6 +111,23 @@ ...@@ -108,6 +111,23 @@
></el-input> ></el-input>
</el-popover> </el-popover>
</div> </div>
<div class="item border" v-else>
<span class="pl-[15px] text-[14px]">选择评价选项</span>
<el-select
v-model="form.pjOption"
placeholder="请选择评价选项"
clearable
filterable
size="small"
>
<el-option
v-for="(v, i) in pjOption"
:key="i"
:label="v"
:value="v"
></el-option>
</el-select>
</div>
<div class="item border"> <div class="item border">
<span class="pl-[15px] text-[14px]">选择部门</span> <span class="pl-[15px] text-[14px]">选择部门</span>
<el-popover <el-popover
...@@ -115,10 +135,29 @@ ...@@ -115,10 +135,29 @@
placement="bottom-start" placement="bottom-start"
popper-class="search-popover" popper-class="search-popover"
> >
<div class="w-full">
<div class="mb-3">推荐部门</div>
<div class="flex w-full flex-col gap-3">
<div
class="flex cursor-pointer"
v-for="(v, i) in calcDept"
:key="v.id"
@click="form.deptName = v.name"
>
<div :class="['mr-4', ' w-[20px]', `index-${i + 1}`]">
{{ i + 1 }}
</div>
<div class="flex-1 truncate">{{ v.name }}</div>
</div>
</div>
</div>
<el-input <el-input
size="small" size="small"
placeholder="暂未选择" placeholder="请输入"
slot="reference" slot="reference"
v-model="form.deptName"
clearable
@input="handleDeptNameInput"
></el-input> ></el-input>
</el-popover> </el-popover>
</div> </div>
...@@ -129,15 +168,36 @@ ...@@ -129,15 +168,36 @@
placement="bottom-start" placement="bottom-start"
popper-class="search-popover" popper-class="search-popover"
> >
<div class="w-full">
<div class="mb-3">推荐窗口</div>
<div class="flex w-full flex-col gap-3">
<div
class="flex cursor-pointer"
v-for="(v, i) in calcWindow"
:key="v.id"
@click="form.windowNum = v.fromnum"
>
<div :class="['mr-4', ' w-[20px]', `index-${i + 1}`]">
{{ i + 1 }}
</div>
<div class="flex-1 truncate">
{{ v.fromnum }}-{{ v.name }}
</div>
</div>
</div>
</div>
<el-input <el-input
size="small" size="small"
placeholder="暂未选择" placeholder="请输入"
slot="reference" slot="reference"
v-model="form.windowNum"
clearable
@input="handleWindowInput"
></el-input> ></el-input>
</el-popover> </el-popover>
</div> </div>
</div> </div>
<div class="btn">检索</div> <div class="btn" @click="handleSearch">检索</div>
</div> </div>
<div class="back-btn" @click="$router.push('/engine')">返回</div> <div class="back-btn" @click="$router.push('/engine')">返回</div>
</div> </div>
...@@ -147,17 +207,21 @@ ...@@ -147,17 +207,21 @@
<script> <script>
import { findBottomSubarrays } from "@/utils"; import { findBottomSubarrays } from "@/utils";
import { mapState } from "vuex"; import { mapState } from "vuex";
let pjOption = ["非常满意", "满意", "基本满意", "不满意", "非常不满意"];
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
pjOption,
calcBusiness: [], calcBusiness: [],
calcDept: [],
calcWindow: [],
subMenus: [], subMenus: [],
form: { form: {
type: "year", type: "year",
businessName: "", businessName: "",
deptName: "", deptName: "",
windowName: "", windowNum: "",
year: "", year: "",
month: "", month: "",
day: "", day: "",
...@@ -184,12 +248,30 @@ export default { ...@@ -184,12 +248,30 @@ export default {
return this.calcBusiness; return this.calcBusiness;
}, },
set(val) { set(val) {
return (this.calcBusiness = val); this.calcBusiness = val;
},
},
calcDeptList: {
get() {
return this.calcDept;
},
set(val) {
this.calcDept = val;
},
},
calcWindowList: {
get() {
return this.calcWindow;
},
set(val) {
this.calcWindow = val;
}, },
}, },
}, },
created() { created() {
this.calcBusiness = this.businessList.slice(0, 10); this.calcBusiness = this.businessList.slice(0, 10);
this.calcDept = this.deptList.slice(0, 10);
this.calcWindow = this.windowList.slice(0, 10);
this.getSubMenus(); this.getSubMenus();
}, },
mounted() {}, mounted() {},
...@@ -209,18 +291,19 @@ export default { ...@@ -209,18 +291,19 @@ export default {
); );
}, },
changeTab(key) { changeTab(key) {
this.form.year = "";
this.form.month = "";
this.form.day = "";
this.form.type = key; this.form.type = key;
}, },
handlePick(val) {
console.log(val);
},
handleClearDate() { handleClearDate() {
this.form.year = ""; this.form.year = "";
this.form.month = ""; this.form.month = "";
this.form.day = ""; this.form.day = "";
}, },
handleBusinessNameInput(name) { handleBusinessNameInput(name) {
if (name !== "") { if (name != "") {
let list = this.businessList.filter((v) => let list = this.businessList.filter((v) =>
v.businessName.includes(name) v.businessName.includes(name)
); );
...@@ -229,6 +312,27 @@ export default { ...@@ -229,6 +312,27 @@ export default {
this.calcBusinessList = this.businessList.slice(0, 10); this.calcBusinessList = this.businessList.slice(0, 10);
} }
}, },
handleDeptNameInput(name) {
if (name != "") {
let list = this.deptList.filter((v) => v.name.includes(name));
this.calcDeptList = list.slice(0, 10);
} else {
this.calcDeptList = this.deptList.slice(0, 10);
}
},
handleWindowInput(value) {
if (value != "") {
let list = this.windowList.filter(
(v) => v.name.includes(value) || v.fromnum.includes(value)
);
this.calcWindowList = list.slice(0, 10);
} else {
this.calcWindowList = this.windowList.slice(0, 10);
}
},
handleSearch() {
this.$emit("search", this.form);
},
}, },
}; };
</script> </script>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
v-for="(v, key) in searchType" v-for="(v, key) in searchType"
:key="key" :key="key"
:label="v" :label="v"
:value="Number(key)" :value="key"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -182,9 +182,9 @@ import { dataSection } from "@/utils"; ...@@ -182,9 +182,9 @@ import { dataSection } from "@/utils";
import { export2Excel } from "@/utils/exportExcel"; import { export2Excel } from "@/utils/exportExcel";
import storage from "@/utils/storage"; import storage from "@/utils/storage";
let searchType = { let searchType = {
1: "按窗口编号", windowFromnum: "按窗口编号",
2: "按群众姓名", peopleName: "按群众姓名",
3: "按群众手机号", peoplePhone: "按群众手机号",
}; };
export default { export default {
components: { components: {
...@@ -200,7 +200,7 @@ export default { ...@@ -200,7 +200,7 @@ export default {
current: 1, current: 1,
total: 0, total: 0,
searchForm: { searchForm: {
type: 1, type: "windowFromnum",
keyword: "", keyword: "",
time: [ time: [
this.$moment().format("YYYY-MM-DD"), this.$moment().format("YYYY-MM-DD"),
...@@ -411,17 +411,8 @@ export default { ...@@ -411,17 +411,8 @@ export default {
siteId: this.searchForm.siteId, siteId: this.searchForm.siteId,
}; };
let val = `%${this.searchForm.keyword}%`; let val = `%${this.searchForm.keyword}%`;
switch (this.searchForm.type) { obj[this.searchForm.type] = val;
case 1:
obj.windowFromnum = val;
break;
case 2:
obj.peopleName = val;
break;
case 3:
obj.peoplePhone = val;
break;
}
let res = await getEvaluateList({ let res = await getEvaluateList({
...obj, ...obj,
...this.searchForm2, ...this.searchForm2,
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
v-for="(v, key) in searchType" v-for="(v, key) in searchType"
:key="key" :key="key"
:label="v" :label="v"
:value="Number(key)" :value="key"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -148,10 +148,10 @@ ...@@ -148,10 +148,10 @@
<script> <script>
import QueueUpDetails from "./components/QueueUpDetails.vue"; import QueueUpDetails from "./components/QueueUpDetails.vue";
let searchType = { let searchType = {
1: "按业务", business: "按业务",
2: "按窗口编号", windowFromnum: "按窗口编号",
3: "按群众姓名", peopleName: "按群众姓名",
4: "按群众手机号", peoplePhone: "按群众手机号",
}; };
import { getQueueList } from "@/api/market"; import { getQueueList } from "@/api/market";
import { getDepartment, getHall } from "@/api/site"; import { getDepartment, getHall } from "@/api/site";
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
current: 1, current: 1,
selectionRow: [], selectionRow: [],
searchForm: { searchForm: {
type: 1, type: "business",
keyword: "", keyword: "",
time: [ time: [
this.$moment().format("YYYY-MM-DD"), this.$moment().format("YYYY-MM-DD"),
...@@ -394,20 +394,7 @@ export default { ...@@ -394,20 +394,7 @@ export default {
siteId: this.searchForm.siteId, siteId: this.searchForm.siteId,
}; };
let val = `%${this.searchForm.keyword}%`; let val = `%${this.searchForm.keyword}%`;
switch (this.searchForm.type) { obj[this.searchForm.type] = val;
case 1:
obj.business = val;
break;
case 2:
obj.windowFromnum = val;
break;
case 3:
obj.peopleName = val;
break;
case 4:
obj.peoplePhone = val;
break;
}
let res = await getQueueList({ ...obj, ...this.searchForm2, ...form }); let res = await getQueueList({ ...obj, ...this.searchForm2, ...form });
if (res.data.code == 1) { if (res.data.code == 1) {
return res.data.data; return res.data.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment