dialog.info.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <div class="edu-training-edit">
  3. <DialogCom title="演练任务详情" :visible.sync="isShow" width="1200px">
  4. <div class="page-body">
  5. <el-descriptions
  6. class="margin-top"
  7. :column="2"
  8. size="medium"
  9. border
  10. :contentStyle="content_style"
  11. :label-style="labelStyle"
  12. >
  13. <el-descriptions-item labelClassName="gx_info_label" label="任务名称">
  14. {{ formData.title }} </el-descriptions-item
  15. ><el-descriptions-item
  16. labelClassName="gx_info_label"
  17. label="任务进度"
  18. >
  19. {{
  20. getLabel(dict.type.drill_task_status, formData.status, "未知")
  21. }} </el-descriptions-item
  22. ><el-descriptions-item
  23. labelClassName="gx_info_label"
  24. label="任务时间"
  25. >
  26. {{
  27. formData.startDate + " ~ " + formData.endDate
  28. }} </el-descriptions-item
  29. ><el-descriptions-item
  30. labelClassName="gx_info_label"
  31. label="演练机构"
  32. >
  33. {{ formData.orgName }} </el-descriptions-item
  34. ><el-descriptions-item
  35. labelClassName="gx_info_label"
  36. label="指挥人"
  37. >
  38. {{ formData.hostName }} </el-descriptions-item
  39. ><el-descriptions-item
  40. labelClassName="gx_info_label"
  41. label="登记人"
  42. >
  43. {{ formData.recorderName}} </el-descriptions-item
  44. ><el-descriptions-item
  45. labelClassName="gx_info_label"
  46. label="演练项目"
  47. >
  48. {{ formData.typeText }} </el-descriptions-item
  49. ><el-descriptions-item
  50. labelClassName="gx_info_label"
  51. label="演练地点"
  52. >
  53. {{ formData.drillSite }} </el-descriptions-item
  54. ><el-descriptions-item
  55. labelClassName="gx_info_label"
  56. label="演练开始时间"
  57. >
  58. {{ formData.drillStartTime }} </el-descriptions-item
  59. >
  60. <el-descriptions-item
  61. labelClassName="gx_info_label"
  62. label="演练结束时间"
  63. >
  64. {{ formData.drillEndTime }}
  65. </el-descriptions-item>
  66. <el-descriptions-item
  67. labelClassName="gx_info_label"
  68. span="2"
  69. label="预设案由"
  70. >
  71. {{ formData.presetCase }}
  72. </el-descriptions-item>
  73. <el-descriptions-item
  74. labelClassName="gx_info_label"
  75. span="2"
  76. label="演练情况"
  77. >
  78. {{ formData.drillSituation }}
  79. </el-descriptions-item>
  80. </el-descriptions>
  81. <!-- <el-form :model="formData" size="small" ref="form" label-position="right" label-width="120px"
  82. label-suffix=":">
  83. <el-row>
  84. <el-col :span="12">
  85. <el-form-item prop="type" label="任务名称">{{
  86. formData.title
  87. }}
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="12">
  91. <el-form-item prop="type" label="演练类型">{{
  92. formData.categoryText
  93. }}
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="12">
  97. <el-form-item prop="type" label="任务进度">{{
  98. getLabel(dict.type.drill_task_status, formData.status,"未知")
  99. }}
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="12">
  103. <el-form-item label="任务时间">{{
  104. formData.startDate +" ~ " + formData.endDate
  105. }}
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="12">
  109. <el-form-item label="演练机构">{{
  110. formData.orgName
  111. }}
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="12">
  115. <el-form-item label="指挥人">{{
  116. formData.hostName
  117. }}
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="12">
  121. <el-form-item label="登记人">{{
  122. formData.recorderName
  123. }}
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="12">
  127. <el-form-item label="演练项目">{{
  128. formData.typeText
  129. }}
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="12">
  133. <el-form-item label="演练地点">{{
  134. formData.drillSite
  135. }}
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="12">
  139. <el-form-item prop="drillStartTime" label="演练开始时间">
  140. {{ formData.drillStartTime }}
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="12">
  144. <el-form-item prop="drillEndTime" label="演练结束时间">
  145. {{ formData.drillEndTime }}
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="24">
  149. <el-form-item prop="hostId" label="预设案由">{{
  150. formData.presetCase
  151. }}
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="24">
  155. <el-form-item prop="hostId" label="演练情况">{{
  156. formData.drillSituation
  157. }}
  158. </el-form-item>
  159. </el-col>
  160. <el-col :span="24">
  161. <el-form-item prop="comment" label="点评总结">{{
  162. formData.comment
  163. }}
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="12">
  167. <el-form-item prop="dueCount" label="参与人员">{{
  168. formData.taskUserList ? formData.taskUserList.filter((x) => x.type === 1)
  169. .map((v) => v.userName).join(",") : ""
  170. }}
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="12">
  174. <el-form-item prop="dueCount" label="缺席人员">{{
  175. formData.taskUserList ? formData.taskUserList.filter((x) => x.type === 2)
  176. .map((v) => v.userName).join(",") : ""
  177. }}
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="12">
  181. <el-form-item prop="imageList" label="演练图片">
  182. <ImageListPreview v-model="formData.imageList"></ImageListPreview>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="12">
  186. <el-form-item prop="imageList" label="参演人员签名图片">
  187. <ImageListPreview v-model="formData.signImageList"></ImageListPreview>
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="24" class="block">
  191. <el-form-item prop="commentScore" label="评分">
  192. <el-rate
  193. v-model="formData.commentScore"
  194. :max="10"
  195. :disabled="true"
  196. :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
  197. </el-rate>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="24">
  201. <el-form-item label="资料文件" prop="fileList">
  202. <K-file-upload ref="upload" :isShowUploadBtn="false"
  203. :defaultValue="formFileListDefualtValue"
  204. v-model="formData.fileList"/>
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. </el-form> -->
  209. </div>
  210. <div slot="footer" class="dialog-footer">
  211. <el-button @click="onHide">关闭</el-button>
  212. </div>
  213. </DialogCom>
  214. </div>
  215. </template>
  216. <script>
  217. import { mapState, mapMutations } from "vuex";
  218. import { getEduTask } from "@/api/core/edu/eduTask";
  219. import { getDrillTask } from "@/api/core/drill/drillTask";
  220. import { initList } from "@/api/core/drill/drillDictionary";
  221. import KFileUpload from "@/components/K-FileUpload/index.vue";
  222. import { getLabel } from "@/views/commonOption";
  223. export default {
  224. components: { KFileUpload },
  225. dicts: ["drill_task_status", "core_drill_type"],
  226. data() {
  227. const params = this.$route.params;
  228. return {
  229. id: params ? params.id : null,
  230. isShow: false,
  231. formData: this.reset(),
  232. drillTypeOptions: [],
  233. formFileListDefualtValue: [],
  234. labelStyle: {
  235. color: "#000",
  236. "text-align": "center",
  237. height: "40px",
  238. "min-width": "150px",
  239. "word-break": "keep-all",
  240. },
  241. content_style: {
  242. "text-align": "left",
  243. "min-width": "300px",
  244. "word-break": "break-all",
  245. },
  246. 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' }
  247. };
  248. },
  249. props: {},
  250. watch: {},
  251. computed: {
  252. ...mapState(["loginUser"]),
  253. },
  254. methods: {
  255. ...mapMutations([]),
  256. getLabel,
  257. reset(other = {}) {
  258. return {
  259. id: null,
  260. type: null,
  261. host: null,
  262. drillSite: null,
  263. drillTime: null,
  264. hostName: null,
  265. presetCase: null,
  266. drillSituation: null,
  267. imageList: null,
  268. signImageList: null,
  269. commentScore: 5,
  270. org: {},
  271. ...other,
  272. };
  273. },
  274. async refresh(id, other) {
  275. if (!id) {
  276. this.reset(other);
  277. } else {
  278. getDrillTask(id).then((response) => {
  279. this.formData = response.data;
  280. this.formFileListDefualtValue = response.data.fileList;
  281. this.formData.signImageList = this.getSingImageList();
  282. this.loading = false;
  283. });
  284. }
  285. },
  286. async show(id, other = {}) {
  287. this.id = id;
  288. await this.refresh(id, other);
  289. this.isShow = true;
  290. },
  291. // 事件
  292. onHide() {
  293. this.isShow = false;
  294. },
  295. onDownload(url, filename) {
  296. let this_ = this;
  297. this.getBlob(url, function (blob) {
  298. this_.saveAs(blob, filename);
  299. });
  300. },
  301. getSingImageList() {
  302. let res = this.formData.taskUserList
  303. ? this.formData.taskUserList
  304. .filter((x) => x.type === 1 && x.sign == 1)
  305. .map((v) => v.signImage)
  306. .join(",")
  307. : null;
  308. console.log("getSingImage", res);
  309. return res;
  310. },
  311. getBlob(url, cb) {
  312. var xhr = new XMLHttpRequest();
  313. xhr.open("GET", url, true);
  314. xhr.responseType = "blob";
  315. xhr.onload = function () {
  316. if (xhr.status === 200) {
  317. cb(xhr.response);
  318. }
  319. };
  320. xhr.send();
  321. },
  322. initDrillTypeOptions() {
  323. initList().then((response) => {
  324. this.drillTypeOptions = response;
  325. });
  326. },
  327. // 事件
  328. //apimark//
  329. },
  330. mounted() {},
  331. };
  332. </script>
  333. <!-- <style lang="less">
  334. .edu-training-edit {
  335. }
  336. </style> -->