baseInfo.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <div class="baseinfo-container">
  3. <div class="basic-details-title border-none">
  4. <span class="border-span">基本信息</span>
  5. </div>
  6. <el-descriptions title="" :column="4" size="medium" border>
  7. <el-descriptions-item>
  8. <template slot="label"> 编码 </template>
  9. {{ info.code }}
  10. </el-descriptions-item>
  11. <el-descriptions-item>
  12. <template slot="label"> 名称 </template>
  13. {{ info.name }}
  14. </el-descriptions-item>
  15. <el-descriptions-item>
  16. <template slot="label"> 型号 </template>
  17. {{ info.baseInfo.modelType }}
  18. </el-descriptions-item>
  19. <el-descriptions-item>
  20. <template slot="label"> 规格 </template>
  21. {{info.baseInfo.specification}}
  22. </el-descriptions-item>
  23. <el-descriptions-item>
  24. <template slot="label" :span="2"> 分类 </template>
  25. {{info.baseInfo.categoryLevelPath}}
  26. </el-descriptions-item>
  27. <el-descriptions-item >
  28. <template slot="label"> 采购日期 </template>
  29. <!-- {{info.warehouseDetail.procurementTime}} -->
  30. </el-descriptions-item>
  31. <el-descriptions-item>
  32. <template slot="label"> 过保日期 </template>
  33. <!-- {{info.warehouseDetail.expirationTime}} -->
  34. </el-descriptions-item>
  35. <el-descriptions-item>
  36. <template slot="label"> 计量单位</template>
  37. {{info.baseInfo.measuringUnit}}
  38. </el-descriptions-item>
  39. <el-descriptions-item v-if="!info.baseInfo.unpack">
  40. <template slot="label"> 最小包装单位</template>
  41. {{info.baseInfo.measuringUnit}}{{info.baseInfo.unit}}/{{info.baseInfo.packingUnit}}
  42. </el-descriptions-item>
  43. </el-descriptions>
  44. <div class="basic-details-title border-none">
  45. <span class="border-span">投产信息</span>
  46. </div>
  47. <el-descriptions title="" :column="4" size="medium" border>
  48. <el-descriptions-item>
  49. <template slot="label"> 固资编码 </template>
  50. {{info.fixCode}}
  51. </el-descriptions-item>
  52. <el-descriptions-item>
  53. <template slot="label"> 权属部门 </template>
  54. {{info.ownershipDeptName}}
  55. </el-descriptions-item>
  56. <el-descriptions-item>
  57. <template slot="label"> 品牌</template>
  58. {{info.brand}}
  59. </el-descriptions-item>
  60. <el-descriptions-item>
  61. <template slot="label"> 供应商</template>
  62. {{info.supplierName}}
  63. </el-descriptions-item>
  64. <el-descriptions-item>
  65. <template slot="label"> 供应商电话 </template>
  66. {{info.supplierMobile}}
  67. </el-descriptions-item>
  68. </el-descriptions>
  69. <div class="basic-details-title border-none">
  70. <span class="border-span">文档信息</span>
  71. </div>
  72. <div class="upload-container">
  73. <div class="img-box">
  74. <img
  75. src="~@/assets/upload-placeholder.svg"
  76. alt=""
  77. v-if="!imageUrl"
  78. />
  79. <img v-else :src="imageUrl" alt="设备图片" />
  80. </div>
  81. <div class="file-list">
  82. <div
  83. :class="{ disabled: !item.storePath }"
  84. @click="openfile(item)"
  85. v-for="(item, index) in fileList"
  86. :key="index"
  87. class="file-box"
  88. >
  89. {{ item.t_name }}
  90. </div>
  91. </div>
  92. </div>
  93. <div class="basic-details-title border-none">
  94. <span class="border-span">扩展信息</span>
  95. </div>
  96. <el-descriptions title="" :column="4" size="medium" border>
  97. <el-descriptions-item
  98. v-for="(item, index) in info.extInfoSelf"
  99. :key="index"
  100. :span="1"
  101. >
  102. <template slot="label"> {{ item.key }} </template>
  103. <div>{{item.value}}</div>
  104. </el-descriptions-item>
  105. </el-descriptions>
  106. </div>
  107. </template>
  108. <script>
  109. import { getAssetInfo } from '@/api/ledgerAssets';
  110. import { getDetails } from '@/api/classifyManage/itemInformation';
  111. import { getImageUrl } from '@/utils/file.js';
  112. import { getFile } from '@/api/system/file/index.js';
  113. export default {
  114. props: {
  115. rowId:{
  116. type:String ,
  117. default:''
  118. },
  119. },
  120. data () {
  121. return {
  122. fileList: [
  123. { t_name: '使用说明书' },
  124. { t_name: '生产许可证书' },
  125. { t_name: '防爆合格证书' },
  126. { t_name: '检验报告' },
  127. { t_name: '检验周期说明' },
  128. { t_name: '图纸资料' },
  129. { t_name: '产品合格证' }
  130. ],
  131. info:{
  132. baseInfo:{},
  133. extInfoSelf:[],
  134. },
  135. // 设备图片
  136. imageUrl: "",
  137. }
  138. },
  139. created () {
  140. this.getDetilInfo()
  141. },
  142. methods:{
  143. async getDetilInfo(){
  144. const res = await getAssetInfo(this.rowId)
  145. if (res){
  146. this.info = res
  147. this.$set(this.info, 'baseInfo', res.category.category)
  148. this.$set(this.info, 'extInfoSelf', res.extInfoSelf?res.extInfoSelf:[])
  149. // 设备图片
  150. if(typeof res.imageUrl !='string' ){
  151. this.imageUrl = getImageUrl(res.imageUrl.storePath)
  152. }
  153. if (res.attUrl && res.attUrl.length > 0) {
  154. // 文档信息
  155. res.attUrl.forEach((item, index) => {
  156. Object.assign(this.fileList[item.sort - 1], item)
  157. })
  158. }
  159. }
  160. },
  161. openfile (row) {
  162. if (row.storePath) {
  163. getFile({ objectName: row.storePath }, row.name);
  164. }
  165. },
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. ::v-deep.baseinfo-container {
  171. background-color: #fff;
  172. padding: 0 20px 20px;
  173. .content {
  174. padding: 0 20px;
  175. }
  176. .basic-details-title{
  177. font-size: 16px;
  178. margin: 15px 0;
  179. }
  180. .upload-container {
  181. display: flex;
  182. .img-box {
  183. width: 280px;
  184. height: 342px;
  185. border: 1px solid rgba(215, 215, 215, 1);
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. img {
  190. max-width: 100%;
  191. }
  192. }
  193. .file-list {
  194. margin-left: 50px;
  195. flex: 1;
  196. display: flex;
  197. justify-content: space-between;
  198. flex-wrap: wrap;
  199. justify-items: baseline;
  200. align-content: flex-start;
  201. .file-box {
  202. width: 30%;
  203. margin-bottom: 20px;
  204. height: 57px;
  205. text-align: center;
  206. line-height: 55px;
  207. border: 1px solid #1890ff;
  208. color: #1890ff;
  209. cursor: pointer;
  210. &.disabled {
  211. cursor: not-allowed;
  212. border-color: rgba(215, 215, 215, 1);
  213. color: rgba(215, 215, 215, 1);
  214. }
  215. }
  216. }
  217. }
  218. }
  219. </style>