瀏覽代碼

页面bug修改

dengrui 3 月之前
父節點
當前提交
78686de9aa

+ 1 - 0
entry/src/main/ets/model/MaterialInformation.ets

@@ -5,6 +5,7 @@ export interface MaterialInformationModel {
   exchangeNumber?: number
   //物料编码
   materialCode?: string
+  materialModel?:string
   label?: string
   //订单编号
   taskId?: string

+ 219 - 13
entry/src/main/ets/pages/RobotErrorHandle.ets

@@ -4,6 +4,7 @@ import MechanicalArmDebuggingRequest from '../common/util/request/MechanicalArmD
 import RobotInfo from '../model/RobotInfo'
 import RequestParam from '../viewmodel/RobotErrorHandle/RequestParam'
 import router from '@ohos.router'
+import promptAction from '@ohos.promptAction'
 @Entry
 @Component
 export struct RobotErrorHandle {
@@ -15,7 +16,7 @@ export struct RobotErrorHandle {
   @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 colorArray: number[] = [1,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'
   @State robotArray: Array<SelectOption> = []
@@ -54,7 +55,16 @@ export struct RobotErrorHandle {
     autoCancel: true,
     customStyle: true,
   })
-
+  //坐标移动小车控制器
+  setRobotByXYController: CustomDialogController = new CustomDialogController({
+    builder: SetRobotByXYDialog({
+      robots: this.robots,
+      selectRobot: this.selectRobot,
+    }),
+    alignment: DialogAlignment.Center,
+    autoCancel: true,
+    customStyle: true,
+  })
   /*handleMoveErrorController: CustomDialogController = new CustomDialogController({
     builder: HandleMoveErrorDialog({
       robots: this.robots,
@@ -141,10 +151,9 @@ export struct RobotErrorHandle {
 
         Divider().vertical(true).color($r('app.color.black_100')).height('80%')
           .margin({right: '2%'})
-
         Row() {
           Column() {
-            Text('设置小车位置')
+            Text('坐标移动小车')
               .fontSize($r('app.float.robot_set_font_size'))
               .fontWeight(FontWeight.Medium)
               .margin({left: '10%'})
@@ -152,27 +161,28 @@ export struct RobotErrorHandle {
           .width('70%')
 
           Column() {
-            Image($r('app.media.coordinate_edit'))
+            Image($r('app.media.single_move'))
               .width('55px')
               .height('55px')
           }
           .width('30%')
         }
-        .width('20%')
+        .width('15%')
         .height('60%')
-        .backgroundColor(this.colorArray[0] == 1 ? $r('app.color.process_divider_white_color') : $r('app.color.process_nameplate_grey_color'))
+        .backgroundColor(this.colorArray[14] == 1 ? $r('app.color.process_divider_white_color') : $r('app.color.process_nameplate_grey_color'))
         .alignItems(VerticalAlign.Center)
         .justifyContent(FlexAlign.End)
         .borderRadius($r('app.float.process_call_image_radius'))
         .margin({right: '2%' })
         .onClick(async ()=>{
-          this.colorArray[0] = 2
+          this.colorArray[14] = 2
           delayExecution(()=>{
-            this.colorArray[0] = 1
+            this.colorArray[14] = 1
           }, 100)
-          this.setRobotLocationController.open()
+          this.setRobotByXYController.open()
         })
 
+
         Row() {
           Column() {
             Text('查询小车位置')
@@ -189,7 +199,7 @@ export struct RobotErrorHandle {
           }
           .width('30%')
         }
-        .width('20%')
+        .width('15%')
         .height('60%')
         .backgroundColor(this.colorArray[1] == 1 ? $r('app.color.process_divider_white_color') : $r('app.color.process_nameplate_grey_color'))
         .alignItems(VerticalAlign.Center)
@@ -236,7 +246,7 @@ export struct RobotErrorHandle {
           }
           .width('30%')
         }
-        .width('20%')
+        .width('15%')
         .height('60%')
         .backgroundColor(this.colorArray[12] == 1 ? $r('app.color.process_divider_white_color') : $r('app.color.process_nameplate_grey_color'))
         .alignItems(VerticalAlign.Center)
@@ -296,7 +306,7 @@ export struct RobotErrorHandle {
           }
           .width('30%')
         }
-        .width('20%')
+        .width('15%')
         .height('60%')
         .backgroundColor(this.colorArray[13] == 1 ? $r('app.color.process_divider_white_color') : $r('app.color.process_nameplate_grey_color'))
         .alignItems(VerticalAlign.Center)
@@ -311,7 +321,36 @@ export struct RobotErrorHandle {
           this.RobotSingleMoveController.open()
         })
 
+        Row() {
+          Column() {
+            Text('设置小车位置')
+              .fontSize($r('app.float.robot_set_font_size'))
+              .fontWeight(FontWeight.Medium)
+              .margin({left: '10%'})
+          }
+          .width('70%')
 
+          Column() {
+            Image($r('app.media.coordinate_edit'))
+              .width('55px')
+              .height('55px')
+          }
+          .width('30%')
+        }
+        .width('15%')
+        .height('60%')
+        .backgroundColor(this.colorArray[0] == 1 ? $r('app.color.process_divider_white_color') : $r('app.color.process_nameplate_grey_color'))
+        .alignItems(VerticalAlign.Center)
+        .justifyContent(FlexAlign.End)
+        .borderRadius($r('app.float.process_call_image_radius'))
+        .margin({right: '2%' })
+        .onClick(async ()=>{
+          this.colorArray[0] = 2
+          delayExecution(()=>{
+            this.colorArray[0] = 1
+          }, 100)
+          this.setRobotLocationController.open()
+        })
       }
       .height('22%')
       .width('100%')
@@ -1405,6 +1444,173 @@ struct SetRobotLocationDialog {
   }
 }
 
+//坐标移动小车位置弹窗
+@CustomDialog
+struct SetRobotByXYDialog {
+  controller: CustomDialogController
+
+  @Link robots: RobotInfo[]
+  @Link selectRobot: number
+
+  @State robotX: number = 0
+  @State robotY: number = 0
+  @State tempSelect: number = 1
+  @State robotArray: Array<SelectOption> = []
+  aboutToAppear(): void {
+    this.tempSelect = this.selectRobot
+    if (this.robots && this.robots.length > 0) {
+      for (const robot of this.robots ) {
+        let option: SelectOption = { value: robot.robotCode ? robot.robotCode : ''}
+        this.robotArray.push(option)
+      }
+    }
+  }
+
+  build() {
+    Column() {
+      Row(){
+        Text('坐标移动小车')
+          .fontWeight(FontWeight.Medium)
+          .fontSize($r('app.float.fontSize_50'))
+      }
+      .height('20%')
+
+      Row() {
+        Text('机器人:')
+          .fontWeight(FontWeight.Medium)
+          .fontSize($r('app.float.fontSize_18'))
+          .width('20%')
+          .height('100%')
+          .textAlign(TextAlign.End)
+        Select(this.robotArray)
+          .selected(this.selectRobot)
+          .value(this.robots && this.robots[this.selectRobot] && this.robots[this.selectRobot].robotCode ? this.robots[this.selectRobot].robotCode : '')
+          .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('60%')
+          .height('100%')
+          .backgroundColor($r('app.color.robot_set_coord_card_grey'))
+          .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) => {
+            console.log('hhtest', index);
+            this.tempSelect = index
+          })
+      }
+      .width('80%')
+      .height('15%')
+      .justifyContent(FlexAlign.Center)
+
+      Row(){
+        Text('X轴:')
+          .fontWeight(FontWeight.Medium)
+          .fontSize($r('app.float.fontSize_18'))
+          .width('20%')
+          .height('100%')
+          .textAlign(TextAlign.End)
+        TextInput({ placeholder: '请输入数字', text: this.robotX + ''})
+          .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.robotX = parseInt(value)
+          })
+      }
+      .width('80%')
+      .height('15%')
+      .justifyContent(FlexAlign.Center)
+
+      Row(){
+        Text('Y轴:')
+          .fontWeight(FontWeight.Medium)
+          .fontSize($r('app.float.fontSize_18'))
+          .width('20%')
+          .height('100%')
+          .textAlign(TextAlign.End)
+        TextInput({ placeholder: '请输入数字', text: this.robotY + ''})
+          .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.robotY = parseInt(value)
+          })
+      }
+      .width('80%')
+      .height('15%')
+      .justifyContent(FlexAlign.Center)
+
+      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()
+          })
+        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(async() => {
+            this.selectRobot = this.tempSelect
+            promptAction.showToast({
+              message: "任务进行中,请等待....",
+              duration: 1800,
+              bottom: '50%'
+            })
+            this.controller?.close()
+            let res: object = await RobotErrorHandleRequest.post('/api/v1/wcs/rgv/movergv', {
+              rgvNo: this.robots[this.selectRobot].robotCode,
+              destX: this.robotX.toString(),
+              destY: this.robotY.toString()
+            } as RequestParam)
+            console.log('移动机器人位置:' + res.toString())
+          })
+      }
+      .justifyContent(FlexAlign.Center)
+      .height('25%')
+      .width('100%')
+
+    }
+    .width('48%')
+    .height('74%')
+    .backgroundColor($r('app.color.page_general_background'))
+    .justifyContent(FlexAlign.SpaceBetween)
+    .borderRadius($r('app.float.general_border_radius'))
+  }
+}
 //处理移动错误弹窗
 /*@CustomDialog
 struct HandleMoveErrorDialog {

+ 27 - 8
entry/src/main/ets/view/ManualWarehousing.ets

@@ -43,6 +43,7 @@ export struct ManualWarehousing {
   // 中间输入框绑定的值
   @State scanCodeValue: string = ""
   @State materialNo: string = ''
+  @State materialModel: string =''
   //1:抽屉在料格内 0:抽屉在料格外
   @State drawerPositionStatus: number = 1
   //入库口料格状态(1:有料箱 0:无料箱)
@@ -118,6 +119,7 @@ export struct ManualWarehousing {
     }
 
     this.MaterialInformation = [...toPushArray]
+
   }
   //RFID卡读取失败弹窗
   RfidCarController: CustomDialogController = new CustomDialogController({
@@ -137,7 +139,8 @@ export struct ManualWarehousing {
       num: this.num,
       seqNo: this.seqNo,
       spec: this.spec,
-      materialNo: this.materialNo
+      materialNo: this.materialNo,
+      materialModel:this.materialModel
     }),
     alignment: DialogAlignment.Bottom,
     gridCount: 4,
@@ -149,6 +152,9 @@ export struct ManualWarehousing {
       stanCode: CommonConstants.STATION_CODE
     } as RequestParamModel)
     this.recentlyRecordObject = res
+    if(!this.recentlyRecordObject.rfid){
+      this.boxMaterials = []
+    }
     this.materialGridStatus = 0
     if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
       this.materialGridStatus = 1
@@ -530,6 +536,7 @@ export struct ManualWarehousing {
                       this.batchCode = item.batchCode!
                       this.materialName = item.materialName!
                       this.materialNo = item.materialCode!
+                      this.materialModel = item.materialModel!
                       this.num = item.num!
                       this.seqNo = item.seqNo!
                       this.spec = item.spec!
@@ -780,6 +787,7 @@ struct materialDetails {
   @Link seqNo: string
   @Link spec: string
   @Link materialNo: string
+  @Link materialModel: string
   @Link private MaterialInformation: Array<MaterialInformationModel>
   scroller: Scroller = new Scroller()
   @State navigation: number = 0
@@ -824,18 +832,29 @@ struct materialDetails {
               .textAlign(TextAlign.Start)
               .fontColor('#99000000')
               .width('100%')
-            Text('规格描述' + this.spec)
+            Text('规格描述:' + this.materialModel)
               .fontSize($r('app.float.robot_state_font_size'))
               .textAlign(TextAlign.Start)
               .fontColor('#99000000')
               .width('100%')
-            Text('批次号:' + this.batchCode)
-              .fontSize($r('app.float.robot_state_font_size'))
-              .textAlign(TextAlign.Start)
-              .fontColor('#99000000')
-              .width('100%')
-              .textOverflow({ overflow: TextOverflow.Ellipsis })
+            Row(){
+              Text('批次号:')
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+
+                .maxLines(1)
+                .textOverflow({ overflow: TextOverflow.Ellipsis })
+              Text(this.batchCode)
+                .fontSize($r('app.float.robot_state_font_size'))
+                .textAlign(TextAlign.Start)
+                .fontColor('#99000000')
+
+                .maxLines(1)
+                .textOverflow({ overflow: TextOverflow.Ellipsis })
 
+            }
+            .padding({right:px2vp(40)})
 
           }.width('80%')
           .height('30%')

+ 2 - 0
entry/src/main/ets/viewmodel/RobotErrorHandle/RequestParam.ets

@@ -9,4 +9,6 @@ export default class RequestParamModel {
   option?: string
   level?: string
   action?: string
+  destX?:string
+  destY?:string
 }