dialog.detail.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. formData.orgs ? formData.orgs.map((o) => o.name).join("、") : ""
  39. }}</el-descriptions-item>
  40. <el-descriptions-item label="备注" :span="4">{{
  41. formData.note
  42. }}</el-descriptions-item>
  43. </el-descriptions>
  44. <el-table :data="tableData" style="width: 100%" height="400px">
  45. <el-table-column prop="ruleName" label="履职手册"> </el-table-column>
  46. <el-table-column prop="itemName" label="履职项"> </el-table-column>
  47. <el-table-column prop="pointName" label="履职内容" width="300px">
  48. <template slot-scope="scope">
  49. <pre>{{ scope.row.pointName }}</pre>
  50. </template>
  51. </el-table-column>
  52. <el-table-column v-if="false" prop="ofOrgId" label="所属机构id">
  53. </el-table-column>
  54. <el-table-column prop="areaName" label="履职区域"> </el-table-column>
  55. <el-table-column prop="checkName" label="履职点位" v-if="false">
  56. </el-table-column>
  57. <el-table-column label="是否扫描">
  58. <template v-slot="{ row }">
  59. {{ row.pointScan ? "是" : "否" }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="必完成项">
  63. <template v-slot="{ row }">
  64. {{ row.required ? "是" : "否" }}
  65. </template>
  66. </el-table-column>
  67. </el-table>
  68. <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  69. <el-button @click="onHide">关闭</el-button>
  70. </div>
  71. </DialogCom>
  72. </div>
  73. </template>
  74. <script>
  75. import { findAllRole } from "@/api/system/role";
  76. import * as api from "@/api/resumption/plan";
  77. import { getLabel } from "@/views/commonOption.js";
  78. import dayjs from "dayjs";
  79. export default {
  80. dicts: [
  81. "resumption_plan_type",
  82. "resumption_plan_cycle",
  83. "resumption_org_type",
  84. "resumption_plan_status",
  85. "sys_org_type",
  86. "resumption_plan_exec",
  87. ],
  88. props: {
  89. orgTypeOptions: {
  90. type: Array,
  91. },
  92. ruleTypeOptions: {
  93. type: Array,
  94. },
  95. },
  96. data() {
  97. return {
  98. isShow: false,
  99. tableData: [],
  100. formData: {
  101. roleList: [],
  102. },
  103. resumptionRoles: [],
  104. };
  105. },
  106. methods: {
  107. getLabel,
  108. dayjs,
  109. show(id) {
  110. this.tableData = null;
  111. api.getDetail(id).then((r) => {
  112. this.formData = r.data;
  113. this.tableData = r.data.itemList;
  114. this.isShow = true;
  115. if (this.formData.execOrgType) {
  116. this.getRolesByOrg();
  117. }
  118. });
  119. },
  120. getRolesByOrg() {
  121. if (this.formData.execOrgType != null) {
  122. let params = {
  123. orgType: this.formData.execOrgType,
  124. };
  125. findAllRole(params).then((res) => {
  126. this.resumptionRoles = res.data;
  127. });
  128. }
  129. },
  130. onHide() {
  131. this.isShow = false;
  132. },
  133. },
  134. };
  135. </script>
  136. <style></style>