index.vue 6.9 KB

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