Browse Source

齐套出库

hh 3 weeks ago
parent
commit
8d719a3b26

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

@@ -133,7 +133,7 @@ export struct InBoundView {
             .width('100%')
             .height('100%')
             .borderRadius($r('app.float.virtualSize_6_4'))
-            .objectFit(ImageFit.Contain)
+            .objectFit(ImageFit.Fill)
           // 文字信息层(左下角)
           Column() {
             Row() {

+ 102 - 70
entry/src/main/ets/pages/OperationMaterialKit.ets

@@ -7,8 +7,14 @@ import { NavigationBar } from '../component/NavigationBar'
 import { OperationMaterialKitOneStep } from '../view/wms/OperationMaterialKitOneStep'
 import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
 import { OperationMaterialKitTwoStep } from '../view/wms/OperationMaterialKitTwoStep'
+import { OperationMaterialKitThreeStep } from '../view/wms/OperationMaterialKitThreeStep'
 import OperationInfo from '../viewmodel/wms/OperationInfo'
 import OperationItem from '../viewmodel/wms/OperationItem'
+import VehicleInfo from '../viewmodel/wms/VehicleInfo'
+import WmsRequest from '../common/util/request/WmsRequest'
+import promptAction from '@ohos.promptAction'
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
+import CommonConstants from '../common/constants/CommonConstants'
 
 @Entry
 @Component
@@ -22,6 +28,22 @@ struct OperationMaterialKit {
   // 选中工序需求的物料
   @State operationItems: OperationItem[] = []
 
+  // 空箱出库的方法
+  callEmptyBoxFun = async () => {
+    let res: VehicleInfo = await WmsRequest.post('/api/v1/stock/queryEmptyBox')
+    console.log("hhtest", JSON.stringify(res), res?.vehicleNo)
+    await WmsRequest.post('/api/v1/wmsOrder/outBox', {
+      stanCode: CommonConstants.STATION_CODE,
+      vehicleNo: res!.vehicleNo,
+      houseNo: res!.houseNo
+    } as RequestParamModel)
+    promptAction.showToast({
+      message: "箱子正在运行中....",
+      duration: 1800,
+      bottom: '50%'
+    })
+  }
+
   build() {
     Column() {
       // 顶部时间和菜单栏
@@ -78,7 +100,13 @@ struct OperationMaterialKit {
           Divider()
             .vertical(false)
             .strokeWidth(1)
+            .layoutWeight(1)
+            .height($r('app.float.virtualSize_19_2'))
             .color($r('app.color.15FFFFFF'))
+            .margin({
+              left: '-3%',
+              right: '-3%',// 向左延伸至圆心
+            })
           Column({space: 5}) {
             Stack() {
               Circle()
@@ -97,6 +125,17 @@ struct OperationMaterialKit {
               .fontColor(this.step === 2 ? $r('app.color.FFFFFF') : $r('app.color.60FFFFFF'))
               .fontWeight(FontWeight.Regular)
           }
+          Divider()
+            .vertical(false)
+            .strokeWidth(1)
+            .layoutWeight(1)
+            .height($r('app.float.virtualSize_19_2'))
+            .color($r('app.color.15FFFFFF'))
+            .margin({
+              left: '-3%',
+              right: '-3%',// 向左延伸至圆心
+              //
+            })
           Column({space: 5}) {
             Stack() {
               Circle()
@@ -118,7 +157,7 @@ struct OperationMaterialKit {
         }
         .height('80%')
         .width('18%')
-        .justifyContent(FlexAlign.SpaceBetween)
+        // .justifyContent(FlexAlign.SpaceBetween)
         .alignItems(VerticalAlign.Top)
 
         Blank()
@@ -144,88 +183,81 @@ struct OperationMaterialKit {
             selectOperations: this.selectOperations,
             operationItems: this.operationItems,
           })
+        } else {
+          OperationMaterialKitThreeStep({
+            workOrder: this.workOrder,
+            selectOperations: this.selectOperations,
+            operationItems: this.operationItems,
+          })
         }
       }
       .height('71%')
       .width('94.8%')
       // 步骤切换按钮
       Row() {
-        if (this.step > 2) {
-          Row () {
-            Text('第一步')
-              .fontSize($r('app.float.fontSize_9_6'))
-              .fontColor($r('app.color.0A84FF'))
-              .fontWeight(FontWeight.Medium)
-          }
-          .height('85%')
-          .width('24.1%')
-          .justifyContent(FlexAlign.Center)
-          .backgroundColor($r('app.color.20FFFFFF'))
-          .borderRadius($r('app.float.fontSize_6_4'))
-          .onClick(()=>{
-            this.step = 1
-          })
-        } else {
-          Row().width('24.1%')
+        Row () {
+          Text('第一步')
+            .fontSize($r('app.float.fontSize_9_6'))
+            .fontColor($r('app.color.0A84FF'))
+            .fontWeight(FontWeight.Medium)
         }
+        .height('85%')
+        .width('24.1%')
+        .justifyContent(FlexAlign.Center)
+        .backgroundColor($r('app.color.20FFFFFF'))
+        .borderRadius($r('app.float.fontSize_6_4'))
+        .opacity(this.step > 2 ? 1 : 0.3)
+        .onClick(()=>{
+          this.step = 1
+        })
         Row().width('1.2%')
-        if (this.step > 1) {
-          Row () {
-            Text('上一步')
-              .fontSize($r('app.float.fontSize_9_6'))
-              .fontColor($r('app.color.0A84FF'))
-              .fontWeight(FontWeight.Medium)
-          }
-          .height('85%')
-          .width('24.1%')
-          .justifyContent(FlexAlign.Center)
-          .backgroundColor($r('app.color.20FFFFFF'))
-          .borderRadius($r('app.float.fontSize_6_4'))
-          .onClick(()=>{
-            this.step -= 1
-          })
-        } else {
-          Row().width('24.1%')
+        Row () {
+          Text('上一步')
+            .fontSize($r('app.float.fontSize_9_6'))
+            .fontColor($r('app.color.0A84FF'))
+            .fontWeight(FontWeight.Medium)
         }
-
+        .height('85%')
+        .width('24.1%')
+        .justifyContent(FlexAlign.Center)
+        .backgroundColor($r('app.color.20FFFFFF'))
+        .borderRadius($r('app.float.fontSize_6_4'))
+        .opacity(this.step > 1 ? 1 : 0.3)
+        .onClick(()=>{
+          this.step -= 1
+        })
         Row().width('1.2%')
-
-        if (this.step === 2) {
-          Row () {
-            Text('空箱出库')
-              .fontSize($r('app.float.fontSize_9_6'))
-              .fontColor($r('app.color.0A84FF'))
-              .fontWeight(FontWeight.Medium)
-          }
-          .height('85%')
-          .width('24.1%')
-          .justifyContent(FlexAlign.Center)
-          .backgroundColor($r('app.color.20FFFFFF'))
-          .borderRadius($r('app.float.fontSize_6_4'))
-        } else {
-          Row().width('24.1%')
+        Row () {
+          Text('空箱出库')
+            .fontSize($r('app.float.fontSize_9_6'))
+            .fontColor($r('app.color.0A84FF'))
+            .fontWeight(FontWeight.Medium)
         }
-
+        .height('85%')
+        .width('24.1%')
+        .justifyContent(FlexAlign.Center)
+        .backgroundColor($r('app.color.20FFFFFF'))
+        .borderRadius($r('app.float.fontSize_6_4'))
+        .opacity(this.step === 2 ? 1 : 0.3)
+        .onClick(()=>{
+          this.callEmptyBoxFun()
+        })
         Row().width('1.2%')
-
-        if (this.step < 3) {
-          Row () {
-            Text('下一步')
-              .fontSize($r('app.float.fontSize_9_6'))
-              .fontColor($r('app.color.0A84FF'))
-              .fontWeight(FontWeight.Medium)
-          }
-          .height('85%')
-          .width('24.1%')
-          .justifyContent(FlexAlign.Center)
-          .backgroundColor($r('app.color.20FFFFFF'))
-          .borderRadius($r('app.float.fontSize_6_4'))
-          .onClick(()=>{
-            this.step += 1
-          })
-        } else {
-          Row().width('24.1%')
+        Row () {
+          Text('下一步')
+            .fontSize($r('app.float.fontSize_9_6'))
+            .fontColor($r('app.color.0A84FF'))
+            .fontWeight(FontWeight.Medium)
         }
+        .height('85%')
+        .width('24.1%')
+        .justifyContent(FlexAlign.Center)
+        .backgroundColor($r('app.color.20FFFFFF'))
+        .borderRadius($r('app.float.fontSize_6_4'))
+        .opacity(this.step < 3 ? 1 : 0.3)
+        .onClick(()=>{
+          this.step += 1
+        })
       }
       .width('94.8%')
       .height('6.1%')

+ 30 - 0
entry/src/main/ets/view/wms/OperationMaterialKitThreeStep.ets

@@ -0,0 +1,30 @@
+import OperationInfo from '../../viewmodel/wms/OperationInfo'
+import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
+import OperationItem from '../../viewmodel/wms/OperationItem'
+import { InBoundView } from '../../component/InBoundView'
+
+@Component
+export struct OperationMaterialKitThreeStep {
+
+  @Link workOrder: WorkOrderInfo
+  @Link selectOperations: OperationInfo[]
+  @Link operationItems: OperationItem[]
+  @State materialNum: number = 0
+
+  build() {
+    Row() {
+      // 出入库料口操作
+      Column() {
+        InBoundView({materialNum:this.materialNum});
+      }
+      .height('100%')
+      .width('29.6%')
+      .borderRadius($r('app.float.virtualSize_6_4'))
+      .justifyContent(FlexAlign.Center)
+      .backgroundColor($r('app.color.10FFFFFF'))
+    }
+    .width('100%')
+    .height('100%')
+    .justifyContent(FlexAlign.Center)
+  }
+}

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

@@ -26,7 +26,7 @@ export struct OperationMaterialKitTwoStep {
   // 选择已有料箱,出库料箱
   @State selectVehicleCode: string = ''
   @State houseStocks: HouseStock[] = []
-  @State materialNum: number=0
+  @State materialNum: number = 0
   // 空箱编码
   @State vehicleCode: string = ''
   @State materialTotal: number = 0