ReportLoss.vue 6.9 KB

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