zhanbo.xu

feat: 优化从总跳分的搜索

......@@ -308,6 +308,8 @@
<div v-loading="loadings.sreachLoading">
<vxe-table
:max-height="tableMaxheight"
:height="300"
ref="tableRef"
:data="tableData"
:column-config="{ resizable: true }"
:row-config="{ isCurrent: true, isHover: true }"
......@@ -821,18 +823,18 @@ export default {
},
};
},
beforeCreate() {},
created() {
try {
if (this.$route.query.billNo && this.$route.query.search == "true") {
this.sreachFormData.billNo = this.$route.query.billNo;
console.log(
this.$route.query,
JSON.parse(this.$route.query.receiptStatus)
);
this.activeType = true;
this.sreachFormData.receiptStatus = JSON.parse(
this.$route.query.receiptStatus
JSON.parse(this.$route.query.receiptStatus || "[]")
);
const choose = JSON.parse(this.$route.query.receiptStatus || "[]");
this.listStatus = choose;
this.changeFilters(choose);
}
} catch (error) {
console.log(error);
......@@ -861,6 +863,23 @@ export default {
});
},
methods: {
// 筛选条件改变
changeFilters(choose) {
this.$nextTick(() => {
const $table = this.$refs.tableRef;
if ($table) {
const newArr = listStatus().map((item) => {
return {
...item,
checked: (choose || []).includes(item.value),
};
});
$table.setFilter("listReceiptStatus", [...newArr], true);
this.listStatusFilters = [...newArr];
}
});
},
filterChangeEvent(value) {
console.log(value.values);
if (value.field === "orderReceiptStatus") {
......