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

隐藏自动入库&&修改机器人输入框

dengrui 3 hónapja
szülő
commit
9fefb20053

+ 49 - 14
entry/src/main/ets/pages/RobotErrorHandle.ets

@@ -12,7 +12,9 @@ export struct RobotErrorHandle {
 
   @State list: Resource[] = [$r('app.media.car_preview'), $r('app.media.car_preview')]
   @State selectRobot: number = 0
-  @State HingingLevel: number = 1
+  @State HingingLevel: number = 0
+  @State HingingIndex: number = 0
+  @State HingingString: string = '原位'
   @State colorArray: number[] = [1,1,1,1,1,1,1,1,1,1,1,1,1,1]
   @State clickStatus: number[] = [1,1,1,1,1,1,1,1,1,1,1,1,1,1]
   @State reminds:string='1'
@@ -388,21 +390,54 @@ export struct RobotErrorHandle {
             .width('20%')
             .height('100%')
             .textAlign(TextAlign.End)
-          TextInput({ placeholder: '请输入数字', text: this.HingingLevel + ''})
-            .placeholderColor($r('app.color.login_text_input_placeholder_color'))
-            .placeholderFont({ size: $r('app.float.robot_set_font_size'), weight: FontWeight.Medium })
-            .fontColor($r('app.color.login_text_input_font_color'))
-            .fontWeight(FontWeight.Medium)
-            .type(InputType.Number)
-            .maxLength(6)
-            .fontSize($r('app.float.fontSize_24'))
-            .width('60%')
-            .height('100%')
-            .opacity($r('app.float.general_font_opacity'))
+          // TextInput({ placeholder: '请输入数字', text: this.HingingLevel + ''})
+          //   .placeholderColor($r('app.color.login_text_input_placeholder_color'))
+          //   .placeholderFont({ size: $r('app.float.robot_set_font_size'), weight: FontWeight.Medium })
+          //   .fontColor($r('app.color.login_text_input_font_color'))
+          //   .fontWeight(FontWeight.Medium)
+          //   .type(InputType.Number)
+          //   .maxLength(6)
+          //   .fontSize($r('app.float.fontSize_24'))
+          //   .width('60%')
+          //   .height('100%')
+          //   .opacity($r('app.float.general_font_opacity'))
+          //   .borderRadius($r('app.float.general_border_radius'))
+          //   .backgroundColor($r('app.color.robot_set_coord_card_grey'))
+          //   .onChange((value: string) => {
+          //     this.HingingLevel = parseInt(value)
+          //   })
+          Select([
+            {value:"原位"},
+            {value:"第一层"},
+            {value:"第二层"},
+            {value:"第三层"},
+            {value:"第四层"},
+            {value:"第五层"},
+            {value:"第六层"},
+            {value:"抽屉位"},
+          ])
+            .selected(this.HingingIndex)
+            .value(this.HingingString)
+            .font({ size: $r('app.float.robot_set_font_size'), weight: FontWeight.Medium})
+            .fontColor($r('app.color.black_100'))
             .borderRadius($r('app.float.general_border_radius'))
+            .width('80%')
+            .height('100%')
+            .margin({right: '5%'})
             .backgroundColor($r('app.color.robot_set_coord_card_grey'))
-            .onChange((value: string) => {
-              this.HingingLevel = parseInt(value)
+            .selectedOptionFontColor($r('app.color.blue_100'))
+            .selectedOptionFont({size: $r('app.float.fontSize_16'), weight: FontWeight.Bold})
+            .optionFontColor($r('app.color.black_100'))
+            .optionFont({size: $r('app.float.fontSize_16'), weight: FontWeight.Medium})
+            .menuAlign(MenuAlignType.START, {dx:0, dy:0})
+            .onSelect((index: number,text:string) => {
+              if(index!=7){
+                this.HingingLevel = index
+              }else{
+                this.HingingLevel = 128
+              }
+              this.HingingString = text
+              this.HingingIndex = index
             })
         }
         .width('20%')

+ 35 - 34
entry/src/main/ets/pages/Warehousing.ets

@@ -157,7 +157,7 @@ struct Warehousing {
   @State private scanStorageList: Array<ScanStorageclass> = []
   @State isHomePage: boolean = false
   //0:主动入库,1:手动入库,2:统计按钮
-  @State inboundButton: number = 0
+  @State inboundButton: number = 1
   //仓储和其他仓储点击按钮变色
   @State warehouseButton: number = 0
   //RFID卡读取失败弹窗
@@ -170,7 +170,7 @@ struct Warehousing {
   fourWidth: number = 290
   twoWidth: number = 150
   // 切换tab添加提示
-  goingToChangeTabIndex: number = 0
+  goingToChangeTabIndex: number = 1
   goingToChangeTab = (tabIndex: number) => {
 
     if (this.inboundButton == 2) {
@@ -242,23 +242,23 @@ struct Warehousing {
           .margin({ right: px2vp(24) })
 
           Row() {
-            Text('自动入库')
-              .textAlign(TextAlign.Center)
-              .borderRadius(px2vp(16))
-              .width('33%')
-              .height('100%')
-              .fontWeight(FontWeight.Medium)
-              .fontSize(px2vp(24))
-              .fontColor(this.inboundButton === 0 ? $r('app.color.black_90') : $r('app.color.black_60'))
-              .backgroundColor(this.inboundButton === 0 ? $r('app.color.process_divider_white_color') : '')
-              .onClick(() => {
-                this.goingToChangeTab(0)
-              })
-            Blank()
+            // Text('自动入库')
+            //   .textAlign(TextAlign.Center)
+            //   .borderRadius(px2vp(16))
+            //   .width('33%')
+            //   .height('100%')
+            //   .fontWeight(FontWeight.Medium)
+            //   .fontSize(px2vp(24))
+            //   .fontColor(this.inboundButton === 0 ? $r('app.color.black_90') : $r('app.color.black_60'))
+            //   .backgroundColor(this.inboundButton === 0 ? $r('app.color.process_divider_white_color') : '')
+            //   .onClick(() => {
+            //     this.goingToChangeTab(0)
+            //   })
+            // Blank()
             Text('手动入库')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width('33%')
+              .width('50%')
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2fp(24))
@@ -271,7 +271,7 @@ struct Warehousing {
             Text('统计')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width('33%')
+              .width('50%')
               .height('100%')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -280,7 +280,7 @@ struct Warehousing {
               .onClick(() => {
                 this.goingToChangeTab(2)
               })
-          }.width(px2vp(923))
+          }.width(px2vp(615))
           .borderRadius(px2vp(15))
           .height(px2vp(80))
           .backgroundColor($r('app.color.black_10'))
@@ -288,22 +288,23 @@ struct Warehousing {
         .height('8%')
         .padding({ left: px2vp(24), right: px2vp(24) })
 
-        if (this.inboundButton === 0 && this.warehouseButton === 0) {
-          //自动入库
-          IntelligentWarehousingGo({
-            scanStorageList: this.scanStorageList,
-            entranceWaiting: this.entranceWaiting,
-            ///料箱状态
-            materialBox: this.materialBox,
-            weight: this.weight,
-            binCode: this.binCode,
-            MaterialInformation: this.MaterialInformation,
-            vehicleLevel: this.vehicleLevel,
-            contraband: this.contraband,
-            automaticWarehousing: this.automaticWarehousing,
-            boxMaterials: this.boxMaterials
-          })
-        } else if (this.inboundButton === 2 && this.warehouseButton === 0) {
+        // if (this.inboundButton === 0 && this.warehouseButton === 0) {
+        //   //自动入库
+        //   IntelligentWarehousingGo({
+        //     scanStorageList: this.scanStorageList,
+        //     entranceWaiting: this.entranceWaiting,
+        //     ///料箱状态
+        //     materialBox: this.materialBox,
+        //     weight: this.weight,
+        //     binCode: this.binCode,
+        //     MaterialInformation: this.MaterialInformation,
+        //     vehicleLevel: this.vehicleLevel,
+        //     contraband: this.contraband,
+        //     automaticWarehousing: this.automaticWarehousing,
+        //     boxMaterials: this.boxMaterials
+        //   })
+        // } else
+          if (this.inboundButton === 2 && this.warehouseButton === 0) {
           //统计
           Column() {
             Statistics()