| | |
| | | |
| | | </select> |
| | | </view> |
| | | <view class="info-block" style="margin-top: 10px;"> |
| | | <view class="info-block" style="margin-top: 10px;"> |
| | | <view class="info-label">备注:</view> |
| | | <input type="text" id="lotNo1" v-model="formData.lotNo1" |
| | | placeholder="请输入备注信息" |
| | | style="color: red; font-weight: bold;"/> |
| | | </view> |
| | | <view class="info-block" style="margin-top: 10px;"> |
| | | <view class="info-label">破坏实验数量:</view> |
| | | <view class="info-value highlight">{{formData.phsy}}</view> |
| | | </view> |
| | | |
| | | |
| | |
| | | |
| | | <!-- 操作按钮区 --> |
| | | <view class="action-buttons"> |
| | | <button class="secondary-btn" @click="addDestruction" v-if="this.current">破坏实验</button> |
| | | <button class="secondary-btn" @click="uploadImages">上传/查看图片</button> |
| | | <button class="secondary-btn" @click="fetchDrawingNumber">调取PLM图纸</button> |
| | | <button class="secondary-btn" @click="addDefectDescription" v-if="this.current">添加不良描述</button> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="destructionPopup" class="overlay"> |
| | | <view class="popup"> |
| | | <h3>破坏实验数量</h3> |
| | | <form> |
| | | <view class="form-group"> |
| | | <label class="form-label">破坏实验数量:</label> |
| | | <input class="form-input" type="text" v-model="PHSY" placeholder="留空表示清除数量" /> |
| | | </view> |
| | | </form> |
| | | <div v-if="!isInteger" class="error-message">请输入整数值或留空</div> |
| | | <button class="updateBut" @click="editDestruction">修改</button> |
| | | <button @click="clearDestruction">清除</button> |
| | | <button @click="destructionPopup = !destructionPopup">取消</button> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="barcode"> |
| | | <u-modal :show="drawingShow" title="图纸明细" @confirm="drawingConfirm" @cancel="drawingCancel" |
| | |
| | | permissionAccount: '', |
| | | hasEmergencyPermission: false, |
| | | showPopup: false, |
| | | PHSY:'', |
| | | |
| | | }, |
| | | tableData: [], |
| | |
| | | fileName:'', |
| | | originalRemarks: '', |
| | | hasEmergencyPermission: false, |
| | | destructionPopup: false, |
| | | PHSY: '', |
| | | isInteger: true, |
| | | |
| | | } |
| | | }, |
| | |
| | | data: { |
| | | itemNo: this.formData.itemId, |
| | | quantity: this.formData.fcovertQty, |
| | | releaseNo: this.formData.releaseNo |
| | | releaseNo: this.formData.releaseNo, |
| | | PHSY: this.formData.PHSY |
| | | } |
| | | }).then(res => { |
| | | if (res.status == 0) { |
| | |
| | | ...data, |
| | | emergencyStatus: data.emergency |
| | | }; |
| | | |
| | | // 确保PHSY字段被正确设置 |
| | | this.formData.PHSY = data.PHSY; |
| | | |
| | | this.$post({ |
| | | url: "/LLJ/getJYItem", |
| | |
| | | }); |
| | | }, |
| | | editRemarks() { |
| | | if (this.remarks) { |
| | | //saveRemarksGid |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | remarks: this.remarks, |
| | | releaseNo: this.formData.releaseNo, |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.remarks = this.remarks; |
| | | this.remarksPopup = !this.remarksPopup; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | let pages = getCurrentPages(); |
| | | let beforePage = pages[pages.length - 2]; |
| | | uni.navigateBack({ |
| | | delta: 1, //返回的页面数,如果为1表示返回上一页 |
| | | success: (event) => { |
| | | beforePage.$vm.reload() |
| | | } |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | } else { |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | remarks: '', |
| | | releaseNo: this.formData.releaseNo, |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.remarks = this.remarks; |
| | | this.remarksPopup = !this.remarksPopup; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | let pages = getCurrentPages(); |
| | | let beforePage = pages[pages.length - 2]; |
| | | uni.navigateBack({ |
| | | delta: 1, //返回的页面数,如果为1表示返回上一页 |
| | | success: (event) => { |
| | | beforePage.$vm.reload() |
| | | } |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | } |
| | | // 保存不良描述 |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | remarks: this.remarks || '', |
| | | releaseNo: this.formData.releaseNo |
| | | // 不再包含PHSY字段 |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.remarks = this.remarks; |
| | | this.remarksPopup = !this.remarksPopup; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | this.init(); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | drawingConfirm() { |
| | |
| | | }); |
| | | }, |
| | | editRemarks() { |
| | | if (this.remarks) { |
| | | // 只保存修改的部分 |
| | | const modifiedRemarks = this.remarks !== this.originalRemarks ? this.remarks : ''; |
| | | |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | remarks: modifiedRemarks, |
| | | releaseNo: this.formData.releaseNo, |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.remarks = this.remarks; |
| | | this.originalRemarks = this.remarks; // 更新原始备注值 |
| | | this.remarksPopup = !this.remarksPopup; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | let pages = getCurrentPages(); |
| | | let beforePage = pages[pages.length - 2]; |
| | | uni.navigateBack({ |
| | | delta: 1, //返回的页面数,如果为1表示返回上一页 |
| | | success: (event) => { |
| | | beforePage.$vm.reload() |
| | | } |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | } else { |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | remarks: '', |
| | | releaseNo: this.formData.releaseNo, |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.remarks = this.remarks; |
| | | this.originalRemarks = this.remarks; // 更新原始备注值 |
| | | this.remarksPopup = !this.remarksPopup; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | let pages = getCurrentPages(); |
| | | let beforePage = pages[pages.length - 2]; |
| | | uni.navigateBack({ |
| | | delta: 1, //返回的页面数,如果为1表示返回上一页 |
| | | success: (event) => { |
| | | beforePage.$vm.reload() |
| | | } |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 保存不良描述 |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | remarks: this.remarks || '', |
| | | releaseNo: this.formData.releaseNo |
| | | // 不再包含PHSY字段 |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.remarks = this.remarks; |
| | | this.remarksPopup = !this.remarksPopup; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | this.init(); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | }, |
| | | addDestruction() { |
| | | // 添加破坏实验的逻辑 |
| | | this.destructionPopup = !this.destructionPopup; |
| | | this.PHSY = this.formData.PHSY || ''; |
| | | this.isInteger = true; |
| | | }, |
| | | editDestruction() { |
| | | // 验证输入是否为整数 |
| | | if(this.PHSY === '') { |
| | | this.isInteger = true; |
| | | // 如果为空,传递空字符串,后端会处理为null |
| | | } else { |
| | | const isInteger = /^-?\d+$/.test(this.PHSY); |
| | | this.isInteger = isInteger; |
| | | if (!isInteger) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 保存破坏实验数量 |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | releaseNo: this.formData.releaseNo, |
| | | PHSY: this.PHSY // 可以是空字符串或有效整数 |
| | | // 不再包含remarks字段 |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | // 如果输入为空,设置为null以便不显示 |
| | | this.formData.PHSY = this.PHSY === '' ? null : this.PHSY; |
| | | this.destructionPopup = false; |
| | | this.$showMessage("保存成功"); |
| | | setTimeout(() => { |
| | | // 跳转到列表页面 |
| | | uni.navigateTo({ |
| | | url: 'List' |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | }, |
| | | clearDestruction() { |
| | | // 清除破坏实验数量 |
| | | this.PHSY = ''; |
| | | this.$post({ |
| | | url: "/LLJ/saveRemarksGid", |
| | | data: { |
| | | gid: this.formData.id, |
| | | releaseNo: this.formData.releaseNo, |
| | | PHSY: '' // 空字符串,后端会处理为null |
| | | } |
| | | }).then(res => { |
| | | if (res.data.tbBillList > 0) { |
| | | this.formData.PHSY = null; // 确保前端也为null,不显示 |
| | | this.destructionPopup = false; |
| | | this.$showMessage("清除成功"); |
| | | setTimeout(() => { |
| | | // 跳转到列表页面 |
| | | uni.navigateTo({ |
| | | url: 'List' |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | .error-message { |
| | | color: #e74c3c; |
| | | font-size: 14px; |
| | | margin-top: 5px; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |