index.vue 6.7 KB

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