dialog.detail.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div>
  3. <DialogCom
  4. title="履职任务详情"
  5. :visible.sync="isShow"
  6. width="1200px"
  7. @close="onClose"
  8. >
  9. <el-descriptions
  10. class="margin-top"
  11. size="medium"
  12. border
  13. :column="2"
  14. v-if="detail"
  15. style="width: 100%;"
  16. :label-style="labelStyle"
  17. :contentStyle="content_style"
  18. >
  19. <el-descriptions-item label="任务名称" labelClassName="gx_info_label">{{
  20. detail.taskName
  21. }}</el-descriptions-item>
  22. <el-descriptions-item label="任务进度" labelClassName="gx_info_label">{{
  23. getLabel(statusOptions, detail.status)
  24. }}</el-descriptions-item>
  25. <el-descriptions-item label="任务时间" labelClassName="gx_info_label"
  26. >{{ dayjs(detail.planStartTime).format("YYYY-MM-DD HH:mm") }}-{{
  27. dayjs(detail.planEndTime).format("YYYY-MM-DD HH:mm")
  28. }}</el-descriptions-item
  29. >
  30. <el-descriptions-item label="履职机构" labelClassName="gx_info_label"
  31. >{{ detail.orgName }}
  32. </el-descriptions-item>
  33. <el-descriptions-item label="履职人员" labelClassName="gx_info_label">{{
  34. detail.roleNames.join("、")
  35. }}</el-descriptions-item>
  36. <el-descriptions-item label="登记人" labelClassName="gx_info_label">{{
  37. detail.submitorName
  38. }}</el-descriptions-item>
  39. <el-descriptions-item
  40. label="隐患问题数"
  41. labelClassName="gx_info_label"
  42. >{{ detail.exceptionCount }}</el-descriptions-item
  43. >
  44. <el-descriptions-item label="登记时间" labelClassName="gx_info_label">{{
  45. dayjs(detail.submitTime).format("YYYY-MM-DD HH:mm")
  46. }}</el-descriptions-item>
  47. </el-descriptions>
  48. <div class="extend_mod">
  49. <el-table
  50. size="small"
  51. :data="tableData"
  52. row-key="itemId"
  53. height="441"
  54. border
  55. style="max-height: 450px; overflow-y: auto"
  56. default-expand-all
  57. :show-header="false"
  58. >
  59. <!-- align="left" -->
  60. <el-table-column type="expand">
  61. <template slot-scope="props">
  62. <el-table
  63. size="small"
  64. v-if="props.row.dataInfoList"
  65. :data="props.row.dataInfoList"
  66. >
  67. <el-table-column
  68. label="履职内容"
  69. align="left"
  70. width="250"
  71. prop="pointName"
  72. >
  73. <template slot-scope="scope">
  74. <pre>{{ scope.row.pointName }}</pre>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. label="履职区域"
  79. align="center"
  80. :show-overflow-tooltip="true"
  81. prop="areaName"
  82. >
  83. </el-table-column>
  84. <el-table-column
  85. label="履职点位"
  86. align="center"
  87. :show-overflow-tooltip="true"
  88. prop="checkName"
  89. >
  90. </el-table-column>
  91. <el-table-column
  92. label="检查结果"
  93. align="center"
  94. :show-overflow-tooltip="true"
  95. >
  96. <template slot-scope="scope">
  97. <span v-if="scope.row.executeResult === '0'">
  98. <!-- <i class="circle" style="background-color: #1890ff" /> -->
  99. <label> 正常</label> </span
  100. ><span v-else>
  101. <!-- <i class="circle" style="background-color: #f5222d" /> -->
  102. <label> 异常</label>
  103. </span>
  104. </template>
  105. </el-table-column>
  106. <!-- <el-table-column
  107. label="履职时间"
  108. align="center"
  109. :show-overflow-tooltip="true"
  110. prop="executeTime"
  111. >
  112. </el-table-column> -->
  113. <el-table-column
  114. label="问题描述"
  115. align="center"
  116. :show-overflow-tooltip="true"
  117. prop="resRemark"
  118. >
  119. </el-table-column>
  120. <el-table-column label="异常图片" align="center">
  121. <template slot-scope="scope">
  122. <div
  123. class="block"
  124. v-for="img in scope.row.appResumptionDataImgList"
  125. >
  126. <el-image
  127. style="width: 50px; height: 50px; margin-right: 5px"
  128. :src="img.imgPath"
  129. fit="fit"
  130. :preview-src-list="
  131. imgPreviewSrcList(scope.row.appResumptionDataImgList)
  132. "
  133. >
  134. </el-image>
  135. </div>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. </template>
  140. </el-table-column>
  141. <el-table-column
  142. label="履职项"
  143. prop="itemName"
  144. :show-overflow-tooltip="true"
  145. />
  146. </el-table>
  147. </div>
  148. <div slot="footer" class="dialog-footer">
  149. <el-button @click="onHide">关闭</el-button>
  150. </div>
  151. </DialogCom>
  152. </div>
  153. </template>
  154. <script>
  155. import * as api from "@/api/resumption/taskManger.js";
  156. import dayjs from "dayjs";
  157. import { getLabel } from "@/views/commonOption.js";
  158. export default {
  159. data() {
  160. return {
  161. isShow: false,
  162. labelStyle: {
  163. color: "#000",
  164. "text-align": "center",
  165. height: "40px",
  166. "min-width": "150px",
  167. "word-break": "keep-all",
  168. },
  169. content_style: {
  170. "text-align": "left",
  171. "min-width": "300px",
  172. "word-break": "break-all",
  173. },
  174. title: "",
  175. tableData: [],
  176. detail: null,
  177. };
  178. },
  179. props: ["statusOptions"],
  180. methods: {
  181. dayjs,
  182. getLabel,
  183. async refresh(id) {
  184. let detail = (await api.one(id)).data;
  185. if (detail && detail.items && detail.items.length > 0) {
  186. this.tableData = detail.items;
  187. } else {
  188. this.tableData = [];
  189. }
  190. this.detail = detail;
  191. },
  192. async show(id, title) {
  193. this.title = title;
  194. await this.refresh(id);
  195. this.isShow = true;
  196. },
  197. onHide() {
  198. this.isShow = false;
  199. },
  200. onClose() {
  201. this.detail = null;
  202. this.tableData = [];
  203. },
  204. imgPreviewSrcList(imgList) {
  205. let srcList = [];
  206. imgList.forEach((element) => {
  207. srcList.push(element.imgPath);
  208. });
  209. return srcList;
  210. },
  211. valueColor(v) {
  212. let color = "";
  213. switch (v) {
  214. case "0":
  215. color = "1890FF";
  216. break;
  217. case "1":
  218. color = "F5222D";
  219. break;
  220. }
  221. return "color:" + color;
  222. },
  223. valueBgColor(v) {
  224. let color = "";
  225. switch (v) {
  226. case "0":
  227. color = "1890FF";
  228. break;
  229. case "1":
  230. color = "F5222D";
  231. break;
  232. }
  233. return "background-color:" + color;
  234. },
  235. },
  236. };
  237. </script>
  238. <style lang="scss">
  239. .dialog-footer {
  240. margin-top: 20px;
  241. }
  242. .block {
  243. /* padding: 10px 10px; */
  244. text-align: center;
  245. /* border-right: 1px solid #eff2f6; */
  246. display: inline-block;
  247. /* width: 20%;
  248. vertical-align: top; */
  249. }
  250. .circle {
  251. display: inline-block;
  252. width: 5px;
  253. height: 5px;
  254. border-radius: 5px;
  255. background-color: red;
  256. border: none;
  257. margin-bottom: 3px;
  258. }
  259. </style>