快乐的昕的电脑
2025-11-19 cd718c2363f8a0426d5bf7365c0df146f86b055f
pages/index.vue
@@ -552,16 +552,14 @@
            }
            return str;
         },
         cancel() {
            if (!this.machineNo) {
               return;
            }
            cancel() {
                if (!this.machineNo) {
                    return;
                }
                const currentOrder = this.isShowTableData[0];
                console.log('cancel检查工单:', currentOrder);
                if (currentOrder && currentOrder.outToolName && currentOrder.outToolName.trim() !== '') {
                // 直接用 flag 判断
                if (this.hasBindedCutterFlag) {
                    uni.showToast({
                        title: '当前工单已绑定刀具,不能清空重选',
                        icon: 'error',
@@ -570,22 +568,22 @@
                    return;
                }
            let editDate = this.formatDate(new Date());
                let editDate = this.formatDate(new Date());
                this.selectedIndexs = [];
            this.selectedIndexs = [];
                this.$post({
                    url: "/MesOrderSelect/Remove",
                    data: {
                        machineNo: this.machineNo,
                        editDate: editDate
                    },
                }).then(res => {
                    if (res.data.tbBillList > 0) {
                        this.isShowTableData = [];
                    }
                });
            },
            this.$post({
               url: "/MesOrderSelect/Remove",
               data: {
                  machineNo: this.machineNo,
                  editDate: editDate
               },
            }).then(res => {
               if (res.data.tbBillList > 0) {
                  this.isShowTableData = [];
               }
            });
         },
         formatDate(date) {
            let year = date.getFullYear(); // 获取年份
            let month = String(date.getMonth() + 1).padStart(2, '0'); // 获取月份并补零
@@ -641,22 +639,33 @@
            })
         },
            //获取表格的数据源
         getWomdaaIsShow() {
            this.$post({
               url: "/Womdaa/GetWomdaasByShow",
               data: {
                  machineNo: this.machineNo,
               }
            }).then(res => {
               this.isShowTableData = res.data.tbBillList;
            getWomdaaIsShow() {
                this.$post({
                    url: "/Womdaa/GetWomdaasByShow",
                    data: {
                        machineNo: this.machineNo,
                    }
                }).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]);
               }
            });
         },
                    // 只判断第一条(只允许一条工单)
                    const order = this.isShowTableData[0];
                    let hasBindedCutter = false;
                    if (order) {
                        hasBindedCutter =
                            (order.outToolId && order.outToolId.toString().trim() !== '') ||
                            (order.outToolCode && order.outToolCode.trim() !== '') ||
                            (order.outToolName && order.outToolName.trim() !== '');
                    }
                    // 存储到 data 变量
                    this.hasBindedCutterFlag = hasBindedCutter;
                    if (this.isShowTableData.length == 1) {
                        uni.setStorageSync('daa001', this.isShowTableData[0].daa001);
                        uni.setStorageSync('id', this.isShowTableData[0].id);
                    }
                });
            },
            isShowTab() {
                if (this.isShowTableData.length > 0) {