dialog.info.vue 11 KB

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