EquipmentDetail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <a-drawer
  3. :title="title"
  4. :width="width"
  5. placement="right"
  6. @close="close"
  7. destroyOnClose
  8. :visible="visible"
  9. class="equipment-detail-drawer"
  10. >
  11. <a-spin :spinning="confirmLoading" style="height: 100%;">
  12. <div class="u-flex-jab equipment-detail-container">
  13. <!-- 基础信息详情 -->
  14. <div class="base-info-container">
  15. <a-descriptions title="" layout="vertical" bordered size="middle" :column="2" class="equiment-info">
  16. <a-descriptions-item label="设备编号" :span="2">
  17. {{detailData.equipmentcode}}
  18. </a-descriptions-item>
  19. <a-descriptions-item label="设备名称" :span="2">
  20. {{detailData.equipmentname}}
  21. </a-descriptions-item>
  22. <a-descriptions-item label="设备分类" :span="2">
  23. {{detailData.equipmenttreeid_dictText}}
  24. </a-descriptions-item>
  25. <a-descriptions-item label="规格型号" :span="2">
  26. {{detailData.spec}}
  27. </a-descriptions-item>
  28. <a-descriptions-item label="安装地点" :span="2">
  29. {{detailData.address}}
  30. </a-descriptions-item>
  31. <a-descriptions-item label="区域" :span="2">
  32. {{detailData.spaceid_dictText}}
  33. </a-descriptions-item>
  34. <a-descriptions-item label="周期" :span="2">
  35. {{detailData.equipmentCycle}}
  36. </a-descriptions-item>
  37. <a-descriptions-item label="周期单位" :span="2">
  38. {{detailData.cycleUnit_dictText}}
  39. </a-descriptions-item>
  40. <a-descriptions-item label="出厂编号">
  41. {{detailData.factoryNo}}
  42. </a-descriptions-item>
  43. <a-descriptions-item label="出厂日期">
  44. {{detailData.productDate}}
  45. </a-descriptions-item>
  46. <a-descriptions-item label="启用日期">
  47. {{detailData.activeDate}}
  48. </a-descriptions-item>
  49. <a-descriptions-item label="责任部门">
  50. {{detailData.responseDepartment}}
  51. </a-descriptions-item>
  52. <a-descriptions-item label="负责人">
  53. {{detailData.responsePerson}}
  54. </a-descriptions-item>
  55. <a-descriptions-item label="领用人">
  56. {{detailData.recipient}}
  57. </a-descriptions-item>
  58. <a-descriptions-item label="管理状态">
  59. {{detailData.manageStatus_dictText}}
  60. </a-descriptions-item>
  61. </a-descriptions>
  62. </div>
  63. <!-- 巡检详情 -->
  64. <a-tabs default-active-key="1" @change="callback" class="equipment-cmms-tabs">
  65. <a-tab-pane key="1" tab="Tab 1">
  66. <a-table
  67. ref="table"
  68. size="middle"
  69. :scroll="{x:true}"
  70. bordered
  71. rowKey="id"
  72. :columns="columns"
  73. :dataSource="logData"
  74. class="equipment-cmms-table">
  75. <span slot="status" slot-scope="text, record">
  76. <a-tag v-if="record.status === '0'" color="orange">{{ text }}</a-tag>
  77. <a-tag v-if="record.status === '1' || record.priority === '2'" color="blue">{{ text }}</a-tag>
  78. <a-tag v-if="record.status === '3'">{{ text }}</a-tag>
  79. </span>
  80. </a-table>
  81. </a-tab-pane>
  82. <a-tab-pane key="2" tab="Tab 2" force-render>
  83. Content of Tab Pane 2
  84. </a-tab-pane>
  85. <a-tab-pane key="3" tab="Tab 3">
  86. Content of Tab Pane 3
  87. </a-tab-pane>
  88. </a-tabs>
  89. </div>
  90. </a-spin>
  91. </a-drawer>
  92. </template>
  93. <script>
  94. import { httpAction, getAction } from '@/api/manage'
  95. export default {
  96. name: 'RepairManageDetail',
  97. data () {
  98. return {
  99. title:"详情",
  100. width:'100%',
  101. visible: false,
  102. confirmLoading: false, // 加载中
  103. detailData: {}, // 详情
  104. logData: [], // 操作日志表格数据
  105. // 表头
  106. columns: [
  107. // {
  108. // title: '序号',
  109. // dataIndex: '',
  110. // key:'rowIndex',
  111. // width:60,
  112. // align:"center",
  113. // customRender:function (t,r,index) {
  114. // return parseInt(index)+1;
  115. // }
  116. // },
  117. {
  118. title:'节点名称',
  119. align:"center",
  120. dataIndex: 'nodename'
  121. },
  122. {
  123. title:'日期',
  124. align:"center",
  125. dataIndex: 'handledate'
  126. },
  127. {
  128. title:'处理意见',
  129. align:"center",
  130. dataIndex: 'opinion'
  131. },
  132. {
  133. title:'备注',
  134. align:"center",
  135. dataIndex: 'remark'
  136. },
  137. ],
  138. }
  139. },
  140. methods: {
  141. detail (record) {
  142. console.log(record)
  143. this.detailData = record
  144. this.visible = true
  145. this.title = record.equipmentname
  146. // this.title = record.repairname + ' 详情'
  147. // this.confirmLoading = true
  148. // getAction('/cmmsRepair/cmmsRepair/queryById',{id:record.id}).then((res)=>{
  149. // if(res.success){
  150. // this.detailData = res.result
  151. // this.logData = res.result.nodeList
  152. // }else{
  153. // this.$message.warning(res.message);
  154. // }
  155. // }).finally(() => {
  156. // this.confirmLoading = false;
  157. // })
  158. },
  159. close () {
  160. this.visible = false;
  161. },
  162. callback(key) {
  163. console.log(key);
  164. },
  165. }
  166. }
  167. </script>
  168. <style lang="less" scoped>
  169. @import '~@/assets/less/uStyle.less';
  170. </style>
  171. <style lang="less" scoped>
  172. .equipment-detail-drawer{
  173. height: 100vh;
  174. overflow: hidden;
  175. /deep/ .ant-drawer-body{
  176. height: calc(100vh - 55px);
  177. overflow: hidden;
  178. padding: 20px;
  179. background-color: #f5f5f5;
  180. }
  181. .base-info-container{
  182. width: calc(50% - 6px);
  183. height: calc(100vh - 55px - 40px);
  184. overflow: auto;
  185. background-color: #fff;
  186. padding: 12px;
  187. border-radius: 4px;
  188. margin-right: 6px;
  189. .equiment-info{
  190. }
  191. }
  192. .equipment-cmms-tabs{
  193. }
  194. .equipment-cmms-table{
  195. width: calc(50% - 6px);
  196. height: calc(100vh - 55px - 40px);
  197. overflow: auto;
  198. background-color: #fff;
  199. padding: 12px;
  200. border-radius: 4px;
  201. margin-left: 6px;
  202. }
  203. }
  204. </style>