index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <div>
  3. <div class="app-container" v-if="isList">
  4. <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true">
  5. <el-form-item label="部门">
  6. <el-cascader
  7. v-model="treeValue"
  8. :options="deptTree"
  9. :props="{ checkStrictly: true }"
  10. ref="cascaderHandle"
  11. clearable
  12. @change="handleChange"
  13. >
  14. </el-cascader>
  15. </el-form-item>
  16. <el-form-item label="员工" prop="staffName">
  17. <el-input
  18. v-model="queryParams.staffName"
  19. clearable
  20. @keyup.enter.native="btnSearch"
  21. />
  22. </el-form-item>
  23. <el-form-item label="状态" prop="status">
  24. <el-select
  25. size="mini"
  26. v-model="queryParams.status"
  27. placeholder=""
  28. clearable
  29. >
  30. <el-option
  31. v-for="dict in dict.type.ehr_pm_status"
  32. :key="dict.value"
  33. :label="dict.label"
  34. :value="dict.value"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="月份" prop="month">
  39. <el-date-picker type="month" value-format="yyyy-MM" v-model="queryParams.month">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item label="评估人" prop="evaluatorName">
  43. <el-input
  44. v-model="queryParams.evaluatorName"
  45. clearable
  46. @keyup.enter.native="btnSearch"
  47. />
  48. </el-form-item>
  49. <el-form-item label="只看自己的">
  50. <el-checkbox v-model="queryParams.params.oneself" @change="btnOneself"></el-checkbox>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-button type="primary" icon="el-icon-search" size="mini" @click="btnSearch">搜索</el-button>
  54. <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
  55. </el-form-item>
  56. </el-form>
  57. <div style="float:right">
  58. <el-badge :value="verifyCount" class="item" style="margin: 0 10px" v-if="verifyCount > 0">
  59. <el-button type="primary" size="mini" @click="btnPmVerify">待确认</el-button>
  60. </el-badge>
  61. <el-badge :value="markCount" class="item" style="margin: 0 10px" v-if="markCount > 0">
  62. <el-button type="primary" size="mini" @click="btnPmMark">待评分</el-button>
  63. </el-badge>
  64. <el-button type="primary" size="mini" @click="btnGradeAdjust" v-if="adjustCount > 0">等级调整({{adjustCount}})</el-button>
  65. <el-button type="primary" size="mini" @click="btnCurrentMonth">本月绩效</el-button>
  66. <el-button type="primary" size="mini" @click="btnNextMonth">下月绩效</el-button>
  67. </div>
  68. <el-table size="mini" height="500px" v-loading="loading" :data="listData" @row-dblclick="btnDetails">
  69. <el-table-column label="编号" align="center" prop="id" />
  70. <el-table-column label="员工姓名" align="center" prop="staffName" />
  71. <el-table-column show-overflow-tooltip label="评估周期" align="center" prop="name" />
  72. <el-table-column label="月度" align="center" prop="month" />
  73. <el-table-column label="自评分" align="center" prop="saMark" />
  74. <el-table-column label="上级评分" align="center" prop="ldMark" />
  75. <el-table-column label="调整分" align="center" prop="ajMark" />
  76. <el-table-column label="调整分等级" align="center" prop="ajGrade" />
  77. <el-table-column label="等级" align="center" prop="grade" />
  78. <el-table-column label="绩效系数" align="center" prop="coefficient" />
  79. <el-table-column label="状态" align="center" prop="status" >
  80. <template slot-scope="scope">
  81. <dict-tag :options="dict.type.ehr_pm_status" :value="scope.row.status"/>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  85. <template slot-scope="scope">
  86. <el-button
  87. size="mini"
  88. type="text"
  89. icon="el-icon-search"
  90. @click="btnDetails(scope.row)"
  91. >详情</el-button>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. <div class="paginationClass">
  96. <pagination
  97. v-show="total>0"
  98. :total="total"
  99. :page.sync="queryParams.pageNum"
  100. :limit.sync="queryParams.pageSize"
  101. @pagination="getList"
  102. />
  103. </div>
  104. </div>
  105. <detail v-model="isList" v-if="!isList" :pageStu="page" :rowId="rowId" :ids="ids" @refresh="refresh" />
  106. <el-dialog title="等级调整" :visible.sync="stageListOpen" width="1000px" :close-on-click-modal="false">
  107. <el-table size="mini" height="500px" v-loading="stageListLoading" :data="stageList" @row-dblclick="btnDetails">
  108. <el-table-column label="名称" align="center" prop="name" />
  109. <el-table-column label="月份" align="center" prop="month" />
  110. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  111. <template slot-scope="scope">
  112. <el-button
  113. size="mini"
  114. type="text"
  115. icon="el-icon-search"
  116. @click="btnEntryAdjust(scope.row)"
  117. >进入调整</el-button>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script>
  125. import detail from './detail.vue'
  126. import { listPerformance,getCurrentMonthId,getNextMonthId} from "@/api/business/ehr/pm/performance";
  127. import { getGradeAdjustConut,toDoList} from "@/api/business/ehr/pm/gradeadjust";
  128. import { getPmVerifyConut} from "@/api/business/ehr/pm/pmverify";
  129. import { getPmMarkConut} from "@/api/business/ehr/pm/pmmark";
  130. import { listDept} from "@/api/business/ehr/ehr/dept";
  131. export default {
  132. name: "assess",
  133. dicts: ['ehr_pm_status'],
  134. components: {detail},
  135. data() {
  136. return {
  137. // 遮罩层
  138. loading: true,
  139. // 显示搜索条件
  140. showSearch: true,
  141. // 总条数
  142. total: 0,
  143. // 表格数据
  144. listData: [],
  145. // id集合
  146. ids: [],
  147. // 弹出层标题
  148. title: "",
  149. // 是否显示弹出层
  150. open: false,
  151. // 查询参数
  152. queryParams: {
  153. pageNum: 1,
  154. pageSize: 10,
  155. params:{
  156. dataPermission: 'Y',
  157. oneself: true,
  158. },
  159. staffName: null,
  160. status: null,
  161. month: null,
  162. dept: null,
  163. },
  164. // 查询日期范围
  165. dateRange: [],
  166. pickerOptions: {
  167. shortcuts: [{
  168. text: '最近一周',
  169. onClick(picker) {
  170. const end = new Date();
  171. const start = new Date();
  172. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  173. picker.$emit('pick', [start, end]);
  174. }
  175. }, {
  176. text: '最近一个月',
  177. onClick(picker) {
  178. const end = new Date();
  179. const start = new Date();
  180. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  181. picker.$emit('pick', [start, end]);
  182. }
  183. }, {
  184. text: '最近三个月',
  185. onClick(picker) {
  186. const end = new Date();
  187. const start = new Date();
  188. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  189. picker.$emit('pick', [start, end]);
  190. }
  191. }]
  192. },
  193. //页面显示
  194. isList: true,
  195. //页面状态
  196. page: '',
  197. //详情id
  198. rowId: '',
  199. //等级调整数量
  200. adjustCount: null,
  201. //等级调整周期列表
  202. stageList:[],
  203. //等级调整周期列表弹出层
  204. stageListOpen:false,
  205. //等级调整周期列表遮罩层
  206. stageListLoading: true,
  207. //待确认数量
  208. verifyCount: null,
  209. //待评分数量
  210. markCount: null,
  211. //部门树
  212. deptTree: [],
  213. //value
  214. treeValue: [],
  215. };
  216. },
  217. async created() {
  218. //查询等级调整数量
  219. let res = await getGradeAdjustConut();
  220. this.adjustCount = res.row;
  221. //查询待确认数量
  222. res = await getPmVerifyConut();
  223. this.verifyCount = res.row;
  224. //查询待评分数量
  225. res = await getPmMarkConut();
  226. this.markCount = res.row;
  227. this.getList();
  228. //如果是跳转过来的页面带了参数flowId则直接进入填写页面
  229. if(this.$route['query'] !== undefined && this.$route.query['flowId'] !== undefined){
  230. this.rowId = this.$route.query.performanceId;
  231. this.page = 'add';
  232. this.ids = [this.$route.query.performanceId];
  233. this.isList = false;
  234. }
  235. listDept().then(response => {
  236. let arr = response.rows;
  237. arr.forEach(function(element) {
  238. element.parent_id = element.superiorsDept;
  239. element.value = element.code;
  240. element.label = element.name;
  241. });
  242. console.log("arr",arr);
  243. this.deptTree = this.arrayToTree(arr,null);
  244. console.log("deptTree",this.deptTree);
  245. });
  246. },
  247. methods: {
  248. /** 查询绩效列表 */
  249. getList() {
  250. this.loading = true;
  251. this.queryParams.dept = this.treeValue[this.treeValue.length - 1];
  252. listPerformance(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  253. this.listData = response.rows;
  254. this.ids = response.rows.map(item => item.id);
  255. this.total = response.total;
  256. this.loading = false;
  257. });
  258. },
  259. /** 搜索按钮操作 */
  260. async btnSearch() {
  261. this.queryParams.pageNum = 1;
  262. this.getList();
  263. },
  264. /** 重置按钮操作 */
  265. btnResetQuery() {
  266. this.resetForm("queryForm");
  267. this.dateRange = [];
  268. this.treeValue = [];
  269. this.btnSearch();
  270. },
  271. /** 刷新 */
  272. refresh(){
  273. this.resetForm("queryForm");
  274. this.dateRange = [];
  275. this.treeValue = [];
  276. this.getList();
  277. },
  278. /** 进入详情 */
  279. btnDetails(row){
  280. this.rowId = row.id;
  281. this.page = 'add';
  282. this.isList = false;
  283. },
  284. //只看自己按钮
  285. btnOneself(){
  286. this.btnSearch();
  287. },
  288. //等级调整
  289. btnGradeAdjust(){
  290. this.stageListOpen = true;
  291. this.getlistStage();
  292. },
  293. //查看当月绩效
  294. async btnCurrentMonth(){
  295. let res = await getCurrentMonthId();
  296. if(!res.id){
  297. this.$modal.msgSuccess("未查询到本月绩效!");
  298. }else{
  299. this.rowId = res.id;
  300. this.page = 'add';
  301. this.ids = [res.id];
  302. this.isList = false;
  303. }
  304. },
  305. //查看下月绩效
  306. async btnNextMonth(){
  307. let res = await getNextMonthId();
  308. if(!res.id){
  309. this.$modal.msgSuccess("未查询到下月绩效!");
  310. }else{
  311. this.rowId = res.id;
  312. this.page = 'add';
  313. this.ids = [res.id];
  314. this.isList = false;
  315. }
  316. },
  317. //查询周期列表
  318. getlistStage() {
  319. this.stageListLoading = true;
  320. toDoList().then(response => {
  321. this.stageList = response.rows;
  322. this.stageListLoading = false;
  323. });
  324. },
  325. //进入调整
  326. btnEntryAdjust(row){
  327. this.$router.push({ name: 'AdjustGrade', query: { id: row.id,gradeconfigId: row.gradeconfigId,flowId: row.flowId } });
  328. },
  329. //待确认
  330. btnPmVerify(){
  331. this.$router.push({name:'PmVerify'});
  332. },
  333. //待评分
  334. btnPmMark(){
  335. this.$router.push({name:'PmMark'});
  336. },
  337. arrayToTree(data, pid) {
  338. let result = []
  339. this.getChildren(data, result, pid)
  340. return result
  341. },
  342. getChildren(data, result, pid) {
  343. for (const item of data) {
  344. if (item.parent_id === pid) {
  345. const newItem = { children: [], ...item }
  346. result.push(newItem)
  347. this.getChildren(data, newItem.children, item.code)
  348. }
  349. }
  350. },
  351. //
  352. handleChange(value){
  353. console.log("value",value);
  354. this.$refs.cascaderHandle.dropDownVisible = false;
  355. },
  356. }
  357. };
  358. </script>
  359. <style lang="scss" scoped>
  360. .btn_grooup {
  361. margin-bottom: 10px;
  362. display: flex;
  363. justify-content: flex-end;
  364. }
  365. .paginationClass {
  366. z-index: 500;
  367. position: fixed;
  368. bottom: 10px;
  369. right: 10px;
  370. width: 100%;
  371. line-height: var(--footer-height);
  372. color: #fff;
  373. }
  374. </style>