Bladeren bron

叫料页面修改

hh 1 jaar geleden
bovenliggende
commit
4c4cac5f35

+ 10 - 3
entry/src/main/ets/common/component/AddAndSubtractComp.ets

@@ -53,15 +53,21 @@ export struct AddAndSubtractComp {
             // 校验数据有效性
             if (this.lowerLimit && num < this.lowerLimit) {
               this.inputNum = this.lowerLimit
-              this.obj[this.editPropertyName] = this.inputNum
+              if (this.obj) {
+                this.obj[this.editPropertyName] = this.inputNum
+              }
               return
             } else if (this.upperLimit && num > this.upperLimit) {
               this.inputNum = this.upperLimit
-              this.obj[this.editPropertyName] = this.inputNum
+              if (this.obj) {
+                this.obj[this.editPropertyName] = this.inputNum
+              }
               return
             }
             this.inputNum = num
-            this.obj[this.editPropertyName] = this.inputNum
+            if (this.obj) {
+              this.obj[this.editPropertyName] = this.inputNum
+            }
           })
       }
       .width('50%')
@@ -89,6 +95,7 @@ export struct AddAndSubtractComp {
     }
     .width('100%')
     .height('100%')
+    .backgroundColor($r('app.color.general_card_background_color'))
     .borderWidth(1)
     .borderColor($r('app.color.general_border_black_color'))
     .borderRadius($r('app.float.general_border_radius'))

+ 1 - 1
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -62,7 +62,7 @@ export default class CommonConstants {
   // 附件地址前缀
   static FILE_URL_PREFIX : string = 'http://192.168.101.4:9000/jgfile'
 
-  // 附件地址前缀
+  // 当前登录用户id
   static USER_ID : number = 0
 
   static readonly STORAGE_TYPE: string[] =  ['电子元器件', '电路板', '结构件', '辅助材料']

+ 366 - 56
entry/src/main/ets/pages/process/CallMaterialPage.ets

@@ -1,3 +1,4 @@
+import { AddAndSubtractComp } from '../../common/component/AddAndSubtractComp'
 import { BottomOperateComp } from '../../common/component/BottomOperateComp'
 import { ProcessTitleComp } from '../../common/component/ProcessTitleComp'
 import CommonConstants from '../../common/constants/CommonConstants'
@@ -15,6 +16,7 @@ struct CallMaterialPage {
 
   @State mainMaterials: MaterialInfo[] = CommonConstants.MATERIAL_ARRAY
   @State auxMaterials: MaterialInfo[] = CommonConstants.MATERIAL_ARRAY
+  @State kittingMainMaterial: string[] = ['LX123132132', 'LX123132133', 'LX123132134', 'LX123132135']
 
   // 辅料类型选中
   @State auxSelect: number = 0
@@ -25,6 +27,31 @@ struct CallMaterialPage {
   // 辅料小类
   @State auxMaterialSubclass: string[][] = CommonConstants.AUX_MATERIAL_SUBCLASSES
 
+  selectBoxCode: string = ''
+  selectAuxMaterial: MaterialInfo = null
+
+  // 料箱详情弹窗
+  boxDetailController: CustomDialogController = new CustomDialogController({
+    builder: BoxDetailDialog({
+      boxCode: this.selectBoxCode
+    }),
+    autoCancel: true,
+    alignment: DialogAlignment.Center,
+    // gridCount: 3,
+    customStyle: true,
+  })
+
+  // 叫料确认弹窗
+  callConfirmController: CustomDialogController = new CustomDialogController({
+    builder: CallConfirmDialog({
+      auxMaterial: this.selectAuxMaterial
+    }),
+    autoCancel: true,
+    alignment: DialogAlignment.Center,
+    // gridCount: 3,
+    customStyle: true,
+  })
+
   // 叫料历史弹窗
   historyController: CustomDialogController = new CustomDialogController({
     builder: HistoryDialog({
@@ -42,7 +69,7 @@ struct CallMaterialPage {
 
       Column() {
         Row() {
-          // BOM物料/辅料切换按钮
+          // 齐套叫料/未齐套叫料/零星叫料切换按钮
           Row() {
             Row() {
               Stack() {
@@ -53,7 +80,7 @@ struct CallMaterialPage {
                     .height('100%')
                     .borderRadius($r('app.float.general_border_radius'))
                 }
-                Text('BOM物料')
+                Text('齐套叫料')
                   .fontSize($r('app.float.set_card_font_size'))
                   .fontColor($r('app.color.general_font_color'))
                   .fontWeight(FontWeight.Medium)
@@ -62,10 +89,11 @@ struct CallMaterialPage {
               .width('100%')
               .height('100%')
             }
+            .width('33.33%')
             .onClick(() => {
               this.callSwitch = 1
             })
-            .width('50%')
+
             Row() {
               Stack() {
                 if (this.callSwitch === 2) {
@@ -75,7 +103,7 @@ struct CallMaterialPage {
                     .height('100%')
                     .borderRadius($r('app.float.general_border_radius'))
                 }
-                Text('料')
+                Text('未齐套叫料')
                   .fontSize($r('app.float.set_card_font_size'))
                   .fontColor($r('app.color.general_font_color'))
                   .fontWeight(FontWeight.Medium)
@@ -84,62 +112,40 @@ struct CallMaterialPage {
               .width('100%')
               .height('100%')
             }
-            .width('50%')
+            .width('33.33%')
             .onClick(() => {
               this.callSwitch = 2
             })
+
+            Row() {
+              Stack() {
+                if (this.callSwitch === 3) {
+                  Text()
+                    .backgroundColor($r('app.color.general_card_background_color'))
+                    .width('100%')
+                    .height('100%')
+                    .borderRadius($r('app.float.general_border_radius'))
+                }
+                Text('零星叫料')
+                  .fontSize($r('app.float.set_card_font_size'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .fontWeight(FontWeight.Medium)
+                  .opacity(this.callSwitch === 2 ? $r('app.float.card_font_select_opacity') : $r('app.float.card_font_default_opacity'))
+              }
+              .width('100%')
+              .height('100%')
+            }
+            .width('33.33%')
+            .onClick(() => {
+              this.callSwitch = 3
+            })
           }
-          .width('31.6%')
+          .width('48%')
           .height('65%')
           .borderRadius($r('app.float.general_border_radius'))
           .backgroundColor($r('app.color.robot_toward_set_card_background'))
 
-          //叫料——辅料需要展示辅料类型
-          if (this.callSwitch === 2) {
-            List() {
-              ForEach(this.auxMaterialTypes, (item: string, index: number) => {
-                ListItem() {
-                  Column() {
-                    Row() {
-                      Text(item)
-                        .fontSize($r('app.float.process_card_middle_font_size'))
-                        .fontColor(this.auxSelect === index ? $r('app.color.process_card_blue_color') : $r('app.color.general_font_color'))
-                        .fontWeight(FontWeight.Medium)
-                        .opacity(this.auxSelect === index ? 1 : $r('app.float.process_step_font_opacity'))
-                    }
-                    .height('70%')
-                    .alignItems(VerticalAlign.Bottom)
-                    Blank()
-                    Row() {
-                      if (this.auxSelect === index) {
-                        Divider()
-                          .width('50%')
-                          .strokeWidth(2)
-                          .color($r('app.color.process_card_blue_color'))
-                      }
-                    }
-                    .height('20%')
-                  }
-                  .width('15%')
-                  .height('65%')
-                  .justifyContent(FlexAlign.Center)
-                  .onClick(()=> {
-                    if (this.auxSelect === index) {
-                      return
-                    }
-                    this.auxSelect = index
-                    this.subclassSelect = 0
-                  })
-                }
-              })
-            }
-            .height('100%')
-            .layoutWeight(1)
-            .listDirection(Axis.Horizontal)
-            .alignListItem(ListItemAlign.Center)
-          } else {
-            Blank()
-          }
+          Blank()
 
           Row() {
             Image($r('app.media.call_material_history'))
@@ -158,7 +164,56 @@ struct CallMaterialPage {
         .margin({left: '1.25%'})
 
         if (this.callSwitch === 1) {
-          // BOM主料 叫料页面
+          // 齐套叫料页面
+          Grid() {
+            ForEach(this.kittingMainMaterial, (item: string) => {
+              GridItem() {
+                Row() {
+                  Column({space: 5}) {
+                    Text(item)
+                      .fontSize($r('app.float.process_card_small_font_size'))
+                      .fontColor($r('app.color.general_font_color'))
+                      .opacity($r('app.float.general_font_opacity'))
+                      .fontWeight(FontWeight.Medium)
+                    Text('料箱编号')
+                      .fontSize($r('app.float.process_card_small_font_size'))
+                      .fontColor($r('app.color.general_font_color'))
+                      .opacity($r('app.float.process_step_font_opacity'))
+                      .fontWeight(FontWeight.Regular)
+                  }
+                  .width('80%')
+                  .height('100%')
+                  .justifyContent(FlexAlign.Center)
+                  .alignItems(HorizontalAlign.Start)
+
+                  Column() {
+                    Image($r('app.media.subscript_space'))
+                      .height($r('app.float.card_subscript_new_size'))
+                      .width($r('app.float.card_subscript_new_size'))
+                  }
+                  .width('20%')
+                  .height('100%')
+                  .justifyContent(FlexAlign.End)
+                  .alignItems(HorizontalAlign.End)
+                }
+                .width('96%')
+                .height('26%')
+                .borderRadius($r('app.float.general_border_radius'))
+                .backgroundColor($r('app.color.general_font_white_color'))
+                .padding({left: '5%'})
+                .onClick(()=>{
+                  this.selectBoxCode = item
+                  this.boxDetailController.open()
+                })
+              }
+            })
+          }
+          .columnsTemplate('1fr 1fr 1fr')
+          .rowsGap(10)
+          .width('100%')
+          .layoutWeight(1)
+        } else if (this.callSwitch === 2) {
+          // 未齐套叫料页面
           Grid() {
             ForEach(this.mainMaterials, (material: MaterialInfo) => {
               GridItem() {
@@ -170,8 +225,52 @@ struct CallMaterialPage {
           .rowsGap(10)
           .width('100%')
           .layoutWeight(1)
-        } else {
+        } else if (this.callSwitch === 3){
           Row() {
+            //叫料——辅料需要展示辅料类型
+            Column(){
+              List() {
+                ForEach(this.auxMaterialTypes, (item: string, index: number) => {
+                  ListItem() {
+                    Column() {
+                      Row() {
+                        Text(item)
+                          .fontSize($r('app.float.process_card_middle_font_size'))
+                          .fontColor(this.auxSelect === index ? $r('app.color.process_card_blue_color') : $r('app.color.general_font_color'))
+                          .fontWeight(FontWeight.Medium)
+                          .opacity(this.auxSelect === index ? 1 : $r('app.float.process_step_font_opacity'))
+                      }
+                      .height('70%')
+                      .alignItems(VerticalAlign.Bottom)
+                      Blank()
+                      Row() {
+                        if (this.auxSelect === index) {
+                          Divider()
+                            .width('40%')
+                            .strokeWidth(2)
+                            .color($r('app.color.process_card_blue_color'))
+                        }
+                      }
+                      .height('20%')
+                    }
+                    .width('100%')
+                    .height('10%')
+                    .justifyContent(FlexAlign.Center)
+                    .onClick(()=> {
+                      if (this.auxSelect === index) {
+                        return
+                      }
+                      this.auxSelect = index
+                      this.subclassSelect = 0
+                    })
+                  }
+                })
+              }
+              .height('100%')
+              .alignListItem(ListItemAlign.Center)
+            }
+            .width('15%')
+            .height('100%')
             Column(){
               List({space: 10}) {
                 ForEach(this.auxMaterialSubclass[this.auxSelect], (item: string, index: number) => {
@@ -204,11 +303,15 @@ struct CallMaterialPage {
                 GridItem() {
                   MaterialCard({material: material})
                 }
+                .onClick(()=>{
+                  this.selectAuxMaterial = material
+                  this.callConfirmController.open()
+                })
               })
             }
             .columnsTemplate('1fr 1fr')
             .rowsGap(10)
-            .width('68%')
+            .width('69%')
           }
           .margin({left: '1.25%'})
           .width('100%')
@@ -231,6 +334,7 @@ struct CallMaterialPage {
 struct MaterialCard {
 
   material: MaterialInfo
+
   build() {
     Column() {
       Text(this.material.materialName)
@@ -273,6 +377,132 @@ struct MaterialCard {
 }
 
 @CustomDialog
+struct BoxDetailDialog {
+
+  @State boxDetails: MaterialInfo[] = CommonConstants.MATERIAL_ARRAY
+  boxCode: string
+  controller?: CustomDialogController
+  cancel: () => void = () => {}
+  confirm: () => void = () => {}
+
+  aboutToAppear() {
+    //   todo 查询料箱详情
+  }
+
+  build() {
+    Column() {
+      Row() {
+        Text('料箱详情')
+          .fontSize($r('app.float.process_card_large_font_size'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      .height('10%')
+      .alignItems(VerticalAlign.Bottom)
+
+      Row() {
+        Text(this.boxCode)
+          .fontSize($r('app.float.process_card_small_font_size'))
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.process_step_font_opacity'))
+          .fontWeight(FontWeight.Regular)
+      }
+      .height('7.5%')
+      .alignItems(VerticalAlign.Center)
+
+      List({space: 10}) {
+        ForEach(this.boxDetails, (item: MaterialInfo)=> {
+          ListItem() {
+            Row() {
+              Column() {
+                Text(item.materialName)
+                  .fontSize($r('app.float.process_card_middle_font_size'))
+                  .fontWeight(FontWeight.Medium)
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.general_font_opacity'))
+                Text(item.materialNo && item.materialNo.length > 0 ? item.materialNo : item.batchCode)
+                  .fontSize($r('app.float.process_card_small_font_size'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.process_step_font_opacity'))
+                  .fontWeight(FontWeight.Regular)
+              }
+              .width('60%')
+              .justifyContent(FlexAlign.End)
+              .alignItems(HorizontalAlign.Start)
+              .padding({left: 14})
+
+              Row() {
+                Text(item.needNum.toString())
+                  .fontSize($r('app.float.process_card_large_font_size'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.general_font_opacity'))
+                  .fontWeight(FontWeight.Bold)
+                Text('个')
+                  .fontSize($r('app.float.process_card_small_font_size'))
+                  .fontColor($r('app.color.general_font_color'))
+                  .opacity($r('app.float.process_step_font_opacity'))
+                  .fontWeight(FontWeight.Medium)
+              }
+              .width('40%')
+              .padding({right: 14})
+              .alignItems(VerticalAlign.Bottom)
+              .justifyContent(FlexAlign.End)
+            }
+            .height('10%')
+          }
+        })
+      }
+      .height('62.6%')
+      .width('94.7%')
+      .borderRadius($r('app.float.general_border_radius'))
+      .borderStyle(BorderStyle.Dashed)
+      .borderColor($r('app.color.material_collect_border_color'))
+      .borderWidth(1)
+
+      Row() {
+        Button('取消')
+          .fontSize($r('app.float.robot_set_font_size'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.robot_set_card_blue'))
+          .width('32%')
+          .height('50%')
+          .borderRadius($r('app.float.robot_set_radius'))
+          .backgroundColor($r('app.color.robot_set_coord_card_grey'))
+          .onClick(() => {
+            this.controller.close()
+            this.cancel()
+          })
+        Row()
+          .width('2.5%')
+        Button('确认取出')
+          .fontSize($r('app.float.robot_set_font_size'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_white_color'))
+          .width('32%')
+          .height('50%')
+          .borderRadius($r('app.float.robot_set_radius'))
+          .backgroundColor($r('app.color.robot_set_card_blue'))
+          .onClick(() => {
+            if (this.controller != undefined) {
+              this.controller.close()
+              this.confirm()
+            }
+          })
+      }
+      .justifyContent(FlexAlign.Center)
+      .height('19.9%')
+      .width('100%')
+    }
+    .width('48%')
+    .height('74%')
+    .backgroundColor($r('app.color.page_general_background'))
+    .justifyContent(FlexAlign.Start)
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}
+
+@CustomDialog
 struct HistoryDialog {
 
   @State historyArray: MaterialInfo[] = CommonConstants.MATERIAL_ARRAY
@@ -361,4 +591,84 @@ struct HistoryDialog {
     .justifyContent(FlexAlign.Start)
     .borderRadius({topLeft: $r('app.float.general_border_radius'), bottomLeft: $r('app.float.general_border_radius'),})
   }
-}
+}
+
+@CustomDialog
+struct CallConfirmDialog {
+  auxMaterial: MaterialInfo
+
+  controller?: CustomDialogController
+  cancel: () => void = () => {}
+  confirm: () => void = () => {}
+
+  build() {
+    Column() {
+      Row() {
+        Text('叫料数量')
+          .fontSize($r('app.float.title_font_size'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.general_font_opacity'))
+      }
+      .height('19%')
+      .alignItems(VerticalAlign.Bottom)
+
+      Row() {
+        Text(this.auxMaterial ? this.auxMaterial.materialName : '')
+          .fontSize($r('app.float.process_card_small_font_size'))
+          .fontColor($r('app.color.general_font_color'))
+          .opacity($r('app.float.process_step_font_opacity'))
+          .fontWeight(FontWeight.Regular)
+      }
+      .height('16%')
+      .width('80%')
+      .justifyContent(FlexAlign.SpaceAround)
+      .alignItems(VerticalAlign.Center)
+
+      Row() {
+        AddAndSubtractComp({inputNum: this.auxMaterial && this.auxMaterial.storeNum > 0 ? 1 : 0, upperLimit: this.auxMaterial && this.auxMaterial.storeNum > 0 ? this.auxMaterial.storeNum : 0, lowerLimit: this.auxMaterial && this.auxMaterial.storeNum > 0 ? 1 : 0})
+      }
+      .height('25%')
+      .width('60%')
+
+      Row() {
+        Button('取消')
+          .fontSize($r('app.float.robot_set_font_size'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.robot_set_card_blue'))
+          .width('32%')
+          .height('50%')
+          .borderRadius($r('app.float.robot_set_radius'))
+          .backgroundColor($r('app.color.robot_set_coord_card_grey'))
+          .onClick(() => {
+            this.controller.close()
+            this.cancel()
+          })
+        Row()
+          .width('2.5%')
+        Button('确认')
+          .fontSize($r('app.float.robot_set_font_size'))
+          .fontWeight(FontWeight.Medium)
+          .fontColor($r('app.color.general_font_white_color'))
+          .width('32%')
+          .height('50%')
+          .borderRadius($r('app.float.robot_set_radius'))
+          .backgroundColor($r('app.color.robot_set_card_blue'))
+          .onClick(() => {
+            if (this.controller != undefined) {
+              this.controller.close()
+            }
+          })
+      }
+      .justifyContent(FlexAlign.Center)
+      .alignItems(VerticalAlign.Center)
+      .height('40%')
+      .width('100%')
+    }
+    .width('48%')
+    .height('37%')
+    .backgroundColor($r('app.color.page_general_background'))
+    .justifyContent(FlexAlign.SpaceEvenly)
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}

+ 1 - 1
entry/src/main/ets/pages/process/ProcessHome.ets

@@ -365,7 +365,7 @@ struct ProcessHome {
                 .padding({left: 12, right: 12})
                 .onClick(()=>{
                   router.pushUrl({
-                    url: 'pages/process/MaterialCirculationPage',
+                    url: 'pages/process/TemporaryStoragePage',
                   })
                 })
               }

+ 0 - 1
entry/src/main/ets/view/RobotSetView.ets

@@ -65,7 +65,6 @@ export struct RobotSetView {
     }
   }
 
-
   // 编辑机器人编码的弹窗控制器
   editCodeController: CustomDialogController = new CustomDialogController({
     builder: EditCodeDialog({

+ 2 - 8
entry/src/main/ets/view/StorageSetView.ets

@@ -187,9 +187,6 @@ export struct StorageSetView {
     })
   }
 
-  /*
-   * updateArray
-   * */
   /**
    * 更新本地数据库的仓储储位
    * @param updateArray 是否更新spaceArray(aboutToAppear调用时不更新)
@@ -475,11 +472,7 @@ export struct StorageSetView {
   }
 
   @Builder
-  displayCard($$: {
-    cardName: string,
-    displayInfo: string,
-    clickEvent?: Function
-  }) {
+  displayCard($$: { cardName: string, displayInfo: string, clickEvent?: Function }) {
     Column() {
       Row() {
         Text($$.cardName)
@@ -539,6 +532,7 @@ struct EditStorageTypeDialog {
   controller?: CustomDialogController
   cancel: () => void = () => {}
   confirm: () => void = () => {}
+
   build() {
     Column() {
       Row() {

+ 1 - 0
entry/src/main/resources/base/profile/main_pages.json

@@ -14,6 +14,7 @@
     "pages/process/ProcessStepPage",
     "pages/process/ProcessDrawingPage",
     "pages/process/StationLoadingPage",
+    "pages/process/TemporaryStoragePage",
     "pages/processAreaPackage/ProcessArea1",
     "pages/LoginPage"
   ]