dialog.info.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="edu-training-edit">
  3. <DialogCom title="演练任务详情" :visible.sync="isShow" width="960px">
  4. <div class="page-body">
  5. <el-form :model="formData" size="small" ref="form" label-position="right" label-width="120px"
  6. label-suffix=":">
  7. <el-row>
  8. <el-col :span="12">
  9. <el-form-item prop="type" label="主题">{{
  10. formData.title
  11. }}
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="12">
  15. <el-form-item label="演练机构">{{
  16. formData.orgName
  17. }}
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="12">
  21. <el-form-item label="演练项目">{{
  22. formData.typeText
  23. }}
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="12">
  27. <el-form-item label="演练地点">{{
  28. formData.drillSite
  29. }}
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="12">
  33. <el-form-item prop="drillStartTime" label="演练开始时间">
  34. {{ formData.drillStartTime }}
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="12">
  38. <el-form-item prop="drillEndTime" label="演练结束时间">
  39. {{ formData.drillEndTime }}
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="12">
  43. <el-form-item prop="hostId" label="指挥人">{{
  44. formData.hostName
  45. }}
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="24">
  49. <el-form-item prop="hostId" label="预设案由">{{
  50. formData.presetCase
  51. }}
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="24">
  55. <el-form-item prop="hostId" label="演练情况">{{
  56. formData.drillSituation
  57. }}
  58. </el-form-item>
  59. </el-col>
  60. <!-- 参与人数 -->
  61. <el-col :span="12">
  62. <el-form-item prop="dueCount" label="参与人员">{{
  63. formData.taskUserList ? formData.taskUserList.filter((x) => x.type === 1)
  64. .map((v) => v.userName).join(",") : ""
  65. }}
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="12">
  69. <el-form-item prop="dueCount" label="缺席人员">{{
  70. formData.taskUserList ? formData.taskUserList.filter((x) => x.type === 2)
  71. .map((v) => v.userName).join(",") : ""
  72. }}
  73. </el-form-item>
  74. </el-col>
  75. <!-- 图片 -->
  76. <el-col :span="12">
  77. <el-form-item prop="imageList" label="上传图片">
  78. <ImageListPreview v-model="formData.imageList"></ImageListPreview>
  79. </el-form-item>
  80. </el-col>
  81. <!-- 图片 -->
  82. <el-col :span="12">
  83. <el-form-item prop="imageList" label="参与人员签名图片">
  84. <ImageListPreview v-model="formData.signImageList"></ImageListPreview>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="24" class="block">
  88. <el-form-item prop="commentScore" label="评分">
  89. <el-rate
  90. v-model="formData.commentScore"
  91. :max="10"
  92. :disabled="true"
  93. :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
  94. </el-rate>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="24">
  98. <el-form-item prop="comment" label="评语">{{
  99. formData.comment
  100. }}
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. </el-form>
  105. </div>
  106. <div slot="footer" class="dialog-footer">
  107. <el-button @click="onHide">关闭</el-button>
  108. </div>
  109. </DialogCom>
  110. </div>
  111. </template>
  112. <script>
  113. import {mapState, mapMutations} from "vuex";
  114. import {getEduTask} from "@/api/core/edu/eduTask";
  115. import {getDrillTask} from "@/api/core/drill/drillTask";
  116. import {initList} from "@/api/core/drill/drillDictionary";
  117. export default {
  118. components: {},
  119. dicts: ['edu_type', 'edu_task_status'],
  120. data() {
  121. const params = this.$route.params;
  122. return {
  123. id: params ? params.id : null,
  124. isShow: false,
  125. formData: this.reset(),
  126. drillTypeOptions: [],
  127. iconClasses: ['icon-rate-face-1', 'icon-rate-face-2', 'icon-rate-face-3'] // 等同于 { 2: 'icon-rate-face-1', 4: { value: 'icon-rate-face-2', excluded: true }, 5: 'icon-rate-face-3' }
  128. };
  129. },
  130. props: {},
  131. watch: {},
  132. computed: {
  133. ...mapState(["loginUser"]),
  134. },
  135. methods: {
  136. ...mapMutations([]),
  137. reset(other = {}) {
  138. return {
  139. id: null,
  140. type: null,
  141. host: null,
  142. drillSite: null,
  143. drillTime: null,
  144. hostName: null,
  145. presetCase: null,
  146. drillSituation: null,
  147. imageList: null,
  148. signImageList: null,
  149. commentScore: 5,
  150. org: {},
  151. ...other,
  152. };
  153. },
  154. async refresh(id, other) {
  155. if (!id) {
  156. this.reset(other);
  157. } else {
  158. getDrillTask(id).then(response => {
  159. this.formData = response.data;
  160. this.formData.signImageList = this.getSingImageList();
  161. this.loading = false;
  162. })
  163. }
  164. },
  165. async show(id, other = {}) {
  166. this.id = id;
  167. await this.refresh(id, other);
  168. this.isShow = true;
  169. },
  170. // 事件
  171. onHide() {
  172. this.isShow = false;
  173. },
  174. onDownload(url, filename) {
  175. let this_ = this;
  176. this.getBlob(url, function (blob) {
  177. this_.saveAs(blob, filename);
  178. });
  179. },
  180. getSingImageList() {
  181. let res = this.formData.taskUserList ? this.formData.taskUserList.filter((x) => x.type === 1 && x.sign == 1)
  182. .map((v) => v.signImage).join(",") : null;
  183. console.log("getSingImage", res)
  184. return res;
  185. },
  186. getBlob(url, cb) {
  187. var xhr = new XMLHttpRequest();
  188. xhr.open("GET", url, true);
  189. xhr.responseType = "blob";
  190. xhr.onload = function () {
  191. if (xhr.status === 200) {
  192. cb(xhr.response);
  193. }
  194. };
  195. xhr.send();
  196. },
  197. initDrillTypeOptions() {
  198. initList().then(response => {
  199. this.drillTypeOptions = response;
  200. })
  201. }
  202. // 事件
  203. //apimark//
  204. },
  205. mounted() {
  206. },
  207. };
  208. </script>
  209. <!-- <style lang="less">
  210. .edu-training-edit {
  211. }
  212. </style> -->