assessManagement.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  1. <template>
  2. <div class="all boxMinHeight">
  3. <!-- 头部筛选条件,按钮组,流程节点 -->
  4. <header>
  5. <div>
  6. <el-row :gutter="10" type="flex" justify="space-between">
  7. <el-col :span="24">
  8. <div class="flex-box">
  9. <div class="flex-box-ce" style="margin-right: 10px;">
  10. <el-cascader v-model="headValue" :options="options" :props="props" :show-all-levels="false"
  11. style="width: 300px;"></el-cascader>
  12. </div>
  13. <!-- 选择部门下拉框 -->
  14. <div class="dept_wdiv">
  15. <div class="dept_inp" @click="show_dept_selector = true">
  16. <span v-if="deptVisibleName != ''">{{ deptVisibleName }}</span>
  17. <span v-else style="color: #b9b9b9;">选择部门</span>
  18. </div>
  19. <i class="el-icon-arrow-down"></i>
  20. </div>
  21. <EmployeeSelector :title="'选择部门'" :isChecKedAll="false" :can_select_employee="false"
  22. :can_select_dept="true" :dept_children="false" :selected="dept_selected"
  23. :visible.sync="show_dept_selector" @confirm="dept_confirm" />
  24. <!-- 选择部门下拉框 -->
  25. <!-- 选择考核模板下拉框 -->
  26. <el-select v-model="groupValue" @change="groupChange" clearable class="margin-l width-300"
  27. placeholder="选择考核表">
  28. <el-option v-for="item in groupOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
  29. </el-select>
  30. <!-- 选择考核模板下拉框 -->
  31. <!-- 姓名搜索 -->
  32. <el-select v-model="employee_ids" multiple filterable clearable class="margin-l" placeholder="姓名搜索">
  33. <el-option v-for="item in employees" :key="item.id" :label="item.name" :value="item.id"></el-option>
  34. </el-select>
  35. <!-- 姓名搜索 -->
  36. <img v-if="all_finish" src="static/images/guidang.png" class="guidang" />
  37. </div>
  38. </el-col>
  39. </el-row>
  40. <el-row :gutter="10" style="margin-top: 20px;">
  41. <el-col :span="24">
  42. <!-- 按钮组 -->
  43. <div class="flex-box-ce">
  44. <template v-if="!all_finish">
  45. <el-button-group>
  46. <el-button type="primary" icon="el-icon-s-promotion" v-if="$getRole(1) && $isAuthoritys_jx($7)"
  47. @click="amhrsponsor">发起考核</el-button>
  48. <el-button type="primary" icon="el-icon-s-custom" v-if="$getRole(1) || $getRole(2)"
  49. @click="isManagement = true">人员管理</el-button>
  50. <!-- 主管理员、有【开始评分】权限的子管理员 -->
  51. <el-button type="primary" icon="el-icon-edit-outline" v-if="$getRole(1) && $isAuthoritys_jx($8)"
  52. @click="startisChecks">开始评分</el-button>
  53. </el-button-group>
  54. <!-- 主管理员、有【菜单权限】权限的子管理员 -->
  55. <el-dropdown v-if="$getRole(1)" style="margin-left:11px;" @command="handleCommand">
  56. <el-button>更多 <i class="el-icon-arrow-down"></i></el-button>
  57. <el-dropdown-menu slot="dropdown">
  58. <el-dropdown-item v-for="(item, index) in dropdownMenu" :key="index" :command="item.key"
  59. :divided="item.bordok" v-if="item.isShow">
  60. {{ item.name }}
  61. </el-dropdown-item>
  62. </el-dropdown-menu>
  63. </el-dropdown>
  64. </template>
  65. </div>
  66. <!-- 按钮组 -->
  67. </el-col>
  68. </el-row>
  69. </div>
  70. <div class="navigationL flex-box-ce flex-d-wrap">
  71. <div v-for="(item, index) in navigationList" :key="index" class="flex-box-ce" @click="navClick(item)">
  72. <template v-if="item.num">
  73. <el-badge :value="item.num" class="item">
  74. <span class="flex-box-ce" :class="{ action: navcli == item.id }">
  75. <div>{{ index ? index : '' }} {{ item.name }}</div>
  76. <div v-if="item.hint">
  77. &nbsp;
  78. <el-tooltip class="item" effect="dark" :content="item.hint" placement="top">
  79. <i class="el-icon-warning-outline navsvg1" v-if="item.hint"></i>
  80. </el-tooltip>
  81. </div>
  82. </span>
  83. </el-badge>
  84. </template>
  85. <span class="flex-box-ce" :class="{ action: navcli == item.id }" v-else>
  86. <div>{{ index ? index : '' }} {{ item.name }}</div>
  87. <div v-if="item.hint">
  88. &nbsp;
  89. <el-tooltip class="item" effect="dark" :content="item.hint" placement="top">
  90. <i class="el-icon-warning-outline navsvg1" v-if="item.hint"></i>
  91. </el-tooltip>
  92. </div>
  93. </span>
  94. <div v-if="index == 0" class="navsvg2"></div>
  95. <i v-if="navigationList.length != index + 1 && index != 0" class="el-icon-right navsvg3"></i>
  96. </div>
  97. </div>
  98. <template v-if="$getRole(1)">
  99. <el-alert type="warning" style="margin-bottom: 15px;" v-if="navcli != 0 && navcli != 3 && navcli != 11"
  100. :closable="false">
  101. 该绩效节点“<span style="font-weight: 600;">{{ getNode }}</span>”
  102. 参与人员:<span style="font-weight: 600;">{{ total }}</span>人,
  103. <!-- 已完成录入<span style="font-weight: 600;">{{ asstabData.length }}</span>人,
  104. 未完成录入<span style="font-weight: 600;">{{ total - asstabData.length }}</span>人 -->
  105. <span class="blue" style="cursor: pointer; margin-left: 10px" @click="isPending = true">查看名单</span>
  106. </el-alert>
  107. </template>
  108. <div v-if="navcli == 3 && $getRole(1) && $isAuthoritys_jx($8)" style="margin-bottom: 15px;">
  109. <el-button type="primary" @click="pf()">批量开始评分</el-button>
  110. </div>
  111. </header>
  112. <!-- 头部筛选条件,按钮组 -->
  113. <el-table :data="asstabData" v-loading="assDetLoad" @row-click="assDetClick" style="width: 100%; margin-top: 20px;"
  114. :header-cell-style="{ background: '#ECF5FF' }" @selection-change="handleSelectionChange">
  115. <el-table-column type="selection" width="55" v-if="navcli == 3"></el-table-column>
  116. <el-table-column label="姓名" min-width="120" align="center">
  117. <template slot-scope="scope">
  118. <userImage class="fl" :id="scope.row.employee_id" style="margin-top: 9px;" :user_name="scope.row.name"
  119. :img_url="scope.row.img_url" width="35px" height="35px" fontSize="12px"></userImage>
  120. <span style="margin-left: 10px; line-height: 50px;">{{ scope.row.name }}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="dept_list" label="部门" min-width="300" align="center">
  124. <template slot-scope="scope">
  125. <template v-if="scope.row.dept_list.length > 0">
  126. <span v-for="(item, index) in scope.row.dept_list" :key="index">
  127. {{ item.dept_name }}
  128. <span v-if="scope.row.dept_list.length - index > 1">,</span>
  129. </span>
  130. </template>
  131. <span v-else>--</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column prop="group_name" label="考核表" min-width="300" align="center">
  135. <template slot-scope="scope">
  136. <span v-if="!scope.row.relevance_group.delete_time">{{ scope.row.relevance_group.name }}</span>
  137. <span v-else class="red">该考核表已被删除</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column prop="final_point" min-width="120" label="考核结果" align="center">
  141. <template slot-scope="scope">
  142. <template v-if="scope.row.final_point">
  143. <span v-if="$getRole(1)">{{ scope.row.final_point }}</span>
  144. <span v-else-if="scope.row.publicity">{{ scope.row.final_point }}</span>
  145. <span v-else>-</span>
  146. </template>
  147. <span v-else>-</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column prop="final_level" min-width="120" label="绩效等级" align="center">
  151. <template slot-scope="scope">
  152. <template v-if="scope.row.final_level">
  153. <span v-if="$getRole(1)">{{ scope.row.final_level }}</span>
  154. <span v-else-if="scope.row.publicity">{{ scope.row.final_level }}</span>
  155. <span v-else>-</span>
  156. </template>
  157. <span v-else>-</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column prop="peoplenum" min-width="300" label="操作" align="center">
  161. <template slot-scope="scope">
  162. <el-button type="text" size="medium" @click="assDetClick(scope.row)">查看</el-button>
  163. <template v-if="$isAuthoritys_jx($9) && !all_finish && scope.row.doing_id == 11">
  164. <el-button type="text" size="medium" @click.stop="theResultsOf1(scope.row, 1)">调整考核结果</el-button>
  165. <el-button type="text" size="medium" @click.stop="theResultsOf1(scope.row, 2)">调整绩效等级</el-button>
  166. </template>
  167. <el-button type="text" v-if="navcli == 3 && $getRole(1) && $isAuthoritys_jx($8)" size="medium"
  168. @click.stop="pf(scope.row)">开始评分</el-button>
  169. </template>
  170. </el-table-column>
  171. </el-table>
  172. <Pagination :page="asstabParams.page" :page_size="asstabParams.page_size" :total="total"
  173. @handleSizeChange="handleSizeChange" @handleCurrentChange="handleCurrentChange"></Pagination>
  174. <BrawerBox drawerTitle="请选择开始评分的考核模板" :showDrawer.sync="isChecks">
  175. <template slot="main">
  176. <div v-loading="isChecksLoad">
  177. <div style="padding-top:10px;">
  178. <JxSearch :screen="2" title="搜索考核模板" ref="braSearch" @confirm="braSearch"></JxSearch>
  179. </div>
  180. <template v-if="scoreGroup.length > 0">
  181. <div class="flex-box-ce li" style="margin-top: 20px;"><el-checkbox class="flex-box-ce"
  182. v-model="isAllSelectIndex" label="全选"></el-checkbox></div>
  183. <ul class="ul">
  184. <li v-for="(item, index) in scoreGroup" :key="index" class="flex-box-ce li">
  185. <el-checkbox class="flex-box-ce" style="padding: 0;" :disabled="item.disabled" v-model="item.check">
  186. <div class="flex-box-ce">
  187. <div class="flex-1">
  188. <!-- <span v-if="item.all_exec_over" class="blue-box" style="padding: 5px 10px; border-radius: 3px; width: 80px;height: 24px; font-size: 12px;">已开始评分</span> -->
  189. <span>{{ item.name }}</span>
  190. </div>
  191. <div class="blue" v-if="item.count_employee > 0">{{ item.count_employee }} 人</div>
  192. </div>
  193. </el-checkbox>
  194. </li>
  195. <div class="fontColorC" style="text-align: center;padding: 10px 0;font-size: 12px;">没有更多了</div>
  196. </ul>
  197. </template>
  198. <NoData v-else></NoData>
  199. </div>
  200. </template>
  201. <template slot="footer">
  202. <div style="position: absolute;left: 20px;font-size: 14px;color: #2b7ce0">已选择:{{ getLeng }}个</div>
  203. <el-button plain @click="isChecks = false">取消</el-button>
  204. <el-button type="primary" @click="beginGrade">开始评分</el-button>
  205. </template>
  206. </BrawerBox>
  207. <!-- 导出执行记录 -->
  208. <EmployeeSelector :title="'选择人员'" :isChecKedAll="false" :max="20" :isRequired="true" :can_select_employee="true"
  209. :can_select_dept="false" :user_employee_list="true" :employee_list="employee_list" :visible.sync="isDerive"
  210. @confirm="confirmDerive" />
  211. <!-- 公式结果 -->
  212. <EmployeeSelector :title="'结果公布'" :is_filtration_creator="false" :can_select_employee="true"
  213. :can_select_dept="false" :user_employee_list="true" :employee_list="employee_list" :selected="selected"
  214. :visible.sync="isResult" @confirm="confirmResult" />
  215. <!-- 更多-管理 -->
  216. <BrawerBox drawerTitle="人员管理" :showDrawer.sync="isManagement">
  217. <template slot="main">
  218. <div class="m-content">
  219. <div>
  220. <div class="m-title">变更参与考核人员({{ employee_list.length }}人)</div>
  221. <div class="flex-box-ce" style="margin-top: 20px;">
  222. <div style="margin-right: 20px;cursor: pointer;" @click="showSelectUser(1)">
  223. <i class="el-icon-circle-plus-outline blue"></i>
  224. 添加
  225. </div>
  226. <div style="cursor: pointer;" @click="showSelectUser(2)">
  227. <i class="el-icon-remove-outline red"></i>
  228. 删除
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. </template>
  234. </BrawerBox>
  235. <!-- 更多-管理-人员选择添加 -->
  236. <EmployeeSelector title="添加被考核人员" :is_filtration_creator="false" :can_select_employee="true"
  237. :can_select_dept="false" :user_employee_list="true" :isRequired="true" :employee_list="add_employee_list"
  238. :visible.sync="isShowUser" @confirm="confirmUser">
  239. <template slot="footer">
  240. <div style="text-align: center;" class="orange flex-1">*添加成功后,别忘了帮Ta加入【绩效等级配置】喔!*</div>
  241. </template>
  242. </EmployeeSelector>
  243. <!-- 更多-管理-人员选择删除 -->
  244. <EmployeeSelector :title="packageName + ':选择被删除人员'" :is_filtration_creator="false" :can_select_employee="true"
  245. :can_select_dept="false" :isRequired="true" :user_employee_list="true" :include_deleted="true"
  246. :employee_list="employee_list" :visible.sync="isShowUser2" @confirm="confirmUser2">
  247. <template slot="header">
  248. <div style="text-align: center;" class="orange">*当所有人员都被选中删除时,该周期的绩效考核也会自动删除*</div>
  249. </template>
  250. </EmployeeSelector>
  251. <el-dialog :title="theResults == 1 ? '调整考核结果' : '调整绩效等级'" :visible.sync="comtheResults" width="500px"
  252. :close-on-click-modal="false">
  253. <div class="">
  254. <div>
  255. 员工姓名:
  256. <span style="padding-left: 14px;">{{ theResultsList.name }}</span>
  257. </div>
  258. <br />
  259. <div v-if="theResults == 1">
  260. <div>原考核结果:<span>{{ theResultsList.final_point }}</span></div>
  261. <br />
  262. <div class="flex-box">
  263. <span style="line-height:36px;">新考核结果:</span>
  264. <el-input v-model="theResultInp"
  265. @input="theResultInp = theResultInp.match(/\d+(\.\d{0,2})?/) ? theResultInp.match(/\d+(\.\d{0,2})?/)[0] : ''"
  266. style="width:250px;" placeholder="请输入新考核结果"></el-input>
  267. </div>
  268. </div>
  269. <div v-else>
  270. <div>原绩效等级:<span>{{ theResultsList.final_level }}</span></div>
  271. <br />
  272. <div class="flex-box-ce">
  273. <span>新绩效等级:</span>
  274. <el-select v-model="level" placeholder="请选择" style="width: 200px;">
  275. <el-option v-for="(item, index) in levels" :key="index" :label="item.name" :value="item.name"></el-option>
  276. </el-select>
  277. </div>
  278. </div>
  279. </div>
  280. <span slot="footer" class="dialog-footer">
  281. <el-button @click="comtheResults = false">取 消</el-button>
  282. <el-button type="primary" :disabled="theResultsButid" @click="savecomtheResults()">确 定</el-button>
  283. </span>
  284. </el-dialog>
  285. <el-dialog title="结果" :visible.sync="isShowData" @close="close_list" :append-to-body="true" width="700px">
  286. <el-table :data="showData" style="max-height: 600px;overflow: auto;">
  287. <el-table-column prop="name" label="名称"></el-table-column>
  288. <el-table-column prop="successText" label="结果">
  289. <template slot-scope="scope">
  290. <span v-if="scope.row.successText == '失败'" class="red">失败</span>
  291. <span v-else class="green">成功</span>
  292. </template>
  293. </el-table-column>
  294. <el-table-column prop="reason" label="描述"></el-table-column>
  295. </el-table>
  296. <span slot="footer" class="dialog-footer" v-if="selectUser.length == showData.length">
  297. <el-button type="primary" @click="isShowData = false">确 定</el-button>
  298. </span>
  299. </el-dialog>
  300. <!-- 待处理人员列表 -->
  301. <BrawerBox :drawerTitle="'“' + getNode + '” 相关负责人名单'" :showDrawer.sync="isPending">
  302. <template slot="main">
  303. <div>
  304. <div class="flex-box-ce" style="border-bottom: 1px solid #f1f1f1;padding: 10px 0;"
  305. v-for="(item, index) in pending_employee_list" :key="index" v-if="pending_employee_list.length > 0">
  306. <div class="flex-box-ce">
  307. <userImage style="margin-right: 10px;" :user_name="item.name" :img_url="item.img_url" width="38px"
  308. height="38px" fontSize="12px"></userImage>
  309. <span>{{ item.name }}</span>
  310. </div>
  311. <div style="margin-left: 10px;" class="flex-1">
  312. <template v-if="item.dept_list.length > 0">
  313. <span v-for="(e, index2) in item.dept_list" :key="index2" class="fontColorC">
  314. {{ e.dept_name }}
  315. <span v-if="item.dept_list.length - index > 1">,</span>
  316. </span>
  317. </template>
  318. </div>
  319. </div>
  320. <NoData v-if="pending_employee_list.length == 0"></NoData>
  321. </div>
  322. </template>
  323. <template slot="footer">
  324. <!-- <el-button plain @click="isPending = false">取消</el-button> -->
  325. <el-button type="primary" @click="getPending">导出人员名单</el-button>
  326. </template>
  327. </BrawerBox>
  328. </div>
  329. </template>
  330. <script>
  331. let that;
  332. import PageHead from '@/components/PageHead'; //头部---返回
  333. import JxSearch from '@/performance/components/public/JxSearch'; //搜索
  334. import EmployeeSelector from '@/components/EmployeeSelector';
  335. import BrawerBox from '@/performance/components/public/BrawerBox';
  336. export default {
  337. name: 'assessDetails',
  338. data() {
  339. return {
  340. date_remark: "",
  341. isHeadShow: false,
  342. pending_employee_list: [], //待处理人员
  343. isPending: false,
  344. total: 0, // 当前节点考核总人数
  345. nowass: false, //已开始评分显示隐藏
  346. pushAssMan: null, //头部跳转
  347. assDetLoad: false, //loading
  348. isLoad: false,
  349. headValue: [], //顶部选择考核
  350. options: [], //顶部考核数据
  351. props: {},
  352. groupValue: [], //选择考核模板val
  353. groupOptions: [], //选择考核模板数据
  354. scoreGroup: [], //评分考核模板
  355. isAllSelectIndex: false,
  356. GroupList: [], //评分考核模板备份搜索数据
  357. // 流程节点
  358. navigationList: [
  359. //导航
  360. { id: 0, name: '考核周期: ', num: 0 },
  361. { id: 1, name: '目标制定', num: 0 },
  362. { id: 2, name: '目标确认', num: 0 },
  363. {
  364. id: 3,
  365. name: '执行中',
  366. num: 0,
  367. hint: '目标制定并确认完毕后,进入到【执行中】阶段,期间员工执行计划,上级跟踪过程。进入结果数据收集和评分阶段'
  368. },
  369. { id: 4, name: '结果值录入', num: 0 },
  370. { id: 5, name: '评分', num: 0 },
  371. { id: 9, name: '审批', num: 0 },
  372. { id: 11, name: '结束', num: 0 }
  373. ],
  374. navcli: 0, // 导航当前选中
  375. svaeNavcli: 0, //保存的选中
  376. // 头部筛选条件
  377. asstabParams: {
  378. package_id: 0, //考核包id
  379. dept_ids: [], //部门idx
  380. group_ids: [], //考核模板ID
  381. doing_id: 0, //状态ID
  382. employee_ids: [], //搜索人员ID
  383. page: 1,
  384. page_size: 10
  385. },
  386. employee_ids: [],
  387. asstabData: [], // 表格数据
  388. employees: [], //被考核人员列表
  389. //更多
  390. dropdownMenu: [
  391. { key: 'a', name: '等级配置', isShow: this.$isAuthoritys_jx(this.$10) },
  392. { key: 'b', name: '结果公布', isShow: true },
  393. { key: 'c', name: '导出明细', bordok: true, isShow: this.$isAuthoritys_jx(this.$11) },
  394. { key: 'd', name: '导出结果', isShow: this.$isAuthoritys_jx(this.$11) },
  395. { key: 'k', name: '导出执行计划', isShow: this.$getRole(1) || this.$getRole(2) },
  396. { key: 'y', name: '批量修改目标值', isShow: true },
  397. { key: 'j', name: '批量转交', isShow: true },
  398. // { key: 'e', name: '自定义导出' },
  399. // { key: 'f', name: '批量操作', bordok: true },
  400. { key: 'h', name: '归档&统计', bordok: true, isShow: false },
  401. // { key: 'g', name: '管理', bordok: true, isShow: true }
  402. ],
  403. // 选择部门
  404. deptVisibleName: '',
  405. dept_selected: { dept: [], employee: [] },
  406. show_dept_selector: false,
  407. deptList_id: [],
  408. isChecks: false, //评分开关
  409. isChecksLoad: false,
  410. allassList: [], //所有流程数据
  411. searchList: [], //搜索备份
  412. searchdet: '', //搜索值
  413. packageName: '', //考核包名称
  414. // 公式结果相关
  415. isResult: false,
  416. employee_list: [], //人员列表
  417. selected: { dept: [], employee: [] }, //已选择公式人员
  418. // 更多-管理
  419. isManagement: false,
  420. ManagementTitle: '删除被考核人员',
  421. add_employee_list: [], //可以被添加到绩效包的人员
  422. isShowUser: false, //控制添加人员
  423. isShowUser2: false, //控制删除人员
  424. selected: { dept: [], employee: [] }, //已选择公式人员
  425. userInfo: this.$userInfo(),
  426. theResults: 1, //结果点击按钮
  427. theResultsList: {}, //点击的结果
  428. comtheResults: false, //切换结果控制
  429. theResultInp: '', //调整考核结果值
  430. theResultsButid: false,
  431. deleteNum: 0, //记录考核包人数
  432. isShowData: false,
  433. showData: [],
  434. all_process_done: false, //是否所有人都完成流程了
  435. all_finish: false, //是否已经归档
  436. isDerive: false,//导出执行人员
  437. level: '',
  438. levels: [],
  439. selectUser: [],
  440. pfIndex: 0,
  441. };
  442. },
  443. components: { PageHead, JxSearch, EmployeeSelector, BrawerBox },
  444. computed: {
  445. /* 选择节点名称 */
  446. getNode() {
  447. let name;
  448. this.navigationList.some(item => {
  449. if (item.id == this.navcli) {
  450. name = item.name;
  451. return true;
  452. }
  453. });
  454. return name;
  455. },
  456. getLeng() {
  457. let num = 0;
  458. this.scoreGroup.forEach(item => {
  459. if (item.check) {
  460. num += 1;
  461. }
  462. });
  463. return num;
  464. }
  465. },
  466. watch: {
  467. isChecks(val) {
  468. if (!val) {
  469. this.isAllSelectIndex = false;
  470. }
  471. },
  472. isAllSelectIndex(val) {
  473. this.scoreGroup.forEach(item => {
  474. if (!item.disabled) {
  475. item.check = val;
  476. }
  477. });
  478. },
  479. headValue(val) {
  480. if (!(this.options && this.options.length > 0)) return
  481. this.options.some(item => {
  482. if (item.id == val[0]) {
  483. item.list.some(e => {
  484. if (e.id == val[1]) {
  485. this.packageName = e.name;
  486. return true;
  487. }
  488. });
  489. return true;
  490. }
  491. });
  492. let arr = JSON.parse(JSON.stringify(val));
  493. arr.push(this.pushAssMan);
  494. this.$setCache('assessDetails', arr); //当点击考核记录进入详情,返后时要还原到之前的考核包
  495. this.asstabParams.package_id = val[val.length - 1];
  496. this.asstabParams.group_ids = []; //置空
  497. if (this.svaeNavcli) {
  498. this.navcli = this.svaeNavcli;
  499. this.asstabParams.doing_id = this.svaeNavcli; //置空
  500. this.svaeNavcli = 0;
  501. } else {
  502. this.navcli = 0;
  503. this.asstabParams.doing_id = 0; //置空
  504. }
  505. this.getInitData(this.asstabParams.package_id, () => { });
  506. this.assDelList(); //请求绩效详情列表
  507. this.getDcl();
  508. },
  509. employee_ids(val) {
  510. this.asstabParams.employee_ids = JSON.stringify(val);
  511. this.asstabParams.page = 1;
  512. this.assDelList();
  513. }
  514. },
  515. activated() {
  516. console.log("activated");
  517. let that = this;
  518. if (that.headValue && that.headValue.length > 0) {
  519. let assessDetails = that.$getCache('assessDetails'); //缓存的数据
  520. if (!(assessDetails && assessDetails.length > 0)) return
  521. assessDetails = assessDetails.filter(item => item !== null)
  522. that.asstabParams.package_id = assessDetails[assessDetails.length - 1];
  523. that.asstabParams.group_ids = []; //置空
  524. if (that.svaeNavcli) {
  525. that.navcli = that.svaeNavcli;
  526. that.asstabParams.doing_id = that.svaeNavcli; //置空
  527. that.svaeNavcli = 0;
  528. } else {
  529. that.navcli = 0;
  530. that.asstabParams.doing_id = 0; //置空
  531. }
  532. that.getInitData(that.asstabParams.package_id, () => { });
  533. that.assDelList(); //请求绩效详情列表
  534. that.getDcl();
  535. }
  536. else {
  537. let params = {
  538. cycle_type: 2, //周期类型
  539. keywords: '', //搜索字
  540. page: 1, //当期页
  541. page_size: 10,//一页多少数据
  542. is_manage_scope: 1,
  543. }
  544. let amfTabL;
  545. that.$axiosUser('get', '/api/pro/per/package/list', params)
  546. .then(res => {
  547. if (res.data.code == 1) {
  548. that.tableData = res.data.data.list;
  549. amfTabL = that.tableData[0];
  550. if (amfTabL) {
  551. that.pushAssMan = amfTabL.pushs ? amfTabL.pushs : null;
  552. that.asstabParams.package_id = amfTabL.id;
  553. that.assessTree(amfTabL.cycle_type, amfTabL.id); //请求绩效树
  554. that.svaeNavcli = amfTabL.navcli ? amfTabL.navcli : 0;
  555. that.asstabParams.doing_id = amfTabL.navcli ? amfTabL.navcli : 0;
  556. that.props = {
  557. lazy: true,
  558. label: 'name',
  559. value: 'id',
  560. children: 'list',
  561. lazyLoad(node, resolve) {
  562. const { level } = node;
  563. that.getAssessTree(node, resolve);
  564. }
  565. }
  566. //回显绩效树的选中
  567. that.getAddEmployee();
  568. }
  569. }
  570. })
  571. }
  572. },
  573. created() {
  574. console.log("created");
  575. // let that = this;
  576. // if (that.headValue && that.headValue.length > 0) {
  577. // let assessDetails = that.$getCache('assessDetails'); //缓存的数据
  578. // if (assessDetails && assessDetails.length > 0) {
  579. // assessDetails = assessDetails.filter(item => item !== null)
  580. // that.asstabParams.package_id = assessDetails[assessDetails.length - 1];
  581. // that.asstabParams.group_ids = []; //置空
  582. // if (that.svaeNavcli) {
  583. // that.navcli = that.svaeNavcli;
  584. // that.asstabParams.doing_id = that.svaeNavcli; //置空
  585. // that.svaeNavcli = 0;
  586. // } else {
  587. // that.navcli = 0;
  588. // that.asstabParams.doing_id = 0; //置空
  589. // }
  590. // that.getInitData(that.asstabParams.package_id, () => { });
  591. // that.assDelList(); //请求绩效详情列表
  592. // that.getDcl();
  593. // }
  594. // //默认请求当月最新数据
  595. // } else {
  596. // let params = {
  597. // cycle_type: 2, //周期类型
  598. // keywords: '', //搜索字
  599. // page: 1, //当期页
  600. // page_size: 10,//一页多少数据
  601. // is_manage_scope: 1,
  602. // }
  603. // let amfTabL;
  604. // that.$axiosUser('get', '/api/pro/per/package/list', params)
  605. // .then(res => {
  606. // if (res.data.code == 1) {
  607. // that.tableData = res.data.data.list;
  608. // amfTabL = that.tableData[0];
  609. // if (amfTabL) {
  610. // that.pushAssMan = amfTabL.pushs ? amfTabL.pushs : null;
  611. // that.asstabParams.package_id = amfTabL.id;
  612. // that.assessTree(amfTabL.cycle_type, amfTabL.id); //请求绩效树
  613. // that.svaeNavcli = amfTabL.navcli ? amfTabL.navcli : 0;
  614. // that.asstabParams.doing_id = amfTabL.navcli ? amfTabL.navcli : 0;
  615. // that.props = {
  616. // lazy: true,
  617. // label: 'name',
  618. // value: 'id',
  619. // children: 'list',
  620. // lazyLoad(node, resolve) {
  621. // const { level } = node;
  622. // that.getAssessTree(node, resolve);
  623. // }
  624. // }
  625. // //回显绩效树的选中
  626. // that.getAddEmployee();
  627. // }
  628. // }
  629. // })
  630. // }
  631. },
  632. methods: {
  633. kspf(is) {
  634. let userInfo = this.selectUser[this.pfIndex];
  635. if (userInfo) {
  636. let data = {
  637. id: userInfo.id, //绩效包ID
  638. single: 1 //非单人
  639. };
  640. this.$axiosUser('post', '/api/pro/per/package/start_score', data).then(res => {
  641. if (!is) {
  642. if (!res.data.data.result) {
  643. let list = res.data.data.list;
  644. list.forEach(item => {
  645. item.successText = '失败';
  646. item.name = this.$getEmployeeMapItem(userInfo.employee_id).name;
  647. item.reason = item.reason;
  648. });
  649. this.showData.unshift(...list)
  650. } else {
  651. let data = {
  652. successText: '成功',
  653. name: this.$getEmployeeMapItem(userInfo.employee_id).name,
  654. reason: '已开始评分'
  655. }
  656. this.showData.unshift(data)
  657. }
  658. this.pfIndex++;
  659. this.kspf();
  660. } else {
  661. this.$message.success(res.data.msg);
  662. this.isChecks = false;
  663. this.getInitData(this.asstabParams.package_id);
  664. this.assDelList();
  665. }
  666. });
  667. } else {
  668. this.isChecks = false;
  669. this.getInitData(this.asstabParams.package_id);
  670. this.assDelList();
  671. }
  672. },
  673. pf(item) {
  674. //开始评分按钮
  675. if (item) {
  676. this.selectUser = [item];
  677. }
  678. if (this.selectUser.length == 0) {
  679. this.$message.warning('请选择开始评分的人员');
  680. return;
  681. }
  682. this.$confirm('所选员工的绩效考核将自动进入评分流程,确认开始评分?', '提示', {
  683. confirmButtonText: '确定',
  684. cancelButtonText: '取消'
  685. }).then(() => {
  686. if (this.selectUser.length == 1) {
  687. this.kspf(true);
  688. } else {
  689. this.pfIndex = 0;
  690. this.isShowData = true;
  691. this.kspf();
  692. }
  693. }).catch(() => { });
  694. },
  695. handleSelectionChange(val) {
  696. this.selectUser = val
  697. },
  698. confirmDerive(obj) {
  699. if (obj.employee.length == 0) {
  700. this.$message.error('请选择人员');
  701. return false;
  702. }
  703. let site_id = this.$getCache('site_info').id;
  704. let employee = obj.employee.map(item => {
  705. return item.id;
  706. });
  707. let url = `${this.$serverdomain}/api/pro/download/schedule?site_id=${site_id}&employee_ids=${JSON.stringify(employee)}&package_id=${this.asstabParams.package_id}&searcher_id=${this.userInfo.id
  708. }`;
  709. window.open(url, '_blank');
  710. },
  711. getPending() {
  712. let site_info = this.$getCache('site_info');
  713. let url = `${this.$serverdomain}/api/pro/download/doing_list?site_id=${site_info.id}&searcher_id=${this.userInfo.id}&package_id=${this.asstabParams.package_id}&node_type=${this.navcli
  714. }`;
  715. window.open(url, '_blank');
  716. },
  717. getDcl() {
  718. if (this.navcli == 0 || !this.$getRole(1)) {
  719. return false;
  720. }
  721. this.$axiosUser('get', 'api/pro/per/package/msg/doing_list', { package_id: this.asstabParams.package_id, node_type: this.navcli }).then(res => {
  722. let list = res.data.data.list;
  723. list.forEach(item => {
  724. let user = this.$getEmployeeMapItem(item.employee_id);
  725. if (!user) {
  726. return false;
  727. }
  728. item.dept_list = user.employee_detail.dept_list;
  729. item.name = user.name;
  730. item.img_url = user.img_url;
  731. });
  732. this.pending_employee_list = list;
  733. });
  734. },
  735. // 关闭
  736. close_list() {
  737. this.showData = [];
  738. },
  739. // 获取可被添加人员
  740. getAddEmployee(fun = function () { }) {
  741. this.$axiosUser('get', 'api/pro/per/package/get_subtraction_employee', { package_id: this.asstabParams.package_id }).then(res => {
  742. this.add_employee_list = res.data.data.list;
  743. fun();
  744. });
  745. },
  746. // 添加人员
  747. confirmUser(val) {
  748. let employee_ids = val.employee.map(item => {
  749. return item.id;
  750. });
  751. let data = {
  752. package_id: this.asstabParams.package_id,
  753. employee_ids: JSON.stringify(employee_ids)
  754. };
  755. this.$axiosUser('post', '/api/pro/per/package/add_package_employee', data).then(res => {
  756. this.$message.success('添加成功');
  757. this.isManagement = false;
  758. this.getInitData(this.asstabParams.package_id, () => { });
  759. this.assDelList();
  760. });
  761. },
  762. //删除人员
  763. confirmUser2(val) {
  764. this.$confirm('被考核人删除后,本次考核相关数据将被清空,无法恢复,请确认是否删除?', '删除确认', {
  765. confirmButtonText: '确定',
  766. cancelButtonText: '取消'
  767. })
  768. .then(() => {
  769. let employee_ids = val.employee.map(item => {
  770. return item.id;
  771. });
  772. let data = {
  773. package_id: this.asstabParams.package_id,
  774. employee_ids: JSON.stringify(employee_ids)
  775. };
  776. this.$axiosUser('post', '/api/pro/per/package/delete_package_employee', data).then(res => {
  777. if (employee_ids.length == this.deleteNum) {
  778. this.$alert('删除成功,考核包已无考核人员,该周期的绩效考核也会自动删除', '提示', {
  779. confirmButtonText: '确定',
  780. showClose: false,
  781. callback: action => {
  782. this.$router.go(-1);
  783. }
  784. });
  785. } else {
  786. this.$message.success('删除成功');
  787. this.isManagement = false;
  788. this.getInitData(this.asstabParams.package_id, () => { });
  789. this.assDelList();
  790. }
  791. });
  792. })
  793. .catch(() => { });
  794. },
  795. savecomtheResults(dataId, db) {
  796. this.theResultsButid = true;
  797. let data = {
  798. id: this.theResultsList.id,
  799. change_type: this.theResults,
  800. };
  801. if (this.theResults == 1) {
  802. data.point = this.theResultInp
  803. } else {
  804. if (!this.level) {
  805. this.$message.error('请选择新等级')
  806. this.theResultsButid = false;
  807. return false
  808. }
  809. data.level = this.level
  810. }
  811. this.$axiosUser('post', '/api/pro/per/package/adjustment', data)
  812. .then(res => {
  813. if (res.data.code == 1) {
  814. this.comtheResults = false;
  815. this.level = '';
  816. this.assDelList();
  817. }
  818. })
  819. .finally(() => {
  820. setTimeout(() => {
  821. this.theResultsButid = false;
  822. }, 300);
  823. });
  824. },
  825. theResultsOf1(data, num) {
  826. this.theResultsList = data;
  827. this.theResults = num;
  828. if (num == 2) {
  829. this.getLevels(data);
  830. return false
  831. }
  832. this.comtheResults = true;
  833. },
  834. getLevels(data) {
  835. this.$axiosUser('get', '/api/pro/per/package/levels', { pe_id: data.id }).then(res => {
  836. this.levels = res.data.data.levels
  837. this.comtheResults = true;
  838. });
  839. },
  840. // 更多-选择人员
  841. showSelectUser(index) {
  842. switch (index) {
  843. case 1:
  844. // this.getAddEmployee(() => {
  845. this.isShowUser = true;
  846. // });
  847. break;
  848. case 2:
  849. this.isShowUser2 = true;
  850. break;
  851. }
  852. },
  853. // 添加考核人
  854. openManagement() {
  855. this.$router.push({ path: '/addPersonnel', query: { packageId: this.asstabParams.package_id } });
  856. },
  857. // 提交公式结果
  858. confirmResult(val) {
  859. let noData = val.employee.map(item => {
  860. return item.id;
  861. });
  862. let publicity = {
  863. publicity: noData, //公布人员id列表
  864. concealment: [] //未公布人员id列表
  865. };
  866. this.$axiosUser('post', '/api/pro/per/package/edit_publicity', { id: this.asstabParams.package_id, publicity: JSON.stringify(publicity) }).then(res => {
  867. this.$message.success('操作成功');
  868. this.assDelList();
  869. this.getInitData(this.asstabParams.package_id, () => { });
  870. });
  871. },
  872. // 更多
  873. handleCommand(val) {
  874. switch (val) {
  875. case 'a': //等级配置
  876. this.$router.push({
  877. path: '/classDtail',
  878. query: {
  879. packageName: this.packageName,
  880. packageId: this.asstabParams.package_id,
  881. employee_list: JSON.stringify(this.employee_list)
  882. }
  883. });
  884. break;
  885. case 'b': //公式结果
  886. this.isResult = true;
  887. break;
  888. case 'c': //导出明细
  889. this.$axiosUser('get', '/api/pro/per/package/export/detail', { package_id: this.asstabParams.package_id }).then(res => {
  890. this.$alert('系统正在处理中,处理完将在工作台以“消息”形式通知您,请留意消息通知', '提示', {
  891. confirmButtonText: '我知道了',
  892. callback: action => { }
  893. });
  894. });
  895. break;
  896. case 'd': //导出结果
  897. this.$axiosUser('get', '/api/pro/per/package/export/result', { package_id: this.asstabParams.package_id }).then(res => {
  898. this.$alert('系统正在处理中,处理完将在工作台以“消息”形式通知您,请留意消息通知', '提示', {
  899. confirmButtonText: '我知道了',
  900. callback: action => { }
  901. });
  902. });
  903. break;
  904. case 'g': //管理
  905. this.isManagement = true;
  906. break;
  907. case 'h': //归档
  908. this.pigeonhole();
  909. break;
  910. case 'y': //批量修改目标值
  911. this.$router.push({ path: '/updateTarget', query: { packageId: this.asstabParams.package_id, packageName: this.packageName, index: '2' } });
  912. break;
  913. case 'j': //批量修改目标值
  914. this.$router.push({ path: '/updateTarget', query: { packageId: this.asstabParams.package_id, packageName: this.packageName, index: '1' } });
  915. break;
  916. case 'k': //批量修改目标值
  917. this.isDerive = true;
  918. break;
  919. }
  920. },
  921. // 归档
  922. pigeonhole() {
  923. this.$confirm('为保证统计数据一致且正确,归档操作不可撤销,归档后不能再修改考核内容,请确认考核信息无误后再归档。', '提示', {
  924. confirmButtonText: '确定',
  925. cancelButtonText: '取消',
  926. type: 'warning'
  927. })
  928. .then(() => {
  929. this.$axiosUser('post', '/api/pro/per/package/change_finish', { package_id: this.asstabParams.package_id }).then(res => {
  930. this.$message.success('操作成功');
  931. this.getInitData(this.asstabParams.package_id);
  932. });
  933. })
  934. .catch(() => { });
  935. },
  936. isSelectable(row, index) {
  937. this.nowass = row.all_exec_over ? true : false;
  938. if (row.all_exec_over) {
  939. return false;
  940. } else {
  941. return true;
  942. }
  943. },
  944. //发起考核
  945. amhrsponsor() {
  946. this.$router.push({ name: 'sponsorAssess' });
  947. },
  948. //开始评分
  949. startisChecks() {
  950. this.isChecks = true;
  951. },
  952. // 页面变更
  953. handleCurrentChange(val) {
  954. this.asstabParams.page = val;
  955. this.assDelList();
  956. },
  957. // 页面跳转
  958. handleSizeChange(val) {
  959. this.asstabParams.page_size = val;
  960. this.assDelList();
  961. },
  962. getInitData(id, fun = function () { }) {
  963. this.isLoad = true;
  964. this.$axiosUser('get', '/api/pro/per/package/info_v3_aid', { package_id: id }).then(res => {
  965. let groups = res.data.data.groups;
  966. this.all_finish = res.data.data.all_finish;
  967. this.all_process_done = res.data.data.all_process_done;
  968. this.dropdownMenu.forEach((item, index) => {
  969. if (item.key == 'h' && !this.all_finish && this.all_process_done) {
  970. if (this.all_finish) {
  971. this.$set(this.dropdownMenu[index], 'isShow', false);
  972. } else {
  973. this.$set(this.dropdownMenu[index], 'isShow', true);
  974. }
  975. }
  976. });
  977. groups.forEach(item => {
  978. item.check = false;
  979. if (item.all_exec_over) {
  980. item.disabled = true;
  981. }
  982. });
  983. this.groupOptions = groups; //考核模板下拉
  984. this.scoreGroup = groups; //评分考核模板
  985. this.GroupList = groups; //考核模板搜索
  986. // 公式结果数据
  987. let employees = res.data.data.employees;
  988. let employee_list = [];
  989. let employee = [];
  990. employees.forEach(item => {
  991. employee_list.push(this.$getEmployeeMapItem(item.id));
  992. if (item.publicity) {
  993. employee.push(this.$getEmployeeMapItem(item.id));
  994. }
  995. });
  996. this.employee_list = employee_list;
  997. this.selected.employee = employee;
  998. this.employees = employees;
  999. // 设置各节点数量
  1000. let statistics = res.data.data.statistics;
  1001. let navigationList = JSON.parse(JSON.stringify(this.navigationList));
  1002. let sum = 0;
  1003. navigationList.forEach(item => {
  1004. if (item.id == 0) item.name = "考核周期: " + this.date_remark
  1005. item.num = statistics[item.id]
  1006. if (item.id != 0) {
  1007. sum += statistics[item.id]
  1008. }
  1009. })
  1010. navigationList[0].num = sum;
  1011. this.navigationList = navigationList;
  1012. fun();
  1013. }).finally(() => {
  1014. this.isLoad = false;
  1015. });
  1016. },
  1017. assDelList() {
  1018. this.assDetLoad = true;
  1019. this.$axiosUser('get', '/api/pro/per/package/info_v3', this.asstabParams).then(res => {
  1020. let list = res.data.data.list || [];
  1021. list.forEach(item => {
  1022. let user = this.$getEmployeeMapItem(item.employee_id);
  1023. if (user.employee_detail) {
  1024. item.dept_list = user.employee_detail.dept_list;
  1025. } else {
  1026. item.dept_list = [];
  1027. }
  1028. item.name = user.name;
  1029. item.img_url = user.img_url;
  1030. if (item.todo.length > 0) {
  1031. item.todo.forEach(e => {
  1032. e.userInfo = this.$getEmployeeMapItem(e.employee_id);
  1033. });
  1034. }
  1035. });
  1036. this.asstabData = list;
  1037. this.total = res.data.data.total;
  1038. this.date_remark = res.data.data.date_remark;
  1039. this.navigationList.forEach(item => {
  1040. if (item.id == 0) item.name = "考核周期: " + this.date_remark
  1041. })
  1042. }).finally(() => {
  1043. this.assDetLoad = false;
  1044. });
  1045. },
  1046. groupChange(data) {
  1047. //考核模板选中
  1048. this.asstabParams.page = 1;
  1049. if (data) {
  1050. this.asstabParams.group_ids = JSON.stringify([data]);
  1051. } else {
  1052. this.asstabParams.group_ids = JSON.stringify([]);
  1053. }
  1054. this.assDelList();
  1055. },
  1056. // 开始评分
  1057. beginGrade() {
  1058. let multipleSelection = [];
  1059. let employeeMap = this.$getEmployeeMapAll();
  1060. this.scoreGroup.forEach(item => {
  1061. if (item.check && item.exec_list.length > 0) {
  1062. item.exec_list.forEach(item2 => {
  1063. item2.id = item2.pe_id
  1064. multipleSelection.push(item2);
  1065. })
  1066. }
  1067. });
  1068. //开始评分按钮
  1069. if (multipleSelection.length == 0) {
  1070. this.$message.warning('请选择开始评分的考核模板');
  1071. return;
  1072. }
  1073. this.selectUser = multipleSelection
  1074. this.pf();
  1075. return false
  1076. this.$confirm('所选考核模板员工的绩效考核将自动进入评分流程,确认开始评分?', '提示', {
  1077. confirmButtonText: '确定',
  1078. cancelButtonText: '取消'
  1079. }).then(() => {
  1080. let data = {
  1081. package_id: this.asstabParams.package_id, //绩效包ID
  1082. group_ids: JSON.stringify(multipleSelection), //考核模板列表
  1083. single: 0 //非单人
  1084. };
  1085. this.$axiosUser('post', '/api/pro/per/package/start_score', data).then(res => {
  1086. if (!res.data.data.result) {
  1087. let list = res.data.data.list;
  1088. list.forEach(item => {
  1089. item.successText = item.success ? '成功' : '失败';
  1090. item.name = employeeMap[item.employee_id].name;
  1091. item.reason = item.success ? '已开始评分' : item.reason;
  1092. });
  1093. this.showData = list;
  1094. this.isShowData = true;
  1095. } else {
  1096. this.$message.success(res.data.msg);
  1097. }
  1098. this.isChecks = false;
  1099. this.assDelList(); //请求绩效详情列表
  1100. });
  1101. }).catch(() => { });
  1102. },
  1103. getAssessTree(node, resolve) {
  1104. if (this.options && this.options.length == 0) {
  1105. return
  1106. }
  1107. this.tableDataLoad = true;
  1108. this.$axiosUser('get', 'api/pro/per/package/list', { page: 0, is_manage_scope: 1, cycle_type: node.value }).then(res => {
  1109. let data = res.data.data.list;
  1110. data.forEach(item => {
  1111. item.leaf = true;
  1112. })
  1113. resolve(data)
  1114. }).finally(() => {
  1115. this.tableDataLoad = false;
  1116. });
  1117. },
  1118. //请求绩效树
  1119. assessTree(id, id2) {
  1120. this.assDetLoad = true;
  1121. this.$axiosUser('get', '/api/pro/per/package/list', { page: 0, is_manage_scope: 1 }).then(res => {
  1122. if (res.data.code == 1) {
  1123. let data = res.data.data.list;
  1124. data.forEach(item => {
  1125. item.leaf = true;
  1126. })
  1127. let arr = [
  1128. { name: '月度', id: 2, list: [] },
  1129. { name: '日', id: 1, list: [] },
  1130. { name: '季度', id: 3, list: [] },
  1131. { name: '半年度', id: 4, list: [] },
  1132. { name: '年度', id: 5, list: [] },
  1133. { name: '自定义', id: 6, list: [] }
  1134. ];
  1135. let arr2 = [
  1136. { name: '月度', id: 2, list: [] },
  1137. { name: '日', id: 1, list: [] },
  1138. { name: '季度', id: 3, list: [] },
  1139. { name: '半年度', id: 4, list: [] },
  1140. { name: '年度', id: 5, list: [] },
  1141. { name: '自定义', id: 6, list: [] }
  1142. ];
  1143. data.forEach(item => {
  1144. arr.forEach(item2 => {
  1145. if (item2.id == item.cycle_type) {
  1146. item2.list.push(item);
  1147. }
  1148. });
  1149. });
  1150. arr.some((item, index) => {
  1151. if (item.id == id) {
  1152. arr2[index].list = item.list;
  1153. return true;
  1154. }
  1155. });
  1156. this.options = arr2;
  1157. this.$nextTick(() => {
  1158. this.headValue.push(id, id2);
  1159. })
  1160. }
  1161. });
  1162. },
  1163. navClick(item) {
  1164. this.navcli = item.id;
  1165. this.asstabParams.page = 1;
  1166. this.asstabParams.doing_id = item.id;
  1167. this.getDcl();
  1168. this.assDelList();
  1169. },
  1170. dept_confirm(data) {
  1171. //部门选择
  1172. this.dept_selected = { dept: [], employee: [] };
  1173. this.deptList_id = [];
  1174. this.deptVisibleName = '';
  1175. if (data.dept !== null && data.dept.length != 0) {
  1176. this.dept_selected = data;
  1177. data.dept.forEach((element, index) => {
  1178. this.deptList_id.push(element.dept_id);
  1179. this.deptVisibleName += element.dept_name;
  1180. if (data.dept.length - index > 1) {
  1181. this.deptVisibleName += ',';
  1182. }
  1183. });
  1184. }
  1185. this.asstabParams.page = 1;
  1186. this.asstabParams.dept_ids = JSON.stringify(this.deptList_id);
  1187. this.assDelList();
  1188. },
  1189. assDetClick(row) {
  1190. //列表点击
  1191. this.$router.push({
  1192. path: '/staffAssDet',
  1193. query: { assID: this.asstabParams.package_id, employeeID: row.id, employeeIDs: row.employee_id }
  1194. });
  1195. },
  1196. braSearch(data) {
  1197. //评分搜索
  1198. this.scoreGroup = this.GroupList.filter(item => item.name.includes(data));
  1199. }
  1200. },
  1201. beforeRouteLeave(to, from, next) {
  1202. if (to.name != 'staffAssDet') {
  1203. localStorage.removeItem('assessDetails');
  1204. }
  1205. next();
  1206. }
  1207. };
  1208. </script>
  1209. <style scoped lang="scss">
  1210. /* 归档图片动画 */
  1211. .guidang {
  1212. margin-left: auto;
  1213. width: 70px;
  1214. animation: example 1s;
  1215. }
  1216. @keyframes example {
  1217. from {
  1218. transform: scale(1.4);
  1219. }
  1220. to {
  1221. transform: scale(1);
  1222. }
  1223. }
  1224. /* 归档图片动画 */
  1225. .all {
  1226. position: relative;
  1227. font-size: 14px;
  1228. background-color: #fff;
  1229. padding: 10px 20px;
  1230. box-sizing: border-box;
  1231. }
  1232. .navsvg1 {
  1233. font-size: 15px;
  1234. position: relative;
  1235. margin-top: 2px;
  1236. }
  1237. .navsvg2 {
  1238. width: 4px;
  1239. height: 20px;
  1240. background-color: #e1e1e1;
  1241. margin: -20px 30px 0 30px;
  1242. }
  1243. .navsvg3 {
  1244. margin: -20px 20px 0 20px;
  1245. color: #e1e1e1;
  1246. display: block;
  1247. font-size: 18px;
  1248. }
  1249. header {
  1250. margin-top: 15px;
  1251. .dept_wdiv {
  1252. width: 200px;
  1253. position: relative;
  1254. .dept_inp {
  1255. width: 100%;
  1256. height: 38px;
  1257. position: absolute;
  1258. top: 0;
  1259. right: 0;
  1260. left: 0;
  1261. bottom: 0;
  1262. z-index: 9;
  1263. border: 1px solid #e0e0e0;
  1264. border-radius: 3px;
  1265. line-height: 32px;
  1266. font-size: 12px;
  1267. padding: 0 10px;
  1268. overflow: hidden;
  1269. white-space: nowrap;
  1270. text-overflow: ellipsis;
  1271. cursor: pointer;
  1272. color: #676767;
  1273. }
  1274. i {
  1275. position: absolute;
  1276. top: 0;
  1277. right: 0;
  1278. top: 10px;
  1279. right: 10px;
  1280. font-size: 14px;
  1281. color: #b5b5b5;
  1282. }
  1283. }
  1284. .navigationL {
  1285. width: 100%;
  1286. margin: 30px 0;
  1287. span {
  1288. display: flex;
  1289. cursor: pointer;
  1290. font-size: 14px;
  1291. width: 180px;
  1292. height: 60px;
  1293. position: relative;
  1294. border-radius: 3px;
  1295. align-items: center;
  1296. justify-content: center;
  1297. color: #303133;
  1298. background-color: #ecf5ff;
  1299. margin-bottom: 20px;
  1300. }
  1301. span:hover {
  1302. color: #428eff;
  1303. border: 1px solid #409EFF;
  1304. background-color: #ecf5ff;
  1305. }
  1306. /deep/ .action {
  1307. color: #428eff;
  1308. border: 1px solid #409EFF;
  1309. background-color: #ecf5ff;
  1310. }
  1311. }
  1312. /deep/ .el-table tr:hover {
  1313. cursor: pointer;
  1314. }
  1315. }
  1316. .braTab {
  1317. padding: 20px 0 0 20px;
  1318. /deep/ .el-table tr:hover {
  1319. cursor: pointer;
  1320. }
  1321. /deep/ .el-table__row {
  1322. .cell {
  1323. padding-left: 10px;
  1324. }
  1325. }
  1326. /deep/ td .cell {
  1327. padding: 10px 0;
  1328. }
  1329. }
  1330. .margin-l {
  1331. margin-left: 10px;
  1332. }
  1333. .width-300 {
  1334. width: 300px;
  1335. }
  1336. .m-content {}
  1337. .m-title {
  1338. color: #909399;
  1339. }
  1340. .ul {
  1341. margin: 20px 0;
  1342. margin-top: 0;
  1343. }
  1344. .li {
  1345. border-bottom: 1px solid #ebebeb;
  1346. }
  1347. .li .flex-box-ce {
  1348. padding: 15px 0;
  1349. }
  1350. .li:hover {
  1351. background-color: #f5f7fa;
  1352. }
  1353. </style>