| | |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="!isUpdate && !formData.fcheckResu && !isShowTable" @click="submitRKJResult">提交检验</button> |
| | | </view> |
| | | |
| | | <view class="plus-button"> |
| | | <button type="warn" v-if="isShowTable" @click="getTable">获取检验项目</button> |
| | | </view> |
| | | |
| | |
| | | this.isUpdate = false; |
| | | this.init(); |
| | | }) |
| | | }, |
| | | submitRKJResult() { |
| | | if (!this.formData.id) { |
| | | this.$showMessage("请先选择检验单号"); |
| | | return; |
| | | } |
| | | |
| | | // 检查是否所有检验项目都已完成 |
| | | let hasUnfinished = false; |
| | | for (let item of this.tableData) { |
| | | if (item.result === '未完成') { |
| | | hasUnfinished = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (hasUnfinished) { |
| | | this.$showMessage("还有检验项目未完成,无法提交"); |
| | | return; |
| | | } |
| | | |
| | | uni.showModal({ |
| | | title: '确认提交', |
| | | content: '确定要提交检验结果吗?提交后将无法修改。', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.$post({ |
| | | url: "/RKJ/submitRKJResult", |
| | | data: { |
| | | gid: this.formData.id, |
| | | userNo: this.$loginInfo.account |
| | | } |
| | | }).then(res => { |
| | | if (res.status === 0) { |
| | | this.$showMessage("提交成功"); |
| | | this.init(); // 重新加载数据 |
| | | } else { |
| | | this.$showMessage(res.message || "提交失败"); |
| | | } |
| | | }).catch(err => { |
| | | this.$showMessage("提交失败:" + err.message); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | onShow() { |