ReportLoss.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <!-- 报损报溢 -->
  3. <view class="main-wrap" :class="{ info: isInfo }">
  4. <uni-search-bar class="uni-search-bar" @confirm="search" v-model="searchValue" @input="search" cancelButton="none" placeholder="关键字"></uni-search-bar>
  5. <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
  6. <view class="order-list">
  7. <u-collapse @change="change" @close="close" @open="open">
  8. <u-collapse-item v-for="(item, index) in listData" :key="index" :title="item.onlyCode" name="Docs guide">
  9. <template slot="title">
  10. <view style="display: flex; justify-content: space-between">
  11. {{ item.onlyCode }}
  12. <text :style="{ color: statusColor[item.status] }">{{ statusOpt[item.status] }}</text>
  13. </view>
  14. </template>
  15. <view class="item">
  16. <view class="main">
  17. <view class="row" v-if="!baseInfo.isUnpack">
  18. <view class="row-item">
  19. <text class="t1">最小包装单位</text>
  20. <text class="t2">{{ item.measurementUnit }}{{ item.unit }} /{{ item.minimumUnit }}</text>
  21. </view>
  22. </view>
  23. <view class="row" v-if="dimension != 2">
  24. <view class="row-item">
  25. <text class="t1">批次号</text>
  26. <text class="t2">{{ item.batch }}</text>
  27. </view>
  28. </view>
  29. <view class="row">
  30. <view class="row-item">
  31. <text class="t1">单价</text>
  32. <text class="t2">
  33. <template v-if="item.univalence || item.univalence === 0">
  34. {{ item.univalence }}
  35. {{ priceList[item.univalenceUnit] }}
  36. </template>
  37. </text>
  38. </view>
  39. </view>
  40. <view class="row">
  41. <view class="row-item">
  42. <text class="t1">盘点工单号</text>
  43. <text class="t2">{{ item.workOrderCode }}</text>
  44. </view>
  45. </view>
  46. <view class="row">
  47. <view class="row-item">
  48. <text class="t1">盘点人</text>
  49. <text class="t2">{{ item.executeUserName }}</text>
  50. </view>
  51. </view>
  52. <view class="row">
  53. <view class="row-item">
  54. <text class="t1">报损溢单号</text>
  55. <text class="t2">{{ item.breakageOverflowCode }}</text>
  56. </view>
  57. </view>
  58. <view class="row">
  59. <view class="row-item">
  60. <text class="t1">操作人</text>
  61. <text class="t2">{{ item.reportName }}</text>
  62. </view>
  63. </view>
  64. <view class="row">
  65. <view class="row-item">
  66. <text class="t1">审核人</text>
  67. <text class="t2">{{ item.accraditationUserName }}</text>
  68. </view>
  69. </view>
  70. <view class="row">
  71. <view class="row-item">
  72. <text class="t1">更新库存时间</text>
  73. <text class="t2">{{ item.updateInventoryTime }}</text>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </u-collapse-item>
  79. </u-collapse>
  80. </view>
  81. <u-loadmore :status="status" style="margin: 20rpx 0" />
  82. </scroll-view>
  83. </view>
  84. </template>
  85. <script>
  86. import { post, postJ } from '@/utils/api.js'
  87. let [page, size, isEnd] = [1, 20, true]
  88. import { debounce } from 'lodash'
  89. export default {
  90. props: ['batchNum', 'baseInfo', 'inventoryCode', 'isInfo', 'dimension'],
  91. data() {
  92. return {
  93. listData: [],
  94. status: 'loading',
  95. searchValue: '',
  96. dict: {
  97. reportType: {
  98. 0: '盘亏-',
  99. 1: '盘盈+'
  100. }
  101. },
  102. statusOpt: {
  103. 1: '盘亏',
  104. 2: '盘损',
  105. 3: '盘盈'
  106. },
  107. statusColor: {
  108. 1: '',
  109. 2: '#F59A23',
  110. 3: '#70B603'
  111. }
  112. }
  113. },
  114. created() {
  115. this.getData()
  116. this.search = debounce(this.search, 1000)
  117. },
  118. methods: {
  119. // 触底
  120. lower() {
  121. console.log('触底')
  122. if (isEnd) {
  123. return
  124. }
  125. this.getMoreLists()
  126. },
  127. getData() {
  128. let par = {
  129. batchNum: this.batchNum,
  130. informationId: this.baseInfo?.materialId,
  131. name: this.searchValue
  132. }
  133. if (this.searchValue !== '') {
  134. par.key = this.searchValue
  135. }
  136. // postJ(
  137. // this.apiUrl +
  138. // `/InventoryBook/select/getBreakageOverflowDetail?size=${size}&page=${page}`,
  139. // par
  140. // ).then(res => {
  141. // if (res.success) {
  142. // this.listData = [...this.listData, ...res.data.records]
  143. // let pages = res.data.pages
  144. // if (page < pages) {
  145. // isEnd = false
  146. // } else {
  147. // isEnd = true
  148. // this.status = 'nomore'
  149. // }
  150. // }
  151. // })
  152. },
  153. getMoreLists() {
  154. page++
  155. this.getData()
  156. },
  157. search() {
  158. this.page = 1
  159. this.listData = []
  160. this.status = 'loading'
  161. this.getData()
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. .main-wrap {
  168. height: calc(100% - 170rpx);
  169. &.info {
  170. height: calc(100% - 236rpx);
  171. }
  172. }
  173. .scroll-Y {
  174. height: calc(100vh - 112rpx);
  175. //height:100%;
  176. background-color: #fafafa;
  177. }
  178. .order-list {
  179. .item {
  180. background-color: #fff;
  181. margin-bottom: 30rpx;
  182. margin-bottom: 30rpx;
  183. .title {
  184. display: flex;
  185. padding: 20rpx;
  186. justify-content: space-between;
  187. align-items: center;
  188. border-bottom: 1px solid #dedede;
  189. .s1 {
  190. color: #333333;
  191. font-size: 28rpx;
  192. font-weight: bold;
  193. }
  194. .s2 {
  195. font-size: 28rpx;
  196. font-weight: bold;
  197. color: #333333;
  198. }
  199. }
  200. .main {
  201. padding: 0 30rpx;
  202. .row {
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. padding: 20rpx 0;
  207. border-bottom: 1px dashed #dedede;
  208. .row-item {
  209. .t1 {
  210. font-weight: bold;
  211. font-size: 28rpx;
  212. color: #333333;
  213. margin-right: 20rpx;
  214. }
  215. .t2 {
  216. font-size: 28rpx;
  217. color: #333333;
  218. }
  219. }
  220. }
  221. .ckmx {
  222. color: #70b603;
  223. font-size: 28rpx;
  224. font-weight: bold;
  225. padding: 20rpx;
  226. display: flex;
  227. justify-content: flex-end;
  228. }
  229. }
  230. }
  231. }
  232. </style>