PopMessage.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <!-- 备品备件弹窗 -->
  3. <u-popup :show="popShow" @close="close" mode="center" class="u-popup">
  4. <view class="bpbj">
  5. <view class="title"> 物品基本信息 </view>
  6. <view class="detail-content">
  7. <view class="list-wrap-1">
  8. <view class="item">
  9. <view class="s1"> 类型标识 </view>
  10. <view class="s2">
  11. {{ info.assetCode }}
  12. </view>
  13. </view>
  14. <view class="item">
  15. <view class="s1"> 物品类型 </view>
  16. <view class="s2">
  17. {{ getDictValue('物品类型', info.assetType) }}
  18. </view>
  19. </view>
  20. <view class="item">
  21. <view class="s1"> 物品编码 </view>
  22. <view class="s2">
  23. {{ info.assetCode }}
  24. </view>
  25. </view>
  26. <view class="item">
  27. <view class="s1"> 物品名称 </view>
  28. <view class="s2">
  29. {{ info.assetName }}
  30. </view>
  31. </view>
  32. <view class="item" v-for="(item, index) in uniqueData" :key="index">
  33. <view class="s1"> {{ item.label }} </view>
  34. <view class="s2">
  35. {{ info[item.prop] }}
  36. </view>
  37. </view>
  38. <view class="item">
  39. <view class="s1"> 计量单位 </view>
  40. <view class="s2">
  41. {{ info.unit }}
  42. </view>
  43. </view>
  44. <view class="item">
  45. <view class="s1"> 包装单位 </view>
  46. <view class="s2">
  47. {{ info.minPackUnit }}
  48. </view>
  49. </view>
  50. <view class="item">
  51. <view class="s1"> 保质期 </view>
  52. <view class="s2">
  53. {{ info.expirationDate }}{{ dateDict[info.expirationDateUnit] }}
  54. </view>
  55. </view>
  56. <view class="item">
  57. <view class="s1"> 允许拆包 </view>
  58. <view class="s2">
  59. {{ info.isUnpack ? '是' : '否' }}
  60. </view>
  61. </view>
  62. <view class="item">
  63. <view class="s1"> 库存总数 </view>
  64. <view class="s2">
  65. {{ info.realInventoryNum }}
  66. </view>
  67. </view>
  68. <!-- <view class="item">
  69. <view class="s1"> 包装数量 </view>
  70. <view class="s2"> {{ info.outInNum }}{{ info.minPackUnit }} </view>
  71. </view> -->
  72. </view>
  73. </view>
  74. <view class="close" @click="close">
  75. <u-button text="关闭"></u-button>
  76. </view>
  77. </view>
  78. </u-popup>
  79. </template>
  80. <script>
  81. import { post } from '@/utils/api.js'
  82. import { mapGetters, mapActions } from 'vuex'
  83. export default {
  84. props: ['info'],
  85. data () {
  86. return {
  87. popShow: false,
  88. dateDict: {
  89. minute: '分钟',
  90. hour: '小时',
  91. day: '天',
  92. month: '月',
  93. year: '年'
  94. }
  95. }
  96. },
  97. computed: {
  98. ...mapGetters(['getDictValue']),
  99. uniqueData () {
  100. switch (+this.info.assetType) {
  101. case 3: //物料
  102. return [{ label: '牌号', prop: 'brandNum' }]
  103. case 8: //耗材
  104. return [
  105. { label: '型号', prop: 'modelType' },
  106. { label: '规格', prop: 'specification' }
  107. ]
  108. case 4: //产品
  109. return [
  110. { label: '牌号', prop: 'brandNum' },
  111. { label: '型号', prop: 'modelType' },
  112. {
  113. label: '标准单重',
  114. prop: 'modelType',
  115. formatter (row) {
  116. if (!row?.extendField) return ''
  117. const extendField = JSON.parse(row.extendField)
  118. return `${extendField.unqualifiedRate || '-'}KG`
  119. }
  120. },
  121. {
  122. label: '不良品率',
  123. prop: 'modelType',
  124. formatter (row) {
  125. if (!row?.extendField) return ''
  126. const extendField = JSON.parse(row.extendField)
  127. return `${extendField.unqualifiedRate || '-'}%`
  128. }
  129. }
  130. ]
  131. case 5: //'周转车'
  132. return [
  133. { label: '规格', prop: 'specification' },
  134. {
  135. label: '材质',
  136. prop: 'texture',
  137. formatter (row) {
  138. if (!row?.extendField) return ''
  139. const extendField = JSON.parse(row.extendField)
  140. return extendField.texture
  141. }
  142. },
  143. {
  144. label: '长宽高',
  145. prop: '',
  146. formatter (row) {
  147. if (!row?.extendField) return ''
  148. const extendField = JSON.parse(row.extendField)
  149. return `${extendField.length || '-'}/${
  150. extendField.width || '-'
  151. }/${extendField.high || '-'}`
  152. }
  153. }
  154. ]
  155. case 2: //'舟皿'
  156. return [
  157. { label: '规格', prop: 'specification' },
  158. { label: '型号', prop: 'modelType' },
  159. {
  160. label: '角度',
  161. prop: '',
  162. formatter (row) {
  163. if (!row?.extendField) return ''
  164. const extendField = JSON.parse(row.extendField)
  165. return extendField.angle
  166. }
  167. },
  168. {
  169. label: '长宽高',
  170. prop: '',
  171. formatter (row) {
  172. if (!row?.extendField) return ''
  173. const extendField = JSON.parse(row.extendField)
  174. return `${extendField.length || '-'}*${
  175. extendField.width || '-'
  176. }*${extendField.high || '-'}`
  177. }
  178. }
  179. ]
  180. case 1: //'设备'
  181. return [
  182. { label: '型号', prop: 'modelType' },
  183. { label: '规格', prop: 'specification' }
  184. ]
  185. case 6: //'模具'
  186. return [
  187. { label: '牌号', prop: 'brandNum' },
  188. { label: '型号', prop: 'modelType' },
  189. {
  190. label: '收缩系数',
  191. prop: '',
  192. formatter (row) {
  193. if (!row?.extendField) return ''
  194. const extendField = JSON.parse(row.extendField)
  195. return extendField.shrinkageCoefficient
  196. }
  197. },
  198. {
  199. label: '芯杆数量',
  200. prop: '',
  201. formatter (row) {
  202. if (!row?.extendField) return ''
  203. const extendField = JSON.parse(row.extendField)
  204. return extendField.mandrelNum
  205. }
  206. },
  207. {
  208. label: '模孔数量',
  209. prop: '',
  210. formatter (row) {
  211. if (!row?.extendField) return ''
  212. const extendField = JSON.parse(row.extendField)
  213. return extendField.dieHoleNum
  214. }
  215. },
  216. {
  217. label: '上冲头数量',
  218. prop: '',
  219. formatter (row) {
  220. if (!row?.extendField) return ''
  221. const extendField = JSON.parse(row.extendField)
  222. return extendField.upperPunchNum
  223. }
  224. },
  225. {
  226. label: '下冲头数量',
  227. prop: '',
  228. formatter (row) {
  229. if (!row?.extendField) return ''
  230. const extendField = JSON.parse(row.extendField)
  231. return extendField.lowerPunchNum
  232. }
  233. }
  234. ]
  235. case 7: //'备品备件'
  236. return [
  237. { label: '规格', prop: 'specification' },
  238. { label: '型号', prop: 'modelType' }
  239. ]
  240. }
  241. return []
  242. }
  243. },
  244. created () {
  245. this.requestDict('物品类型')
  246. },
  247. methods: {
  248. ...mapActions('dict', ['requestDict']),
  249. open (item) {
  250. this.popShow = true
  251. },
  252. close () {
  253. this.popShow = false
  254. }
  255. }
  256. }
  257. </script>
  258. <style lang="scss" scoped>
  259. .list-wrap-1 {
  260. padding: 30rpx;
  261. .item {
  262. color: #000000;
  263. font-size: 28rpx;
  264. padding: 10rpx 0;
  265. display: flex;
  266. justify-content: space-between;
  267. }
  268. .item + .item {
  269. border-top: 1px dashed #555;
  270. }
  271. }
  272. .bpbj {
  273. width: 600rpx;
  274. .title {
  275. margin-bottom: 7px;
  276. background-color: #333333;
  277. text-align: center;
  278. color: #fff;
  279. padding: 10rpx 0;
  280. }
  281. /deep/.u-number-box {
  282. .u-number-box__minus,
  283. .u-number-box__plus,
  284. .u-number-box__input {
  285. font-size: 30rpx;
  286. height: 1.6em !important;
  287. }
  288. .u-number-box__input {
  289. width: 2em !important;
  290. }
  291. .u-number-box__minus,
  292. .u-number-box__plus {
  293. background-color: $j-primary-border-green !important;
  294. .u-icon__icon {
  295. color: #fff !important;
  296. }
  297. }
  298. }
  299. }
  300. </style>