zhanbo.xu

feat: 优化从总跳分的搜索

...@@ -308,6 +308,8 @@ ...@@ -308,6 +308,8 @@
308 <div v-loading="loadings.sreachLoading"> 308 <div v-loading="loadings.sreachLoading">
309 <vxe-table 309 <vxe-table
310 :max-height="tableMaxheight" 310 :max-height="tableMaxheight"
311 + :height="300"
312 + ref="tableRef"
311 :data="tableData" 313 :data="tableData"
312 :column-config="{ resizable: true }" 314 :column-config="{ resizable: true }"
313 :row-config="{ isCurrent: true, isHover: true }" 315 :row-config="{ isCurrent: true, isHover: true }"
...@@ -821,18 +823,18 @@ export default { ...@@ -821,18 +823,18 @@ export default {
821 }, 823 },
822 }; 824 };
823 }, 825 },
826 + beforeCreate() {},
824 created() { 827 created() {
825 try { 828 try {
826 if (this.$route.query.billNo && this.$route.query.search == "true") { 829 if (this.$route.query.billNo && this.$route.query.search == "true") {
827 this.sreachFormData.billNo = this.$route.query.billNo; 830 this.sreachFormData.billNo = this.$route.query.billNo;
828 console.log( 831 console.log(
829 this.$route.query, 832 this.$route.query,
830 - JSON.parse(this.$route.query.receiptStatus) 833 + JSON.parse(this.$route.query.receiptStatus || "[]")
831 - );
832 - this.activeType = true;
833 - this.sreachFormData.receiptStatus = JSON.parse(
834 - this.$route.query.receiptStatus
835 ); 834 );
835 + const choose = JSON.parse(this.$route.query.receiptStatus || "[]");
836 + this.listStatus = choose;
837 + this.changeFilters(choose);
836 } 838 }
837 } catch (error) { 839 } catch (error) {
838 console.log(error); 840 console.log(error);
...@@ -861,6 +863,23 @@ export default { ...@@ -861,6 +863,23 @@ export default {
861 }); 863 });
862 }, 864 },
863 methods: { 865 methods: {
866 + // 筛选条件改变
867 + changeFilters(choose) {
868 + this.$nextTick(() => {
869 + const $table = this.$refs.tableRef;
870 + if ($table) {
871 + const newArr = listStatus().map((item) => {
872 + return {
873 + ...item,
874 + checked: (choose || []).includes(item.value),
875 + };
876 + });
877 + $table.setFilter("listReceiptStatus", [...newArr], true);
878 + this.listStatusFilters = [...newArr];
879 + }
880 + });
881 + },
882 +
864 filterChangeEvent(value) { 883 filterChangeEvent(value) {
865 console.log(value.values); 884 console.log(value.values);
866 if (value.field === "orderReceiptStatus") { 885 if (value.field === "orderReceiptStatus") {
......