index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <!--用户数据-->
  5. <el-col>
  6. <div class="main-search-box">
  7. <!-- 搜索条件 -->
  8. <el-form
  9. :model="queryParams"
  10. ref="queryForm"
  11. pageSize="small"
  12. :inline="true"
  13. v-show="showSearch"
  14. >
  15. <el-form-item label="组织机构" class="formTreeItem">
  16. <tree-select
  17. v-model="queryParams.orgId"
  18. :options="deptOptions"
  19. :show-count="true"
  20. :normalizer="tenantIdnormalizer"
  21. :props="{ checkStrictly: true, label: 'name' }"
  22. placeholder="请选择归属机构"
  23. clearValueText="清除"
  24. :noChildrenText="''"
  25. :clearable="false"
  26. noOptionsText="没有数据"
  27. noResultsText="没有搜索结果"
  28. />
  29. </el-form-item>
  30. <el-form-item label="年月">
  31. <el-date-picker
  32. type="month"
  33. v-model="queryParams.date"
  34. placeholder="选择年月"
  35. :clearable="false"
  36. value-format="yyyy-MM"
  37. >
  38. </el-date-picker>
  39. </el-form-item>
  40. <el-row :gutter="10" class="mb8">
  41. <el-col :span="1.5">
  42. <el-button
  43. type="primary"
  44. icon="el-icon-search"
  45. pageSize="mini"
  46. @click="handleQuery"
  47. >搜索</el-button
  48. >
  49. <el-button
  50. type="primary"
  51. icon="el-icon-refresh"
  52. pageSize="mini"
  53. @click="resetQuery"
  54. >重置</el-button
  55. >
  56. </el-col>
  57. </el-row>
  58. </el-form>
  59. </div>
  60. <el-table
  61. border
  62. height="650"
  63. pageSize="small"
  64. v-loading="loading"
  65. :data="dataList"
  66. align="center"
  67. fixed
  68. @selection-change="handleSelectionChange"
  69. >
  70. <el-table-column
  71. label="序号"
  72. type="index"
  73. width="100"
  74. ></el-table-column>
  75. <el-table-column label="年月" :formatter="formatterScore" />
  76. <el-table-column label="机构名称" prop="orgName"> </el-table-column>
  77. <el-table-column label=">90 低" prop="level_gt90">
  78. <template slot-scope="{ row }">
  79. <div>
  80. <span class="text" @click="clickHandlerRow(row, 1)">{{
  81. row.level_gt90
  82. }}</span>
  83. </div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column label="80-90 中" prop="level_80_90">
  87. <template slot-scope="{ row }">
  88. <div>
  89. <span class="text" @click="clickHandlerRow(row, 2)">{{
  90. row.level_80_90
  91. }}</span>
  92. </div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="70-80 高" prop="level_70_80">
  96. <template slot-scope="{ row }">
  97. <div>
  98. <span class="text" @click="clickHandlerRow(row, 3)">{{
  99. row.level_70_80
  100. }}</span>
  101. </div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="70及以下 极高" prop="level_lt70">
  105. <template slot-scope="{ row }">
  106. <div>
  107. <span class="text" @click="clickHandlerRow(row, 4)">{{
  108. row.level_lt70
  109. }}</span>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. label="操作"
  115. width="180"
  116. fixed="right"
  117. class-name="small-padding fixed-width"
  118. >
  119. <template slot-scope="{ row }">
  120. <el-button
  121. pageSize="mini"
  122. @click="editHandler(row)"
  123. type="text"
  124. class="el-icon-view"
  125. >查看</el-button
  126. ><el-button
  127. pageSize="mini"
  128. @click="anewHandler(row)"
  129. type="text"
  130. class="el-icon-edit-outline"
  131. >重新计算</el-button
  132. >
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <pagination
  137. v-show="total > 0"
  138. :total="total"
  139. :page.sync="queryParams.pageNum"
  140. :limit.sync="queryParams.pageSize"
  141. @pagination="getList"
  142. />
  143. </el-col>
  144. </el-row>
  145. <scorestatisticsDialog
  146. ref="Evaluate"
  147. :targetList="targetList"
  148. @success="getList()"
  149. ></scorestatisticsDialog>
  150. </div>
  151. </template>
  152. <script>
  153. import { mapGetters } from "vuex";
  154. import { findAllRole } from "@/api/system/role";
  155. import { list, anewDetail } from "@/api/scorestatistics/scorestatistics.js";
  156. import OrgTree from "@/components/orgTree";
  157. import { newDateMonth } from "@/utils/index.js";
  158. import scorestatisticsDialog from "./scorestatisticsDialog.vue";
  159. import { deptTreeSelect } from "@/api/system/public";
  160. export default {
  161. name: "SocWebIndex",
  162. dicts: ["sys_org_type", "plan_status"],
  163. components: {
  164. OrgTree,
  165. scorestatisticsDialog,
  166. },
  167. data() {
  168. const { params, query } = this.$route;
  169. return {
  170. targetList: [],
  171. targetListChild: [],
  172. targetListGrandson: [],
  173. loading: false,
  174. selectedValues: [],
  175. planRoles: [],
  176. queryParams: {
  177. orgId: null,
  178. date: newDateMonth("", "1"),
  179. pageNum: 1,
  180. pageSize: 10,
  181. },
  182. // 显示搜索条件
  183. showSearch: true,
  184. total: 0,
  185. dataList: [],
  186. deptOptions: [], //机构数组
  187. };
  188. },
  189. created() {
  190. this.queryParams.orgId = this.orgId;
  191. this.getList();
  192. this.getDeptTree();
  193. },
  194. mounted() {},
  195. computed: {
  196. ...mapGetters(["orgId"]),
  197. },
  198. methods: {
  199. /** 查询机构树数据 */
  200. getDeptTree() {
  201. deptTreeSelect().then((response) => {
  202. this.deptOptions = response.data;
  203. });
  204. },
  205. /** treeSelect组件自定义数据*/
  206. tenantIdnormalizer(node, instanceId) {
  207. if (node.children && !node.children.length) {
  208. delete node.children;
  209. }
  210. return {
  211. id: node.id,
  212. label: node.shortName,
  213. children: node.children,
  214. };
  215. },
  216. formatterScore({ dataYear, dataMonth }) {
  217. return dataYear + "-" + dataMonth;
  218. },
  219. //获取列表
  220. getList() {
  221. this.loading = true;
  222. // this.queryParams.orgId = this.orgId;
  223. list(this.queryParams).then((res) => {
  224. this.dataList = res?.rows || [];
  225. this.total = res?.total || [];
  226. this.loading = false;
  227. });
  228. },
  229. // 多选框选中数据
  230. handleSelectionChange(selection) {},
  231. /** 新增按钮操作 */
  232. handleAdd() {
  233. this.$refs.Evaluate.show();
  234. },
  235. editHandler(row) {
  236. this.$refs.Evaluate.show(row);
  237. },
  238. anewHandler(row) {
  239. this.$modal
  240. .confirm("重新计算将会等待一段时间,你确定要重新计算吗?")
  241. .then(function () {})
  242. .then(() => {
  243. anewDetail({
  244. month: row.dataMonth,
  245. year: row.dataYear,
  246. orgId: row.orgId,
  247. }).then((res) => {
  248. let { code, msg } = res;
  249. if (code == 200) {
  250. this.getList();
  251. this.$modal.msgSuccess("计算成功");
  252. } else {
  253. this.$modal.msgSuccess(msg);
  254. }
  255. });
  256. });
  257. },
  258. /** 搜索按钮操作 */
  259. handleQuery() {
  260. this.queryParams.pageNum = 1;
  261. this.getList();
  262. },
  263. /** 重置按钮操作 */
  264. resetQuery() {
  265. this.queryParams = {
  266. orgId: null,
  267. date: "",
  268. pageNum: 1,
  269. pageSize: 10,
  270. };
  271. this.getList();
  272. },
  273. clickHandlerRow(row, num) {
  274. row.levelId = num;
  275. this.$refs.Evaluate.show(row);
  276. },
  277. },
  278. };
  279. </script>
  280. <style lang="scss" scoped>
  281. ::v-deep.formTreeItem {
  282. .el-form-item__content {
  283. width: 264px;
  284. }
  285. }
  286. .text {
  287. color: #008cd6;
  288. text-decoration: underline;
  289. cursor: pointer;
  290. }
  291. </style>