home.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <template>
  2. <div class="all boxMinHeight">
  3. <div>
  4. <div class="left-main" v-if="$getRole(1)">
  5. <div class="flex-box-ce" v-if="entranceList.length > 0">
  6. <div class="entrance flex-box-ce" v-for="(item, index) in entranceList" :key="index" @click="openUrl(item)">
  7. <img :src="item.image" />
  8. <span>{{ item.name }}</span>
  9. </div>
  10. </div>
  11. <div v-else><div style="text-align: center;margin: 020px;" class="fontColorF">暂无相关权限</div></div>
  12. </div>
  13. <!-- 待办 -->
  14. <div class="flex-box">
  15. <div class="flex-1 dispose-left">
  16. <div class="more2" v-if="agencyList.length > 0">
  17. <span @click="$router.push({ name: 'backlog', query: { activeName: activeName } })">
  18. 查看更多
  19. <i class="el-icon-d-arrow-right"></i>
  20. </span>
  21. </div>
  22. <el-tabs v-model="activeName" class="tabs">
  23. <el-tab-pane :title="tab.title" :name="tab.name" :key="tab.name" v-for="(tab, index) in editableTabs" v-loading="loading">
  24. <span slot="label" v-if="tab.num > 0">
  25. <el-badge :value="tab.num" :max="999">
  26. <span>{{ tab.title }}</span>
  27. </el-badge>
  28. </span>
  29. <span slot="label" v-else>
  30. <div style="position: relative;vertical-align: middle;display: inline-block;">
  31. <span>{{ tab.title }}</span>
  32. </div>
  33. </span>
  34. <template v-if="agencyList.length > 0">
  35. <div class="flex-box-ce item" v-for="(item, index) in agencyList" :key="index" @click="openDetail(1, item)">
  36. <template v-if="item.userInfo">
  37. <userImage :img_url="item.userInfo.img_url" :user_name="item.userInfo.name" fontSize="14" width="40px" height="40px"></userImage>
  38. </template>
  39. <div class="flex-1 font-flex-word content">
  40. <div style="max-width: 700px;" class="font-flex-word">{{ item.content }}</div>
  41. </div>
  42. <div class="fontColorB">{{ $moment(item.update_time).format('YYYY-MM-DD HH:mm') }}</div>
  43. </div>
  44. </template>
  45. <NoData v-else content="暂无内容" :isSolt="true">
  46. <div class="fontColorF" style="text-align: center;">
  47. 暂无内容,
  48. <span class="blue" style="cursor: pointer;" @click="$router.push({ name: 'backlog', query: { selectIndex: 1 } })">去查看已处理的</span>
  49. </div>
  50. </NoData>
  51. </el-tab-pane>
  52. </el-tabs>
  53. </div>
  54. <div style="width: 300px;margin-left: 10px;padding: 20px 10px;" class="dispose-left">
  55. <div class="more2">
  56. <span @click="$router.push({ name: 'unread' })">
  57. 查看更多
  58. <i class="el-icon-d-arrow-right"></i>
  59. </span>
  60. </div>
  61. <div style="border-bottom: 1px solid #f1f1f1;margin-bottom: 15px;">
  62. <el-badge :value="messageNum" :max="999" v-if="messageNum > 0">
  63. <div class="message-title">
  64. <svg-icon icon-class="unread"></svg-icon>
  65. 未读消息
  66. </div>
  67. </el-badge>
  68. <div class="message-title" v-else>
  69. <svg-icon icon-class="unread"></svg-icon>
  70. 未读消息
  71. </div>
  72. </div>
  73. <template v-if="messageList.length > 0">
  74. <div class="item" v-for="(item, index) in messageList" :key="index" @click="openDetail(2, item)">
  75. <div class="flex-box" v-if="item.type == 4">
  76. <div style="width: 25px;padding-top: 6px;"><svg-icon icon-class="message-download"></svg-icon></div>
  77. <span class="message-content flex-1">{{ item.content }}</span>
  78. </div>
  79. <div class="flex-box" v-else>
  80. <div style="width: 25px;padding-top: 6px;"><svg-icon icon-class="inform"></svg-icon></div>
  81. <span class="message-content flex-1">{{ item.content }}</span>
  82. </div>
  83. </div>
  84. </template>
  85. <NoData v-else content="暂无内容" :isSolt="true">
  86. <div class="fontColorF" style="text-align: center;">
  87. 暂无内容,
  88. <span class="blue" style="cursor: pointer;" @click="$router.push({ name: 'unread', query: { selectIndex: 1 } })">去查看已读的</span>
  89. </div>
  90. </NoData>
  91. </div>
  92. </div>
  93. <!-- 管理 -->
  94. <div class="gl-all" v-loading="staffLoad">
  95. <div class="flex-box" style="margin-bottom: 20px;">
  96. <el-cascader
  97. v-model="headValue"
  98. :options="options"
  99. :show-all-levels="false"
  100. :props="{ expandTrigger: 'hover', label: 'name', value: 'id', children: 'list' }"
  101. ></el-cascader>
  102. <div style="margin-left:10px;width:200px;"><JxSearch :screen="2" title="请输入姓名搜索" @confirm="searchList"></JxSearch></div>
  103. </div>
  104. <el-tabs v-model="glIndex">
  105. <el-tab-pane :label="item.title" :name="item.name" v-for="(item, index) in glIist" :key="index">
  106. <el-table stripe :data="glDataList" v-loading="glLoading" :header-cell-style="{ background: '#EDF4FF' }">
  107. <el-table-column prop="name" label="被考核人">
  108. <template slot-scope="scope">
  109. <div class="flex-box-ce">
  110. <userImage
  111. :id="scope.row.userInfo.id"
  112. :user_name="scope.row.userInfo.name"
  113. :img_url="scope.row.userInfo.img_url"
  114. width="35px"
  115. height="35px"
  116. fontSize="12px"
  117. ></userImage>
  118. <span style="margin-left: 10px; line-height: 50px;">{{ scope.row.userInfo.name }}</span>
  119. <span style="margin-left: 10px; line-height: 50px;" class="yellow" v-if="scope.row.has_finish">已归档</span>
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="name" label="部门">
  124. <template slot-scope="scope">
  125. <div v-if="scope.row.dept_list.length > 0">
  126. <span v-for="(item, index) in scope.row.dept_list" :key="index">
  127. {{ item.name }}
  128. <span v-if="scope.row.dept_list.length - index > 1">,</span>
  129. </span>
  130. </div>
  131. <span v-else>--</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="package_name" label="考核时段"></el-table-column>
  135. <el-table-column prop="name" label="管理记录" v-if="glIndex == '1'">
  136. <template slot-scope="scope">
  137. <span v-if="scope.row.count_record == 0" class="fontColorB">无管理记录</span>
  138. <span v-else class="blue" style="cursor: pointer;" @click="openTx(scope.row)">{{ scope.row.count_record }}条管理记录</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column prop="name" label="执行计划" v-if="glIndex == '1'">
  142. <template slot-scope="scope">
  143. <template v-if="scope.row.action_update">
  144. <div v-if="returnStr(scope.row.action_update).indexOf('今天') >= 0" class="actionText yellow">{{ returnStr(scope.row.action_update) }}</div>
  145. <div v-else-if="returnStr(scope.row.action_update).indexOf('昨天') >= 0" class="actionText green">
  146. {{ returnStr(scope.row.action_update) }}
  147. </div>
  148. <div v-else class="actionText">{{ returnStr(scope.row.action_update) }}</div>
  149. </template>
  150. <div></div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column prop="status" label="评分进度" v-else>
  154. <template slot-scope="scope">
  155. <span v-if="scope.row.status == 0" class="yellow">未到评分节点</span>
  156. <span v-if="scope.row.status == 1" class="blue">待我评分</span>
  157. <span v-if="scope.row.status == 2" class="green">我已评分</span>
  158. <span v-if="scope.row.status == 3" class="green">已被其他管理评分</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column prop="score_info" label="评分" v-if="glIndex == '2'">
  162. <template slot-scope="scope">
  163. <div v-if="scope.row.score_info.length > 0">
  164. <div v-for="(item, index) in returnPoint(scope.row)" :key="index">
  165. <div style="margin-top: 5px;" v-if="item.pointList.length > 0">
  166. {{ item.name }}:
  167. <span class="blue">{{ item.pointList.toString() }}</span>
  168. </div>
  169. <div v-else>--</div>
  170. </div>
  171. </div>
  172. <div v-else>--</div>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="操作">
  176. <template slot-scope="scope">
  177. <el-button @click="openTx(scope.row)" type="text" v-if="glIndex == '1' && !scope.row.has_finish">填写管理记录</el-button>
  178. <el-button @click="openDetail2(scope.row)" type="text">查看详情</el-button>
  179. <el-button @click="openDetail2(scope.row)" type="text" v-if="glIndex == '2' && scope.row.status == 1">去评分</el-button>
  180. </template>
  181. </el-table-column>
  182. </el-table>
  183. <div class="more">
  184. <span @click="$router.push({ name: glIndex == 1 ? 'management' : 'score', query: { headValue: JSON.stringify(headValue) } })">
  185. 查看更多
  186. <i class="el-icon-d-arrow-right"></i>
  187. </span>
  188. </div>
  189. </el-tab-pane>
  190. </el-tabs>
  191. </div>
  192. <!-- 常见问题 -->
  193. <!-- <div class="wt">
  194. <div class="flex-box-ce"><div class="wt-title flex-1">常见问题</div></div>
  195. <div class="wts" v-for="(item, index) in issueList" :key="index">
  196. <div class="flex-box-ce wt-item">
  197. <span class="fontColorF flex-box-ce">
  198. <span class="zmBox">Q</span>
  199. 问题:
  200. </span>
  201. <span class="flex-1">{{ item.title }}</span>
  202. </div>
  203. <div class="flex-box wt-item">
  204. <span class="fontColorF flex-box">
  205. <span class="zmBox" style="background-color: #8E9296;">A</span>
  206. 回答:
  207. </span>
  208. <span class="flex-1">{{ item.content }}</span>
  209. </div>
  210. </div>
  211. </div> -->
  212. </div>
  213. <!-- 跟踪管理 -->
  214. <TrackManagement
  215. :showDrawer.sync="isTrack"
  216. :isCz="has_finish ? true : false"
  217. :id="employeeID"
  218. :apList="apList"
  219. :recordMemberIds="recordMemberIds"
  220. :assessId="employee_id"
  221. @confirm="getManagement"
  222. ></TrackManagement>
  223. </div>
  224. </template>
  225. <script>
  226. import ECharts from 'echarts';
  227. import TrackManagement from '@/components/public/TrackManagement';
  228. import JxSearch from '@/components/public/JxSearch';
  229. export default {
  230. name: 'home',
  231. components: { JxSearch, TrackManagement },
  232. data() {
  233. return {
  234. day: this.$moment().format('YYYY-MM-DD'),
  235. editableTabs: [
  236. { title: '全部待办', name: '0', num: 0 },
  237. { title: '目标制定', name: '1', num: 0 },
  238. { title: '目标确认', name: '2', num: 0 },
  239. { title: '结果录入', name: '4', num: 0 },
  240. { title: '评分', name: '5', num: 0 },
  241. { title: '审批', name: '9', num: 0 }
  242. ],
  243. userInfo: this.$getUserData(),
  244. entranceList: [],
  245. agencyList: [], //待办列表
  246. agencyNum: 0,
  247. messageList: [], //消息列表
  248. messageNum: 0,
  249. activeName: '0',
  250. loading: false,
  251. // 管理相关
  252. options: [], //
  253. headValue: [],
  254. glIndex: '1',
  255. glIist: [{ name: '1', title: '我参与管理' }, { name: '2', title: '我参与评分' }],
  256. glLoading: false,
  257. glDataList: [],
  258. package_id: '', //考核包ID
  259. name: '', //搜索Name
  260. pendingList: [], //提供给考核详情上下切换人员列表
  261. issueList: [
  262. {
  263. title: '新绩效可以解决什么问题?',
  264. content:
  265. '1、告别低效绩效考核,让绩效管理流程化;2、进度轻松管控,每个节点进度清晰可见;3、考核目标批量派发,评分流程自定义;4、员工按目标执行计划,上级跟踪管理做好过程管控记录;5、绩效统计图表分析,告别繁杂数据工作'
  266. },
  267. {
  268. title: '如何快速上手并使用新绩效?',
  269. content:
  270. '1、建立考核表(把考核目标相同的人员分组,定考核模板,设计考核流程);2、根据考核周期,发起考核;3、针对每个员工进行考核管理、跟踪及评分;4、查看报表并进行结果分析'
  271. },
  272. {
  273. title: '新绩效和原有的绩效有何关联和区别吗?',
  274. content:
  275. '原有绩效以任务为主,重点关注任务是否完成,仅支持月度考核;新绩效支持任意周期的考核,以目标结果为导向,以员工执行计划和跟踪管理记录来关注过程,拥有完善的目标制定、在线评分和审批流程,绩效目标清单一目了然。'
  276. }
  277. ],
  278. isTrack: false,
  279. apList: [], //管理记录源数据
  280. employee_id: 0, //被考核人ID
  281. employeeID: 0,
  282. staffLoad: false,
  283. recordMemberIds: [],
  284. has_finish: 0 //是否归档
  285. };
  286. },
  287. activated() {
  288. this.getAgencyNum();
  289. this.getAgency();
  290. this.getMessage();
  291. this.glIndex == '1' ? this.getManagement() : this.getScorerRecord();
  292. // var url = window.location.href;
  293. // var rUrl = this.GetRequest(url).url || '';
  294. // this.$nextTick(function() {
  295. // if (rUrl) {
  296. // setTimeout(() => {
  297. // this.$router.push({ path: '/' + decodeURIComponent(rUrl) });
  298. // }, 200);
  299. // }
  300. // });
  301. },
  302. created() {
  303. this.setMenu();
  304. this.getAgencyNum();
  305. },
  306. mounted() {
  307. this.getAgency();
  308. this.getMessage();
  309. this.assessTree();
  310. // var url = window.location.href;
  311. // var rUrl = this.GetRequest(url).url || '';
  312. // this.$nextTick(function() {
  313. // if (rUrl) {
  314. // setTimeout(() => {
  315. // this.$router.push({ path: '/' + decodeURIComponent(rUrl) });
  316. // }, 200);
  317. // }
  318. // });
  319. },
  320. watch: {
  321. activeName() {
  322. this.getAgencyNum();
  323. this.getAgency();
  324. },
  325. glIndex(val) {
  326. this.glDataList = [];
  327. if (this.headValue.length != 0) {
  328. val == '1' ? this.getManagement() : this.getScorerRecord();
  329. }
  330. },
  331. headValue(val) {
  332. this.package_id = val[val.length - 1];
  333. this.glIndex == '1' ? this.getManagement() : this.getScorerRecord();
  334. }
  335. },
  336. methods: {
  337. GetRequest(urlStr) {
  338. if (typeof urlStr == 'undefined') {
  339. var url = decodeURI(location.search); //获取url中"?"符后的字符串
  340. } else {
  341. var url = '?' + urlStr.split('?')[1];
  342. }
  343. var theRequest = new Object();
  344. var strs;
  345. if (url.indexOf('?') != -1) {
  346. var str = url.substr(1);
  347. strs = str.split('&');
  348. for (var i = 0; i < strs.length; i++) {
  349. theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
  350. }
  351. }
  352. return theRequest;
  353. },
  354. returnStr(time) {
  355. let date = `${time}000`;
  356. let res = this.$moment(Number(date)).format('YYYY-MM-DD HH:mm');
  357. return this.fnTime(res);
  358. },
  359. fnTime(time) {
  360. let staer = time.slice(0, 11);
  361. let ptime = new Date(time).getTime();
  362. const twentyFourHours = 24 * 60 * 60 * 1000;
  363. const fortyEightHours = 24 * 60 * 60 * 1000 * 2;
  364. const date = new Date();
  365. const year = date.getFullYear();
  366. const month = date.getMonth() + 1;
  367. const day = date.getDate();
  368. const today = `${year}-${month}-${day}`;
  369. const todayTime = new Date(today).getTime();
  370. const yesterdayTime = new Date(todayTime - twentyFourHours).getTime();
  371. const lastYesterdayTime = new Date(todayTime - fortyEightHours).getTime();
  372. if (ptime >= todayTime) {
  373. return '今天 ' + time.split(' ')[1] + ' 更新了执行计划';
  374. } else if (ptime < todayTime && yesterdayTime <= ptime) {
  375. return '昨天 ' + time.split(' ')[1] + ' 更新了执行计划';
  376. } else if (ptime < yesterdayTime && lastYesterdayTime <= ptime) {
  377. return '前天 ' + time.split(' ')[1] + ' 更新了执行计划';
  378. } else if (this.dateSum(this.day, staer) > 30) {
  379. return '近30天无计划更新';
  380. } else {
  381. return time + ' 更新了执行计划';
  382. }
  383. },
  384. dateSum(sDate1, sDate2) {
  385. //sDate1和sDate2是2008-12-13格式
  386. var aDate, oDate1, oDate2, iDays;
  387. aDate = sDate1.split('-');
  388. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]); //转换为12-13-2008格式
  389. aDate = sDate2.split('-');
  390. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
  391. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
  392. return iDays;
  393. },
  394. returnPoint(item) {
  395. let id = item.node_info.id;
  396. let stats = item.status;
  397. let arr = [{ name: '上级评分', pointList: [] }, { name: '特定指标评分', pointList: [] }];
  398. item.score_info.forEach(e => {
  399. if (stats == 0) {
  400. if (e.node_id < id) {
  401. if (e.node_code == 'score_supervisor') {
  402. //上级评分
  403. if (e.node_id == id && stats == 1) {
  404. arr[0].pointList.push(e.point + '(暂存)');
  405. } else {
  406. arr[0].pointList.push(e.point);
  407. }
  408. } else {
  409. //指定评分呢
  410. if (e.node_id == id && stats == 1) {
  411. arr[1].pointList.push(e.point + '(暂存)');
  412. } else {
  413. arr[1].pointList.push(e.point);
  414. }
  415. }
  416. }
  417. } else {
  418. if (e.node_id <= id) {
  419. if (e.node_code == 'score_supervisor') {
  420. //上级评分
  421. if (e.node_id == id && stats == 1) {
  422. arr[0].pointList.push(e.point + '(暂存)');
  423. } else {
  424. arr[0].pointList.push(e.point);
  425. }
  426. } else {
  427. //指定评分呢
  428. if (e.node_id == id && stats == 1) {
  429. arr[1].pointList.push(e.point + '(暂存)');
  430. } else {
  431. arr[1].pointList.push(e.point);
  432. }
  433. }
  434. }
  435. }
  436. });
  437. return arr;
  438. },
  439. openTx(item) {
  440. this.employee_id = item.employee_id;
  441. this.employeeID = item.record_id;
  442. this.has_finish = item.record_id;
  443. this.employeeDet(item.record_id, () => {
  444. this.isTrack = true;
  445. });
  446. },
  447. employeeDet(id, callBack) {
  448. this.staffLoad = true;
  449. this.$axios('get', '/api/per/package/employee/info', { id: id })
  450. .then(res => {
  451. let data = res.data.data;
  452. this.apList = data.dimension;
  453. this.recordMemberIds = data.record_member_ids;
  454. callBack && callBack();
  455. })
  456. .finally(() => {
  457. this.staffLoad = false;
  458. });
  459. },
  460. openDetail2(item) {
  461. this.$router.push({
  462. path: '/staffAssDet',
  463. query: {
  464. assID: this.package_id,
  465. employeeID: item.record_id,
  466. employeeIDs: item.employee_id
  467. }
  468. });
  469. },
  470. //我管理记录
  471. getManagement() {
  472. if (this.headValue.length == 0) {
  473. return false;
  474. }
  475. this.glLoading = true;
  476. this.$axios('get', '/api/per/package/management_record', { package_id: this.package_id || 0, name: this.name, page: 1, page_size: 5 })
  477. .then(res => {
  478. let list = res.data.data.list;
  479. list.forEach(item => {
  480. if (item.employee_id) {
  481. //当是导入导出时,显示登录者
  482. item.userInfo = this.$getEmployeeList()[item.employee_id];
  483. if (this.$getEmployeeList()[item.employee_id]) {
  484. item.dept_list = this.$getEmployeeList()[item.employee_id].dept_list;
  485. }
  486. }
  487. });
  488. this.glDataList = list;
  489. })
  490. .finally(() => {
  491. this.glLoading = false;
  492. });
  493. },
  494. //我评分的
  495. getScorerRecord() {
  496. if (this.headValue.length == 0) {
  497. return false;
  498. }
  499. this.glLoading = true;
  500. this.$axios('get', '/api/per/package/score_record', { package_id: this.package_id || 0, name: this.name, page: 1, page_size: 5 })
  501. .then(res => {
  502. let list = res.data.data.list;
  503. list.forEach(item => {
  504. if (item.employee_id) {
  505. //当是导入导出时,显示登录者
  506. item.userInfo = this.$getEmployeeList()[item.employee_id];
  507. if (this.$getEmployeeList()[item.employee_id]) {
  508. item.dept_list = this.$getEmployeeList()[item.employee_id].dept_list;
  509. }
  510. }
  511. });
  512. this.glDataList = list;
  513. })
  514. .finally(() => {
  515. this.glLoading = false;
  516. });
  517. },
  518. //搜索
  519. searchList(data) {
  520. this.name = data;
  521. this.glIndex == '1' ? this.getManagement() : this.getScorerRecord();
  522. },
  523. //请求绩效树
  524. assessTree() {
  525. this.$axios('get', '/api/per/package/tree').then(res => {
  526. if (res.data.code == 1) {
  527. this.options = res.data.data;
  528. let headValue = [];
  529. this.options.some(item => {
  530. if (item.list.length > 0) {
  531. headValue.push(item.id);
  532. headValue.push(item.list[0].id);
  533. return true;
  534. }
  535. });
  536. if (headValue.length > 0) {
  537. this.headValue = headValue;
  538. }
  539. }
  540. });
  541. },
  542. openDetail(index, item) {
  543. if (index == 1) {
  544. if (item.type == 1) {
  545. this.$router.push({
  546. path: '/staffAssDet',
  547. query: {
  548. assID: item.remark.package_id,
  549. employeeID: item.remark.packageEmployee_id,
  550. employeeIDs: item.remark.employee_id,
  551. pendingList: JSON.stringify(this.pendingList),
  552. activeName: this.activeName
  553. }
  554. });
  555. } else {
  556. this.$router.push({ name: 'resultSet', query: { id: item.remark.packageEmployee_id, packageName: item.remark.package_name } });
  557. }
  558. } else {
  559. this.disposeMessage(item);
  560. }
  561. },
  562. // 处理未读信息
  563. disposeMessage(item) {
  564. if (item.type == 1 || item.type == 2) {
  565. this.$router.push({
  566. path: '/staffAssDet',
  567. query: {
  568. assID: item.remark.package_id,
  569. employeeID: item.remark.packageEmployee_id,
  570. employeeIDs: item.remark.employee_id
  571. }
  572. });
  573. } else if (item.type == 3) {
  574. //导入
  575. } else {
  576. //导出
  577. window.open(this.$serverdomain + item.remark.file_path);
  578. }
  579. this.$axios('post', '/api/per/package/msg/cc', { id: item.id, type: item.type, employee_id_code: this.$returnCode(item.employee_id) }).then(res => {});
  580. },
  581. //待办数量
  582. getAgencyNum() {
  583. this.$axios('get', '/api/per/package/msg/agency_num', { status: 0 }).then(res => {
  584. let data = res.data.data;
  585. this.editableTabs = [
  586. // { title: '全部待办', name: '0', num: data.all_total },
  587. { title: '全部待办', name: '0', num: 0 },
  588. { title: '目标制定', name: '1', num: data.target },
  589. { title: '目标确认', name: '2', num: data.confirm },
  590. { title: '结果录入', name: '4', num: data.result_value },
  591. { title: '评分', name: '5', num: data.score },
  592. { title: '审批', name: '9', num: data.review }
  593. ];
  594. });
  595. },
  596. //待办
  597. getAgency() {
  598. this.loading = true;
  599. this.$axios('get', '/api/per/package/msg/agency', { node_type: this.activeName, status: 0, page: 1, page_size: 10 })
  600. .then(res => {
  601. let list = res.data.data.list;
  602. let pendingList = [];
  603. list.forEach(item => {
  604. if (item.remark.employee_id) {
  605. //被考核人
  606. let userInfo = this.$getEmployeeList()[item.remark.employee_id];
  607. item.userInfo = userInfo;
  608. pendingList.push({
  609. name: userInfo.name,
  610. img_url: userInfo.img_url,
  611. employeeID: item.remark.packageEmployee_id,
  612. package_name: item.remark.package_name
  613. });
  614. }
  615. if (item.employee_id) {
  616. //当是导入导出时,显示登录者
  617. item.userInfo2 = this.$getEmployeeList()[item.employee_id];
  618. }
  619. });
  620. this.pendingList = pendingList;
  621. this.agencyList = list.slice(0, 5);
  622. this.agencyNum = res.data.data.total;
  623. })
  624. .finally(() => {
  625. this.loading = false;
  626. });
  627. },
  628. //消息列表
  629. getMessage() {
  630. this.$axios('get', '/api/per/package/msg/cc', { status: 0, page: 1, page_size: 5 }).then(res => {
  631. let list = res.data.data.list;
  632. list.forEach(item => {
  633. if (item.remark.employee_id) {
  634. //被考核人
  635. item.userInfo = this.$getEmployeeList()[item.remark.employee_id];
  636. }
  637. if (item.employee_id) {
  638. //当是导入导出时,显示登录者
  639. item.userInfo2 = this.$getEmployeeList()[item.employee_id];
  640. }
  641. });
  642. this.messageList = list;
  643. this.messageNum = res.data.data.total;
  644. });
  645. },
  646. openUrl(item) {
  647. // let leg = this.$getCache('routers').length;
  648. if (item.name == '考核表') {
  649. // this.$setCache('activeIndex', leg - 1);
  650. this.$setCache('setUrlName', null);
  651. }
  652. if (item.name == '指标库') {
  653. // this.$setCache('activeIndex', leg - 1);
  654. this.$setCache('setUrlName', 'indexSet');
  655. }
  656. this.$router.push({ path: item.url });
  657. },
  658. setMenu() {
  659. let entranceList = [];
  660. if (this.$isAuthoritys([this.$7, this.$8, this.$9, this.$10, this.$11,this.$17,this.$18])) {
  661. entranceList.push({ name: '考核管理', image: require('@/assets/image/1.png'), url: '/assessManagement' });
  662. }
  663. if (this.$isAuthoritys([this.$13, this.$14])) {
  664. entranceList.push({ name: '考核表', image: require('@/assets/image/2.png'), url: '/set' });
  665. }
  666. if (this.$isAuthoritys(this.$7)) {
  667. entranceList.push({ name: '发起考核', image: require('@/assets/image/3.png'), url: '/sponsorAssess' });
  668. }
  669. if (this.$isAuthoritys(this.$12)) {
  670. entranceList.push({ name: '指标库', image: require('@/assets/image/4.png'), url: '/set' });
  671. }
  672. this.entranceList = entranceList;
  673. }
  674. }
  675. };
  676. </script>
  677. <style scoped="scoped">
  678. .actionText {
  679. }
  680. .zmBox {
  681. width: 18px;
  682. height: 18px;
  683. background-color: #f26c69;
  684. color: #fff;
  685. text-align: center;
  686. line-height: 18px;
  687. font-size: 12px;
  688. border-radius: 50%;
  689. margin-right: 10px;
  690. }
  691. .more {
  692. text-align: right;
  693. color: #909399;
  694. font-size: 14px;
  695. padding: 16px 0px 0 0px;
  696. }
  697. .more span {
  698. cursor: pointer;
  699. }
  700. .more span:hover {
  701. color: #26a2ff;
  702. }
  703. .more2 {
  704. text-align: right;
  705. color: #909399;
  706. font-size: 14px;
  707. padding: 16px 0px 0 0px;
  708. position: absolute;
  709. top: 14px;
  710. right: 20px;
  711. z-index: 999;
  712. }
  713. .more2 span {
  714. cursor: pointer;
  715. }
  716. .more2 span:hover {
  717. color: #26a2ff;
  718. }
  719. .dispose-left{
  720. position: relative;
  721. }
  722. .dispose-left ::v-deep.el-badge__content.is-fixed {
  723. position: absolute;
  724. top: 20px;
  725. right: -2px;
  726. }
  727. .tabs ::v-deep.el-badge__content.is-fixed {
  728. position: absolute;
  729. top: 50%;
  730. right: -2px;
  731. }
  732. .all {
  733. font-size: 14px;
  734. border-radius: 4px;
  735. }
  736. .item {
  737. font-size: 14px;
  738. cursor: pointer;
  739. padding: 5px;
  740. }
  741. .item:hover {
  742. background-color: #f5f7fa;
  743. }
  744. .content {
  745. padding: 0 10px;
  746. }
  747. .message-content {
  748. overflow: hidden;
  749. text-overflow: ellipsis;
  750. word-break: break-all;
  751. display: -webkit-box;
  752. -webkit-line-clamp: 2;
  753. -webkit-box-orient: vertical;
  754. line-height: 22px;
  755. }
  756. .message-title {
  757. height: 40px;
  758. line-height: 40px;
  759. font-size: 16px;
  760. font-weight: normal;
  761. position: relative;
  762. padding: 0 5px;
  763. }
  764. .open-detail {
  765. cursor: pointer;
  766. }
  767. .dispose-left,
  768. .gl-all {
  769. background-color: #fff;
  770. padding: 20px;
  771. border-radius: 5px;
  772. }
  773. .left-main {
  774. background-color: #fff;
  775. padding: 20px;
  776. border-radius: 5px;
  777. }
  778. .title {
  779. font-size: 14px;
  780. margin-bottom: 15px;
  781. border-bottom: 1px solid #ebebeb;
  782. padding-bottom: 16px;
  783. }
  784. .wt {
  785. padding: 15px;
  786. border-radius: 4px;
  787. border-radius: 5px;
  788. background-color: #fff;
  789. }
  790. .wt-title {
  791. font-size: 14px;
  792. }
  793. .wts {
  794. margin-top: 20px;
  795. line-height: 25px;
  796. font-size: 14px;
  797. }
  798. .tabss {
  799. position: absolute;
  800. right: 0px;
  801. top: 146px;
  802. cursor: pointer;
  803. z-index: 999;
  804. }
  805. .entrance {
  806. padding: 15px;
  807. border-radius: 4px;
  808. border: 1px solid #ebebeb;
  809. font-size: 14px;
  810. width: 200px;
  811. color: #222;
  812. margin: 0 12px;
  813. cursor: pointer;
  814. }
  815. .entrance:hover {
  816. background-color: #f5f7fa;
  817. }
  818. .entrance img {
  819. width: 30px;
  820. height: 30px;
  821. border-radius: 2px;
  822. margin-right: 10px;
  823. }
  824. .flex-5 {
  825. position: relative;
  826. }
  827. ::v-deep .el-tabs__nav-wrap::after {
  828. content: '';
  829. position: absolute;
  830. left: 0;
  831. bottom: 0;
  832. width: 100%;
  833. height: 1px !important;
  834. background-color: #e4e7ed;
  835. z-index: 1;
  836. }
  837. /* 右边 */
  838. .gg-img {
  839. width: 100%;
  840. height: 100px;
  841. border-radius: 5px;
  842. margin-top: 20px;
  843. }
  844. .echarts {
  845. border-radius: 4px;
  846. padding: 10px;
  847. }
  848. .echarts-header {
  849. margin: 10px 0;
  850. }
  851. #eChart {
  852. height: 300px;
  853. width: 100%;
  854. }
  855. </style>