LittleMaterialsStorage.ets 16 KB

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