Detail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <a-card :bordered="false" :title="modalTitle" v-show="visible">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
  7. </span>
  8. </a-col>
  9. </a-row>
  10. <title-divider title="基础信息" width="90px"></title-divider>
  11. <detail-list title="" :col="3">
  12. <detail-list-item term="id">{{ model.id }}</detail-list-item>
  13. <detail-list-item term="集团统一编码">{{ model.uniteNo }}</detail-list-item>
  14. <detail-list-item term="自编号">{{ model.zbh }}</detail-list-item>
  15. <detail-list-item term="备件编码">{{ model.no }}</detail-list-item>
  16. <detail-list-item term="备件名称">{{ model.name }}</detail-list-item>
  17. <detail-list-item term="名称编码">{{ model.nameNo }}</detail-list-item>
  18. <detail-list-item term="规格型号">{{ model.ggxh }}</detail-list-item>
  19. <detail-list-item term="规格编码">{{ model.ggNo }}</detail-list-item>
  20. <detail-list-item term="备件类别">{{ model.typeName }}</detail-list-item>
  21. <detail-list-item term="备件等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
  22. <detail-list-item term="备件价值">{{ BaseTool.Amount.formatter(model.initialValue) }}</detail-list-item>
  23. <detail-list-item term="生产商">{{ model.producerName }}</detail-list-item>
  24. <detail-list-item term="供应商">{{ model.supplierName }}</detail-list-item>
  25. <detail-list-item term="原厂编号">{{ model.initNo }}</detail-list-item>
  26. <detail-list-item term="计量单位">{{ model.unit }}</detail-list-item>
  27. <detail-list-item term="包装单位">{{ model.unitBz }}</detail-list-item>
  28. <detail-list-item term="折算系数">{{ model.unitRate }}</detail-list-item>
  29. <detail-list-item term="当前库存">{{ model.currentStock }}</detail-list-item>
  30. <detail-list-item term="采购周期">{{ model.purchasePeriod }}天</detail-list-item>
  31. <detail-list-item term="使用周期">{{ model.usePeriod }}月</detail-list-item>
  32. <detail-list-item term="寿命周期">{{ model.agePeriod }}月</detail-list-item>
  33. <detail-list-item term="当前库存">{{ model.currentStock }}</detail-list-item>
  34. <detail-list-item term="最高库存">{{ model.maxStock }}</detail-list-item>
  35. <detail-list-item term="最低库存">{{ model.minStock }}</detail-list-item>
  36. <detail-list-item term="初始库存">{{ model.initStock }}</detail-list-item>
  37. <detail-list-item term="英文名称">{{ model.englishName }}</detail-list-item>
  38. <detail-list-item term="助记码">{{ model.zjm }}</detail-list-item>
  39. <detail-list-item term="产地">{{ BaseTool.Object.getField(cdMap,model.cd) }}</detail-list-item>
  40. <detail-list-item term="用途">{{ BaseTool.Object.getField(ytMap,model.yt) }}</detail-list-item>
  41. <detail-list-item term="参数">{{ model.params }}</detail-list-item>
  42. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  43. <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  44. <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
  45. <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
  46. </detail-list>
  47. <title-divider title="图片信息" width="90px"></title-divider>
  48. <detail-list title="" :col="1">
  49. <detail-list-item term="" v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
  50. <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1" >
  51. <img v-for="item in model.applicationFileList" :src="item.url" :key="item.id" class="image">
  52. </viewer>
  53. </detail-list-item>
  54. <detail-list-item term="" v-if="model.applicationFileList == null || model.applicationFileList.length === 0">
  55. 暂无
  56. </detail-list-item>
  57. </detail-list>
  58. <title-divider title="设备信息" width="100px"></title-divider>
  59. <div class="table-operator">
  60. </div>
  61. <a-table
  62. :data-source="data"
  63. :columns="columns"
  64. bordered
  65. tableLayout="auto"
  66. rowKey="id">
  67. </a-table>
  68. <template slot="footer">
  69. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  70. </template>
  71. </a-card>
  72. </template>
  73. <script>
  74. import DetailList from '@/components/tools/DetailList'
  75. import { selectSbModelListBySpareId } from '@/api/sb/modelbom'
  76. const DetailListItem = DetailList.Item
  77. export default {
  78. name: 'SparePartInfoDetail',
  79. components: {
  80. DetailList,
  81. DetailListItem
  82. },
  83. data () {
  84. return {
  85. confirmLoading: false,
  86. mdl: {},
  87. modalTitle: null,
  88. visible: false,
  89. // 下拉框map
  90. levelMap: {},
  91. unitMap: {},
  92. cdMap: {},
  93. ytMap: {},
  94. model: {
  95. 'no': null,
  96. 'name': null,
  97. 'ggxh': null,
  98. 'typeId': null,
  99. 'level': null,
  100. 'initialValue': null,
  101. 'producerId': null,
  102. 'producerName': null,
  103. 'supplierId': null,
  104. 'supplierName': null,
  105. 'unit': null,
  106. 'unitBz': null,
  107. 'unitRate': null,
  108. 'currentStock': null,
  109. 'purchasePeriod': null,
  110. 'usePeriod': null,
  111. 'agePeriod': null,
  112. 'maxStock': null,
  113. 'qrCode': null,
  114. 'applicationFileList': [],
  115. 'minStock': null,
  116. 'initStock': null,
  117. 'params': null,
  118. 'remark': null,
  119. 'createdUserId': null,
  120. 'updateUserId': null,
  121. 'updateTime': null,
  122. 'createdUserName': null,
  123. 'updateUserName': null,
  124. 'typeName': null
  125. },
  126. periodTypeMap: {},
  127. // 表头
  128. columns: [
  129. {
  130. title: '型号',
  131. dataIndex: 'model'
  132. },
  133. {
  134. title: '名称',
  135. dataIndex: 'name'
  136. },
  137. {
  138. title: '新号',
  139. dataIndex: 'no'
  140. },
  141. {
  142. title: '旧号',
  143. dataIndex: 'zbh'
  144. },
  145. {
  146. title: '更换周期',
  147. dataIndex: 'period',
  148. customRender: (text, record, index) => {
  149. return text + this.BaseTool.Table.getMapText(this.periodTypeMap, record.periodType)
  150. }
  151. },
  152. {
  153. title: '数量',
  154. dataIndex: 'num'
  155. },
  156. {
  157. title: '操作',
  158. key: 'action',
  159. checked: true,
  160. align: 'center',
  161. // fixed: 'right',
  162. scopedSlots: { customRender: 'action' }
  163. }
  164. ],
  165. data: []
  166. }
  167. },
  168. created () {
  169. // 下拉框map
  170. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_PART_INFO_LEVEL)
  171. this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
  172. this.cdMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PRODUCER_AREA)
  173. this.ytMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_USE_TYPE)
  174. this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
  175. },
  176. methods: {
  177. base (record) {
  178. this.visible = true
  179. this.modalTitle = '详情'
  180. this.model = record
  181. selectSbModelListBySpareId({ id: record.id }).then(res => {
  182. this.data = res.data
  183. })
  184. },
  185. inited (viewer) {
  186. this.$viewer = viewer
  187. // this.$viewer.index = 0
  188. // // 不要他的按钮
  189. // this.$viewer.options.button = false
  190. // // 不要他的底部缩略图
  191. // this.$viewer.options.navbar = false
  192. // // 不要他的底部标题
  193. // this.$viewer.options.title = false
  194. // // 不要他的底部工具栏
  195. // this.$viewer.options.toolbar = false
  196. },
  197. handleCancel () {
  198. this.visible = false
  199. this.confirmLoading = false
  200. this.$emit('ok')
  201. }
  202. }
  203. }
  204. </script>
  205. <style scoped>
  206. .image {
  207. width: calc(20% - 10px);
  208. cursor: pointer;
  209. margin: 5px;
  210. display: inline-block;
  211. }
  212. </style>