jobBooking.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. formedNum: null,
  53. taskId: this.taskId,
  54. reportType: 2,
  55. formingNum: res.formingNum,
  56. formingWeight: res.formingWeight,
  57. formedWeight: res.formedWeight,
  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. uni.navigateBack()
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .content-box {
  80. height: 100vh;
  81. overflow: hidden;
  82. display: flex;
  83. flex-direction: column;
  84. }
  85. .list_box {
  86. flex: 1;
  87. overflow: hidden;
  88. padding: 4rpx 0;
  89. .u-list {
  90. height: 100% !important;
  91. }
  92. .card_box {
  93. padding: 16rpx 24rpx;
  94. }
  95. }
  96. .bottom-wrapper {
  97. .btn_box {
  98. width: 750rpx;
  99. height: 88rpx;
  100. line-height: 88rpx;
  101. background: $theme-color;
  102. text-align: center;
  103. font-size: 36rpx;
  104. font-style: normal;
  105. font-weight: 400;
  106. color: #fff;
  107. }
  108. }
  109. .search_list {
  110. min-height: 500rpx;
  111. padding: 0 32rpx;
  112. }
  113. </style>