dialog.detail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="rule-type">
  3. <DialogCom title="履职任务详情" :visible.sync="isShow" width="1500px">
  4. <el-descriptions :column="4" border>
  5. <el-descriptions-item label="任务名称">{{
  6. formData.planName
  7. }}</el-descriptions-item>
  8. <el-descriptions-item label="任务类型">{{
  9. getLabel(dict.type.resumption_plan_type, formData.planType)
  10. }}</el-descriptions-item>
  11. <el-descriptions-item label="任务周期">{{
  12. getLabel(dict.type.resumption_plan_cycle, formData.planCycle)
  13. }}</el-descriptions-item>
  14. <el-descriptions-item label="任务时段">{{
  15. getLabel(dict.type.resumption_plan_exec, formData.planExec)
  16. }}</el-descriptions-item>
  17. <el-descriptions-item label="机构类型">{{
  18. getLabel(orgTypeOptions, formData.execOrgType)
  19. }}</el-descriptions-item>
  20. <el-descriptions-item label="履职人员">
  21. {{
  22. resumptionRoles
  23. .filter((r) => formData.roleList.includes(r.id))
  24. .map((r) => r.name)
  25. .join("、")
  26. }}
  27. </el-descriptions-item>
  28. <el-descriptions-item label="任务次数" :span="formData.planCycle == 0?1:2">{{
  29. formData.count
  30. }}</el-descriptions-item>
  31. <el-descriptions-item label="开始时间" v-if="formData.planCycle == 0">{{
  32. dayjs(formData.startDate).format("YYYY年MM月DD日")
  33. }}</el-descriptions-item>
  34. <el-descriptions-item label="开始时间" v-if="formData.planCycle == 0">{{
  35. dayjs(formData.endDate).format("YYYY年MM月DD日")
  36. }}</el-descriptions-item>
  37. <el-descriptions-item label="履职机构" :span="4">
  38. <el-tooltip class="item" effect="dark" :content='formData.orgs ? formData.orgs.map((o) => o.name).join("、") : ""' placement="top">
  39. <div class="ellipsis-tooltip">
  40. {{ formData.orgs ? formData.orgs.map((o) => o.name).join("、") : "" }}
  41. </div>
  42. </el-tooltip>
  43. <div class="count">
  44. ({{formData.orgs.length }})
  45. </div>
  46. </el-descriptions-item>
  47. <el-descriptions-item label="备注" :span="4">{{
  48. formData.note
  49. }}</el-descriptions-item>
  50. </el-descriptions>
  51. <el-table :data="tableData" style="width: 100%" height="400px">
  52. <el-table-column prop="ruleName" label="履职手册"> </el-table-column>
  53. <el-table-column prop="itemName" label="履职项"> </el-table-column>
  54. <el-table-column prop="pointName" label="履职内容" width="300px">
  55. <template slot-scope="scope">
  56. <pre>{{ scope.row.pointName }}</pre>
  57. </template>
  58. </el-table-column>
  59. <el-table-column v-if="false" prop="ofOrgId" label="所属机构id">
  60. </el-table-column>
  61. <el-table-column prop="areaName" label="履职区域"> </el-table-column>
  62. <el-table-column prop="checkName" label="履职点位" v-if="false">
  63. </el-table-column>
  64. <el-table-column label="是否扫描">
  65. <template v-slot="{ row }">
  66. {{ row.pointScan ? "是" : "否" }}
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="必完成项">
  70. <template v-slot="{ row }">
  71. {{ row.required ? "是" : "否" }}
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  76. <el-button @click="onHide">关闭</el-button>
  77. </div>
  78. </DialogCom>
  79. </div>
  80. </template>
  81. <script>
  82. import { findAllRole } from "@/api/system/role";
  83. import * as api from "@/api/resumption/plan";
  84. import { getLabel } from "@/views/commonOption.js";
  85. import dayjs from "dayjs";
  86. export default {
  87. dicts: [
  88. "resumption_plan_type",
  89. "resumption_plan_cycle",
  90. "resumption_org_type",
  91. "resumption_plan_status",
  92. "sys_org_type",
  93. "resumption_plan_exec",
  94. ],
  95. props: {
  96. orgTypeOptions: {
  97. type: Array,
  98. },
  99. ruleTypeOptions: {
  100. type: Array,
  101. },
  102. },
  103. data() {
  104. return {
  105. isShow: false,
  106. tableData: [],
  107. formData: {
  108. roleList: [],
  109. },
  110. resumptionRoles: [],
  111. };
  112. },
  113. methods: {
  114. getLabel,
  115. dayjs,
  116. show(id) {
  117. this.tableData = null;
  118. api.getDetail(id).then((r) => {
  119. this.formData = r.data;
  120. this.tableData = r.data.itemList;
  121. this.isShow = true;
  122. if (this.formData.execOrgType) {
  123. this.getRolesByOrg();
  124. }
  125. });
  126. },
  127. getRolesByOrg() {
  128. if (this.formData.execOrgType != null) {
  129. let params = {
  130. orgType: this.formData.execOrgType,
  131. };
  132. findAllRole(params).then((res) => {
  133. this.resumptionRoles = res.data;
  134. });
  135. }
  136. },
  137. onHide() {
  138. this.isShow = false;
  139. },
  140. },
  141. };
  142. </script>
  143. <style scoped>
  144. .ellipsis-tooltip {
  145. display: inline-block;
  146. max-width: 900px;
  147. white-space: nowrap;
  148. overflow: hidden;
  149. text-overflow: ellipsis;
  150. vertical-align: bottom;
  151. float: left;
  152. }
  153. .count {
  154. white-space: nowrap;
  155. margin-left: 5px;
  156. float: left;
  157. }
  158. </style>