detail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="报损报溢详情"
  8. @clickLeft="back"
  9. >
  10. </uni-nav-bar>
  11. <view>
  12. <CellInfo label="报损报溢编码" :value="infoData.code"></CellInfo>
  13. <CellInfo label="名称" :value="infoData.name"></CellInfo>
  14. <CellInfo
  15. label="报损报溢部门"
  16. :value="infoData.reportDeptName"
  17. ></CellInfo>
  18. <CellInfo label="报损报溢人" :value="infoData.reportName"></CellInfo>
  19. <CellInfo label="审核人部门" :value="infoData.auditDeptName"></CellInfo>
  20. <CellInfo label="审核人" :value="infoData.auditName"></CellInfo>
  21. <CellInfo label="备注" :value="infoData.remark"></CellInfo>
  22. </view>
  23. <uni-section title="报损报溢明细" type="line">
  24. <view class="order-box">盘点工单{{ infoData.workOrderCode }}</view>
  25. <view
  26. v-for="(item, index) in infoData.list"
  27. :key="index"
  28. class="list-card"
  29. >
  30. <view class="status" :style="{ color: _getStatus(item.status).color }">
  31. <text>{{ _getStatus(item.status).name }}</text>
  32. <text
  33. >数量:{{
  34. (([1, 2].includes(item.status) ? '-' : '+') || '') + item.amount
  35. }}</text
  36. >
  37. </view>
  38. <view class="row first">
  39. <view class="col">
  40. <text class="main">{{ item.name }}</text>
  41. {{ item.code }}
  42. </view>
  43. </view>
  44. <view class="row">
  45. <view class="col" style="width: 100%">
  46. <text class="main">货位:</text>
  47. {{ item.warehouseName }}-{{ item.reservoirName }}-{{
  48. item.goodsShelfName
  49. }}-{{ item.goodsAllocationName }}
  50. </view>
  51. </view>
  52. <view class="row">
  53. <view class="col">
  54. <text class="label">批次号:</text>
  55. {{ item.batch }}
  56. </view>
  57. <view class="col">
  58. <text class="label">类型:</text>
  59. {{ getDictValue('物品类型', item.productType) }}
  60. </view>
  61. <view class="col" v-for="(itm, index) in tableHeader" :key="index">
  62. <text class="label">{{ itm.label }}:</text>
  63. {{ item[itm.prop] }}
  64. </view>
  65. <view class="col" v-if="!item.isUnpack">
  66. <text class="label">最小单元:</text>
  67. {{ item.unit }}/{{ item.minPackUnit }}
  68. </view>
  69. </view>
  70. </view>
  71. </uni-section>
  72. </view>
  73. </template>
  74. <script>
  75. import { post, postJ, get, getJ } from '@/utils/api.js'
  76. import { getDict, wh_equStatus } from '../enum.js'
  77. import CellInfo from '@/components/CellInfo.vue'
  78. import dictMxins from '@/mixins/dictMixins'
  79. export default {
  80. components: { CellInfo },
  81. mixins: [dictMxins],
  82. data () {
  83. return {
  84. pickerIndex: 0,
  85. deptList: [],
  86. userList: [],
  87. infoData: {
  88. auditId: '',
  89. auditName: '',
  90. verifyDeptCode: '',
  91. verifyDeptName: '',
  92. workOrderCode: '',
  93. list: []
  94. }
  95. }
  96. },
  97. computed: {
  98. tableHeader () {
  99. if (this.infoData.list?.length) {
  100. return this.getTableHeader(this.infoData.list[0].productType)
  101. }
  102. return []
  103. }
  104. },
  105. onLoad ({ id }) {
  106. this.getDetail(id)
  107. this.requestDict('物品类型')
  108. },
  109. methods: {
  110. getTableHeader (selectEquiType) {
  111. switch (+selectEquiType) {
  112. case 3:
  113. return [{ label: '牌号', prop: 'assetBrand' }]
  114. case 8:
  115. return [
  116. // { label: '型号', prop: 'assetSku' },
  117. { label: '型号', prop: 'modelType' },
  118. { label: '规格', prop: 'specification' }
  119. ]
  120. case 4:
  121. return [
  122. { label: '牌号', prop: 'assetBrand' },
  123. { label: '型号', prop: 'modelType' },
  124. // { label: '型号', prop: 'assetSku' }
  125. ]
  126. case 5: //'周转车'
  127. return [
  128. { label: '规格', prop: 'specification' },
  129. {
  130. label: '材质',
  131. prop: 'texture',
  132. formatter (row) {
  133. if (!row?.extendField) return ''
  134. const extendField = JSON.parse(row.extendField)
  135. return extendField.texture
  136. }
  137. },
  138. {
  139. label: '长宽高',
  140. prop: '',
  141. formatter (row) {
  142. if (!row?.extendField) return ''
  143. const extendField = JSON.parse(row.extendField)
  144. return `${extendField.length || '-'}*${
  145. extendField.width || '-'
  146. }*${extendField.high || '-'}`
  147. }
  148. }
  149. ]
  150. case 2: //'舟皿'
  151. return [
  152. { label: '规格', prop: 'specification' },
  153. { label: '型号', prop: 'modelType' },
  154. // { label: '型号', prop: 'assetSku' },
  155. {
  156. label: '长宽高',
  157. prop: '',
  158. formatter (row) {
  159. if (!row?.extendField) return ''
  160. const extendField = JSON.parse(row.extendField)
  161. return `${extendField.length || '-'}*${
  162. extendField.width || '-'
  163. }*${extendField.high || '-'}`
  164. }
  165. }
  166. ]
  167. case 1: //'设备'
  168. return [
  169. // { label: '型号', prop: 'assetSku' },
  170. { label: '型号', prop: 'modelType' },
  171. { label: '规格', prop: 'specification' }
  172. ]
  173. case 6: //'模具'
  174. return [
  175. { label: '牌号', prop: 'assetBrand' },
  176. { label: '型号', prop: 'modelType' },
  177. // { label: '型号', prop: 'assetSku' },
  178. {
  179. label: '收缩系数',
  180. prop: '',
  181. formatter (row) {
  182. if (!row?.extendField) return ''
  183. const extendField = JSON.parse(row.extendField)
  184. return extendField.shrinkageCoefficient
  185. }
  186. }
  187. ]
  188. case 7: //'备品备件'
  189. return [
  190. { label: '规格', prop: 'specification' },
  191. { label: '型号', prop: 'modelType' },
  192. // { label: '型号', prop: 'assetSku' }
  193. ]
  194. }
  195. return []
  196. },
  197. _getStatus: getDict(wh_equStatus),
  198. async getDetail (id) {
  199. const res = await get(this.apiUrl + `/breakag/info/${id}`)
  200. if (res?.success) {
  201. this.infoData = res.data
  202. }
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss" scoped>
  208. .footBox {
  209. position: fixed;
  210. bottom: 0;
  211. left: 0;
  212. right: 0;
  213. }
  214. .mainBox {
  215. padding-bottom: 90rpx;
  216. .order-box {
  217. color: #7f7f7f;
  218. background-color: rgba(215, 215, 215, 0.729411764705882);
  219. line-height: 44rpx;
  220. border-radius: 44rpx;
  221. text-align: center;
  222. font-size: 28rpx;
  223. margin: 0 20rpx;
  224. }
  225. .list-card {
  226. border-bottom: 6rpx solid #f2f2f2;
  227. position: relative;
  228. .status {
  229. padding: 6rpx 20rpx;
  230. font-weight: bold;
  231. font-size: 28rpx;
  232. display: flex;
  233. justify-content: space-between;
  234. align-items: center;
  235. border-bottom: 1rpx solid #f2f2f2;
  236. }
  237. .del {
  238. position: absolute;
  239. color: $uni-color-order-error !important;
  240. bottom: 5rpx;
  241. right: 10rpx;
  242. font-size: 50rpx !important;
  243. }
  244. .row {
  245. display: flex;
  246. justify-content: space-between;
  247. align-items: center;
  248. font-size: 28rpx;
  249. flex-wrap: wrap;
  250. padding: 10rpx 20rpx;
  251. color: #7d7d7d;
  252. &.first {
  253. color: #000;
  254. font-size: 28rpx;
  255. border-bottom: 1rpx solid #f2f2f2;
  256. .col {
  257. width: 100%;
  258. }
  259. }
  260. .col {
  261. width: 50%;
  262. }
  263. .label {
  264. margin-right: 10rpx;
  265. display: inline-block;
  266. width: 180rpx;
  267. text-align: right;
  268. }
  269. .main {
  270. margin-right: 10rpx;
  271. }
  272. }
  273. }
  274. }
  275. </style>