快乐的昕的电脑
2025-10-14 24a60698d12ccb23d132ba4c91d9eb7a4a303ca9
components/WorkOrder.vue
@@ -19,7 +19,7 @@
                     <input class="inp" type="text" v-model="order.daa001" disabled="true" />
                  </view>
                  <view class="form-item">
                     <label>刀具名称:</label><!--刀具名称???-->
                     <label>刀具名称:</label>
                     <input class="inp" type="text" v-model="order.moldId" disabled="true" />
                  </view>
                  <view class="form-item">
@@ -53,12 +53,12 @@
               </view>
               <view class="form-row3">
                  <view class="form-item">
                     <label>产品编码:</label><!--产品编码???-->
                     <input class="inp" type="text" v-model="order.daa004" disabled="true" />
                     <label>产品编码:</label>
                     <input class="inp" type="text" v-model="order.daa002" disabled="true" />
                  </view>
                  <view class="form-item">
                     <label>产品规格:</label><!--开工数采:开工时的累计生产数???-->
                     <input class="inp" type="text" v-model="order.daa004" disabled="true" />
                     <label>产品规格:</label>
                     <input class="inp" type="text" v-model="order.daa005" disabled="true" />
                  </view>
                  <view class="form-item">
                     <label>报工数量:</label>
@@ -180,13 +180,9 @@
         };
      },
      created() {
         this.fetchData(true);
         this.sumbit();
         this.init();
      },
      mounted() {
         this.fetchData(false); // Initial fetch
@@ -196,7 +192,6 @@
         clearInterval(this.timer); // Clear the timer on component destruction
      },
      methods: {
         init() {
            this.$post({
               url: "/MesOrderSta/init",
@@ -236,25 +231,18 @@
            });
         },
         onDaa003Change(event) {
            let orde = this.lineList[this.DAA003List.indexOf(event)];
            this.orderId = orde.id;
            this.orderNo = orde.daa001;
            //切换为新的id
            uni.setStorageSync('machine', this.machineNo);
            uni.setStorageSync('orderId', this.orderId);
            uni.setStorageSync('orderNo', this.orderNo);
            this.fetchData(false);
            this.sumbit();
         },
         sumbit() {
            this.$post({
               url: "/MesOrderSta/FindByOrderNo",
               data: {
@@ -263,23 +251,17 @@
               }
            }).then(res => {
               let statusForm = res.data.tbBillList;
               this.startTime = res.data.tbBillList.startTime;
               this.endTime = res.data.tbBillList.endTime;
               this.productionDuration = "0m";
               if (this.startTime) {
                  let date1 = new Date(this.startTime);
                  let date2 = new Date();
                  if (this.endTime) {
                     date2 = new Date(this.endTime);
                  }
                  // 计算两个日期之间的差异(以毫秒为单位)
                  let differenceInMilliseconds = date2 - date1;
                  this.productionDuration = (differenceInMilliseconds / 60000).toFixed(2);
               }
@@ -330,11 +312,9 @@
            if (!this.orderId && !this.orderNo) {
               return;
            }
            this.getOrderById();
            this.getSJByOrder();
            this.getXJByOrder();
            if (flag) {
               this.$post({
                  url: "/Womdaa/GetWomdaasByShow",
@@ -361,44 +341,39 @@
                  orderNo: this.orderNo
               }
            }).then(res => {
               if (res.data.tbBillList == null) {
                  this.$showMessage("工单不存在或者未开工,请检查");
           // 保证order为对象,避免模板报错
            this.order = {
                daa001: '',
                moldId: '',
                daa008: '',
                daa004: '',
                daa003: '',
                daa011: '',
                daa018: '',
                machineNo: '',
                engineeringNo: '',
                todayOutput: 0,
                todayRunTime: '',
                todayFaultNum: 0,
                jdl: '',
            };
                  // 保证order为对象,避免模板报错
                  this.order = {
                     daa001: '',
                     moldId: '',
                     daa008: '',
                     daa004: '',
                     daa003: '',
                     daa002: '',
                     daa005: '',
                     daa011: '',
                     daa018: '',
                     machineNo: '',
                     engineeringNo: '',
                     todayOutput: 0,
                     todayRunTime: '',
                     todayFaultNum: 0,
                     jdl: '',
                  };
                  return;
               }
               this.order = res.data.tbBillList;
               uni.setStorageSync('engineeringNo', this.order.engineeringNo);
               this.orderStatus = this.order.daa018;
               this.collectedAmount = this.order.todayOutput;
               if (!this.order.todayOutput) {
                  this.collectedAmount = 0;
               }
               this.todayRunTime = this.order.todayRunTime;
               if (!this.order.todayRunTime) {
                  this.todayRunTime = "0";
               }
               //this.productionDuration = (this.order.todayOnlineTime / 3600).toFixed(2) + "h";
               this.todayFaultNum = this.order.todayFaultNum;
               this.utilizationRate = this.order.jdl + '%';
@@ -467,9 +442,9 @@
      margin-bottom: 20px;
   }
   .refresh-btn:hover {
      background-color: #00A2E9;
   }
      .refresh-btn:hover {
         background-color: #00A2E9;
      }
   .form-row {
      display: flex;
@@ -561,7 +536,6 @@
      margin-top: -13px;
      line-height: 48px;
      align-content: flex-start;
   }
   .form-row3 {