| | |
| | | onLoad() { |
| | | //页面加载时调用的事件 |
| | | this.init(); |
| | | // 同时获取未提交和已提交的数量 |
| | | this.getCounts(); |
| | | }, |
| | | methods: { |
| | | // ===== 新增查询条件选择方法 ===== |
| | |
| | | this.selectedField = fieldMap[this.optionsIndex]; |
| | | }, |
| | | |
| | | // ===== 新增获取数量统计方法 ===== |
| | | getCounts() { |
| | | // 获取未提交数量 - fsubmit = 0 或空值 |
| | | this.$post({ |
| | | url: "/RKJ/getPage", |
| | | data: { |
| | | pageIndex: 1, |
| | | limit: 1, // 只需要获取总数,不需要具体数据 |
| | | createUser: this.$loginInfo.account, |
| | | fsubmit: "0" // 未提交:fsubmit = 0 或空值 |
| | | } |
| | | }).then(res => { |
| | | this.unsubmittedCount = res.data.totalCount || 0; |
| | | }).catch(() => { |
| | | this.unsubmittedCount = 0; |
| | | }); |
| | | |
| | | // 获取已提交数量 - fsubmit = 1 |
| | | this.$post({ |
| | | url: "/RKJ/getPage", |
| | | data: { |
| | | pageIndex: 1, |
| | | limit: 1, // 只需要获取总数,不需要具体数据 |
| | | createUser: this.$loginInfo.account, |
| | | fsubmit: "1" // 已提交:fsubmit = 1 |
| | | } |
| | | }).then(res => { |
| | | this.submittedCount = res.data.totalCount || 0; |
| | | }).catch(() => { |
| | | this.submittedCount = 0; |
| | | }); |
| | | }, |
| | | |
| | | //搜索框点击事件 |
| | | btnclicked() { |
| | | this.pageIndex = 1; |
| | | this.data = []; |
| | | this.init(); |
| | | // 搜索后重新获取数量统计 |
| | | this.getCounts(); |
| | | }, |
| | | |
| | | init() { |
| | | //获取搜索条件内容 |
| | | let SearchValue = this.searchValue; |
| | | |
| | | let fsubmit = null; // 默认查询所有未提交的记录(包括fsubmit = 0和fsubmit为空) |
| | | let fsubmit = "0"; // 默认查询未提交的记录(fsubmit = 0或空值) |
| | | if (this.current == 1) { |
| | | fsubmit = "1"; // 已提交 |
| | | } |
| | |
| | | } |
| | | this.totalCount = res.data.totalCount; |
| | | this.totalPage = Math.ceil(this.totalCount / this.limit); |
| | | |
| | | // 设置数量统计 - 参考XJ的实现方式 |
| | | if (this.current === 1) { |
| | | this.submittedCount = res.data.totalCount; |
| | | } else { |
| | | this.unsubmittedCount = res.data.totalCount; |
| | | } |
| | | |
| | | this.noData = this.pageIndex >= this.totalPage; |
| | | this.isLoading = false; // 结束加载 |
| | |
| | | this.data = []; |
| | | this.pageIndex = 1; |
| | | this.init(); |
| | | // 切换标签后重新获取数量统计 |
| | | this.getCounts(); |
| | | } |
| | | }, |
| | | navigateToDetail(item) { |
| | |
| | | this.data = []; |
| | | //this.current = 0 |
| | | this.init(); |
| | | // 页面显示时重新获取数量统计 |
| | | this.getCounts(); |
| | | } |
| | | }; |
| | | </script> |