Detail.vue 7.7 KB

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