index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div>
  3. <div class="app-container" v-if="isList">
  4. <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" @submit.native.prevent>
  5. <el-row >
  6. <el-col :span="18">
  7. <el-form-item label="部门">
  8. <el-cascader
  9. v-model="treeValue"
  10. :options="deptTree"
  11. :props="{ checkStrictly: true }"
  12. ref="cascaderHandle"
  13. clearable
  14. @change="handleChange"
  15. placeholder=""
  16. >
  17. </el-cascader>
  18. </el-form-item>
  19. <el-form-item label="员工">
  20. <el-input
  21. v-model="queryParams.params.staffCodeOrName"
  22. clearable
  23. @keyup.enter.native="btnSearch"
  24. />
  25. </el-form-item>
  26. <el-form-item label="状态" prop="status">
  27. <el-select
  28. size="mini"
  29. v-model="queryParams.status"
  30. placeholder=""
  31. clearable
  32. >
  33. <el-option
  34. v-for="dict in dict.type.ehr_pm_status"
  35. :key="dict.value"
  36. :label="dict.label"
  37. :value="dict.value"
  38. ></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="月份" prop="month">
  42. <el-date-picker type="month" value-format="yyyy-MM" v-model="queryParams.month">
  43. </el-date-picker>
  44. </el-form-item>
  45. <el-form-item label="评估人" prop="evaluatorName">
  46. <el-input
  47. v-model="queryParams.evaluatorName"
  48. clearable
  49. @keyup.enter.native="btnSearch"
  50. />
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6">
  54. <el-form-item style="float:right">
  55. <el-button type="primary" icon="el-icon-search" size="mini" @click="btnSearch">搜索</el-button>
  56. <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. </el-form>
  61. <div style="float:right">
  62. </div>
  63. <el-table size="mini" height="500px" v-loading="loading" :data="listData" @row-dblclick="btnDetails">
  64. <el-table-column label="绩效编号" align="center" prop="id" />
  65. <el-table-column label="员工姓名" align="center" prop="staffName" />
  66. <el-table-column show-overflow-tooltip label="评估周期" align="center" prop="name" />
  67. <el-table-column label="月度" align="center" prop="month" />
  68. <el-table-column label="自评分" align="center" prop="saMark" />
  69. <el-table-column label="上级评分" align="center" prop="ldMark" />
  70. <el-table-column label="综合得分" align="center" prop="mark" />
  71. <el-table-column label="等级" align="center" prop="grade" />
  72. <el-table-column label="绩效系数" align="center" prop="coefficient" />
  73. <el-table-column label="状态" align="center" prop="status" >
  74. <template slot-scope="scope">
  75. <dict-tag :options="dict.type.ehr_pm_status" :value="scope.row.status"/>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  79. <template slot-scope="scope">
  80. <el-button
  81. size="mini"
  82. type="text"
  83. icon="el-icon-search"
  84. @click="btnDetails(scope.row)"
  85. >详情</el-button>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. <div class="paginationClass">
  90. <pagination
  91. v-show="total>0"
  92. :total="total"
  93. :page.sync="queryParams.pageNum"
  94. :limit.sync="queryParams.pageSize"
  95. @pagination="getList"
  96. />
  97. </div>
  98. </div>
  99. <detail v-model="isList" v-if="!isList" :pageStu="page" :rowId="rowId" :ids="ids" @refresh="refresh" />
  100. </div>
  101. </template>
  102. <script>
  103. import detail from './detail.vue'
  104. import { listPerformance} from "@/api/business/ehr/pm/performance";
  105. import { listDept} from "@/api/business/ehr/ehr/dept";
  106. export default {
  107. name: "assess",
  108. dicts: ['ehr_pm_status'],
  109. components: {detail},
  110. data() {
  111. return {
  112. // 遮罩层
  113. loading: true,
  114. // 显示搜索条件
  115. showSearch: true,
  116. // 总条数
  117. total: 0,
  118. // 表格数据
  119. listData: [],
  120. // id集合
  121. ids: [],
  122. // 弹出层标题
  123. title: "",
  124. // 是否显示弹出层
  125. open: false,
  126. // 查询参数
  127. queryParams: {
  128. pageNum: 1,
  129. pageSize: 10,
  130. params:{
  131. dataPermission: 'N',
  132. JXKKB: 'Y',
  133. staffCodeOrName: null,
  134. },
  135. status: null,
  136. month: null,
  137. dept: null,
  138. evaluatorName: null,
  139. },
  140. // 查询日期范围
  141. dateRange: [],
  142. //页面显示
  143. isList: true,
  144. //页面状态
  145. page: '',
  146. //详情id
  147. rowId: '',
  148. //部门树
  149. deptTree: [],
  150. //value
  151. treeValue: [],
  152. };
  153. },
  154. async created() {
  155. this.getList();
  156. listDept().then(response => {
  157. let arr = response.rows;
  158. arr.forEach(function(element) {
  159. element.parent_id = element.superiorsDept;
  160. element.value = element.code;
  161. element.label = element.name;
  162. });
  163. this.deptTree = this.arrayToTree(arr,null);
  164. });
  165. },
  166. methods: {
  167. /** 查询绩效列表 */
  168. getList() {
  169. this.loading = true;
  170. this.queryParams.dept = this.treeValue[this.treeValue.length - 1];
  171. listPerformance(this.queryParams).then(response => {
  172. this.listData = response.rows;
  173. this.ids = response.rows.map(item => item.id);
  174. this.total = response.total;
  175. this.loading = false;
  176. });
  177. },
  178. /** 搜索按钮操作 */
  179. async btnSearch() {
  180. this.queryParams.pageNum = 1;
  181. this.getList();
  182. },
  183. /** 重置按钮操作 */
  184. btnResetQuery() {
  185. this.resetForm("queryForm");
  186. this.dateRange = [];
  187. this.treeValue = [];
  188. this.queryParams.params.staffCodeOrName = null;
  189. this.btnSearch();
  190. },
  191. /** 刷新 */
  192. refresh(){
  193. this.resetForm("queryForm");
  194. this.dateRange = [];
  195. this.treeValue = [];
  196. this.getList();
  197. },
  198. /** 进入详情 */
  199. btnDetails(row){
  200. this.rowId = row.id;
  201. this.page = 'add';
  202. this.isList = false;
  203. },
  204. arrayToTree(data, pid) {
  205. let result = []
  206. this.getChildren(data, result, pid)
  207. return result
  208. },
  209. getChildren(data, result, pid) {
  210. for (const item of data) {
  211. if (item.parent_id === pid) {
  212. const newItem = { children: [], ...item }
  213. result.push(newItem)
  214. this.getChildren(data, newItem.children, item.code)
  215. }
  216. }
  217. },
  218. //
  219. handleChange(value){
  220. console.log("value",value);
  221. this.$refs.cascaderHandle.dropDownVisible = false;
  222. },
  223. }
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. .btn_grooup {
  228. margin-bottom: 10px;
  229. display: flex;
  230. justify-content: flex-end;
  231. }
  232. .paginationClass {
  233. z-index: 500;
  234. position: fixed;
  235. bottom: 10px;
  236. right: 10px;
  237. width: 100%;
  238. line-height: var(--footer-height);
  239. color: #fff;
  240. }
  241. </style>