Detail.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <a-modal
  3. :title="modalTitle"
  4. :width="1200"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. @cancel="handleCancel"
  8. >
  9. <detail-list title="" :col="2">
  10. <detail-list-item term="标准名称">{{ model.name }}</detail-list-item>
  11. <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
  12. <!-- <detail-list-item term="编码">{{ model.no }}</detail-list-item>-->
  13. <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
  14. <detail-list-item term="计划周期">{{ model.period }}{{ BaseTool.Object.getField(periodTypeMap,model.periodType) }}</detail-list-item>
  15. <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
  16. <!-- <detail-list-item term="动作类型">{{ BaseTool.Object.getField(actionTypeMap,model.actionType) }}</detail-list-item>-->
  17. <detail-list-item term="部位">{{ model.partName }}</detail-list-item>
  18. <!-- <detail-list-item term="是否启用"><badge :status="DictCache.COLOR.YES_NO[model.enable]" :text="enableMap[model.enable]"></badge></detail-list-item>-->
  19. <!-- <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  20. <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
  21. <detail-list-item term="创建时间">{{ model.updateTime }}</detail-list-item>
  22. <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>-->
  23. </detail-list>
  24. <detail-list title="" :col="1">
  25. <detail-list-item term="检查项目">{{ model.requirement }}</detail-list-item>
  26. <detail-list-item term="执行标准">{{ model.remark }}</detail-list-item>
  27. </detail-list>
  28. <title-divider title="标准图片" width="90px"></title-divider>
  29. <detail-list title="" :col="1">
  30. <detail-list-item term="" v-if="model.checkImgList != null && model.checkImgList.length > 0">
  31. <viewer :images="model.checkImgList" @inited="inited" ref="viewer" :index="1" >
  32. <img v-for="item in model.checkImgList" :src="item.url" :key="item.id" class="image">
  33. </viewer>
  34. </detail-list-item>
  35. <detail-list-item term="" v-if="model.checkImgList == null || model.checkImgList.length === 0">
  36. 暂无
  37. </detail-list-item>
  38. </detail-list>
  39. <title-divider title="标准文件" width="90px"></title-divider>
  40. <detail-list title="" :col="8">
  41. <detail-list-item term="">
  42. <a-upload
  43. :multiple="true"
  44. :fileList="BaseTool.UPLOAD.transImg(model.checkFileList)"
  45. >
  46. </a-upload>
  47. </detail-list-item>
  48. </detail-list>
  49. <!-- <a-tabs type="card" default-active-key="1">
  50. <a-tab-pane key="1" tab="点检标准参数">
  51. <a-table
  52. bordered
  53. :data-source="data"
  54. :columns="columns"
  55. tableLayout="auto"
  56. rowKey="id"
  57. >
  58. </a-table>
  59. </a-tab-pane>
  60. </a-tabs>-->
  61. <title-divider title="关联备件" width="90px"></title-divider>
  62. <a-table
  63. :data-source="data"
  64. :columns="columns"
  65. bordered
  66. tableLayout="auto"
  67. rowKey="bomId">
  68. </a-table>
  69. <template slot="footer">
  70. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  71. </template>
  72. </a-modal>
  73. </template>
  74. <script>
  75. import DetailList from '@/components/tools/DetailList'
  76. const DetailListItem = DetailList.Item
  77. export default {
  78. name: 'CheckStandardDetail',
  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. typeMap: {},
  91. periodTypeMap: {},
  92. actionTypeMap: {},
  93. enableMap: {},
  94. model: {
  95. 'name': null,
  96. 'no': null,
  97. 'type': null,
  98. 'part': null,
  99. 'enable': null,
  100. 'requirement': null,
  101. 'standardHours': null,
  102. 'remark': null,
  103. 'createdUserId': null,
  104. 'updateUserId': null,
  105. 'updateUserName': null,
  106. 'updateTime': null
  107. },
  108. // 表头
  109. columns: [
  110. {
  111. title: '名称',
  112. dataIndex: 'spareName'
  113. },
  114. {
  115. title: '规格型号',
  116. dataIndex: 'ggxh'
  117. },
  118. {
  119. title: '数量',
  120. dataIndex: 'num',
  121. width: 150,
  122. scopedSlots: { customRender: 'num' }
  123. }
  124. ],
  125. data: []
  126. }
  127. },
  128. created () {
  129. // 下拉框map
  130. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
  131. this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  132. this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
  133. this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
  134. },
  135. methods: {
  136. inited (viewer) {
  137. this.$viewer = viewer
  138. // this.$viewer.index = 0
  139. // // 不要他的按钮
  140. // this.$viewer.options.button = false
  141. // // 不要他的底部缩略图
  142. // this.$viewer.options.navbar = false
  143. // // 不要他的底部标题
  144. // this.$viewer.options.title = false
  145. // // 不要他的底部工具栏
  146. // this.$viewer.options.toolbar = false
  147. },
  148. base (record) {
  149. this.visible = true
  150. this.modalTitle = '详情'
  151. this.model = record
  152. this.data = record.detailList
  153. },
  154. handleCancel () {
  155. this.visible = false
  156. this.confirmLoading = false
  157. }
  158. }
  159. }
  160. </script>