| | |
| | | <input v-model="customAmount" class="inp bad-input" placeholder="请输入数量" /> |
| | | </view> |
| | | |
| | | <!-- 确认提交按钮 --> |
| | | <!-- 确认提交和调机报工按钮 --> |
| | | <view class="submit-section"> |
| | | <button class="details-btn" @click="confirmCustomAmount">确认提交</button> |
| | | <button class="details-btn" @click="confirmTiaojiBaogong">调机报工</button> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | this.customAmount = ''; |
| | | }).catch(() => this.$showMessage('报废数量填写失败,请重试')); |
| | | }, |
| | | // 新增:调机报工 |
| | | confirmTiaojiBaogong() { |
| | | if (!this.customAmount || isNaN(Number(this.customAmount))) { this.$showMessage('请输入有效的数量'); return; } |
| | | if (!this.staffNo) { this.$showMessage('请选择报工人'); return; } |
| | | const staffNo = this.staffNo.split(':')[0]; |
| | | const amount = Number(this.customAmount); |
| | | this.$post({ |
| | | url: "/MesInvItemBarcodes/AddBFToBarcodes", // 如有调机专用接口请替换 |
| | | data: { |
| | | orderNo: this.orderNo, |
| | | orderId: this.orderId, |
| | | bf: amount, |
| | | staffNo: staffNo, |
| | | initCjNum: this.order.initCjNum, |
| | | currentCjNum: this.order.currentCjNum, |
| | | type: 'tiaoji' // 可加区分字段,后端如需区分调机报工 |
| | | } |
| | | }).then(res => { |
| | | if (res.status == 1) { this.$showMessage(res.message); return; } |
| | | this.$showMessage('调机报工成功'); |
| | | this.fetchData(true); |
| | | this.customAmount = ''; |
| | | }).catch(() => this.$showMessage('调机报工失败,请重试')); |
| | | }, |
| | | save() { |
| | | if (!this.staffNo) { this.$showMessage('请选择报工人'); return; } |
| | | uni.showToast({ title: '保存成功', icon: 'success' }); |