OrderMaterialStorageFirstStep.ets 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import {MaterialList,OrderListComponent} from "../../component/OrderMaterialsStorageView"
  2. import {OrderParams,DemandMaterial} from "../../params/OrderMaterialsStorageParams"
  3. import WmsRequest from '../../common/util/request/WmsRequest'
  4. import RequestParamModel from '../../viewmodel/wms/RequestParamModel'
  5. import WorkOrderInfo from '../../viewmodel/wms/WorkOrderInfo'
  6. import WorkOrderMaterialInfo from "../../viewmodel/wms/WorkOrderMaterialInfo"
  7. @Component
  8. export struct OrderMaterialStorageFirstStep {
  9. @Link currentStep: number
  10. @Link materialData: WorkOrderMaterialInfo[] ;
  11. @Link selectWorkOrder: WorkOrderInfo
  12. @State workOrderArray: WorkOrderInfo[] = []
  13. @State nextStepButtonClick:number =1
  14. loadWorkOrders = async () => {
  15. this.workOrderArray = await WmsRequest.post('/api/v1/plan/workOrder/list', {
  16. queryComplete: 0,
  17. } as RequestParamModel) as WorkOrderInfo[]
  18. }
  19. aboutToAppear(): void {
  20. this.loadWorkOrders();
  21. this.selectWorkOrder = {}
  22. }
  23. build() {
  24. Column(){
  25. Row(){
  26. Column(){
  27. Row(){
  28. Text("选择工单")
  29. .fontColor($r('app.color.FFFFFF'))
  30. .fontSize($r('app.float.fontSize_15_2'))
  31. }.height('10%')
  32. Row(){
  33. OrderListComponent({
  34. workOrders:this.workOrderArray,
  35. selectWorkOrder: this.selectWorkOrder,
  36. materialData:this.materialData
  37. }).width('95%').height('90%')
  38. }
  39. }.width('30%').backgroundColor($r('app.color.10FFFFFF'))
  40. Image($r('app.media.arrow_right'))
  41. .width($r('app.float.virtualSize_23'))
  42. .height($r('app.float.virtualSize_23'))
  43. .fillColor($r('app.color.FFFFFF'))
  44. .margin({left:'-2%',right:'-2%'})
  45. Column(){
  46. Row(){
  47. Text("需求物料")
  48. .fontColor($r('app.color.FFFFFF'))
  49. .fontSize($r('app.float.fontSize_15_2'))
  50. }.height('10%')
  51. Row() {
  52. MaterialList({ MaterialData: this.materialData })
  53. .width('100%')
  54. .height('100%')
  55. }.width('95%').height('90%')
  56. }.width('62%').backgroundColor($r('app.color.10FFFFFF'))
  57. }
  58. .height('85%')
  59. .justifyContent(FlexAlign.SpaceEvenly)
  60. .width('100%')
  61. Button({type:ButtonType.Normal}) {
  62. Text("下一步")
  63. .fontSize($r('app.float.fontSize_12'))
  64. .fontColor($r('app.color.0A84FF')) // 图片中的蓝色
  65. }
  66. .width('22%')
  67. .height('6%')
  68. .margin({bottom:'3%',left:'73%'})
  69. .backgroundColor(this.selectWorkOrder.orderCode ?$r('app.color.20FFFFFF'):$r('app.color.10FFFFFF'))
  70. .borderRadius($r('app.float.virtualSize_6_4'))
  71. .enabled(!!this.selectWorkOrder.orderCode ) // 只有选中订单时才启用按钮
  72. .scale({ x: this.nextStepButtonClick, y: this.nextStepButtonClick })
  73. .animation({
  74. duration: 200,
  75. curve: Curve.Linear // 弹性曲线更生动
  76. })
  77. .onClick(() => {
  78. this.nextStepButtonClick = 0.9;
  79. setTimeout(() => {
  80. this.nextStepButtonClick = 1;
  81. this.currentStep = 2;
  82. }, 200);
  83. })
  84. }.height('83.6%').margin({top:'3%'}).width('100%')
  85. .justifyContent(FlexAlign.SpaceAround)
  86. .width('100%')
  87. }
  88. }