details.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="dataInfo.assetName" @clickLeft="back">
  4. </uni-nav-bar>
  5. <view class="title">
  6. 基本信息
  7. </view>
  8. <view class="list-wrap-1">
  9. <view class="item">
  10. <view class="s1">
  11. 物料编码
  12. </view>
  13. <view class="s2">
  14. {{dataInfo.assetCode}}
  15. </view>
  16. </view>
  17. <view class="item">
  18. <view class="s1">
  19. 物料类型
  20. </view>
  21. <view class="s2">
  22. {{dict.warehousingType[dataInfo.assetType]}}
  23. </view>
  24. </view>
  25. <view class="item">
  26. <view class="s1">
  27. 牌号
  28. </view>
  29. <view class="s2">
  30. {{dataInfo.brandNum}}
  31. </view>
  32. </view>
  33. <view class="item">
  34. <view class="s1">
  35. 型号
  36. </view>
  37. <view class="s2">
  38. {{dataInfo.modelType}}
  39. </view>
  40. </view>
  41. <view class="item">
  42. <view class="s1">
  43. 计量单位
  44. </view>
  45. <view class="s2">
  46. {{dataInfo.unit}}
  47. </view>
  48. </view>
  49. <!-- <view class="item">
  50. <view class="s1">
  51. 包装单位
  52. </view>
  53. <view class="s2">
  54. {{dataInfo.minPackUnit}}
  55. </view>
  56. </view> -->
  57. <view class="item">
  58. <view class="s1">
  59. 库存总数
  60. </view>
  61. <view class="s2">
  62. {{dataInfo.realInventoryNum}}{{dataInfo.unit}}
  63. </view>
  64. </view>
  65. <!-- <view class="item">
  66. <view class="s1">
  67. 包装数量
  68. </view>
  69. <view class="s2">
  70. {{dataInfo.measurementUnit}}
  71. </view>
  72. </view> -->
  73. </view>
  74. <view class="title">
  75. 批次明细
  76. </view>
  77. <view class="table-wrap">
  78. <uni-table border stripe emptyText="暂无更多数据">
  79. <!-- 表头行 -->
  80. <uni-tr>
  81. <uni-th align="left" width="240rpx" :sortable="true"
  82. @sort-change="sortChange('batchNum',$event)">批次号</uni-th>
  83. <uni-th align="left" width="170rpx" :sortable="true"
  84. @sort-change="sortChange('realInventoryNum',$event)">库存数量</uni-th>
  85. <uni-th align="left" width="170rpx" :sortable="true"
  86. @sort-change="sortChange('measurementUnit',$event)">包装数量</uni-th>
  87. <uni-th align="left" width="170rpx" :sortable="true"
  88. @sort-change="sortChange('days',$event)">库龄(天)</uni-th>
  89. </uni-tr>
  90. <!-- 表格数据行 -->
  91. <uni-tr v-for="(item,index) in pcmxList" :key="index">
  92. <uni-td>
  93. <text class="pch" @click="goPch(item)">{{item.batchNum}}</text>
  94. </uni-td>
  95. <uni-td>{{item.realInventoryNum}}</uni-td>
  96. <uni-td>{{item.measurementUnit}}</uni-td>
  97. <uni-td>{{item.days}}</uni-td>
  98. </uni-tr>
  99. </uni-table>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. import {
  105. post
  106. } from '@/utils/api.js'
  107. export default {
  108. data() {
  109. return {
  110. // 基本信息
  111. dataInfo:'',
  112. // 列表维度
  113. dimension:'',
  114. pcmxList: [
  115. ],
  116. dict: {
  117. warehousingType: {
  118. 1: '生产设备',
  119. 2: '舟皿',
  120. 3: '物料',
  121. 5: '周转车',
  122. 6: '模具',
  123. 7: "备品备件",
  124. }
  125. }
  126. }
  127. },
  128. onLoad(option) {
  129. console.log(option)
  130. this.dataInfo = JSON.parse(decodeURIComponent(option.info))
  131. this.dimension = option.dimension
  132. this.getData()
  133. },
  134. methods: {
  135. sortChange(type, e) {
  136. console.log(type, e)
  137. let order = e.order
  138. this.pcmxList.sort((a, b) => {
  139. switch (order) {
  140. // 下降
  141. case 'descending':
  142. return a[type] - b[type]
  143. break;
  144. // 上降
  145. case 'ascending':
  146. return b[type] - a[type]
  147. break;
  148. // 正常
  149. case null:
  150. break;
  151. default:
  152. break;
  153. }
  154. })
  155. },
  156. goPch(item){
  157. let par = {
  158. batchNum:item.batchNum,
  159. inventoryCode:item.assetCode,
  160. code:item.assetType
  161. }
  162. par = this.URLSearchParams(par)
  163. uni.navigateTo({
  164. url: "/pages/warehouse/inventory/batch/batch?" + par,
  165. });
  166. },
  167. getData(){
  168. let par = {
  169. dimension:this.dimension,
  170. inventoryCode:this.dataInfo.assetCode,
  171. name:this.dataInfo.assetName,
  172. }
  173. par = this.URLSearchParams(par)
  174. post(this.apiUrl + "/InventoryBook/select/getDetail?"+par).then((res) => {
  175. if (res.success) {
  176. this.pcmxList = res.data.records
  177. }
  178. });
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .title {
  185. background-color: #70b603;
  186. color: #fff;
  187. font-size: 28rpx;
  188. padding: 20rpx 30rpx;
  189. }
  190. .list-wrap-1 {
  191. padding: 30rpx;
  192. .item {
  193. color: #000000;
  194. font-size: 28rpx;
  195. padding: 10rpx 0;
  196. display: flex;
  197. justify-content: space-between;
  198. }
  199. .item+.item {
  200. border-top: 1px dashed #555;
  201. }
  202. }
  203. .pch{
  204. text-decoration: underline;
  205. color: #70b603;
  206. }
  207. </style>