detail.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <ele-modal
  3. :visible.sync="visible"
  4. title="查看详情"
  5. width="60vw"
  6. append-to-body
  7. :close-on-click-modal="false"
  8. :maxable="true"
  9. @close="cancel"
  10. >
  11. <div class="detail-box">
  12. <el-row class="detail-row">
  13. <el-col :span="12" class="detail-item">
  14. <span class="detail-label">培训名称:</span>
  15. <span class="detail-value">{{ form.trainingName || '-' }}</span>
  16. </el-col>
  17. <el-col :span="12" class="detail-item">
  18. <span class="detail-label">培训计划状态:</span>
  19. <span class="detail-value">{{ form.planStatusName || '-' }}</span>
  20. </el-col>
  21. </el-row>
  22. <el-row class="detail-row">
  23. <el-col :span="12" class="detail-item">
  24. <span class="detail-label">培训讲师:</span>
  25. <span class="detail-value">{{ form.trainingLecturer || '-' }}</span>
  26. </el-col>
  27. <el-col :span="12" class="detail-item">
  28. <span class="detail-label">讲师资质:</span>
  29. <span class="detail-value">{{
  30. form.lecturerQualification || '-'
  31. }}</span>
  32. </el-col>
  33. </el-row>
  34. <el-row class="detail-row">
  35. <el-col :span="12" class="detail-item">
  36. <span class="detail-label">培训开始时间:</span>
  37. <span class="detail-value">{{ form.trainingStartTime || '-' }}</span>
  38. </el-col>
  39. <el-col :span="12" class="detail-item">
  40. <span class="detail-label">要求完成时间:</span>
  41. <span class="detail-value">{{
  42. form.requiredCompleteTime || '-'
  43. }}</span>
  44. </el-col>
  45. </el-row>
  46. <el-row class="detail-row">
  47. <el-col :span="12" class="detail-item">
  48. <span class="detail-label">培训学时:</span>
  49. <span class="detail-value">{{ form.trainingHours || '-' }}</span>
  50. </el-col>
  51. <el-col :span="12" class="detail-item">
  52. <span class="detail-label">课程时长(分钟):</span>
  53. <span class="detail-value">{{
  54. form.courseDurationMinutes || '-'
  55. }}</span>
  56. </el-col>
  57. </el-row>
  58. <el-row class="detail-row">
  59. <el-col :span="12" class="detail-item">
  60. <span class="detail-label">学习状态:</span>
  61. <span class="detail-value">{{ form.statusName || '-' }}</span>
  62. </el-col>
  63. <el-col :span="12" class="detail-item">
  64. <span class="detail-label">是否已逾期:</span>
  65. <span class="detail-value">{{ form.overdue ? '是' : '否' }}</span>
  66. </el-col>
  67. </el-row>
  68. <el-row class="detail-row">
  69. <el-col :span="12" class="detail-item">
  70. <span class="detail-label">已完成时长(分钟):</span>
  71. <span class="detail-value">{{
  72. form.completedDurationMinutes || '-'
  73. }}</span>
  74. </el-col>
  75. <el-col :span="12" class="detail-item">
  76. <span class="detail-label">完成时间:</span>
  77. <span class="detail-value">{{ form.completeTime || '-' }}</span>
  78. </el-col>
  79. </el-row>
  80. <el-row class="detail-row">
  81. <el-col :span="24" class="detail-item">
  82. <span class="detail-label">相关培训资料:</span>
  83. <span class="detail-value">{{
  84. form.trainingMaterialNames || '-'
  85. }}</span>
  86. </el-col>
  87. </el-row>
  88. <el-row class="detail-row">
  89. <el-col :span="24" class="detail-item">
  90. <span class="detail-label">资料学习进度:</span>
  91. <span class="detail-value"
  92. >{{ form.materialCompletedCount || 0 }}/{{
  93. form.materialTotalCount || 0
  94. }}</span
  95. >
  96. </el-col>
  97. </el-row>
  98. <el-row v-if="form.examName" class="detail-row">
  99. <el-col :span="12" class="detail-item">
  100. <span class="detail-label">考试名称:</span>
  101. <span class="detail-value">{{ form.examName }}</span>
  102. </el-col>
  103. <el-col :span="12" class="detail-item">
  104. <span class="detail-label">考试类型:</span>
  105. <span class="detail-value">{{ examTypeText }}</span>
  106. </el-col>
  107. </el-row>
  108. <el-row v-if="form.examName" class="detail-row">
  109. <el-col :span="12" class="detail-item">
  110. <span class="detail-label">考试地点:</span>
  111. <span class="detail-value">{{ form.examPlace || '-' }}</span>
  112. </el-col>
  113. <el-col :span="12" class="detail-item">
  114. <span class="detail-label">考试时长(分钟):</span>
  115. <span class="detail-value">{{
  116. form.examDurationMinutes || '-'
  117. }}</span>
  118. </el-col>
  119. </el-row>
  120. <el-row v-if="form.examName" class="detail-row">
  121. <el-col :span="12" class="detail-item">
  122. <span class="detail-label">合格分数:</span>
  123. <span class="detail-value">{{ form.passScore || '-' }}</span>
  124. </el-col>
  125. </el-row>
  126. </div>
  127. <template v-slot:footer>
  128. <el-button @click="cancel">关闭</el-button>
  129. </template>
  130. </ele-modal>
  131. </template>
  132. <script>
  133. import { EXAM_TYPE_MAP } from '../constants';
  134. const defForm = {
  135. trainingName: '',
  136. planStatus: '',
  137. planStatusName: '',
  138. trainingLecturer: '',
  139. lecturerQualification: '',
  140. trainingStartTime: '',
  141. requiredCompleteTime: '',
  142. trainingHours: '',
  143. courseDurationMinutes: '',
  144. status: '',
  145. statusName: '',
  146. overdue: false,
  147. completedDurationMinutes: '',
  148. completeTime: '',
  149. trainingMaterialNames: '',
  150. materialCompletedCount: '',
  151. materialTotalCount: '',
  152. examName: '',
  153. examType: '',
  154. examPlace: '',
  155. examDurationMinutes: '',
  156. passScore: ''
  157. };
  158. export default {
  159. data() {
  160. return {
  161. visible: false,
  162. form: JSON.parse(JSON.stringify(defForm))
  163. };
  164. },
  165. computed: {
  166. examTypeText() {
  167. return EXAM_TYPE_MAP[this.form.examType] || this.form.examType || '-';
  168. }
  169. },
  170. methods: {
  171. open(row) {
  172. this.visible = true;
  173. this.form = JSON.parse(JSON.stringify({ ...defForm, ...(row || {}) }));
  174. },
  175. cancel() {
  176. this.form = JSON.parse(JSON.stringify(defForm));
  177. this.visible = false;
  178. }
  179. }
  180. };
  181. </script>
  182. <style lang="scss" scoped>
  183. .detail-box {
  184. max-height: calc(100vh - 300px);
  185. overflow-y: auto;
  186. padding: 10px 20px;
  187. }
  188. .detail-row {
  189. border-bottom: 1px solid #ebeef5;
  190. padding: 14px 0;
  191. &:last-child {
  192. border-bottom: none;
  193. }
  194. }
  195. .detail-item {
  196. display: flex;
  197. align-items: flex-start;
  198. line-height: 22px;
  199. }
  200. .detail-label {
  201. flex-shrink: 0;
  202. width: 120px;
  203. text-align: right;
  204. color: #606266;
  205. }
  206. .detail-value {
  207. flex: 1;
  208. color: #303133;
  209. word-break: break-all;
  210. }
  211. </style>