Forráskód Böngészése

手动入库添加按钮。

jiaxiaoqiang 1 hónapja
szülő
commit
ca9685d86c

+ 3 - 3
entry/src/main/ets/common/util/request/Request.ets

@@ -10,10 +10,10 @@ import CommonConstants from '../../constants/CommonConstants';
 //import PreferencesUtil from '../PreferencesUtil';
 import { printError, printRequest, printResponse, handleRes } from './Helps';
 
-// const baseUrl = "http://10.88.20.188:8079/"
+
 // jiaxiaoqiang:这里要改
-const baseUrl = "http://10.88.11.200:8079/"
-// const baseUrl = "http://192.168.101.188:8079/"
+const baseUrl = "http://10.88.11.200:8079/" //xianfeng
+// const baseUrl = "http://192.168.1.4:8079/" //chuangke
 
 // 创建实例
 const JGRequest = axios.create(

+ 3 - 3
entry/src/main/ets/common/util/request/StorageRequest.ets

@@ -9,10 +9,10 @@ import axios, {
 import CommonConstants from '../../constants/CommonConstants';
 import { printError, printRequest, printResponse, handleRes } from './Helps';
 
-// const baseUrl = "http://10.88.20.188:8079/"
+
 // jiaxiaoqiang:这里要改
-const baseUrl = "http://10.88.11.200:8079/"
-// const baseUrl = "http://192.168.101.188:8079/"
+const baseUrl = "http://10.88.11.200:8079/" //xianfeng
+// const baseUrl = "http://192.168.1.4:8079/" //chuangke
 const DEBUG = true //
 
 // 创建实例

+ 1 - 1
entry/src/main/ets/pages/LoginPage.ets

@@ -18,7 +18,7 @@ struct LoginPage {
   controller: TextInputController = new TextInputController()
   //1是拣选,2是装配,3是测试,4是维修站,5是入库,6是出库
   @State stationDictValue: string = ''
-  @State loginName: string = 'XF-01'
+  @State loginName: string = 'admin'
   @State password: string = '123456'
   @State dept: DeptInfo = { deptName: '仿真中心' }
   @State workstation: WorkstationInfo = {}

+ 27 - 13
entry/src/main/ets/view/ManualWarehousing.ets

@@ -199,24 +199,18 @@ export struct ManualWarehousing {
     console.log("QQQ", JSON.stringify(outRes), outRes?.orderId)
 
   }
-
-
   // 获取二楼绑定料箱信息
   getUpstairsData = async () => {
     // 如果没有rfid就不调用
     if (!this.recentlyRecordObject.rfid) {
       return
     }
+    let res: MaterialInformationModel[] = await StorageRequest.get(`/web/wcs/bindInfo/${this.recentlyRecordObject.rfid}`) as MaterialInformationModel[]
 
+    if (res && res.length && res.length > 0) {
+      this.MaterialInformation = res
+    }
 
-    let res: MaterialInformationModel = await StorageRequest.get(`/web/wcs/bindInfo/${this.recentlyRecordObject.rfid}` as MaterialInformationModel)
-
-
-    // TODO
-    // let obj: MaterialInformationModel = JSON.parse(JSON.stringify(res))
-    //将返回的数据解析后,如果数组不为空  就赋值到下面的数组里面
-
-    // this.MaterialInformation = []
   }
   // 清空的按钮调用这个方法
   clearData = () => {
@@ -572,7 +566,25 @@ export struct ManualWarehousing {
         }.width(px2vp(1260))
         .height(px2vp(800))
 
-        Column() {
+        Row({ space: 20 }) {
+          Button('获取二楼信息')
+            .fontSize($r('app.float.fontSize_24'))
+            .fontColor($r('app.color.general_font_white_color'))
+            .width(px2vp(200))
+            .height(px2vp(80))
+            .backgroundColor($r('app.color.brown_100'))
+            .onClick(() => {
+              this.getUpstairsData()
+            })
+          Button('清空物料')
+            .fontSize($r('app.float.fontSize_24'))
+            .fontColor($r('app.color.general_font_white_color'))
+            .width(px2vp(150))
+            .height(px2vp(80))
+            .backgroundColor($r('app.color.blue_100'))
+            .onClick(() => {
+              this.clearData()
+            })
           if (this.MaterialInformation.length === 0) {
             Button('绑定料箱')
               .fontSize($r('app.float.fontSize_24'))
@@ -580,7 +592,8 @@ export struct ManualWarehousing {
               .width(px2vp(608))
               .height(px2vp(80))
               .backgroundColor($r('app.color.blue_20'))
-          } else {
+          }
+          else {
             Button('绑定料箱')
               .fontSize($r('app.float.fontSize_24'))
               .fontColor($r('app.color.general_font_white_color'))
@@ -612,7 +625,8 @@ export struct ManualWarehousing {
 
               })
           }
-        }.width(px2vp(1260))
+        }
+        .width(px2vp(1260))
         .height(px2vp(100))
         .justifyContent(FlexAlign.Center)
 

+ 16 - 16
oh-package-lock.json5

@@ -3,38 +3,38 @@
   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
   "specifiers": {
     "lite_chart@^0.0.1": "lite_chart@0.0.1",
-    "pinyin-pro@^3.18.3": "pinyin-pro@3.18.3",
-    "@ohos/axios@^2.2.1-rc.0": "@ohos/axios@2.2.2",
     "@ohos/hypium@1.0.11": "@ohos/hypium@1.0.11",
-    "@mcui/mccharts@^1.0.2": "@mcui/mccharts@1.0.2"
+    "@mcui/mccharts@^1.0.2": "@mcui/mccharts@1.0.2",
+    "@ohos/axios@2.2.1-rc.0": "@ohos/axios@2.2.1-rc.0",
+    "pinyin-pro@^3.18.3": "pinyin-pro@3.18.3"
   },
   "packages": {
     "@ohos/hypium@1.0.11": {
-      "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.11.tgz",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.11.tgz",
       "integrity": "sha512-KawcLnv43C3QIYv1UbDnKCFX3MohtDxGuFvzlUxT/qf2DBilR56Ws6zrj90LdH6PjloJQwOPESuBQIHBACAK7w==",
       "registryType": "ohpm",
       "shasum": "fa799d273fa7d921701578c5e7084849354a4af0"
     },
+    "@ohos/axios@2.2.1-rc.0": {
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/axios/-/axios-2.2.1-rc.0.har",
+      "integrity": "sha512-owJh8oOd1i56vZGU7opjz8EwYVsiHtuFYCwTyYCLZYLyeCdn9+laWjDpNrCSDZktySyYCu9qmK9867XQ+8QVFg==",
+      "registryType": "ohpm"
+    },
     "lite_chart@0.0.1": {
-      "resolved": "https://repo.harmonyos.com/ohpm/lite_chart/-/lite_chart-0.0.1.har",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/lite_chart/-/lite_chart-0.0.1.har",
       "integrity": "sha512-iEq2uXyC3jkeErHOLVFLz/yj5ft9OHST8aqCltewqlbRtwQRzUqLi/KpNTXlZlSsAGZPizVjFje1oyT19frSJw==",
       "registryType": "ohpm"
     },
+    "@mcui/mccharts@1.0.2": {
+      "resolved": "https://ohpm.openharmony.cn/ohpm/@mcui/mccharts/-/mccharts-1.0.2.har",
+      "integrity": "sha512-44hGTwZcsfFnny7nT/zMpWKFqXbaVmdlDbyeJIOlJwbglS/S3ypqhBdzbpj3aJrcMSd5FLFO0FrZGntph9HSIw==",
+      "registryType": "ohpm"
+    },
     "pinyin-pro@3.18.3": {
-      "resolved": "https://repo.harmonyos.com/ohpm/pinyin-pro/-/pinyin-pro-3.18.3.tgz",
+      "resolved": "https://ohpm.openharmony.cn/ohpm/pinyin-pro/-/pinyin-pro-3.18.3.tgz",
       "integrity": "sha512-YkY/n+T2DoRZxmZk+ReuNeSl2SowIMVDdagydILlPI0qNsbH7K5IKAQFihKl1JNiXLqwQT6kkVwVDsUek7AIqg==",
       "registryType": "ohpm",
       "shasum": "6dd2fcf2dbba3b1e3d6b54d6b138cf2e6003b0c7"
-    },
-    "@ohos/axios@2.2.2": {
-      "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.2.har",
-      "integrity": "sha512-JpSAeuR9NPhK1dbJjk1DVLgBZVRHgorNFAcpNrnBxt02mVGeeB3dyqmLetfqk+25f2dWwPkCHwm4+TqQPc093w==",
-      "registryType": "ohpm"
-    },
-    "@mcui/mccharts@1.0.2": {
-      "resolved": "https://repo.harmonyos.com/ohpm/@mcui/mccharts/-/mccharts-1.0.2.har",
-      "integrity": "sha512-44hGTwZcsfFnny7nT/zMpWKFqXbaVmdlDbyeJIOlJwbglS/S3ypqhBdzbpj3aJrcMSd5FLFO0FrZGntph9HSIw==",
-      "registryType": "ohpm"
     }
   }
 }

+ 1 - 1
oh-package.json5

@@ -5,7 +5,7 @@
     "@ohos/hypium": "1.0.11",
     "@mcui/mccharts": "^1.0.2",
     "lite_chart": "^0.0.1",
-    "@ohos/axios": "^2.2.1-rc.0",
+    "@ohos/axios": "2.2.1-rc.0",
     "pinyin-pro": "^3.18.3"
   },
   "author": "",