快乐的昕的电脑
2025-10-31 b155c16513a840ae6ed788a68a483ef37ec5f964
混合
已修改1个文件
30 ■■■■ 文件已修改
components/machine.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/machine.vue
@@ -157,6 +157,7 @@
            },
            // 保存并生效,将时间等信息提交到后端
            // 变更:返回 Promise;成功后局部刷新(调用 findByOrderId)而不是整页 reload
            // 保存并生效,将时间等信息提交到后端
            save() {
                if (!this.statusForm.id) {
                    this.$showMessage("id为空,不允许推送");
@@ -177,13 +178,28 @@
                    if (res && res.data && res.data.tbBillList) {
                        this.$showMessage("呼叫成功");
                         //或者方法3:使用 uni.navigateBack 再跳转回来(如果是从其他页面跳转过来的)
                         uni.navigateBack({
                             delta: 1,
                             success: () => {
                                 // 可以在这里重新跳转到当前页面
                             }
                         });
                        // 方案1:使用uni-app的页面刷新方法
                        // 方法1:触发下拉刷新(如果页面支持)
                        if (uni.startPullDownRefresh) {
                            uni.startPullDownRefresh();
                            // 2秒后停止刷新
                            setTimeout(() => {
                                uni.stopPullDownRefresh();
                            }, 2000);
                        }
                        // 方法2:重新调用页面的onLoad方法(推荐)
                        const pages = getCurrentPages();
                        const currentPage = pages[pages.length - 1];
                        if (currentPage && currentPage.onLoad) {
                            // 保存当前页面参数
                            const pageOptions = currentPage.options || {};
                            // 重新加载页面数据
                            currentPage.onLoad(pageOptions);
                        }
                        // 方法3:同时刷新组件数据
                        this.findByOrderId();
                    } else {
                        this.$showMessage("呼叫失败");