staffAssDet.vue 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528
  1. <template>
  2. <div class="all boxMinHeight">
  3. <template v-if="isDetails">
  4. <PageHead phName="员工绩效详情"></PageHead>
  5. <div class="flex-box-ce" style="position: absolute;right: 20px;top: 20px;z-index: 2;">
  6. <el-select v-model="headvalue" style="width: 250px;" placeholder="请选择" v-if="!isDisabled">
  7. <el-option v-for="item in headoptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
  8. </el-select>
  9. <div v-else class="fontColorB font-flex-word" style="width: 250px;">{{packageName}}</div>
  10. </div>
  11. <header v-loading="staffLoad">
  12. <div class="flex-box-ce head">
  13. <div class="flex-box-ce head2User flex-1">
  14. <userImage class="fl" :id="remployee.id" :user_name="remployee.name" :img_url="remployee.img_url" width="50px" height="50px"></userImage>
  15. <div class="headTname">
  16. <div style="">{{ remployee.name }}</div>
  17. <span v-for="(item, index) in remployee.employee_detail.dept_list" :key="index" v-if="remployee.employee_detail.dept_list.length>0">
  18. <span>{{ item.dept_name }}</span>
  19. <span v-if="remployee.employee_detail.dept_list.length - index > 1">,</span>
  20. </span>
  21. </div>
  22. <img v-if="has_finish" src="static/images/guidang.png" class="guidang">
  23. </div>
  24. <template v-if="!gradeBegin">
  25. <div class="button-width" v-if="!has_finish">
  26. <!-- 撤销上一次操作 -->
  27. <template v-if="revocationShow">
  28. <el-button @click="isShowCx=true" type="primary">撤销上一次操作</el-button>
  29. </template>
  30. <!-- 目标制定节点 -->
  31. <template v-if="isShowTargetBtn">
  32. <el-button @click="openFormulate()" type="primary">制定目标</el-button>
  33. <el-button @click="submit()" type="primary">提交</el-button>
  34. </template>
  35. <!-- 目标确认 -->
  36. <template v-if="isShowConfirmBtn">
  37. <el-button type="primary" @click="gradeOk">同意</el-button>
  38. <el-button class="red" type="danger" plain @click="gradeTurn" style="margin-left: -2px;background-color: #fff;">驳回</el-button>
  39. <el-button v-if="isUpdateIndex" @click="openFormulate()" >修改目标</el-button>
  40. </template>
  41. <!-- 录入结果值 -->
  42. <el-button v-if="resultButShow" @click="openResult()" type="primary">{{resultStr}}</el-button>
  43. <!-- 审批 -->
  44. <template v-if="examineButShow">
  45. <el-button type="primary" @click="gradeOk">同意</el-button>
  46. <el-button class="red" type="danger" plain v-if="isAction" @click="gradeTurn"style="margin-left: -2px;background-color: #fff;">驳回</el-button>
  47. </template>
  48. <!-- 评分 -->
  49. <el-button v-if="gradeButShow" type="primary" @click="gradeClick">评分</el-button>
  50. <el-button v-if="recordsManagement" @click="isTrack = true">管理记录</el-button>
  51. <el-button v-if="actionButShow" @click="isPlan = true">执行计划</el-button>
  52. <el-button v-if="feedbackBut" @click="communication = true">沟通反馈</el-button>
  53. <!-- 主次管理员,被考核人上级 -->
  54. <template v-if="$getRole(1)||isSj">
  55. <el-dropdown style="margin-left:10px;" @command="handleCommand">
  56. <el-button>管理</el-button>
  57. <el-dropdown-menu slot="dropdown">
  58. <el-dropdown-item v-for="(item, index) in dropdownMenu" :key="index" :command="item.key" :divided="item.bordok" v-if="item.isShow">
  59. {{ item.name }}
  60. </el-dropdown-item>
  61. </el-dropdown-menu>
  62. </el-dropdown>
  63. </template>
  64. </div>
  65. </template>
  66. </div>
  67. <!-- 流程 -->
  68. <div class="flex-box-ce flex-d-wrap">
  69. <div v-for="(item, index) in flow" :key="index"
  70. :class="[item.status == 1 ? 'flow-item-color' : '', index == 0 ? 'flow-item-start' : 'flow-item']"
  71. class="flex-box-ce"
  72. >
  73. <el-tooltip effect="dark" :content="item.code == 'execution' ? execution : item.remarks" placement="top">
  74. <span class="flow-box">
  75. <span>{{ index + 1 }}.{{ item.remark }}</span>
  76. <span v-if="item.code == 'execution'">
  77. <i class="el-icon-warning-outline"></i>
  78. :
  79. </span>
  80. <template v-if="item.target.length > 0">
  81. <span v-for="(item2, index2) in item.target" :key="index2">
  82. {{ item2.employee_name }}
  83. <span v-if="item.target.length - index2 > 1">,</span>
  84. </span>
  85. </template>
  86. </span>
  87. </el-tooltip>
  88. <i class="el-icon-success blue" v-if="item.status == 2" style="margin-right:10px;"></i>
  89. <div @click.stop="processDet(item)" style="width: 20px;" class="dian" v-if="item.target.length > 0&& !gradeBegin">
  90. <i class="el-icon-more detailsPonit"></i>
  91. </div>
  92. <img src="static/images/jt.png" class="flow-img" v-if="index!=(flow.length-1)||flow[flow.length - 1].status == 2">
  93. </div>
  94. <template v-if="flow.length > 0">
  95. <div class="flow-item flex-box-ce flex-center-center" v-if="flow[flow.length - 1].status == 2">
  96. <span class="flex-1">{{ flow.length + 1 }}.结束</span>
  97. <i class="el-icon-success blue" style="margin-right:10px;"></i>
  98. </div>
  99. </template>
  100. </div>
  101. <!-- 考核结果 -->
  102. <div class="flex-box-end flex-v-ce" style="margin-top: 20px;">
  103. <template v-if="dimension.length>0">
  104. <div class="flex-box-ce result" v-if="dimension[0].final_point" style="margin-right: 20px;">
  105. <span style="padding-right: 20px;">考核结果分数:{{dimension[0].final_point}}分</span>
  106. <span>等级:{{dimension[0].final_level}}</span>
  107. </div>
  108. </template>
  109. <el-tooltip placement="bottom">
  110. <div class="popover-box" slot="content">
  111. <div class="popover-title">开启显示更多可浏览全部考核内容</div>
  112. <div class="popover-content">点击右边箭头和滑动下方滚动条都可以查看更多内容</div>
  113. </div>
  114. <el-switch
  115. v-model="isShowOneselfScore"
  116. active-text="显示更多">
  117. </el-switch>
  118. </el-tooltip>
  119. </div>
  120. <!-- 表格 -->
  121. <div class="dimensionCla" v-loading="tableLoad">
  122. <!-- 点击滚动 -->
  123. <TableBox :tableData="dimension" :isShowYd="isShowOneselfScore" :headerCellStyle="{ background: '#ECF5FF', textAlign: 'center' }" :objectSpanMethod="objectSpanMethod">
  124. <el-table-column prop="theDimension" width="80" label="维度" align="center">
  125. <template slot-scope="scope">
  126. <span style="width: 13px;display: inline-block;">{{ scope.row.theDimension }}</span>
  127. <template v-if="calc_dimension&&(scope.row.type == 1||scope.row.type == 2)">
  128. <div v-if="!scope.row.toScore">({{ scope.row.dimension_weight }}%)</div>
  129. </template>
  130. </template>
  131. </el-table-column>
  132. <el-table-column prop="name" label="指标名称" min-width="220">
  133. <template slot-scope="scope">
  134. <!-- <template v-if="Number(scope.row.weight) > 0">
  135. <PreBox :value="scope.row.name+'(权重:'+scope.row.weight+'%)'"></PreBox>
  136. </template> -->
  137. <PreBox :value="scope.row.name"></PreBox>
  138. </template>
  139. </el-table-column>
  140. <el-table-column prop="name" label="权重" align="center" width="60">
  141. <template slot-scope="scope">
  142. <span v-if="Number(scope.row.weight) > 0">{{scope.row.weight}}%</span>
  143. <span v-else>--</span>
  144. </template>
  145. </el-table-column>
  146. <template v-if="isShowOneselfScore">
  147. <el-table-column prop="type" label="指标类型">
  148. <template slot-scope="scope">
  149. <span v-if="scope.row.type == 1">量化指标</span>
  150. <span v-if="scope.row.type == 2">非量化指标</span>
  151. <span v-if="scope.row.type == 3">额外加分项</span>
  152. <span v-if="scope.row.type == 4">额外扣分项</span>
  153. </template>
  154. </el-table-column>
  155. </template>
  156. <el-table-column prop="target" label="目标值" align="left" min-width="150" v-if="getTableItem('target')">
  157. <template slot-scope="scope">
  158. <div v-if="scope.row.target != '-' && scope.row.target != undefined&&scope.row.target!='0'">
  159. 目标值:
  160. <span>{{ scope.row.target + '' + scope.row.unit }}</span>
  161. </div>
  162. <span v-else>-</span>
  163. <div v-if="scope.row.result !== null&&scope.row.result !== ''&&scope.row.result !== undefined" class="orange">
  164. <template v-if="scope.row.type==1">
  165. 结果值: <span>{{ scope.row.result + '' + scope.row.unit }}</span><span v-if="scope.row.resultUserName">({{scope.row.resultUserName}})</span>
  166. </template>
  167. <!-- <template v-if="scope.row.result_file">
  168. <div v-if="scope.row.result_file.images.length>0">
  169. <div style="margin-bottom: 3px;cursor: pointer;" class="blue" v-for="(item, index) in scope.row.result_file.images" :key="index" @click="onFilePreView(item)">{{ item.name }}</div>
  170. </div>
  171. <div v-if="scope.row.result_file.append.length>0">
  172. <div style="margin-bottom: 3px;cursor: pointer;" class="blue" v-for="(item, index) in scope.row.result_file.append" :key="index" @click="onFilePreView2(item)">{{ item.name }}</div>
  173. </div>
  174. </template> -->
  175. </div>
  176. <span v-else>-</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column prop="target" label="附件" align="left" min-width="150" v-if="getTableItem('result_file')">
  180. <template slot-scope="scope" v-if="scope.row.result_file">
  181. <div v-if="scope.row.result_file.images.length>0">
  182. <div style="margin-bottom: 3px;cursor: pointer;" class="blue" v-for="(item, index) in scope.row.result_file.images" :key="index" @click="onFilePreView(item)">{{ item.name }}</div>
  183. </div>
  184. <div v-if="scope.row.result_file.append.length>0">
  185. <div style="margin-bottom: 3px;cursor: pointer;" class="blue" v-for="(item, index) in scope.row.result_file.append" :key="index" @click="onFilePreView2(item)">{{ item.name }}</div>
  186. </div>
  187. </template>
  188. </el-table-column>
  189. <template v-if="isShowOneselfScore">
  190. <el-table-column prop="point_limit" label="加扣分上限" align="center" width="100" v-if="getTableItem('point_limit')"></el-table-column>
  191. </template>
  192. <el-table-column prop="per_remark" label="考核标准" min-width="200" v-if="getTableItem('per_remark')">
  193. <template slot-scope="scope">
  194. <PreBox :value="scope.row.per_remark"></PreBox>
  195. </template>
  196. </el-table-column>
  197. <el-table-column prop="remark" label="备注" min-width="200" v-if="isShowOneselfScore">
  198. <template slot-scope="scope">
  199. <PreBox :value="scope.row.remark"></PreBox>
  200. </template>
  201. </el-table-column>
  202. <el-table-column prop="schedule" label="执行计划" align="center" min-width="200" v-if="getTableItem('schedule')">
  203. <template slot-scope="scope">
  204. <div class="flex-box-ce" v-if="scope.row.schedule && scope.row.schedule.length > 0">
  205. <el-button type="text" class="flex-1" @click="openPlan(scope.row.planIndex)">({{ scope.row.schedule.length }}) 条执行计划</el-button>
  206. </div>
  207. <span v-else>-</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column prop="mamage_record" label="跟踪管理记录" align="center" min-width="200" v-if="getTableItem('mamage_record')">
  211. <template slot-scope="scope">
  212. <div class="flex-box-ce" v-if="scope.row.mamage_record && scope.row.mamage_record.length > 0">
  213. <el-button type="text" class="flex-1" @click="openTrack(scope.row.planIndex)">({{ scope.row.mamage_record.length }}) 条管理记录</el-button>
  214. </div>
  215. <span v-else>-</span>
  216. </template>
  217. </el-table-column>
  218. <el-table-column v-for="(item, index) in lingScore_infos" :key="index" min-width="200" v-if="(item.poiSco || item.poicom)&&isShowOneself(item)">
  219. <template slot="header" slot-scope="scope">
  220. <el-tooltip effect="dark" :content="item.title" placement="top">
  221. <span>
  222. <div class="font-flex-word">{{ item.title }}</div>
  223. </span>
  224. </el-tooltip>
  225. </template>
  226. <el-table-column prop="title" min-width="100" v-if="item.poiSco">
  227. <template slot="header" slot-scope="scope">
  228. <span>评分</span>
  229. </template>
  230. <template slot-scope="scope">
  231. <div v-for="(arr, att) in scope.row.score_infos" :key="att">
  232. <div v-if="arr.newKey == item.newKey">
  233. <span v-if="arr.employee_id == item.employee_id">{{ initData(arr.point) }} <span class="blue">{{arr.level}}</span></span>
  234. <span v-else>-</span>
  235. </div>
  236. </div>
  237. <span v-if="scope.row.score_infos ? scope.row.score_infos.length == 0 : ''">-</span>
  238. <!-- 总分分数 -->
  239. <span v-if="scope.row.toScore">{{ item.totalScore }}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column prop="title" min-width="100" v-if="item.poicom">
  243. <template slot="header" slot-scope="scope">
  244. <span>说明</span>
  245. </template>
  246. <template slot-scope="scope">
  247. <div v-for="(arr, att) in scope.row.score_infos" :key="att">
  248. <div v-if="arr.newKey == item.newKey">
  249. <span v-if="arr.employee_id == item.employee_id">
  250. <PreBox :value="initData(arr.remark)"></PreBox>
  251. </span>
  252. <span v-else>-</span>
  253. </div>
  254. </div>
  255. <span v-if="scope.row.score_infos ? scope.row.score_infos.length == 0 : ''">-</span>
  256. <span v-if="scope.row.toScore">
  257. <PreBox :value="item.comment"></PreBox>
  258. </span>
  259. </template>
  260. </el-table-column>
  261. </el-table-column>
  262. <!-- 输入框 -->
  263. <template v-if="gradeBegin">
  264. <!-- 评分输入 -->
  265. <el-table-column min-width="250" fixed="right">
  266. <template slot="header" slot-scope="scope">
  267. <div>{{ scoreTab.title }}</div>
  268. </template>
  269. <template slot-scope="scope">
  270. <el-popover placement="top" v-if="scope.row.auto_score===0||scope.row.auto_score" width="400" trigger="hover">
  271. <div style="padding: 10px;padding-top: 0;">
  272. <div class="flex-box-ce">
  273. <div class="flex-1">按以下公式和数据自动计算评分</div>
  274. </div>
  275. <div v-html="scope.row.expressionStr" style="background-color: #f1f1f1;padding: 10px;text-align: left;border-radius: 5px;cursor: pointer;"></div>
  276. <div class="flex-box-ce">
  277. <div class="orange" style="margin-right: 20px;">结果值:{{scope.row.result}}</div>
  278. <div class="orange">目标值:{{scope.row.target}}</div>
  279. </div>
  280. </div>
  281. <div slot="reference">系统评分<i class="el-icon-warning"></i>:<span class="blue">{{scope.row.auto_score}}</span></div>
  282. </el-popover>
  283. <div v-if="thecurrentFlow == 'score_supervisor'">
  284. <!-- 评指标分 -->
  285. <el-input
  286. v-if="ruleScore == 1 && !scope.row.totalScore"
  287. :rows="1"
  288. @blur="sgradeBlur(scope.$index)"
  289. @input="[sgradeInp(scope.$index,scope.row), (scope.row.score_grade = scope.row.score_grade.match(/\d+(\.\d{0,2})?/) ? scope.row.score_grade.match(/\d+(\.\d{0,2})?/)[0] : '')]"
  290. v-model="scope.row.score_grade"
  291. placeholder="请输入"
  292. ></el-input>
  293. <span v-else-if="ruleScore == 1 && scope.row.totalScore">{{ tabTotaScore }}</span>
  294. <!-- 评总分 -->
  295. <el-input
  296. v-else-if="ruleScore == 2 && scope.row.totalScore"
  297. :rows="1"
  298. @input="[sgradeInp(scope.$index,scope.row), (scope.row.score_grade = scope.row.score_grade.match(/\d+(\.\d{0,2})?/) ? scope.row.score_grade.match(/\d+(\.\d{0,2})?/)[0] : '')]"
  299. v-model="scope.row.score_grade"
  300. placeholder="请输入"
  301. ></el-input>
  302. <span v-else>-</span>
  303. </div>
  304. <div v-else>
  305. <span v-if="scope.row.totalScore">{{ tabTotaScore }}</span>
  306. <el-input v-else :rows="1" @blur="sgradeBlur(scope.$index)"
  307. @input="[sgradeInp(scope.$index,scope.row), (scope.row.score_grade = scope.row.score_grade.match(/\d+(\.\d{0,2})?/) ? scope.row.score_grade.match(/\d+(\.\d{0,2})?/)[0] : '')]"
  308. v-model="scope.row.score_grade" placeholder="请输入"
  309. ></el-input>
  310. </div>
  311. </template>
  312. </el-table-column>
  313. <!-- 说明 -->
  314. <el-table-column min-width="150" fixed="right">
  315. <template slot="header" slot-scope="scope">
  316. <div>{{ scoreTab.explain }}</div>
  317. </template>
  318. <template slot-scope="scope">
  319. <div style="cursor: pointer;">
  320. <!-- 指标评分说明 -->
  321. <template v-if="ruleScore == 1 && !scope.row.totalScore">
  322. <div @click="showPf(scope.$index,1)">
  323. <PreBox :value="scope.row.score_remark" v-if="scope.row.score_remark"></PreBox>
  324. <div v-else class="shuru">请输入</div>
  325. </div>
  326. </template>
  327. <!-- 总分说明 -->
  328. <template v-if="ruleScore == 2 && scope.row.totalScore">
  329. <div @click="showPf(scope.$index,2)">
  330. <PreBox :value="scope.row.total_score_comment" v-if="scope.row.total_score_comment"></PreBox>
  331. <div v-else class="shuru">请输入</div>
  332. </div>
  333. </template>
  334. </div>
  335. </template>
  336. </el-table-column>
  337. </template>
  338. </TableBox>
  339. </div>
  340. <Record :record="record"></Record>
  341. </header>
  342. <footer class="footer flex-box-end" v-if="gradeBegin">
  343. <el-button @click="cancel">取消</el-button>
  344. <el-button class="primaryBtn" @click="save(0)">暂存</el-button>
  345. <el-button type="primary" @click="save(1)">提交评分</el-button>
  346. </footer>
  347. </template>
  348. <resultSetAll2 v-else :peIds="resultData.peIds" :packageName="resultData.packageName"></resultSetAll2>
  349. <!-- 上一个 下一个 -->
  350. <div class="upDown-box" v-if="isDisabled&& !gradeBegin">
  351. <div class="flex-box-ce flex-center-center fontColorB" style="height: 60px;">
  352. <div class="flex-1 orange" v-if="!up.employeeID" style="text-align: center;border-right: 1px solid #f1f1f1;">已无待办</div>
  353. <div class="flex-1 flex-box-ce flex-center-center up-item" v-else style="border-right: 1px solid #f1f1f1;" @click="qieh(1)">
  354. <userImage :user_name="up.name" :img_url="up.img_url" width="40px" height="40px" fontSize="12"></userImage>
  355. <div class="upName font-flex-word">{{up.name}}</div>
  356. <div>上一个</div>
  357. </div>
  358. <div class="flex-1 orange" v-if="!down.employeeID" style="text-align: center;">已无待办</div>
  359. <div class="flex-1 flex-box-ce flex-center-center up-item" v-else @click="qieh(2)">
  360. <div>下一个</div>
  361. <div class="upName font-flex-word">{{down.name}}</div>
  362. <userImage :user_name="down.name" :img_url="down.img_url" width="40px" height="40px" fontSize="12"></userImage>
  363. </div>
  364. </div>
  365. </div>
  366. <!-- 流程详情 -->
  367. <BrawerBox :drawerTitle="processDel.remarkDel + proNum" :footNo="false" :showDrawer.sync="isChecks">
  368. <template slot="main">
  369. <div class="processSty">
  370. <div v-for="(item, index) in processDel.target" :key="index" class="flex-box flex-d-center proListSty">
  371. <div style="width:230px;" class="flex-box flex-d-center flex-h-ce">
  372. <div>
  373. <userImage class="fl" :id="item.employee_id" :user_name="item.employee_name" width="30px" height="30px" fontSize="12"></userImage>
  374. <span class="proName">{{ item.employee_name }}</span>
  375. </div>
  376. <el-tag v-if="processDel.status == 0" size="mini" type="warning" color="#ffe7d3" style="color:#ff8d00;">流程未到</el-tag>
  377. <!-- 针对任一人处理了,其他人显示无需处理 -->
  378. <template v-else-if="item.status == 1">
  379. <template v-if="(processDel.multi_executor==2)&&getStrus()">
  380. <el-tag size="mini">无需处理</el-tag>
  381. </template>
  382. <template v-else>
  383. <el-tag size="mini">处理中</el-tag>
  384. </template>
  385. </template>
  386. <el-tag v-else-if="item.status == 2" size="mini" type="success">已处理</el-tag>
  387. </div>
  388. <!-- 主子管理员 并且当前节点里包括登录者-->
  389. <template v-if="$getRole(1)||item.employee_id==userInfo.id">
  390. <template v-if="processDel.code=='score_supervisor'||processDel.code=='special_scorer'">
  391. <!-- 指定评分人节点 -->
  392. <template v-if="processDel.code=='score_supervisor'">
  393. <el-button v-if="transferBut && item.status == 1&& (processDel.transfer||$getRole(1))" class="proButt" @click="careOf(item)">转交</el-button>
  394. </template>
  395. <!-- 特定指标指定评分人,因为默认是可以转交的,所有没有 transfer 字段 -->
  396. <template v-else>
  397. <el-button v-if="transferBut && item.status == 1" class="proButt" @click="careOf(item)">转交</el-button>
  398. </template>
  399. </template>
  400. <template v-else-if="processDel.code=='review'||processDel.code=='confirm'">
  401. <el-button v-if="transferBut && item.status == 1&& ((processDel.action.indexOf('transfer')>=0)||$getRole(1))" class="proButt" @click="careOf(item)">转交</el-button>
  402. </template>
  403. <template v-else>
  404. <el-button v-if="transferBut && item.status == 1" class="proButt" @click="careOf(item)">转交</el-button>
  405. </template>
  406. </template>
  407. </div>
  408. </div>
  409. </template>
  410. </BrawerBox>
  411. <!-- 审批同意 -->
  412. <el-dialog title="意见说明" :visible.sync="examineConsent" width="500px" :close-on-click-modal="false">
  413. <el-input type="textarea" v-model="tDownList.comment" rows="4" placeholder="请输入意见说明(选填)"></el-input>
  414. <span slot="footer" class="dialog-footer">
  415. <el-button @click="tDlose(1)">取 消</el-button>
  416. <el-button type="primary" @click="tDownOk(1)">确 定</el-button>
  417. </span>
  418. </el-dialog>
  419. <!--驳回评分 -->
  420. <BrawerBox drawerTitle="驳回评分" :showDrawer.sync="turnDown">
  421. <template slot="main">
  422. <el-form label-position="top" label-width="80px" :rules="rFlowRules" :model="tDownList" ref="tDownList" class="elFrom-margin">
  423. <el-form-item label="重置到" prop="node_id">
  424. <el-select v-model="tDownList.node_id" clearable placeholder="请选择阶段" style="width:100%;">
  425. <el-option v-for="item in rFlowArrive" :key="item.value" :label="item.label" :value="item.value"></el-option>
  426. </el-select>
  427. <el-select v-if="rUsers.length > 0" multiple v-model="tDownList.employee_id" clearable placeholder="请选择重置人员" style="width:100%;margin-top: 10px;">
  428. <el-option v-for="item in rUsers" :key="item.value" :label="item.label" :value="item.value"></el-option>
  429. </el-select>
  430. </el-form-item>
  431. <el-form-item label="驳回说明" :required="true">
  432. <el-input type="textarea" rows="7" placeholder="请输入驳回意见(必填)" v-model="tDownList.comment"></el-input>
  433. </el-form-item>
  434. </el-form>
  435. </template>
  436. <template slot="footer">
  437. <el-button plain size="" @click="tDlose(0)">取消</el-button>
  438. <el-button type="primary" @click="tDownOk(0, 'tDownList')">确认</el-button>
  439. </template>
  440. </BrawerBox>
  441. <!-- 重置流程 -->
  442. <BrawerBox drawerTitle="重置流程" :showDrawer.sync="resetFlow">
  443. <template slot="main">
  444. <el-form label-position="top" :rules="rFlowRules" :model="rFlowList" ref="rFlowList" label-width="80px" class="elFrom-margin">
  445. <el-form-item label="操作">
  446. <el-radio-group v-model="rFlowList.type">
  447. <el-radio :label="1">重置到指定节点</el-radio>
  448. <el-radio :label="2">重新读取考核模板设置</el-radio>
  449. </el-radio-group>
  450. </el-form-item>
  451. <el-form-item label="指标处理" v-if="rFlowList.type == 2">
  452. <el-radio-group v-model="rFlowList.overwrite_mode">
  453. <el-radio :label="2">保留已制定指标</el-radio>
  454. <el-radio :label="1">重置指标</el-radio>
  455. </el-radio-group>
  456. </el-form-item>
  457. <el-form-item label="重置到" prop="node_id" v-if="rFlowList.type == 1">
  458. <el-select v-model="rFlowList.node_id" clearable placeholder="请选择阶段" style="width:100%;">
  459. <el-option v-for="item in rFlowArrive" :key="item.value" :label="item.label" :value="item.value"></el-option>
  460. </el-select>
  461. <el-select v-if="rUsers.length > 0" multiple v-model="rFlowList.employee_id" clearable placeholder="请选择重置人员" style="width:100%;margin-top: 10px;">
  462. <el-option v-for="item in rUsers" :key="item.value" :label="item.label" :value="item.value"></el-option>
  463. </el-select>
  464. </el-form-item>
  465. <el-form-item label="重置说明" prop="comment">
  466. <el-input type="textarea" rows="6" placeholder="请输入重置说明(必填)" v-model="rFlowList.comment" maxlength="200" show-word-limit></el-input>
  467. </el-form-item>
  468. </el-form>
  469. </template>
  470. <template slot="footer">
  471. <el-button plain @click="resetFlow = false">取消</el-button>
  472. <el-button type="primary" @click="rFlowOk('rFlowList')">确认</el-button>
  473. </template>
  474. </BrawerBox>
  475. <!-- 跟踪管理 -->
  476. <TrackManagement :showDrawer.sync="isTrack" :isCz="!isCzData" :recordMemberIds="recordMemberIds" :id="employeeID" :apList="apList" :assessId="employID" @confirm="employeeDet" :planIndex="planIndex"></TrackManagement>
  477. <!-- 执行计划 -->
  478. <ActionPlan :showDrawer.sync="isPlan" :isCz="!isCzData" :id="employeeID" :apList="apList" :assessId="employID" @confirm="employeeDet" :planIndex="planIndex"></ActionPlan>
  479. <!-- 沟通反馈 -->
  480. <BrawerBox drawerTitle="沟通反馈" :showDrawer.sync="communication">
  481. <template slot="main">
  482. <el-input type="textarea" v-model="communicationVal" rows="10" placeholder="请输入反馈内容(必填)" maxlength="300" show-word-limit></el-input>
  483. <div class="aite" @click="selectUser = true">@</div>
  484. <el-tag style="margin: 0 5px;" v-for="(tag, index) in tags" :key="tag.id" closable @close="handleClose(tag, index)">{{ tag.name }}</el-tag>
  485. </template>
  486. <template slot="footer">
  487. <span class="dialog-footer">
  488. <el-button @click="communication = false">取 消</el-button>
  489. <el-button type="primary" @click="saveCommunication()">确 定</el-button>
  490. </span>
  491. </template>
  492. </BrawerBox>
  493. <!-- 沟通反馈 -->
  494. <EmployeeSelector title="选择@人员" :is_filtration_creator="false" :visible.sync="selectUser" @confirm="confirmCreator" />
  495. <!-- 转交 -->
  496. <EmployeeSelector title="选择人员" :is_filtration_creator="false" :multi="false" :isChecKedAll="false" :visible.sync="careOfSelector" @confirm="confirmcareOf" />
  497. <!-- 评分说明 -->
  498. <el-dialog title="评分说明" :visible.sync="isShowPf" width="500px" :close-on-click-modal="false">
  499. <el-input type="textarea" v-model="pfText" rows="4" placeholder="请输入评分说明" maxlength="100" show-word-limit></el-input>
  500. <span slot="footer" class="dialog-footer">
  501. <el-button @click="isShowPf=false">取 消</el-button>
  502. <el-button type="primary" @click="updateText()">确 定</el-button>
  503. </span>
  504. </el-dialog>
  505. <!-- 撤销操作 -->
  506. <el-dialog title="撤销" :visible.sync="isShowCx" width="500px" :close-on-click-modal="false">
  507. <el-input type="textarea" v-model="cxText" rows="4" placeholder="请输入撤销理由" maxlength="200" show-word-limit></el-input>
  508. <span slot="footer" class="dialog-footer">
  509. <el-button @click="isShowCx=false">取 消</el-button>
  510. <el-button type="primary" @click="revocation()">确 定</el-button>
  511. </span>
  512. </el-dialog>
  513. <!-- 调整目标反馈 -->
  514. <el-dialog title="调整目标" :visible.sync="isAdjustment" :close-on-click-modal="false" width="700px">
  515. <div>
  516. <el-radio-group v-model="radio">
  517. <div class="flex-box-v">
  518. <el-radio :label="1" style="margin-bottom: 30px;">仅修改指标内容,不重置考核流程
  519. <br/> <span style="font-size: 12px;color: #C0C4CF;padding-left: 25px;padding-top: 5px;">不影响进行中的考核流程,只对指标内容和信息进行修改</span>
  520. </el-radio>
  521. <el-radio :label="2">修改指标,并重置考核流程
  522. <br/> <span style="font-size: 12px;color: #C0C4CF;padding-left: 25px;">修改指标并按照新的流程来进行考核,已评分和已审批的记录也会被重置</span>
  523. </el-radio>>
  524. </div>
  525. </el-radio-group>
  526. </div>
  527. <span slot="footer">
  528. <el-button @click="isAdjustment = false">取消</el-button>
  529. <el-button type="primary" @click="setDataAccess">确定</el-button>
  530. </span>
  531. </el-dialog>
  532. <!-- 评分确认 -->
  533. <el-dialog title="请确认您的评分" :visible.sync="isPoint" :close-on-click-modal="false" width="700px">
  534. <div>
  535. <el-table :data="pointList" :header-cell-style="{ background: '#ECF5FF' }" border>
  536. <el-table-column prop="name" min-width="150" label="指标">
  537. <template slot="header" slot-scope="scope">
  538. <span>指标(<span style="color:#ff9600;">每项指标评分</span>)</span>
  539. </template>
  540. </el-table-column>
  541. <!-- <el-table-column prop="score_remark" label="评分说明"></el-table-column> -->
  542. <el-table-column prop="score" label="评分" align="left"></el-table-column>
  543. </el-table>
  544. </div>
  545. <span slot="footer">
  546. <el-button @click="isPoint = false">返回修改</el-button>
  547. <el-button type="primary" @click="score">确定</el-button>
  548. </span>
  549. </el-dialog>
  550. <el-dialog title="图片查看" :visible.sync="isShowImg" width="50%" >
  551. <img :src="imgUrl" style="width: 100%;">
  552. <span slot="footer" class="dialog-footer">
  553. <el-button @click="isShowImg = false">取 消</el-button>
  554. <el-button type="primary" @click="isShowImg = false">确 定</el-button>
  555. </span>
  556. </el-dialog>
  557. </div>
  558. </template>
  559. <script>
  560. import BrawerBox from '@/performance/components/public/BrawerBox';
  561. import PageHead from '@/components/PageHead'; //头部---返回
  562. import Record from '@/performance/components/public/Record';
  563. import ActionPlan from '@/performance/components/public/ActionPlan';
  564. import TableBox from '@/performance/components/public/TableBox';
  565. import TrackManagement from '@/performance/components/public/TrackManagement';
  566. import EmployeeSelector from '@/components/EmployeeSelector';
  567. import resultSetAll2 from '@/performance/views/myPerformance/resultSetAll2';
  568. import {getExpressionStr} from '@/performance/utils/auth'
  569. export default {
  570. name: 'staffAssDet',
  571. components: {
  572. PageHead,
  573. BrawerBox,
  574. Record,
  575. ActionPlan,
  576. TableBox,
  577. TrackManagement,
  578. EmployeeSelector,
  579. resultSetAll2
  580. },
  581. data() {
  582. return {
  583. radio: 1,
  584. isAdjustment:false,
  585. isDetails:true,//是否显示考核详情页面
  586. resultData:{},
  587. gradeList: [],
  588. dropdownMenu: [{ key: 'a', name: '重置流程',isShow:true }, { key: 'b', name: '调整目标',isShow:true }],
  589. lingScore_infos: [],
  590. staffLoad: false, //loading
  591. tableLoad: false, //loading
  592. execution: '目标制定并确认完毕后,进入到【执行中】阶段,期间员工执行计划,上级跟踪过程。进入结果数据收集和评分阶段',
  593. isChecks: false, //侧边弹窗
  594. headvalue: '',
  595. headoptions: [],
  596. employeeID: 0, //考核记录ID
  597. employID: 0, //当前角色ID
  598. empDetList: {},
  599. remployee: {employee_detail:{}}, //被考核人员信息
  600. flow: [], //步骤
  601. atPresentFlow: 0, //当前步骤ID
  602. dimension: [], //维度表格信息
  603. config: {}, //配置
  604. tableData: [],
  605. communication: false, //沟通
  606. communicationVal: '',
  607. tags: [], //沟通@人员
  608. selectUser: false,
  609. nowFLow: '', //当前的流程
  610. turnDown: false, //驳回开关
  611. tDownArrive: [], //驳回到--数据
  612. tDownList: {
  613. node_id: '', //重置到某个节点,
  614. employee_id: [], //重置到节点的某个用户 0表示驳回到节点
  615. comment: '' //审核意见
  616. },
  617. userInfo: this.$userInfo(),
  618. processDel: {}, //流程侧边栏
  619. proNum: '', //流程侧边栏头部
  620. calc_dimension: 0, //是否参与权重
  621. revocationNodeId:1,//撤销节点ID
  622. isShowCx:false,
  623. cxText:'',
  624. //按钮显示隐藏
  625. revocationShow:false,//是否可以撤销
  626. gradeButShow: false, //评分
  627. actionButShow: true, //执行计划
  628. recordsManagement: true, //管理记录
  629. examineButShow: false, //审批
  630. isAction:false,//驳回控制
  631. resultButShow: false, //结果值录入
  632. gradeBegin: false, //评分确定
  633. scoreTab: {}, //评分表头
  634. record: [], //考核记录
  635. planIndex: [], //执行计划的下标,当点击表格查看时用到
  636. apList: [], //执行计划数据
  637. isPlan: false, //计划弹窗
  638. // 重置流程
  639. resetFlow: false,
  640. rFlowArrive: [], //重置节点数据
  641. rUsers: [], //重置用户数据
  642. rFlowList: {
  643. type: 1, //重置类型 1 流程内重置 2 重读维度流程 重置
  644. node_id: '', //重置到某个节点, (type 1 必填)
  645. employee_id: [], //重置到节点的某个用户 0表示驳回到节点 (type 1 必填)
  646. overwrite_mode: 2, //1 从原来考核模板覆写,2 从个人考核包重置 (type 2 必填)
  647. comment: '' //审核意见
  648. },
  649. rFlowRules: {
  650. node_id: [{ required: true, message: '请选择重置节点' }],
  651. comment: [{ required: true, message: '请填写重置说明' }]
  652. },
  653. feedbackBut: false, //沟通反馈按钮
  654. isTrack: false, //跟踪管理
  655. weight: '指标权重(0%)',
  656. packageName: '', //考核包名称 结果值录入用到
  657. ruleScore: 1, //1-指标均要评分 2-评分总结
  658. thecurrentFlow: '', //当前节点
  659. tabTotaScore: 0, //表格展示的总分
  660. mandatoryScore: false, //指标说明是否必填
  661. mandatoryNote: false, //总分说明是否必填(暂不做)
  662. scoreInfo: [], //各个节点的人评的总分
  663. examineConsent: false, //审批
  664. transferBut: false, //转交按钮
  665. careOfSelector: false, //转交选人
  666. careOfPeopleId: 0, //转交的 -- 转出ID
  667. isCs:false,//是否抄送人进入(抄送人能看到全部评分内容)
  668. isShowTargetBtn:false, // 目标制定相关
  669. isShowConfirmBtn:false,//目标确认按钮
  670. isUpdateIndex:false,//确认人是否允许修改指标
  671. has_finish:false,//是否归档
  672. // 评分说明弹窗
  673. isShowPf:false,
  674. pfText:'',
  675. indexText:{//定位评分说明
  676. e:0,
  677. index:0
  678. },
  679. isShowOneselfScore:false,//是否只看自己的评分内容
  680. // 控制上下
  681. isDisabled:false,
  682. up:{},
  683. down:{},
  684. package_id:'',
  685. recordMemberIds:[],
  686. pendingList:'',
  687. page:1,
  688. isJz:true,
  689. activeName:'',//待办带进来的节点类型
  690. // 评分确认列表
  691. pointList:[],
  692. pointData:{},
  693. isPoint:false,
  694. publicity:0,
  695. isShowImg:false,
  696. imgUrl:'',
  697. resultStr:'录入结果值',
  698. isSj:false,//是否是被考核人上级
  699. };
  700. },
  701. computed:{
  702. isCzData(){
  703. if(this.gradeBegin){
  704. return true
  705. }
  706. if(this.has_finish){
  707. return true
  708. }
  709. return false
  710. },
  711. isShowOneself(){
  712. return function (value){
  713. if(!this.isShowOneselfScore){
  714. if(value.employee_id==this.userInfo.id){
  715. return true
  716. }else{
  717. return false
  718. }
  719. }else{
  720. return true
  721. }
  722. }
  723. }
  724. },
  725. watch: {
  726. isAdjustment(val){
  727. if (!val) {
  728. this.radio=1
  729. }
  730. },
  731. isShowOneselfScore(){
  732. this.tableLoad=true;
  733. setTimeout(()=>{
  734. this.tableLoad=false;
  735. },500)
  736. },
  737. examineConsent(val){
  738. if(!val){
  739. this.tDownList={
  740. node_id: '', //重置到某个节点,
  741. employee_id: [], //重置到节点的某个用户 0表示驳回到节点
  742. comment: '' //审核意见
  743. }
  744. }
  745. },
  746. isChecks(val){
  747. if (!val) {
  748. this.transferBut=false
  749. }
  750. },
  751. headvalue(id) {
  752. this.headoptions.some(item => {
  753. if (item.id == id) {
  754. this.packageName = item.name;
  755. return true;
  756. }
  757. });
  758. let data={//缓存的数据用于录入结果后返回页面复原数据
  759. employeeID:this.employeeID,
  760. employID:this.employID,
  761. assID:id,
  762. }
  763. this.$setCache("staffAssDet",data)
  764. if(this.pendingList){
  765. this.employeeDet();
  766. }else{
  767. this.employeeDet(true);
  768. }
  769. },
  770. resetFlow(val) {
  771. if (!val) {
  772. this.rFlowList = {
  773. type: 1, //重置类型 1 流程内重置 2 重读维度流程 重置
  774. node_id: '', //重置到某个节点, (type 1 必填)
  775. employee_id: [], //重置到节点的某个用户 0表示驳回到节点 (type 1 必填)
  776. overwrite_mode: 1, //1 从原来考核模板覆写,2 从个人考核包重置 (type 2 必填)
  777. comment: '' //审核意见
  778. };
  779. this.$nextTick(() => {
  780. this.$refs.rFlowList.resetFields();
  781. });
  782. }
  783. },
  784. 'rFlowList.node_id'(val) {
  785. if (!val) {
  786. this.rUsers = [];
  787. return false;
  788. }
  789. this.rFlowArrive.some(item => {
  790. if (val == item.id) {
  791. let users=[];
  792. item.target.map(item2 => {
  793. if(item2.status==2){
  794. users.push({value: item2.employee_id, label: item2.employee_name })
  795. }
  796. });
  797. this.rUsers =users;
  798. return true;
  799. }
  800. });
  801. },
  802. 'tDownList.node_id'(val) {
  803. if (!val) {
  804. this.rUsers = [];
  805. return false;
  806. }
  807. this.rFlowArrive.some(item => {
  808. if (val == item.id) {
  809. let users=[];
  810. item.target.map(item2 => {
  811. if(item2.status==2){
  812. users.push({value: item2.employee_id, label: item2.employee_name })
  813. }
  814. });
  815. this.rUsers =users;
  816. return true;
  817. }
  818. });
  819. },
  820. flow(val) {
  821. //重置要用到
  822. let executionIndex = 0; //执行中下标
  823. let targetIndex = 0; //目标下标(处理中的)
  824. let isNoe=true;//是否完成了整个流程
  825. val.forEach((item, index) => {
  826. item.index = index + 1;
  827. if (item.status == 1) {
  828. targetIndex = index;
  829. isNoe=false
  830. }
  831. });
  832. if (targetIndex == 0&&isNoe) {//当流程执行完会是0
  833. targetIndex = val.length;
  834. }
  835. let rFlowArrive = val.slice(executionIndex, targetIndex);
  836. // 过滤掉 抄送与执行中节点,还有节点人员为空的节点
  837. var arrs=[];
  838. rFlowArrive.forEach((item, index) => {
  839. item.value = item.id;
  840. item.label = item.index + '.' + item.remarks;
  841. if (item.code == 'cc'||item.code=='execution'||item.target.length==0) {
  842. return
  843. }
  844. arrs.push(item);
  845. });
  846. this.rFlowArrive = arrs;
  847. },
  848. communication(val) {
  849. if (!val) {
  850. this.tags = [];
  851. this.communicationVal = '';
  852. }
  853. },
  854. isFlow(val) {
  855. if (!val) {
  856. this.target = [];
  857. }
  858. },
  859. isShowPf(val){
  860. if (!val) {
  861. this.pfText = '';
  862. this.indexText={e:0,index:0}
  863. }
  864. },
  865. 'remployee.id'(val){
  866. if(val){
  867. this.getSuperior();
  868. }
  869. },
  870. },
  871. created() {
  872. let staffAssDet=this.$getCache('staffAssDet');//缓存的数据
  873. if(staffAssDet){
  874. this.employeeID =staffAssDet.employeeID; //个人记录ID
  875. this.employID =staffAssDet.employID; //被考核人ID
  876. this.assList(staffAssDet.assID);
  877. }else{
  878. if(this.$route.query.pe_ids){//结果值点击进来
  879. this.isDetails=false;
  880. this.resultData={
  881. peIds:this.$route.query.pe_ids,
  882. packageName:this.$route.query.name
  883. }
  884. let pendingList=JSON.parse(this.$route.query.pendingList);
  885. this.up={};
  886. this.down={};
  887. pendingList.some((item,index)=>{
  888. if(item.package_id){
  889. if(this.$route.query.package_id==item.package_id){
  890. if(pendingList[index-1]){
  891. this.up=pendingList[index-1];
  892. }
  893. if(pendingList[index+1]){
  894. this.down=pendingList[index+1]
  895. }
  896. if(index==(pendingList.length-2)&&pendingList.length>=10){//如果当点击到待办人员的倒数第二个,加载剩余的
  897. this.getAgency();
  898. }
  899. return true
  900. }
  901. }
  902. })
  903. }else{
  904. this.employeeID = Number(this.$route.query.employeeID); //个人记录ID
  905. this.employID = Number(this.$route.query.employeeIDs); //被考核人ID
  906. this.assList(this.$route.query.assID);
  907. }
  908. }
  909. // 是否显示上下人
  910. if(this.$route.query.pendingList){
  911. this.pendingList=JSON.parse(this.$route.query.pendingList);
  912. this.activeName=this.$route.query.activeName;
  913. this.page=this.$route.query.page||1;
  914. this.isDisabled=true;
  915. }else{
  916. this.isDisabled=false;
  917. this.activeName='';
  918. }
  919. },
  920. methods: {
  921. onFilePreView(file) {
  922. if(file.url){
  923. this.imgUrl=file.url;
  924. this.isShowImg=true;
  925. }
  926. },
  927. onFilePreView2(file) {
  928. window.open(file.url, '_blank');
  929. },
  930. // 获取待办数据
  931. getAgency() {
  932. if(!this.isJz){ return false}
  933. this.page=this.page+1;
  934. this.$axiosUser('get', '/api/pro/per/package/msg/agency', { node_type: this.activeName, status: 0, page: this.page, page_size: 10 },'v2')
  935. .then(res => {
  936. let list = res.data.data.list;
  937. let pendingList = [];
  938. list.forEach(item => {
  939. if(item.node_type==4){
  940. let userInfo = this.$getEmployeeMapItem(item.first_employee_id);
  941. item.userInfo = userInfo;
  942. let name=item.content.split(',')[0]
  943. pendingList.push({ name: userInfo.name,img_url:userInfo.img_url,package_name:name,pe_ids:item.pe_ids,employeeID:'结果',package_id:item.package_id});
  944. return false
  945. }
  946. if (item.remark.employee_id) {
  947. //被考核人
  948. let userInfo = this.$getEmployeeMapItem(item.remark.employee_id);
  949. item.userInfo = userInfo;
  950. pendingList.push({ name: userInfo.name, img_url: userInfo.img_url, employeeID: item.remark.packageEmployee_id, package_name: item.remark.package_name });
  951. }
  952. });
  953. if(list.length<10){
  954. this.isJz=false;
  955. }
  956. this.pendingList.push(...pendingList);
  957. })
  958. },
  959. //撤销
  960. revocation() {
  961. let params={
  962. id:this.employeeID,
  963. node_id:this.revocationNodeId,
  964. comment:this.cxText
  965. }
  966. this.$axiosUser('post', '/api/pro/per/package/revoke', params).then(res => {
  967. if (res.data.code == 1) {
  968. this.$message.success('撤销成功');
  969. this.employeeDet();
  970. }
  971. }).finally(()=>{
  972. this.isShowCx=false;
  973. this.cxText="";
  974. });
  975. },
  976. // 判断是否能点击列表打开管理记录
  977. isShowGl(){
  978. if((this.$getRole(2)||this.$getRole(3))&&this.recordMemberIds.indexOf(this.$userInfo().id)>=0){
  979. return false
  980. }else{
  981. return true
  982. }
  983. },
  984. setUpD(){
  985. let pendingList=this.pendingList;
  986. this.up={};
  987. this.down={};
  988. pendingList.some((item,index)=>{
  989. if(this.employeeID==item.employeeID){
  990. this.packageName=item.package_name;
  991. if(pendingList[index-1]){
  992. this.up=pendingList[index-1];
  993. }
  994. if(pendingList[index+1]){
  995. this.down=pendingList[index+1]
  996. }
  997. if(index==(pendingList.length-2)&&pendingList.length>=10){//如果当点击到待办人员的倒数第二个,加载剩余的
  998. this.getAgency();
  999. }
  1000. return true
  1001. }
  1002. })
  1003. },
  1004. qieh(index){
  1005. let employeeID=index==1? this.up.employeeID:this.down.employeeID;
  1006. if(employeeID==='结果'){//结果值录入
  1007. this.isDetails=false;
  1008. let data=index==1? this.up:this.down;
  1009. this.resultData={
  1010. peIds:JSON.stringify(data.pe_ids),
  1011. packageName:data.package_name
  1012. }
  1013. let pendingList=this.pendingList;
  1014. this.up={};
  1015. this.down={};
  1016. pendingList.some((item,index)=>{
  1017. if(item.package_id){
  1018. if(data.package_id==item.package_id){
  1019. if(pendingList[index-1]){
  1020. this.up=pendingList[index-1];
  1021. }
  1022. if(pendingList[index+1]){
  1023. this.down=pendingList[index+1]
  1024. }
  1025. if(index==(pendingList.length-2)&&pendingList.length>=10){//如果当点击到待办人员的倒数第二个,加载剩余的
  1026. this.getAgency();
  1027. }
  1028. return true
  1029. }
  1030. }
  1031. })
  1032. }else{
  1033. this.isDetails=true;
  1034. this.employeeID=employeeID
  1035. this.employeeDet('',()=>{
  1036. let data={//缓存的数据用于录入结果后返回页面复原数据
  1037. employeeID:this.employeeID,
  1038. employID:this.remployee.id,
  1039. assID:this.package_id,
  1040. }
  1041. this.$setCache("staffAssDet",data)
  1042. });
  1043. }
  1044. },
  1045. updateText(){
  1046. let list = this.dimension[this.indexText.e];
  1047. this.indexText.index==1? list.score_remark=this.pfText:list.total_score_comment=this.pfText
  1048. this.$set(this.dimension, this.indexText.e, list);
  1049. this.isShowPf=false;
  1050. },
  1051. // 填写评分说明
  1052. showPf(e,index){
  1053. let list = this.dimension[e];
  1054. let text=index==1? list.score_remark:list.total_score_comment;//判断是指标说明,还是总分说明
  1055. this.indexText={e:e,index:index}
  1056. this.pfText=text;
  1057. this.isShowPf=true;
  1058. },
  1059. // 目标确认-提交
  1060. submit(){
  1061. this.$confirm('请确认提交制定的指标,提交后不能再自行修改!', '提示', {
  1062. confirmButtonText: '确定',
  1063. cancelButtonText: '取消'
  1064. }).then(() => {
  1065. let data={
  1066. id:this.employeeID,
  1067. node_id:this.atPresentFlow,
  1068. submit:1,
  1069. dimension:JSON.stringify(this.apList)
  1070. }
  1071. this.$axiosUser('post', '/api/pro/per/package/target_set', data).then(res => {
  1072. if (res.data.code == 1) {
  1073. this.$message.success('提交成功');
  1074. this.employeeDet();
  1075. }
  1076. });
  1077. }).catch(() => {
  1078. console.log('取消');
  1079. });
  1080. },
  1081. //获取指定人员上级列表
  1082. getSuperiors(employee_id){
  1083. return this.$axiosUser('get', 'api/pro/employee/superior', {employee_id:employee_id,platform:'3'}).then(res=>{
  1084. return res.data.data.list
  1085. })
  1086. },
  1087. // 判断是否当前被考核人的上级
  1088. async getSuperior(){
  1089. this.isSj=false;
  1090. if(!this.remployee.id){ return is}
  1091. let superior_list=await this.getSuperiors(this.remployee.id);
  1092. superior_list.some(item=>{
  1093. if(item.id==this.userInfo.id){
  1094. this.isSj=true;
  1095. return true
  1096. }
  1097. })
  1098. },
  1099. //判断当有一个人完成,其他显示无需操作
  1100. getStrus(){
  1101. let is=false;
  1102. if(this.processDel.multi_executor==2){
  1103. this.processDel.target.some(item=>{
  1104. if(item.status==2){
  1105. is=true
  1106. return true
  1107. }
  1108. })
  1109. return is;
  1110. }else{
  1111. return false
  1112. };
  1113. },
  1114. //转交
  1115. careOf(data) {
  1116. this.careOfPeopleId = data.employee_id;
  1117. this.careOfSelector = true;
  1118. },
  1119. //转交选人
  1120. confirmcareOf(list) {
  1121. let data = {
  1122. id: this.employeeID, //个人考核记录ID
  1123. node_id: this.processDel.id, //节点ID
  1124. to_employee_id: list.employee[0].id, //接收用户ID
  1125. from_employee_id: this.careOfPeopleId //转出用户ID
  1126. };
  1127. this.$axiosUser('post', '/api/pro/per/package/transfer', data).then(res => {
  1128. if (res.data.code == 1) {
  1129. this.$message.success('转交成功');
  1130. this.isChecks = false;
  1131. this.employeeDet();
  1132. }
  1133. });
  1134. },
  1135. // 打开结果值录入
  1136. openResult() {
  1137. this.$router.push({
  1138. name: 'resultSet',
  1139. query: { id: this.employeeID, packageName: this.packageName,resultStr:this.resultStr },
  1140. });
  1141. },
  1142. // 打开目标制定
  1143. openFormulate() {
  1144. this.$router.push({
  1145. name: 'formulate',
  1146. query: { id: this.employeeID, packageName: this.packageName,nodeId:this.atPresentFlow }
  1147. });
  1148. },
  1149. //打开管理记录
  1150. openTrack(index) {
  1151. this.planIndex = index;
  1152. this.isTrack = true;
  1153. },
  1154. //打开执行计划
  1155. openPlan(index) {
  1156. this.planIndex = index;
  1157. this.isPlan = true;
  1158. },
  1159. //评分--取消
  1160. cancel() {
  1161. this.$confirm('是否暂存当前页面内容?', '提示', {
  1162. confirmButtonText: '暂存',
  1163. cancelButtonText: '不暂存'
  1164. })
  1165. .then(() => {
  1166. this.save(0);
  1167. })
  1168. .catch(() => {
  1169. this.employeeDet();
  1170. this.gradeBegin = false;
  1171. });
  1172. },
  1173. //评分提交
  1174. save(num) {
  1175. let data = {
  1176. id: this.employeeID, //个人考核包ID
  1177. is_submit: num, //是否提交 0否(暂存) 1 是
  1178. node_id: this.atPresentFlow //当前节点
  1179. };
  1180. let point_info=[];//各项评分数据
  1181. let sumData={//总分数据
  1182. total_score:'',
  1183. total_score_comment:'',
  1184. }
  1185. this.dimension.forEach(item => {
  1186. let resultInfo={};
  1187. if(this.ruleScore==1&&!item.totalScore){//各项评分
  1188. resultInfo = {//评分信息--只评总分不需要
  1189. score: item.score_grade?item.score_grade:'', //单项目结果值
  1190. score_remark:item.score_remark,
  1191. dimension_key: item.dimension_key, //维度索引
  1192. index_key: item.index_key, //指标索引
  1193. index_id: item.id ,//指标ID
  1194. name:item.name,
  1195. // 用于计算分数
  1196. d_weight: item.dimension_weight, //维度权重
  1197. weight: item.weight, //指标权重
  1198. type: item.type //所属指标种类 1-量化指标 2-行为价值观指标 3-额外加分项 4-额外扣分项
  1199. };
  1200. point_info.push(resultInfo);
  1201. }else{//等于2:只评总分
  1202. if(item.totalScore){
  1203. sumData={
  1204. total_score:item.score_grade?item.score_grade:'',
  1205. total_score_comment:item.total_score_comment,
  1206. }
  1207. }
  1208. }
  1209. });
  1210. let isMust=true,isExplain=true;//isMust验证评分,isExplain验证说明
  1211. if(num==1){//提交验证必填
  1212. if(this.ruleScore==1){//各项评分
  1213. point_info.forEach(item=>{
  1214. if(this.mandatoryScore){//评分说明必填
  1215. if(!item.score_remark){
  1216. isExplain=false
  1217. }
  1218. }
  1219. if(!item.score){
  1220. isMust=false
  1221. }
  1222. })
  1223. if (!isMust) {
  1224. this.$message.warning('请输入所有评分');
  1225. return false;
  1226. }
  1227. if (!isExplain) {
  1228. this.$message.warning('请输入所有评分说明');
  1229. return false;
  1230. }
  1231. }else{//总分
  1232. if(!sumData.total_score){
  1233. this.$message.warning('请输入评分总分');
  1234. return false;
  1235. }
  1236. if(this.mandatoryScore){
  1237. if(!sumData.total_score_comment){
  1238. this.$message.warning('请输入总分说明');
  1239. return false;
  1240. }
  1241. }
  1242. }
  1243. }
  1244. if(this.ruleScore==1){
  1245. data.total_score = this.fomatFloat(this.totalPointsCount(point_info), 2); //计算的个人评出的总分(保留小数后两位)
  1246. }else{
  1247. data.total_score = this.fomatFloat(sumData.total_score, 2); //计算的个人评出的总分(保留小数后两位)
  1248. data.total_score_comment=sumData.total_score_comment;
  1249. }
  1250. data.point_info = JSON.stringify(point_info); // 评分信息 -- 填所有评分时必须的字段(传入某指标的分数、说明、维度索引、制表索引、指标ID)
  1251. let pointList=JSON.parse(JSON.stringify(point_info));
  1252. pointList.push({
  1253. name:'总分',
  1254. score:data.total_score,
  1255. score_remark:data.total_score_comment
  1256. })
  1257. this.pointList=pointList;
  1258. this.pointData=data;
  1259. if(this.ruleScore==1){//只评总分不需要弹窗
  1260. this.isPoint=true;
  1261. }else{
  1262. this.score()
  1263. }
  1264. },
  1265. score(){
  1266. this.$axiosUser('post', '/api/pro/per/package/submit_score', this.pointData).then(res => {
  1267. this.$message.success('评分成功');
  1268. this.gradeBegin = false;
  1269. this.isPoint = false;
  1270. this.employeeDet();
  1271. });
  1272. },
  1273. fomatFloat(src, pos) {
  1274. return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
  1275. },
  1276. //计算总分
  1277. totalPointsCount(data) {
  1278. let ct = this.empDetList.calc_type; //1-加和计算 2-加权计算
  1279. let cd = this.empDetList.calc_dimension; //是否维度权重参与计算 1-是 0-否
  1280. let num = 0;
  1281. data.forEach(item => {
  1282. if (item.score) {
  1283. if (item.type == 3) {
  1284. //3-额外加分项
  1285. num += Number(item.score);
  1286. }else if(item.type == 4){//4-额外扣分项 不计算
  1287. num -= Number(item.score);
  1288. }else {
  1289. if (ct == 1 && cd == 0) {
  1290. //加和
  1291. num += Number(item.score);
  1292. } else if (ct == 1 && cd == 1) {
  1293. //加和--维度权重参与计算
  1294. num += Number(item.score) * Number(item.d_weight / 100);
  1295. } else if (ct == 2 && cd == 0) {
  1296. //加权
  1297. num += Number(item.score) * Number(item.weight / 100);
  1298. } else if (ct == 2 && cd == 1) {
  1299. //加权--维度权重参与计算
  1300. num += Number(item.score) * Number(item.d_weight / 100) * Number(item.weight / 100);
  1301. }
  1302. }
  1303. }
  1304. });
  1305. return num;
  1306. },
  1307. sgradeBlur(e) {
  1308. let list = this.dimension[e];
  1309. let tPoints = [];
  1310. this.dimension.forEach(item => {
  1311. if (item.score_grade) {
  1312. tPoints.push({
  1313. score: item.score_grade, //分值
  1314. d_weight: item.dimension_weight, //维度权重
  1315. weight: item.weight, //指标权重
  1316. type: item.type //所属指标种类 1-量化指标 2-行为价值观指标 3-额外加分项 4-额外扣分项
  1317. });
  1318. }
  1319. });
  1320. this.tabTotaScore = this.fomatFloat(this.totalPointsCount(tPoints), 2);
  1321. },
  1322. sgradeInp(e,item) {
  1323. //e当前行 ,item用于判断当前输入是否超过评分上限
  1324. let list = this.dimension[e];
  1325. if(item){
  1326. if(item.type==3||item.type==4){
  1327. if(item.point_limit!='-'){
  1328. if(item.score_grade>Number(item.point_limit)){
  1329. this.$message.error("评分超过上限")
  1330. list.score_grade='';
  1331. this.$set(this.dimension, e, list);
  1332. return false
  1333. }
  1334. }
  1335. }
  1336. }
  1337. this.$set(this.dimension, e, list);
  1338. },
  1339. //绩效包列表
  1340. assList(assID) {
  1341. let params = {
  1342. page: 0, //当期页
  1343. employee_id: this.employID
  1344. };
  1345. this.staffLoad = true;
  1346. this.$axiosUser('get', '/api/pro/per/package/list', params).then(res => {
  1347. if (res.data.code == 1) {
  1348. this.headoptions = res.data.data.list;
  1349. this.headvalue = Number(assID);
  1350. }
  1351. });
  1352. },
  1353. deepCopyAndMakeReactive(original, vm) {
  1354. if (Array.isArray(original)) {
  1355. return original.map(item => this.deepCopyAndMakeReactive(item, vm));
  1356. } else if (typeof original === 'object' && original !== null) {
  1357. const copy = {};
  1358. Object.keys(original).forEach(key => {
  1359. this.$set(copy, key, this.deepCopyAndMakeReactive(original[key], vm));
  1360. });
  1361. return copy;
  1362. }
  1363. return original;
  1364. },
  1365. // 绩效考核详情
  1366. employeeDet(is,func=function(){}) {
  1367. let params = {};
  1368. // 重置按钮状态
  1369. this.revocationShow=false,
  1370. this.gradeButShow = false;
  1371. this.examineButShow=false;
  1372. this.isAction=false
  1373. this.resultButShow = false;
  1374. this.isShowTargetBtn = false;
  1375. this.isShowConfirmBtn = false;
  1376. this.isUpdateIndex=false;
  1377. this.atPresentFlow = 0;
  1378. this.nowFLow="";
  1379. if (is) {
  1380. params.package_id = this.headvalue;
  1381. params.employee_id = this.employID; //用户ID
  1382. } else {
  1383. params.id = this.employeeID; //个人考核记录ID
  1384. }
  1385. this.staffLoad = true;
  1386. this.$axiosUser('get', '/api/pro/per/package/employee/info', params).then(res => {
  1387. if (res.data.code == 1) {
  1388. let data = res.data.data;
  1389. this.has_finish=data.has_finish;
  1390. this.recordMemberIds = data.record_member_ids;
  1391. this.empDetList = data;
  1392. this.employeeID = data.id; //考核记录id
  1393. this.package_id=data.package_id
  1394. this.publicity=data.publicity;
  1395. if(this.pendingList){
  1396. this.setUpD();
  1397. }
  1398. this.remployee =this.$getEmployeeMapItem(data.employee_id); //被考核人员信息
  1399. this.flow = data.flow; //流程
  1400. this.config = data.config;
  1401. this.calc_dimension = data.calc_dimension; //是否参与权重
  1402. this.apList = JSON.parse(JSON.stringify(data.dimension));
  1403. this.scoreInfo = data.score_info; //各个节点的人评的总分
  1404. // 沟通反馈是否启用
  1405. this.feedbackBut = data.config.assessment.feedback == '1' ? true : false;
  1406. let point_scope = data.config.assessment.point_scope; //评分可见权限
  1407. let point_comment = data.config.assessment.point_comment; //说明可见权限
  1408. let executor = {}; //与当前登录账号相同的执行人
  1409. let review = {}; //与当前登录账号相同的审批人
  1410. let isReview=false;//判断账号是否审批人中一位
  1411. let targetUserList=[];//结果值录入人 ,用来显示结果值录入人
  1412. data.flow.forEach((item,index) => {
  1413. if (item.code == 'execution') {//查找 已开始或已结束的执行节点中有无当前账号
  1414. if (item.status != 0) {
  1415. item.target.forEach(tar => {
  1416. if (tar.employee_id == this.userInfo.id) {
  1417. executor = tar; //存入与当前登录账号相同的执行人
  1418. executor.newCode = 'employee'; //保存执行人节点code
  1419. }
  1420. });
  1421. }
  1422. }
  1423. if (item.code == 'review') {//查找 已开始或已结束的审批节点中有无当前账号
  1424. if(item.status != 0){
  1425. item.target.forEach(tar => {
  1426. if (tar.employee_id == this.userInfo.id) {
  1427. isReview=true;
  1428. review = tar; //存入与当前登录账号相同的审批人
  1429. review.newCode = 'reviewer'; //保存审批人节点code
  1430. }
  1431. });
  1432. }
  1433. }
  1434. if (item.code=='result_value'){//获取结果值录入人集合
  1435. targetUserList=item.target
  1436. }
  1437. //当前步骤
  1438. if (item.status == 1) {
  1439. // 判断是否显示撤销按钮
  1440. if(item.code != 'cc'){
  1441. this.isRevocation(item,data.flow[index-1]);
  1442. }
  1443. this.nowFLow = item.code;
  1444. this.atPresentFlow = item.id;
  1445. this.setBtn(item)//其他按钮控制
  1446. if(item.code == 'target'||item.code == 'confirm'){//当是目标制定,目标确认时,隐藏调整目标按钮
  1447. this.dropdownMenu[1].isShow=false
  1448. }else{
  1449. this.dropdownMenu[1].isShow=true
  1450. }
  1451. //审批按钮
  1452. if (item.code == 'review') {
  1453. let reviewif = false;
  1454. item.target.forEach(tar => {
  1455. if (tar.employee_id == this.userInfo.id && tar.status == 1) {
  1456. reviewif = true;
  1457. }
  1458. });
  1459. this.examineButShow = reviewif ? true : false;
  1460. this.isAction=item.action.indexOf('refuse')>=0? true:false;
  1461. }
  1462. //结果值录入按钮
  1463. if(item.code=='result_value'||item.code=='score_supervisor'||item.code=='special_scorer'){
  1464. this.isresultBtn(item)
  1465. }
  1466. }
  1467. let remName = item.remark;
  1468. item.target.forEach((add, att) => {
  1469. remName += add.employee_name;
  1470. remName += item.target.length - att > 1 ? ',' : '';
  1471. });
  1472. item.remarks = remName;
  1473. item.remarkDel = item.remark.split(':')[0];
  1474. });
  1475. if(this.atPresentFlow == 0){//如果当前节点id为0,代表此考核详情已完毕,把最后一个节点作为当前节点
  1476. this.atPresentFlow = data.flow[data.flow.length-1].id
  1477. // 判断抄送节点里是否包含当前登录者
  1478. let cs= data.flow[data.flow.length-1];
  1479. if(cs.code=='cc'){ //判断最后一个节点是否抄送节点
  1480. cs.target.some(item => {
  1481. if (item.employee_id == this.userInfo.id) {
  1482. this.isCs = true;
  1483. return true;
  1484. }
  1485. });
  1486. }
  1487. }
  1488. //整合表格格式
  1489. let dimension = data.dimension;
  1490. let dimeTab = [];
  1491. let gradeTab = [];
  1492. let weight = 0; //权重统计
  1493. dimension.forEach((item, keys) => {
  1494. item.index.forEach((arr, index) => {
  1495. weight += Number(arr.weight);
  1496. arr.wdLeg = 0; //其他这个指标集合的指标给值为0
  1497. item.index[0].wdLeg = item.index.length; //找出这个指标集合的第一个并给与他的长度
  1498. arr.theDimension = item.name;
  1499. arr.dimension_weight = item.dimension_weight; //维度权重
  1500. arr.score_infos = [];
  1501. arr.planIndex = [keys, index]; //当打开执行计划时的下标
  1502. arr.per_remark = this.initData(arr.per_remark);
  1503. arr.remark = this.initData(arr.remark);
  1504. arr.target = this.initData(arr.target);
  1505. arr.result = arr.result; //结果值
  1506. arr.point_limit = this.initData(arr.point_limit);
  1507. if(item.index_type==3||item.index_type==4){
  1508. arr.weight = this.initData(Number(arr.weight));
  1509. }
  1510. // 写入每个指标的结果值录入人
  1511. targetUserList.forEach(target=>{
  1512. target.list.forEach(target2=>{
  1513. if(target2.index_id==arr.id){
  1514. arr.resultUserName = target.employee_name; //结果值
  1515. }
  1516. })
  1517. })
  1518. // 权限区分
  1519. arr.score_info.forEach((list, auto) => {
  1520. if (list.id <= this.atPresentFlow) {//atPresentFlow为当前节点id。。数据-id <= 当前节点id . :筛选出当前节点及之前的评分节点的数据
  1521. list.employees.forEach(emplo => {
  1522. //获取code
  1523. data.flow.forEach(codes => {
  1524. if (codes.id == list.id) {
  1525. emplo.code = codes.code;
  1526. codes.target.some(tar => {//找到每个评分人获取评分状态
  1527. if(tar.employee_id==emplo.employee_id){
  1528. emplo.status = tar.status;
  1529. return true
  1530. }
  1531. });
  1532. }
  1533. });
  1534. emplo.id = list.id;
  1535. emplo.newKey = Number(emplo.id + '' + emplo.employee_id); //给一个唯一key,目的:找到不同节点的相同的人 去重
  1536. arr.score_infos.push(emplo);
  1537. gradeTab.push(emplo);
  1538. });
  1539. }
  1540. });
  1541. dimeTab.push(arr);
  1542. });
  1543. });
  1544. this.weight = '指标权重(' + weight + '%)';
  1545. let poiSco = data.config.assessment.point_scope; //评分可见权限
  1546. let poicom = data.config.assessment.point_comment; //说明可见权限
  1547. let duplicat = this.duplicateRemoval(gradeTab, 'newKey');
  1548. duplicat.forEach(item => {
  1549. if (item.code == 'review') {//审批
  1550. item.newCode = 'reviewer';
  1551. } else if (item.code == 'execution') {//执行中
  1552. item.newCode = 'employee';
  1553. } else if (item.code == 'score_supervisor') {//指定上级
  1554. item.newCode = 'manager';
  1555. } else if (item.code == 'special_scorer') {//特定上级
  1556. item.newCode = 'special';
  1557. }
  1558. //item为评分数据,数据内只有两个节点:指定(score_supervisor,权限名:manager) 特定上级(special_scorer,权限名:special)
  1559. //poiSco 评分权限
  1560. //poicom 说明权限
  1561. //executor 执行人中的当前登陆账号
  1562. //review 审批人中的当前登陆账号
  1563. if(executor.employee_id){//若有数据,那么当前登录账号必定在执行人中并且执行节点正在执行或已结束(哪怕正在执行也无所谓,前方已经过滤评分数据,会得到[])
  1564. if(poiSco[executor.newCode] == '2'){//已有数据并且为2 ‘查看所有的’ ,那就可以将所有的评分权限都改为 ‘2’
  1565. for(let i in poiSco){
  1566. poiSco[i] = '2'
  1567. }
  1568. }
  1569. if(poicom[executor.newCode] == '2'){//说明同上
  1570. for(let i in poicom){
  1571. poicom[i] = '2'
  1572. }
  1573. }
  1574. }
  1575. if(review.employee_id){//审批节点--同上 (审批节点默认为2,可以直接全部变成2)
  1576. if(poiSco[review.newCode] == '2'){
  1577. for(let i in poiSco){
  1578. poiSco[i] = '2'
  1579. }
  1580. }
  1581. if(poicom[review.newCode] == '2'){//说明同上
  1582. for(let i in poicom){
  1583. poicom[i] = '2'
  1584. }
  1585. }
  1586. }
  1587. if (item.employee_id == executor.employee_id) {//判断当前评分数据是否 与 执行节点的当前帐号一致
  1588. if (poiSco[executor.newCode] == '2') {//如果一致并且执行节点为‘2’即查看所有,那么就修改当前 评分数据 的权限也为‘2’
  1589. poiSco[item.newCode] = '2';
  1590. }
  1591. if (poicom[executor.newCode] == '2') {//执行中的 -- 说明权限-同上
  1592. poicom[item.newCode] = '2';
  1593. }
  1594. }
  1595. if (item.employee_id == review.employee_id) {//判断当前评分数据是否 与 审批节点的当前帐号一致
  1596. if (poiSco[review.newCode] == '2') {
  1597. poiSco[item.newCode] = '2';
  1598. }
  1599. if (poicom[review.newCode] == '2') {//审批的 -- 说明权限-同上
  1600. poicom[item.newCode] = '2';
  1601. }
  1602. }
  1603. });
  1604. let poiSOk = false//评分--为true时所有评分可看
  1605. let poiCOk = false//说明--为true时所有说明可看
  1606. duplicat.forEach(item => {
  1607. if (poiSco[item.newCode] == '1' && item.employee_id == this.userInfo.id) {
  1608. item.poiSco = true;
  1609. }else if(poiSco[item.newCode] == '2'){//当前 评分 数据权限等于2时并且 (当前数据id为登陆账号 或 执行中权限等于2(代表当前登陆账号为执行中的一员 或 审批权限等于2(代表当前登陆账号为审批中的一员)) 时,所有评分都可见
  1610. if(item.employee_id == this.userInfo.id || poiSco[executor.newCode] == '2' || poiSco[review.newCode] == '2'){
  1611. poiSOk = true
  1612. }
  1613. }
  1614. //说明可见权限。
  1615. if (poicom[item.newCode] == '1' && item.employee_id == this.userInfo.id) {//说明--同上
  1616. item.poicom = true;
  1617. }else if(poicom[item.newCode] == '2'){
  1618. if(item.employee_id == this.userInfo.id || poicom[executor.newCode] == '2' || poicom[review.newCode] == '2'){
  1619. poiCOk = true
  1620. }
  1621. }
  1622. });
  1623. duplicat.forEach(item => {
  1624. if(poiSOk || this.$getRole(1)||this.isCs){
  1625. item.poiSco = true;
  1626. }
  1627. if(poiCOk || this.$getRole(1)||this.isCs){
  1628. item.poicom = true;
  1629. }
  1630. })
  1631. //遍历列表总分
  1632. let scoreListInfo = [];
  1633. let totSco = false;
  1634. let points=[];//最终显示评分
  1635. this.scoreInfo.forEach(item => {
  1636. item.employees.forEach(arr => {
  1637. arr.newKey = Number(item.id + '' + arr.employee_id);
  1638. arr.codeId = item.id;
  1639. scoreListInfo.push(arr);
  1640. });
  1641. });
  1642. duplicat.forEach((item,index) => {
  1643. scoreListInfo.forEach(arr => {
  1644. if (item.newKey == arr.newKey) {
  1645. item.totalScore = arr.point;
  1646. item.comment = arr.comment;
  1647. if (arr.point) {
  1648. totSco = true;
  1649. }
  1650. }
  1651. });
  1652. if(item.status!=2&&item.id!=this.atPresentFlow){
  1653. // delete duplicat[index]
  1654. }else{
  1655. points.push(item)
  1656. }
  1657. });
  1658. points.sort(this.rule("id"))//跟距ID排序
  1659. console.log(points)
  1660. this.lingScore_infos = points;
  1661. this.isShowOneselfScore = !this.isShowOneselfScore
  1662. setTimeout(()=>{
  1663. this.isShowOneselfScore = !this.isShowOneselfScore
  1664. })
  1665. // this.lingScore_infos = this.deepCopyAndMakeReactive(points,this)
  1666. // console.log(this.lingScore_infos)
  1667. // this.lingScore_infos = []
  1668. // points.map((item,index) => {
  1669. // this.lingScore_infos.push(item)
  1670. // })
  1671. // this.$set(this.lingScore_infos,points.map(item => ({ ...item })))
  1672. let toScore = {
  1673. theDimension: '总分',
  1674. wdLeg: 0,
  1675. toScore: true
  1676. };
  1677. if (totSco) {
  1678. let poiScoDimeTab = false;
  1679. duplicat.forEach(item => {
  1680. if (item.poiSco) {
  1681. poiScoDimeTab = true;
  1682. }
  1683. });
  1684. if (poiScoDimeTab) {
  1685. dimeTab.push(toScore);
  1686. this.$nextTick(() => {
  1687. //刷新总分--行
  1688. dimeTab.forEach((item, index) => {
  1689. if (item.toScore) {
  1690. this.sgradeInp(index);
  1691. }
  1692. });
  1693. });
  1694. }
  1695. }
  1696. //流程结束后的判断
  1697. this.pdLc()
  1698. if (!this.nowFLow||this.nowFLow=='review') {//是审批节点或者流程结束,(流程结束nowFLow为空)
  1699. if(data.publicity == 1||this.$getRole(1)||isReview){ //结果是否公示,是否主次管理员,是否是审批人
  1700. dimeTab[0].final_point = data.final_point; //考核结果--总分
  1701. dimeTab[0].final_level = data.final_level; //考核结果--等级
  1702. dimeTab[0].doing_id = 11;
  1703. dimeTab[0].zfLeg = dimeTab.length;
  1704. }
  1705. }
  1706. this.dimension = dimeTab.map(item => ({ ...item })); //表格数据
  1707. //记录
  1708. let record = res.data.data.record;
  1709. record.forEach(item => {
  1710. item.userData = this.$getEmployeeMapItem(item.employee_id);
  1711. });
  1712. this.record = record;
  1713. func();
  1714. }
  1715. })
  1716. .finally(() => {
  1717. this.staffLoad = false;
  1718. });
  1719. },
  1720. // 判断是否显示撤销按钮
  1721. isRevocation(dqItem,upItem){
  1722. // 当前只需要评分节点需要撤回
  1723. //当前节点包含自己并且其他任意一人未完成的显示按钮
  1724. if(dqItem.code=='score_supervisor'||dqItem.code=='special_scorer'){
  1725. dqItem.target.some((item,index)=>{
  1726. if(item.employee_id==this.userInfo.id&&item.status==2){
  1727. dqItem.target.some((item2,index2)=>{
  1728. if(item2.status==1){
  1729. this.revocationNodeId=dqItem.id
  1730. this.revocationShow=true;
  1731. return true;
  1732. }
  1733. })
  1734. }
  1735. })
  1736. }
  1737. let is=true;//判断当前节点人员是否有完成的
  1738. //上一节点中包含登录者并且是完成的状态显示按钮
  1739. if(upItem){
  1740. dqItem.target.some((item,index)=>{
  1741. if(item.status==2){
  1742. is=false;
  1743. }
  1744. })
  1745. if((upItem.code=='score_supervisor'||upItem.code=='special_scorer')){
  1746. upItem.target.some((item,index)=>{
  1747. if(item.employee_id==this.userInfo.id&&item.status==2&&is){
  1748. this.revocationNodeId=upItem.id
  1749. this.revocationShow=true;
  1750. return true;
  1751. }
  1752. })
  1753. }
  1754. }
  1755. },
  1756. //判断是否显示结果值
  1757. isresultBtn(item){
  1758. //结果值录入按钮
  1759. let flow=this.flow;
  1760. if (item.code == 'result_value') {
  1761. item.target.forEach(tar => {
  1762. if (tar.employee_id == this.userInfo.id) {
  1763. this.resultButShow = true;
  1764. this.resultStr=tar.status==2? '调整结果值':'录入结果值'
  1765. }
  1766. });
  1767. return true;
  1768. }else{
  1769. let is=false
  1770. flow.some(obj=>{
  1771. if(obj.code == 'result_value') {
  1772. obj.target.forEach(tar => {
  1773. if (tar.employee_id == this.userInfo.id) {
  1774. is = true;
  1775. }
  1776. });
  1777. }
  1778. if(obj.code=='score_supervisor'||obj.code=='special_scorer'){
  1779. let isUpdate=true;
  1780. if(obj.target.length>0){
  1781. obj.target.forEach(e=>{
  1782. if(e.status==2){
  1783. isUpdate=false
  1784. }
  1785. })
  1786. if(isUpdate&&is){
  1787. this.resultButShow = true;
  1788. this.resultStr='调整结果值';
  1789. }
  1790. }
  1791. return true
  1792. }
  1793. })
  1794. }
  1795. },
  1796. pdLc(){
  1797. let flow=JSON.parse(JSON.stringify(this.flow)).reverse();//反转流程,找第一个评分节点
  1798. //流程结束,但是最后一个“评分”节点里有自己显示撤销
  1799. if(this.publicity==1){
  1800. flow.some(item=>{
  1801. if(item.code=='review'||item.code=='cc'){
  1802. return true
  1803. }
  1804. if(item.code=='score_supervisor'||item.code=='special_scorer'){
  1805. item.target.some(e=>{
  1806. if(e.employee_id==this.userInfo.id&&e.status==2){
  1807. this.revocationNodeId=item.id
  1808. this.revocationShow=true;
  1809. return true
  1810. }
  1811. })
  1812. return true
  1813. }
  1814. })
  1815. }
  1816. },
  1817. // 各按钮控制
  1818. setBtn(item){
  1819. // 目标制定
  1820. if(item.code == 'target'){
  1821. item.target.forEach(tar => {
  1822. if (tar.employee_id == this.userInfo.id && tar.status == 1) {
  1823. this.isShowTargetBtn = true;
  1824. }
  1825. });
  1826. return
  1827. }
  1828. // 目标确认
  1829. if(item.code == 'confirm'){
  1830. item.target.forEach(tar => {
  1831. if (tar.employee_id == this.userInfo.id && tar.status == 1) {
  1832. this.isShowConfirmBtn = true;
  1833. }
  1834. });
  1835. this.isUpdateIndex=item.action.indexOf('index')>=0? true:false
  1836. return
  1837. }
  1838. //评分按钮
  1839. if (item.code == 'score_self' || item.code == 'score_mutual' || item.code == 'score_supervisor' || item.code == 'special_scorer') {
  1840. item.target.forEach(tar => {
  1841. if (tar.employee_id == this.userInfo.id && tar.status == 1) {
  1842. this.gradeButShow = true;
  1843. }
  1844. });
  1845. return
  1846. }
  1847. },
  1848. //去重
  1849. duplicateRemoval(data, name) {
  1850. let bbt = {};
  1851. let abbts = data.reduce((cur, next) => {
  1852. bbt[next[name]] ? '' : (bbt[next[name]] = true && cur.push(next));
  1853. return cur;
  1854. }, []);
  1855. return abbts;
  1856. },
  1857. //跟距ID排序
  1858. rule(key) {
  1859. return function (a, b) { // sort 默认接受a,b两个参数表示数组中的值
  1860. var value1 = a[key]
  1861. var value2 = b[key]
  1862. return value1 - value2
  1863. }
  1864. },
  1865. groupBy(data, params) {
  1866. const groups = {};
  1867. data.forEach(v => {
  1868. const group = JSON.stringify(v[params]);
  1869. groups[group] = groups[group] || [];
  1870. groups[group].push(v);
  1871. });
  1872. return Object.values(groups);
  1873. },
  1874. //数据初始化,没有值或者空数组的显示-
  1875. initData(str) {
  1876. if (str == null) {
  1877. return str ? str : '-';
  1878. }
  1879. if (typeof str == 'object') {
  1880. return str.length > 0 ? str : '-';
  1881. } else {
  1882. return str ? str : '-';
  1883. }
  1884. },
  1885. // 根据数据结构显示table,
  1886. getTableItem(str) {
  1887. let dimension = this.dimension;
  1888. let is = false;
  1889. dimension.some(item => {
  1890. for (var key in item) {
  1891. if (str == key) {
  1892. if (typeof item[key] == 'object') {
  1893. if(key=='result_file'){
  1894. // 附件
  1895. if(item[key].append.length>0||item[key].images.length>0){
  1896. is = true;
  1897. return true;
  1898. }
  1899. }else{
  1900. //是数组并且长度大于0
  1901. if (item[key].length > 0) {
  1902. is = true;
  1903. return true;
  1904. }
  1905. }
  1906. } else {
  1907. if(key=='target'){
  1908. if (item[key] != '0'&&item[key] != '-') {
  1909. //是有数据并且!= -
  1910. is = true;
  1911. return true;
  1912. }
  1913. }else{
  1914. if (item[key] != '-') {
  1915. //是有数据并且!= -
  1916. is = true;
  1917. return true;
  1918. }
  1919. }
  1920. }
  1921. }
  1922. }
  1923. });
  1924. return is;
  1925. },
  1926. //流程点击
  1927. processDet(data) {
  1928. this.processDel = data;
  1929. this.isChecks = true;
  1930. if (data.target.length == 0) {
  1931. this.proNum = '';
  1932. } else {
  1933. let arr = 0;
  1934. data.target.forEach((item, index) => {
  1935. if (item.status == 2) {
  1936. arr++;
  1937. }
  1938. });
  1939. this.proNum = '(' + arr + '/' + data.target.length + ')';
  1940. }
  1941. let code = this.processDel.code;
  1942. if (this.processDel.status == 1) {//当是目标制定,目标确认 结果值录入,上级评分,指定人评分,审批时显示转交按钮
  1943. if (code == 'target'||code == 'confirm'||code == 'score_supervisor' || code == 'special_scorer' || code == 'result_value' || code == 'review') {
  1944. this.transferBut = true;
  1945. }//当上级评分,指定人评分,判断是否具有转交权限
  1946. }
  1947. },
  1948. handleCommand(val) {
  1949. //管理选项
  1950. if (val == 'a') {
  1951. //重置流程
  1952. this.resetFlow = true;
  1953. } else if (val == 'b') {
  1954. this.isAdjustment=true;
  1955. }
  1956. },
  1957. //
  1958. setDataAccess(){
  1959. this.isAdjustment=false;
  1960. if(this.radio==2){
  1961. //调整目标
  1962. this.$router.push({
  1963. name: 'adjustment',
  1964. query: { id: this.employeeID }
  1965. });
  1966. }else{
  1967. //调整目标
  1968. this.$router.push({
  1969. name: 'adjustment2',
  1970. query: { id: this.employeeID }
  1971. });
  1972. }
  1973. },
  1974. // 沟通反馈
  1975. saveCommunication() {
  1976. if (!this.communicationVal) {
  1977. this.$message.error('请输入沟通内容');
  1978. return false;
  1979. }
  1980. let target_id = this.tags.map(item => {
  1981. return item.id;
  1982. });
  1983. this.$axiosUser('post', '/api/pro/per/package/negotiation', {
  1984. id: this.employeeID,
  1985. content: this.communicationVal,
  1986. target_id: JSON.stringify(target_id)
  1987. }).then(res => {
  1988. this.$message.success('已沟通');
  1989. this.employeeDet();
  1990. this.communication = false;
  1991. });
  1992. },
  1993. confirmCreator(e) {
  1994. this.tags = e.employee;
  1995. },
  1996. handleClose(tag, index) {
  1997. this.tags.splice(index, 1);
  1998. },
  1999. //评分按钮
  2000. gradeClick() {
  2001. this.gradeBegin = true;
  2002. let dnsion = [];
  2003. this.dimension.forEach(item => {
  2004. if (!item.toScore) {
  2005. item.score_infos.forEach(arr => {
  2006. if (arr.employee_id == this.userInfo.id&&arr.id==this.atPresentFlow) {
  2007. item.score_grade = arr.point; //某指标的分数
  2008. item.score_remark = arr.remark; //评分说明
  2009. if(item.type==1){
  2010. item.expressionStr=getExpressionStr(item.expression)
  2011. }else{
  2012. item.expressionStr=''
  2013. }
  2014. dnsion.push(item);
  2015. }
  2016. });
  2017. }
  2018. });
  2019. let data = {};
  2020. dnsion.forEach(item => {
  2021. item.wdLeg = 0;
  2022. });
  2023. let totalScore = {
  2024. theDimension: '总分',
  2025. wdLeg: 0,
  2026. totalScore: true
  2027. };
  2028. this.flow.forEach(item => {
  2029. if (item.code == 'score_supervisor' && item.status == 1) {
  2030. this.ruleScore = item.rule == 2 ? 2 : 1; //1-指标均要评分 2-评分总结
  2031. this.thecurrentFlow = 'score_supervisor';
  2032. totalScore.codeId = item.id;
  2033. } else if (item.code == 'special_scorer' && item.status == 1) {
  2034. this.ruleScore = 1;
  2035. }
  2036. if ((item.code == 'score_supervisor' && item.status == 1) || (item.code == 'special_scorer' && item.status == 1)) {
  2037. //上级评分,特定评分 评分人必填项
  2038. item.action.forEach(arr => {
  2039. this.mandatoryScore = arr == 'comment' ? true : false; //指标说明是否必填
  2040. });
  2041. }
  2042. });
  2043. this.scoreInfo.forEach(item => {
  2044. item.employees.forEach(arr => {
  2045. if (arr.employee_id == this.userInfo.id) {
  2046. this.tabTotaScore = arr.point ? arr.point : 0;
  2047. if (item.id == totalScore.codeId && this.ruleScore == 2) {
  2048. totalScore.score_grade = arr.point;
  2049. totalScore.total_score_comment = arr.comment ? arr.comment : '';
  2050. }
  2051. }
  2052. });
  2053. });
  2054. let dimenList = [];
  2055. let users=[];//当前节点的自己的信息
  2056. this.flow.forEach(item => {//根据流程当前节点,找节点的人员中的登陆者
  2057. if (item.status == 1) {
  2058. item.target.some(arr => {
  2059. if (arr.employee_id == this.userInfo.id) {
  2060. arr.flowStatusId=item.id;//当前节点的ID
  2061. users=arr
  2062. return true
  2063. }
  2064. });
  2065. }
  2066. });
  2067. users.list.forEach(att => {//获取当前节点审批人员中的登陆者
  2068. dnsion.forEach((add,index) => {
  2069. if (att.index_id == add.id&&att.dimension_key==add.planIndex[0]&&att.index_key==add.planIndex[1]) {//因为不同维度下可能存在相同的指标,所以也要判断他的维度是否一致
  2070. add.dimension_key = att.dimension_key; //维度索引
  2071. add.index_key = att.index_key; //指标索引
  2072. add.score_infos.forEach(user=>{ //显示的文案,找到当前登录人
  2073. if(user.id==users.flowStatusId){
  2074. if(user.employee_id==this.userInfo.id){
  2075. this.scoreTab.title = user.title;
  2076. this.scoreTab.explain = user.title.split(':')[0] + '说明';
  2077. }
  2078. }
  2079. })
  2080. dimenList.push(add);
  2081. }
  2082. });
  2083. });
  2084. dimenList.push(totalScore);
  2085. this.$nextTick(()=>{
  2086. // this.dimension = dimenList;
  2087. this.dimension = dimenList.map(item => ({ ...item }));
  2088. })
  2089. },
  2090. gradeTurn() {
  2091. //评分驳回按钮
  2092. this.turnDown = true;
  2093. },
  2094. gradeOk() {
  2095. //评分驳回按钮
  2096. this.examineConsent = true;
  2097. },
  2098. tDownOk(num, formName) {
  2099. let tDownList = this.tDownList;
  2100. if (num == 1) {
  2101. let data = {
  2102. id: this.employeeID, //个人考核包ID
  2103. agree: 1, //同意1 驳回0
  2104. c_node_id:this.atPresentFlow,//当前节点ID
  2105. comment: tDownList.comment //审核意见
  2106. };
  2107. this.tDownHttpJx(1, data);
  2108. } else if (num == 0) {
  2109. //驳回
  2110. this.$refs[formName].validate(valid => {
  2111. if (valid) {
  2112. if (tDownList.employee_id.length == 0) {
  2113. this.$message.error('至少选择一名重置人员');
  2114. return false;
  2115. }
  2116. if (!tDownList.comment) {
  2117. this.$message.error('请输入驳回说明');
  2118. return false;
  2119. }
  2120. this.$confirm('流程将驳回到选中节点,已完成的节点需要重新进行处理,确认重置流程?', '提示', {
  2121. confirmButtonText: '确定',
  2122. cancelButtonText: '取消',
  2123. type: 'warning'
  2124. })
  2125. .then(() => {
  2126. let data = {
  2127. id: this.employeeID, //个人考核包ID
  2128. agree: 0, //同意1 驳回0
  2129. node_id: tDownList.node_id, //重置到某个节点, (type 1 必填)
  2130. c_node_id:this.atPresentFlow,//当前节点ID
  2131. employee_id: JSON.stringify(tDownList.employee_id), //重置到节点的某个用户 string(JSOn)
  2132. comment: tDownList.comment //审核意见
  2133. };
  2134. this.tDownHttpJx(0, data);
  2135. })
  2136. .catch(() => {});
  2137. } else {
  2138. return false;
  2139. }
  2140. });
  2141. }
  2142. },
  2143. tDownHttpJx(num, data) {
  2144. this.$axiosUser('post', '/api/pro/per/package/review', data).then(res => {
  2145. this.$message.success('提交成功');
  2146. this.tDlose(num);
  2147. this.employeeDet();
  2148. });
  2149. },
  2150. tDlose(num) {
  2151. //驳回侧边栏关闭
  2152. if (num == 0) {
  2153. this.turnDown = false;
  2154. } else if (num == 1) {
  2155. this.examineConsent = false;
  2156. }
  2157. },
  2158. //重置确定
  2159. rFlowOk(formName) {
  2160. this.$refs[formName].validate(valid => {
  2161. if (valid) {
  2162. let rFlowList = this.rFlowList;
  2163. if (rFlowList.type == 1) {
  2164. if (rFlowList.employee_id.length == 0) {
  2165. this.$message.error('至少选择一名重置人员');
  2166. return false;
  2167. }
  2168. }
  2169. this.$confirm('流程将重置,已完成的节点需要重新进行处理,确认重置流程?', '提示', {
  2170. confirmButtonText: '确定',
  2171. cancelButtonText: '取消',
  2172. type: 'warning'
  2173. })
  2174. .then(() => {
  2175. let data;
  2176. if (rFlowList.type == 1) {
  2177. data = {
  2178. id: this.employeeID, //个人考核包ID
  2179. type: rFlowList.type, //重置类型 1 流程内重置 2 重读维度流程 重置
  2180. node_id: rFlowList.node_id, //重置到某个节点, (type 1 必填)
  2181. employee_id: JSON.stringify(rFlowList.employee_id), //重置到节点的某个用户 string(JSOn)
  2182. comment: rFlowList.comment //审核意见
  2183. };
  2184. } else {
  2185. data = {
  2186. id: this.employeeID, //个人考核包ID
  2187. type: rFlowList.type, //重置类型 1 流程内重置 2 重读维度流程 重置
  2188. overwrite_mode: rFlowList.overwrite_mode, //1 从原来考核模板覆写,2 从个人考核包重置 (type 2 必填)
  2189. comment: rFlowList.comment //审核意见
  2190. };
  2191. }
  2192. this.$axiosUser('post', 'api/pro/per/package/reset_flow', data).then(res => {
  2193. this.$message.success('提交成功');
  2194. this.resetFlow = false;
  2195. this.employeeDet();
  2196. });
  2197. })
  2198. .catch(() => {});
  2199. } else {
  2200. return false;
  2201. }
  2202. });
  2203. },
  2204. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  2205. if (!this.gradeBegin && !row.toScore) {
  2206. if (columnIndex === 0) {
  2207. return {
  2208. rowspan: row.wdLeg,
  2209. colspan: 1
  2210. };
  2211. }
  2212. }
  2213. if (row.zfLeg) {
  2214. //考核结果、绩效等级
  2215. if (column.label == '考核结果' || column.label == '绩效等级') {
  2216. if (rowIndex != 1) {
  2217. return {
  2218. rowspan: row.zfLeg,
  2219. colspan: 1
  2220. };
  2221. } else {
  2222. return {
  2223. rowspan: 0,
  2224. colspan: 0
  2225. };
  2226. }
  2227. }
  2228. }
  2229. }
  2230. },
  2231. beforeRouteLeave(to, from, next) {
  2232. if(to.name!='formulate'&&to.name!='resultSet'){
  2233. localStorage.removeItem("staffAssDet")
  2234. }
  2235. next();
  2236. }
  2237. };
  2238. </script>
  2239. <style scoped lang="scss">
  2240. .guidang{
  2241. margin-left: 20px;
  2242. width: 70px;
  2243. animation:example 1s;
  2244. }
  2245. @keyframes example {
  2246. from {transform: scale(1.4);}
  2247. to {transform: scale(1);}
  2248. }
  2249. .popover-box{
  2250. opacity: 1;
  2251. border-radius: 4px;
  2252. width: 250px;
  2253. }
  2254. .popover-title{
  2255. font-size: 14px;
  2256. font-family: PingFang SC;
  2257. font-weight: 400;
  2258. text-align: center;
  2259. color: #FFCB00;
  2260. margin-bottom: 10px;
  2261. }
  2262. .popover-content{
  2263. font-size: 14px;
  2264. font-family: PingFang SC;
  2265. font-weight: 400;
  2266. opacity: 1;
  2267. color: #fff;
  2268. }
  2269. .result{
  2270. border: 2px solid #ff9600;
  2271. padding: 5px 10px;
  2272. color: #ff9600;
  2273. text-align: center;
  2274. }
  2275. .flow-img{
  2276. width: 20px;
  2277. position: absolute;
  2278. right: -30px;
  2279. }
  2280. .all {
  2281. position: relative;
  2282. font-size: 14px;
  2283. background-color: #fff;
  2284. padding: 20px;
  2285. header {
  2286. margin-bottom: 60px;
  2287. .head {
  2288. border-top: 1px solid #e6e6e6;
  2289. border-bottom: 1px solid #e6e6e6;
  2290. padding: 20px 0;
  2291. margin-top: 10px;
  2292. }
  2293. .head2User {
  2294. .headTname {
  2295. padding: 7px 0 0 15px;
  2296. div {
  2297. padding: 0 0 3px 0;
  2298. font-size: 15px;
  2299. }
  2300. span {
  2301. font-size: 13px;
  2302. color: #969696;
  2303. }
  2304. }
  2305. }
  2306. }
  2307. }
  2308. .upDown-box{
  2309. position: fixed;
  2310. bottom: 10px;
  2311. left: 50%;
  2312. background-color: #fff;
  2313. z-index: 100;
  2314. width: 370px;
  2315. height: 60px;
  2316. border-radius: 100px;
  2317. margin-left: -185px;
  2318. box-shadow: 0 0 5px #999999;
  2319. }
  2320. .upName{
  2321. width: 80px;
  2322. text-align: center;
  2323. padding: 0 5px;
  2324. font-weight: 600;
  2325. }
  2326. .up-item{
  2327. cursor: pointer;
  2328. }
  2329. .up-item:hover{
  2330. cursor: pointer;
  2331. color: #409EFF;
  2332. }
  2333. .shuru{
  2334. border-bottom: 1px solid #DCDFE6;
  2335. cursor: pointer;
  2336. color: #C0C4CC;
  2337. line-height: 36px;
  2338. height: 36px;
  2339. }
  2340. .aite {
  2341. padding: 10px;
  2342. font-size: 16px;
  2343. cursor: pointer;
  2344. width: 40px;
  2345. }
  2346. .aite:hover {
  2347. color: #409EFF;
  2348. }
  2349. .flow-item-start,
  2350. .flow-item {
  2351. background-color: #ECF5FF;
  2352. height: 60px;
  2353. min-width: 280px;
  2354. position: relative;
  2355. margin-right: 40px;
  2356. margin-top: 20px;
  2357. padding: 0 10px;
  2358. border-radius: 5px;
  2359. }
  2360. .flow-box {
  2361. overflow: hidden;
  2362. text-overflow: ellipsis;
  2363. white-space: nowrap;
  2364. width: 230px;
  2365. display: inline-block;
  2366. }
  2367. // .flow-item-start::after {
  2368. // position: absolute;
  2369. // content: '';
  2370. // width: 0;
  2371. // height: 0;
  2372. // border-top: 18px solid transparent;
  2373. // border-left: 20px solid #f4f6f9;
  2374. // border-bottom: 18px solid transparent;
  2375. // border-radius: 2px;
  2376. // top: 0;
  2377. // right: -20px;
  2378. // }
  2379. // .flow-item::before {
  2380. // content: '';
  2381. // position: absolute;
  2382. // width: 0;
  2383. // height: 0;
  2384. // border-top: 18px solid transparent;
  2385. // border-left: 20px solid #fff;
  2386. // border-bottom: 18px solid transparent;
  2387. // border-radius: 2px;
  2388. // top: 0;
  2389. // left: 0px;
  2390. // }
  2391. // .flow-item::after {
  2392. // content: '';
  2393. // position: absolute;
  2394. // width: 0;
  2395. // height: 0;
  2396. // border-top: 18px solid transparent;
  2397. // border-left: 20px solid #f4f6f9;
  2398. // border-bottom: 18px solid transparent;
  2399. // border-radius: 2px;
  2400. // top: 0;
  2401. // right: -20px;
  2402. // }
  2403. .el-icon-warning-outline {
  2404. color: #848484;
  2405. position: relative;
  2406. top: 1px;
  2407. }
  2408. .flow-item-color {
  2409. background-color: #409EFF;
  2410. color: #fff;
  2411. .detailsPonit {
  2412. color: #ffffff;
  2413. }
  2414. .el-icon-warning-outline {
  2415. color: #ffffff;
  2416. }
  2417. }
  2418. .detailsPonit {
  2419. margin-left: 10px;
  2420. font-size: 14px;
  2421. color: #848484;
  2422. cursor: pointer;
  2423. }
  2424. .flow-item-color::after {
  2425. border-left: 20px solid #409EFF;
  2426. }
  2427. .feedDoalog {
  2428. /deep/ .el-dialog__body {
  2429. padding: 0 20px 30px;
  2430. }
  2431. }
  2432. .mentSty {
  2433. max-width: 300px;
  2434. height: 23px;
  2435. display: inline-block;
  2436. }
  2437. // .button-width {
  2438. // button {
  2439. // width: 80px;
  2440. // }
  2441. // }
  2442. .elFrom-margin {
  2443. /deep/ .el-form-item__label {
  2444. padding: 0;
  2445. }
  2446. padding: 0 20px 0 0;
  2447. }
  2448. .processSty {
  2449. margin-top: -20px;
  2450. .proListSty {
  2451. border-bottom: 1px solid #e2e2e2;
  2452. padding: 17px 0;
  2453. .proButt {
  2454. color: #4799ff;
  2455. border: 1px solid #78a1ff;
  2456. font-size: 14px;
  2457. padding: 0px 10px;
  2458. height: 30px;
  2459. }
  2460. .proName {
  2461. font-size: 15px;
  2462. line-height: 30px;
  2463. padding-left: 8px;
  2464. }
  2465. }
  2466. }
  2467. .footer {
  2468. position: fixed;
  2469. bottom: 0;
  2470. left: 0;
  2471. right: 0;
  2472. background-color: #fff;
  2473. border-top: 1px solid #e8e8e8;
  2474. padding: 12px 30px;
  2475. z-index: 100;
  2476. }
  2477. .dian {
  2478. position: absolute;
  2479. right: 10px;
  2480. }
  2481. </style>