index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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">
  5. </uni-nav-bar>
  6. <view class="list_box">
  7. <u-list @scrolltolower="scrolltolower">
  8. <view class="card_box" v-for="(item,index) in List" :key="index">
  9. <workOrderBom :item='item' v-if='item' :isDetails='true'></workOrderBom>
  10. <sampleBom :item='item.quality' v-if='item.quality'></sampleBom>
  11. </view>
  12. </u-list>
  13. </view>
  14. <view class="bottom-wrapper">
  15. <view class="btn_box" @click="save">一键报工</view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. workorderList,
  23. } from '@/api/pda/workOrder.js'
  24. import workOrderBom from '../../feeding/components/workOrderBom.vue'
  25. import sampleBom from '../components/sampleBom.vue'
  26. import {
  27. batchSave
  28. } from '@/api/pda/feeding.js'
  29. export default {
  30. components: {
  31. workOrderBom,
  32. sampleBom
  33. },
  34. data() {
  35. return {
  36. title: null,
  37. id: null,
  38. taskId: null,
  39. List: []
  40. }
  41. },
  42. onLoad(options) {
  43. this.title = options.taskName ? options.taskName : '质检'
  44. this.id = options.workOrderId
  45. this.taskId = options.taskId
  46. this.getList()
  47. },
  48. methods: {
  49. getList() {
  50. workorderList({
  51. ids: [this.id],
  52. taskId: this.taskId
  53. }).then(res => {
  54. this.List = res.map(m => {
  55. m.workOrderId = m.id
  56. m.quality['sampleList'] = []
  57. delete m.id
  58. return {
  59. ...m
  60. }
  61. })
  62. })
  63. },
  64. scrolltolower() {},
  65. save() {
  66. console.log(this.List)
  67. return false
  68. batchSave(this.List).then(res => {
  69. uni.navigateBack()
  70. })
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .content-box {
  77. height: 100vh;
  78. overflow: hidden;
  79. display: flex;
  80. flex-direction: column;
  81. }
  82. .list_box {
  83. flex: 1;
  84. overflow: hidden;
  85. padding: 4rpx 0;
  86. .u-list {
  87. height: 100% !important;
  88. }
  89. .card_box {
  90. padding: 16rpx 24rpx;
  91. }
  92. }
  93. .bottom-wrapper {
  94. .btn_box {
  95. width: 750rpx;
  96. height: 88rpx;
  97. line-height: 88rpx;
  98. background: $theme-color;
  99. text-align: center;
  100. font-size: 36rpx;
  101. font-style: normal;
  102. font-weight: 400;
  103. color: #fff;
  104. }
  105. }
  106. .operate_box {
  107. padding: 10rpx 160rpx;
  108. /deep/ .u-button {
  109. width: 160rpx;
  110. }
  111. }
  112. </style>