|
@@ -1,6 +1,8 @@
|
|
|
import EquipmentRequest from '../common/util/request/EquipmentRequest'
|
|
|
+import JGRequest from '../common/util/request/Request'
|
|
|
import StorageRequest from '../common/util/request/StorageRequest'
|
|
|
import RequestParamModel from '../viewmodel/RequestParamModel'
|
|
|
+import promptAction from '@ohos.promptAction'
|
|
|
|
|
|
export class routerClass {
|
|
|
xRoute?: number
|
|
@@ -12,6 +14,49 @@ export class routerHttp {
|
|
|
YCoordinateIn?: number
|
|
|
}
|
|
|
|
|
|
+export class Adjustment {
|
|
|
+ destx?: string
|
|
|
+ code?: string
|
|
|
+ msg?: string
|
|
|
+ cmdId?: string
|
|
|
+ state?: string
|
|
|
+}
|
|
|
+
|
|
|
+export class carPositionClass {
|
|
|
+ code?: string
|
|
|
+ message?: string
|
|
|
+ data?: dataClass
|
|
|
+}
|
|
|
+
|
|
|
+export class dataClass {
|
|
|
+ x?: number
|
|
|
+ y?: number
|
|
|
+}
|
|
|
+
|
|
|
+enum ChooseStatus {
|
|
|
+ Normal = 0,
|
|
|
+ isChoosing = 1,
|
|
|
+ Chosen = 2, //已经选择了
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+@Extend(Text)
|
|
|
+function commonSquare() {
|
|
|
+ .width(px2vp(55))
|
|
|
+ .height(px2vp(55))
|
|
|
+ .fontColor($r('app.color.blue_100'))
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .border({ width: px2vp(1), color: '#7DC8EA' })
|
|
|
+}
|
|
|
+
|
|
|
+@Extend(Button)
|
|
|
+function choiceBtnSty() {
|
|
|
+ .width(px2vp(292))
|
|
|
+ .borderRadius(px2vp(76))
|
|
|
+ .height(px2vp(80))
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
@Entry
|
|
|
@Component
|
|
|
export struct WarehouseMap {
|
|
@@ -25,15 +70,8 @@ export struct WarehouseMap {
|
|
|
{ xRoute: 9, YRoute: 10 },
|
|
|
{ xRoute: 8, YRoute: 10 },
|
|
|
]
|
|
|
- @State routeIndex: number = 0
|
|
|
- //路径开关
|
|
|
- @State routeIndexSwitch: number = 0
|
|
|
//选择层数颜色
|
|
|
@State selectColor: number = -1
|
|
|
- //调入svg
|
|
|
- @State enterSvg: number = 0
|
|
|
- //调出svg
|
|
|
- @State outSvg: number = 0
|
|
|
@State selectSvg: number = 0
|
|
|
//车坐标
|
|
|
@State carYCoordinate: number = 10
|
|
@@ -47,10 +85,11 @@ export struct WarehouseMap {
|
|
|
@State YCoordinate: number = 0
|
|
|
@State XCoordinate: number = 0
|
|
|
//调入格子
|
|
|
- @State SelectEnter: number = 0
|
|
|
+ @State SelectEnter: number = ChooseStatus.Normal
|
|
|
//调出格子
|
|
|
- @State SelectOut: number = 0
|
|
|
- @State boxNumber: number = 0
|
|
|
+ @State SelectOut: ChooseStatus = ChooseStatus.Normal //点击 选调出料格
|
|
|
+ @State boxNumber: number = 0 //调箱数量
|
|
|
+ @State numberEnable: number = 0 //调入料格的剩余的个数
|
|
|
@State JobHopping: number = 0
|
|
|
scroller: Scroller = new Scroller()
|
|
|
//选择的第几层
|
|
@@ -110,7 +149,7 @@ export struct WarehouseMap {
|
|
|
// destY:this.YCoordinateIn,
|
|
|
// rgvNo:'rgvNo1'
|
|
|
})
|
|
|
- console.log('textTag', 'get请求结果' + JSON.stringify(res));
|
|
|
+
|
|
|
return res
|
|
|
}
|
|
|
//请求车的位置
|
|
@@ -120,9 +159,7 @@ export struct WarehouseMap {
|
|
|
this.carYCoordinate = res.data.y!
|
|
|
this.carXCoordinate = res.data.x!
|
|
|
}
|
|
|
- console.log('textTag', '----------' + JSON.stringify(res));
|
|
|
- console.log('textTag', '----------' + JSON.stringify(this.carYCoordinate));
|
|
|
- console.log('textTag', '----------' + JSON.stringify(this.carXCoordinate));
|
|
|
+
|
|
|
return res
|
|
|
}
|
|
|
// 获取仓库坐标信息,x和y轴的信息
|
|
@@ -130,7 +167,7 @@ export struct WarehouseMap {
|
|
|
let result: number[][] = await StorageRequest.post("/api/v1/wms/position/lineInfo/")
|
|
|
|
|
|
this.XYxis = result
|
|
|
- console.log("---", JSON.stringify(result))
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -144,6 +181,17 @@ export struct WarehouseMap {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // 停止调仓后重置数据
|
|
|
+ resetData = () => {
|
|
|
+ this.JobHopping = 0
|
|
|
+ this.SelectOut = ChooseStatus.Normal
|
|
|
+ this.SelectEnter = ChooseStatus.Normal
|
|
|
+ this.storeyNumber = -1
|
|
|
+ this.boxNumber = 0
|
|
|
+ this.selectStorey = -1
|
|
|
+ this.stop()
|
|
|
+ }
|
|
|
+
|
|
|
build() {
|
|
|
Row() {
|
|
|
Column() {
|
|
@@ -155,13 +203,14 @@ export struct WarehouseMap {
|
|
|
.height(px2vp(80))
|
|
|
.onClick(() => {
|
|
|
if (this.JobHopping === 0) {
|
|
|
+ this.getStorageXYData()
|
|
|
this.promptsController.open()
|
|
|
} else if (this.JobHopping === 1) {
|
|
|
- this.JobHopping = 0
|
|
|
+ this.resetData()
|
|
|
}
|
|
|
})
|
|
|
Blank()
|
|
|
- if (this.storeyNumber !== -1) {
|
|
|
+ if (this.SelectOut == ChooseStatus.Chosen) {
|
|
|
Text('层数')
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.fontWeight(FontWeight.Medium)
|
|
@@ -182,7 +231,8 @@ export struct WarehouseMap {
|
|
|
.onClick(() => {
|
|
|
if (index >= (6 - this.storeyNumber)) {
|
|
|
this.selectStorey = index + 1
|
|
|
- console.log('textTag' + '选择第几层的料箱' + this.selectStorey)
|
|
|
+
|
|
|
+ this.boxNumber = this.storeyNumber - (6 - this.selectStorey)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -268,70 +318,87 @@ export struct WarehouseMap {
|
|
|
List({ space: px2vp(1) }) {
|
|
|
ForEach(y, (x: number, index2: number) => {
|
|
|
ListItem() {
|
|
|
- if (x >= 0) {
|
|
|
+ if (x >= 0 && x != 999) {
|
|
|
Stack() {
|
|
|
- Text(x === 0 ? '' : x.toString())
|
|
|
- .width(px2vp(55))
|
|
|
- .height(px2vp(55))
|
|
|
- .fontColor($r('app.color.blue_100'))
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
- .border({ width: px2vp(1), color: '#7DC8EA' })
|
|
|
- .backgroundColor(x == 999 ? '#E84026 ' : x === 0 ? $r('app.color.white_f1f3f5') : (this.SelectOut === 1 || this.SelectEnter === 1) ? $r('app.color.green_100') : '')
|
|
|
- if (this.routeIndexSwitch === 1) {
|
|
|
- //for (let num = 0; num < this.route.length; num++) {
|
|
|
- Text()
|
|
|
- .width(px2vp(55))
|
|
|
- .height(px2vp(55))
|
|
|
- .fontColor($r('app.color.black_100'))
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
- // .backgroundColor((index1===this.route[this.routeIndex].YRoute&&index2===this.route[this.routeIndex].xRoute)?$r('app.color.green_100'):'')
|
|
|
- // }
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
- Row() {
|
|
|
- Image((index1 === this.carYCoordinate && index2 === this.carXCoordinate) ? $r('app.media.robot_top') : (index1 === this.carYCoordinate && index2 === this.carXCoordinate + 1) ? $r("app.media.robot_arm") : (index1 === this.carYCoordinate1 && index2 === this.carXCoordinate1) ? $r('app.media.car_top') : (index1 === this.carYCoordinate1 && index2 === this.carXCoordinate1 - 1) ? $r('app.media.car_bottom') : '')
|
|
|
- .width(px2vp(55))
|
|
|
- .height(px2vp(55))
|
|
|
- .margin({ right: px2vp(55) })
|
|
|
- .onClick(() => {
|
|
|
- if (x !== -1 && this.SelectOut === 1) {
|
|
|
+ // 根据不同的状态展示不同的颜色
|
|
|
+ // 任何状态下都展示数字
|
|
|
+ Text(x.toString())
|
|
|
+ .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
|
|
|
+
|
|
|
+ // 调出正在选择中
|
|
|
+ if (this.SelectOut == ChooseStatus.isChoosing) {
|
|
|
+ if (Number(x) > 0) {
|
|
|
+ Text(x.toString())
|
|
|
+ .commonSquare().backgroundColor($r('app.color.green_100'))
|
|
|
+ .onClick(() => {
|
|
|
this.YCoordinate = index1
|
|
|
this.XCoordinate = index2
|
|
|
- this.SelectOut = 2
|
|
|
- this.SelectEnter = 3
|
|
|
- this.outSvg = 1
|
|
|
+ this.SelectOut = ChooseStatus.Chosen
|
|
|
this.storeyNumber = x
|
|
|
- console.log('textTag' + '调出坐标' + this.XCoordinate + this.YCoordinate)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Text(x.toString())
|
|
|
+ .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (this.SelectEnter == ChooseStatus.isChoosing) {
|
|
|
+ if (Number(x) < 6 && index1 != this.YCoordinate && index2 != this.XCoordinate) {
|
|
|
+ Text(x.toString())
|
|
|
+ .commonSquare().backgroundColor($r('app.color.green_100'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.YCoordinateIn = index1
|
|
|
+ this.XCoordinateIn = index2
|
|
|
+ this.SelectEnter = ChooseStatus.Chosen
|
|
|
+ this.numberEnable = 6 - Number(x)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Text(x.toString())
|
|
|
+ .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 普通状态下 调出和调入都没有在选择的情况下展示的 小车
|
|
|
+ if (this.SelectOut != ChooseStatus.isChoosing && this.SelectEnter != ChooseStatus.isChoosing) {
|
|
|
+ Row() {
|
|
|
+ Image((index1 === this.carYCoordinate && index2 === this.carXCoordinate) ? $r('app.media.robot_top') : (index1 === this.carYCoordinate && index2 === this.carXCoordinate + 1) ? $r("app.media.robot_arm") : (index1 === this.carYCoordinate1 && index2 === this.carXCoordinate1) ? $r('app.media.car_top') : (index1 === this.carYCoordinate1 && index2 === this.carXCoordinate1 - 1) ? $r('app.media.car_bottom') : '')
|
|
|
+ .width(px2vp(55))
|
|
|
+ .height(px2vp(55))
|
|
|
+ .margin({ right: px2vp(55) })
|
|
|
+ // .onClick(() => {
|
|
|
+ // if (x !== -1 && this.SelectOut === 1) {
|
|
|
+ // this.YCoordinate = index1
|
|
|
+ // this.XCoordinate = index2
|
|
|
+ // this.SelectOut = 2
|
|
|
+ // this.SelectEnter = 3
|
|
|
+ // this.outSvg = 1
|
|
|
+ // this.storeyNumber = x
|
|
|
+ // console.log('textTag' + '调出坐标' + this.XCoordinate + this.YCoordinate)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .width(px2vp(55))
|
|
|
+ .height(px2vp(55))
|
|
|
}
|
|
|
- .justifyContent(FlexAlign.End)
|
|
|
- .width(px2vp(55))
|
|
|
- .height(px2vp(55))
|
|
|
|
|
|
- if ((this.outSvg === 1)) {
|
|
|
- Image(((index1 === this.YCoordinate && index2 === this.XCoordinate)) ? $r('app.media.Retrieve_grid') : '')
|
|
|
+
|
|
|
+ // 展示调出的图标
|
|
|
+ if (index1 === this.YCoordinate && index2 === this.XCoordinate && this.SelectOut == ChooseStatus.Chosen) {
|
|
|
+ Image($r('app.media.Retrieve_grid'))
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
- .onClick(() => {
|
|
|
- if (x !== -1 && this.SelectEnter === 1 && this.SelectOut === 2) {
|
|
|
- this.YCoordinateIn = index1
|
|
|
- this.XCoordinateIn = index2
|
|
|
- this.SelectEnter = 2
|
|
|
- this.enterSvg = 1
|
|
|
- console.log('textTag' + '调入坐标' + this.XCoordinateIn + this.YCoordinateIn)
|
|
|
- }
|
|
|
- })
|
|
|
}
|
|
|
- if (this.enterSvg === 1) {
|
|
|
- Image((((index1 === this.YCoordinateIn && index2 === this.XCoordinateIn))) ? $r('app.media.Transfer_grid') : '')
|
|
|
+ // 展示调入的图标
|
|
|
+ if (this.SelectEnter == ChooseStatus.Chosen && index1 === this.YCoordinateIn && index2 === this.XCoordinateIn) {
|
|
|
+ Image($r('app.media.Transfer_grid'))
|
|
|
.width(px2vp(55))
|
|
|
.height(px2vp(55))
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
Text()
|
|
|
.width(px2vp(55))
|
|
@@ -354,6 +421,8 @@ export struct WarehouseMap {
|
|
|
.width(px2vp(1020))
|
|
|
.height(px2vp(800))
|
|
|
.scrollable(ScrollDirection.Horizontal) // 滚动方向纵向
|
|
|
+
|
|
|
+
|
|
|
if (this.JobHopping === 1) {
|
|
|
Column() {
|
|
|
Column() {
|
|
@@ -367,22 +436,25 @@ export struct WarehouseMap {
|
|
|
}
|
|
|
|
|
|
Blank()
|
|
|
- Button(this.SelectOut === 2 ? '取消选择' : '选调出料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- .borderRadius(8)
|
|
|
- .backgroundColor(this.SelectOut === 2 ? $r('app.color.red_100') : $r('app.color.blue_100'))
|
|
|
- .width(px2vp(292))
|
|
|
- .borderRadius(px2vp(76))
|
|
|
- .height(px2vp(80))
|
|
|
- .onClick(() => {
|
|
|
- if (this.SelectOut === 0 || this.SelectOut === 2) {
|
|
|
- this.SelectOut = 1
|
|
|
- this.YCoordinate = 0
|
|
|
- this.XCoordinate = 0
|
|
|
- this.outSvg = 0
|
|
|
- this.enterSvg = 0
|
|
|
- }
|
|
|
- console.log('textTag' + '-----' + this.SelectOut)
|
|
|
- })
|
|
|
+ if (this.SelectOut == ChooseStatus.Chosen) {
|
|
|
+ Button('取消选择', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ .choiceBtnSty()
|
|
|
+ .backgroundColor($r('app.color.red_100'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.SelectOut = ChooseStatus.Normal
|
|
|
+ this.storeyNumber = -1
|
|
|
+ this.selectStorey = -1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Button('选调出料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ .choiceBtnSty()
|
|
|
+ .backgroundColor($r('app.color.blue_100'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.SelectOut = ChooseStatus.isChoosing
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
Blank()
|
|
|
|
|
|
}
|
|
@@ -402,26 +474,27 @@ export struct WarehouseMap {
|
|
|
.width(px2vp(410))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
Blank()
|
|
|
- Button(this.SelectEnter === 2 ? '取消选择' : '选调入料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- .borderRadius(8)
|
|
|
- .backgroundColor(this.SelectEnter === 3 ? $r('app.color.blue_100') : this.SelectEnter === 2 ? $r('app.color.red_100') : $r('app.color.blue_20'))
|
|
|
- .width(px2vp(292))
|
|
|
- .height(px2vp(80))
|
|
|
- .borderRadius(px2vp(76))
|
|
|
- .onClick(() => {
|
|
|
- if (this.SelectEnter === 3) {
|
|
|
- this.SelectEnter = 1
|
|
|
- console.log('textTag' + '-----' + this.SelectEnter)
|
|
|
- } else if (this.SelectEnter === 2) {
|
|
|
- this.SelectEnter = 1
|
|
|
- //this.outSvg=0
|
|
|
- this.enterSvg = 0
|
|
|
- this.XCoordinateIn = 0
|
|
|
- this.YCoordinateIn = 0
|
|
|
- }
|
|
|
- })
|
|
|
- Blank()
|
|
|
|
|
|
+
|
|
|
+ if (this.SelectEnter == ChooseStatus.Chosen) {
|
|
|
+ Button('取消选择', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ .choiceBtnSty()
|
|
|
+ .backgroundColor($r('app.color.red_100'))
|
|
|
+ .onClick(() => {
|
|
|
+ this.SelectEnter = ChooseStatus.Normal
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Button('选调入料格', { type: ButtonType.Normal, stateEffect: true })
|
|
|
+ .choiceBtnSty()
|
|
|
+ .backgroundColor($r('app.color.blue_100'))
|
|
|
+ .enabled(this.SelectOut == ChooseStatus.Chosen)
|
|
|
+ .onClick(() => {
|
|
|
+ this.SelectEnter = ChooseStatus.isChoosing
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ Blank()
|
|
|
}
|
|
|
.width(px2vp(450))
|
|
|
.height(px2vp(188))
|
|
@@ -432,94 +505,25 @@ export struct WarehouseMap {
|
|
|
.margin({ bottom: px2vp(48) })
|
|
|
|
|
|
Column() {
|
|
|
- Text('调箱数量')
|
|
|
+ Text('调箱数量' + this.boxNumber)
|
|
|
.fontWeight(FontWeight.Medium)
|
|
|
.fontColor($r('app.color.black_100'))
|
|
|
.fontSize($r('app.float.fontSize_24'))
|
|
|
.width(px2vp(410))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Row() {
|
|
|
- Text('调动箱数')
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .width(px2vp(150))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- Text('最大[6]')
|
|
|
- .fontWeight(FontWeight.Regular)
|
|
|
- .fontColor($r('app.color.black_60'))
|
|
|
- .fontSize($r('app.float.fontSize_20'))
|
|
|
- .width(px2vp(150))
|
|
|
- .textAlign(TextAlign.End)
|
|
|
- }.width(px2vp(300))
|
|
|
- .height(px2vp(30))
|
|
|
-
|
|
|
- Blank()
|
|
|
- Row() {
|
|
|
- Image($r('app.media.add_disabled'))
|
|
|
- .width(px2vp(50))
|
|
|
- .height(px2vp(50))
|
|
|
- .onClick(() => {
|
|
|
- if (this.boxNumber < 6) {
|
|
|
- this.boxNumber++
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- Text(this.boxNumber.toString())
|
|
|
- .fontWeight(FontWeight.Medium)
|
|
|
- .fontColor($r('app.color.black_100'))
|
|
|
- .fontSize($r('app.float.fontSize_24'))
|
|
|
- .width(px2vp(80))
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
-
|
|
|
- Image($r('app.media.subtract_disabled'))
|
|
|
- .width(px2vp(50))
|
|
|
- .height(px2vp(50))
|
|
|
- .onClick(() => {
|
|
|
- if (this.boxNumber > 0) {
|
|
|
- this.boxNumber--
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- }.width(px2vp(450))
|
|
|
- .height(px2vp(80))
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
-
|
|
|
- Blank()
|
|
|
-
|
|
|
}
|
|
|
.width(px2vp(450))
|
|
|
- .height(px2vp(188))
|
|
|
.padding(px2vp(20))
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
.borderRadius(px2vp(16))
|
|
|
.backgroundColor($r('app.color.black_10'))
|
|
|
.margin({ bottom: px2vp(48) })
|
|
|
|
|
|
- Button('确认调仓', { type: ButtonType.Normal, stateEffect: true })
|
|
|
- .borderRadius(8)
|
|
|
- .backgroundColor(this.SelectEnter === 2 ? $r('app.color.blue_100') : $r('app.color.blue_20'))
|
|
|
- .width(px2vp(292))
|
|
|
- .height(px2vp(80))
|
|
|
- .borderRadius(px2vp(76))
|
|
|
+ Button('确认调仓', { type: ButtonType.Normal, stateEffect: true }).choiceBtnSty()
|
|
|
+ .backgroundColor((this.SelectEnter == ChooseStatus.Chosen && this.SelectOut == ChooseStatus.Chosen) ? $r('app.color.blue_100') : $r('app.color.blue_20'))
|
|
|
+ .enabled(this.SelectEnter == ChooseStatus.Chosen && this.SelectOut == ChooseStatus.Chosen)
|
|
|
.onClick(() => {
|
|
|
- // this.Adjustment().then((res:Adjustment[])=> {
|
|
|
- // console.log('textTag', '-------执行情况结果 cccccc11' + JSON.stringify(res))
|
|
|
- // })
|
|
|
- for (let index = 0; index < this.route.length; index++) {
|
|
|
- this.routeIndex = index
|
|
|
- }
|
|
|
- this.routeIndexSwitch = 1
|
|
|
- this.enterSvg = 0
|
|
|
- this.SelectEnter = 0
|
|
|
- this.SelectOut = 0
|
|
|
- this.storeyNumber = -1
|
|
|
- this.outSvg = 0
|
|
|
- this.AdjustmentHttp().then((res: Adjustment[]) => {
|
|
|
- console.log('textTag', '-------执行情况结果 cccccc111111' + JSON.stringify(res))
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
+ this.sureToChangeStore()
|
|
|
})
|
|
|
|
|
|
|
|
@@ -536,6 +540,38 @@ export struct WarehouseMap {
|
|
|
.padding({ left: px2vp(24), right: px2vp(24) })
|
|
|
.margin({ top: px2vp(20) })
|
|
|
}
|
|
|
+
|
|
|
+ sureToChangeStore = async () => {
|
|
|
+ // 入的要比调箱数量大
|
|
|
+ if (this.boxNumber > this.numberEnable) {
|
|
|
+
|
|
|
+ promptAction.showToast({
|
|
|
+ message: "调入料格剩余数量小于调箱的数量!",
|
|
|
+ duration: 1800,
|
|
|
+ bottom: '50%'
|
|
|
+ })
|
|
|
+
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // console.log("jjjjjjj", this.XCoordinate, this.YCoordinate, this.XCoordinateIn, this.YCoordinateIn)
|
|
|
+
|
|
|
+ await StorageRequest.post("/api/v1/wms/common/changePosition", {
|
|
|
+ src: `${this.XCoordinate + 1}-${this.YCoordinate + 1}`,
|
|
|
+ dest: `${this.XCoordinateIn + 1}-${this.YCoordinateIn + 1}`,
|
|
|
+ num: this.boxNumber
|
|
|
+ } as RequestParamModel)
|
|
|
+
|
|
|
+ this.resetData()
|
|
|
+
|
|
|
+ }
|
|
|
+ stop = async () => {
|
|
|
+ await JGRequest.get("api/v1/wms/common/startChangePosition/0")
|
|
|
+ }
|
|
|
+
|
|
|
+ aboutToDisappear(): void {
|
|
|
+ this.stop()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@CustomDialog
|
|
@@ -543,6 +579,11 @@ export struct WarehouseMap {
|
|
|
struct prompt {
|
|
|
@Link JobHopping: number
|
|
|
controller: CustomDialogController
|
|
|
+ start = async () => {
|
|
|
+ await JGRequest.get("api/v1/wms/common/startChangePosition/1")
|
|
|
+ this.JobHopping = 1
|
|
|
+ this.controller.close()
|
|
|
+ }
|
|
|
|
|
|
build() {
|
|
|
Column({ space: px2vp(50) }) {
|
|
@@ -572,13 +613,12 @@ struct prompt {
|
|
|
Blank()
|
|
|
Button('确认', { type: ButtonType.Normal, stateEffect: true })
|
|
|
.borderRadius(8)
|
|
|
- .backgroundColor($r('app.color.blue_100'))
|
|
|
+ .backgroundColor($r('app.color.warn_1'))
|
|
|
.width(px2vp(252))
|
|
|
.height(px2vp(69))
|
|
|
.borderRadius(px2vp(76))
|
|
|
.onClick(() => {
|
|
|
- this.JobHopping = 1
|
|
|
- this.controller.close()
|
|
|
+ this.start()
|
|
|
})
|
|
|
}.width(px2vp(600))
|
|
|
.padding({ left: px2vp(30), right: px2vp(30) })
|
|
@@ -590,21 +630,4 @@ struct prompt {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export class Adjustment {
|
|
|
- destx?: string
|
|
|
- code?: string
|
|
|
- msg?: string
|
|
|
- cmdId?: string
|
|
|
- state?: string
|
|
|
-}
|
|
|
|
|
|
-export class carPositionClass {
|
|
|
- code?: string
|
|
|
- message?: string
|
|
|
- data?: dataClass
|
|
|
-}
|
|
|
-
|
|
|
-export class dataClass {
|
|
|
- x?: number
|
|
|
- y?: number
|
|
|
-}
|