Procházet zdrojové kódy

增加出入库调试

cjb před 2 měsíci
rodič
revize
17a4d44402

+ 5 - 4
entry/src/main/ets/component/InBoundView.ets

@@ -204,7 +204,7 @@ export struct InBoundView {
             .fontSize($r('app.float.fontSize_30'))
             .fontColor($r('app.color.0A84FF'))
         }
-        .width('45%')
+        .width('48%')
         .height('100%')
         .backgroundColor($r('app.color.20FFFFFF'))
         .borderRadius($r('app.float.virtualSize_16'))
@@ -232,7 +232,8 @@ export struct InBoundView {
             .fontSize($r('app.float.fontSize_30'))
             .fontColor($r('app.color.0A84FF'))
         }
-        .width('45%')
+        .width('48%')
+        .margin({left:'4%'})
         .height('100%')
         .backgroundColor($r('app.color.20FFFFFF'))
         .borderRadius($r('app.float.virtualSize_16'))
@@ -258,7 +259,7 @@ export struct InBoundView {
       .width('95%')
       .height('6%')
       .margin({ top: '2%' })
-      .justifyContent(FlexAlign.SpaceAround)
+      .justifyContent(FlexAlign.Start)
       .alignItems(VerticalAlign.Top)
 
       Button({ type: ButtonType.Normal }) {
@@ -267,7 +268,7 @@ export struct InBoundView {
           .fontColor($r('app.color.0A84FF'))
       }
       .margin({ top: '9%' })
-      .width('90%')
+      .width('95%')
       .height('6%')
       .backgroundColor($r('app.color.20FFFFFF'))
       .borderRadius($r('app.float.virtualSize_16'))

+ 61 - 1
entry/src/main/ets/component/NavigationBar.ets

@@ -2,6 +2,9 @@ import router from '@ohos.router';
 import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
 import {MaterialNotificationDialog,MaterialRequestDialog} from '../view/wms/CallMaterialNotification'
 import {WarehousingLogDialog} from '../view/wms/WarehousingLog'
+import {InBoundView} from '../component/InBoundView'
+import MaterialInfo from '../viewmodel/wms/MaterialInfo';
+
 @Component
 export struct NavigationBar {
   @Prop notificationNumber: number = 2;
@@ -75,6 +78,13 @@ export struct NavigationBar {
     maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
   })
 
+  InAndOutBoundController: CustomDialogController = new CustomDialogController({
+    builder: InAndOutBoundDialog(),
+    autoCancel: true, // 点击遮罩关闭
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
+  })
+
 
   searchRequestMaterial= () => {
     this.MaterialRequestController.open()
@@ -135,10 +145,60 @@ export struct NavigationBar {
             url: 'pages/RgvControl'
           })
         })
+      Image($r('app.media.navigation_in_out_bound'))
+        .width($r('app.float.virtualSize_56'))
+        .height($r('app.float.virtualSize_56'))
+        .fillColor($r('app.color.FFFFFF'))
+        .onClick(()=>{
+        this.InAndOutBoundController.open()
+        })
     }
     .height('100%')
     .width('100%')
     .justifyContent(FlexAlign.SpaceEvenly)
     .alignItems(VerticalAlign.Top)
   }
-}
+}
+
+
+// 确认框
+@CustomDialog
+export struct InAndOutBoundDialog {
+  @State materialNum: number=0
+  @State scanMaterialList: MaterialInfo[] = []
+  controller: CustomDialogController
+  onConfirm: () => void = () => {}
+
+  build() {
+    Column() {
+
+      InBoundView({
+        materialNum:this.materialNum,
+        boxMaterials:this.scanMaterialList
+      }).height('93%')
+      Column() {
+        Divider()
+          .vertical(false)
+          .strokeWidth(1)
+          .color($r('app.color.15FFFFFF'))
+        Row() {
+            Text('关闭')
+              .fontColor($r('app.color.60FFFFFF'))
+              .fontSize($r('app.float.fontSize_30'))
+        }
+        .justifyContent(FlexAlign.Center)
+        .alignItems(VerticalAlign.Center)
+        .width('100%')
+        .height('100%')
+        .onClick(() => this.controller.close())
+      }
+      .width('100%')
+      .height('7%')
+    }
+    .height('80%')
+    .width('30%')
+    .backgroundColor($r('app.color.2A2A2A'))
+    .justifyContent(FlexAlign.End)
+    .borderRadius(16)
+  }
+}

+ 17 - 5
entry/src/main/ets/pages/Menu.ets

@@ -24,7 +24,7 @@ struct menu {
   @State outBoundOrders: BoundOrder[]=[]
   @State loginName: string = 'admin'
   @State password: string = '123456'
-
+@State isConnected:boolean=false
 
   loadOrders = async (type: number, targetArray: BoundOrder[]) => {
     const pages = await WmsRequest.post('/api/v1/wmsOrder/page', { type } as RequestParamModel) as PageRes;
@@ -57,8 +57,8 @@ struct menu {
     };
     try {
       MqttManager.init(clientOptions);
-      const isConnected = await MqttManager.connect(connectOptions);
-      if (isConnected) {
+      this.isConnected = await MqttManager.connect(connectOptions);
+      if (this.isConnected ) {
         console.info(TAG, 'MQTT connected successfully');
         await MqttManager.subscribe('station100/data/devices');
       } else {
@@ -119,8 +119,20 @@ struct menu {
   }
 
   async aboutToAppear() {
-    this.loginWms();
-    this.connectMQTT();
+    //this.connectMQTT();
+    //this.loginWms();
+    const checkInterval = setInterval(() => {
+      if (CommonConstants.AUTH_TOKEN!='') {
+        clearInterval(checkInterval);  // 停止轮询
+        setTimeout(() => {
+          this.connectMQTT();
+        }, 1000);
+        return
+      }
+      this.loginWms();
+    }, 2000); // 每500毫秒检查一次
+
+   // this.loginWms();
 
     // 查询数据字典放到CommonConstants的DICT_DATA变量中
     // let res: DictInfo[] = await WmsRequest.post('/api/v1/sys/dictData/all',)

+ 0 - 1
entry/src/main/ets/view/wms/CallMaterialNotification.ets

@@ -103,7 +103,6 @@ export struct MaterialNotificationDialog {
   }
 
   async aboutToAppear() {
-    console.info("testtag1+11111")
     this.workOrders = this.workOrders
       .slice()
       .sort((a) => a.workOrderState === "已完成" ? 1 : -1);

+ 1 - 1
entry/src/main/module.json5

@@ -16,7 +16,7 @@
         "name": "EntryAbility",
         "srcEntry": "./ets/entryability/EntryAbility.ts",
         "description": "$string:EntryAbility_desc",
-        "icon": "$media:icon",
+        "icon": "$media:HONDAK_LOGO",
         "label": "$string:EntryAbility_label",
         "startWindowIcon": "$media:startIcon",
         "startWindowBackground": "$color:start_window_background",

binární
entry/src/main/resources/base/media/HONDAK_LOGO.png


+ 14 - 0
entry/src/main/resources/base/media/navigation_in_out_bound.svg

@@ -0,0 +1,14 @@
+<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M44 38.5C44.8284 38.5 45.5 39.1716 45.5 40C45.5 40.8284 44.8284 41.5 44 41.5H4C3.17157 41.5 2.5 40.8284 2.5 40C2.5 39.1716 3.17157 38.5 4 38.5H44Z" fill="white"/>
+<path d="M16.5 42V40C16.5 39.1716 17.1716 38.5 18 38.5C18.8284 38.5 19.5 39.1716 19.5 40V42C19.5 42.8284 18.8284 43.5 18 43.5C17.1716 43.5 16.5 42.8284 16.5 42Z" fill="white"/>
+<path d="M10.5 42V40C10.5 39.1716 11.1716 38.5 12 38.5C12.8284 38.5 13.5 39.1716 13.5 40V42C13.5 42.8284 12.8284 43.5 12 43.5C11.1716 43.5 10.5 42.8284 10.5 42Z" fill="white"/>
+<path d="M4.5 42V40C4.5 39.1716 5.17157 38.5 6 38.5C6.82843 38.5 7.5 39.1716 7.5 40V42C7.5 42.8284 6.82843 43.5 6 43.5C5.17157 43.5 4.5 42.8284 4.5 42Z" fill="white"/>
+<path d="M22.5 42V40C22.5 39.1716 23.1716 38.5 24 38.5C24.8284 38.5 25.5 39.1716 25.5 40V42C25.5 42.8284 24.8284 43.5 24 43.5C23.1716 43.5 22.5 42.8284 22.5 42Z" fill="white"/>
+<path d="M28.5 42V40C28.5 39.1716 29.1716 38.5 30 38.5C30.8284 38.5 31.5 39.1716 31.5 40V42C31.5 42.8284 30.8284 43.5 30 43.5C29.1716 43.5 28.5 42.8284 28.5 42Z" fill="white"/>
+<path d="M34.5 42V40C34.5 39.1716 35.1716 38.5 36 38.5C36.8284 38.5 37.5 39.1716 37.5 40V42C37.5 42.8284 36.8284 43.5 36 43.5C35.1716 43.5 34.5 42.8284 34.5 42Z" fill="white"/>
+<path d="M40.5 42V40C40.5 39.1716 41.1716 38.5 42 38.5C42.8284 38.5 43.5 39.1716 43.5 40V42C43.5 42.8284 42.8284 43.5 42 43.5C41.1716 43.5 40.5 42.8284 40.5 42Z" fill="white"/>
+<path d="M12.5001 20.5V9.25C12.5001 8.83577 12.8359 8.5 13.2501 8.5H35.7501C36.1643 8.5 36.5001 8.83579 36.5001 9.25V31.75C36.5001 32.1642 36.1644 32.5 35.7501 32.5H26.1876C25.3592 32.5 24.6876 33.1716 24.6876 34C24.6876 34.8284 25.3592 35.5 26.1876 35.5H35.7501C37.8212 35.5 39.5001 33.8211 39.5001 31.75V9.25C39.5001 7.17894 37.8212 5.5 35.7501 5.5H13.2501C11.179 5.5 9.50014 7.17895 9.50014 9.25V20.5C9.50014 21.3284 10.1717 22 11.0001 22C11.8286 22 12.5001 21.3284 12.5001 20.5Z" fill="white"/>
+<path d="M6.00014 29.5C5.17171 29.5 4.50014 28.8284 4.50014 28C4.50014 27.1716 5.17171 26.5 6.00014 26.5H24.0001C24.8286 26.5 25.5001 27.1716 25.5001 28C25.5001 28.8284 24.8286 29.5 24.0001 29.5H6.00014Z" fill="white"/>
+<path d="M20.9464 22.3359C20.3573 21.8558 19.4886 21.8904 18.9396 22.4395C18.3906 22.9885 18.356 23.8571 18.8361 24.4463L18.9396 24.5605L22.379 28L18.9396 31.4395L18.8361 31.5537C18.356 32.1429 18.3906 33.0115 18.9396 33.5605C19.4886 34.1096 20.3573 34.1442 20.9464 33.6641L21.0607 33.5605L25.5607 29.0605C26.1465 28.4748 26.1465 27.5252 25.5607 26.9395L21.0607 22.4395L20.9464 22.3359Z" fill="white"/>
+<path d="M7.55385 22.3359C8.143 21.8558 9.01166 21.8904 9.56068 22.4395C10.1097 22.9885 10.1443 23.8571 9.6642 24.4463L9.56068 24.5605L6.12123 28L9.56068 31.4395L9.6642 31.5537C10.1443 32.1429 10.1097 33.0115 9.56068 33.5605C9.01166 34.1096 8.143 34.1442 7.55385 33.6641L7.43959 33.5605L2.93959 29.0605C2.3538 28.4748 2.3538 27.5252 2.93959 26.9395L7.43959 22.4395L7.55385 22.3359Z" fill="white"/>
+</svg>

+ 1 - 1
entry/src/main/resources/zh_CN/element/string.json

@@ -10,7 +10,7 @@
     },
     {
       "name": "EntryAbility_label",
-      "value": "label"
+      "value": "HJZX_WMS"
     }
   ]
 }