快乐的昕的电脑
2025-11-21 5949b176eff7fa739ec2f341860c2f1a4803c176
新增:调机报工
已修改1个文件
27 ■■■■■ 文件已修改
components/WorkOrderPrint.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/WorkOrderPrint.vue
@@ -131,9 +131,10 @@
                    <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>
@@ -431,6 +432,30 @@
                    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' });