Detail.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <a-modal :title="modalTitle" :width="1200" :visible="visible" :confirmLoading="confirmLoading" @cancel="handleCancel">
  3. <detail-list title="" :col="2">
  4. <!-- <detail-list-item term="标准名称">{{ model.name }}</detail-list-item>-->
  5. <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
  6. <detail-list-item term="编码">{{ model.no }}</detail-list-item>
  7. <!-- 保养标准查看界面补充缺失参数 -->
  8. <detail-list-item v-if="checkType === 2" term="设备编号">{{ sbInfo.sbNo }}</detail-list-item>
  9. <detail-list-item v-if="checkType === 2" term="设备名称">{{ sbInfo.sbName }}</detail-list-item>
  10. <detail-list-item v-if="checkType === 2" term="执行人方式">{{ BaseTool.Object.getField(checkUserTypeMap,
  11. sbInfo.checkUserType) }}</detail-list-item>
  12. <detail-list-item v-if="checkType === 2" term="执行人/班组">{{ sbInfo.checkUserName || sbInfo.checkDeptName || '-'
  13. }}</detail-list-item>
  14. <!-- <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>-->
  15. <detail-list-item term="维护等级">{{ BaseTool.Object.getField(levelMap, model.level) }}</detail-list-item>
  16. <detail-list-item term="计划周期">{{ model.period }}{{ BaseTool.Object.getField(periodTypeMap, model.periodType)
  17. }}</detail-list-item>
  18. <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
  19. <detail-list-item term="上次实际日期">{{ model.lastDate }}</detail-list-item>
  20. <detail-list-item term="下次预计日期">{{ model.nextDate }}</detail-list-item>
  21. <!-- <detail-list-item term="动作类型">{{ BaseTool.Object.getField(actionTypeMap,model.actionType) }}</detail-list-item>-->
  22. <!-- <detail-list-item term="部位">{{ model.partName }}</detail-list-item>-->
  23. <!-- <detail-list-item term="是否启用"><badge :status="DictCache.COLOR.YES_NO[model.enable]" :text="enableMap[model.enable]"></badge></detail-list-item>-->
  24. <!-- <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
  25. <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
  26. <detail-list-item term="创建时间">{{ model.updateTime }}</detail-list-item>
  27. <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>-->
  28. </detail-list>
  29. <detail-list title="" :col="1">
  30. <!-- <detail-list-item term="检查项目">{{ model.requirement }}</detail-list-item> -->
  31. <detail-list-item term="检查标准">{{ model.remark }}</detail-list-item>
  32. </detail-list>
  33. <title-divider title="检查项目" width="90px"></title-divider>
  34. <a-table :data-source="model.requirementList" :columns="columns2" bordered rowKey="bomId" :pagination="false">
  35. </a-table>
  36. <template slot="footer">
  37. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  38. </template>
  39. <title-divider title="标准图片" width="90px"></title-divider>
  40. <detail-list title="" :col="1">
  41. <detail-list-item term="" v-if="model.checkImgList != null && model.checkImgList.length > 0">
  42. <viewer :images="model.checkImgList" @inited="inited" ref="viewer" :index="1">
  43. <img v-for="item in model.checkImgList" :src="item.url" :key="item.id" class="image">
  44. </viewer>
  45. </detail-list-item>
  46. <detail-list-item term="" v-if="model.checkImgList == null || model.checkImgList.length === 0">
  47. 暂无
  48. </detail-list-item>
  49. </detail-list>
  50. <title-divider title="标准文件" width="90px"></title-divider>
  51. <detail-list title="" :col="8">
  52. <detail-list-item term="">
  53. <a-upload :multiple="true" :fileList="BaseTool.UPLOAD.transImg(model.checkFileList)">
  54. </a-upload>
  55. </detail-list-item>
  56. </detail-list>
  57. <!-- <a-tabs type="card" default-active-key="1">
  58. <a-tab-pane key="1" tab="点检标准参数">
  59. <a-table
  60. bordered
  61. :data-source="data"
  62. :columns="columns"
  63. tableLayout="auto"
  64. rowKey="id"
  65. >
  66. </a-table>
  67. </a-tab-pane>
  68. </a-tabs>-->
  69. <title-divider title="关联备件" width="90px"></title-divider>
  70. <a-table :data-source="data" :columns="columns" bordered tableLayout="auto" rowKey="bomId">
  71. </a-table>
  72. <!-- <template slot="footer">
  73. <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
  74. </template> -->
  75. </a-modal>
  76. </template>
  77. <script>
  78. import DetailList from '@/components/tools/DetailList'
  79. const DetailListItem = DetailList.Item
  80. export default {
  81. name: 'CheckStandardDetail',
  82. components: {
  83. DetailList,
  84. DetailListItem,
  85. },
  86. props: {
  87. /**
  88. * 检查类型: 1-点检 2-保养
  89. */
  90. checkType: {
  91. type: Number,
  92. default: 1,
  93. },
  94. },
  95. data() {
  96. return {
  97. confirmLoading: false,
  98. mdl: {},
  99. modalTitle: null,
  100. visible: false,
  101. // 下拉框map
  102. typeMap: {},
  103. levelMap: {},
  104. periodTypeMap: {},
  105. checkUserTypeMap: {},
  106. actionTypeMap: {},
  107. enableMap: {},
  108. model: {
  109. /* 'name': null, */
  110. no: null,
  111. type: null,
  112. level: null,
  113. part: null,
  114. enable: null,
  115. requirement: null,
  116. standardHours: null,
  117. remark: null,
  118. nextDate: null,
  119. lastDate: null,
  120. createdUserId: null,
  121. updateUserId: null,
  122. updateUserName: null,
  123. updateTime: null,
  124. },
  125. sbInfo: {},
  126. // 表头
  127. columns2: [
  128. {
  129. title: '保养周期',
  130. dataIndex: 'period'
  131. },
  132. {
  133. title: '管理项目',
  134. dataIndex: 'manageItem',
  135. },
  136. {
  137. title: '检查项目',
  138. dataIndex: 'checkItem',
  139. },
  140. {
  141. title: '方法工具',
  142. dataIndex: 'method',
  143. },
  144. {
  145. title: '保养级别',
  146. dataIndex: 'checkLevel',
  147. },
  148. {
  149. title: '标准类型',
  150. dataIndex: 'sbTypeName',
  151. },
  152. {
  153. title: '内容',
  154. dataIndex: 'remark',
  155. },
  156. // {
  157. // title: '类型',
  158. // dataIndex: 'type',
  159. // customRender: (text, record, index) => {
  160. // return this.BaseTool.Table.getMapText(this.typeDetailMap, text)
  161. // },
  162. // },
  163. ],
  164. columns: [
  165. {
  166. title: '名称',
  167. dataIndex: 'spareName',
  168. },
  169. {
  170. title: '规格型号',
  171. dataIndex: 'ggxh',
  172. },
  173. {
  174. title: '数量',
  175. dataIndex: 'num',
  176. width: 150,
  177. scopedSlots: { customRender: 'num' },
  178. },
  179. ],
  180. data: [],
  181. typeDetailMap: {},
  182. }
  183. },
  184. created() {
  185. // 下拉框map
  186. this.typeDetailMap = this.DictCache.getLabelByValueMapByType('check_item_type')
  187. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
  188. this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  189. this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
  190. this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
  191. this.checkUserTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_USER_TYPE)
  192. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
  193. },
  194. methods: {
  195. inited(viewer) {
  196. this.$viewer = viewer
  197. // this.$viewer.index = 0
  198. // // 不要他的按钮
  199. // this.$viewer.options.button = false
  200. // // 不要他的底部缩略图
  201. // this.$viewer.options.navbar = false
  202. // // 不要他的底部标题
  203. // this.$viewer.options.title = false
  204. // // 不要他的底部工具栏
  205. // this.$viewer.options.toolbar = false
  206. },
  207. base(record, sbInfo) {
  208. this.visible = true
  209. this.modalTitle = '详情'
  210. this.model = record
  211. this.sbInfo = sbInfo
  212. this.data = record.detailList
  213. },
  214. handleCancel() {
  215. this.visible = false
  216. this.confirmLoading = false
  217. },
  218. },
  219. }
  220. </script>