MenuView.ets 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { BoundOrder} from "../viewmodel/wms/OrderMaterialsStorageParams"
  2. @Component
  3. export struct StorageList {
  4. @Prop storageData: BoundOrder[] = []
  5. @Prop title: string = ''
  6. private scrollerForList: Scroller = new Scroller()
  7. build() {
  8. Column() {
  9. // 标题部分
  10. Text(this.title)
  11. .fontSize($r('app.float.fontSize_38'))
  12. .fontColor($r('app.color.FFFFFF'))
  13. .width('100%')
  14. .textAlign(TextAlign.Center)
  15. .height('15%')
  16. // 列表部分
  17. List({scroller:this.scrollerForList}) {
  18. ForEach(this.storageData, (item:BoundOrder) => {
  19. ListItem() {
  20. Row() {
  21. // 左侧信息列
  22. Column() {
  23. Text(item.batchCode)
  24. .fontSize($r('app.float.fontSize_24'))
  25. .fontColor($r('app.color.FFFFFF'))
  26. Text(` ${item.materialName} ${item.materialNo}`)
  27. .fontSize($r('app.float.fontSize_16'))
  28. .fontColor($r('app.color.60FFFFFF'))
  29. .margin({ top: 4 })
  30. Text(item.created)
  31. .fontSize($r('app.float.fontSize_16'))
  32. .fontColor($r('app.color.60FFFFFF'))
  33. .margin({ top: 4 })
  34. }
  35. .alignItems(HorizontalAlign.Start)
  36. // 右侧状态列
  37. Column() {
  38. Text(String(item.num))
  39. .fontSize($r('app.float.fontSize_38'))
  40. .fontColor($r('app.color.FFFFFF'))
  41. Text('数量')
  42. .fontSize($r('app.float.fontSize_16'))
  43. .fontColor($r('app.color.60FFFFFF'))
  44. .margin({ top: 4 })
  45. }
  46. .alignItems(HorizontalAlign.End)
  47. }
  48. .justifyContent(FlexAlign.SpaceBetween)
  49. .padding(13)
  50. .width('100%')
  51. }
  52. })
  53. }
  54. .width('100%')
  55. .height('85%')
  56. .divider({
  57. strokeWidth: 1,
  58. color: $r('app.color.333333')
  59. })
  60. } .backgroundColor($r('app.color.10FFFFFF'))
  61. .height('100%')
  62. .justifyContent(FlexAlign.Start)
  63. }
  64. }