LittleMaterialsStorage.ets 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. import {ProcessFlow,MaterialList,SingleOrder,BoxGrid,
  2. OrderListComponent,MaterialListComponent} from "../component/OrderMaterialsStorageView"
  3. import {OrderParams,DemandMaterial,MaterialBox, EmptyBox} from "../params/OrderMaterialsStorageParams"
  4. import router from '@ohos.router';
  5. import {NavigationBar} from '../component/NavigationBar'
  6. import {TimeAndTitle} from "../component/TimeAndTitle"
  7. import {InBoundView} from '../component/InBoundView'
  8. @Entry
  9. @Component
  10. struct LittleMaterialsStorage{
  11. @State messages:string[] = []
  12. @State currentStep: number = 1;
  13. @State emptyBoxes: EmptyBox[] = [
  14. { position: 'X-1Y-2' },
  15. { position: 'X-1Y-2' },
  16. { position: 'X-1Y-2' },
  17. { position: 'X-1Y-2' },
  18. { position: 'X-1Y-2' },
  19. { position: 'X-1Y-2' },
  20. { position: 'X-1Y-2' },
  21. { position: 'X-1Y-2' },
  22. { position: 'X-1Y-2' },
  23. { position: 'X-1Y-2' } // 图片显示6个空箱位置
  24. ]
  25. @State materialBoxes: MaterialBox[] = [
  26. // 第一行物料箱
  27. {
  28. id: '1', type: 'material',
  29. name: '物料名称XXXXX',
  30. boxNumber: 'LX-12345',
  31. boxType: '通用类型',
  32. order: 'XXXXX订单',
  33. quantity: 10,
  34. position: 'X-1 Y-2'
  35. },
  36. // 其他2个物料箱...
  37. // 第二行空箱
  38. {
  39. id: '4', type: 'empty',
  40. name: '空箱',
  41. boxNumber: 'LX-67890',
  42. boxType: '通用类型',
  43. position: 'X-3 Y-1'
  44. },
  45. {
  46. id: '1', type: 'material',
  47. name: '物料名称XXXXX',
  48. boxNumber: 'LX-12345',
  49. boxType: '通用类型',
  50. order: 'XXXXX订单',
  51. quantity: 10,
  52. position: 'X-1 Y-2'
  53. },
  54. // 其他2个物料箱...
  55. // 第二行空箱
  56. {
  57. id: '4', type: 'empty',
  58. name: '空箱',
  59. boxNumber: 'LX-67890',
  60. boxType: '通用类型',
  61. position: 'X-3 Y-1'
  62. },
  63. {
  64. id: '1', type: 'material',
  65. name: '物料名称XXXXX',
  66. boxNumber: 'LX-12345',
  67. boxType: '通用类型',
  68. order: 'XXXXX订单',
  69. quantity: 10,
  70. position: 'X-1 Y-2'
  71. },
  72. // 其他2个物料箱...
  73. // 第二行空箱
  74. {
  75. id: '4', type: 'empty',
  76. name: '空箱',
  77. boxNumber: 'LX-67890',
  78. boxType: '通用类型',
  79. position: 'X-3 Y-1'
  80. },
  81. {
  82. id: '1', type: 'material',
  83. name: '物料名称XXXXX',
  84. boxNumber: 'LX-12345',
  85. boxType: '通用类型',
  86. order: 'XXXXX订单',
  87. quantity: 10,
  88. position: 'X-1 Y-2'
  89. },
  90. // 其他2个物料箱...
  91. // 第二行空箱
  92. {
  93. id: '4', type: 'empty',
  94. name: '空箱',
  95. boxNumber: 'LX-67890',
  96. boxType: '通用类型',
  97. position: 'X-3 Y-1'
  98. },
  99. {
  100. id: '1', type: 'material',
  101. name: '物料名称XXXXX',
  102. boxNumber: 'LX-12345',
  103. boxType: '通用类型',
  104. order: 'XXXXX订单',
  105. quantity: 10,
  106. position: 'X-1 Y-2'
  107. },
  108. // 其他2个物料箱...
  109. // 第二行空箱
  110. {
  111. id: '4', type: 'empty',
  112. name: '空箱',
  113. boxNumber: 'LX-67890',
  114. boxType: '通用类型',
  115. position: 'X-3 Y-1'
  116. },
  117. {
  118. id: '1', type: 'material',
  119. name: '物料名称XXXXX',
  120. boxNumber: 'LX-12345',
  121. boxType: '通用类型',
  122. order: 'XXXXX订单',
  123. quantity: 10,
  124. position: 'X-1 Y-2'
  125. },
  126. // 其他2个物料箱...
  127. {
  128. id: '1', type: 'material',
  129. name: '物料名称XXXXX',
  130. boxNumber: 'LX-12345',
  131. boxType: '通用类型',
  132. order: 'XXXXX订单',
  133. quantity: 10,
  134. position: 'X-1 Y-2'
  135. },
  136. // 其他2个物料箱...
  137. // 第二行空箱
  138. {
  139. id: '4', type: 'empty',
  140. name: '空箱',
  141. boxNumber: 'LX-67890',
  142. boxType: '通用类型',
  143. position: 'X-3 Y-1'
  144. }, {
  145. id: '1', type: 'material',
  146. name: '物料名称XXXXX',
  147. boxNumber: 'LX-12345',
  148. boxType: '通用类型',
  149. order: 'XXXXX订单',
  150. quantity: 10,
  151. position: 'X-1 Y-2'
  152. },
  153. // 其他2个物料箱...
  154. // 第二行空箱
  155. {
  156. id: '4', type: 'empty',
  157. name: '空箱',
  158. boxNumber: 'LX-67890',
  159. boxType: '通用类型',
  160. position: 'X-3 Y-1'
  161. },
  162. // 第二行空箱
  163. {
  164. id: '4', type: 'empty',
  165. name: '空箱',
  166. boxNumber: 'LX-67890',
  167. boxType: '通用类型',
  168. position: 'X-3 Y-1'
  169. },
  170. // 其他2个空箱...
  171. ];
  172. @State orders:OrderParams[]= [
  173. { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
  174. { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
  175. { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' },
  176. { orderName: '订单名称XXXXX', orderNo: '123123213', date: '2025/11/11', progress: '50%' },
  177. { orderName: '订单名称XXXX', orderNo: '123123213', date: '2025/11/11', progress: '75%' },
  178. { orderName: '特殊订单', orderNo: 'SH2024001', date: '2024/03/01', progress: '100%' }
  179. ]
  180. build() {
  181. Row() {
  182. Column() {
  183. Row(){
  184. TimeAndTitle()
  185. }.width('100%')
  186. .height('3.4%')
  187. .alignItems(VerticalAlign.Bottom)
  188. .justifyContent(FlexAlign.End)
  189. Row(){
  190. Image($r('app.media.general_return'))
  191. .height($r('app.float.virtualSize_22_4'))
  192. .width($r('app.float.virtualSize_22_4'))
  193. .fillColor($r('app.color.FFFFFF'))
  194. // .onClick(()=> {
  195. // router.back()
  196. // })
  197. Text('零星物料入库')
  198. .fontColor($r('app.color.FFFFFF'))
  199. .fontSize($r('app.float.fontSize_15_2'))
  200. }
  201. .height('4%')
  202. .width('100%')
  203. .justifyContent(FlexAlign.Start)
  204. .margin({left:'5%'})
  205. .onClick(()=> {
  206. router.back()
  207. })
  208. Row(){
  209. Row(){
  210. ProcessFlow({
  211. currentStep:this.currentStep,
  212. firstStepTitle: "调取料箱",
  213. secondStepTitle:"绑定入库",
  214. thirdStepTitle:"",
  215. })
  216. }.width('20%')
  217. .margin({right:'20%'})
  218. NavigationBar().width('20%')
  219. }
  220. .width('100%')
  221. .height('4%')
  222. .margin({top:'1%'})
  223. .justifyContent(FlexAlign.End)
  224. .alignItems(VerticalAlign.Bottom)
  225. if(this.currentStep === 1)
  226. {
  227. Column(){
  228. Row(){
  229. Column(){
  230. Column(){
  231. Row(){
  232. Text('查询物料')
  233. .fontColor($r('app.color.FFFFFF'))
  234. .fontSize($r('app.float.fontSize_15_2'))
  235. .margin({top:'4%'})
  236. }.height('10%')
  237. Row() {
  238. // 左侧二维码图标
  239. Image($r('app.media.material_qr_code')) // 请替换为您的二维码图片资源
  240. .width($r('app.float.virtualSize_16_8'))
  241. .height($r('app.float.virtualSize_16_8'))
  242. .fillColor($r('app.color.FFFFFF'))
  243. .margin({left:'2%'})
  244. // 扫码输入框
  245. TextInput({ placeholder: '请扫描物料编码' })
  246. .type(InputType.Normal)
  247. .placeholderFont({ size: $r('app.float.fontSize_12')})
  248. .placeholderColor($r('app.color.30FFFFFF'))
  249. .fontSize($r('app.float.fontSize_12'))
  250. .fontColor($r('app.color.FFFFFF'))
  251. }
  252. .margin({top:'3%'})
  253. .height('8%')
  254. .width('80%')
  255. .borderRadius($r('app.float.virtualSize_7_2'))
  256. .backgroundColor($r('app.color.000000'))
  257. // 操作说明
  258. Text('通过物料扫码查询当前库存是否有同型号物')
  259. .fontSize($r('app.float.fontSize_8'))
  260. .fontColor($r('app.color.60FFFFFF'))
  261. .width('100%')
  262. .textAlign(TextAlign.Center)
  263. .margin({top:'2%'})
  264. Column() {
  265. Image($r('app.media.arrow_down'))
  266. .width($r('app.float.virtualSize_23'))
  267. .height($r('app.float.virtualSize_23'))
  268. .fillColor($r('app.color.FFFFFF'))
  269. Column({space:5}){
  270. Text('DIANLUBANPCBAADD123124114232423ASD')
  271. .fontSize($r('app.float.fontSize_12'))
  272. .fontColor($r('app.color.0A84FF'))
  273. .textAlign(TextAlign.Start)
  274. .width('100%')
  275. Text('产品型号:12322221232321222332211233')
  276. .fontSize($r('app.float.fontSize_8'))
  277. .fontColor($r('app.color.0A84FF'))
  278. .textAlign(TextAlign.Start)
  279. .width('100%')
  280. Text('序列号:123254213452465346346456')
  281. .fontSize($r('app.float.fontSize_8'))
  282. .fontColor($r('app.color.0A84FF'))
  283. .textAlign(TextAlign.Start)
  284. .width('100%')
  285. Text('数量:10个')
  286. .fontSize($r('app.float.fontSize_8'))
  287. .fontColor($r('app.color.0A84FF'))
  288. .textAlign(TextAlign.Start)
  289. .width('100%')
  290. }.backgroundColor($r('app.color.000000'))
  291. .borderRadius($r('app.float.virtualSize_7_2'))
  292. .padding(16)
  293. .margin({top:'4%'})
  294. .height('40%')
  295. .width('80%')
  296. Row(){
  297. Text('当前有 ')
  298. .fontSize($r('app.float.fontSize_8'))
  299. .fontColor($r('app.color.60FFFFFF'))
  300. Text('6')
  301. .fontSize($r('app.float.fontSize_12'))
  302. .fontColor($r('app.color.0A84FF'))
  303. Text(' 个料箱装有同型号物料')
  304. .fontSize($r('app.float.fontSize_8'))
  305. .fontColor($r('app.color.60FFFFFF'))
  306. }.justifyContent(FlexAlign.Center)
  307. .margin({top:'5%'})
  308. }.margin({top:'4%'})
  309. }.height('100%').width('95%').justifyContent(FlexAlign.Start)
  310. }.width('30%').backgroundColor($r('app.color.10FFFFFF'))
  311. Image($r('app.media.arrow_right'))
  312. .width($r('app.float.virtualSize_23'))
  313. .height($r('app.float.virtualSize_23'))
  314. .fillColor($r('app.color.FFFFFF'))
  315. .margin({left:'-2%',right:'-2%'})
  316. Column(){
  317. Row(){
  318. Text("选择料箱")
  319. .fontColor($r('app.color.FFFFFF'))
  320. .fontSize($r('app.float.fontSize_15_2'))
  321. }.height('10%')
  322. Row() {
  323. BoxGrid({ materialBoxes:this.materialBoxes,emptyBoxes:this.emptyBoxes })
  324. .width('100%')
  325. .height('100%')
  326. }.width('100%').height('90%')
  327. }.width('62%').backgroundColor($r('app.color.10FFFFFF'))
  328. }
  329. .height('85%')
  330. .justifyContent(FlexAlign.SpaceEvenly)
  331. .width('100%')
  332. Row({space:15}){
  333. Button({type:ButtonType.Normal}) {
  334. Text("料箱出库")
  335. .fontSize($r('app.float.fontSize_12'))
  336. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  337. }
  338. .width('22%')
  339. .height('100%')
  340. .backgroundColor($r('app.color.20FFFFFF'))
  341. .borderRadius($r('app.float.virtualSize_6_4'))
  342. //.enabled(!!this.selectedOrderNo) // 只有选中订单时才启用按钮
  343. .onClick(() => {
  344. this.currentStep = 1;
  345. })
  346. Button({type:ButtonType.Normal}) {
  347. Text("下一步")
  348. .fontSize($r('app.float.fontSize_12'))
  349. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  350. }
  351. .width('22%')
  352. .height('100%')
  353. .backgroundColor($r('app.color.20FFFFFF'))
  354. .borderRadius($r('app.float.virtualSize_6_4'))
  355. //.enabled(!!this.selectedOrderNo) // 只有选中订单时才启用按钮
  356. .onClick(() => {
  357. this.currentStep = 2
  358. })
  359. }.width('100%').height('6%').justifyContent(FlexAlign.End).margin({bottom:'3%',right:'5%'})
  360. }.height('83.6%').margin({top:'3%'}).width('100%')
  361. .justifyContent(FlexAlign.SpaceAround)
  362. .width('100%')
  363. }
  364. if(this.currentStep === 2){
  365. Column(){
  366. Row(){
  367. Column(){
  368. Row(){
  369. Column(){
  370. Text("扫码录入")
  371. .fontColor($r('app.color.FFFFFF'))
  372. .fontSize($r('app.float.fontSize_15_2'))
  373. Text('电机生产订单DWS123331223332(电路板-SDASDASFSADASD)')
  374. .fontColor($r('app.color.FFFFFF'))
  375. .fontSize($r('app.float.fontSize_8'))
  376. }.height('100%').width('65%').alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.Center)
  377. Row() {
  378. // 左侧二维码图标
  379. Image($r('app.media.material_qr_code')) // 请替换为您的二维码图片资源
  380. .width($r('app.float.virtualSize_16_8'))
  381. .height($r('app.float.virtualSize_16_8'))
  382. .fillColor($r('app.color.FFFFFF'))
  383. .margin({left:'2%'})
  384. // 扫码输入框
  385. TextInput({ placeholder: '请扫描物料编码' })
  386. .type(InputType.Normal)
  387. .placeholderFont({ size: $r('app.float.fontSize_12')})
  388. .placeholderColor($r('app.color.30FFFFFF'))
  389. .fontSize($r('app.float.fontSize_12'))
  390. .fontColor($r('app.color.FFFFFF'))
  391. }.width('35%')
  392. .borderRadius($r('app.float.virtualSize_7_2'))
  393. .backgroundColor($r('app.color.000000'))
  394. }.justifyContent(FlexAlign.Start)
  395. .height('10%')
  396. .width('95%')
  397. .justifyContent(FlexAlign.Center)
  398. Row() {
  399. MaterialListComponent({orders:this.orders}).width('95%')
  400. }.width('100%').height('90%').justifyContent(FlexAlign.Center)
  401. }.width('62%').backgroundColor($r('app.color.10FFFFFF'))
  402. Image($r('app.media.arrow_right'))
  403. .width($r('app.float.virtualSize_23'))
  404. .height($r('app.float.virtualSize_23'))
  405. .fillColor($r('app.color.FFFFFF'))
  406. .margin({left:'-2%',right:'-2%'})
  407. Column(){
  408. InBoundView({messages:this.messages})
  409. }.width('29%').backgroundColor($r('app.color.10FFFFFF'))
  410. }
  411. .height('85%')
  412. .justifyContent(FlexAlign.SpaceEvenly)
  413. .width('100%')
  414. Row({space:15}){
  415. Button({type:ButtonType.Normal}) {
  416. Text("上一步")
  417. .fontSize($r('app.float.fontSize_12'))
  418. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  419. }
  420. .width('22%')
  421. .height('100%')
  422. .backgroundColor($r('app.color.20FFFFFF'))
  423. .borderRadius($r('app.float.virtualSize_6_4'))
  424. //.enabled(!!this.selectedOrderNo) // 只有选中订单时才启用按钮
  425. .onClick(() => {
  426. this.currentStep = 1;
  427. })
  428. }.width('100%').height('6%').justifyContent(FlexAlign.Start).margin({bottom:'3%',left:'5%'})
  429. }.height('83.6%').margin({top:'3%'}).width('100%')
  430. .justifyContent(FlexAlign.SpaceAround)
  431. .width('100%')
  432. }
  433. }
  434. .width('100%')
  435. .height('100%')
  436. .backgroundColor($r('app.color.000000'))
  437. }
  438. .height('100%')
  439. }
  440. }