WarehouseMap.ets 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. import EquipmentRequest from '../common/util/request/EquipmentRequest'
  2. import JGRequest from '../common/util/request/Request'
  3. import StorageRequest from '../common/util/request/StorageRequest'
  4. import RequestParamModel from '../viewmodel/RequestParamModel'
  5. import promptAction from '@ohos.promptAction'
  6. export class routerClass {
  7. xRoute?: number
  8. YRoute?: number
  9. }
  10. export class routerHttp {
  11. XCoordinateIn?: number
  12. YCoordinateIn?: number
  13. }
  14. export class Adjustment {
  15. destx?: string
  16. code?: string
  17. msg?: string
  18. cmdId?: string
  19. state?: string
  20. }
  21. export class carPositionClass {
  22. code?: string
  23. message?: string
  24. data?: dataClass
  25. }
  26. export class dataClass {
  27. x?: number
  28. y?: number
  29. }
  30. enum ChooseStatus {
  31. Normal = 0,
  32. isChoosing = 1,
  33. Chosen = 2, //已经选择了
  34. }
  35. @Extend(Text)
  36. function commonSquare() {
  37. .width(px2vp(55))
  38. .height(px2vp(55))
  39. .fontColor($r('app.color.blue_100'))
  40. .textAlign(TextAlign.Center)
  41. .border({ width: px2vp(1), color: '#7DC8EA' })
  42. }
  43. @Extend(Button)
  44. function choiceBtnSty() {
  45. .width(px2vp(292))
  46. .borderRadius(px2vp(76))
  47. .height(px2vp(80))
  48. }
  49. @Entry
  50. @Component
  51. export struct WarehouseMap {
  52. //车的位置请求返回数据
  53. @State CarPosition: Array<carPositionClass> = []
  54. @State rgvNo: string = 'rgv1'
  55. @State route: routerClass[] = [
  56. { xRoute: 10, YRoute: 9 },
  57. { xRoute: 10, YRoute: 9 },
  58. { xRoute: 10, YRoute: 10 },
  59. { xRoute: 9, YRoute: 10 },
  60. { xRoute: 8, YRoute: 10 },
  61. ]
  62. //选择层数颜色
  63. @State selectColor: number = -1
  64. @State selectSvg: number = 0
  65. //车坐标
  66. @State carYCoordinate: number = 10
  67. @State carXCoordinate: number = 10
  68. @State carYCoordinate1: number = 8
  69. @State carXCoordinate1: number = 9
  70. //调入xy坐标
  71. @State YCoordinateIn: number = 0
  72. @State XCoordinateIn: number = 0
  73. //调出xy坐标
  74. @State YCoordinate: number = 0
  75. @State XCoordinate: number = 0
  76. //调入格子
  77. @State SelectEnter: number = ChooseStatus.Normal
  78. //调出格子
  79. @State SelectOut: ChooseStatus = ChooseStatus.Normal //点击 选调出料格
  80. @State boxNumber: number = 0 //调箱数量
  81. @State numberEnable: number = 0 //调入料格的剩余的个数
  82. @State JobHopping: number = 0
  83. scroller: Scroller = new Scroller()
  84. //选择的第几层
  85. @State selectStorey: number = -1
  86. //选调出格子有多少层
  87. @State storeyNumber: number = -1
  88. @State private storey: number[] = [6, 5, 4, 3, 2, 1]
  89. @State private YAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  90. @State private XAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
  91. // @State private XAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45]
  92. @State private XYxis: number[][] = [
  93. [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 6, 0, 6, 6],
  94. [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 6, 0, 6, 6],
  95. [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  96. [-1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 6, 6, 6, 0, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  97. [-1, -1, -1, -1, -1, -1, -1, 0, 6, 0, 6, 5, 6, 0, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  98. [-1, -1, -1, -1, -1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  99. [-1, -1, -1, -1, -1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  100. [-1, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  101. [-1, -1, -1, -1, -1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  102. [-1, -1, -1, -1, -1, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  103. [0, 0, 0, -1, -1, 6, 6, 6, 2, 6, 6, 6, 6, 3, 6, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  104. [0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 0, -1, -1, -1, -1, -1, -1, -1, -1],
  105. [0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
  106. ]
  107. @State yNum: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
  108. //提示弹窗
  109. promptsController: CustomDialogController = new CustomDialogController({
  110. builder: prompt({
  111. JobHopping: this.JobHopping
  112. }),
  113. alignment: DialogAlignment.Center,
  114. gridCount: 4,
  115. customStyle: true,
  116. })
  117. //硬件调仓操作
  118. AdjustmentHttp = async (): Promise<Adjustment[]> => {
  119. let res: Adjustment[] = await EquipmentRequest.post("/api/v1/wcs/box/movMultiple",
  120. //todo 坐标加1,二维数组索引从零开始
  121. {
  122. //目标位置
  123. dest: (this.XCoordinateIn + 1) + '-' + (this.YCoordinateIn + 1),
  124. //移动位置
  125. src: (this.XCoordinate + 1) + '-' + (this.YCoordinate + 1),
  126. //todo 数量暂时写死1
  127. num: "1"
  128. } as RequestParamModel)
  129. //
  130. console.log('textTag', 'post请求结果' + JSON.stringify(res)
  131. );
  132. return res
  133. }
  134. Adjustment = async (): Promise<Adjustment[]> => {
  135. let res: Adjustment[] = await EquipmentRequest.get("/api/v1/wcs/rgvs/",
  136. {
  137. // destx:this.XCoordinateIn,
  138. // destY:this.YCoordinateIn,
  139. // rgvNo:'rgvNo1'
  140. })
  141. return res
  142. }
  143. //请求车的位置
  144. CarPositionHttp = async (): Promise<carPositionClass> => {
  145. let res: carPositionClass = await EquipmentRequest.get("/api/v1/wcs/rgv/" + this.rgvNo, {}) as carPositionClass
  146. if (res !== undefined && res.data !== undefined) {
  147. this.carYCoordinate = res.data.y!
  148. this.carXCoordinate = res.data.x!
  149. }
  150. return res
  151. }
  152. // 获取仓库坐标信息,x和y轴的信息
  153. getStorageXYData = async () => {
  154. let result: number[][] = await StorageRequest.post("/api/v1/wms/position/lineInfo/")
  155. console.log("getStorageXYData", JSON.stringify(result))
  156. let doubleArray: number[][] = []
  157. // let arrOne: number[] = []
  158. result.forEach((level1) => {
  159. let arrTwo: number[] = []
  160. level1.forEach((value) => {
  161. if (arrTwo.length < 18) {
  162. arrTwo.push(value)
  163. }
  164. })
  165. doubleArray.push(arrTwo)
  166. })
  167. // doubleArray.push(arrTwo)
  168. console.log("getStorageXYData", JSON.stringify(doubleArray))
  169. this.XYxis = doubleArray
  170. }
  171. aboutToAppear(): void {
  172. this.getStorageXYData()
  173. this.CarPositionHttp().then((res: carPositionClass) => {
  174. console.log('textTag', '-------car现在的位置执行情况结果 cccccc11' + JSON.stringify(res))
  175. })
  176. }
  177. // 停止调仓后重置数据
  178. resetData = () => {
  179. this.JobHopping = 0
  180. this.SelectOut = ChooseStatus.Normal
  181. this.SelectEnter = ChooseStatus.Normal
  182. this.storeyNumber = -1
  183. this.boxNumber = 0
  184. this.selectStorey = -1
  185. this.stop()
  186. }
  187. build() {
  188. Row() {
  189. Column() {
  190. Button(this.JobHopping === 0 ? '启动调仓' : '停止调仓', { type: ButtonType.Normal, stateEffect: true })
  191. .borderRadius(8)
  192. .borderRadius(px2vp(76))
  193. .backgroundColor(this.JobHopping === 0 ? $r('app.color.blue_100') : $r('app.color.red_100'))
  194. .width(px2vp(292))
  195. .height(px2vp(80))
  196. .onClick(() => {
  197. if (this.JobHopping === 0) {
  198. this.getStorageXYData()
  199. this.promptsController.open()
  200. } else if (this.JobHopping === 1) {
  201. this.resetData()
  202. }
  203. })
  204. Blank()
  205. if (this.SelectOut == ChooseStatus.Chosen) {
  206. Text('层数')
  207. .fontSize($r('app.float.fontSize_24'))
  208. .fontWeight(FontWeight.Medium)
  209. .textAlign(TextAlign.Center)
  210. .width(px2vp(292))
  211. .height(px2vp(80))
  212. List({ space: px2vp(20) }) {
  213. ForEach(this.storey, (item: number, index: number) => {
  214. ListItem() {
  215. Text(item.toString())
  216. .width(px2vp(291))
  217. .height(px2vp(80))
  218. .fontColor($r('app.color.black_100'))
  219. .textAlign(TextAlign.Center)
  220. .border({ width: px2vp(1) })
  221. .backgroundColor((index === (this.selectStorey - 1)) ? $r('app.color.red_100') : index >= (6 - this.storeyNumber) ? $r('app.color.green_100') : $r('app.color.white_f1f3f5'))
  222. .borderRadius(px2vp(16))
  223. .onClick(() => {
  224. if (index >= (6 - this.storeyNumber)) {
  225. this.selectStorey = index + 1
  226. this.boxNumber = this.storeyNumber - (6 - this.selectStorey)
  227. }
  228. })
  229. }
  230. })
  231. }
  232. .scrollBar(BarState.Off)
  233. .width(px2vp(292))
  234. .height(px2vp(600))
  235. }
  236. }.width(px2vp(292))
  237. .height(px2vp(800))
  238. .margin({ right: px2vp(24) })
  239. Column() {
  240. Row() {
  241. Column() {
  242. Text('y')
  243. .width(px2vp(25))
  244. .height(px2vp(25))
  245. .fontColor($r('app.color.order_producing_state_background'))
  246. .textAlign(TextAlign.Center)
  247. }
  248. .width(px2vp(25))
  249. .height(px2vp(55))
  250. .justifyContent(FlexAlign.End)
  251. Column() {
  252. Text('x')
  253. .width(px2vp(25))
  254. .height(px2vp(25))
  255. .fontColor($r('app.color.order_producing_state_background'))
  256. .textAlign(TextAlign.Center)
  257. }
  258. .width(px2vp(25))
  259. .height(px2vp(55))
  260. .justifyContent(FlexAlign.Start)
  261. }
  262. .width(px2vp(50))
  263. .height(px2vp(55))
  264. List({ space: px2vp(1) }) {
  265. ForEach(this.YAxis, (item: number, index: number) => {
  266. ListItem() {
  267. Text(item.toString())
  268. .width(px2vp(55))
  269. .height(px2vp(55))
  270. .fontColor($r('app.color.black_10'))
  271. .textAlign(TextAlign.Center)
  272. }
  273. })
  274. }
  275. .scrollBar(BarState.Off)
  276. .width(px2vp(60))
  277. .height(px2vp(745))
  278. }
  279. .width(px2vp(60))
  280. .height(px2vp(800))
  281. Scroll(this.scroller) {
  282. Column() {
  283. List({ space: px2vp(1) }) {
  284. ForEach(this.XAxis, (item: number, index: number) => {
  285. ListItem() {
  286. Text(item.toString())
  287. .width(px2vp(55))
  288. .height(px2vp(55))
  289. .fontColor($r('app.color.black_10'))
  290. .textAlign(TextAlign.Center)
  291. }
  292. })
  293. }
  294. .listDirection(Axis.Horizontal)
  295. .scrollBar(BarState.Off)
  296. .width(px2vp(1020))
  297. .height(px2vp(55))
  298. List({ space: px2vp(1) }) {
  299. ForEach(this.XYxis, (y: number[], index1: number) => {
  300. ListItem() {
  301. List({ space: px2vp(1) }) {
  302. ForEach(y, (x: number, index2: number) => {
  303. ListItem() {
  304. if (x >= 0 && x != 999) {
  305. Stack() {
  306. // 根据不同的状态展示不同的颜色
  307. // 任何状态下都展示数字
  308. Text(x.toString())
  309. .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
  310. // 调出正在选择中
  311. if (this.SelectOut == ChooseStatus.isChoosing) {
  312. if (Number(x) > 0) {
  313. Text(x.toString())
  314. .commonSquare().backgroundColor($r('app.color.green_100'))
  315. .onClick(() => {
  316. this.YCoordinate = index1
  317. this.XCoordinate = index2
  318. this.SelectOut = ChooseStatus.Chosen
  319. this.storeyNumber = x
  320. })
  321. }
  322. else {
  323. Text(x.toString())
  324. .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
  325. }
  326. }
  327. else if (this.SelectEnter == ChooseStatus.isChoosing) {
  328. if (Number(x) < 6 && index1 != this.YCoordinate && index2 != this.XCoordinate) {
  329. Text(x.toString())
  330. .commonSquare().backgroundColor($r('app.color.green_100'))
  331. .onClick(() => {
  332. this.YCoordinateIn = index1
  333. this.XCoordinateIn = index2
  334. this.SelectEnter = ChooseStatus.Chosen
  335. this.numberEnable = 6 - Number(x)
  336. })
  337. }
  338. else {
  339. Text(x.toString())
  340. .commonSquare().backgroundColor($r('app.color.white_f1f3f5'))
  341. }
  342. }
  343. // 普通状态下 调出和调入都没有在选择的情况下展示的 小车
  344. if (this.SelectOut != ChooseStatus.isChoosing && this.SelectEnter != ChooseStatus.isChoosing) {
  345. Row() {
  346. 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') : '')
  347. .width(px2vp(55))
  348. .height(px2vp(55))
  349. .margin({ right: px2vp(55) })
  350. // .onClick(() => {
  351. // if (x !== -1 && this.SelectOut === 1) {
  352. // this.YCoordinate = index1
  353. // this.XCoordinate = index2
  354. // this.SelectOut = 2
  355. // this.SelectEnter = 3
  356. // this.outSvg = 1
  357. // this.storeyNumber = x
  358. // console.log('textTag' + '调出坐标' + this.XCoordinate + this.YCoordinate)
  359. // }
  360. // })
  361. }
  362. .justifyContent(FlexAlign.End)
  363. .width(px2vp(55))
  364. .height(px2vp(55))
  365. }
  366. // 展示调出的图标
  367. if (index1 === this.YCoordinate && index2 === this.XCoordinate && this.SelectOut == ChooseStatus.Chosen) {
  368. Image($r('app.media.Retrieve_grid'))
  369. .width(px2vp(55))
  370. .height(px2vp(55))
  371. }
  372. // 展示调入的图标
  373. if (this.SelectEnter == ChooseStatus.Chosen && index1 === this.YCoordinateIn && index2 === this.XCoordinateIn) {
  374. Image($r('app.media.Transfer_grid'))
  375. .width(px2vp(55))
  376. .height(px2vp(55))
  377. }
  378. }
  379. } else {
  380. Text()
  381. .width(px2vp(55))
  382. .height(px2vp(55))
  383. .fontColor($r('app.color.black_100'))
  384. .textAlign(TextAlign.Center)
  385. }
  386. }
  387. })
  388. }
  389. .listDirection(Axis.Horizontal)
  390. }
  391. })
  392. }
  393. .scrollBar(BarState.Off)
  394. }.width(px2vp(1020))
  395. .height(px2vp(800))
  396. }
  397. .width(px2vp(1020))
  398. .height(px2vp(800))
  399. .scrollable(ScrollDirection.Horizontal) // 滚动方向纵向
  400. if (this.JobHopping === 1) {
  401. Column() {
  402. Column() {
  403. Row() {
  404. Text('调出料格')
  405. .fontWeight(FontWeight.Medium)
  406. .fontColor($r('app.color.black_100'))
  407. .fontSize($r('app.float.fontSize_24'))
  408. .width(px2vp(410))
  409. .textAlign(TextAlign.Start)
  410. }
  411. Blank()
  412. if (this.SelectOut == ChooseStatus.Chosen) {
  413. Button('取消选择', { type: ButtonType.Normal, stateEffect: true })
  414. .choiceBtnSty()
  415. .backgroundColor($r('app.color.red_100'))
  416. .onClick(() => {
  417. this.SelectOut = ChooseStatus.Normal
  418. this.storeyNumber = -1
  419. this.selectStorey = -1
  420. })
  421. }
  422. else {
  423. Button('选调出料格', { type: ButtonType.Normal, stateEffect: true })
  424. .choiceBtnSty()
  425. .backgroundColor($r('app.color.blue_100'))
  426. .onClick(() => {
  427. this.SelectOut = ChooseStatus.isChoosing
  428. })
  429. }
  430. Blank()
  431. }
  432. .width(px2vp(450))
  433. .height(px2vp(188))
  434. .padding(px2vp(20))
  435. .alignItems(HorizontalAlign.Center)
  436. .borderRadius(px2vp(16))
  437. .backgroundColor($r('app.color.black_10'))
  438. .margin({ bottom: px2vp(48) })
  439. Column() {
  440. Text('调入料格')
  441. .fontWeight(FontWeight.Medium)
  442. .fontColor($r('app.color.black_100'))
  443. .fontSize($r('app.float.fontSize_24'))
  444. .width(px2vp(410))
  445. .textAlign(TextAlign.Start)
  446. Blank()
  447. if (this.SelectEnter == ChooseStatus.Chosen) {
  448. Button('取消选择', { type: ButtonType.Normal, stateEffect: true })
  449. .choiceBtnSty()
  450. .backgroundColor($r('app.color.red_100'))
  451. .onClick(() => {
  452. this.SelectEnter = ChooseStatus.Normal
  453. })
  454. }
  455. else {
  456. Button('选调入料格', { type: ButtonType.Normal, stateEffect: true })
  457. .choiceBtnSty()
  458. .backgroundColor($r('app.color.blue_100'))
  459. .enabled(this.SelectOut == ChooseStatus.Chosen)
  460. .onClick(() => {
  461. this.SelectEnter = ChooseStatus.isChoosing
  462. })
  463. }
  464. Blank()
  465. }
  466. .width(px2vp(450))
  467. .height(px2vp(188))
  468. .padding(px2vp(20))
  469. .alignItems(HorizontalAlign.Center)
  470. .borderRadius(px2vp(16))
  471. .backgroundColor($r('app.color.black_10'))
  472. .margin({ bottom: px2vp(48) })
  473. Column() {
  474. Text('调箱数量' + this.boxNumber)
  475. .fontWeight(FontWeight.Medium)
  476. .fontColor($r('app.color.black_100'))
  477. .fontSize($r('app.float.fontSize_24'))
  478. .width(px2vp(410))
  479. .textAlign(TextAlign.Start)
  480. }
  481. .width(px2vp(450))
  482. .padding(px2vp(20))
  483. .alignItems(HorizontalAlign.Center)
  484. .borderRadius(px2vp(16))
  485. .backgroundColor($r('app.color.black_10'))
  486. .margin({ bottom: px2vp(48) })
  487. Button('确认调仓', { type: ButtonType.Normal, stateEffect: true }).choiceBtnSty()
  488. .backgroundColor((this.SelectEnter == ChooseStatus.Chosen && this.SelectOut == ChooseStatus.Chosen) ? $r('app.color.blue_100') : $r('app.color.blue_20'))
  489. .enabled(this.SelectEnter == ChooseStatus.Chosen && this.SelectOut == ChooseStatus.Chosen)
  490. .onClick(() => {
  491. this.sureToChangeStore()
  492. })
  493. }.width(px2vp(450))
  494. .height(px2vp(800))
  495. .margin({ left: px2vp(24) })
  496. } else if (this.JobHopping === 1) {
  497. }
  498. }
  499. .width(px2vp(1920))
  500. .height(px2vp(800))
  501. .padding({ left: px2vp(24), right: px2vp(24) })
  502. .margin({ top: px2vp(20) })
  503. }
  504. sureToChangeStore = async () => {
  505. // 入的要比调箱数量大
  506. if (this.boxNumber > this.numberEnable) {
  507. promptAction.showToast({
  508. message: "调入料格剩余数量小于调箱的数量!",
  509. duration: 1800,
  510. bottom: '50%'
  511. })
  512. return
  513. }
  514. // console.log("jjjjjjj", this.XCoordinate, this.YCoordinate, this.XCoordinateIn, this.YCoordinateIn)
  515. await StorageRequest.post("/api/v1/wms/common/changePosition", {
  516. src: `${this.XCoordinate + 1}-${this.YCoordinate + 1}`,
  517. dest: `${this.XCoordinateIn + 1}-${this.YCoordinateIn + 1}`,
  518. num: this.boxNumber
  519. } as RequestParamModel)
  520. this.resetData()
  521. }
  522. stop = async () => {
  523. await JGRequest.get("api/v1/wms/common/startChangePosition/0")
  524. }
  525. aboutToDisappear(): void {
  526. this.stop()
  527. }
  528. }
  529. @CustomDialog
  530. ///无批次号物料详情弹窗
  531. struct prompt {
  532. @Link JobHopping: number
  533. controller: CustomDialogController
  534. start = async () => {
  535. await JGRequest.get("api/v1/wms/common/startChangePosition/1")
  536. this.JobHopping = 1
  537. this.controller.close()
  538. }
  539. build() {
  540. Column({ space: px2vp(50) }) {
  541. Text('调仓确认')
  542. .fontSize($r('app.float.fontSize_50'))
  543. .fontWeight(FontWeight.Medium)
  544. .fontColor($r('app.color.black_100'))
  545. .textAlign(TextAlign.Center)
  546. .width(px2vp(400))
  547. .margin({ top: px2vp(30) })
  548. Text('启动调仓后,其他工位将无法叫料,是否开始?')
  549. .fontSize($r('app.float.fontSize_24'))
  550. .fontWeight(FontWeight.Medium)
  551. .fontColor($r('app.color.black_100'))
  552. .textAlign(TextAlign.Center)
  553. .width(px2vp(400))
  554. Row() {
  555. Button('取消', { type: ButtonType.Normal, stateEffect: true })
  556. .borderRadius(8)
  557. .backgroundColor($r('app.color.blue_100'))
  558. .width(px2vp(252))
  559. .height(px2vp(69))
  560. .borderRadius(px2vp(76))
  561. .onClick(() => {
  562. this.controller.close()
  563. })
  564. Blank()
  565. Button('确认', { type: ButtonType.Normal, stateEffect: true })
  566. .borderRadius(8)
  567. .backgroundColor($r('app.color.warn_1'))
  568. .width(px2vp(252))
  569. .height(px2vp(69))
  570. .borderRadius(px2vp(76))
  571. .onClick(() => {
  572. this.start()
  573. })
  574. }.width(px2vp(600))
  575. .padding({ left: px2vp(30), right: px2vp(30) })
  576. }.width(px2vp(800))
  577. .height(px2vp(400))
  578. .backgroundColor($r('app.color.white_f1f3f5'))
  579. .borderRadius(16)
  580. }
  581. }