PopMessage.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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. {{ info.categoryLevelPath }}
  19. </view>
  20. </view>
  21. <view class="item">
  22. <view class="s1">物品编码</view>
  23. <view class="s2">
  24. {{ info.categoryCode }}
  25. </view>
  26. </view>
  27. <view class="item">
  28. <view class="s1">物品名称</view>
  29. <view class="s2">
  30. {{ info.categoryName }}
  31. </view>
  32. </view>
  33. <!-- <view class="item" v-for="(item, index) in uniqueData" :key="index">
  34. <view class="s1">{{ item.label }}</view>
  35. <view class="s2">
  36. {{ info[item.prop] }}
  37. </view>
  38. </view> -->
  39. <view class="item">
  40. <view class="s1">计量单位</view>
  41. <view class="s2">
  42. {{ info.measureUnit }}
  43. </view>
  44. </view>
  45. <view class="item" v-if="info.dimension == 3">
  46. <view class="s1">包装单位</view>
  47. <view class="s2">
  48. {{ info.packingUnit }}
  49. </view>
  50. </view>
  51. <view class="item" v-if="info.dimension == 3">
  52. <view class="s1">存货周期</view>
  53. <view class="s2">{{ info.inventoryCycle }}</view>
  54. </view>
  55. <!-- <view class="item">
  56. <view class="s1">允许拆包</view>
  57. <view class="s2">
  58. {{ info.isUnpack ? '是' : '否' }}
  59. </view>
  60. </view> -->
  61. <!-- <view class="item">
  62. <view class="s1">库存总数</view>
  63. <view class="s2">
  64. {{ info.realInventoryNum }}
  65. </view>
  66. </view> -->
  67. <!-- <view class="item">
  68. <view class="s1"> 包装数量 </view>
  69. <view class="s2"> {{ info.outInNum }}{{ info.minPackUnit }} </view>
  70. </view> -->
  71. </view>
  72. </view>
  73. <view class="close" @click="close">
  74. <u-button text="关闭"></u-button>
  75. </view>
  76. </view>
  77. </u-popup>
  78. </template>
  79. <script>
  80. import { post } from '@/utils/api.js'
  81. import { getByCode } from '@/api/pda/common.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 || '-'}/${extendField.width || '-'}/${extendField.high || '-'}`
  150. }
  151. }
  152. ]
  153. case 2: //'舟皿'
  154. return [
  155. { label: '规格', prop: 'specification' },
  156. { label: '型号', prop: 'modelType' },
  157. {
  158. label: '角度',
  159. prop: '',
  160. formatter(row) {
  161. if (!row?.extendField) return ''
  162. const extendField = JSON.parse(row.extendField)
  163. return extendField.angle
  164. }
  165. },
  166. {
  167. label: '长宽高',
  168. prop: '',
  169. formatter(row) {
  170. if (!row?.extendField) return ''
  171. const extendField = JSON.parse(row.extendField)
  172. return `${extendField.length || '-'}*${extendField.width || '-'}*${extendField.high || '-'}`
  173. }
  174. }
  175. ]
  176. case 1: //'设备'
  177. return [
  178. { label: '型号', prop: 'modelType' },
  179. { label: '规格', prop: 'specification' }
  180. ]
  181. case 6: //'模具'
  182. return [
  183. { label: '牌号', prop: 'brandNum' },
  184. { label: '型号', prop: 'modelType' },
  185. {
  186. label: '收缩系数',
  187. prop: '',
  188. formatter(row) {
  189. if (!row?.extendField) return ''
  190. const extendField = JSON.parse(row.extendField)
  191. return extendField.shrinkageCoefficient
  192. }
  193. },
  194. {
  195. label: '芯杆数量',
  196. prop: '',
  197. formatter(row) {
  198. if (!row?.extendField) return ''
  199. const extendField = JSON.parse(row.extendField)
  200. return extendField.mandrelNum
  201. }
  202. },
  203. {
  204. label: '模孔数量',
  205. prop: '',
  206. formatter(row) {
  207. if (!row?.extendField) return ''
  208. const extendField = JSON.parse(row.extendField)
  209. return extendField.dieHoleNum
  210. }
  211. },
  212. {
  213. label: '上冲头数量',
  214. prop: '',
  215. formatter(row) {
  216. if (!row?.extendField) return ''
  217. const extendField = JSON.parse(row.extendField)
  218. return extendField.upperPunchNum
  219. }
  220. },
  221. {
  222. label: '下冲头数量',
  223. prop: '',
  224. formatter(row) {
  225. if (!row?.extendField) return ''
  226. const extendField = JSON.parse(row.extendField)
  227. return extendField.lowerPunchNum
  228. }
  229. }
  230. ]
  231. case 7: //'备品备件'
  232. return [
  233. { label: '规格', prop: 'specification' },
  234. { label: '型号', prop: 'modelType' }
  235. ]
  236. }
  237. return []
  238. }
  239. },
  240. // created() {
  241. // this.requestDict('物品类型')
  242. // },
  243. methods: {
  244. // ...mapActions('dict', ['requestDict']),
  245. open(item) {
  246. this.popShow = true
  247. },
  248. close() {
  249. this.popShow = false
  250. }
  251. }
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. .list-wrap-1 {
  256. padding: 30rpx;
  257. .item {
  258. color: #000000;
  259. font-size: 28rpx;
  260. padding: 10rpx 0;
  261. display: flex;
  262. justify-content: space-between;
  263. .s1 {
  264. width: 200rpx;
  265. }
  266. }
  267. .item + .item {
  268. border-top: 1px dashed #555;
  269. }
  270. }
  271. .bpbj {
  272. width: 600rpx;
  273. .title {
  274. margin-bottom: 7px;
  275. background-color: #333333;
  276. text-align: center;
  277. color: #fff;
  278. padding: 10rpx 0;
  279. }
  280. /deep/.u-number-box {
  281. .u-number-box__minus,
  282. .u-number-box__plus,
  283. .u-number-box__input {
  284. font-size: 30rpx;
  285. height: 1.6em !important;
  286. }
  287. .u-number-box__input {
  288. width: 2em !important;
  289. }
  290. .u-number-box__minus,
  291. .u-number-box__plus {
  292. background-color: $j-primary-border-green !important;
  293. .u-icon__icon {
  294. color: #fff !important;
  295. }
  296. }
  297. }
  298. }
  299. </style>