cjb преди 3 седмици
родител
ревизия
83c48df8bc

+ 4 - 4
entry/src/main/ets/component/NavigationBar.ets

@@ -12,7 +12,7 @@ export struct NavigationBar {
       orderName: "生产订单",
       orderCode: "PO-20240501-001",
       workOrderCode: "WC-001",
-      planStartWhen: "工序A",
+      planStartWhen: "2025/11/11 11:11:11",
       inventoryNum: "50",
       planNum: "100",
       workOrderState:"完成"
@@ -21,7 +21,7 @@ export struct NavigationBar {
       orderName: "维修订单",
       orderCode: "MO-20240501-002",
       workOrderCode: "WC-002",
-      planStartWhen: "工序B",
+      planStartWhen: "2025/11/11 11:11:11",
       inventoryNum: "30",
       planNum: "60",
       workOrderState:"完成"
@@ -30,7 +30,7 @@ export struct NavigationBar {
       orderName: "测试订单",
       orderCode: "TO-20240501-003",
       workOrderCode: "WC-003",
-      planStartWhen: "工序C",
+      planStartWhen: "2025/11/11 11:11:11",
       inventoryNum: "80",
       planNum: "120",
       workOrderState:"完成"
@@ -39,7 +39,7 @@ export struct NavigationBar {
       orderName: "紧急订单",
       orderCode: "EO-20240501-004",
       workOrderCode: "WC-004",
-      planStartWhen: "工序D",
+      planStartWhen: "2025/11/11 11:11:11",
       inventoryNum: "10",
       planNum: "20",
       workOrderState:"完成"

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

@@ -302,7 +302,7 @@ export struct BoxGrid {
                     .fontSize($r('app.float.fontSize_16'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`坐标: ${box.locationNo}`)
+                  Text(`坐标: ${box.coordinate}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_16'))
                     .textAlign(TextAlign.Start)

+ 61 - 236
entry/src/main/ets/component/WarehousingStaticsView.ets

@@ -1,5 +1,10 @@
 import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
 import {DemandMaterial,MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
+import WorkOrderMaterialInfo from "../viewmodel/wms/WorkOrderMaterialInfo"
+import WmsRequest from '../common/util/request/WmsRequest'
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
+import MaterialInfo from '../viewmodel/wms/MaterialInfo'
+import MaterialBoxInfo from '../viewmodel/wms/MaterialBoxInfo'
 @Component
 export struct StaticOrderList {
   private scrollerForList: Scroller = new Scroller()
@@ -67,16 +72,10 @@ struct StaticOrderItem{
           .fontWeight(FontWeight.Lighter)
 
         Row() {
-          Text('齐套比例:')
+          Text(`齐套比例:${(Number(this.item.inventoryNum) / Number(this.item.planNum) * 100).toFixed(0)}%`)
             .fontColor($r('app.color.FFFFFF'))
             .fontSize($r('app.float.fontSize_16'))
             .fontWeight(FontWeight.Lighter)
-
-          Text(`${this.item.inventoryNum}`)
-            .fontColor($r('app.color.FFFFFF'))
-            .fontSize($r('app.float.fontSize_16'))
-            .margin({ left: 4 })
-            .fontWeight(FontWeight.Lighter)
         }
         .width('100%')
         .justifyContent(FlexAlign.Start)
@@ -111,23 +110,22 @@ struct OrderMaterialDialog {
   @Prop inBoundRation:number = 10
   @Prop outBoundRation:number = 79
   @Link selectedOrder: WorkOrderInfo
-  @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[] = [];
+
+  queryDemandMaterial=async(workOrderCode:string)=>{
+    this.materialData = await WmsRequest.post('/api/v1/wms/workOrderMaterial/list', {
+      workOrderCode: workOrderCode,
+    } as RequestParamModel) as WorkOrderMaterialInfo[]
+  }
 
   controller: CustomDialogController
   searchRequestMaterial: () => void = () => {}
 
+  async aboutToAppear(){
+    const workOrderCode = this.selectedOrder?.workOrderCode ?? '';
+    this.queryDemandMaterial(workOrderCode);
+  }
+
   build() {
     Column() {
       Column(){
@@ -154,7 +152,7 @@ struct OrderMaterialDialog {
             Text(`下发时间: ${this.selectedOrder.planStartWhen}`)
               .fontColor($r('app.color.FFFFFF'))
               .fontSize($r('app.float.fontSize_16'))
-            Text(`预计完成时间: ${this.selectedOrder.planStartWhen}`)
+            Text(`预计完成时间: ${this.selectedOrder.planStartEnd}`)
               .fontColor($r('app.color.FFFFFF'))
               .fontSize($r('app.float.fontSize_16'))
             Text(`生产数量: ${this.selectedOrder.inventoryNum}`)
@@ -223,16 +221,16 @@ struct OrderMaterialDialog {
       .width('95%')
      Column(){
        List({scroller:this.scrollerForList}) {
-         ForEach(this.materialData, (item:DemandMaterial) => {
+         ForEach(this.materialData, (item:WorkOrderMaterialInfo) => {
            ListItem() {
              Column() {
                Column(){
-                 Text(item.materialName)
+                 Text(item.itemName)
                    .fontSize($r('app.float.fontSize_16'))
                    .fontColor($r('app.color.FFFFFF'))
                    .width('100%')
                    .textAlign(TextAlign.Start)
-                 Text(`型号: ${item.materialType}`)
+                 Text(`型号: ${item.itemCode}`)
                    .fontSize($r('app.float.fontSize_16'))
                    .fontColor($r('app.color.60FFFFFF'))
                    .width('100%')
@@ -240,25 +238,25 @@ struct OrderMaterialDialog {
                    .textAlign(TextAlign.Start)
                }
                Row(){
-                 Text(`入库数量:${item.planNum}`)
+                 Text(`入库数量:${item.storageNum}`)
                    .fontSize($r('app.float.fontSize_16'))
                    .fontColor($r('app.color.FFFFFF'))
                    .width('20%')
                    .fontWeight(FontWeight.Lighter)
                    .textAlign(TextAlign.Start)
-                 Text(`出库数量:${item.planNum}`)
+                 Text(`出库数量:${item.storageNum}`)
                    .fontSize($r('app.float.fontSize_16'))
                    .fontColor($r('app.color.FFFFFF'))
                    .fontWeight(FontWeight.Lighter)
                    .width('20%')
                    .textAlign(TextAlign.Start)
-                 Text(`缺料数量:${item.planNum}`)
+                 Text(`缺料数量:${item.num}`)
                    .fontSize($r('app.float.fontSize_16'))
                    .fontColor($r('app.color.FFFFFF'))
                    .fontWeight(FontWeight.Lighter)
                    .width('20%')
                    .textAlign(TextAlign.Start)
-                 Text(`需求数量:${item.planNum}`)
+                 Text(`需求数量:${item.num}`)
                    .fontSize($r('app.float.fontSize_16'))
                    .fontColor($r('app.color.FFFFFF'))
                    .width('20%')
@@ -309,23 +307,18 @@ struct OrderMaterialDialog {
 @Component
 export struct StaticMaterialList {
   private scrollerForList: Scroller = new Scroller()
-  @Prop boundMaterial: DemandMaterial[] = [
-    {materialName: 'PCBA电路板SADD12312', 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 },
-  ]
+
+  @Prop currentStock: MaterialInfo[] = []
   @State scaleValue : number = 1
   build() {
     Column() { // 订单列表
       List({ space: 8,scroller:this.scrollerForList }) {
-        ForEach(this.boundMaterial, (item: DemandMaterial, index) => {
+        ForEach(this.currentStock, (item: MaterialInfo, index) => {
           ListItem() {
             StaticMaterialItem({
               item: item,
               index:index,
-              boundMaterial:this.boundMaterial
+              currentStock:this.currentStock
             })
           }
         })
@@ -340,14 +333,15 @@ export struct StaticMaterialList {
 
 @Component
 struct StaticMaterialItem{
-  @Prop item: DemandMaterial
+  @Prop item: MaterialInfo
   @Prop index: number
-  @Prop boundMaterial:DemandMaterial[]
+  @Prop currentStock:MaterialInfo[]
   @State scaleValue : number = 1
-  @State selectedMaterial :DemandMaterial={}
+  @State selectedMaterial :MaterialInfo={}
   private onSelect(index: number): void {
-    this.selectedMaterial = this.boundMaterial[index]
+    this.selectedMaterial = this.currentStock[index]
   }
+
   MaterialBoxController: CustomDialogController = new CustomDialogController({
     builder: MaterialBoxDialog({
       selectedMaterial:this.selectedMaterial
@@ -356,6 +350,7 @@ struct StaticMaterialItem{
     customStyle: true,
     maskColor: 'rgba(0,0,0,0.8)',  // 黑色遮罩
   })
+
   build() {
     Column() {
       // 订单标题(带订单号)
@@ -371,14 +366,14 @@ struct StaticMaterialItem{
 
       // 订单详情
       Column({ space: 3 }) {
-        Text(`型号: ${this.item.materialType}`)
+        Text(`型号: ${this.item.materialNo}`)
           .fontColor($r('app.color.FFFFFF'))
           .textAlign(TextAlign.Start)
           .width('100%')
           .fontWeight(FontWeight.Lighter)
           .fontSize($r('app.float.fontSize_16'))
 
-        Text(`总数量: ${this.item.inBoundNum}`)
+        Text(`总数量: ${this.item.num}`)
           .fontColor($r('app.color.FFFFFF'))
           .width('100%')
           .fontWeight(FontWeight.Lighter)
@@ -413,191 +408,26 @@ struct StaticMaterialItem{
 
 @CustomDialog
 struct MaterialBoxDialog {
-  @Prop workOrders:WorkOrderInfo[] = []
-  @Prop inBoundRation:number = 10
-  @Prop outBoundRation:number = 79
-  @Link selectedMaterial: DemandMaterial
+  @Link selectedMaterial: MaterialInfo
   private scrollerMaterial: Scroller = new Scroller()
   @State selectedMaterialIndex: number = -1  // 物料箱选中索引
   private onSelectMaterial(index: number) {
     this.selectedMaterialIndex = index
   }
-
-  @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 materialBoxes: MaterialBoxInfo[] = [];
   @Prop emptyBoxes: EmptyBox[] = [];
   controller: CustomDialogController
   searchRequestMaterial: () => void = () => {}
 
+  loadMaterialBoxes= async()=>{
+    this.materialBoxes = await WmsRequest.post("/api/v1/stock/groupList", {
+      materialNo: this.selectedMaterial.materialNo,
+    } as RequestParamModel);
+  }
+  async aboutToAppear() {
+    this.loadMaterialBoxes();
+  }
+
   build() {
     Column() {
       Column(){
@@ -609,39 +439,38 @@ struct MaterialBoxDialog {
 
       Column() {
         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_30'))
                   .fontColor($r('app.color.FFFFFF'))
                   .width('100%')
                   .textAlign(TextAlign.Start)
                   .margin({ bottom: '2%',left:'2%' })
-                // 订单详情
                 Column({ space: 3 }) {
-                  Text(`料箱编号: ${box.id}`)
+                  Text(`料箱编号: ${box.vehicleCode}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_16'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`料箱类型: ${box.boxType}`)
+                  Text(`所属订单: `)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_16'))
                     .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_16'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`数量: ${box.boxNumber}`)
+                  Text(`层数: ${box.position}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_16'))
                     .fontWeight(FontWeight.Lighter)
                     .textAlign(TextAlign.Start)
-                  Text(`位置: ${box.position}`)
+                  Text(`位置: ${box.coordinate}`)
                     .fontColor($r('app.color.FFFFFF'))
                     .fontSize($r('app.float.fontSize_16'))
                     .fontWeight(FontWeight.Lighter)
@@ -708,7 +537,7 @@ export struct LineChart {
   private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
 
   // 图表数据
-  private readonly data: number[] = [400, 380, 400, 450, 430, 450, 440, 450, 430, 440, 420, 450]
+  @Link  frequencyData: number[]
   private readonly months: string[] = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
 
   // 图表尺寸和边距
@@ -716,10 +545,6 @@ export struct LineChart {
   private readonly chartHeight: number = 250
   private readonly chartPadding: number = 30
 
-  aboutToAppear() {
-    // 初始化设置
-  }
-
   build() {
     Column() {
       Canvas(this.context)
@@ -788,8 +613,8 @@ export struct LineChart {
     this.context.strokeStyle = '#2196F3'
     this.context.lineWidth = 2
 
-    this.data.forEach((value, i) => {
-      const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.data.length - 1))
+    this.frequencyData.forEach((value, i) => {
+      const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.frequencyData.length - 1))
       const y = this.chartHeight - this.chartPadding - ((value / 500) * (this.chartHeight - 2 * this.chartPadding))
 
       if (i === 0) {
@@ -803,8 +628,8 @@ export struct LineChart {
   }
 
   private drawPoints() {
-    this.data.forEach((value, i) => {
-      const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.data.length - 1))
+    this.frequencyData.forEach((value, i) => {
+      const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.frequencyData.length - 1))
       const y = this.chartHeight - this.chartPadding - ((value / 500) * (this.chartHeight - 2 * this.chartPadding))
 
       this.context.beginPath()

+ 93 - 18
entry/src/main/ets/pages/IntelligentWarehousingStatics.ets

@@ -4,18 +4,81 @@
 import router from '@ohos.router';
 import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
 import {StaticOrderList,StaticMaterialList,LineChart} from '../component/WarehousingStaticsView'
-
-
+import WmsRequest from '../common/util/request/WmsRequest'
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
+import MaterialBoxInfo from '../viewmodel/wms/MaterialBoxInfo'
+import MaterialInfo from '../viewmodel/wms/MaterialInfo'
+import {FrequencyClass,MonthClass} from '../viewmodel/wms/BoundFrequency'
 @Entry
 @Component
 struct IntelligentWarehousingStatics {
-  @State workOrderArray: WorkOrderInfo[] = [
-    { orderName: '订单名称1XXXXX', workOrderCode: '123123213', planStartWhen: '2025/11/11', inventoryNum: '50%' },
-    { orderName: '订单名称2XXXXX', workOrderCode: '123123213', planStartWhen: '2025/11/11', inventoryNum: '50%' },
-    { orderName: '订单名称3XXXXX', workOrderCode: '123123213', planStartWhen: '2025/11/11', inventoryNum: '50%' },
-    { orderName: '订单名称4XXXXX', workOrderCode: '123123213', planStartWhen: '2025/11/11', inventoryNum: '50%' },
-    { orderName: '订单名称5XXXXX', workOrderCode: '123123213', planStartWhen: '2025/11/11', inventoryNum: '50%' },
-  ]
+  @State workOrderArray: WorkOrderInfo[] = []
+  @State emptyBoxesNum:number = 0
+  @State currentBoxesNum:number = 0
+  @State allStorageBox:number = 300
+  @State inputMaterialName:string = ''
+  @State currentStock:MaterialInfo[] = []
+  @State frequency: FrequencyClass = {}
+  @State frequencyData: number[] = []
+
+
+
+  loadMaterialBoxes = async ()=>{
+    let res: MaterialBoxInfo[] = await WmsRequest.post("/api/v1/stock/groupList", {
+      materialName: "空盒",
+    } as RequestParamModel);
+    this.emptyBoxesNum = res.length;
+    console.info( "qqqqq"+JSON.stringify(res))
+    res = await WmsRequest.post("/api/v1/stock/groupList", {
+    } as RequestParamModel);
+    this.currentBoxesNum = res.length;
+    console.info( "qqqqq"+JSON.stringify(res))
+  }
+
+  loadStockList= async ()=>{
+    this.currentStock = await WmsRequest.post('/api/v1/stock/mergeList', {
+      materialName: this.inputMaterialName,
+    } as RequestParamModel) as WorkOrderInfo[]
+    this.inputMaterialName = ''
+
+  }
+
+  loadBoundFrequency= async ()=> {
+    try {
+      // 1. 获取数据
+      this.frequency = await WmsRequest.get('/api/v1/wmsOrder/inOutTimes/1') as FrequencyClass;
+      console.info('Monthly Data'+JSON.stringify(this.frequency))
+
+      // 2. 初始化一个长度为12的数组,默认值为0
+      if(this.frequency){
+        const monthlyData:number[] = new Array(12).fill(0);
+        // 3. 遍历 list,按 month 填充 times
+        this.frequency?.list?.forEach((item: MonthClass) => {
+          const month = item?.month ?? 0;  // Fallback to 0 if undefined
+          const times = item?.times ?? 0;   // Fallback to 0 if undefined
+
+          if (month >= 1 && month <= 12) {
+            monthlyData[month - 1] = times;
+          }
+        });
+        this.frequencyData = monthlyData; // 例如: [0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 0]
+      }
+    } catch (error) {
+      console.error('Failed to load frequency data:', error);
+    }
+  }
+
+  loadWorkOrders = async () => {
+    this.workOrderArray = await WmsRequest.post('/api/v1/plan/workOrder/list', {
+      queryComplete: 0,
+    } as RequestParamModel) as WorkOrderInfo[]
+  }
+   async aboutToAppear() {
+     this.loadMaterialBoxes();
+     this.loadWorkOrders();
+     this.loadStockList();
+     this.loadBoundFrequency();
+   }
 
 
   build() {
@@ -49,8 +112,8 @@ struct IntelligentWarehousingStatics {
                 Column(){
                   Stack({ alignContent: Alignment.Center }) {
                     Progress({
-                      value: 75,
-                      total: 100,
+                      value: this.currentBoxesNum,
+                      total: this.allStorageBox,
                       type: ProgressType.Ring
                     })
                       .width('100%')
@@ -58,7 +121,7 @@ struct IntelligentWarehousingStatics {
                       .backgroundColor($r('app.color.20FFFFFF'))
 
                     Column() {
-                      Text("75%")
+                      Text(`${(Number(this.currentBoxesNum) / Number(this.allStorageBox) * 100).toFixed(0)}%`)
                         .fontSize($r('app.float.fontSize_70')) // 大号数字
                         .fontColor($r('app.color.FFFFFF'))
                         //.margin({ bottom: $r('app.float.virtualSize_12') })
@@ -78,7 +141,7 @@ struct IntelligentWarehousingStatics {
                 .justifyContent(FlexAlign.Center)
                 Column(){
                   Column(){
-                    Text("20")
+                    Text(`${this.emptyBoxesNum}`)
                       .fontColor($r('app.color.FFFFFF'))
                       .fontSize($r('app.float.fontSize_48'))
                     Text("空箱")
@@ -87,7 +150,7 @@ struct IntelligentWarehousingStatics {
                       .fontWeight(FontWeight.Lighter)
                   }
                   Column(){
-                    Text("100")
+                    Text(`${this.currentBoxesNum}`)
                       .fontColor($r('app.color.FFFFFF'))
                       .fontSize($r('app.float.fontSize_48'))
                     Text("当前箱数")
@@ -96,7 +159,7 @@ struct IntelligentWarehousingStatics {
                       .fontWeight(FontWeight.Lighter)
                   }
                   Column(){
-                    Text("182")
+                    Text(`${this.allStorageBox}`)
                       .fontColor($r('app.color.FFFFFF'))
                       .fontSize($r('app.float.fontSize_48'))
                     Text("总储位")
@@ -124,7 +187,9 @@ struct IntelligentWarehousingStatics {
                 .height('15%')
                 .justifyContent(FlexAlign.Center)
 
-                LineChart()
+                LineChart({
+                  frequencyData:this.frequencyData
+                })
                   .width('80%')
                   .height('80%')
 
@@ -168,20 +233,30 @@ struct IntelligentWarehousingStatics {
                 .fillColor($r('app.color.FFFFFF'))
                 .margin({ left: '2%' })
               // 扫码输入框
-              TextInput({ placeholder: '请扫描物料编码' })
+              TextInput({ text:this.inputMaterialName,placeholder: '请扫描物料编码' })
                 .type(InputType.Normal)
                 .placeholderFont({ size: $r('app.float.fontSize_30') })
                 .placeholderColor($r('app.color.30FFFFFF'))
                 .fontSize($r('app.float.fontSize_30'))
                 .fontColor($r('app.color.FFFFFF'))
                 .enableKeyboardOnFocus(false)
+                .onSubmit(() => {
+                  this.loadStockList()
+                })
+                .onChange((value: string) => {
+                  this.inputMaterialName = value
+                })
+
+
             }
             .height('8%')
             .width('80%')
             .borderRadius($r('app.float.virtualSize_16'))
             .backgroundColor($r('app.color.000000'))
 
-            StaticMaterialList().width('90%').height('76%').margin({top:'3%'})
+            StaticMaterialList({
+              currentStock:this.currentStock
+            }).width('90%').height('76%').margin({top:'3%'})
 
           }.justifyContent(FlexAlign.Start).margin({top:'5%'})
           .height('100%')

+ 15 - 3
entry/src/main/ets/view/wms/CallMaterialNotification.ets

@@ -1,6 +1,9 @@
 //叫料通知
 import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
 import {OrderParams,DemandMaterial} from "../../params/OrderMaterialsStorageParams"
+import WmsRequest from '../../common/util/request/WmsRequest'
+import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
+import { NotificationInfo} from '../../viewmodel/wms/NotificationInfo'
 
 @Component
 struct MaterialNotificationItem{
@@ -26,7 +29,7 @@ struct MaterialNotificationItem{
             .fontSize($r('app.float.fontSize_16'))
             .fontWeight(FontWeight.Lighter)
 
-          Text(`工序: ${this.item.planStartWhen}`)
+          Text(`工序: ${this.item.orderCode}`)
             .fontColor(this.item.workOrderState=="完成"?$r('app.color.FFFFFF'):$r('app.color.30FFFFFF'))
             .fontSize($r('app.float.fontSize_16'))
             .fontWeight(FontWeight.Lighter)
@@ -37,7 +40,7 @@ struct MaterialNotificationItem{
               .fontSize($r('app.float.fontSize_16'))
               .fontWeight(FontWeight.Lighter)
 
-            Text(`${(Number(this.item.inventoryNum) / Number(this.item.planNum) * 100).toFixed(0)}%`)
+            Text(this.item.planStartWhen)
               .fontColor(this.item.workOrderState=="完成"?$r('app.color.FFFFFF'):$r('app.color.30FFFFFF'))
               .fontSize($r('app.float.fontSize_16'))
               .margin({ left: 4 })
@@ -89,12 +92,21 @@ export struct MaterialNotificationDialog {
   private scrollerForList: Scroller = new Scroller()
   @Link selectWorkOrder:WorkOrderInfo
   @Link workOrders: WorkOrderInfo[]
+  @State notificationList :NotificationInfo[]=[]
   //@Link selectWorkOrder: WorkOrderInfo
   // 选中回调函数
   controller: CustomDialogController
   searchRequestMaterial: () => void = () => {}
 
-  aboutToAppear() {
+  loadNotificationList=async()=>{
+    this.notificationList = await WmsRequest.post('/api/v1/sys/message/list', {
+      type:2
+    } as RequestParamModel) as NotificationInfo[]
+    console.info("testtag1+"+JSON.stringify(this.notificationList))
+  }
+
+  async aboutToAppear() {
+    console.info("testtag1+11111")
     this.workOrders = this.workOrders
       .slice()
       .sort((a) => a.workOrderState === "已完成" ? 1 : -1);

+ 11 - 0
entry/src/main/ets/viewmodel/wms/BoundFrequency.ets

@@ -0,0 +1,11 @@
+export interface FrequencyClass {
+  list?: MonthClass[]
+  todayInTimes?: number
+  todayOutTimes?: number
+}
+
+export interface MonthClass {
+  times?: number
+  month?: number
+  houseType?: number
+}

+ 17 - 0
entry/src/main/ets/viewmodel/wms/NotificationInfo.ets

@@ -0,0 +1,17 @@
+export class NotificationInfo {
+  content?: string;
+  created?: string
+  creator?: string;
+  deptId?: string;
+  id?: string;
+  msgId?: string;
+  orgId?: string;
+  readState?: string;
+  receiveUsers?: string
+  state?: string;
+  title?: string;
+  type?: string;
+  updated?: string
+  updator?: string;
+  userId?: number;
+}