| | |
| | | <view class="info-label">工单数量:</view> |
| | | <view class="info-value highlight">{{ formData.daa008 }}</view> |
| | | </view> |
| | | <view v-if="formData.remarks && current" class="info-block"> |
| | | <view v-if="formData.remarks" class="info-block"> |
| | | <view class="info-label">备注:</view> |
| | | <view class="info-value">{{ formData.remarks }}</view> |
| | | </view> |
| | |
| | | comments: "", |
| | | commentsPopup: false, |
| | | current: true, |
| | | |
| | | getTableTimer: null, // 防抖定时器 |
| | | |
| | | }; |
| | | }, |
| | |
| | | if (res.statusCode === 200 || res.status === 0 || res.data === true || res.data.tbBillList === true) { |
| | | |
| | | this.$showMessage("成功提交检验"); |
| | | |
| | | // 清除本地存储的一致性核对状态 |
| | | const storageKey = `yzxChecked_${this.formData.id}`; |
| | | uni.removeStorageSync(storageKey); |
| | | |
| | | // 提交成功后刷新页面数据 |
| | | this.init(); |
| | | // 1.5秒后跳转到列表页面 |
| | |
| | | |
| | | init() { |
| | | if (this.formData.id) { |
| | | // 从本地存储读取一致性核对状态 |
| | | const storageKey = `yzxChecked_${this.formData.id}`; |
| | | const storedYzxChecked = uni.getStorageSync(storageKey); |
| | | |
| | | this.$post({ |
| | | url: "/SJ/GetPage", |
| | | data: { |
| | |
| | | }).then(res => { |
| | | let tbBillListElement = res.data.tbBillList[0]; |
| | | if (tbBillListElement) { |
| | | // 保存当前的yzxChecked状态 |
| | | const currentYzxChecked = this.formData.yzxChecked; |
| | | this.formData = tbBillListElement; |
| | | // 恢复yzxChecked状态,避免被服务器数据覆盖 |
| | | this.formData.yzxChecked = currentYzxChecked; |
| | | // 恢复本地存储的一致性核对状态 |
| | | if (storedYzxChecked) { |
| | | this.formData.yzxChecked = true; |
| | | } |
| | | this.$post({ |
| | | url: "/SJ/getQSItems", |
| | | data: { |
| | |
| | | duration: 2000, |
| | | }); |
| | | } else { |
| | | const currentStatus = this.current ? 'A' : 'B'; // 添加current参数 |
| | | uni.navigateTo({ |
| | | url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData |
| | | .id + '&index=' + index |
| | | .id + '&index=' + index + '¤t=' + currentStatus |
| | | }); |
| | | } |
| | | }, |
| | | getTable() { |
| | | // 清除上一次的定时器 |
| | | if (this.getTableTimer) { |
| | | clearTimeout(this.getTableTimer); |
| | | } |
| | | |
| | | // 设置1秒防抖 |
| | | this.getTableTimer = setTimeout(() => { |
| | | this.executeGetTable(); |
| | | }, 1000); |
| | | }, |
| | | |
| | | executeGetTable() { |
| | | this.$post({ |
| | | url: "/SJ/SetQSItems", |
| | | data: { |
| | |
| | | this.comments = this.formData.comments; |
| | | }, |
| | | editRemarks() { |
| | | if (this.remarks) { |
| | | // 允许保存空字符串或空格,只检查是否为null或undefined |
| | | if (this.remarks !== null && this.remarks !== undefined) { |
| | | //saveRemarksGid |
| | | this.$post({ |
| | | url: "/SJ/saveRemarksGid", |
| | |
| | | }, |
| | | onShow() { |
| | | // 每次进入页面都会执行的方法 |
| | | // 注释掉init()调用,避免覆盖一致性核对状态 |
| | | // this.init(); |
| | | this.init(); |
| | | } |
| | | }; |
| | | </script> |