Kaynağa Gözat

入库工位可以操作齐套相关操作

hh 1 hafta önce
ebeveyn
işleme
03f83ab5d9

+ 14 - 2
entry/src/main/ets/pages/LoginPage.ets

@@ -7,8 +7,7 @@ import UserAuthModel from '../model/database/UserAuthModel';
 import UserInfo from '../model/UserInfo'
 import process from '@ohos.process'
 import RequestParamModel from '../viewmodel/RequestParamModel'
-import StorageRequest from '../common/util/request/StorageRequest'
-import EquipmentRequest from '../common/util/request/EquipmentRequest'
+import connection from '@ohos.net.connection'
 
 export const stationDictValue: string = ''
 
@@ -67,6 +66,19 @@ struct LoginPage {
   })
 
   async aboutToAppear() {
+    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) => {
+            AppStorage.setOrCreate('stationIp', address.address.address)
+          })
+        }
+      }
+    } catch (err) {
+      console.log('hhtest', err);
+    }
     this.controller.stopEditing()
     let userInfo = await UserAuthModel.getLast()
     //登录时,查询部门、

+ 4 - 1
entry/src/main/ets/view/CompleteSet.ets

@@ -208,6 +208,8 @@ export struct CompleteSet {
   rfidTimer: number = -1
   @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空回库下面的列表
   @State imgSrc:Resource = $r('app.media.drawer_inside')
+  // 当前工位ip
+  @StorageLink('stationIp') stationIp: string = ''
   //设置img图片路径
   setImgSrc = ()=>{
     if(this.drawerPositionStatus == 1 && this.materialGridStatus == 0){
@@ -394,10 +396,11 @@ export struct CompleteSet {
   Warehousing = async (): Promise<MaterialInformationModel[]> => {
     let res: MaterialInformationModel[] = await StorageRequest.post("/api/v1/wmsOrder/inBox", {
       houseNo: '1',
-      stanCode: CommonConstants.STATION_CODE,
+      // stanCode: CommonConstants.STATION_CODE,
       vehicleCode: this.recentlyRecordObject.rfid,
       detailsList: this.boxMaterials,
       wcsType: "kitting",
+      stationIp: this.stationIp,
     } as RequestParamModel)
 
     promptAction.showToast({

+ 4 - 1
entry/src/main/ets/view/ManualOutbound.ets

@@ -40,6 +40,8 @@ export struct ManualOutbound {
   @State materiaNo: string = ''
   //取料箱中物料信息
   @State private boxMaterials: Array<MaterialInformationModel> = []
+  // 当前工位ip
+  @StorageLink('stationIp') stationIp: string = ''
   // 打开物料位置弹窗之后的操作
   currentBoxStationModel: Materialpositionclass = {}
   goingToLookDetail = async (m: Materialpositionclass) => {
@@ -125,7 +127,8 @@ export struct ManualOutbound {
     let res: boxMaterialClass[] = await StorageRequest.post("/api/v1/wmsOrder/inBox", {
       houseNo: '1',
       vehicleCode: this.recentlyRecordObject.rfid,
-      detailsList: this.boxMaterials
+      detailsList: this.boxMaterials,
+      stationIp: this.stationIp,
     } as RequestParamModel)
 
     promptAction.showToast({

+ 1 - 0
entry/src/main/ets/viewmodel/RequestParamModel.ets

@@ -63,4 +63,5 @@ export default class RequestParamModel {
   processVehicleMaterialList?: MaterialInformationModel[]
   wcsType?: string
   readState?: number
+  stationIp?: string
 }