Detail.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  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: 16px" v-if="model.status === DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE" type="default" @click="handleExecute()">接收</a-button>
  7. <a-button style="margin-left: 16px" v-if="model.status === DictCache.VALUE.CHECK_JOB_STATUS.EXECUTING" type="default" @click="handleFinish()">完成</a-button>
  8. <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
  9. </span>
  10. </a-col>
  11. </a-row>
  12. <title-divider title="标准信息" width="90px"></title-divider>
  13. <detail-list title="" :col="2">
  14. <detail-list-item term="标准名称">{{ modelStandard.name }}</detail-list-item>
  15. <detail-list-item term="编码">{{ modelStandard.no }}</detail-list-item>
  16. <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,modelStandard.type) }}</detail-list-item>
  17. <detail-list-item term="计划周期">{{ modelStandard.period }}{{ BaseTool.Object.getField(periodTypeMap,modelStandard.periodType) }}</detail-list-item>
  18. <detail-list-item term="标准工时">{{ modelStandard.standardHours }}</detail-list-item>
  19. <detail-list-item term="动作类型">{{ BaseTool.Object.getField(actionTypeMap,modelStandard.actionType) }}</detail-list-item>
  20. <detail-list-item term="部位">{{ modelStandard.partName }}</detail-list-item>
  21. <!-- <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
  22. <detail-list-item term="创建时间">{{ model.updateTime }}</detail-list-item>
  23. <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>-->
  24. </detail-list>
  25. <detail-list title="" :col="1">
  26. <detail-list-item term="要求">{{ modelStandard.requirement }}</detail-list-item>
  27. <detail-list-item term="备注">{{ modelStandard.remark }}</detail-list-item>
  28. </detail-list>
  29. <title-divider title="标准图片" width="90px"></title-divider>
  30. <detail-list title="" :col="6">
  31. <detail-list-item v-for="item in modelStandard.checkImgList" term="">
  32. <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
  33. </detail-list-item>
  34. </detail-list>
  35. <title-divider title="标准文件" width="90px"></title-divider>
  36. <detail-list title="" :col="8">
  37. <detail-list-item term="">
  38. <a-upload
  39. :multiple="true"
  40. :fileList="BaseTool.UPLOAD.transImg(modelStandard.checkFileList)"
  41. >
  42. </a-upload>
  43. </detail-list-item>
  44. </detail-list>
  45. <title-divider title="任务信息" width="90px"></title-divider>
  46. <detail-list title="" :col="3">
  47. <detail-list-item term="实际工时">{{ model.realHours }}</detail-list-item>
  48. <detail-list-item term="执行日期">{{ model.startTime }}</detail-list-item>
  49. <detail-list-item term="截至日期">{{ model.endTime }}</detail-list-item>
  50. <detail-list-item term="实际开始时间">{{ model.actualStartTime }}</detail-list-item>
  51. <detail-list-item term="实际结束时间">{{ model.actualEndTime }}</detail-list-item>
  52. <!--<detail-list-item term="是否停机"><badge :status="DictCache.COLOR.YES_NO[model.sbStatus]" :text="sbStatusMap[model.sbStatus]" /></detail-list-item>-->
  53. <detail-list-item term="任务状态"><badge :status="DictCache.COLOR.CHECK_JOB_STATUS[model.status]" :text="statusMap[model.status]" /></detail-list-item>
  54. </detail-list>
  55. <detail-list title="" :col="1">
  56. <detail-list-item term="检查结果">{{ model.feedback }}</detail-list-item>
  57. </detail-list>
  58. <base-form :check-type="checkType" ref="baseModal" @ok="handleOk"/>
  59. </a-card>
  60. </template>
  61. <script>
  62. import DetailList from '@/components/tools/DetailList'
  63. import { fetchCheckStandard } from '@/api/check/checkstandard'
  64. import { executeJob, fetchCheckJob } from '@/api/check/checkjob'
  65. import BaseForm from '@/views/check/checkjob/modules/BaseForm'
  66. const DetailListItem = DetailList.Item
  67. export default {
  68. name: 'CheckJobDetail',
  69. components: {
  70. DetailList,
  71. DetailListItem,
  72. BaseForm
  73. },
  74. props: {
  75. /**
  76. * 检查类型: 1-任务 2-巡检
  77. */
  78. checkType: {
  79. type: Number,
  80. default: 1
  81. }
  82. },
  83. data () {
  84. return {
  85. names: ['任务', '巡检'],
  86. confirmLoading: false,
  87. mdl: {},
  88. modalTitle: null,
  89. visible: false,
  90. // 下拉框map
  91. statusMap: {},
  92. sbStatusMap: {},
  93. periodTypeMap: {},
  94. actionTypeMap: {},
  95. typeMap: {},
  96. enableMap: {},
  97. modelStandard: {},
  98. model: {
  99. 'planId': null,
  100. 'startTime': null,
  101. 'endTime': null,
  102. 'actualStartTime': null,
  103. 'actualEndTime': null,
  104. 'checkedNum': null,
  105. 'abnormalNum': null,
  106. 'checkNum': null,
  107. 'status': null,
  108. 'sbStatus': null,
  109. 'createdUserId': null,
  110. 'updateUserId': null,
  111. 'updateUserName': null,
  112. 'updateTime': null
  113. }
  114. }
  115. },
  116. created () {
  117. // 下拉框map
  118. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
  119. this.sbStatusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  120. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
  121. this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  122. this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
  123. this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
  124. },
  125. methods: {
  126. base (record) {
  127. this.visible = true
  128. this.modalTitle = '详情'
  129. this.model = record
  130. fetchCheckStandard({ id: record.standardId }).then(res => {
  131. this.modelStandard = res.data
  132. })
  133. },
  134. handleCancel () {
  135. this.visible = false
  136. this.confirmLoading = false
  137. this.$emit('ok')
  138. },
  139. handleFinish () {
  140. fetchCheckJob({ id: this.model.id }).then(res => {
  141. const modal = this.$refs.baseModal
  142. modal.base(res.data)
  143. })
  144. },
  145. handleExecute () {
  146. executeJob({ id: this.model.id }).then(res => {
  147. this.$message.info('接收成功')
  148. this.handleOk()
  149. })
  150. },
  151. handleOk () {
  152. fetchCheckJob({ id: this.model.id }).then(res => {
  153. this.model = res.data
  154. })
  155. }
  156. }
  157. }
  158. </script>