performanceDetails.js 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381
  1. var that;
  2. var app = getApp();
  3. var animation;
  4. import { returnStr,setCache,getCache,_debounce,getRole } from '../../../utils/util'
  5. Page({
  6. data: {
  7. param:{},//参数
  8. userInfo:{},
  9. userList:[],
  10. users:[],//沟通选择的人员
  11. textArea:'',//内容
  12. animationInfo: {},
  13. isShow: false,
  14. isShowText: false,
  15. has_finish: 0, //是否归档 0否 1是
  16. perfstepFlow: [], // 步骤
  17. smdsinsFlow: 0, // 当前绩效流程所在位置
  18. flowNow: {}, // 当前节点
  19. thecurrentFlow: '', // 当前节点
  20. ruleScore: 1, // 1-指标均要评分 2-评分总结
  21. mandatoryScore: false, // 指标说明是否必填
  22. weight: '',
  23. apList: [], // 执行计划数据
  24. planIndex: [], // 执行计划的下标,当点击表格查看时用到
  25. // 按钮显示隐藏
  26. targetConfirmed: false, // 目标确认
  27. gradeButShow: false, // 评分
  28. examineButShow: false, // 审批
  29. isAction: false, // 审批驳回
  30. resultButShow: false, // 结果值录入
  31. actionButShow: false, // 执行计划
  32. recordsManagement: false, // 管理记录
  33. feedbackBut: false, // 沟通反馈按钮
  34. transferBut: false, // 转交按钮
  35. careOfPeopleId: [], // 转交的 -- 转出ID
  36. selectZj: false,
  37. zjId: 0, // 转交用户ID
  38. revocationShow: false, //是否可以撤销
  39. revocationNodeId: 1, //撤销节点ID
  40. recordList: [], // 记录列表
  41. recordAllList: [], // 记录列表
  42. selectUser: false, // 沟通反馈@
  43. emtags: [], // 沟通反馈@选中人员
  44. selectpradio: '',
  45. selectpradio1: '',
  46. rejectList: [],
  47. rejectListIndex:-1,
  48. rejectList1: [],
  49. rejectList1Index:0,
  50. rejectdlg: false, // 驳回选项弹窗
  51. rejectData: {}, // 驳回数据
  52. rejectProp: false, // 驳回--选人
  53. popupknowFrom: 0, // 0:沟通反馈,1:驳回,2审批,3目标确认,4.撤销
  54. gradeval: 0, // 评分总分
  55. graded: false, // 评分模块开关
  56. commFeedback: '', // 沟通弹窗反馈
  57. show_dept_selector: false, // 转交选人
  58. Information: {
  59. // 顶部员工信息
  60. name: '',
  61. deptList: []
  62. },
  63. // 执行中
  64. inExecution: [],
  65. scoreInfo: [], // 各个节点的人评的总分
  66. titList: [],
  67. bootBool: false, // 防止多次请求
  68. isCs: false, // 是否抄送人进入(抄送人能看到全部评分内容)
  69. com_height: '100%',
  70. isDisabled: false, //是否显示上下一条
  71. headuDown: [],
  72. pendingList: [],
  73. page: 1,
  74. isJz: true,
  75. activeName: '', //待办带进来的节点类型
  76. checked: false, //只看自己评分
  77. recordMemberIds: [],
  78. flexDialog: false,
  79. flexIndex: 0,
  80. // 评分确认列表
  81. pointList: [],
  82. pointData: {},
  83. isPoint: false,
  84. isShowPoint: true,
  85. publicity: 0,
  86. isShowText: false,
  87. logText: '执行计划',
  88. logList: [],
  89. apDetails: {},
  90. isShowCx:false,
  91. checked:false,//是否查看更多
  92. isSuperior:false,//判断当前登录者是否是该考核人的上级
  93. },
  94. onLoad(e) {
  95. that = this;
  96. dd.setNavigationBar({ title: e.tel });
  97. this.setData({
  98. param: e,
  99. userInfo:app.globalData.userData,
  100. userList:app.globalData.usersList
  101. });
  102. if (this.data.param.paths && this.data.param.data) {
  103. let data = JSON.parse(this.data.param.data);
  104. data.employee_id_code=app.returnCode(data.employee_id)
  105. app.$post('api/per/package/msg/cc', data).then(res => {});
  106. }
  107. },
  108. onShow() {
  109. animation = dd.createAnimation({
  110. duration: 200,
  111. timeFunction: "linear",
  112. });
  113. this.employeeDet();
  114. },
  115. onChangeC(e){
  116. this.setData({
  117. checked: e.detail.value
  118. })
  119. this.isShowOneself();
  120. },
  121. // 确认评分
  122. scorerveok(e) {
  123. let num = e.target.dataset.index
  124. let data = {
  125. id: this.data.employeeID, // 个人考核包ID
  126. is_submit: num, // 是否提交 0否(暂存) 1 是
  127. node_id: this.data.smdsinsFlow // 当前节点
  128. };
  129. let point_info = []; // 各项评分数据
  130. let sumData = {
  131. // 总分数据
  132. total_score: '',
  133. total_score_comment: ''
  134. };
  135. this.data.inExecution.forEach(item => {
  136. let resultInfo = {};
  137. if (this.data.ruleScore == 1 && !item.totalScore) {
  138. // 各项评分
  139. resultInfo = {
  140. // 评分信息--只评总分不需要
  141. score: item.resultval ? item.resultval : '', // 单项目结果值
  142. score_remark: item.remarks,
  143. dimension_key: item.dimension_key, // 维度索引
  144. index_key: item.index_key, // 指标索引
  145. index_id: item.id, // 指标ID
  146. name: item.name,
  147. // 用于计算分数
  148. d_weight: item.dimension_weight, // 维度权重
  149. weight: item.weight, // 指标权重
  150. type: item.type // 所属指标种类 1-量化指标 2-行为价值观指标 3-额外加分项 4-额外扣分项
  151. };
  152. point_info.push(resultInfo);
  153. } else {
  154. // 等于2:只评总分
  155. if (item.totalScore) {
  156. sumData = {
  157. total_score: item.resultval ? item.resultval : '',
  158. total_score_comment: item.remarks
  159. };
  160. }
  161. }
  162. });
  163. let isMust = true,
  164. isExplain = true; // isMust验证评分,isExplain验证说明
  165. if (num == 1) {
  166. // 提交验证必填
  167. if (this.data.ruleScore == 1) {
  168. // 各项评分
  169. point_info.forEach(item => {
  170. if (this.data.mandatoryScore) {
  171. // 评分说明必填
  172. if (!item.score_remark) {
  173. isExplain = false;
  174. }
  175. }
  176. if (!item.score) {
  177. isMust = false;
  178. }
  179. });
  180. if (!isMust) {
  181. app.globalData.showToast('请输入所有结果值');
  182. return false;
  183. }
  184. if (!isExplain) {
  185. app.globalData.showToast('请输入所有评分说明');
  186. return false;
  187. }
  188. } else {
  189. // 总分
  190. if (!sumData.total_score) {
  191. app.globalData.showToast('请输入评分总分');
  192. return false;
  193. }
  194. if (this.data.mandatoryScore) {
  195. if (!sumData.total_score_comment) {
  196. app.globalData.showToast('请输入总分说明');
  197. }
  198. return false;
  199. }
  200. }
  201. }
  202. if (this.data.ruleScore == 1) {
  203. data.total_score = this.fomatFloat(this.totalPointsCount(point_info), 2); // 计算的个人评出的总分(保留小数后两位)
  204. } else {
  205. data.total_score = this.fomatFloat(sumData.total_score, 2); // 计算的个人评出的总分(保留小数后两位)
  206. data.total_score_comment = sumData.total_score_comment;
  207. }
  208. data.point_info = JSON.stringify(point_info); // 评分信息 -- 填所有评分时必须的字段(传入某指标的分数、说明、维度索引、制表索引、指标ID)
  209. if (this.data.bootBool) {
  210. return;
  211. }
  212. let pointList = JSON.parse(JSON.stringify(point_info));
  213. pointList.push({
  214. name: '总分',
  215. score: data.total_score,
  216. score_remark: data.total_score_comment
  217. });
  218. this.setData({
  219. pointList:pointList,
  220. pointData:data
  221. })
  222. if (this.data.ruleScore == 1) {
  223. //只评总分不需要弹窗
  224. this.setData({
  225. isPoint:true,
  226. })
  227. } else {
  228. this.score();
  229. }
  230. },
  231. fomatFloat(src, pos) {
  232. return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
  233. },
  234. // 计算总分
  235. totalPointsCount(data) {
  236. let ct = this.data.empDetList.calc_type; // 1-加和计算 2-加权计算
  237. let cd = this.data.empDetList.calc_dimension; // 是否维度权重参与计算 1-是 0-否
  238. let num = 0;
  239. data.forEach(item => {
  240. if (item.score) {
  241. if (item.type == 3) {
  242. // 3-额外加分项
  243. num += Number(item.score);
  244. } else if (item.type == 4) {
  245. // 4-额外扣分项 不计算
  246. num -= Number(item.score);
  247. } else {
  248. if (ct == 1 && cd == 0) {
  249. // 加和
  250. num += Number(item.score);
  251. } else if (ct == 1 && cd == 1) {
  252. // 加和--维度权重参与计算
  253. num += Number(item.score) * Number(item.d_weight / 100);
  254. } else if (ct == 2 && cd == 0) {
  255. // 加权
  256. num += Number(item.score) * Number(item.weight / 100);
  257. } else if (ct == 2 && cd == 1) {
  258. // 加权--维度权重参与计算
  259. num += Number(item.score) * Number(item.d_weight / 100) * Number(item.weight / 100);
  260. }
  261. }
  262. }
  263. });
  264. return num;
  265. },
  266. // 评分-文本框失去焦点时触发
  267. watresultval(e) {
  268. let item = e.target.dataset.item
  269. let val=item.resultval;
  270. let totalScore=item.totalScore ? item.totalScore : false;
  271. if (totalScore) {
  272. this.setData({
  273. gradeval:this.fomatFloat(val, 2)
  274. })
  275. } else {
  276. let tPoints = [];
  277. this.data.inExecution.forEach(item => {
  278. if (item.resultval) {
  279. tPoints.push({
  280. score: item.resultval, // 分值
  281. d_weight: item.dimension_weight, // 维度权重
  282. weight: item.weight, // 指标权重
  283. type: item.type // 所属指标种类 1-量化指标 2-行为价值观指标 3-额外加分项 4-额外扣分项
  284. });
  285. }
  286. });
  287. this.setData({
  288. gradeval:this.fomatFloat(this.totalPointsCount(tPoints), 2)
  289. })
  290. }
  291. this.setData({
  292. isShowPoint:true
  293. })
  294. },
  295. // e当前行 ,item用于判断当前输入是否超过评分上限
  296. sgradeInp(e){
  297. let item = e.target.dataset.item;
  298. let index = e.target.dataset.index;
  299. // item.resultval = item.resultval.match(/\d+(\.\d{0,2})?/) ? item.resultval.match(/\d+(\.\d{0,2})?/)[0] : '';
  300. this.setData({
  301. [`inExecution[${index}].resultval`]:e.detail.value
  302. })
  303. if (item) {
  304. if (item.type == 3 || item.type == 4) {
  305. if (item.point_limit) {
  306. if (this.data.inExecution[index].resultval > Number(item.point_limit)) {
  307. app.globalData.showToast('评分超过上限');
  308. this.setData({
  309. [`inExecution[${index}].resultval`]:''
  310. })
  311. return false;
  312. }
  313. }
  314. }
  315. }
  316. },
  317. bindText:_debounce(function(e){
  318. let index = e.target.dataset.index;
  319. this.setData({
  320. [`inExecution[${index}].remarks`]:e.detail.value
  321. })
  322. }),
  323. score() {
  324. app.$post('api/per/package/submit_score', this.data.pointData).then(res => {
  325. app.globalData.showToast('提交成功');
  326. this.setData({
  327. bootBool:false,
  328. isPoint:false,
  329. graded:false,
  330. })
  331. this.employeeDet();
  332. });
  333. },
  334. // 显示评分
  335. gradeClick() {
  336. that.setData({
  337. graded: true
  338. });
  339. let dnsion = [];
  340. this.data.inExecution.forEach(item => {
  341. if (item.employee_id == this.data.userInfo.id && item.flowId == this.data.smdsinsFlow) {
  342. dnsion.push(item);
  343. }
  344. });
  345. let totalScore = {
  346. theDimension: '总分',
  347. wdLeg: 0,
  348. totalScore: true
  349. };
  350. this.data.perfstepFlow.forEach(item => {
  351. if (item.code == 'score_supervisor' && item.status == 1) {
  352. this.setData({
  353. ruleScore: item.rule == 2 ? 2 : 1, // 1-指标均要评分 2-评分总结
  354. thecurrentFlow:'score_supervisor'
  355. });
  356. totalScore.codeId = item.id;
  357. } else if (item.code == 'special_scorer' && item.status == 1) {
  358. this.setData({
  359. ruleScore: 1, // 1-指标均要评分 2-评分总结
  360. });
  361. }
  362. if ((item.code == 'score_supervisor' && item.status == 1) || (item.code == 'special_scorer' && item.status == 1)) {
  363. // 上级评分,特定评分 评分人必填项
  364. item.action.forEach(arr => {
  365. this.setData({
  366. mandatoryScore: arr == 'comment', // 指标说明是否必填
  367. });
  368. });
  369. }
  370. });
  371. // 总分
  372. this.data.scoreInfo.forEach(item => {
  373. item.employees.forEach(arr => {
  374. if (arr.employee_id == this.data.userInfo.id) {
  375. this.setData({
  376. gradeval: arr.point ? arr.point : 0,
  377. });
  378. if (item.id == totalScore.codeId && this.data.ruleScore == 2) {
  379. totalScore.resultval = arr.point;
  380. totalScore.remarks = arr.comment ? arr.comment : '';
  381. }
  382. }
  383. });
  384. });
  385. let dimenList = [];
  386. let users = []; // 当前节点的自己的信息
  387. this.data.perfstepFlow.forEach(item => {
  388. // 根据流程当前节点,找节点的人员中的登陆者
  389. if (item.status == 1) {
  390. item.target.some(arr => {
  391. if (arr.employee_id == this.data.userInfo.id) {
  392. arr.flowStatusId = item.id; // 当前节点的ID
  393. users = arr;
  394. return true;
  395. }
  396. });
  397. }
  398. });
  399. users.list.forEach(att => {
  400. // 获取当前节点审批人员中的登陆者
  401. dnsion.forEach(add => {
  402. if (att.index_id == add.id && att.dimension_key == add.planIndex[0] && att.index_key == add.planIndex[1]) {
  403. add.dimension_key = att.dimension_key; // 维度索引
  404. add.index_key = att.index_key; // 指标索引
  405. add.score_infos.forEach(user => {
  406. // 显示的文案,找到当前登录人
  407. if (user.id == users.flowStatusId) {
  408. if (user.employee_id == this.data.userInfo.id) {
  409. this.setData({
  410. [`scoreTab.title`]:user.title,
  411. [`scoreTab.explain`]:user.title.split(':')[0] + '说明',
  412. })
  413. }
  414. }
  415. });
  416. dimenList.push(add);
  417. }
  418. });
  419. });
  420. this.data.scoreInfo.forEach(item => {
  421. item.employees.forEach(arr => {
  422. if (arr.employee_id == this.data.userInfo.id) {
  423. this.setData({
  424. gradeval:arr.point ? arr.point : 0
  425. })
  426. if (item.id == totalScore.codeId && this.data.ruleScore == 2) {
  427. totalScore.resultval = arr.point;
  428. totalScore.remarks = arr.comment ? arr.comment : '';
  429. }
  430. }
  431. });
  432. });
  433. this.data.perfstepFlow.forEach(item => {
  434. if (item.code == 'score_supervisor' && item.status == 1 && this.data.ruleScore == 2) {
  435. dimenList.push(totalScore);
  436. }
  437. });
  438. this.setData({
  439. inExecution:dimenList
  440. })
  441. },
  442. // 评分取消
  443. scorerveno() {
  444. this.setData({
  445. graded:false,
  446. skeletonLoad:false,
  447. })
  448. this.employeeDet();
  449. },
  450. confirmBh(){
  451. if (!this.data.textArea) {
  452. app.globalData.showToast('请输入沟通内容');
  453. return false;
  454. }
  455. let target_id = this.data.users.map(item => {
  456. return item.id;
  457. });
  458. app.$post('api/per/package/negotiation', {
  459. id: this.data.employeeID,
  460. content: this.data.textArea,
  461. target_id: JSON.stringify(target_id)
  462. }).then(res => {
  463. app.globalData.showToast('已沟通');
  464. this.employeeDet();
  465. this.showGt();
  466. });
  467. },
  468. // 沟通@人员
  469. onSelectUser(item) {
  470. that.setData({
  471. users: item
  472. });
  473. },
  474. //转交
  475. openSelectUser(e) {
  476. if (this.data.careOfPeopleId.length == 1) {
  477. this.openSelect(e)
  478. } else {
  479. let items=this.data.careOfPeopleId.map(item=>{
  480. return item.employee_name
  481. })
  482. dd.showActionSheet({
  483. title: '请选择被转交人员',
  484. items: items,
  485. cancelButtonText: '取消',
  486. success: (res) => {
  487. if(res.index!==-1){
  488. this.setData({
  489. zjId:this.data.careOfPeopleId[res.index].employee_id, //被转出人ID
  490. })
  491. this.openSelect(e)
  492. }
  493. },
  494. });
  495. }
  496. },
  497. //选择
  498. openSelect(e) {
  499. let index = e.target.dataset.index
  500. animation.translateY(0).step();
  501. that.setData({
  502. // users:[],
  503. // textArea:'',
  504. isShowstaff: index,
  505. animationInfo: animation.export(),
  506. popupCx: 'container__mask',
  507. });
  508. },
  509. //转交人员
  510. confirm(data) {
  511. that.setData({
  512. employeeObj: data
  513. });
  514. let item = data[0];
  515. dd.confirm({
  516. title: '温馨提示',
  517. content: '确认转交:' + item.name + '?',
  518. confirmButtonText: '确定',
  519. cancelButtonText: '取消',
  520. success: (result) => {
  521. if(result.confirm){
  522. let employeeId = this.data.careOfPeopleId.length == 1 ? this.data.careOfPeopleId[0].employee_id : this.data.zjId;
  523. let data = {
  524. id: this.data.employeeID, // 个人考核记录ID
  525. node_id: this.data.flowNow.id, // 节点ID
  526. to_employee_id_code: item.code, // 接收用户ID
  527. from_employee_id_code: app.returnCode(employeeId) // 转出用户ID
  528. };
  529. app.$post('api/per/package/transfer', data).then(res => {
  530. if (res.data.code == 1) {
  531. app.globalData.showToast('转交成功');
  532. this.employeeDet();
  533. this.closeWindows();
  534. }
  535. });
  536. }
  537. },
  538. });
  539. },
  540. showGt() {
  541. that.setData({
  542. users:[],
  543. isShowGt: !this.data.isShowGt
  544. });
  545. },
  546. showCx() {
  547. that.setData({
  548. isShowCx: true
  549. });
  550. },
  551. //关闭规则
  552. onClose() {
  553. animation.translateY(1200).step();
  554. that.setData({
  555. animationInfo: animation.export(),
  556. isShowstaff: false,
  557. popupCx: '',
  558. });
  559. },
  560. openVas(e) {
  561. let index = e.target.dataset.index
  562. let item = e.target.dataset.item
  563. this.setData({
  564. logText: index == '1' ? '执行计划' : '管理记录',
  565. logList:index == '1' ? item.schedule : item.mamage_record,
  566. apDetails:item,
  567. isShowText: true,
  568. });
  569. },
  570. rotateAndScale() {
  571. this.setData({
  572. isShow: !this.data.isShow
  573. });
  574. },
  575. //关闭所有弹窗
  576. closeWindows(){
  577. this.setData({
  578. // 目标确认
  579. rejectdlg:false,
  580. commFeedback:'',
  581. // 转交
  582. employeeObj:[],
  583. users:[],
  584. textArea:'',
  585. isShowGt:false,
  586. isPoint:false,
  587. isShowText:false,
  588. isShow:false,
  589. isShowCx:false,
  590. })
  591. },
  592. // 录入结果值
  593. enteringResult() {
  594. dd.navigateTo({
  595. url: `../resultValueEntry/resultValueEntry?id=${this.data.employeeID}&packageName=${this.data.param.tel}`
  596. })
  597. },
  598. agree0Prop(e) {
  599. let num=e.target.dataset.num
  600. let data = {
  601. id: this.data.employeeID, // 个人考核包ID
  602. agree: num, // 同意1 驳回0
  603. c_node_id: this.data.flowNow.id // 当前节点ID
  604. };
  605. if (num == 0) {
  606. if (!this.data.commFeedback) {
  607. app.globalData.showToast('请输入驳回内容');
  608. return false;
  609. }
  610. if (!this.data.rejectData.node_id) {
  611. app.globalData.showToast('请选择驳回节点!');
  612. return false;
  613. }
  614. if (!this.data.rejectData.employee_id) {
  615. app.globalData.showToast('至少选择一名重置人员!');
  616. return false;
  617. }
  618. data.employee_id_code = app.returnCode(this.data.rejectData.employee_id);
  619. data.node_id = this.data.rejectData.node_id;
  620. }
  621. if (this.data.commFeedback) {
  622. data.comment = this.data.commFeedback; // 审核意见
  623. }
  624. // console.log(data);
  625. // return false
  626. app.$post('api/per/package/review', data).then(res => {
  627. app.globalData.showToast('提交成功');
  628. this.employeeDet();
  629. this.closeWindows();
  630. });
  631. },
  632. isShowOneself() {
  633. let inExecution=this.data.inExecution
  634. inExecution.forEach((e,index)=>{
  635. e.scoreList.forEach(item=>{
  636. if (!this.data.checked) {
  637. if (item.employee_id == this.data.userInfo.id) {
  638. item.isShow=true;
  639. } else {
  640. item.isShow=false;
  641. }
  642. } else {
  643. item.isShow=true;
  644. }
  645. })
  646. })
  647. this.setData({
  648. inExecution:inExecution
  649. })
  650. },
  651. // 驳回选择节点
  652. clickreject(e) {
  653. this.setData({
  654. rejectListIndex:e.detail.value,
  655. rejectList1:[],
  656. rejectData:{},
  657. })
  658. let item=this.data.rejectList[this.data.rejectListIndex]
  659. let rejectList1=[];
  660. if (item.staff.length > 1) {
  661. rejectList1.push({ employee_id: 0, employee_name: '全部人员' });
  662. item.staff.forEach(item => {
  663. if (item.status == 2) {
  664. rejectList1.push(item);
  665. }
  666. });
  667. this.setData({
  668. rejectProp:true,
  669. rejectList1:rejectList1,
  670. })
  671. } else {
  672. this.setData({
  673. rejectProp:false,
  674. [`rejectData.employee_id`]:[item.staff[0].employee_id],
  675. })
  676. }
  677. this.setData({
  678. [`rejectData.node_id`]:item.id,
  679. })
  680. },
  681. //驳回选择人员
  682. clickreject1(e) {
  683. this.setData({
  684. rejectList1Index:e.detail.value,
  685. })
  686. let item=this.data.rejectList1[this.data.rejectList1Index]
  687. if (item.employee_id == 0) {
  688. let arr = [];
  689. this.data.rejectList1.forEach(aoo => {
  690. if (aoo.employee_id && aoo.employee_id != 0) {
  691. arr.push(aoo.employee_id);
  692. }
  693. });
  694. this.setData({
  695. [`rejectData.employee_id`]:arr,
  696. })
  697. } else {
  698. this.setData({
  699. [`rejectData.employee_id`]:[item.employee_id],
  700. })
  701. }
  702. },
  703. bindFeedback: function (e) {
  704. this.setData({
  705. commFeedback: e.detail.value,
  706. });
  707. },
  708. bindTextAreaBlur: function (e) {
  709. this.setData({
  710. textArea: e.detail.value,
  711. });
  712. },
  713. employeeDet() {
  714. let params = {};
  715. if (this.data.param.id) {
  716. params.id = this.data.param.id;
  717. } else if (this.data.param.assId && this.data.param.staffId) {
  718. params.package_id = this.data.param.assId;
  719. params.employee_id_code = this.data.param.staffId;
  720. }
  721. this.skeletonLoad = true;
  722. app.$get('api/per/package/employee/info', params).then(res => {
  723. if (res.data.code == 1) {
  724. let data = res.data.data;
  725. if (this.data.pendingList.length > 0) { //上下考核人
  726. this.setUpD();
  727. }
  728. this.setData({
  729. has_finish:data.has_finish,
  730. recordMemberIds : data.record_member_ids || [],
  731. empDetList : data,
  732. employeeID : data.id, // 考核记录id
  733. Information : data.relevance_employee, // 考核人员信息
  734. [`Information.deptList`] : data.relevance_employee.dept_list, // 部门
  735. perfstepFlow : data.flow, // 流程
  736. apList : JSON.stringify(data.dimension),
  737. scoreInfo : data.score_info, // 各个节点的人评的总分
  738. feedbackBut : data.config.assessment.feedback == '1', // 沟通反馈是否启用
  739. resultButShow : false, // 录入结果值
  740. gradeButShow : false, // 评分按钮
  741. examineButShow : false, // 审批按钮
  742. transferBut : false, // 转交按钮
  743. targetConfirmed : false, // 目标确认
  744. publicity : data.publicity,
  745. actionButShow : false, // 执行计划按钮
  746. recordsManagement : false, // 管理记录按钮
  747. revocationShow : false,
  748. smdsinsFlow : 0,
  749. flexIndex : 0,
  750. })
  751. this.buttonIf2(); //判断管理记录/执行计划按钮是否显示
  752. let executor = {}; // 与当前登录账号相同的执行人
  753. let review = {}; // 与当前登录账号相同的审批人
  754. data.flow.forEach((item, index) => {
  755. if (item.code == 'execution') {
  756. // 查找 已开始或已结束的执行节点中有无当前账号
  757. if (item.status != 0) {
  758. item.target.forEach(tar => {
  759. if (tar.employee_id == this.data.userInfo.id) {
  760. executor = tar; // 存入与当前登录账号相同的执行人
  761. executor.newCode = 'employee'; // 保存执行人节点code
  762. }
  763. });
  764. }
  765. }
  766. if (item.code == 'review') {
  767. // 查找 已开始或已结束的审批节点中有无当前账号
  768. if (item.status != 0) {
  769. item.target.forEach(tar => {
  770. if (tar.employee_id == this.data.userInfo.id) {
  771. review = tar; // 存入与当前登录账号相同的审批人
  772. review.newCode = 'reviewer'; // 保存审批人节点code
  773. }
  774. });
  775. }
  776. }
  777. this.buttonIf(item);
  778. if (item.status == 1) {
  779. if (item.code != 'cc') {
  780. this.isRevocation(item, data.flow[index - 1]);
  781. }
  782. data.flow.push({ id: data.flow.length + 1, remark: '结束', status: 0, target: [] });
  783. this.setData({
  784. flowNow : item,
  785. smdsinsFlow : item.id,
  786. flexIndex : index + 1,
  787. })
  788. }
  789. });
  790. if (this.data.flexIndex == 0) {
  791. data.flow.push({ id: data.flow.length + 1, remark: '结束', status: 2, target: [] });
  792. this.setData({
  793. flexIndex : data.flow.length,
  794. perfstepFlow : data.flow, // 流程
  795. })
  796. }
  797. if (this.data.smdsinsFlow == 0) {
  798. // 如果当前节点id为0,代表此考核详情已完毕,把最后一个节点作为当前节点
  799. this.setData({
  800. smdsinsFlow : data.flow[data.flow.length - 1].id
  801. })
  802. let cs = data.flow[data.flow.length - 1];
  803. cs.target.some(item => {
  804. if (item.employee_id == this.userInfo.id) {
  805. this.setData({
  806. isCs :true
  807. })
  808. return true;
  809. }
  810. });
  811. }
  812. // 整合表格格式
  813. let dimension = data.dimension;
  814. let dimeTab = [];
  815. let weight = 0; // 权重统计
  816. // poiSco 评分权限
  817. // poicom 说明权限
  818. let poiSco = data.config.assessment.point_scope; // 评分可见权限
  819. let poicom = data.config.assessment.point_comment; // 说明可见权限
  820. dimension.forEach((item, keys) => {
  821. item.index.forEach((arr, index) => {
  822. weight += Number(arr.weight);
  823. arr.theDimension = item.name + '(' + Number(index + 1) + ')';
  824. arr.dimension_weight = item.dimension_weight; // 维度权重
  825. arr.score_infos = [];
  826. arr.planIndex = [keys, index]; // 当打开执行计划时的下标
  827. let tar = null;
  828. if (this.initData(arr.result)) {
  829. tar = this.initData(arr.result) + arr.unit;
  830. }
  831. arr.tabList = [
  832. {
  833. lab: '指标类型',
  834. prop: this.indexType(this.initData(arr.type))
  835. },
  836. {
  837. lab: '指标权重(%)',
  838. prop: this.initData(arr.weight) ? '指标权重:' + this.initData(arr.weight) + '%' : null
  839. }
  840. ];
  841. arr.details = [
  842. // {
  843. // lab: '指标类型',
  844. // prop: this.indexType(this.initData(arr.type))
  845. // },
  846. { lab: '目标值', prop: this.initData(arr.target)? + this.initData(arr.target) + arr.unit:'' },
  847. { lab: '结果值', prop: tar },
  848. { lab: '加扣分上限', prop: this.initData(arr.point_limit) },
  849. // { lab: '考核标准', prop: this.initData(arr.per_remark) },
  850. // {
  851. // lab: '指标权重(%)',
  852. // prop: this.initData(arr.weight) ? this.initData(arr.weight) + '%' : null
  853. // },
  854. { lab: '备注', prop: this.initData(arr.remark) }
  855. ];
  856. // 权限区分
  857. arr.scoreList = [];
  858. arr.score_info.forEach((list, auto) => {
  859. if (list.id <= this.data.smdsinsFlow) {
  860. // smdsinsFlow为当前节点id。。数据-id <= 当前节点id . :筛选出当前节点及之前的评分节点的数据
  861. list.employees.forEach(emplo => {
  862. if (emplo.employee_id == this.data.userInfo.id && list.id == this.data.smdsinsFlow) {
  863. arr.resultval = emplo.point;
  864. arr.remarks = emplo.remark;
  865. arr.employee_id = emplo.employee_id;
  866. arr.flowId = list.id;
  867. }
  868. // 获取code
  869. data.flow.forEach(codes => {
  870. if (codes.id == list.id) {
  871. if (codes.code == 'review') {
  872. // 审批
  873. emplo.newCode = 'reviewer';
  874. } else if (codes.code == 'execution') {
  875. // 执行中
  876. emplo.newCode = 'employee';
  877. } else if (codes.code == 'score_supervisor') {
  878. // 指定上级
  879. emplo.newCode = 'manager';
  880. } else if (codes.code == 'special_scorer') {
  881. // 特定上级
  882. emplo.newCode = 'special';
  883. }
  884. codes.target.some(tar => {
  885. //找到每个评分人获取评分状态
  886. if (tar.employee_id == emplo.employee_id) {
  887. emplo.status = tar.status;
  888. return true;
  889. }
  890. });
  891. }
  892. });
  893. // item为评分数据,数据内只有两个节点:指定(score_supervisor,权限名:manager) 特定上级(special_scorer,权限名:special)
  894. // executor 执行人中的当前登陆账号
  895. // review 审批人中的当前登陆账号
  896. if (executor.employee_id) {
  897. // 若有数据,那么当前登录账号必定在执行人中并且执行节点正在执行或已结束(哪怕正在执行也无所谓,前方已经过滤评分数据,会得到[])
  898. if (poiSco[executor.newCode] == '2') {
  899. // 已有数据并且为2 ‘查看所有的’ ,那就可以将所有的评分权限都改为 ‘2’
  900. for (let i in poiSco) {
  901. poiSco[i] = '2';
  902. }
  903. }
  904. if (poicom[executor.newCode] == '2') {
  905. // 说明同上
  906. for (let i in poicom) {
  907. poicom[i] = '2';
  908. }
  909. }
  910. }
  911. if (review.employee_id) {
  912. // 审批节点--同上 (审批节点默认为2,可以直接全部变成2)
  913. if (poiSco[review.newCode] == '2') {
  914. for (let i in poiSco) {
  915. poiSco[i] = '2';
  916. }
  917. }
  918. if (poicom[review.newCode] == '2') {
  919. // 说明同上
  920. for (let i in poicom) {
  921. poicom[i] = '2';
  922. }
  923. }
  924. }
  925. if (item.employee_id == executor.employee_id) {
  926. // 判断当前评分数据是否 与 执行节点的当前帐号一致
  927. if (poiSco[executor.newCode] == '2') {
  928. // 如果一致并且执行节点为‘2’即查看所有,那么就修改当前 评分数据 的权限也为‘2’
  929. poiSco[item.newCode] = '2';
  930. }
  931. if (poicom[executor.newCode] == '2') {
  932. // 执行中的 -- 说明权限-同上
  933. poicom[item.newCode] = '2';
  934. }
  935. }
  936. if (item.employee_id == review.employee_id) {
  937. // 判断当前评分数据是否 与 审批节点的当前帐号一致
  938. if (poiSco[review.newCode] == '2') {
  939. poiSco[item.newCode] = '2';
  940. }
  941. if (poicom[review.newCode] == '2') {
  942. // 审批的 -- 说明权限-同上
  943. poicom[item.newCode] = '2';
  944. }
  945. }
  946. let scoredata = {
  947. // 评分&&说明
  948. lab: emplo.title,
  949. prop: emplo.point,
  950. newCode: emplo.newCode,
  951. employee_id: emplo.employee_id,
  952. level: emplo.level,
  953. remark: emplo.remark,
  954. knowFrom: 0,
  955. status: emplo.status
  956. };
  957. arr.scoreList.push(scoredata);
  958. // 单项总分显示
  959. if (this.retrunFs(list.id, emplo).length > 0&&!emplo.point) { //单项指标评分不显示总分,只评总分显示,要去掉,请把!emplo.point判断去掉
  960. arr.scoreList.push(...this.retrunFs(list.id, emplo));
  961. }
  962. });
  963. }
  964. });
  965. dimeTab.push(arr);
  966. });
  967. });
  968. this.setData({
  969. weight: weight + '%',
  970. })
  971. let poiSOk = false; // 评分--为true时所有评分可看
  972. let poiCOk = false; // 说明--为true时所有说明可看
  973. dimeTab.forEach(arr => {
  974. arr.scoreList.forEach(item => {
  975. // 判断评分
  976. if (poiSco[item.newCode] == '1' && item.employee_id == this.data.userInfo.id) {
  977. item.pointShow = true; //是否显示评分
  978. } else if (poiSco[item.newCode] == '2') {
  979. // 当前 评分 数据权限等于2时并且(当前数据id为登陆账号 或 执行中权限等于2(代表当前登陆账号为执行中的一员) 或 审批权限等于2(代表当前登陆账号为审批中的一员)) 时,所有评分都可见
  980. if (item.employee_id == this.data.userInfo.id || poiSco[executor.newCode] == '2' || poiSco[review.newCode] == '2') {
  981. poiSOk = true;
  982. }
  983. }
  984. // 判断说明
  985. if (poicom[item.newCode] == '1' && item.employee_id == this.data.userInfo.id) {
  986. item.textShow = true; //是否显示说明
  987. } else if (poicom[item.newCode] == '2') {
  988. if (item.employee_id == this.data.userInfo.id || poicom[executor.newCode] == '2' || poicom[review.newCode] == '2') {
  989. poiCOk = true;
  990. }
  991. }
  992. });
  993. });
  994. dimeTab.forEach(arr => {
  995. arr.returnStr = returnStr(arr.action_update)
  996. let points = []; //最终显示评分
  997. arr.scoreList.forEach(item => {
  998. item.isShow=true;//控制是否显示更多
  999. if (poiSOk || getRole(1) || this.data.isCs) {
  1000. item.pointShow = true;
  1001. }
  1002. if (poiCOk || getRole(1) || this.data.isCs) {
  1003. item.textShow = true;
  1004. }
  1005. if (item.status != 2 && item.id != this.data.smdsinsFlow) {
  1006. // delete duplicat[index]
  1007. } else {
  1008. points.push(item);
  1009. }
  1010. });
  1011. arr.scoreList = points;
  1012. });
  1013. // console.log(dimeTab)
  1014. this.setData({
  1015. inExecution: dimeTab,
  1016. })
  1017. this.pdLc(); //流程结束后的判断
  1018. let titDatas = [];
  1019. if (data.publicity == 1 && (!this.data.flowNow.code || this.data.flowNow.code == 'review')) {
  1020. // 判断是否公开,并且是审批节点或者流程结束,(流程结束flowNow为空)
  1021. if (this.initData(data.final_point)) {
  1022. titDatas.push({ lab: '考核结果', prop: data.final_point });
  1023. }
  1024. if (this.initData(data.final_level)) {
  1025. titDatas.push({ lab: '绩效等级', prop: data.final_level });
  1026. }
  1027. }
  1028. this.setData({
  1029. titList: titDatas,// 顶部数据
  1030. recordList:[]
  1031. })
  1032. let recordList = [];
  1033. // 记录
  1034. let record = res.data.data.record;
  1035. record.forEach((item, index) => {
  1036. if(this.data.userList[item.employee_id]){
  1037. item.name = this.data.userList[item.employee_id].name;
  1038. }
  1039. // if (index < 3) {
  1040. recordList.push(item);
  1041. // }
  1042. });
  1043. this.setData({
  1044. recordAllList: record,// 顶部数据
  1045. recordList:recordList
  1046. })
  1047. this.skeletonLoad = false;
  1048. }
  1049. });
  1050. },
  1051. pdLc() {
  1052. let flow = JSON.parse(JSON.stringify(this.data.perfstepFlow)).reverse(); //反转流程,找第一个评分节点
  1053. //流程结束,但是最后一个“评分”节点里有自己显示撤销
  1054. if (this.data.publicity == 1) {
  1055. flow.some(item => {
  1056. if (item.code == 'review' || item.code == 'cc') {
  1057. return true;
  1058. }
  1059. if (item.code == 'score_supervisor' || item.code == 'special_scorer') {
  1060. item.target.some(e => {
  1061. if (e.employee_id == this.data.userInfo.id && e.status == 2) {
  1062. this.setData({
  1063. revocationNodeId:item.id,
  1064. revocationShow:true
  1065. })
  1066. return true;
  1067. }
  1068. });
  1069. return true;
  1070. }
  1071. });
  1072. }
  1073. },
  1074. buttonIf2() {
  1075. if (this.data.Information.id == this.data.userInfo.id) {
  1076. this.setData({
  1077. actionButShow:true
  1078. })
  1079. }
  1080. // 指定管理记录人是否包含自己
  1081. this.data.recordMemberIds.some(item => {
  1082. if (item == this.data.userInfo.id) {
  1083. this.setData({
  1084. recordsManagement:true
  1085. })
  1086. return true;
  1087. }
  1088. });
  1089. this.getSuperior(this.data.Information.id)//判断是否当前被考核人的上级
  1090. if (this.data.userInfo.is_creator == 1) {
  1091. // 如果是创始人也可以操作
  1092. this.setData({
  1093. recordsManagement:true
  1094. })
  1095. }
  1096. if (app.getPermis(3)) {
  1097. // 如果是子管理员并且管理范围权限为“全公司”
  1098. this.setData({
  1099. recordsManagement:true
  1100. })
  1101. }
  1102. },
  1103. buttonIf(item) {
  1104. // 按钮控制
  1105. if (item.status == 1) {
  1106. // 目标确认
  1107. if (item.code == 'confirm') {
  1108. item.target.forEach(tar => {
  1109. if (tar.employee_id == this.data.userInfo.id && tar.status == 1) {
  1110. this.setData({
  1111. targetConfirmed:true
  1112. })
  1113. }
  1114. });
  1115. }
  1116. // 评分按钮
  1117. if (item.code == 'score_self' || item.code == 'score_mutual' || item.code == 'score_supervisor' || item.code == 'special_scorer') {
  1118. item.target.forEach(tar => {
  1119. if (tar.employee_id == this.data.userInfo.id && tar.status == 1) {
  1120. this.setData({
  1121. gradeButShow:true
  1122. })
  1123. }
  1124. });
  1125. }
  1126. // 结果值录入按钮
  1127. if (item.code == 'result_value') {
  1128. item.target.forEach(tar => {
  1129. if (tar.employee_id == this.data.userInfo.id) {
  1130. this.setData({
  1131. resultButShow:true
  1132. })
  1133. }
  1134. });
  1135. }
  1136. // 审批按钮
  1137. if (item.code == 'review') {
  1138. let reviewif = false;
  1139. item.target.forEach(tar => {
  1140. if (tar.employee_id == this.data.userInfo.id && tar.status == 1) {
  1141. reviewif = true;
  1142. }
  1143. });
  1144. this.setData({
  1145. examineButShow:!!reviewif,
  1146. isAction:item.action.indexOf('refuse') >= 0
  1147. })
  1148. }
  1149. this.setData({
  1150. careOfPeopleId:[],
  1151. })
  1152. let careOfPeopleId=[],transferBut=false;
  1153. // 当是结果值录入,上级评分,指定人评分,审批时显示转交按钮
  1154. if (
  1155. item.code == 'target' ||
  1156. item.code == 'score_supervisor' ||
  1157. item.code == 'special_scorer' ||
  1158. item.code == 'result_value' ||
  1159. item.code == 'review' ||
  1160. item.code == 'confirm'
  1161. ) {
  1162. item.target.forEach(add => {
  1163. if ((add.employee_id == this.data.userInfo.id || getRole(1)) && add.status == 1) {
  1164. if (item.code == 'review' || item.code == 'confirm') {
  1165. if (item.action.indexOf('transfer') >= 0 || getRole(1)) {
  1166. careOfPeopleId.push(add);
  1167. transferBut=true
  1168. }
  1169. } else if (item.code == 'score_supervisor') {
  1170. if (item.transfer || getRole(1)) {
  1171. careOfPeopleId.push(add);
  1172. transferBut=true
  1173. }
  1174. } else {
  1175. careOfPeopleId.push(add);
  1176. transferBut=true
  1177. }
  1178. this.setData({
  1179. careOfPeopleId:careOfPeopleId,
  1180. transferBut:transferBut
  1181. })
  1182. }
  1183. });
  1184. }
  1185. }
  1186. },
  1187. // 管理记录||执行计划
  1188. openTrackPath(e) {
  1189. let add=e.target.dataset.str
  1190. let data = {
  1191. know: add,
  1192. apList: this.data.apList,
  1193. packId: this.data.employeeID,
  1194. assessID: this.data.Information.id,
  1195. planIndex: this.data.planIndex,
  1196. recordMemberIds: this.data.recordMemberIds
  1197. };
  1198. setCache('actionplanList', data);
  1199. dd.navigateTo({
  1200. url: `../actionplanList/actionplanList`
  1201. })
  1202. },
  1203. // 判断是否当前被考核人的上级
  1204. getSuperior(id){
  1205. app.$get('api/per/user/manager_list', { id_code:app.returnCode(id) }).then(res=>{
  1206. let superiorList = res.data.data; //被考核人上级
  1207. superiorList.some(item=>{
  1208. if(item.id==this.data.userInfo.id){
  1209. this.setData({
  1210. recordsManagement:true
  1211. })
  1212. return true
  1213. }
  1214. })
  1215. });
  1216. },
  1217. // 撤销
  1218. revocation() {
  1219. let params = {
  1220. id: this.data.employeeID,
  1221. node_id: this.data.revocationNodeId,
  1222. comment: this.data.textArea
  1223. };
  1224. app.$post('api/per/package/revoke', params)
  1225. .then(res => {
  1226. if (res.data.code == 1) {
  1227. app.globalData.showToast('撤销成功');
  1228. this.employeeDet();
  1229. }
  1230. })
  1231. .finally(() => {
  1232. this.closeWindows();
  1233. });
  1234. },
  1235. // 判断是否显示撤销按钮
  1236. isRevocation(dqItem, upItem) {
  1237. // 当前只需要评分节点需要撤回
  1238. //当前节点包含自己并且其他任意一人未完成的显示按钮
  1239. if (dqItem.code == 'score_supervisor' || dqItem.code == 'special_scorer') {
  1240. dqItem.target.some((item, index) => {
  1241. if (item.employee_id == this.data.userInfo.id && item.status == 2) {
  1242. dqItem.target.some((item2, index2) => {
  1243. if (item2.status == 1) {
  1244. this.setData({
  1245. revocationNodeId: dqItem.id,
  1246. revocationShow:true
  1247. })
  1248. return true;
  1249. }
  1250. });
  1251. }
  1252. });
  1253. }
  1254. let is = true; //判断当前节点人员是否有完成的
  1255. //上一节点中包含登录者并且是完成的状态显示按钮
  1256. if (upItem) {
  1257. dqItem.target.some((item, index) => {
  1258. if (item.status == 2) {
  1259. is = false;
  1260. }
  1261. });
  1262. if (upItem.code == 'score_supervisor' || upItem.code == 'special_scorer') {
  1263. upItem.target.some((item, index) => {
  1264. if (item.employee_id == this.data.userInfo.id && item.status == 2 && is) {
  1265. this.setData({
  1266. revocationNodeId: upItem.id,
  1267. revocationShow:true
  1268. })
  1269. return true;
  1270. }
  1271. });
  1272. }
  1273. }
  1274. },
  1275. // 数据初始化,没有值或者空数组的显示-
  1276. initData(str) {
  1277. if (str == null) {
  1278. return str || null;
  1279. }
  1280. if (typeof str === 'object') {
  1281. return str.length > 0 ? str : null;
  1282. } else {
  1283. return str || null;
  1284. }
  1285. },
  1286. indexType(item) {
  1287. return item == 1 ? '量化指标' : item == 2 ? '非量化指标' : item == 3 ? '额外加分项' : item == 4 ? '额外扣分项' : '';
  1288. },
  1289. // 返回节点评分是只评总分的
  1290. retrunFs(eid, e) {
  1291. let arr = [];
  1292. this.data.scoreInfo.forEach(item => {
  1293. if (item.id == eid) {
  1294. item.employees.forEach(u => {
  1295. if (u.point && u.employee_id == e.employee_id) {
  1296. let scoredata = {
  1297. // 评分
  1298. lab: e.title,
  1299. prop: u.point + '(总分)',
  1300. newCode: e.newCode,
  1301. knowFrom: 0,
  1302. employee_id: e.employee_id,
  1303. level: '',
  1304. remark: u.comment,
  1305. status: 2
  1306. };
  1307. arr.push(scoredata);
  1308. }
  1309. });
  1310. }
  1311. });
  1312. return arr;
  1313. },
  1314. gradeTurn() {
  1315. this.setData({
  1316. selectpradio:'',
  1317. selectpradio1:'',
  1318. rejectProp:false,
  1319. rejectData:{},
  1320. })
  1321. let list = [];
  1322. this.data.perfstepFlow.forEach((item, index) => {
  1323. if (item.status == 2 && item.code != 'execution' && item.code != 'cc' && item.target.length != 0) {
  1324. let arr = {};
  1325. arr.id = item.id;
  1326. arr.name = item.remark;
  1327. item.target.forEach((att, aoo) => {
  1328. arr.name += att.employee_name;
  1329. arr.name += item.target.length - aoo > 1 ? ',' : '';
  1330. });
  1331. arr.staff = item.target;
  1332. list.push(arr);
  1333. }
  1334. });
  1335. this.setData({
  1336. rejectList:list,
  1337. popupknowFrom:1,
  1338. rejectdlg:true,
  1339. })
  1340. },
  1341. // 审批同意
  1342. gradeOk() {
  1343. if (this.data.flowNow.code == 'confirm') {
  1344. // 驳回
  1345. this.setData({
  1346. popupknowFrom:3
  1347. })
  1348. this.popupknowFrom = 3;
  1349. } else if (this.data.flowNow.code == 'review') {
  1350. // 审批
  1351. this.setData({
  1352. popupknowFrom:2
  1353. })
  1354. }
  1355. this.setData({
  1356. rejectdlg:true,
  1357. })
  1358. },
  1359. });