快乐的昕的电脑
2025-11-14 c51d38b0052fb89b17813e8e739a1309989322ce
pages/index.vue
@@ -15,20 +15,23 @@
            刀具管理
         </view>
         <view class="tab-item" :class="{ active: currentTab === 4 }" @click="changeTab(4)">
            打码报工
            生产报工
         </view>
         <view class="tab-item" :class="{ active: currentTab === 1 }" @click="changeTab(1)">
         <!-- <view class="tab-item" :class="{ active: currentTab === 1 }" @click="changeTab(1)">
            开工完工
         </view>
         </view> -->
         <view class="tab-item" :class="{ active: currentTab === 5 }" @click="changeTab(5)">
            e-SOP
         </view>
         <view class="tab-item" :class="{ active: currentTab === 6 }" @click="changeTab(6)">
            工艺参数
         </view>
         <view class="tab-item" :class="{ active: currentTab === 8 }" @click="changeTab(8)">
            打印机设置
         <view class="tab-item" :class="{ active: currentTab === 9 }" @click="changeTab(9)">
            设备点检
         </view>
         <!-- <view class="tab-item" :class="{ active: currentTab === 8 }" @click="changeTab(8)">
            打印机设置
         </view> -->
      </view>
      <view class="font"></view>
@@ -63,28 +66,28 @@
               <view class="section card">
                  <uni-table border stripe emptyText="暂无更多数据" @selection-change="selectionChange">
                     <uni-tr>
                        <uni-th align="center" class="th" style="color: #FFFFFF">工序</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF">工单号</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF">产品编码</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF">产品名称</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF">规格</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF;width: 100px;">已生产数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF;width: 100px;">未生产数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF;width: 100px;">派工数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF;width: 100px;">工单数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF;width: 100px;">工单状态</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF;width: 100px;">报工人</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF">选择</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 140px;">工序</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 180px;">工单号</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 220px;">产品编码</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 180px;">产品名称</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 180px;">规格</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">已生产数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">未生产数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">派工数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">工单数量</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">工单状态</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">报工人</uni-th>
                        <uni-th align="center" class="th" style="color: #FFFFFF; width: 120px;">选择</uni-th>
                     </uni-tr>
                     <uni-tr v-for="(item, index) in isShowTableData" :key="index">
                        <uni-td align="center">
                           <input class="form-input" disabled="true" type="text" v-model="item.procName" /><!--工序-->
                        </uni-td>
                        <uni-td align="center">
                           <input class="form-input" disabled="true" type="text" v-model="item.daa001" />
                           <input class="form-input" disabled="true" type="text" v-model="item.daa001" /><!--工单号-->
                        </uni-td>
                        <uni-td align="center">
                           <input class="form-input" disabled="true" type="text" v-model="item.daa002" />
                           <input class="form-input" disabled="true" type="text" v-model="item.daa002" /><!--产品编码-->
                        </uni-td>
                        <uni-td align="center">
                           <input class="form-input" disabled="true" type="text" v-model="item.daa003" /><!--产品名称-->
@@ -112,7 +115,7 @@
                        </uni-td>
                        <uni-td>
                           <view class="uni-group">
                              <button type="default" @click="toDetail(item)">
                              <button class="select-btn" type="default" @click="toDetail(item)">
                                 选择
                              </button>
                           </view>
@@ -126,10 +129,10 @@
               </view>
               <view>
                  <text style="color: red;">
                  <!--<text style="color: red;">
                     说明:只能同时开工一个工单。选择完成,点击保存选择。系统保留选中的工单。
                     如果要重选,点击清空重选功能。
                  </text>
                  </text>-->
               </view>
            </view>
         </view>
@@ -163,6 +166,10 @@
         <view v-if="currentTab === 6" class="tab-content">
            <Technology :orderId="orderId" :orderNo="selectedOrder" :machineNo="machineNo" />
         </view>
         <view v-if="currentTab === 9" class="tab-content">
            <!-- 设备点检视图 -->
            <EquipmentInspection :machineNo="machineNo" />
         </view>
      </scroll-view>
@@ -170,11 +177,12 @@
      <view v-if="isShow" class="overlay">
         <view class="popup">
            <view class="form-row">
               <view>
                  <label style="float: left;margin-top: 18px;">选择工单状态:</label>
               <view style="display: flex; align-items: center;">
                  <label style="float: left;margin-top: 18px;">点击按钮筛选工单状态:</label>
                  <superwei-combox :candidates="engineeringNoMapList" placeholder="请选择" v-model="engineeringNo"
                               @select="onEngineeringNoChange" class="picker"
                               style="padding: 7px 46px;width: 650px;"></superwei-combox>
                  <span style="margin-left: 20px; color: #ff6600; font-size: 18px;">多选时只保留最后一条工单</span>
               </view>
            </view>
@@ -248,16 +256,17 @@
</template>
<script>
   import WorkOrderStatus from '../components/WorkOrderStatus.vue'; // 确保路径正确
   import UniTable from "../uni_modules/uni-table/components/uni-table/uni-table.vue";
   import Mold from "../components/mold.vue";
   import Machine from "../components/machine.vue";
   import WorkOrderPrint from "../components/WorkOrderPrint.vue";
   import WorkOrder from "../components/WorkOrder.vue";
   import Technology from "../components/Technology.vue";
   import PDFShow from "../components/PDFShow.vue";
   import PrintInit from "../components/PrintInit.vue";
   import PrintTest from "../components/PrintTest.vue";
import WorkOrderStatus from '../components/WorkOrderStatus.vue'; // 确保路径正确
import UniTable from "../uni_modules/uni-table/components/uni-table/uni-table.vue";
import Mold from "../components/mold.vue";
import Machine from "../components/machine.vue";
import WorkOrderPrint from "../components/WorkOrderPrint.vue";
import WorkOrder from "../components/WorkOrder.vue";
import Technology from "../components/Technology.vue";
import PDFShow from "../components/PDFShow.vue";
import PrintInit from "../components/PrintInit.vue";
import PrintTest from "../components/PrintTest.vue";
import EquipmentInspection from "../components/EquipmentInspection.vue";
   export default {
      components: {
@@ -270,7 +279,8 @@
         WorkOrderStatus,
         PDFShow,
         PrintInit,
         PrintTest
         PrintTest,
         EquipmentInspection
      },
      data() {
         return {
@@ -396,9 +406,9 @@
            this.getWomdaaIsShow();
         },
         getPrintInfo() {
            var mac = "ac:f4:2c:20:0d:b4";
            var mac = "";
            
            mac = "e8:51:9e:7d:dc:95";
            mac = "74:24:ca:4f:b7:9b";
            this.$post({
               url: "/DevMachine/GetDevMachineByPdaMac",
               data: {
@@ -416,45 +426,46 @@
               this.getWomdaaIsShow();
            });
            return;
            
            
   //          if (plus.os.name == "Android") {
   //             //获取手机MAC地址
   //             var Context = plus.android.importClass("android.content.Context");
   //             var WifiManager = plus.android.importClass("android.net.wifi.WifiManager");
   //             var wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE);
   //             var WifiInfo = plus.android.importClass("android.net.wifi.WifiInfo");
   //             var wifiInfo = wifiManager.getConnectionInfo();
   //             mac = wifiInfo.getMacAddress();
             if (plus.os.name == "Android") {
                //获取手机MAC地址
                var Context = plus.android.importClass("android.content.Context");
                var WifiManager = plus.android.importClass("android.net.wifi.WifiManager");
                var wifiManager = plus.android.runtimeMainActivity().getSystemService(Context.WIFI_SERVICE);
                var WifiInfo = plus.android.importClass("android.net.wifi.WifiInfo");
                var wifiInfo = wifiManager.getConnectionInfo();
                mac = wifiInfo.getMacAddress();
               
   //             //如果mac为“02:00:00:00:00:00”,则可能是安卓6.0以上版本,则使用另一种方法获取mac地址
   //             if (mac == "02:00:00:00:00:00") {
   //                mac = this.getMacNew();
   //             }
   //             //如果mac使用新方法依然是“02:00:00:00:00:00”则不进行保存
   //             if (mac == "02:00:00:00:00:00") {
   //                return;
   //             }
   //             uni.setStorageSync('pdaMac', mac);
                //如果mac为“02:00:00:00:00:00”,则可能是安卓6.0以上版本,则使用另一种方法获取mac地址
                if (mac == "02:00:00:00:00:00") {
                   mac = this.getMacNew();
                }
                //如果mac使用新方法依然是“02:00:00:00:00:00”则不进行保存
                if (mac == "02:00:00:00:00:00") {
                   return;
                }
                uni.setStorageSync('pdaMac', mac);
   //             this.$post({
   //                url: "/DevMachine/GetDevMachineByPdaMac",
   //                data: {
   //                   pdaMac: mac,
   //                }
   //             }).then(res => {
   //                let devMachine = res.data.tbBillList;
   //                this.machineNo = devMachine.machineNo;
   //                this.machineName = "当前机台:" + this.machineNo + "号注塑机";
                this.$post({
                   url: "/DevMachine/GetDevMachineByPdaMac",
                   data: {
                      pdaMac: mac,
                   }
                }).then(res => {
                   let devMachine = res.data.tbBillList;
                   this.machineNo = devMachine.machineNo;
                   this.machineName = "当前机台:" + this.machineNo + "号齿轮机";
   //                uni.setStorageSync('machineNo', this.machineNo);
   //                uni.setStorageSync('printMac', devMachine.printMac);
                   uni.setStorageSync('machineNo', this.machineNo);
                   uni.setStorageSync('printMac', devMachine.printMac);
 
   //                this.getWomdaaIsShow();
                   this.getWomdaaIsShow();
   //             });
   //          }
                });
             }
         },
         save() {
            let data = this.selectedItems();
@@ -635,29 +646,25 @@
            });
         },
         isShowTab() {
            isShowTab() {
                if (this.isShowTableData.length > 0) {
                    uni.showToast({
                        title: '已有正在操作的工单,不能再次选择',
                        icon: 'error',
                        duration: 2000
                    });
                    return;
                }
            if (this.isShowTableData.length > 0) {
               uni.showToast({
                  title: '已有正在操作的工单,不能再次选择',
                  //将值设置为 success 或者直接不用写icon这个参数
                  icon: 'error',
                  //显示持续时间为 2秒
                  duration: 2000
               });
               return;
            }
            this.isShow = true;
            this.engineeringNo = null;
            this.tableData = [];
                this.isShow = true;
                // 默认选中“待开工”
                this.engineeringNo = '待开工';
                this.tableData = [];
                // 下拉框只显示工单状态
                this.engineeringNoMapList = ['待开工', '未开工', '完工', '暂停'];
                // 默认显示全部工单
                this.getWomdaa();
         },
                this.engineeringNoMapList = ['待开工', '未开工', '开工', '暂停', '完工'];
                // 默认显示“待开工”工单
                this.getWomdaaByStatus();
            },
            // 下拉框选中后,按状态筛选工单
            onEngineeringNoChange(status) {
                this.engineeringNo = status;
@@ -881,16 +888,19 @@
      /* Increased font size for content */
   }
   .picker {
      float: left;
      margin-top: 7px;
      margin-left: 10px;
      text-align: center;
      font-size: 100%;
      padding: 5.5px 1px;
      background-color: #f8f8f8;
      border: 2px solid #ccc;
   }
    .picker {
        float: left;
        margin-top: 7px;
        margin-left: 10px;
        text-align: center;
        font-size: 100%;
        padding: 5.5px 1px;
        background-color: #fff; // 这里改为蓝色
        border: 2px solid #007aff; // 边框也改为蓝色
        color: #007aff; // 字体颜色改为白色,保证可读性
        border-radius: 6px;
        transition: background 0.2s;
    }
   .th {
      background-color: lightskyblue;
@@ -1001,4 +1011,17 @@
         font-size: 20px;
      }
   }
</style>
    .select-btn {
        width: 180px; // 更宽
        height: 80px; // 更高
        font-size: 1.8vw; // 字体也略大
        border-radius: 10px;
        background-color: #f5f5f5;
        color: #007aff;
        border: 2px solid #007aff;
        margin: 0 auto;
        display: block;
    }
</style>