index.vue 12 KB

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