list.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <view>
  4. <sl-filter :themeColor="themeColor" :menuList="menuList" @result="result"></sl-filter>
  5. </view>
  6. <scroll-view :scroll-y="true" class="page">
  7. <view class="cu-list menu card-menu margin-top">
  8. <view class="cu-item" style="margin-top: 10rpx;" v-for="(item,index) in data" @click="itemClick(item)">
  9. <view class="content">
  10. <view class="cu-form-group">
  11. <view class="title" style="min-width: calc(6em + 15px);">制衣生产车间</view>
  12. <text class="text-grey" style="flex: 1;">{{item.zyProductWorkshop}}</text>
  13. </view>
  14. <view class="cu-form-group">
  15. <view class="title" style="min-width: calc(6em + 15px);">制衣班组</view>
  16. <text class="text-grey" style="flex: 1;">{{item.zyTeam}}</text>
  17. </view>
  18. <view class="cu-form-group">
  19. <view class="title" style="min-width: calc(6em + 15px);">库存量</view>
  20. <text class="text-grey" style="flex: 1;">{{item.stockQty}}</text>
  21. </view>
  22. <view class="cu-form-group">
  23. <view class="title" style="min-width: calc(6em + 15px);">订单号</view>
  24. <text class="text-grey" style="flex: 1;">{{item.orderNo}}</text>
  25. </view>
  26. <view class="cu-form-group">
  27. <view class="title" style="min-width: calc(6em + 15px);">交期</view>
  28. <text class="text-grey" style="flex: 1;">{{item.deliveryDate}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. <dp-number-modal ref="dpNumberModal" @confirm='dpNumberModalConfirm'></dp-number-modal>
  35. <u-notify ref='uNotify'></u-notify>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. listAvailable
  41. } from '@/api/biz/filing.js'
  42. import {
  43. add
  44. } from '@/api/biz/back.js'
  45. import dpNumberModal from '@/components/dp-number-modal/dp-number-modal.vue'
  46. export default {
  47. components: {
  48. dpNumberModal
  49. },
  50. data() {
  51. return {
  52. themeColor: '#000000',
  53. filterResult: '',
  54. menuList: [{
  55. 'title': '车间',
  56. 'detailTitle': '请选择制衣生产车间(可多选)',
  57. 'isMutiple': true,
  58. 'key': 'workshop',
  59. 'detailList': [{
  60. 'title': '不限',
  61. 'value': ''
  62. }, {
  63. 'title': '制衣一厂',
  64. 'value': '1'
  65. }, {
  66. 'title': '制衣二厂',
  67. 'value': '1'
  68. }]
  69. },
  70. {
  71. 'title': '排序',
  72. 'key': 'sort',
  73. 'isSort': true,
  74. 'detailList': [{
  75. 'title': '默认排序',
  76. 'value': ''
  77. }]
  78. }
  79. ],
  80. data: [],
  81. focusItem: {}
  82. }
  83. },
  84. onLoad() {
  85. this.initData()
  86. },
  87. methods: {
  88. itemClick(item) {
  89. this.$refs.dpNumberModal.show = true
  90. this.focusItem = item
  91. },
  92. dpNumberModalConfirm() {
  93. let id = this.focusItem.id+''
  94. let qty = this.$refs.dpNumberModal.value
  95. const param = {
  96. "orderId": id,
  97. "backQty": qty
  98. }
  99. add(param).then(res=>{
  100. if(res.success){
  101. this.$refs.uNotify.show({
  102. type: 'success',
  103. message: "送活操作成功"
  104. })
  105. this.$refs.dpNumberModal.value=''
  106. this.$refs.dpNumberModal.show = false
  107. this.focusItem.stockQty = parseInt(this.focusItem.stockQty)-parseInt(qty)
  108. }else{
  109. console.log(res)
  110. this.$refs.uNotify.show({
  111. type: 'error',
  112. message: res.message
  113. })
  114. }
  115. })
  116. },
  117. initData() {
  118. listAvailable().then(res => {
  119. if (res.success) {
  120. this.data = res.data
  121. }
  122. })
  123. }
  124. },
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. .page {
  129. height: 100Vh;
  130. width: 100vw;
  131. }
  132. .page.show {
  133. overflow: hidden;
  134. }
  135. .cu-form-group {
  136. min-height: 0;
  137. border: none;
  138. }
  139. </style>