快乐的昕的电脑
2025-11-18 cdef1c2c7f4703776ff598e34d897d6dce449735
Revert "调试"

This reverts commit 0913e7c07da316a3054488273edb9ec81db8a41a.
已修改1个文件
63 ■■■■ 文件已修改
pages/index.vue 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index.vue
@@ -553,26 +553,25 @@
                return str;
            },
            // 判断单条记录是否绑定刀具
            isCutterBound(row) {
                if (!row) return false;
                const idBound = typeof row.outToolId === 'number' ? row.outToolId > 0 : (
                    row.outToolId && row.outToolId.toString().trim() !== ''
                );
                const codeBound = !!(row.outToolCode && row.outToolCode.toString().trim() !== '');
                const nameBound = !!(row.outToolName && row.outToolName.toString().trim() !== '');
                return idBound || codeBound || nameBound;
            },
            // 旧的钩子替换为调用 isCutterBound(只看第一条或根据需要遍历)
                // 刀具绑定判断钩子
            hasBindedCutter() {
                // 当前只允许一条正在操作的工单,取第一条
                return this.isCutterBound(this.isShowTableData[0]);
                    const currentOrder = this.isShowTableData[0];
                    return (
                        currentOrder &&
                        (
                            (currentOrder.outToolId && currentOrder.outToolId.toString().trim() !== '') ||
                            (currentOrder.outToolCode && currentOrder.outToolCode.trim() !== '') ||
                            (currentOrder.outToolName && currentOrder.outToolName.trim() !== '')
                        )
                    );
            },
            cancel() {
                if (!this.machineNo) return;
                // 后端数据判断
                    if (!this.machineNo) {
                        return;
                    }
                    // 使用钩子判断
                if (this.hasBindedCutter()) {
                    uni.showToast({
                        title: '当前工单已绑定刀具,不能清空重选',
@@ -581,11 +580,16 @@
                    });
                    return;
                }
                const editDate = this.formatDate(new Date());
                    let editDate = this.formatDate(new Date());
                this.selectedIndexs = [];
                this.$post({
                    url: "/MesOrderSelect/Remove",
                    data: { machineNo: this.machineNo, editDate }
                        data: {
                            machineNo: this.machineNo,
                            editDate: editDate
                        },
                }).then(res => {
                    if (res.data.tbBillList > 0) {
                        this.isShowTableData = [];
@@ -651,25 +655,16 @@
            getWomdaaIsShow() {
                this.$post({
                    url: "/Womdaa/GetWomdaasByShow",
                    data: { machineNo: this.machineNo }
                }).then(res => {
                    const list = res.data.tbBillList || [];
                    // 统一映射并输出调试日志
                    this.isShowTableData = list.map(r => {
                        return {
                            ...r,
                            // 兼容大小写或下划线命名(若不存在则使用原值或空)
                            outToolId: r.outToolId ?? r.out_tool_id ?? r.outToolID ?? r.toolId ?? 0,
                            outToolCode: r.outToolCode ?? r.out_tool_code ?? r.toolCode ?? '',
                            outToolName: r.outToolName ?? r.out_tool_name ?? r.toolName ?? ''
                        };
                    });
                    if (this.isShowTableData.length > 0) {
                        console.log("GetWomdaasByShow 第一条记录:", this.isShowTableData[0]);
                    data: {
                        machineNo: this.machineNo,
                    }
                    if (this.isShowTableData.length === 1) {
                }).then(res => {
                    this.isShowTableData = res.data.tbBillList;
                    if (this.isShowTableData.length == 1) {
                        uni.setStorageSync('daa001', this.isShowTableData[0].daa001);
                        uni.setStorageSync('id', this.isShowTableData[0].id);
                        //this.toDetail(this.isShowTableData[0]);
                    }
                });
            },