快乐的昕的电脑
2025-12-03 61d625abbb73d22f4868aebb16c833ebae523614
查询当前数采数,作为下刀计数实时显示
已修改1个文件
21 ■■■■■ 文件已修改
components/mold.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/mold.vue
@@ -181,6 +181,27 @@
            toolModel() { this.isDirty = true; }
        },
        methods: {
    //查询当前数采数,作为下刀计数实时显示
            async fetchCurrentCjNum(toolNo) {
                if (!this.machineNo) return null;
                try {
                    const res = await this.$post({
                        url: '/Womdaa/GetWomdaasByShow',
                        data: JSON.stringify({ machineNo: this.machineNo }),
                        headers: { 'Content-Type': 'application/json' }
                    });
                    if (res.status === 0 && Array.isArray(res.data?.tbBillList)) {
                        const found = res.data.tbBillList.find(x =>
                            x.cutterId === toolNo || x.cutteR_ID === toolNo
                        );
                        return found ? (found.CurrentCjNum ?? found.currentCjNum ?? null) : null;
                    }
                } catch (e) {
                    console.warn('获取currentCjNum失败', e);
                }
                return null;
            },
            // 新增:刷新按钮处理方法
            async handleRefresh() {
                // 刷新刀具列表和表单数据