dialog.info.vue 11 KB

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