Forráskód Böngészése

统一扫码、完成图片;修改物料采集页面

hh 2 hónapja
szülő
commit
d9ae341286

+ 43 - 37
entry/src/main/ets/pages/ProcessIndex.ets

@@ -14,6 +14,7 @@ import { SwitchingDeptDialog, SwitchingProductLineDialog, SwitchingStationDialog
 import { SwitchingUserDialog } from '../view/SwitchingUserDialog';
 import OperationComponent from '../viewmodel/process/OperationComponent';
 import ProcessInfo from '../viewmodel/process/ProcessInfo';
+import { MaterialCollectView } from '../view/process/MaterialCollectView';
 
 @Entry
 @Component
@@ -102,12 +103,10 @@ struct ProcessIndex {
     ['9', $r('app.media.process_component_label_bind')],
     ['10', $r('app.media.process_component_visual_inspect')],
   ])
-  @State selectOpComponent: number = 0
   // 扫码开工后的生产过程信息
   @State process: ProcessInfo = {}
   // 扫码开工状态(0:未开工 1:已开工)
-  scanState: number = 0
-
+  @State scanState: number = 0
 
   private scrollerList: Scroller = new Scroller()
 
@@ -537,50 +536,56 @@ struct ProcessIndex {
           .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
         } else {
           Column() {
-            Row() {
-              List ({space: 4}) {
-                ForEach(this.opComponents, (item: OperationComponent, index: number) => {
-                  ListItem() {
-                    Column() {
-                      Stack() {
-                        Image(this.selectComponentType === item.compentType! ? $r('app.media.process_component_state_select') : (this.componentStates.length >= (index + 1) && this.componentStates[index] === 1 ? $r('app.media.process_component_state_finish') : $r('app.media.process_component_state_no_select')))
-                          .height(this.selectComponentType === item.compentType! ? '100%' : '90%')
-                          .width('100%')
-                          .objectFit(ImageFit.Fill)
-                          .borderRadius($r('app.float.fontSize_16'))
-                        Column({space: 2}) {
-                          Image(this.componentResMap.get(item.compentType!))
-                            .height($r('app.float.virtualSize_24'))
-                            .width($r('app.float.virtualSize_24'))
-                          Text(item.compentName!)
-                            .fontSize($r('app.float.fontSize_16'))
-                            .fontWeight(FontWeight.Regular)
-                            .fontColor($r('app.color.90000000'))
-                        }
+            List ({space: 4}) {
+              ForEach(this.opComponents, (item: OperationComponent, index: number) => {
+                ListItem() {
+                  Column() {
+                    Stack() {
+                      Image(this.selectComponentType === item.compentType! ? $r('app.media.process_component_state_select') : (this.componentStates.length >= (index + 1) && this.componentStates[index] === 1 ? $r('app.media.process_component_state_finish') : $r('app.media.process_component_state_no_select')))
+                        .height(this.selectComponentType === item.compentType! ? '100%' : '90%')
                         .width('100%')
-                        .height('90%')
-                        .justifyContent(FlexAlign.Center)
+                        .objectFit(ImageFit.Fill)
+                        .borderRadius($r('app.float.fontSize_16'))
+                      Column({space: 2}) {
+                        Image(this.componentResMap.get(item.compentType!))
+                          .height($r('app.float.virtualSize_24'))
+                          .width($r('app.float.virtualSize_24'))
+                          .fillColor(this.selectComponentType === item.compentType! ? $r('app.color.99000000') : (this.componentStates.length >= (index + 1) && this.componentStates[index] === 1 ? $r('app.color.30D158') : $r('app.color.FFFFFF')))
+                        Text(item.compentName!)
+                          .fontSize($r('app.float.fontSize_16'))
+                          .fontWeight(FontWeight.Regular)
+                          .fontColor(this.selectComponentType === item.compentType! ? $r('app.color.99000000') : (this.componentStates.length >= (index + 1) && this.componentStates[index] === 1 ? $r('app.color.30D158') : $r('app.color.FFFFFF')))
                       }
                       .width('100%')
-                      .height('100%')
-                      .alignContent(Alignment.Top)
-                      .onClick(()=>{
-                        this.selectComponentType = item.compentType!
-                      })
+                      .height('90%')
+                      .justifyContent(FlexAlign.Center)
                     }
+                    .width('100%')
                     .height('100%')
-                    .width('12.5%')
+                    .alignContent(Alignment.Top)
+                    .onClick(()=>{
+                      this.selectComponentType = item.compentType!
+                    })
                   }
-                })
-              }
-              .listDirection(Axis.Horizontal)
-              .width('100%')
-              .height('100%')
+                  .height('100%')
+                  .width('12.5%')
+                }
+              })
             }
+            .listDirection(Axis.Horizontal)
             .height('9.3%')
             .width('79.1%')
-            Column() {
 
+            Column() {
+              if (this.selectComponentType === '1') {
+                MaterialCollectView({
+                  scanState: this.scanState,
+                  seqNo: this.seqNo,
+                  selectWorkOder: this.selectWorkOder,
+                  selectOperationId: this.selectOperationId,
+                  process: this.process,
+                })
+              }
             }
             .width('79.1%')
             .height('90.7%')
@@ -748,6 +753,7 @@ struct ProcessIndex {
                 }
               }
             }
+            this.scanState = 1
           })
         }
         .height('90.6%')

+ 2 - 2
entry/src/main/ets/view/SelectOrderDialog.ets

@@ -45,7 +45,7 @@ export struct SelectOrderDialog {
 
       Row() {
         // 左侧二维码图标
-        Image($r('app.media.qr_code'))
+        Image($r('app.media.material_qr_code'))
           .width($r('app.float.virtualSize_32'))
           .height($r('app.float.virtualSize_32'))
           .fillColor($r('app.color.FFFFFF'))
@@ -123,7 +123,7 @@ export struct SelectOrderDialog {
                 .padding(8)
                 Stack(){
                   if (order.workOrderState ==="6") {
-                    Image($r('app.media.order_complete'))
+                    Image($r("app.media.process_complete_test"))
                       .width($r('app.float.virtualSize_112'))
                       .height($r('app.float.virtualSize_80'))
                       .position({ x: '30%', y: '0%' })

+ 1 - 1
entry/src/main/ets/view/SwitchingProductDialog.ets

@@ -196,7 +196,7 @@ export struct SwitchingProductDialog{
            .margin({left:'22%'})
          Row() {
            // 左侧二维码图标
-           Image($r('app.media.qr_code'))
+           Image($r('app.media.material_qr_code'))
              .width($r('app.float.virtualSize_32'))
              .height($r('app.float.virtualSize_32'))
              .fillColor($r('app.color.FFFFFF'))

+ 150 - 0
entry/src/main/ets/view/process/MaterialCollectView.ets

@@ -0,0 +1,150 @@
+import ProcessRequest from '../../common/util/request/ProcessRequest'
+import OperationItem from '../../viewmodel/OperationItem'
+import ProcessInfo from '../../viewmodel/process/ProcessInfo'
+import RequestParamModel from '../../viewmodel/RequestParamModel'
+import WorkOrderInfo from '../../viewmodel/WorkOrderInfo'
+
+@Component
+export struct MaterialCollectView {
+  @State scanCode: string = ''
+  // 需要采集的工序物料
+  @State itemArray: OperationItem[] = []
+  // 总需求数
+  @State needNum: number = 100
+  // 实际数量(已采集数)
+  @State realNum: number = 46
+  // 扫码开工状态(0:未开工 1:已开工)
+  @Link scanState: number
+  // 当前流转卡号
+  @Link seqNo: string
+  // 选中工单
+  @Link selectWorkOder: WorkOrderInfo
+  // 选中工序id
+  @Link selectOperationId: string
+  // 扫码开工后的生产过程信息
+  @Link process: ProcessInfo
+
+  async aboutToAppear() {
+    if (this.scanState === 1) {
+      this.itemArray = await ProcessRequest.post('/api/v1/process/itemRecord/list', {
+        operationId: this.selectOperationId,
+        workOrderCode: this.selectWorkOder.workOrderCode!,
+        seqNo: this.seqNo,
+        processId: this.process.id,
+        pageNo: 1,
+        pageSize: 999999} as RequestParamModel)
+    } else {
+      this.itemArray = await ProcessRequest.post('/api/v1/op/operationItem/page', {
+        operationId: this.selectOperationId,
+        pageNo: 1,
+        pageSize: 999999} as RequestParamModel)
+    }
+    for (const element of this.itemArray) {
+      this.needNum += element.needNum!
+      this.realNum += element.realNum!
+    }
+  }
+  
+  build() {
+    Column() {
+      // 扫码框和已采集统计
+      Row() {
+        Row() {
+          // 左侧二维码图标
+          Image($r('app.media.material_qr_code'))
+            .width($r('app.float.virtualSize_32'))
+            .height($r('app.float.virtualSize_32'))
+            .fillColor($r('app.color.FFFFFF'))
+            .margin({ left: '2%'})
+          // 扫码输入框
+          TextInput({text:this.scanCode, placeholder: '请扫描物料编码' })
+            .type(InputType.Normal)
+            .placeholderFont({ size: $r('app.float.fontSize_16') })
+            .placeholderColor($r('app.color.30FFFFFF'))
+            .fontSize($r('app.float.fontSize_30'))
+            .fontColor($r('app.color.FFFFFF'))
+            .enableKeyboardOnFocus(false)
+            .onSubmit(() => {
+
+            })
+            .onChange((value: string) => {
+
+            })
+        }
+        .height('52.8%')
+        .width('28.4%')
+        .borderRadius($r('app.float.virtualSize_16'))
+        .backgroundColor($r('app.color.000000'))
+
+        Column() {
+          Text(this.realNum + '/' + this.needNum)
+            .fontColor($r('app.color.FFFFFF'))
+            .fontSize($r('app.float.fontSize_16'))
+            .fontWeight(FontWeight.Regular)
+          Progress({ value: this.realNum, total: this.needNum, type: ProgressType.Linear })
+            .width('100%')
+            .color($r('app.color.0A84FF'))
+            .backgroundColor($r('app.color.15FFFFFF'))
+            .borderRadius($r('app.float.virtualSize_32'))
+        }
+        .width('13.1%')
+        .height('31.3%')
+        .alignItems(HorizontalAlign.End)
+        .justifyContent(FlexAlign.SpaceBetween)
+      }
+      .height('13.5%')
+      .width('93%')
+      .justifyContent(FlexAlign.SpaceBetween)
+      // 动态排列容器
+      Scroll() {
+        Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Column, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start}) {
+          ForEach(this.itemArray, (item: OperationItem, index: number) => {
+            Column() {
+              Row() {
+                Column() {
+                  Text(item.itemName!)
+                    .fontSize($r('app.float.fontSize_24'))
+                    .fontWeight(FontWeight.Medium)
+                    .fontColor($r('app.color.FFFFFF'))
+                  Text(item.itemCode!)
+                    .fontSize($r('app.float.fontSize_12'))
+                    .fontWeight(FontWeight.Lighter)
+                    .fontColor($r('app.color.FFFFFF'))
+                }
+                .width('45.5%')
+                .height('100%')
+                .justifyContent(FlexAlign.Center)
+                Row() {
+                  Image($r('app.media.process_complete_test'))
+                    .height('100%')
+                    .width('45.5%')
+                }
+                .width('50%')
+                .height('100%')
+                .alignItems(VerticalAlign.Top)
+              }
+              .height('45.8%')
+              .width('100%')
+              .justifyContent(FlexAlign.End)
+
+
+            }
+            .width('32.8%')
+            .height('25.2%')
+            .borderRadius($r('app.float.virtualSize_16'))
+            .backgroundColor($r('app.color.20FFFFFF'))
+            .margin({ top: index > 2 ? '1%' : '0%', left: (index % 3) === 0 ? '0%' : '0.8%' })
+          })
+        }
+        .width('100%')
+      }
+      .scrollable(ScrollDirection.Vertical) // 垂直滚动
+      .scrollBar(BarState.Auto)
+      .width('93%')
+      .height('84%')
+    }
+    .width('100%')
+    .height('100%')
+  }
+
+}

+ 23 - 0
entry/src/main/ets/viewmodel/OperationItem.ets

@@ -0,0 +1,23 @@
+// 工序物料信息
+export default class OperationItem {
+  // 工序id
+  operationId?: string;
+  // 物料编码
+  itemCode?: string;
+  // 物料名称
+  itemName?: string;
+  // 物料规格
+  itemModel?: string;
+  // 所需数量
+  num?: number;
+  // 实际数量(生产过程-已采集数量)
+  realNum?: number;
+  // 需求数量(生产过程)
+  needNum?: number;
+  // 单位
+  unit?: string;
+  // 齐套数量
+  kitNum?: number;
+  // 入库数量
+  storageNum?: number;
+}

+ 4 - 0
entry/src/main/ets/viewmodel/RequestParamModel.ets

@@ -54,6 +54,10 @@ export default class RequestParamModel {
   name?: string;
   //资产编号
   propertyCode?: string;
+  //流转卡号/序列号
+  seqNo?: string;
+  //生产过程id
+  processId?: string;
   //载具通用性
   universal?: number;
   // 分页参数-第几页

entry/src/main/resources/base/media/order_complete.png → entry/src/main/resources/base/media/process_complete_test.png


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 3
entry/src/main/resources/base/media/qr_code.svg