dialog.info.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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 prop="type" label="任务进度">{{
  16. getLabel(dict.type.drill_task_status, formData.status,"未知")
  17. }}
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="12">
  21. <el-form-item label="任务时间">{{
  22. formData.startDate +" ~ " + formData.endDate
  23. }}
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="12">
  27. <el-form-item label="演练机构">{{
  28. formData.orgName
  29. }}
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="12">
  33. <el-form-item label="指挥人">{{
  34. formData.hostName
  35. }}
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="12">
  39. <el-form-item label="记录人">{{
  40. formData.recorderName
  41. }}
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="12">
  45. <el-form-item label="演练项目">{{
  46. formData.typeText
  47. }}
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="12">
  51. <el-form-item label="演练地点">{{
  52. formData.drillSite
  53. }}
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="12">
  57. <el-form-item prop="drillStartTime" label="演练开始时间">
  58. {{ formData.drillStartTime }}
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="12">
  62. <el-form-item prop="drillEndTime" label="演练结束时间">
  63. {{ formData.drillEndTime }}
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="24">
  67. <el-form-item prop="hostId" label="预设案由">{{
  68. formData.presetCase
  69. }}
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="24">
  73. <el-form-item prop="hostId" label="演练情况">{{
  74. formData.drillSituation
  75. }}
  76. </el-form-item>
  77. </el-col>
  78. <!-- 参与人数 -->
  79. <el-col :span="12">
  80. <el-form-item prop="dueCount" label="参与人员">{{
  81. formData.taskUserList ? formData.taskUserList.filter((x) => x.type === 1)
  82. .map((v) => v.userName).join(",") : ""
  83. }}
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="12">
  87. <el-form-item prop="dueCount" label="缺席人员">{{
  88. formData.taskUserList ? formData.taskUserList.filter((x) => x.type === 2)
  89. .map((v) => v.userName).join(",") : ""
  90. }}
  91. </el-form-item>
  92. </el-col>
  93. <!-- 图片 -->
  94. <el-col :span="12">
  95. <el-form-item prop="imageList" label="演练图片">
  96. <ImageListPreview v-model="formData.imageList"></ImageListPreview>
  97. </el-form-item>
  98. </el-col>
  99. <!-- 图片 -->
  100. <el-col :span="12">
  101. <el-form-item prop="imageList" label="参演人员签名图片">
  102. <ImageListPreview v-model="formData.signImageList"></ImageListPreview>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="12">
  106. <el-form-item prop="comment" label="评语">{{
  107. formData.comment
  108. }}
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="12" class="block">
  112. <el-form-item prop="commentScore" label="评分">
  113. <el-rate
  114. v-model="formData.commentScore"
  115. :max="10"
  116. :disabled="true"
  117. :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
  118. </el-rate>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="24">
  122. <el-form-item label="资料文件" prop="fileList">
  123. <K-file-upload ref="upload" :isShowUploadBtn="false"
  124. :defaultValue="formFileListDefualtValue"
  125. v-model="formData.fileList"/>
  126. </el-form-item>
  127. </el-col>
  128. </el-row>
  129. </el-form>
  130. </div>
  131. <div slot="footer" class="dialog-footer">
  132. <el-button @click="onHide">关闭</el-button>
  133. </div>
  134. </DialogCom>
  135. </div>
  136. </template>
  137. <script>
  138. import {mapState, mapMutations} from "vuex";
  139. import {getEduTask} from "@/api/core/edu/eduTask";
  140. import {getDrillTask} from "@/api/core/drill/drillTask";
  141. import {initList} from "@/api/core/drill/drillDictionary";
  142. import KFileUpload from "@/components/K-FileUpload/index.vue";
  143. import { getLabel } from "@/views/commonOption";
  144. export default {
  145. components: {KFileUpload},
  146. dicts: ['drill_task_status', 'core_drill_type'],
  147. data() {
  148. const params = this.$route.params;
  149. return {
  150. id: params ? params.id : null,
  151. isShow: false,
  152. formData: this.reset(),
  153. drillTypeOptions: [],
  154. formFileListDefualtValue: [],
  155. 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' }
  156. };
  157. },
  158. props: {},
  159. watch: {},
  160. computed: {
  161. ...mapState(["loginUser"]),
  162. },
  163. methods: {
  164. ...mapMutations([]),
  165. getLabel,
  166. reset(other = {}) {
  167. return {
  168. id: null,
  169. type: null,
  170. host: null,
  171. drillSite: null,
  172. drillTime: null,
  173. hostName: null,
  174. presetCase: null,
  175. drillSituation: null,
  176. imageList: null,
  177. signImageList: null,
  178. commentScore: 5,
  179. org: {},
  180. ...other,
  181. };
  182. },
  183. async refresh(id, other) {
  184. if (!id) {
  185. this.reset(other);
  186. } else {
  187. getDrillTask(id).then(response => {
  188. this.formData = response.data;
  189. this.formFileListDefualtValue=response.data.fileList;
  190. this.formData.signImageList = this.getSingImageList();
  191. this.loading = false;
  192. })
  193. }
  194. },
  195. async show(id, other = {}) {
  196. this.id = id;
  197. await this.refresh(id, other);
  198. this.isShow = true;
  199. },
  200. // 事件
  201. onHide() {
  202. this.isShow = false;
  203. },
  204. onDownload(url, filename) {
  205. let this_ = this;
  206. this.getBlob(url, function (blob) {
  207. this_.saveAs(blob, filename);
  208. });
  209. },
  210. getSingImageList() {
  211. let res = this.formData.taskUserList ? this.formData.taskUserList.filter((x) => x.type === 1 && x.sign == 1)
  212. .map((v) => v.signImage).join(",") : null;
  213. console.log("getSingImage", res)
  214. return res;
  215. },
  216. getBlob(url, cb) {
  217. var xhr = new XMLHttpRequest();
  218. xhr.open("GET", url, true);
  219. xhr.responseType = "blob";
  220. xhr.onload = function () {
  221. if (xhr.status === 200) {
  222. cb(xhr.response);
  223. }
  224. };
  225. xhr.send();
  226. },
  227. initDrillTypeOptions() {
  228. initList().then(response => {
  229. this.drillTypeOptions = response;
  230. })
  231. }
  232. // 事件
  233. //apimark//
  234. },
  235. mounted() {
  236. },
  237. };
  238. </script>
  239. <!-- <style lang="less">
  240. .edu-training-edit {
  241. }
  242. </style> -->