dialog.detail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div>
  3. <DialogCom
  4. :title="title + '详情'"
  5. :visible.sync="isShow"
  6. width="1200px"
  7. :destroy-on-close="true"
  8. >
  9. <el-table
  10. :data="tableData"
  11. row-key="itemId"
  12. height="441"
  13. style="max-height: 450px; overflow-y: auto"
  14. default-expand-all
  15. >
  16. <!-- align="left" -->
  17. <el-table-column type="expand">
  18. <template slot-scope="props">
  19. <el-table
  20. v-if="props.row.dataInfoList"
  21. :data="props.row.dataInfoList"
  22. >
  23. <el-table-column
  24. label="履职内容"
  25. align="left"
  26. width="250"
  27. prop="pointName"
  28. >
  29. </el-table-column>
  30. <el-table-column
  31. label="履职区域"
  32. align="center"
  33. :show-overflow-tooltip="true"
  34. prop="areaName"
  35. >
  36. </el-table-column>
  37. <el-table-column
  38. label="履职结果"
  39. align="center"
  40. :show-overflow-tooltip="true"
  41. >
  42. <template slot-scope="scope">
  43. <span v-if="scope.row.executeResult === '0'">
  44. <i class="circle" style="background-color: #1890ff" />
  45. <label style="color: #1890ff"> 正常</label> </span
  46. ><span v-else>
  47. <i class="circle" style="background-color: #f5222d" />
  48. <label style="color: #f5222d"> 异常</label>
  49. </span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column
  53. label="履职时间"
  54. align="center"
  55. :show-overflow-tooltip="true"
  56. prop="executeTime"
  57. >
  58. </el-table-column>
  59. <el-table-column label="履职图片" align="center">
  60. <template slot-scope="scope">
  61. <div
  62. class="block"
  63. v-for="img in scope.row.appResumptionDataImgList"
  64. >
  65. <el-image
  66. style="width: 50px; height: 50px; margin-right: 5px"
  67. :src="img.imgPath"
  68. fit="fit"
  69. :preview-src-list="
  70. imgPreviewSrcList(scope.row.appResumptionDataImgList)
  71. "
  72. >
  73. </el-image>
  74. </div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. label="问题描述"
  79. align="center"
  80. :show-overflow-tooltip="true"
  81. prop="resRemark"
  82. >
  83. </el-table-column>
  84. </el-table>
  85. </template>
  86. </el-table-column>
  87. <el-table-column
  88. label="履职项"
  89. align="center"
  90. prop="itemName"
  91. :show-overflow-tooltip="true"
  92. />
  93. </el-table>
  94. <div slot="footer" class="dialog-footer">
  95. <el-button @click="onHide">取消</el-button>
  96. </div>
  97. </DialogCom>
  98. </div>
  99. </template>
  100. <script>
  101. import * as api from "@/api/resumption/taskManger.js";
  102. export default {
  103. data() {
  104. return {
  105. isShow: false,
  106. title: "",
  107. tableData: [],
  108. };
  109. },
  110. methods: {
  111. async refresh(id) {
  112. let detail = (await api.one(id)).data;
  113. if (detail && detail.length > 0) {
  114. this.tableData = detail;
  115. } else {
  116. this.tableData = [];
  117. }
  118. },
  119. async show(id, title) {
  120. this.title = title;
  121. await this.refresh(id);
  122. this.isShow = true;
  123. },
  124. onHide() {
  125. this.isShow = false;
  126. },
  127. reset() {
  128. this.tableData = [];
  129. },
  130. imgPreviewSrcList(imgList) {
  131. let srcList = [];
  132. imgList.forEach((element) => {
  133. srcList.push(element.imgPath);
  134. });
  135. return srcList;
  136. },
  137. valueColor(v) {
  138. let color = "";
  139. switch (v) {
  140. case "0":
  141. color = "1890FF";
  142. break;
  143. case "1":
  144. color = "F5222D";
  145. break;
  146. }
  147. return "color:" + color;
  148. },
  149. valueBgColor(v) {
  150. let color = "";
  151. switch (v) {
  152. case "0":
  153. color = "1890FF";
  154. break;
  155. case "1":
  156. color = "F5222D";
  157. break;
  158. }
  159. return "background-color:" + color;
  160. },
  161. },
  162. };
  163. </script>
  164. <style lang="scss">
  165. .block {
  166. // padding: 10px 10px;
  167. text-align: center;
  168. // border-right: 1px solid #eff2f6;
  169. display: inline-block;
  170. // width: 20%;
  171. // vertical-align: top;
  172. }
  173. .circle {
  174. display: inline-block;
  175. width: 5px;
  176. height: 5px;
  177. border-radius: 5px;
  178. background-color: red;
  179. border: none;
  180. margin-bottom: 3px;
  181. }
  182. </style>