cjb 3 hafta önce
ebeveyn
işleme
3db7e402c4

+ 18 - 20
entry/src/main/ets/common/util/mqtt.ets

@@ -1,18 +1,13 @@
 // src/main/ets/utils/MqttManager.ts
 import { MqttAsync, MqttClient, MqttClientOptions, MqttConnectOptions,MqttQos, MqttMessage, MqttPublishOptions } from '@ohos/mqtt';
-import emitter from '@ohos.events.emitter';
+
 
 const TAG = 'MqttManager';
-export enum EventId {
-  MQTT_MESSAGE = 1001,
-  STATION2_SET = 1002,
-  STATION2_WEIGHT = 1003,
-  RFID1 = 1004,
-  RFID2 = 1005
-}
-// 1. 定义事件ID常量(必须为number)
+
 type MessageCallback = (topic: string, payload: string) => void;
 
+
+
 interface TagValuePair {
   tag: string;
   value: number;
@@ -74,22 +69,25 @@ class MqttManager {
       const valueJson: MQTTReceiveData = JSON.parse(payload);
       const station2Set = valueJson?.d?.find(item => item.tag === 'Station2Set')?.value;
       const station2Weight = decodeWeight(valueJson?.d?.find(item => item.tag === 'Station2Weight')?.value);
-      const rfidString = decodeRfidString(
+      //抽屉内的RFID
+      const rfidStringIn = decodeRfidString(
+        valueJson?.d?.find(item => item.tag === 'Barcode2Data1')?.value as number,
+        valueJson?.d?.find(item => item.tag === 'Barcode2Data2')?.value as number,
+        valueJson?.d?.find(item => item.tag === 'Barcode2Data3')?.value as number,
+        valueJson?.d?.find(item => item.tag === 'Barcode2Data4')?.value as number
+      );
+      //抽屉外的RFID
+      const rfidStringOut = decodeRfidString(
         valueJson?.d?.find(item => item.tag === 'RFID2Data1')?.value as number,
         valueJson?.d?.find(item => item.tag === 'RFID2Data2')?.value as number,
         valueJson?.d?.find(item => item.tag === 'RFID2Data3')?.value as number,
         valueJson?.d?.find(item => item.tag === 'RFID2Data4')?.value as number
       );
-      console.info("sssssss"+rfidString)
-      emitter.emit({
-        eventId: EventId.MQTT_MESSAGE
-      }, {
-        data: {  // 按照 EventData 接口要求包裹数据
-          station2Set: station2Set,
-          station2Weight: station2Weight,
-          rfid: rfidString
-        }
-      });
+      console.info(TAG,`抽屉内${rfidStringIn}:抽屉外${rfidStringOut}`)
+      AppStorage.SetOrCreate<number>('drawerPositionStatus', station2Set);
+      AppStorage.SetOrCreate<number>('materialBoxWeight', station2Weight);
+      AppStorage.SetOrCreate<string>('materialBoxID', rfidStringIn);
+
     } catch (e) {
       console.error("MQTT消息处理异常:", e);
     }

+ 2 - 2
entry/src/main/ets/common/util/request/WmsRequest.ets

@@ -11,9 +11,9 @@ import { printError, printRequest, printResponse, handleRes } from './Helps';
 
 
 // jiaxiaoqiang:这里要改
-const baseUrl = "http://192.168.1.3:11010/" //chuangke
+//const baseUrl = "http://192.168.1.3:11010/" //chuangke
 //const baseUrl = "http://192.168.1.174:8079"//huajing
-//const baseUrl = "http://192.168.1.3:8079"//huajing
+const baseUrl = "http://192.168.1.3:8079"//huajing
 // const baseUrl = "http://192.168.1.4:8079/" //chuangke
 const DEBUG = true //
 

+ 72 - 84
entry/src/main/ets/component/InBoundView.ets

@@ -1,27 +1,52 @@
+/*
+ * 入库台料口操作
+ * */
 import MqttManager from '../common/util/mqtt';
-import emitter from '@ohos.events.emitter';
-import {EventId,MQTTPublishData} from '../common/util/mqtt';
+import {MQTTPublishData} from '../common/util/mqtt';
 import promptAction from '@ohos.promptAction';
 import RequestParamModel from '../viewmodel/wms/RequestParamModel'
 import CommonConstants from '../common/constants/CommonConstants'
-import {MaterialListInformation,MaterialBoxInfo,outBoxClass} from '../params/MaterialInformationParam'
+import {MaterialBoxInfo} from '../params/MaterialInformationParam'
+import {RemindDialog} from "../component/OrderMaterialsStorageView"
 import WmsRequest from '../common/util/request/WmsRequest'
 import {detailsListClass} from '../viewmodel/wms/InBoundOrderInfo'
 import {CommonConfirmDialog}from "../component/OrderMaterialsStorageView"
 import {ConfirmDialogParams} from "../params/OrderMaterialsStorageParams"
-
 @Component
 export struct InBoundView {
+  //右下角抽屉日志
   @Prop messages: string[] = []
-  @State drawerPositionStatus: number = 1
-  @State materialBoxID: string = ''
+  //物料数量
+  @Link materialNum:number
+  //伸出按钮缩放
   @State putOutButtonClick :number = 1
+  //缩回按钮缩放
   @State putInButtonClick :number = 1
+  //入库按钮缩放
   @State InboundButtonClick :number = 1
+  //入库料箱物料表
   @State private boxMaterials: Array<detailsListClass> = []
-  //料箱重量
-  @State materialBoxWeight: number = 0
+  //弹窗提示内容
+  @State reminds:string = ''
+  //全局变量 料箱重量
+  @StorageLink('materialBoxWeight') materialBoxWeight: number =0;
+  //全局变量 抽屉状态
+  @StorageLink('drawerPositionStatus') drawerPositionStatus: number=1 ;
+  //全局变量 料箱ID
+  @StorageLink('materialBoxID') materialBoxID: string = '';
+  //@State materialBoxID:string = ''
+
+  //提示弹窗
+  remindController: CustomDialogController = new CustomDialogController({
+    builder: RemindDialog({
+      remind: this.reminds,}
+    ),
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.6)',
+    //autoCancel:false
+  })
 
+  //确认弹窗
   commonDialogController: CustomDialogController | null = null;
   private showConfirmDialog(params: ConfirmDialogParams) {
     if (this.commonDialogController) {
@@ -38,12 +63,13 @@ export struct InBoundView {
       }),
       cancel: () => console.log('用户取消操作'),
       customStyle: true,
+      autoCancel:false,
       maskColor: 'rgba(0,0,0,0.6)'
     });
 
     this.commonDialogController.open();
   }
-
+  //入库命令
   Warehousing = async () => {
     console.info("sssss"+this.materialBoxID)
     let res: MaterialBoxInfo[] = await WmsRequest.post("/api/v1/wmsOrder/inBox", {
@@ -62,15 +88,6 @@ export struct InBoundView {
 
   }
 
-  refreshTag=()=>{
-    emitter.on({
-      eventId: EventId.MQTT_MESSAGE
-    }, (eventData: emitter.EventData) => {
-      //this.materialBoxID = eventData?.data?.['rfid']
-      this.drawerPositionStatus = Number(eventData?.data?.['station2Set'])
-      this.materialBoxWeight = Number(eventData?.data?.['station2Weight'])
-    })
-  }
   //抽屉推出
   pushOut =()=>{
     const drawerCommand: MQTTPublishData = {
@@ -97,14 +114,7 @@ export struct InBoundView {
     MqttManager.publish('station100/cmd/devices', drawerCommand, 1, true);
   }
   aboutToAppear(): void {
-    this.refreshTag()
-    this.materialBoxID = CommonConstants.MATERIAL_BOX_ID
-    console.info("sssss"+this.materialBoxID)
-  }
-
-  aboutToDisappear(): void
-  {
-    emitter.off(EventId.MQTT_MESSAGE)
+    // this.materialBoxID = CommonConstants.MATERIAL_BOX_ID
   }
 
   build() {
@@ -153,7 +163,7 @@ export struct InBoundView {
 
           // 右上角物料信息
           Row() {
-            Text(`物料:  0`)
+            Text(`物料:${this.materialNum}`)
               .fontSize(18)
               .fontColor($r('app.color.0A84FF'))// 使用图片中的蓝色
               .fontWeight(FontWeight.Medium)
@@ -179,7 +189,7 @@ export struct InBoundView {
           .alignItems(HorizontalAlign.End)
         }
         .width('95%')
-        .height('100%') // 根据实际需求调整
+        .height('100%')
       }
       .height('67%')
       .width('100%')
@@ -190,7 +200,7 @@ export struct InBoundView {
         Button({ type: ButtonType.Normal }) {
           Text("伸出")
             .fontSize($r('app.float.fontSize_12'))
-            .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+            .fontColor($r('app.color.0A84FF'))
         }
         .width('45%')
         .height('100%')
@@ -199,7 +209,7 @@ export struct InBoundView {
         .scale({ x: this.putOutButtonClick, y: this.putOutButtonClick })
         .animation({
           duration: 200,
-          curve: Curve.Linear  // 弹性曲线更生动
+          curve: Curve.Linear
         })
         .onClick(() => {
           this.putOutButtonClick = 0.9; // 点击时缩小
@@ -218,7 +228,7 @@ export struct InBoundView {
         Button({ type: ButtonType.Normal }) {
           Text("缩回")
             .fontSize($r('app.float.fontSize_12'))
-            .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+            .fontColor($r('app.color.0A84FF'))
         }
         .width('45%')
         .height('100%')
@@ -227,7 +237,7 @@ export struct InBoundView {
         .scale({ x: this.putInButtonClick, y: this.putInButtonClick })
         .animation({
           duration: 200,
-          curve: Curve.Linear  // 弹性曲线更生动
+          curve: Curve.Linear
         })
         .onClick(() => {
           this.putInButtonClick = 0.9; // 点击时缩小
@@ -252,7 +262,7 @@ export struct InBoundView {
       Button({ type: ButtonType.Normal }) {
         Text("入库")
           .fontSize($r('app.float.fontSize_12'))
-          .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+          .fontColor($r('app.color.0A84FF'))
       }
       .margin({ top: '9%' })
       .width('90%')
@@ -262,21 +272,41 @@ export struct InBoundView {
       .scale({ x: this.InboundButtonClick, y: this.InboundButtonClick })
       .animation({
         duration: 200,
-        curve: Curve.Linear  // 弹性曲线更生动
+        curve: Curve.Linear
       })
       .onClick(() => {
         this.InboundButtonClick = 0.9; // 点击时缩小
         setTimeout(() => {
           this.InboundButtonClick = 1; // 0.2秒后恢复
-          this.showConfirmDialog({
-            title: '入库确认',
-            message: `确定要${this.materialBoxID}料箱入库吗?`,
-            onConfirm: () => {
-              this.Warehousing();
-            }
-          })
         }, 200);
-        // 按钮点击事件处理\
+
+        if(this.drawerPositionStatus == 0)
+        {
+          this.reminds = "抽屉未缩回,请检查后重试"
+          this.remindController.open()
+          setTimeout(() => {
+            this.remindController.close()
+          }, 2000);
+          return
+        }
+
+        if(this.materialBoxWeight == 0)
+        {
+          this.reminds = "未放入料箱,请检查后重试"
+          this.remindController.open()
+          setTimeout(() => {
+            this.remindController.close()
+          }, 2000);
+          return
+        }
+
+        this.showConfirmDialog({
+          title: '入库确认',
+          message: `确定要${this.materialBoxID}料箱入库吗?`,
+          onConfirm: () => {
+            this.Warehousing();
+          }
+        })
       })
     }
     .width('100%')
@@ -286,48 +316,6 @@ export struct InBoundView {
 }
 
 
-function decodeRegister(regValue: number | undefined): string {
-  if (regValue === undefined) return ''; // 处理undefined
-
-  // 确保是16位无符号整数
-  const value = regValue & 0xFFFF;
-
-  // 提取高8位和低8位
-  const highByte = (value >> 8) & 0xFF;
-  const lowByte = value & 0xFF;
-
-  // 转换为ASCII字符
-  return String.fromCharCode(highByte) + String.fromCharCode(lowByte);
-}
-
-// 完整RFID解码函数
-function decodeRfidString(
-  rfidData1?: number,
-  rfidData2?: number,
-  rfidData3?: number,
-  rfidData4?: number
-): string {
-  return [
-    decodeRegister(rfidData1),
-    decodeRegister(rfidData2),
-    decodeRegister(rfidData3),
-    decodeRegister(rfidData4)
-  ].join('');
-}
-
-function decodeWeight(regValue: number | undefined): number {
-  if (regValue === undefined) return 0; // 处理undefined
-
-  // 确保是16位无符号整数
-  const value = regValue & 0xFFFF;
-
-  // 提取高8位和低8位
-  const highByte = (value >> 8) & 0xFF;
-  const lowByte = value & 0xFF;
-
-  // 转换为ASCII字符
-  return highByte+lowByte/100
-}
 
 
 

+ 1 - 1
entry/src/main/ets/component/MenuView.ets

@@ -1,5 +1,5 @@
 import { BoundOrder} from "../params/OrderMaterialsStorageParams"
-import PageRes from '../viewmodel/wms/InBoundOrderInfo'
+
 @Component
 export struct StorageList {
   @Prop storageData: BoundOrder[] = []

+ 45 - 31
entry/src/main/ets/component/OrderMaterialsStorageView.ets

@@ -1,6 +1,9 @@
 import {DemandMaterial,OrderParams,MaterialItem,MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
 import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
+import WorkOrderMaterialInfo from "../viewmodel/wms/WorkOrderMaterialInfo"
 import {MaterialBoxInfo} from '../params/MaterialInformationParam'
+import WmsRequest from '../common/util/request/WmsRequest'
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
 @Component
 export struct ProcessFlow {
   @Prop currentStep:number =0
@@ -92,9 +95,14 @@ export struct OrderListComponent {
   private scrollerForList: Scroller = new Scroller()
   @Prop workOrders: WorkOrderInfo[] = []
   @Link selectWorkOrder: WorkOrderInfo
+  @Link materialData:WorkOrderMaterialInfo[]
   @State selectedIndex: number = -1  // 添加选中索引状态
 
-
+  queryDemandMaterial=async(workOrderCode:string)=>{
+    this.materialData = await WmsRequest.post('/api/v1/wms/workOrderMaterial/list', {
+      workOrderCode: workOrderCode,
+    } as RequestParamModel) as WorkOrderMaterialInfo[]
+  }
   // 选中回调函数
   private onSelect(index: number): void {
     this.selectedIndex = index
@@ -148,6 +156,7 @@ export struct OrderListComponent {
             .border({width:2,color:index === this.selectedIndex ? $r('app.color.2030D158'):$r('app.color.20FFFFFF')})
             .onClick(() => {
               this.onSelect(index)
+              this.queryDemandMaterial(this.selectWorkOrder.workOrderCode)
             })
           }
         })
@@ -239,17 +248,18 @@ export struct BoxGrid {
     this.selectedMaterialIndex = -1
   }
 
+
   @Link materialBoxes: MaterialBoxInfo[] ;
   @Link emptyBoxes: MaterialBoxInfo[]
   build() {
     Column() {
       if(this.isQueryMaterial){
         Grid(this.scrollerMaterial) {
-          ForEach(this.materialBoxes, (box: MaterialBox, index) => {
+          ForEach(this.materialBoxes, (box: MaterialBoxInfo, index) => {
             GridItem() {
               Column() {
                 // 订单标题(带订单号)
-                Text(`${box.name}`)
+                Text(`${box.materials?box.materials[0].materialName:''}`)
                   .fontSize($r('app.float.fontSize_12'))
                   .fontColor($r('app.color.FFFFFF'))
                   .width('100%')
@@ -257,27 +267,32 @@ export struct BoxGrid {
                   .margin({ bottom: '2%',left:'2%' })
                 // 订单详情
                 Column({ space: 3 }) {
-                  Text(`料箱编号: ${box.id}`)
+                  Text(`料箱编号: ${box.vehicleCode}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`料箱类型: ${box.boxType}`)
+                  // Text(`料箱类型: ${box.materials?box.materials[0].materialNo:''}`)
+                  //   .fontColor($r('app.color.FFFFFF'))
+                  //   .fontSize($r('app.float.fontSize_8'))
+                  //   .fontWeight(FontWeight.Lighter)
+                  //   .textAlign(TextAlign.Start)
+                  Text(`所属订单: ${box.taskNo}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`所属订单: ${box.order}`)
+                  Text(`数量: ${box.materials?box.materials[0].num:''}${box.materials?box.materials[0].unit:''}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`数量: ${box.boxNumber}`)
+                  Text(`层数: ${box.position}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`位置: ${box.position}`)
+                  Text(`坐标: ${box.locationNo}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .textAlign(TextAlign.Start)
@@ -300,6 +315,7 @@ export struct BoxGrid {
             })
             .onClick(() => {
               this.onSelectMaterial(index)
+              this.selectedMaterialBox = box
               //this.selectedMaterialBox = box.id
             })
 
@@ -480,27 +496,27 @@ export struct MaterialBoxGrid {
 @Component
 export struct MaterialList {
   private scrollerForList: Scroller = new Scroller()
-  @Prop MaterialData: DemandMaterial[] = []
+  @Prop MaterialData: WorkOrderMaterialInfo[] = []
   build() {
     Column() {
       List({scroller:this.scrollerForList}) {
-        ForEach(this.MaterialData, (item:DemandMaterial) => {
+        ForEach(this.MaterialData, (item:WorkOrderMaterialInfo) => {
           ListItem() {
             Column() {
               Row(){
-                Text(item.materialName)
+                Text(item.itemName)
                   .fontSize($r('app.float.fontSize_12'))
                   .fontColor($r('app.color.FFFFFF'))
                   .width('90%')
                   .textAlign(TextAlign.Start)
-                Text(`${item.inBoundNum}/${item.planNum}`)
+                Text(`${item.storageNum}/${item.num}`)
                   .fontSize($r('app.float.fontSize_12'))
                   .fontColor($r('app.color.FFFFFF'))
                   .width('10%')
                   .textAlign(TextAlign.End)
               }.margin({top:'1%'})
               Row(){
-                Text(`型号: ${item.materialType}`)
+                Text(`型号: ${item.itemCode}`)
                   .fontSize($r('app.float.fontSize_8'))
                   .fontColor($r('app.color.FFFFFF'))
                   .width('90%')
@@ -533,47 +549,45 @@ export struct MaterialList {
 @Component
 export struct MaterialListComponent {
   private scrollerForList: Scroller = new Scroller()
-  @Link orders: OrderParams[]
-  @State selectedIndex: number = -1  // 添加选中索引状
+  @Link ScanMaterialList: WorkOrderInfo[]
+  @Link materialNum :number
+
   // 选中回调函数
-  private onSelect(index: number): void {
-    this.selectedIndex = index
-  }
 
   build() {
     Column() { // 订单列表
       List({ space: 8,scroller:this.scrollerForList }) {
-        ForEach(this.orders, (item: OrderParams, index) => {
+        ForEach(this.ScanMaterialList, (item: WorkOrderInfo, index) => {
           ListItem() {
             Row() {
               Column(){
                 // 订单标题(带订单号)
-                Text(`${item.orderName}`)
+                Text(`${item.materialName}`)
                   .fontSize($r('app.float.fontSize_12'))
                   .fontColor($r('app.color.FFFFFF'))
                   .width('100%')
                   .textAlign(TextAlign.Start)
                 // 订单详情
                 Column({ space: 3 }) {
-                  Text(`型号: ${item.orderNo}`)
+                  Text(`型号: ${item.materialCode}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .width('100%')
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`序列号: ${item.date}`)
+                  Text(`序列号: ${item.batchNo}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .width('100%')
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`所属订单: ${item.date}`)
-                    .fontColor($r('app.color.FFFFFF'))
-                    .fontSize($r('app.float.fontSize_8'))
-                    .width('100%')
-                    .fontWeight(FontWeight.Lighter)
-                    .textAlign(TextAlign.Start)
-                  Text(`数量: ${item.date}`)
+                  // Text(`所属订单: ${item.date}`)
+                  //   .fontColor($r('app.color.FFFFFF'))
+                  //   .fontSize($r('app.float.fontSize_8'))
+                  //   .width('100%')
+                  //   .fontWeight(FontWeight.Lighter)
+                  //   .textAlign(TextAlign.Start)
+                  Text(`数量: ${item.num}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_8'))
                     .width('100%')
@@ -589,8 +603,8 @@ export struct MaterialListComponent {
                   .height($r('app.float.virtualSize_23'))
                   .fillColor($r('app.color.FF453A'))
                   .onClick(()=>{
-                    this.orders.splice(index, 1);
-
+                    this.ScanMaterialList.splice(index, 1);
+                    this.materialNum--
                   })
               }.width('10%')
             }

+ 2 - 7
entry/src/main/ets/pages/EmptyBoxStorage.ets

@@ -15,12 +15,7 @@ struct emptyBoxStorage {
   @State generateButtonClick :number = 1
   @State printButtonClick :number = 1
   @State writeButtonClick :number = 1
-  @State messages: string[] = [
-    "抽屉伸出成功                   12-12-12",
-    "抽屉伸出成功                   12-12-12",
-    "抽屉伸出成功                   12-12-12",
-    "抽屉伸出成功                   12-12-12"
-  ]
+  @State materialNum: number=0
   build() {
     Row() {
       Column() {
@@ -247,7 +242,7 @@ struct emptyBoxStorage {
             .fillColor($r('app.color.FFFFFF'))
             .margin({left:'-2%',right:'-2%'})
           Column(){
-            InBoundView({messages:this.messages});
+            InBoundView({materialNum:this.materialNum});
           }
           .width('29%')
           .height('85%')

+ 11 - 5
entry/src/main/ets/pages/LittleMaterialOutBound.ets

@@ -1,5 +1,5 @@
 /*
- * 零星物料
+ * 零星物料
  * */
 import {
   ProcessFlow,
@@ -16,15 +16,17 @@ import { InBoundView } from '../component/InBoundView'
 import WmsRequest from '../common/util/request/WmsRequest'
 import RequestParamModel from '../viewmodel/wms/RequestParamModel'
 import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
+import WorkOrderMaterialInfo from "../viewmodel/wms/WorkOrderMaterialInfo"
 
 @Entry
 @Component
 struct LittleMaterialsOutBound {
-  @State messages: string[] = []
+  @State materialNum: number=0
   @State currentStep: number = 1;
   @State nextStepButtonClick :number = 1
   @State preStepButtonClick :number = 1
   @State outBoundButtonClick :number = 1
+  @State materialData: WorkOrderMaterialInfo[] = [];
   @State emptyBoxes: EmptyBox[] = [
     { position: 'X-1Y-2' },
     { position: 'X-1Y-2' },
@@ -322,7 +324,8 @@ struct LittleMaterialsOutBound {
                   Column() {
                     OrderListComponent({
                       workOrders: this.workOrderArray,
-                      selectWorkOrder: this.selectWorkOrder }).height('100%')
+                      selectWorkOrder: this.selectWorkOrder,
+                      materialData:this.materialData}).height('100%')
                   }.margin({ top: '4%' }).height('70%')
                 }.height('100%').width('95%').justifyContent(FlexAlign.Start)
               }.width('30%').backgroundColor($r('app.color.10FFFFFF'))
@@ -409,7 +412,7 @@ struct LittleMaterialsOutBound {
           Column() {
             Row() {
               Column() {
-                InBoundView({ messages: this.messages })
+                InBoundView({ materialNum: this.materialNum })
               }.width('29%').backgroundColor($r('app.color.10FFFFFF'))
               Image($r('app.media.arrow_right'))
                 .width($r('app.float.virtualSize_23'))
@@ -447,7 +450,10 @@ struct LittleMaterialsOutBound {
                 .justifyContent(FlexAlign.Center)
 
                 Row() {
-                  MaterialListComponent({ orders: this.orders }).width('95%')
+                  MaterialListComponent({
+                    ScanMaterialList:this.orders,
+                    materialNum:this.materialNum
+                  }).width('95%')
                 }.width('100%').height('78%').justifyContent(FlexAlign.Center)
                 //Column(){
                   Button({type:ButtonType.Normal}) {

+ 6 - 3
entry/src/main/ets/pages/LittleMaterialsStorage.ets

@@ -11,7 +11,7 @@ import {MaterialListInformation,MaterialBoxInfo} from '../params/MaterialInforma
 @Entry
 @Component
 struct LittleMaterialsStorage{
-  @State messages:string[] = []
+  @State materialNum:number=0
   @State currentStep: number = 1;
   @State emptyBoxes: MaterialBoxInfo[] = []
   @State selectedMaterialBox: MaterialBoxInfo = {};
@@ -277,7 +277,10 @@ struct LittleMaterialsStorage{
                 .justifyContent(FlexAlign.Center)
 
                 Row() {
-                  MaterialListComponent({orders:this.orders}).width('95%')
+                  MaterialListComponent({
+                    ScanMaterialList:this.orders,
+                    materialNum:this.materialNum
+                  }).width('95%')
                 }.width('100%').height('90%').justifyContent(FlexAlign.Center)
               }.width('62%').backgroundColor($r('app.color.10FFFFFF'))
               Image($r('app.media.arrow_right'))
@@ -287,7 +290,7 @@ struct LittleMaterialsStorage{
                 .margin({left:'-2%',right:'-2%'})
 
               Column(){
-                InBoundView({messages:this.messages})
+                InBoundView({materialNum:this.materialNum})
               }.width('29%').backgroundColor($r('app.color.10FFFFFF'))
             }
             .height('85%')

+ 21 - 21
entry/src/main/ets/pages/Menu.ets

@@ -114,8 +114,8 @@ struct menu {
       CommonConstants.LOGIN_OUT = false
 
     }
-    this.loadOrders(1, this.inBoundOrders)
-    this.loadOrders(2, this.outBoundOrders)
+     this.loadOrders(1, this.inBoundOrders)
+     this.loadOrders(2, this.outBoundOrders)
   }
 
   async aboutToAppear() {
@@ -123,25 +123,25 @@ struct menu {
     this.connectMQTT();
 
     // 查询数据字典放到CommonConstants的DICT_DATA变量中
-    let res: DictInfo[] = await WmsRequest.post('/api/v1/sys/dictData/all',)
-    if (res && res.length > 0) {
-      for (const dict of res) {
-        CommonConstants.DICT_DATA.set(dict.dictCode, dict.list)
-      }
-    }
-    try {
-      const netHandle = connection.getDefaultNetSync();
-      if (netHandle) {
-        let connectionProperties = await connection.getConnectionProperties(netHandle)
-        if (connectionProperties && connectionProperties.linkAddresses) {
-          connectionProperties.linkAddresses.forEach((address: connection.LinkAddress, index: number) => {
-            console.info('hhtest', "get address info: " + JSON.stringify(address));
-          })
-        }
-      }
-    } catch (err) {
-      console.log('hhtest', err);
-    }
+    // let res: DictInfo[] = await WmsRequest.post('/api/v1/sys/dictData/all',)
+    // if (res && res.length > 0) {
+    //   for (const dict of res) {
+    //     CommonConstants.DICT_DATA.set(dict.dictCode, dict.list)
+    //   }
+    // }
+    // try {
+    //   const netHandle = connection.getDefaultNetSync();
+    //   if (netHandle) {
+    //     let connectionProperties = await connection.getConnectionProperties(netHandle)
+    //     if (connectionProperties && connectionProperties.linkAddresses) {
+    //       connectionProperties.linkAddresses.forEach((address: connection.LinkAddress, index: number) => {
+    //         console.info('hhtest', "get address info: " + JSON.stringify(address));
+    //       })
+    //     }
+    //   }
+    // } catch (err) {
+    //   console.log('hhtest', err);
+    // }
   }
 
 

+ 0 - 189
entry/src/main/ets/pages/OrderMaterialsStorage.ets

@@ -17,195 +17,6 @@ struct orderMaterialsStorage {
   @State selectWorkOrder:WorkOrderInfo = {}
   @State messages:string[] = []
   @State currentStep: number = 1;
-  @State emptyBoxes: EmptyBox[] = [
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' },
-    { position: 'X-1Y-2' } // 图片显示6个空箱位置
-  ]
-  @State materialBoxes: MaterialBox[] = [
-  // 第一行物料箱
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-    {
-      id: '1', type: 'material',
-      name: '物料名称XXXXX',
-      boxNumber: 'LX-12345',
-      boxType: '通用类型',
-      order: 'XXXXX订单',
-      quantity: 10,
-      position: 'X-1 Y-2'
-    },
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    }, {
-    id: '1', type: 'material',
-    name: '物料名称XXXXX',
-    boxNumber: 'LX-12345',
-    boxType: '通用类型',
-    order: 'XXXXX订单',
-    quantity: 10,
-    position: 'X-1 Y-2'
-  },
-
-    // 其他2个物料箱...
-
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-    // 第二行空箱
-    {
-      id: '4', type: 'empty',
-      name: '空箱',
-      boxNumber: 'LX-67890',
-      boxType: '通用类型',
-      position: 'X-3 Y-1'
-    },
-  // 其他2个空箱...
-  ];
-  @State orders:OrderParams[]= [
-    { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
-    { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
-    { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' },
-    { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
-    { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
-    { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' }
-  ]
-  @State materialData: DemandMaterial[] = [
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-  ];
-
   build() {
     Row() {
       Column() {

+ 54 - 6
entry/src/main/ets/pages/RgvControl.ets

@@ -1,5 +1,5 @@
 /*
- * 零星物料入库
+ * 小车控制
  * */
 import router from '@ohos.router';
 import {InfoRow} from '../component/RgvControlView'
@@ -8,6 +8,9 @@ import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
 import {RgvButton,RemindDialog,MoveControllerButton,CommonConfirmDialog,MoveDialog}from "../component/RgvControlView"
 import {RobotInfo,RgvInfo,ErrorMessage,RequestParam,ConfirmDialogParams,RobotSingleMovePost} from "../params/RobotsParam"
 import CommonConstants from '../common/constants/CommonConstants'
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
+import WmsRequest from '../common/util/request/WmsRequest'
+import {MaterialBoxInfo} from '../params/MaterialInformationParam'
 const TAG: string = 'RGV'
 @Entry
 @Component
@@ -21,7 +24,9 @@ struct RgvControl {
   @State currentStep: number = 1;
   @State selectWorkOrder: WorkOrderInfo = {}
   @State workOrderArray: WorkOrderInfo[] = []
-  @State scaleValue: number = 1;
+
+  @State cleanErrorClick: number = 1;
+  @State cleanTaskClick: number = 1;
   @State selectRobotIndex : number = 0
   @State axisNumberX : number = 0
   @State axisNumberY : number = 0
@@ -42,6 +47,12 @@ struct RgvControl {
     maskColor: 'rgba(0,0,0,0.6)',
     autoCancel:false
   })
+  //清除任务
+  cleanTask = async () => {
+    let res: MaterialBoxInfo = await WmsRequest.post("/api/v1/wmsOrder/clear", {} as RequestParamModel)
+    console.log('testTag1', '----------' + JSON.stringify(res));
+  }
+
   // rgv开机
   executePowerOn = async()=>{
     try {
@@ -387,7 +398,7 @@ struct RgvControl {
               .fontColor($r('app.color.FFFFFF'))
               .fontSize($r('app.float.fontSize_15_2'))
           }
-          .width('85%')
+          .width('75%')
           .justifyContent(FlexAlign.Start)
           .margin({ left: '3%' })
           .onClick(() => {
@@ -400,6 +411,42 @@ struct RgvControl {
                 .height('50%')
                 .margin({ right: 8 })
                 .fillColor($r('app.color.0A84FF'))
+              Text("清除任务")
+                .fontSize($r('app.float.fontSize_12'))
+                .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
+            }.justifyContent(FlexAlign.Center)
+          }
+          .width('10%')
+          .height('100%')
+          .margin({right:'2%'})
+          .backgroundColor($r('app.color.20FFFFFF'))
+          .borderRadius($r('app.float.virtualSize_6_4'))
+          .scale({ x: this.cleanTaskClick, y: this.cleanTaskClick })
+          .animation({
+            duration: 200,
+            curve: Curve.Linear  // 弹性曲线更生动
+          })
+          .onClick(() => {
+            this.cleanTaskClick = 0.9;  // 点击时缩小
+            setTimeout(() => {
+              this.cleanTaskClick = 1; // 0.2秒后恢复
+            }, 200);
+            this.showConfirmDialog({
+              title: '清除任务',
+              message: `确定要清除任务吗?`,
+              onConfirm: ()=> {
+                this.cleanTask()
+              }
+            });
+          })
+
+          Button({type:ButtonType.Normal}){
+            Row() {
+              Image($r('app.media.rgv_clean_error'))
+                .width('12%')
+                .height('50%')
+                .margin({ right: 8 })
+                .fillColor($r('app.color.0A84FF'))
               Text("清除错误")
                 .fontSize($r('app.float.fontSize_12'))
                 .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
@@ -409,15 +456,15 @@ struct RgvControl {
           .height('100%')
           .backgroundColor($r('app.color.20FFFFFF'))
           .borderRadius($r('app.float.virtualSize_6_4'))
-          .scale({ x: this.scaleValue, y: this.scaleValue })
+          .scale({ x: this.cleanErrorClick, y: this.cleanErrorClick })
           .animation({
             duration: 200,
             curve: Curve.Linear  // 弹性曲线更生动
           })
           .onClick(() => {
-            this.scaleValue = 0.9;  // 点击时缩小
+            this.cleanErrorClick = 0.9;  // 点击时缩小
             setTimeout(() => {
-              this.scaleValue = 1; // 0.2秒后恢复
+              this.cleanErrorClick = 1; // 0.2秒后恢复
             }, 200);
             this.showConfirmDialog({
               title: '清除错误',
@@ -427,6 +474,7 @@ struct RgvControl {
               }
             });
           })
+
         } .height('4%').width('100%').justifyContent(FlexAlign.Start)
 
         Row(){

+ 11 - 0
entry/src/main/ets/params/MaterialInformationParam.ets

@@ -37,10 +37,21 @@ export interface MaterialBoxInfo {
   //位置
   locationNo?: string;
   planNo?: string;
+  //层数
   position?: number;
   taskNo?: string;
   //料箱编码
   vehicleCode?: string;
+  materials?:materialsInfo[]
+}
+
+interface materialsInfo {
+  codes?:[]
+  materialName?: string,
+  materialNo?: string,
+  num?: number,
+  spec?:string
+  unit?: string
 }
 
 export interface outBoxClass {

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

@@ -23,7 +23,7 @@ export struct OperationMaterialKitTwoStep {
   // 选择已有料箱,出库料箱
   @State selectVehicleCode: string = ''
   @State houseStocks: HouseStock[] = []
-  @State messages: string[] = []
+  @State materialNum: number=0
   // 空箱编码
   @State vehicleCode: string = ''
   @State materialTotal: number = 0
@@ -311,7 +311,7 @@ export struct OperationMaterialKitTwoStep {
         .width($r('app.float.virtualSize_19_2'))
       // 出入库料口操作
       Column() {
-        InBoundView({messages:this.messages});
+        InBoundView({materialNum:this.materialNum});
       }
       .height('100%')
       .width('29.6%')

+ 4 - 24
entry/src/main/ets/view/wms/OrderMaterialStorageFirstStep.ets

@@ -3,35 +3,14 @@ import {OrderParams,DemandMaterial} from "../../params/OrderMaterialsStoragePara
 import WmsRequest from '../../common/util/request/WmsRequest'
 import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
 import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
-
+import WorkOrderMaterialInfo from "../../viewmodel/wms/WorkOrderMaterialInfo"
 
 @Component
 export struct OrderMaterialStorageFirstStep {
   @Link currentStep: number
-  @State orders:OrderParams[]= [
-    { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
-    { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
-    { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' },
-    { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
-    { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
-    { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' }
-  ]
-  @State materialData: DemandMaterial[] = [
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-    {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
-  ];
+  @State materialData: WorkOrderMaterialInfo[] = [];
 
   @Link selectWorkOrder: WorkOrderInfo
-
   @State workOrderArray: WorkOrderInfo[] = []
   @State nextStepButtonClick:number =1
 
@@ -58,7 +37,8 @@ export struct OrderMaterialStorageFirstStep {
           Row(){
             OrderListComponent({
               workOrders:this.workOrderArray,
-              selectWorkOrder: this.selectWorkOrder
+              selectWorkOrder: this.selectWorkOrder,
+              materialData:this.materialData
             }).width('95%').height('90%')
           }
         }.width('30%').backgroundColor($r('app.color.10FFFFFF'))

+ 75 - 40
entry/src/main/ets/view/wms/OrderMaterialStorageSecondStep.ets

@@ -1,12 +1,10 @@
 import {SingleOrder,BoxGrid,RemindDialog} from "../../component/OrderMaterialsStorageView"
 import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
 import WmsRequest from '../../common/util/request/WmsRequest'
-import {MaterialListInformation,MaterialBoxInfo,outBoxClass} from '../../params/MaterialInformationParam'
+import {MaterialBoxInfo,outBoxClass} from '../../params/MaterialInformationParam'
 import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
 import CommonConstants from '../../common/constants/CommonConstants'
-import promptAction from '@ohos.promptAction'
-import emitter from '@ohos.events.emitter';
-import {EventId} from '../../common/util/mqtt';
+import promptAction from '@ohos.promptAction';
 import {RgvInfo} from "../../params/RobotsParam"
 import {CommonConfirmDialog}from "../../component/OrderMaterialsStorageView"
 import {ConfirmDialogParams} from "../../params/OrderMaterialsStorageParams"
@@ -24,19 +22,11 @@ export struct OrderMaterialStorageSecondStep {
   @State isQueryMaterial: boolean = false
   @State emptyBoxes: MaterialBoxInfo[] = []
   @State materialBoxes: MaterialBoxInfo[] = []
-  @State materialBoxWeight: number = 0
   @State reminds:string='1'
-  @State drawerPositionStatus: number = 1
+  @StorageLink('materialBoxWeight') materialBoxWeight: number =0;
+  @StorageLink('drawerPositionStatus') drawerPositionStatus: number=1 ;
+  @State materialBoxID:string = ''
 
-  refreshTag=()=>{
-    emitter.on({
-      eventId: EventId.MQTT_MESSAGE
-    }, (eventData: emitter.EventData) => {
-      //this.materialBoxID = eventData?.data?.['rfid']
-      this.drawerPositionStatus = Number(eventData?.data?.['station2Set'])
-      this.materialBoxWeight = Number(eventData?.data?.['station2Weight'])
-    })
-  }
 
   remindController: CustomDialogController = new CustomDialogController({
     builder: RemindDialog({
@@ -44,21 +34,22 @@ export struct OrderMaterialStorageSecondStep {
     ),
     customStyle: true,
     maskColor: 'rgba(0,0,0,0.6)',
-    autoCancel:false
+    //autoCancel:false
   })
-  getStoreList = async () => {
-    let res: MaterialListInformation[] = await WmsRequest.post("/api/v1/stock/mergeList", {
-      houseType: "1",
-      materialNo: this.scanCodeValue,
-    } as RequestParamModel)
-    this.scanCodeValue = ''
-    console.log('qqqq' + '列表' + JSON.stringify(res))
-  }
 
-  MaterialpositionHttp = async (item: MaterialListInformation) => {
-    let res: MaterialBoxInfo[] = await WmsRequest.post("/api/v1/stock/groupList", {
-      materialName: item.materialName,
-    } as RequestParamModel);
+  getMaterialBoxList = async (currentMaterialNo: string) => {
+    this.materialBoxes = await WmsRequest.post("/api/v1/stock/groupList", {
+        materialNo: currentMaterialNo,
+      } as RequestParamModel);
+    if(this.materialBoxes.length==0){
+      this.reminds="无当前物料料箱!"
+      this.remindController.open()
+      setTimeout(() => {
+        this.remindController.close();
+      }, 2000); // 2000毫秒 = 2秒
+    }else{
+      this.isQueryMaterial = true;
+    }
   }
 
   //暂时取空箱
@@ -85,6 +76,7 @@ export struct OrderMaterialStorageSecondStep {
       }),
       cancel: () => console.log('用户取消操作'),
       customStyle: true,
+      autoCancel:false,
       maskColor: 'rgba(0,0,0,0.6)'
     });
 
@@ -107,6 +99,10 @@ export struct OrderMaterialStorageSecondStep {
           this.remindController.close(); // 关闭弹窗
         }
       }, 500); // 每500毫秒检查一次
+
+      setTimeout(() => {
+        clearInterval(checkInterval);
+      }, 300000);
       // 成功后的刷新逻辑
     } catch (error) {
       console.error("出库操作失败:", error);
@@ -131,8 +127,8 @@ export struct OrderMaterialStorageSecondStep {
 
   aboutToAppear(): void {
     this.getEmptyBox()
-    this.refreshTag();
   }
+
   build() {
     Column(){
       Row(){
@@ -160,6 +156,12 @@ export struct OrderMaterialStorageSecondStep {
                 .fontSize($r('app.float.fontSize_12'))
                 .fontColor($r('app.color.FFFFFF'))
                 .enableKeyboardOnFocus(false)
+                .onSubmit(() => {
+                  this.getMaterialBoxList(this.scanCodeValue)
+                })
+                .onChange((value: string) => {
+                  this.scanCodeValue = value
+                })
             }
             .margin({top:'3%'})
             .height('8%')
@@ -167,7 +169,7 @@ export struct OrderMaterialStorageSecondStep {
             .borderRadius($r('app.float.virtualSize_7_2'))
             .backgroundColor($r('app.color.000000'))
             // 操作说明
-            Text('通过物料扫码查询当前库存是否有同型号物')
+            Text('通过物料扫码查询当前库存是否有同型号物')
               .fontSize($r('app.float.fontSize_8'))
               .fontColor($r('app.color.60FFFFFF'))
               .width('100%')
@@ -286,20 +288,53 @@ export struct OrderMaterialStorageSecondStep {
           duration: 200,
           curve: Curve.Linear  // 弹性曲线更生动
         })
-        .onClick(() => {
+        .onClick(async() => {
           this.outBoundButtonClick = 0.9;
           setTimeout(() => {
             this.outBoundButtonClick = 1;
-            this.showConfirmDialog({
-              title: '料箱出库',
-              message: `确定要${this.selectedMaterialBox.vehicleCode}料箱出库吗?`,
-              onConfirm: ()=> {
-                this.boxOutBound();
-              }
-            });
-            CommonConstants.MATERIAL_BOX_ID = this.selectedMaterialBox.vehicleCode?this.selectedMaterialBox.vehicleCode:""
-            console.info("rgvs"+CommonConstants.MATERIAL_BOX_ID)
           }, 200);
+
+          //查询小车的状态
+          const rgvStatusNormal = await this.queryRgvInfo()
+          if(!rgvStatusNormal){
+            this.reminds = "小车状态异常或位置错误,请检查后重试"
+            this.remindController.open()
+            setTimeout(() => {
+              this.remindController.close()
+            }, 2000);
+            return
+          }
+          console.info("ssss"+this.drawerPositionStatus+"as")
+          if(this.drawerPositionStatus == 0)
+          {
+            this.reminds = "抽屉未缩回,请检查后重试"
+            this.remindController.open()
+            setTimeout(() => {
+              this.remindController.close()
+            }, 2000);
+            return
+          }
+
+          if(this.materialBoxWeight > 0)
+          {
+            this.reminds = "抽屉已有料箱,请检查后重试"
+            this.remindController.open()
+            setTimeout(() => {
+              this.remindController.close()
+            }, 2000);
+            return
+          }
+
+          //查询抽屉的状态
+          this.showConfirmDialog({
+            title: '料箱出库',
+            message: `确定要${this.selectedMaterialBox.vehicleCode}料箱出库吗?`,
+            onConfirm: ()=> {
+              this.boxOutBound();
+            }
+          });
+          CommonConstants.MATERIAL_BOX_ID = this.selectedMaterialBox.vehicleCode?this.selectedMaterialBox.vehicleCode:""
+          console.info("rgvs"+CommonConstants.MATERIAL_BOX_ID)
         })
         Button({type:ButtonType.Normal}) {
           Text("下一步")

+ 66 - 4
entry/src/main/ets/view/wms/OrderMaterialStorageThirdStep.ets

@@ -1,10 +1,17 @@
 import {MaterialListComponent} from "../../component/OrderMaterialsStorageView"
 import {OrderParams,DemandMaterial,MaterialBox, EmptyBox} from "../../params/OrderMaterialsStorageParams"
 import {InBoundView} from '../../component/InBoundView'
-
+import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
+import WmsRequest from '../../common/util/request/WmsRequest'
+import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
+import {RemindDialog} from "../../component/OrderMaterialsStorageView"
+const TAG = 'OrderInbound';
 @Component
 export struct OrderMaterialStorageThirdStep {
   @State messages:string[] = []
+  //物料数量
+  @State materialNum:number= 0
+  //当前步骤
   @Link currentStep: number
   @State orders:OrderParams[]= [
   // { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
@@ -14,8 +21,54 @@ export struct OrderMaterialStorageThirdStep {
   // { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
   // { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' }
   ]
+  @State scanCodeValue :string = ''
   @State firstStepButtonClick:number = 1
   @State preStepButtonClick:number = 1
+  @State ScanMaterialList:WorkOrderInfo[] = []
+  //提示信息
+  @State reminds:string=''
+
+  remindController: CustomDialogController = new CustomDialogController({
+    builder: RemindDialog({
+      remind: this.reminds,}
+    ),
+    customStyle: true,
+    maskColor: 'rgba(0,0,0,0.6)',
+    //autoCancel:false
+  })
+
+  //扫描物料编码
+  ScanMaterialCode = async (itemCode: string) => {
+    console.info(TAG,itemCode)
+    try{
+      this.scanCodeValue = ""
+      let res: WorkOrderInfo = await WmsRequest.post("/api/v1/process/circulation/material", {
+        label: `BM${itemCode};18*18*1-6;SL50;20240111` //"#gys022#sc022#100#20220929#31"
+      } as RequestParamModel)
+
+      const isDuplicate = this.ScanMaterialList.some(
+        item => item.materialCode === res.materialCode
+      );
+
+      if (isDuplicate) {
+        console.warn(`物料 ${res.materialCode} 已存在,无法重复添加`);
+        this.reminds="物料已存在!"
+        this.remindController.open()
+        setTimeout(() => {
+          this.remindController.close();
+        }, 2000);
+        return
+      }
+
+      // 无重复时,添加到列表
+      this.ScanMaterialList = [...this.ScanMaterialList, res];
+      this.materialNum = this.ScanMaterialList.length; // 更新物料数量统计
+
+    }catch (err) {
+      console.error(TAG, `http ScanMaterialCode failed: ${JSON.stringify(err)}`);
+    }
+  }
+
   build() {
     Column(){
       Row(){
@@ -37,13 +90,19 @@ export struct OrderMaterialStorageThirdStep {
                 .fillColor($r('app.color.FFFFFF'))
                 .margin({left:'2%'})
               // 扫码输入框
-              TextInput({ placeholder: '请扫描物料编码' })
+              TextInput({text:this.scanCodeValue,placeholder: '请扫描物料编码' })
                 .type(InputType.Normal)
                 .placeholderFont({ size: $r('app.float.fontSize_12')})
                 .placeholderColor($r('app.color.30FFFFFF'))
                 .fontSize($r('app.float.fontSize_12'))
                 .fontColor($r('app.color.FFFFFF'))
                 .enableKeyboardOnFocus(false)
+                .onSubmit(()=>{
+                  this.ScanMaterialCode(this.scanCodeValue)
+                })
+                .onChange((value: string) => {
+                  this.scanCodeValue = value
+                })
             }.width('35%')
             .borderRadius($r('app.float.virtualSize_7_2'))
             .backgroundColor($r('app.color.000000'))
@@ -53,7 +112,10 @@ export struct OrderMaterialStorageThirdStep {
           .justifyContent(FlexAlign.Center)
 
           Row() {
-            MaterialListComponent({orders:this.orders}).width('95%')
+            MaterialListComponent({
+              ScanMaterialList:this.ScanMaterialList,
+              materialNum:this.materialNum
+            }).width('95%')
           }.width('100%').height('90%').justifyContent(FlexAlign.Center)
         }.width('62%').backgroundColor($r('app.color.10FFFFFF'))
         Image($r('app.media.arrow_right'))
@@ -63,7 +125,7 @@ export struct OrderMaterialStorageThirdStep {
           .margin({left:'-2%',right:'-2%'})
 
         Column(){
-          InBoundView({messages:this.messages})
+          InBoundView({materialNum:this.materialNum})
         }.width('29%').backgroundColor($r('app.color.10FFFFFF'))
       }
       .height('85%')

+ 2 - 0
entry/src/main/ets/viewmodel/wms/RequestParamModel.ets

@@ -35,4 +35,6 @@ export default class RequestParamModel {
   orgId?:number
   //工位id
   stationId?:string
+  //工单编号
+  workOrderCode?:string
 }

+ 4 - 0
entry/src/main/ets/viewmodel/wms/WorkOrderInfo.ets

@@ -11,6 +11,10 @@ export default class WorkOrderInfo {
   materialCode?: string
   // 物料名称
   materialName?: string
+  //序列号
+  batchNo?:string
+  //扫码物料数量
+  num?:number
   // 物料型号
   materialModel?: string
   // 工艺版本

+ 15 - 0
entry/src/main/ets/viewmodel/wms/WorkOrderMaterialInfo.ets

@@ -0,0 +1,15 @@
+// 工序物料信息
+export default class WorkOrderMaterialInfo {
+  // 物料编码
+  itemCode?: string;
+  // 物料名称
+  itemName?: string;
+  // 物料规格
+  itemModel?: string;
+  // 所需数量
+  num?: number;
+  // 单位
+  unit?: string;
+  // 入库数量
+  storageNum?: number;
+}