OutboundStation.ets 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. import { TitleStateComp } from '../common/component/TitleStateComp'
  2. import { CompleteSet } from '../view/CompleteSet'
  3. import { Statistics } from '../view/Statistics'
  4. import { AdjustStorageView } from '../view/storage/AdjustStorageView'
  5. import { ManualOutbound } from '../view/ManualOutbound'
  6. import { WarehouseMap } from './WarehouseMap'
  7. import { MaterialCirculationPage } from './process/MaterialCirculationPage'
  8. import { SureToDoDialog } from '../common/component/SureToDoDialog'
  9. /*
  10. * 出库工位
  11. * */
  12. @Entry
  13. @Component
  14. struct OutboundStation {
  15. //齐套按钮(0:齐套 1:手动出库 2:调仓:3:统计)
  16. @State inboundButton: number = 0
  17. @State Button: number = 0
  18. //仓储和其他仓储点击按钮变色
  19. @State warehouseButton: number = 0
  20. @State isHomePage: boolean = false
  21. fourWidth: number = 280
  22. twoWidth: number = 150
  23. // 切换tab添加提示
  24. goingToChangeTabIndex: number = 0
  25. goingToChangeTab = (tabIndex: number) => {
  26. if (this.inboundButton == 3) {
  27. this.inboundButton = tabIndex
  28. }
  29. else {
  30. this.goingToChangeTabIndex = tabIndex
  31. this.changeTabController.open()
  32. }
  33. }
  34. sureToChangeTab = () => {
  35. this.inboundButton = this.goingToChangeTabIndex
  36. }
  37. cancel = () => {
  38. this.changeTabController.close()
  39. }
  40. changeTabController: CustomDialogController = new CustomDialogController({
  41. builder: SureToDoDialog(
  42. {
  43. cancel: this.cancel,
  44. confirm: this.sureToChangeTab,
  45. title: "提示",
  46. info: '切换会中断当前的操作'
  47. }
  48. ),
  49. alignment: DialogAlignment.Center,
  50. customStyle: true,
  51. autoCancel: false,
  52. })
  53. build() {
  54. Column() {
  55. TitleStateComp({ isHomePage: this.isHomePage, })
  56. Column() {
  57. Row({ space: px2vp(24) }) {
  58. Row() {
  59. Text('智能仓储')
  60. .textAlign(TextAlign.Center)
  61. .borderRadius(px2vp(16))
  62. .width(px2vp(this.fourWidth))
  63. .height(px2vp(80))
  64. .fontWeight(FontWeight.Medium)
  65. .fontSize(px2vp(24))
  66. .fontColor(this.warehouseButton === 0 ? $r('app.color.black_90') : $r('app.color.black_60'))
  67. .backgroundColor(this.warehouseButton === 0 ? $r('app.color.process_divider_white_color') : '')
  68. .onClick(() => {
  69. this.warehouseButton = 0
  70. })
  71. // Blank()
  72. // Text('xxxxxxx')
  73. // .textAlign(TextAlign.Center)
  74. // .borderRadius(px2vp(16))
  75. // .width(px2vp(292))
  76. // .height(px2vp(80))
  77. // .fontWeight(FontWeight.Medium)
  78. // .fontSize(px2vp(24))
  79. // .fontColor(this.warehouseButton===1?$r('app.color.black_90'):$r('app.color.black_60'))
  80. // .backgroundColor(this.warehouseButton===1?$r('app.color.process_divider_white_color'):'')
  81. // .onClick(()=>{
  82. // this.warehouseButton=1
  83. // })
  84. }
  85. .width(px2vp(this.fourWidth))
  86. .borderRadius(px2vp(16))
  87. .height(px2vp(80))
  88. .backgroundColor($r('app.color.black_10'))
  89. Row({ space: px2vp(24) }) {
  90. Text('齐套')
  91. .textAlign(TextAlign.Center)
  92. .borderRadius(px2vp(16))
  93. .width(px2vp(this.twoWidth))
  94. .height(px2vp(80))
  95. .fontWeight(FontWeight.Medium)
  96. .fontSize(px2vp(24))
  97. .fontColor(this.inboundButton === 0 ? $r('app.color.black_90') : $r('app.color.black_60'))
  98. .backgroundColor(this.inboundButton === 0 ? $r('app.color.process_divider_white_color') : '')
  99. .onClick(() => {
  100. this.goingToChangeTab(0)
  101. })
  102. Text('手动出库')
  103. .textAlign(TextAlign.Center)
  104. .borderRadius(px2vp(16))
  105. .width(px2vp(this.fourWidth))
  106. .height(px2vp(80))
  107. .fontWeight(FontWeight.Medium)
  108. .fontSize(px2vp(24))
  109. .fontColor(this.inboundButton === 1 ? $r('app.color.black_90') : $r('app.color.black_60'))
  110. .backgroundColor(this.inboundButton === 1 ? $r('app.color.process_divider_white_color') : '')
  111. .onClick(() => {
  112. this.goingToChangeTab(1)
  113. })
  114. // Text('物料流转')
  115. // .textAlign(TextAlign.Center)
  116. // .borderRadius(px2vp(16))
  117. // .width(px2vp(292))
  118. // .height(px2vp(80))
  119. // .fontWeight(FontWeight.Medium)
  120. // .fontSize(px2vp(24))
  121. // .fontColor(this.inboundButton === 4 ? $r('app.color.black_90') : $r('app.color.black_60'))
  122. // .backgroundColor(this.inboundButton === 4 ? $r('app.color.process_divider_white_color') : '')
  123. // .onClick(() => {
  124. // this.Button = 1
  125. // this.inboundButton = 4
  126. // })
  127. Text('调仓')
  128. .textAlign(TextAlign.Center)
  129. .borderRadius(px2vp(16))
  130. .width(px2vp(this.twoWidth))
  131. .height(px2vp(80))
  132. .fontWeight(FontWeight.Medium)
  133. .fontSize(px2vp(24))
  134. .fontColor(this.inboundButton === 2 ? $r('app.color.black_90') : $r('app.color.black_60'))
  135. .backgroundColor(this.inboundButton === 2 ? $r('app.color.process_divider_white_color') : '')
  136. .onClick(() => {
  137. this.goingToChangeTab(2)
  138. })
  139. Text('统计')
  140. .textAlign(TextAlign.Center)
  141. .borderRadius(px2vp(16))
  142. .width(px2vp(this.twoWidth))
  143. .height(px2vp(80))
  144. .fontWeight(FontWeight.Medium)
  145. .fontSize(px2vp(24))
  146. .fontColor(this.inboundButton === 3 ? $r('app.color.black_90') : $r('app.color.black_60'))
  147. .backgroundColor(this.inboundButton === 3 ? $r('app.color.process_divider_white_color') : '')
  148. .onClick(() => {
  149. this.goingToChangeTab(3)
  150. })
  151. }.width(px2vp(this.fourWidth + this.twoWidth * 3 + 24 * 3))
  152. .borderRadius(px2vp(16))
  153. .height(px2vp(80))
  154. .backgroundColor($r('app.color.black_10'))
  155. }
  156. .width(px2vp(1920))
  157. .height(px2vp(80))
  158. .padding({ left: px2vp(24), right: px2vp(24) })
  159. if (this.warehouseButton === 0 && this.inboundButton === 0) {
  160. //齐套
  161. Column() {
  162. CompleteSet()
  163. }
  164. .margin({ top: px2vp(20), bottom: $r('app.float.topMargins_20') })
  165. .width(px2vp(1920))
  166. .height(px2vp(900))
  167. } else if (this.warehouseButton === 0 && this.inboundButton === 2) {
  168. Column() {
  169. //调仓
  170. //AdjustStorageView()
  171. WarehouseMap()
  172. }
  173. .width('100%')
  174. .height('92%')
  175. } else if (this.warehouseButton === 0 && this.inboundButton === 3) {
  176. Column() {
  177. //智能仓储统计
  178. Statistics()
  179. }
  180. .width('100%')
  181. .height('92%')
  182. }
  183. else if (this.warehouseButton === 0 && this.inboundButton === 1) {
  184. Column() {
  185. //手动出库
  186. ManualOutbound()
  187. }
  188. .margin({ top: $r('app.float.topMargins_20'), bottom: $r('app.float.topMargins_20') })
  189. .width('100%')
  190. .height('92%')
  191. }
  192. else if (this.warehouseButton === 0 && this.inboundButton === 4) {
  193. Column() {
  194. //物料流转
  195. MaterialCirculationPage()
  196. }
  197. .margin({ top: $r('app.float.topMargins_20'), bottom: $r('app.float.topMargins_20') })
  198. .width('100%')
  199. .height('92%')
  200. }
  201. }
  202. .width('100%')
  203. .height('92%')
  204. .padding({ left: px2vp(24), right: px2vp(24) })
  205. .backgroundColor($r('app.color.white_f1f3f5'))
  206. }.width('100%')
  207. .height('100%')
  208. }
  209. }