| | |
| | | data() { |
| | | return { |
| | | query: { |
| | | name: '', |
| | | type: '', |
| | | huiMinName: '', |
| | | huiMinType: '', |
| | | dateRange: [], |
| | | status: '' |
| | | status: '', |
| | | huiMinStatus: '', |
| | | }, |
| | | loading: false, |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | total: 800, |
| | |
| | | methods: { |
| | | handleSearch() { |
| | | console.log('搜索条件:', this.query) |
| | | // 修复方案:使用箭头函数 + 字段校验 |
| | | this.loading = true; |
| | | const vm = this; // 保留Vue实例引用 |
| | | let ajax = new $ax(Feng.ctxPath + "/tHuiminCard/list", |
| | | (data) => { // 改用箭头函数 |
| | | console.log('原始数据:', data); |
| | | this.loading = false; |
| | | if(data.rows && Array.isArray(data.rows)){ |
| | | vm.tableData = data.rows; |
| | | vm.total = data.total; |
| | |
| | | } |
| | | }, |
| | | (data) => { |
| | | this.loading = false; |
| | | Feng.error("搜索失败: " + (data.responseJSON?.message || '服务器异常')); // 错误提示优化 |
| | | }); |
| | | |
| | | console.log('请求参数222:', this.query.dateRange) |
| | | // 添加请求参数 |
| | | ajax.set({ |
| | | pageNum: this.currentPage, |
| | | pageSize: this.pageSize, |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | startTime: this.query.dateRange !=null && this.query.dateRange.length > 0 ? this.query.dateRange[0] : null, |
| | | endTime: this.query.dateRange !=null && this.query.dateRange.length > 0 ? this.query.dateRange[1] : null, |
| | | ...this.query |
| | | }); |
| | | ajax.start(); |
| | |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.pageSize = val |
| | | this.handleSearch() |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.currentPage = val |
| | | this.handleSearch() |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | // 多选处理 |