Pārlūkot izejas kodu

flex布局修改

hh 2 mēneši atpakaļ
vecāks
revīzija
4b70a9fb34

+ 28 - 16
entry/src/main/ets/pages/LittleMaterialOutBound.ets

@@ -5,10 +5,10 @@ import {
   ProcessFlow,
   CommonConfirmDialog,
   RemindDialog
-} from "../component/OrderMaterialsStorageView"
+} from '../component/OrderMaterialsStorageView'
 import router from '@ohos.router';
 import { NavigationBar } from '../component/NavigationBar'
-import { TimeAndTitle } from "../component/TimeAndTitle"
+import { TimeAndTitle } from '../component/TimeAndTitle'
 import { InBoundView } from '../component/InBoundView'
 import WmsRequest from '../common/util/request/WmsRequest'
 import RequestParamModel from '../viewmodel/wms/RequestParamModel'
@@ -17,11 +17,10 @@ import HashMap from '@ohos.util.HashMap';
 import CommonConstants from '../common/constants/CommonConstants';
 import DictInfo from '../viewmodel/DictInfo';
 import RobotErrorHandleRequest from '../common/util/request/RobotErrorHandleRequest';
-import { ConfirmDialogParams, RgvInfo }  from "../viewmodel/wms/rgv/RobotsParam"
+import { ConfirmDialogParams, RgvInfo }  from '../viewmodel/wms/rgv/RobotsParam'
 import promptAction from '@ohos.promptAction';
 import VehicleInfo from '../viewmodel/wms/VehicleInfo';
 import MaterialInfo from '../viewmodel/wms/MaterialInfo';
-import { InfoRow } from '../component/RgvControlView';
 
 @Entry
 @Component
@@ -74,6 +73,15 @@ struct LittleMaterialsOutBound {
     this.materialBoxInfos = await WmsRequest.post('/api/v1/stock/groupList', {
       materialNo: this.selectMaterialCode
     } as RequestParamModel)
+    if (this.materialBoxInfos) {
+      for (const element of this.materialBoxInfos) {
+        if (element.coordinate && element.coordinate.length > 0 && element.coordinate.indexOf('-') > 0) {
+          let coors = element.coordinate.split('-');
+          element.x = parseInt(coors[0])
+          element.y = parseInt(coors[1])
+        }
+      }
+    }
   }
   // 扫码物料编码方法
   scanMaterialCodeFunc = async (itemCode: string) => {
@@ -166,7 +174,7 @@ struct LittleMaterialsOutBound {
   // 料箱出库的方法
   callBoxOutboundFunc = async () => {
     if (this.selectVehicleIndex < 0) {
-      this.reminds = "请先选择料箱"
+      this.reminds = '请先选择料箱'
       this.remindController.open()
       setTimeout(() => {
         this.remindController.close()
@@ -176,16 +184,16 @@ struct LittleMaterialsOutBound {
     //查询小车的状态
     const rgvStatusNormal = await this.queryRgvInfo()
     if(!rgvStatusNormal) {
-      this.reminds = "小车状态异常或位置错误,请检查后重试"
+      this.reminds = '小车状态异常或位置错误,请检查后重试'
       this.remindController.open()
       setTimeout(() => {
         this.remindController.close()
       }, 2000);
       return
     }
-    console.info("hhtest", this.drawerPositionStatus+"as")
+    console.info('hhtest', this.drawerPositionStatus+'as')
     if(this.drawerPositionStatus == 0) {
-      this.reminds = "抽屉未缩回,请检查后重试"
+      this.reminds = '抽屉未缩回,请检查后重试'
       this.remindController.open()
       setTimeout(() => {
         this.remindController.close()
@@ -194,7 +202,7 @@ struct LittleMaterialsOutBound {
     }
 
     if(this.materialBoxWeight > 0) {
-      this.reminds = "抽屉已有料箱,请检查后重试"
+      this.reminds = '抽屉已有料箱,请检查后重试'
       this.remindController.open()
       setTimeout(() => {
         this.remindController.close()
@@ -221,7 +229,7 @@ struct LittleMaterialsOutBound {
     }
 
     promptAction.showToast({
-      message: "箱子正在运行中....",
+      message: '箱子正在运行中....',
       duration: 1800,
       bottom: '50%'
     })
@@ -281,9 +289,9 @@ struct LittleMaterialsOutBound {
           Row() {
             ProcessFlow({
               currentStep: this.currentStep,
-              firstStepTitle: "选择物料",
-              secondStepTitle: "零星出库",
-              thirdStepTitle: "",
+              firstStepTitle: '选择物料',
+              secondStepTitle: '零星出库',
+              thirdStepTitle: '',
             })
           }
           .height('80%')
@@ -338,6 +346,9 @@ struct LittleMaterialsOutBound {
                 .justifyContent(FlexAlign.Center)
                 .borderRadius($r('app.float.virtualSize_16'))
                 .backgroundColor($r('app.color.20FFFFFF'))
+                .onClick(()=>{
+                  this.getStoreListFunc()
+                })
               }
               .height('7.3%')
               .width('70.4%')
@@ -401,7 +412,7 @@ struct LittleMaterialsOutBound {
             .borderRadius($r('app.float.virtualSize_16'))
             .justifyContent(FlexAlign.Start)
             .backgroundColor($r('app.color.10FFFFFF'))
-            Image($r("app.media.wms_arrow_right"))
+            Image($r('app.media.wms_arrow_right'))
               .height($r('app.float.virtualSize_48'))
               .width($r('app.float.virtualSize_48'))
             // 选择料箱
@@ -417,7 +428,7 @@ struct LittleMaterialsOutBound {
               .justifyContent(FlexAlign.Center)
               // 动态排列容器
               Scroll() {
-                Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start}) {
+                Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Column, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start}) {
                   ForEach(this.materialBoxInfos, (item: MaterialBoxInfo, index: number) => {
                     Column({ space: 5 }) {
                       Row() {
@@ -475,6 +486,7 @@ struct LittleMaterialsOutBound {
                     })
                   })
                 }
+                .width('100%')
               }
               .scrollable(ScrollDirection.Vertical) // 垂直滚动
               .scrollBar(BarState.Auto)
@@ -504,7 +516,7 @@ struct LittleMaterialsOutBound {
             .borderRadius($r('app.float.virtualSize_16'))
             .justifyContent(FlexAlign.Start)
             .backgroundColor($r('app.color.10FFFFFF'))
-            Image($r("app.media.wms_arrow_right"))
+            Image($r('app.media.wms_arrow_right'))
               .height($r('app.float.virtualSize_48'))
               .width($r('app.float.virtualSize_48'))
             Column() {

+ 2 - 1
entry/src/main/ets/view/wms/OperationMaterialKitTwoStep.ets

@@ -563,7 +563,7 @@ struct SelectMaterialBoxDialog {
 
       // 动态排列容器
       Scroll() {
-        Flex({ wrap: FlexWrap.Wrap, justifyContent: FlexAlign.Start }) {
+        Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Column, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start}) {
           ForEach(this.MaterialBoxInfos, (item: MaterialBoxInfo, index: number) => {
             Column({ space: 5 }) {
               Row() {
@@ -621,6 +621,7 @@ struct SelectMaterialBoxDialog {
             })
           })
         }
+        .width('100%')
       }
       .scrollable(ScrollDirection.Vertical) // 垂直滚动
       .scrollBar(BarState.Auto)