hh 2 settimane fa
parent
commit
0132250d58

+ 246 - 130
entry/src/main/ets/pages/Index.ets

@@ -6,134 +6,134 @@ import ProcessRequest from '../common/util/request/ProcessRequest';
 import RequestParamModel from '../viewmodel/RequestParamModel';
 import OperationInfo from '../viewmodel/process/OperationInfo';
 import { SelectOrderDialog } from '../view/SelectOrderDialog';
+import image from '@ohos.multimedia.image';
 
 @Entry
 @Component
 struct Index {
-  @State message: string = 'Hello World';
   // 工单列表
   @State workOrders: WorkOrderInfo[] = []
   // 选中工单
   @State selectWorkOder: WorkOrderInfo = {
-    beforeNum: '0.00',
-    completeNum:'0.00',
-    inventoryNum:'0.00',
-    materialCode:'GAS-RTA',
-    materialModel: 'N2纯度99.9999%,露点<-70°C',
-    materialName:'快速退火气体',
-    ops:[
-      {
-        exists:false,
-        firstCheck:0,
-        inspection:0,
-        mutualInspection:0,
-        opComplete:false,
-        operationCode:'GX-SFZB',
-        operationId:'679',
-        operationName:'三防准备',
-        operationSort:0,
-        selfCheck:0,
-        seqs:[],
-        specialInspection:0,
-        workOrderCode:'10.25.0022'
-      },
-      {
-        exists:false,
-        firstCheck:0,
-        inspection:0,
-        mutualInspection:0,
-        opComplete:false,
-        operationCode:'GX-CXSL',
-        operationId:'680',
-        operationName:'程序烧录',
-        operationSort:1,
-        selfCheck:0,
-        seqs:[],
-        specialInspection:0,
-        workOrderCode:'10.25.0022'
-      },
-      {
-        exists:true,
-        firstCheck:0,
-        inspection:0,
-        mutualInspection:0,
-        opComplete:false,
-        operationCode:'GX-WGJC',
-        operationId:'681',
-        operationName:'外观检测',
-        operationSort:2,
-        selfCheck:0,
-        seqs:[
-          {
-            currentTask:'当前进度:包装工位1(三防准备)',
-            seqNo:'10.25.0022-0001',
-            state:'0'
-          }
-        ],
-        specialInspection:0,
-        workOrderCode:'10.25.0022'
-      },
-      {
-        exists:false,
-        firstCheck:0,
-        inspection:0,
-        mutualInspection:0,
-        opComplete:false,
-        operationCode:'GX-JY',
-        operationId:'682',
-        operationName:'检验',
-        operationSort:3,
-        selfCheck:0,
-        seqs:[],
-        specialInspection:0,
-        workOrderCode:'10.25.0022'
-      },
-      {
-        exists:false,
-        firstCheck:0,
-        inspection:0,
-        mutualInspection:0,
-        opComplete:false,
-        operationCode:'GJ-WWSF',
-        operationId:'683',
-        operationName:'委外三防',
-        operationSort:4,
-        selfCheck:0,
-        seqs:[],
-        specialInspection:0,
-        workOrderCode:'10.25.0022'
-      },
-      {
-        exists:false,
-        firstCheck:0,
-        inspection:0,
-        mutualInspection:0,
-        opComplete:false,
-        operationCode:'GJ-GDWCC',
-        operationId:'677',
-        operationName:'高低温存储',
-        operationSort:5,
-        selfCheck:0,
-        seqs:[],
-        specialInspection:0,
-        workOrderCode:'10.25.0022'
-      }
-    ],
-    orderCode:'DD2505140001',
-    orderName:'GAS-RTA',
-    planNum:'1.00',
-    planStartEnd:'2025-05-16 08:26:00',
-    planStartWhen:'2025-05-16 08:00:00',
-    processRouteCode:'GAS-RTA',
-    processRouteId:147,
-    processRouteName:'GAS-RTA',
-    productLineId:'18',
-    productLineName:'配件产线01',
-    workOrderCode:'10.25.0022',
-    workOrderState:'3',
-    workshopId:'0',
-    workshopName:'青半002'
-  }
+  beforeNum: '0.00',
+  completeNum:'0.00',
+  inventoryNum:'0.00',
+  materialCode:'GAS-RTA',
+  materialModel: 'N2纯度99.9999%,露点<-70°C',
+  materialName:'快速退火气体',
+  ops:[
+    {
+      exists:false,
+      firstCheck:0,
+      inspection:0,
+      mutualInspection:0,
+      opComplete:false,
+      operationCode:'GX-SFZB',
+      operationId:'679',
+      operationName:'三防准备',
+      operationSort:0,
+      selfCheck:0,
+      seqs:[],
+      specialInspection:0,
+      workOrderCode:'10.25.0022'
+    },
+    {
+      exists:false,
+      firstCheck:0,
+      inspection:0,
+      mutualInspection:0,
+      opComplete:false,
+      operationCode:'GX-CXSL',
+      operationId:'680',
+      operationName:'程序烧录',
+      operationSort:1,
+      selfCheck:0,
+      seqs:[],
+      specialInspection:0,
+      workOrderCode:'10.25.0022'
+    },
+    {
+      exists:true,
+      firstCheck:0,
+      inspection:0,
+      mutualInspection:0,
+      opComplete:false,
+      operationCode:'GX-WGJC',
+      operationId:'681',
+      operationName:'外观检测',
+      operationSort:2,
+      selfCheck:0,
+      seqs:[
+        {
+          currentTask:'当前进度:包装工位1(三防准备)',
+          seqNo:'10.25.0022-0001',
+          state:'0'
+        }
+      ],
+      specialInspection:0,
+      workOrderCode:'10.25.0022'
+    },
+    {
+      exists:false,
+      firstCheck:0,
+      inspection:0,
+      mutualInspection:0,
+      opComplete:false,
+      operationCode:'GX-JY',
+      operationId:'682',
+      operationName:'检验',
+      operationSort:3,
+      selfCheck:0,
+      seqs:[],
+      specialInspection:0,
+      workOrderCode:'10.25.0022'
+    },
+    {
+      exists:false,
+      firstCheck:0,
+      inspection:0,
+      mutualInspection:0,
+      opComplete:false,
+      operationCode:'GJ-WWSF',
+      operationId:'683',
+      operationName:'委外三防',
+      operationSort:4,
+      selfCheck:0,
+      seqs:[],
+      specialInspection:0,
+      workOrderCode:'10.25.0022'
+    },
+    {
+      exists:false,
+      firstCheck:0,
+      inspection:0,
+      mutualInspection:0,
+      opComplete:false,
+      operationCode:'GJ-GDWCC',
+      operationId:'677',
+      operationName:'高低温存储',
+      operationSort:5,
+      selfCheck:0,
+      seqs:[],
+      specialInspection:0,
+      workOrderCode:'10.25.0022'
+    }
+  ],
+  orderCode:'DD2505140001',
+  orderName:'GAS-RTA',
+  planNum:'1.00',
+  planStartEnd:'2025-05-16 08:26:00',
+  planStartWhen:'2025-05-16 08:00:00',
+  processRouteCode:'GAS-RTA',
+  processRouteId:147,
+  processRouteName:'GAS-RTA',
+  productLineId:'18',
+  productLineName:'配件产线01',
+  workOrderCode:'10.25.0022',
+  workOrderState:'3',
+  workshopId:'0',
+  workshopName:'青半002'
+}
   // 工位通知数量
   @State noticeNum: number = 100
   // 扫描或手动输入的物料编码
@@ -178,7 +178,8 @@ struct Index {
           .fillColor($r('app.color.FFFFFF'))
         Text('生产执行')
           .fontColor($r('app.color.FFFFFF'))
-          .fontSize($r('app.float.fontSize_38'))
+          .fontSize($r('app.float.fontSize_30'))
+          .fontWeight(FontWeight.Medium)
       }
       .height('4%')
       .width('94.8%')
@@ -186,21 +187,57 @@ struct Index {
       .onClick(()=> {
         router.back()
       })
-
+      Row().height('2.8%')
+      // 主要操作栏
       Row() {
         // 左侧选择工单、工位、人员;工序查看
         Column() {
-          Button('请选择工单', { type: ButtonType.Normal })
+          if (this.selectWorkOder && this.selectWorkOder.workOrderCode) {
+            Column() {
+              Text(this.selectWorkOder.materialName!)
+                .fontWeight(FontWeight.Medium)
+                .fontColor($r('app.color.FFFFFF'))
+                .fontSize($r('app.float.fontSize_24'))
+                .width('88.9%')
+              Text(this.selectWorkOder.materialCode!)
+                .fontWeight(FontWeight.Lighter)
+                .fontColor($r('app.color.FFFFFF'))
+                .fontSize($r('app.float.fontSize_12'))
+                .width('88.9%')
+              Row() {
+                Text('工单:')
+                  .fontWeight(FontWeight.Lighter)
+                  .fontColor($r('app.color.FFFFFF'))
+                  .fontSize($r('app.float.fontSize_12'))
+                Text(this.selectWorkOder.orderCode!)
+                  .fontWeight(FontWeight.Bold)
+                  .fontColor($r('app.color.FFFFFF'))
+                  .fontSize($r('app.float.fontSize_16'))
+              }
+              .width('88.9%')
+            }
             .width('100%')
             .height('12.4%')
-            .fontWeight(FontWeight.Medium)
-            .fontColor($r('app.color.FFFFFF'))
-            .fontSize($r('app.float.fontSize_24'))
+            .justifyContent(FlexAlign.Center)
             .backgroundColor($r('app.color.20FFFFFF'))
             .borderRadius($r('app.float.fontSize_16'))
             .onClick(()=>{
               this.selectOrderController.open()
             })
+          } else {
+            Button('请选择工单', { type: ButtonType.Normal })
+              .width('100%')
+              .height('12.4%')
+              .fontWeight(FontWeight.Medium)
+              .fontColor($r('app.color.FFFFFF'))
+              .fontSize($r('app.float.fontSize_24'))
+              .backgroundColor($r('app.color.20FFFFFF'))
+              .borderRadius($r('app.float.fontSize_16'))
+              .onClick(()=>{
+                this.selectOrderController.open()
+              })
+          }
+
           // 工位、人员信息
           Row() {
             Row().width('5.6%')
@@ -254,14 +291,14 @@ struct Index {
               ForEach(this.selectWorkOder.ops!, (item: OperationInfo, index: number) => {
                 ListItem() {
                   Column() {
-                    Row({space: 5}) {
+                    Row() {
                       Row() {
                         Text((index + 1).toString())
                           .fontSize($r('app.float.fontSize_16'))
                           .fontColor($r('app.color.FFFFFF'))
                           .fontWeight(FontWeight.Bold)
                       }
-                      .width('16.7%')
+                      .width('14.6%')
                       .height('80%')
                       .justifyContent(FlexAlign.Center)
                       Row() {
@@ -269,11 +306,21 @@ struct Index {
                           .fontSize($r('app.float.fontSize_16'))
                           .fontColor( $r('app.color.FFFFFF'))
                           .fontWeight(FontWeight.Regular)
+                          .padding({left: 5})
                       }
-                      .width('100%')
-                      .height('70%')
+                      .width('70.8%')
+                      .height('100%')
                       .alignItems(VerticalAlign.Center)
                       .justifyContent(FlexAlign.Start)
+                      Row() {
+                        Image($r('app.media.process_complete'))
+                          .width($r('app.float.virtualSize_24'))
+                          .height($r('app.float.virtualSize_24'))
+                          .fillColor($r('app.color.FFFFFF'))
+                      }
+                      .width('14.6%')
+                      .height('100%')
+                      .justifyContent(FlexAlign.Center)
                     }
                     .width('100%')
                     .height('70%')
@@ -360,6 +407,75 @@ struct Index {
       .height('80%')
       .width('94.8%')
       .justifyContent(FlexAlign.SpaceBetween)
+      // 底部按钮和抽屉
+      Stack() {
+        Column() {
+          Blank()
+          Row() {
+            Row() {
+
+            }
+            .width('50%')
+            .height('100%')
+            .borderWidth(1)
+            Row(){
+
+            }.width('50%')
+            .height('100%')
+            .borderWidth(1)
+            // Image($r('app.media.process_drawer_switch'))
+            //   .width($r('app.float.virtualSize_48'))
+            //   .height($r('app.float.virtualSize_48'))
+            //   .fillColor($r('app.color.60FFFFFF'))
+          }
+          .width('100%')
+          .height('47%')
+          .justifyContent(FlexAlign.Center)
+          .backgroundImage($r('app.media.process_drawer_thumbnail'), ImageRepeat.XY)
+        }
+        .width('100%')
+        .height('100%')
+
+        Row() {
+          Row().width('2.6%')
+          Row({space: 4}) {
+            Image($r('app.media.process_work_instruction'))
+              .width($r('app.float.virtualSize_24'))
+              .height($r('app.float.virtualSize_24'))
+              .fillColor($r('app.color.0A84FF'))
+            Text('作业指导')
+              .fontColor($r('app.color.0A84FF'))
+              .fontSize($r('app.float.fontSize_24'))
+              .fontWeight(FontWeight.Medium)
+          }
+          .width('10%')
+          .height('58.3%')
+          .justifyContent(FlexAlign.Center)
+          .backgroundColor($r('app.color.20FFFFFF'))
+          .borderRadius($r('app.float.fontSize_16'))
+          Row().width('1.5%')
+          Row({space: 4}) {
+            Image($r('app.media.process_work_instruction'))
+              .width($r('app.float.virtualSize_24'))
+              .height($r('app.float.virtualSize_24'))
+              .fillColor($r('app.color.0A84FF'))
+            Text('作业指导')
+              .fontColor($r('app.color.0A84FF'))
+              .fontSize($r('app.float.fontSize_24'))
+              .fontWeight(FontWeight.Medium)
+          }
+          .width('10%')
+          .height('58.3%')
+          .justifyContent(FlexAlign.Center)
+          .backgroundColor($r('app.color.20FFFFFF'))
+          .borderRadius($r('app.float.fontSize_16'))
+        }
+        .height('90.6%')
+        .width('100%')
+      }
+      .width('100%')
+      .height('9.8%')
+      .alignContent(Alignment.Top)
     }
     .width('100%')
     .height('100%')

+ 3 - 0
entry/src/main/resources/base/media/process_complete.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path fill-opacity=".9" d="M2.136 12.207a1 1 0 0 1 1.378-1.449l.036.035 5.102 5.1.07.058a.5.5 0 0 0 .604-.037l.028-.025 1.414-1.414 3.182-3.182 5.75-5.75a1 1 0 0 1 1.448 1.378l-.034.036-5.743 5.743-.007.007-4.95 4.95a2 2 0 0 1-2.783.043l-.045-.043-5.45-5.45Z"/>
+</svg>

+ 3 - 0
entry/src/main/resources/base/media/process_drawer_switch.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 48 48">
+  <path d="M5.5 19.5a1.5 1.5 0 0 1 0-3h37a1.5 1.5 0 0 1 0 3h-37Zm37 9a1.5 1.5 0 0 1 0 3h-37a1.5 1.5 0 0 1 0-3h37Z"/>
+</svg>

BIN
entry/src/main/resources/base/media/process_drawer_thumbnail.png


+ 4 - 0
entry/src/main/resources/base/media/process_work_instruction.svg

@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
+  <path d="M3.25 21V3c0-.966.784-1.75 1.75-1.75h10l.077.004A.75.75 0 0 1 15.75 2v4.25H20a.75.75 0 0 1 .75.75v14A1.75 1.75 0 0 1 19 22.75H5A1.75 1.75 0 0 1 3.25 21Zm1.5 0c0 .138.112.25.25.25h14a.25.25 0 0 0 .25-.25V7.75H15a.75.75 0 0 1-.75-.75V2.75H5a.25.25 0 0 0-.25.25v18Z"/>
+  <path d="M14.47 1.47a.75.75 0 0 1 1.004-.052l.056.052 5 5 .052.056a.75.75 0 0 1-1.056 1.056l-.056-.052-5-5-.052-.056a.75.75 0 0 1 .052-1.004ZM10.25 8.5a1.25 1.25 0 1 0-2.5 0 1.25 1.25 0 0 0 2.5 0Zm1.5 0a2.75 2.75 0 1 1-5.5 0 2.75 2.75 0 0 1 5.5 0Zm4.277 1.418a.75.75 0 0 1 1.223.582v8a.75.75 0 0 1-.75.75h-9a.75.75 0 0 1-.75-.75V14l.006-.093a.75.75 0 0 1 1.03-.6l3.756 1.548 4.402-4.859.083-.078Zm-3.726 6.336a.75.75 0 0 1-.73.226l-.112-.037L8.25 15.12v2.63h7.5v-5.305l-3.45 3.809Z"/>
+</svg>