PopMessage.vue 8.0 KB

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