jobBooking.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
  4. color="#000" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
  5. </uni-nav-bar>
  6. <view class="list_box">
  7. <u-list @scrolltolower="scrolltolower">
  8. <view class="card_box">
  9. <workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
  10. <sampleBom :item='objData.quality' v-if='objData.quality' :workReportInfo='objData.workReportInfo'
  11. :isDetails='true'></sampleBom>
  12. </view>
  13. </u-list>
  14. </view>
  15. <view class="bottom-wrapper">
  16. <view class="btn_box" @click="save">一键报工</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. getByIdReport,
  23. jobSave
  24. } from '@/api/pda/jobBooking.js'
  25. import sampleBom from '../components/sampleBom.vue'
  26. import workOrderBom from '../../feeding/components/workOrderBom.vue'
  27. export default {
  28. components: {
  29. workOrderBom,
  30. sampleBom
  31. },
  32. data() {
  33. return {
  34. title: '',
  35. objData: {},
  36. id: null,
  37. taskId: null,
  38. }
  39. },
  40. onLoad(options) {
  41. this.title = options.taskName ? options.taskName + '-报工' : '报工'
  42. this.id = options.workOrderId
  43. this.taskId = options.taskId
  44. this.getList()
  45. },
  46. onShow() {
  47. },
  48. methods: {
  49. getList() {
  50. getByIdReport(this.id, this.taskId).then(res => {
  51. res.workReportInfo = {
  52. formingNum: null,
  53. formingWeight: null,
  54. formedNum: null,
  55. formedWeight: null,
  56. taskId: this.taskId,
  57. reportType: 2
  58. }
  59. this.objData = res
  60. })
  61. },
  62. scrolltolower() {},
  63. save() {
  64. if (Number(this.objData.workReportInfo.formedNum) <= 0 || this.objData.workReportInfo.formedNum == null) {
  65. uni.showToast({
  66. icon: 'none',
  67. title: '请输入合格数量'
  68. })
  69. return false
  70. }
  71. jobSave(this.objData).then(res => {
  72. if (res) {
  73. uni.navigateBack()
  74. }
  75. })
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .content-box {
  82. height: 100vh;
  83. overflow: hidden;
  84. display: flex;
  85. flex-direction: column;
  86. }
  87. .list_box {
  88. flex: 1;
  89. overflow: hidden;
  90. padding: 4rpx 0;
  91. .u-list {
  92. height: 100% !important;
  93. }
  94. .card_box {
  95. padding: 16rpx 24rpx;
  96. }
  97. }
  98. .bottom-wrapper {
  99. .btn_box {
  100. width: 750rpx;
  101. height: 88rpx;
  102. line-height: 88rpx;
  103. background: $theme-color;
  104. text-align: center;
  105. font-size: 36rpx;
  106. font-style: normal;
  107. font-weight: 400;
  108. color: #fff;
  109. }
  110. }
  111. .search_list {
  112. min-height: 500rpx;
  113. padding: 0 32rpx;
  114. }
  115. </style>