|
@@ -5,6 +5,9 @@ import { MaterialInformationModel } from '../model/MaterialInformation';
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel';
|
|
|
import EquipmentRequest from '../common/util/request/EquipmentRequest';
|
|
|
import { boxMaterialClass } from './CompleteSet';
|
|
|
+import { StationInfoModel } from '../model/StorageSpace';
|
|
|
+import CommonConstants from '../common/constants/CommonConstants';
|
|
|
+import JGRequest from '../common/util/request/Request';
|
|
|
|
|
|
export interface exchangeClass {
|
|
|
exchangeNumber?: number
|
|
@@ -112,6 +115,50 @@ export struct IntelligentWarehousingGo {
|
|
|
console.log('testTag', '扫码成功1!' + obj.batchCode)
|
|
|
return obj
|
|
|
}
|
|
|
+ // 通过RFID请求读取料箱的信息
|
|
|
+ rfidTimer: number = -1
|
|
|
+ @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空列表
|
|
|
+ @State private recentlyRecordObject: StationInfoModel = {}
|
|
|
+ rfidInfoIntervalFun = async () => {
|
|
|
+ let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
|
|
|
+ stanCode: CommonConstants.STATION_CODE
|
|
|
+ } as RequestParamModel)
|
|
|
+ this.recentlyRecordObject = res
|
|
|
+
|
|
|
+ if (this.preRfid && this.preRfid != this.recentlyRecordObject.rfid) {
|
|
|
+ this.MaterialInformation = []
|
|
|
+ }
|
|
|
+ this.preRfid = this.recentlyRecordObject.rfid ?? ""
|
|
|
+
|
|
|
+ if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
|
|
|
+ this.weight = Number(res.weight)
|
|
|
+ this.recentlyRecordObject.weight = this.recentlyRecordObject.weight + 'Kg'
|
|
|
+ this.MaterialInformation = await JGRequest.get(`/api/v1/plan/requisition/queryVehicleInfo/${this.recentlyRecordObject.rfid}`)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @State statusByAuto: number = 0 //0关闭 1开启
|
|
|
+ getAutoStatus = async () => {
|
|
|
+ this.statusByAuto = await JGRequest.get("/api/v1/wms/common/autoInBoxInfo")
|
|
|
+ console.log("ddddddddddddddddddd", this.statusByAuto)
|
|
|
+ }
|
|
|
+ setStatusByNumber = async (s: number) => {
|
|
|
+ await JGRequest.get(`/api/v1/wms/common/autoInBox/${s}`)
|
|
|
+ this.getAutoStatus()
|
|
|
+ }
|
|
|
+
|
|
|
+ async aboutToAppear() {
|
|
|
+ this.rfidTimer = setInterval(() => {
|
|
|
+ this.rfidInfoIntervalFun()
|
|
|
+ }, 2000)
|
|
|
+
|
|
|
+ this.getAutoStatus()
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ aboutToDisappear(): void {
|
|
|
+ clearInterval(this.rfidTimer)
|
|
|
+ }
|
|
|
|
|
|
build() {
|
|
|
Row() {
|
|
@@ -159,7 +206,7 @@ export struct IntelligentWarehousingGo {
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
- Text(this.materialBox === 1 || this.materialBox === 2 ? this.materialBoxId : '-')
|
|
|
+ Text(this.recentlyRecordObject.rfid)
|
|
|
.height('50%')
|
|
|
.fontWeight(FontWeight.Regular)
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
@@ -176,16 +223,16 @@ export struct IntelligentWarehousingGo {
|
|
|
.padding({ left: px2vp(30) })
|
|
|
|
|
|
Column() {
|
|
|
- Text('入库任务单')
|
|
|
- .height('50%')
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
- Text(this.materialBox === 1 || this.materialBox === 2 ? this.taskSheetId : '-')
|
|
|
- .height('50%')
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontColor($r('app.color.black_100'))
|
|
|
+ // Text('入库任务单')
|
|
|
+ // .height('50%')
|
|
|
+ // .fontWeight(FontWeight.Regular)
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontColor($r('app.color.black_60'))
|
|
|
+ // Text(this.materialBox === 1 || this.materialBox === 2 ? this.taskSheetId : '-')
|
|
|
+ // .height('50%')
|
|
|
+ // .fontWeight(FontWeight.Regular)
|
|
|
+ // .fontSize($r('app.float.fontSize_20'))
|
|
|
+ // .fontColor($r('app.color.black_100'))
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('30%')
|
|
@@ -199,14 +246,11 @@ export struct IntelligentWarehousingGo {
|
|
|
.fontSize($r('app.float.fontSize_20'))
|
|
|
.fontColor($r('app.color.black_60'))
|
|
|
Blank()
|
|
|
- Text(this.materialBox === 1 || this.materialBox === 2 ? this.weight.toString() : '-')
|
|
|
+ Text(this.recentlyRecordObject.weight)
|
|
|
.fontSize(px2vp(48))
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
.fontColor(this.weight >= 15 ? $r('app.color.brown_100') : $r('app.color.green_100'))
|
|
|
- Text('Kg')
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
+
|
|
|
}
|
|
|
.padding({ right: px2vp(50), left: px2vp(30) })
|
|
|
.width('100%')
|
|
@@ -232,38 +276,26 @@ export struct IntelligentWarehousingGo {
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Row() {
|
|
|
- if (this.weight !== 0 && this.weight <= 15) {
|
|
|
- Button('停止自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ if (this.statusByAuto === 1) {
|
|
|
+ Button('停止', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.width('100%')
|
|
|
.height('90%')
|
|
|
.borderRadius(px2vp(50))
|
|
|
.backgroundColor($r('app.color.brown_100'))
|
|
|
.onClick(() => {
|
|
|
- this.automaticWarehousing = 1
|
|
|
+ this.setStatusByNumber(0)
|
|
|
|
|
|
})
|
|
|
- } else if (this.weight == 0 || this.weight > 15 || this.contraband === 1) {
|
|
|
- Button('启动自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ } else {
|
|
|
+ Button('启动', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.width('100%')
|
|
|
.height('90%')
|
|
|
.borderRadius(px2vp(50))
|
|
|
- .opacity(0.2)
|
|
|
.backgroundColor($r('app.color.blue_100'))
|
|
|
.onClick(() => {
|
|
|
- this.automaticWarehousing = 0
|
|
|
-
|
|
|
+ this.setStatusByNumber(1)
|
|
|
})
|
|
|
}
|
|
|
- // else if (this.weight!==0&&this.weight<=15){
|
|
|
- // Button('启动自动入库', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- // .width('100%')
|
|
|
- // .height('90%')
|
|
|
- // .borderRadius(px2vp(50))
|
|
|
- // .backgroundColor($r('app.color.blue_100'))
|
|
|
- //
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('10%')
|
|
@@ -273,58 +305,58 @@ export struct IntelligentWarehousingGo {
|
|
|
.margin({ right: px2vp(24) })
|
|
|
|
|
|
Column() {
|
|
|
- Row() {
|
|
|
- Image($r('app.media.shaoma'))
|
|
|
- .width(px2vp(32))
|
|
|
- .height(px2vp(32))
|
|
|
- Row() {
|
|
|
- TextInput({ text: this.materialNo,
|
|
|
- placeholder: '请点击扫码或者输入物料编码',
|
|
|
- controller: this.textcontroller })
|
|
|
- .width('92%')
|
|
|
- .placeholderFont({ size: $r('app.float.fontSize_24') })
|
|
|
- .height('100%')
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontSize($r('app.float.fontSize_24'))
|
|
|
- .backgroundColor("#ffff")
|
|
|
- .borderRadius(21)
|
|
|
- .onSubmit(() => {
|
|
|
- //执行什么操作
|
|
|
- if (this.automaticWarehousing === 1) {
|
|
|
- this.materialBox = 1
|
|
|
- console.log('testAge' + '请求参数' + this.materialNo)
|
|
|
- this.ScanStorageCode(this.materialNo).then((obj: MaterialInformationModel) => {
|
|
|
- this.MaterialInformation.push(obj)
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- .onChange((value: string) => {
|
|
|
- // this.itemCode=value
|
|
|
- })
|
|
|
- }.width('80%')
|
|
|
- .padding({ left: 10 })
|
|
|
-
|
|
|
- Image($r('app.media.search'))
|
|
|
- .width(px2vp(32))
|
|
|
- .height(px2vp(32))
|
|
|
- .onClick(async () => {
|
|
|
- if (this.automaticWarehousing === 1) {
|
|
|
- this.materialBox = 1
|
|
|
- console.log('testAge' + '请求参数' + this.materialNo)
|
|
|
- this.ScanStorageCode(this.materialNo).then((obj: MaterialInformationModel) => {
|
|
|
- this.MaterialInformation.push(obj)
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
- .border({ width: 0.1 })
|
|
|
- .borderRadius(40)
|
|
|
- .width(px2vp(608))
|
|
|
- .height(px2vp(80))
|
|
|
- .backgroundColor('#fff')
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
+ // Row() {
|
|
|
+ // Image($r('app.media.shaoma'))
|
|
|
+ // .width(px2vp(32))
|
|
|
+ // .height(px2vp(32))
|
|
|
+ // Row() {
|
|
|
+ // TextInput({ text: this.materialNo,
|
|
|
+ // placeholder: '请点击扫码或者输入物料编码',
|
|
|
+ // controller: this.textcontroller })
|
|
|
+ // .width('92%')
|
|
|
+ // .placeholderFont({ size: $r('app.float.fontSize_24') })
|
|
|
+ // .height('100%')
|
|
|
+ // .fontWeight(FontWeight.Medium)
|
|
|
+ // .fontSize($r('app.float.fontSize_24'))
|
|
|
+ // .backgroundColor("#ffff")
|
|
|
+ // .borderRadius(21)
|
|
|
+ // .onSubmit(() => {
|
|
|
+ // //执行什么操作
|
|
|
+ // if (this.automaticWarehousing === 1) {
|
|
|
+ // this.materialBox = 1
|
|
|
+ // console.log('testAge' + '请求参数' + this.materialNo)
|
|
|
+ // this.ScanStorageCode(this.materialNo).then((obj: MaterialInformationModel) => {
|
|
|
+ // this.MaterialInformation.push(obj)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ // .onChange((value: string) => {
|
|
|
+ // // this.itemCode=value
|
|
|
+ // })
|
|
|
+ // }.width('80%')
|
|
|
+ // .padding({ left: 10 })
|
|
|
+ //
|
|
|
+ // Image($r('app.media.search'))
|
|
|
+ // .width(px2vp(32))
|
|
|
+ // .height(px2vp(32))
|
|
|
+ // .onClick(async () => {
|
|
|
+ // if (this.automaticWarehousing === 1) {
|
|
|
+ // this.materialBox = 1
|
|
|
+ // console.log('testAge' + '请求参数' + this.materialNo)
|
|
|
+ // this.ScanStorageCode(this.materialNo).then((obj: MaterialInformationModel) => {
|
|
|
+ // this.MaterialInformation.push(obj)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // .border({ width: 0.1 })
|
|
|
+ // .borderRadius(40)
|
|
|
+ // .width(px2vp(608))
|
|
|
+ // .height(px2vp(80))
|
|
|
+ // .backgroundColor('#fff')
|
|
|
+ // .justifyContent(FlexAlign.Center)
|
|
|
|
|
|
Column() {
|
|
|
List() {
|
|
@@ -400,13 +432,13 @@ export struct IntelligentWarehousingGo {
|
|
|
.backgroundColor('#fff')
|
|
|
.onClick(() => {
|
|
|
// this.exchangeIndex=exchangeIndex!
|
|
|
- this.index = index
|
|
|
- this.batchCode = item.batchCode!
|
|
|
- this.materialName = item.materialName!
|
|
|
- this.materialNo = item.materialNo!
|
|
|
- this.num = item.num!
|
|
|
- this.seqNo = item.seqNo!
|
|
|
- this.spec = item.spec!
|
|
|
+ // this.index = index
|
|
|
+ // this.batchCode = item.batchCode!
|
|
|
+ // this.materialName = item.materialName!
|
|
|
+ // this.materialNo = item.materialNo!
|
|
|
+ // this.num = item.num!
|
|
|
+ // this.seqNo = item.seqNo!
|
|
|
+ // this.spec = item.spec!
|
|
|
//if (item.exchangeNumber===null){
|
|
|
// this.MaterialInformation[index].exchangeNumber=0
|
|
|
|
|
@@ -437,7 +469,7 @@ export struct IntelligentWarehousingGo {
|
|
|
// seqNo: item.seqNo!,
|
|
|
// spec: item.spec!,
|
|
|
// }
|
|
|
- this.materialDetailsController.open()
|
|
|
+ // this.materialDetailsController.open()
|
|
|
})
|
|
|
}
|
|
|
.swipeAction({ end: this.itemEnd(index) })
|