소스 검색

手动入库更改

dengrui 4 달 전
부모
커밋
5daa2a23ac
2개의 변경된 파일91개의 추가작업 그리고 42개의 파일을 삭제
  1. 15 10
      entry/src/main/ets/pages/RobotErrorHandle.ets
  2. 76 32
      entry/src/main/ets/view/ManualWarehousing.ets

+ 15 - 10
entry/src/main/ets/pages/RobotErrorHandle.ets

@@ -651,11 +651,13 @@ export struct RobotErrorHandle {
                 option: 'mainPower'
               } as RequestParam);
               console.log('机器人开机:' + res.toString());
+              delayExecution(async () => {
               res = await RobotErrorHandleRequest.post('/api/v1/wcs/rgv/rgvPowerOn', {
                 rgvNo: this.robots[this.selectRobot].robotCode,
                 option: 'mcu'
               } as RequestParam);
               console.log('机器人开机:' + res.toString());
+              }, 5000);
             }, 5000);
             this.reminds = '机器人开机'
             this.remindController.open()
@@ -717,16 +719,19 @@ export struct RobotErrorHandle {
                   option: 'mainPower'
                 } as RequestParam);
                 console.log('机器人关机:' + res.toString());
-                res = await RobotErrorHandleRequest.post('/api/v1/wcs/rgv/rgvPowerOff', {
-                  rgvNo: this.robots[this.selectRobot].robotCode,
-                  option: 'mcu'
-                } as RequestParam);
-                console.log('机器人关机:' + res.toString());
-                this.reminds = '机器人关机';
-                this.remindController.open();
-                delayExecution(() => {
-                  this.remindController.close();
-                }, 2000);
+
+                delayExecution(async() => {
+                  res = await RobotErrorHandleRequest.post('/api/v1/wcs/rgv/rgvPowerOff', {
+                    rgvNo: this.robots[this.selectRobot].robotCode,
+                    option: 'mcu'
+                  } as RequestParam);
+                  console.log('机器人关机:' + res.toString());
+                  this.reminds = '机器人关机';
+                  this.remindController.open();
+                  delayExecution(() => {
+                    this.remindController.close();
+                  }, 2000);
+                }, 5000);
               }, 5000);
             }, 5000);
           }

+ 76 - 32
entry/src/main/ets/view/ManualWarehousing.ets

@@ -238,8 +238,8 @@ export struct ManualWarehousing {
 
     if (res && res.length && res.length > 0) {
       this.MaterialInformation = res
+      console.log('dyy',JSON.stringify(res))
     }
-
   }
   // 清空的按钮调用这个方法
   clearData = () => {
@@ -468,14 +468,17 @@ export struct ManualWarehousing {
                         Text(item.materialName)
                           .fontWeight(FontWeight.Medium)// Text(item.materialCode)
                           .fontSize($r('app.float.fontSize_24'))
+                        Text(item.materialCode)
+                          .fontWeight(FontWeight.Medium)
+                          .fontSize($r('app.float.fontSize_24'))
                         Text(item.spec)
                           .fontColor("#666666")
                           .fontWeight(FontWeight.Regular)
                           .fontSize($r('app.float.fontSize_20'))
-                        Text(item.type)
-                          .fontColor("#666666")
-                          .fontWeight(FontWeight.Regular)
-                          .fontSize($r('app.float.fontSize_20'))
+                        // Text(item.type)
+                        //   .fontColor("#666666")
+                        //   .fontWeight(FontWeight.Regular)
+                        //   .fontSize($r('app.float.fontSize_20'))
                         Row() {
                           Text(item.num?.toString())
                             .fontWeight(FontWeight.Bold)
@@ -776,6 +779,43 @@ export struct ManualWarehousing {
   }
 }
 
+@Component
+struct TextInputExample {
+  @Link exchangeNumber: number
+  @Link index: number
+  @Link num: number
+  @Link private MaterialInformation: Array<MaterialInformationModel>
+  controller: TextInputController = new TextInputController()
+
+  build() {
+    TextInput({ text:this.num.toString(), controller: this.controller })
+      .fontSize($r('app.float.title_font_size'))
+      .fontWeight(FontWeight.Bold)
+      .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
+      .height('85%')
+      .width('60%')
+      .textAlign(TextAlign.Center)
+      .backgroundColor($r('app.color.general_card_background_color'))
+      .borderRadius(0)
+      .border({ width: 0.8 })
+      .onChange((newValue: string) => {
+        this.num = Number(newValue)
+        this.MaterialInformation[this.index] = {
+          taskId: this.MaterialInformation[this.index].taskId!,
+          materialName: this.MaterialInformation[this.index].materialName!,
+          // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber!,
+          exchangeNumber: this.exchangeNumber,
+          num: this.num,
+          materialCode: this.MaterialInformation[this.index].materialCode!,
+          batchCode: this.MaterialInformation[this.index].batchCode!,
+          seqNo: this.MaterialInformation[this.index].seqNo!,
+          spec: this.MaterialInformation[this.index].spec!,
+        }
+        console.log('dyy',this.num)
+      })
+  }
+}
+
 @CustomDialog
   ///无批次号物料详情弹窗
 struct materialDetails {
@@ -832,7 +872,7 @@ struct materialDetails {
               .textAlign(TextAlign.Start)
               .fontColor('#99000000')
               .width('100%')
-            Text('规格描述:' + this.materialModel)
+            Text('规格型号:' + this.materialModel)
               .fontSize($r('app.float.robot_state_font_size'))
               .textAlign(TextAlign.Start)
               .fontColor('#99000000')
@@ -842,14 +882,12 @@ struct materialDetails {
                 .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 })
 
@@ -888,30 +926,36 @@ struct materialDetails {
                     spec: this.MaterialInformation[this.index].spec,
                   }
                 })
-              TextInput({ text: this.num?.toString() })
-                .fontSize($r('app.float.title_font_size'))
-                .fontWeight(FontWeight.Bold)
-                .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
-                .height('85%')
-                .width('60%')
-                .type(InputType.Number)
-                .textAlign(TextAlign.Center)
-                .backgroundColor($r('app.color.general_card_background_color'))
-                .borderRadius(0)
-                .border({ width: 0.8 })
-                .onChange(() => {
-                  this.MaterialInformation[this.index] = {
-                    taskId: this.MaterialInformation[this.index].taskId!,
-                    materialName: this.MaterialInformation[this.index].materialName!,
-                    // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber!,
-                    exchangeNumber: this.exchangeNumber,
-                    num: this.num,
-                    materialCode: this.MaterialInformation[this.index].materialCode!,
-                    batchCode: this.MaterialInformation[this.index].batchCode!,
-                    seqNo: this.MaterialInformation[this.index].seqNo!,
-                    spec: this.MaterialInformation[this.index].spec!,
-                  }
-                })
+              TextInputExample({
+                MaterialInformation:this.MaterialInformation,
+                num:this.num,
+                exchangeNumber:this.exchangeNumber,
+                index:this.index
+              })
+              // TextInput({ text:this.num.toString() })
+              //   .fontSize($r('app.float.title_font_size'))
+              //   .fontWeight(FontWeight.Bold)
+              //   .fontColor($r('app.color.general_font_color'))// .opacity($r('app.float.general_font_opacity'))
+              //   .height('85%')
+              //   .width('60%')
+              //   .textAlign(TextAlign.Center)
+              //   .backgroundColor($r('app.color.general_card_background_color'))
+              //   .borderRadius(0)
+              //   .border({ width: 0.8 })
+              //   .onChange(() => {
+              //     this.MaterialInformation[this.index] = {
+              //       taskId: this.MaterialInformation[this.index].taskId!,
+              //       materialName: this.MaterialInformation[this.index].materialName!,
+              //       // exchangeNumber:this.MaterialInformation[this.index].exchangeNumber!,
+              //       exchangeNumber: this.exchangeNumber,
+              //       num: this.num,
+              //       materialCode: this.MaterialInformation[this.index].materialCode!,
+              //       batchCode: this.MaterialInformation[this.index].batchCode!,
+              //       seqNo: this.MaterialInformation[this.index].seqNo!,
+              //       spec: this.MaterialInformation[this.index].spec!,
+              //     }
+              //   })
+
 
               Image($r('app.media.add_disabled'))
                 .width(px2vp(120))