123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409 |
- <template>
- <div class="all boxMinHeight">
- <PageHead phName="员工绩效详情"></PageHead>
- <div class="flex-box-ce" style="position: absolute;right: 20px;top: 20px;z-index: 2;">
- <!-- <div style="padding-right: 10px;">
- <el-checkbox v-model="isShowOneselfScore">只看自己评分内容</el-checkbox>
- </div> -->
- <el-select v-model="headvalue" style="width: 250px;" placeholder="请选择" v-if="!isDisabled">
- <el-option v-for="item in headoptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <div v-else class="fontColorB font-flex-word" style="width: 250px;">{{ packageName }}</div>
- </div>
- <header v-loading="staffLoad">
- <div class="flex-box-ce head">
- <div class="flex-box-ce head2User flex-1">
- <userImage class="fl" :id="remployee.id" :user_name="remployee.name" :img_url="remployee.img_url" width="50px" height="50px"></userImage>
- <div class="headTname">
- <div style="">{{ remployee.name }}</div>
- <span v-for="(item, index) in remployee.deptList" :key="index" v-if="remployee.deptList.length > 0">
- <span>{{ item.name }}</span>
- <span v-if="remployee.deptList.length - index > 1">,</span>
- </span>
- </div>
- <img v-if="has_finish" src="@/assets/image/guidang.png" class="guidang" />
- </div>
- <template v-if="!gradeBegin">
- <div class="button-width" v-if="!has_finish">
- <!-- 撤销上一次操作 -->
- <template v-if="revocationShow">
- <el-button @click="isShowCx = true" type="primary">撤销上一次操作</el-button>
- </template>
- <!-- 目标制定节点 -->
- <template v-if="isShowTargetBtn">
- <el-button @click="openFormulate()" type="primary">制定目标</el-button>
- <el-button @click="submit()" type="primary">提交</el-button>
- </template>
- <!-- 目标确认 -->
- <template v-if="isShowConfirmBtn">
- <el-button type="primary" @click="gradeOk">同意</el-button>
- <el-button class="red" type="danger" plain @click="gradeTurn" style="background-color: #fff;">驳回</el-button>
- <el-button v-if="isUpdateIndex" @click="openFormulate()">修改目标</el-button>
- </template>
- <!-- 录入结果值 -->
- <el-button v-if="resultButShow" @click="openResult()" type="primary">录入结果值</el-button>
- <!-- 审批 -->
- <template v-if="examineButShow">
- <el-button type="primary" @click="gradeOk">同意</el-button>
- <el-button class="red" type="danger" plain v-if="isAction" @click="gradeTurn" style="background-color: #fff;">驳回</el-button>
- </template>
- <!-- 评分 -->
- <el-button v-if="gradeButShow" type="primary" @click="gradeClick">评分</el-button>
- <el-button v-if="recordsManagement" @click="isTrack = true">管理记录</el-button>
- <el-button v-if="actionButShow" @click="isPlan = true">执行计划</el-button>
- <el-button v-if="feedbackBut" @click="communication = true">沟通反馈</el-button>
- <!-- 主次管理员,被考核人上级 -->
- <template v-if="$getRole(1) || isSuperior">
- <el-dropdown style="margin-left:10px;" @command="handleCommand">
- <el-button>管理</el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-for="(item, index) in dropdownMenu" :key="index" :command="item.key" :divided="item.bordok" v-if="item.isShow">
- {{ item.name }}
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </div>
- </template>
- </div>
- <!-- 流程 -->
- <div class="flex-box-ce flex-d-wrap">
- <div
- v-for="(item, index) in flow"
- :key="index"
- :class="[item.status == 1 ? 'flow-item-color' : '', index == 0 ? 'flow-item-start' : 'flow-item']"
- class="flex-box-ce"
- >
- <el-tooltip effect="dark" :content="item.code == 'execution' ? execution : item.remarks" placement="top">
- <span class="flow-box">
- <span>{{ index + 1 }}.{{ item.remark }}</span>
- <span v-if="item.code == 'execution'">
- <i class="el-icon-warning-outline"></i>
- :
- </span>
- <template v-if="item.target.length > 0">
- <span v-for="(item2, index2) in item.target" :key="index2">
- {{ item2.employee_name }}
- <span v-if="item.target.length - index2 > 1">,</span>
- </span>
- </template>
- </span>
- </el-tooltip>
- <i class="el-icon-success blue" v-if="item.status == 2" style="margin-right:10px;"></i>
- <div @click.stop="processDet(item)" style="width: 20px;" class="dian" v-if="item.target.length > 0 && !gradeBegin">
- <svg-icon icon-class="detailsPonit" class="detailsPonit" />
- </div>
- <img src="@/assets/image/jt.png" class="flow-img" v-if="index != flow.length - 1 || flow[flow.length - 1].status == 2" />
- </div>
- <template v-if="flow.length > 0">
- <div class="flow-item flex-box-ce flex-center-center" v-if="flow[flow.length - 1].status == 2">
- <span class="flex-1">{{ flow.length + 1 }}.结束</span>
- <i class="el-icon-success blue" style="margin-right:10px;"></i>
- </div>
- </template>
- </div>
- <!-- 考核结果 -->
- <div class="flex-box-end flex-v-ce" style="margin-top: 20px;">
- <template v-if="dimension.length > 0">
- <div class="flex-box-ce result" v-if="dimension[0].final_point" style="margin-right: 20px;">
- <span style="padding-right: 20px;">考核结果分数:{{ dimension[0].final_point }}分</span>
- <span>等级:{{ dimension[0].final_level }}</span>
- </div>
- </template>
- <el-tooltip placement="bottom">
- <div class="popover-box" slot="content">
- <div class="popover-title">开启显示更多可浏览全部考核内容</div>
- <div class="popover-content">点击右边箭头和滑动下方滚动条都可以查看更多内容</div>
- </div>
- <el-switch v-model="isShowOneselfScore" active-text="显示更多"></el-switch>
- </el-tooltip>
- </div>
- <!-- 表格 -->
- <div class="dimensionCla" v-loading="tableLoad">
- <!-- 点击滚动 -->
- <TableBox
- :tableData="dimension"
- :isShowYd="isShowOneselfScore"
- :headerCellStyle="{ background: '#ECF5FF', textAlign: 'center' }"
- :objectSpanMethod="objectSpanMethod"
- >
- <el-table-column prop="theDimension" width="80" label="维度" align="center">
- <template slot-scope="scope">
- <span style="width: 13px;display: inline-block;">{{ scope.row.theDimension }}</span>
- <template v-if="calc_dimension && (scope.row.type == 1 || scope.row.type == 2)">
- <div v-if="!scope.row.toScore">({{ scope.row.dimension_weight }}%)</div>
- </template>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="名称" min-width="220">
- <template slot-scope="scope">
- <template v-if="Number(scope.row.weight) > 0">
- <PreBox :value="scope.row.name + '(权重:' + scope.row.weight + '%)'"></PreBox>
- </template>
- <PreBox v-else :value="scope.row.name"></PreBox>
- </template>
- </el-table-column>
- <template v-if="isShowOneselfScore">
- <el-table-column prop="type" width="100" label="指标类型">
- <template slot-scope="scope">
- <span v-if="scope.row.type == 1">量化指标</span>
- <span v-if="scope.row.type == 2">非量化指标</span>
- <span v-if="scope.row.type == 3">额外加分项</span>
- <span v-if="scope.row.type == 4">额外扣分项</span>
- </template>
- </el-table-column>
- </template>
- <el-table-column prop="target" label="目标值" align="left" min-width="150" v-if="getTableItem('target') || getTableItem('result')">
- <template slot-scope="scope">
- <div v-if="scope.row.target != '-' && scope.row.target != undefined && scope.row.target != '0'">
- 目标值:
- <span>{{ scope.row.target + '' + scope.row.unit }}</span>
- </div>
- <span v-else>-</span>
- <div v-if="scope.row.result != '-' && scope.row.result != undefined" class="yellow">
- 结果值:
- <span>{{ scope.row.result + '' + scope.row.unit }}</span>
- </div>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <template v-if="isShowOneselfScore">
- <el-table-column prop="point_limit" label="加扣分上限" align="center" width="100" v-if="getTableItem('point_limit')">
- <template slot-scope="scope">
- <span>{{scope.row.point_limit}}</span>
- </template>
- </el-table-column>
- </template>
- <el-table-column prop="per_remark" label="考核标准" min-width="200" v-if="getTableItem('per_remark')">
- <template slot-scope="scope">
- <PreBox :value="scope.row.per_remark"></PreBox>
- </template>
- </el-table-column>
- <el-table-column prop="remark" label="备注" min-width="200" v-if="isShowOneselfScore">
- <template slot-scope="scope">
- <PreBox :value="scope.row.remark"></PreBox>
- </template>
- </el-table-column>
- <el-table-column prop="schedule" label="执行计划" align="center" min-width="200" v-if="getTableItem('schedule')">
- <template slot-scope="scope">
- <div class="flex-box-ce" v-if="scope.row.schedule && scope.row.schedule.length > 0">
- <el-button type="text" class="flex-1" @click="openPlan(scope.row.planIndex)">({{ scope.row.schedule.length }}) 条执行计划</el-button>
- </div>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column prop="mamage_record" label="跟踪管理记录" align="center" min-width="200" v-if="getTableItem('mamage_record')">
- <template slot-scope="scope">
- <div class="flex-box-ce" v-if="scope.row.mamage_record && scope.row.mamage_record.length > 0">
- <el-button type="text" class="flex-1" @click="openTrack(scope.row.planIndex)">({{ scope.row.mamage_record.length }}) 条管理记录</el-button>
- </div>
- <span v-else>-</span>
- </template>
- </el-table-column>
- <el-table-column v-for="(item, index) in lingScore_infos" :key="index" min-width="200" v-if="(item.poiSco || item.poicom) && isShowOneself(item)">
- <template slot="header" slot-scope="scope">
- <el-tooltip effect="dark" :content="item.title" placement="top">
- <span>
- <div class="font-flex-word">{{ item.title }}</div>
- </span>
- </el-tooltip>
- </template>
- <el-table-column prop="title" min-width="100" v-if="item.poiSco">
- <template slot="header" slot-scope="scope">
- <span>评分</span>
- </template>
- <template slot-scope="scope">
- <div v-for="(arr, att) in scope.row.score_infos" :key="att">
- <div v-if="arr.newKey == item.newKey">
- <span v-if="arr.employee_id == item.employee_id">
- {{ initData(arr.point) }}
- <span class="blue">{{ arr.level }}</span>
- </span>
- <span v-else>-</span>
- </div>
- </div>
- <span v-if="scope.row.score_infos ? scope.row.score_infos.length == 0 : ''">-</span>
- <!-- 总分分数 -->
- <span v-if="scope.row.toScore">{{ item.totalScore }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="title" min-width="100" v-if="item.poicom">
- <template slot="header" slot-scope="scope">
- <span>说明</span>
- </template>
- <template slot-scope="scope">
- <div v-for="(arr, att) in scope.row.score_infos" :key="att">
- <div v-if="arr.newKey == item.newKey">
- <span v-if="arr.employee_id == item.employee_id"><PreBox :value="initData(arr.remark)"></PreBox></span>
- <span v-else>-</span>
- </div>
- </div>
- <span v-if="scope.row.score_infos ? scope.row.score_infos.length == 0 : ''">-</span>
- <span v-if="scope.row.toScore"><PreBox :value="item.comment"></PreBox></span>
- </template>
- </el-table-column>
- </el-table-column>
- <!-- 输入框 -->
- <template v-if="gradeBegin">
- <!-- 评分输入 -->
- <el-table-column min-width="150" fixed="right">
- <template slot="header" slot-scope="scope">
- <div>{{ scoreTab.title }}</div>
- </template>
- <template slot-scope="scope">
- <div v-if="thecurrentFlow == 'score_supervisor'">
- <el-input
- v-if="ruleScore == 1 && !scope.row.totalScore"
- :rows="1"
- @blur="sgradeBlur(scope.$index)"
- @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] : '')
- ]
- "
- v-model="scope.row.score_grade"
- placeholder="请输入"
- ></el-input>
- <span v-else-if="ruleScore == 1 && scope.row.totalScore">{{ tabTotaScore }}</span>
- <el-input
- v-else-if="ruleScore == 2 && scope.row.totalScore"
- :rows="1"
- @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] : '')
- ]
- "
- v-model="scope.row.score_grade"
- placeholder="请输入"
- ></el-input>
- <span v-else>-</span>
- </div>
- <div v-else>
- <span v-if="scope.row.totalScore">{{ tabTotaScore }}</span>
- <el-input
- v-else
- :rows="1"
- @blur="sgradeBlur(scope.$index)"
- @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] : '')
- ]
- "
- v-model="scope.row.score_grade"
- placeholder="请输入"
- ></el-input>
- </div>
- </template>
- </el-table-column>
- <!-- 说明 -->
- <el-table-column min-width="150" fixed="right">
- <template slot="header" slot-scope="scope">
- <div>{{ scoreTab.explain }}</div>
- </template>
- <template slot-scope="scope">
- <div style="cursor: pointer;">
- <!-- 指标评分说明 -->
- <template v-if="ruleScore == 1 && !scope.row.totalScore">
- <div @click="showPf(scope.$index, 1)">
- <PreBox :value="scope.row.score_remark" v-if="scope.row.score_remark"></PreBox>
- <div v-else class="shuru">请输入</div>
- </div>
- </template>
- <!-- 总分说明 -->
- <template v-if="ruleScore == 2 && scope.row.totalScore">
- <div @click="showPf(scope.$index, 2)">
- <PreBox :value="scope.row.total_score_comment" v-if="scope.row.total_score_comment"></PreBox>
- <div v-else class="shuru">请输入</div>
- </div>
- </template>
- </div>
- </template>
- </el-table-column>
- </template>
- </TableBox>
- </div>
- <Record :record="record"></Record>
- </header>
- <footer class="footer flex-box-end" v-if="gradeBegin">
- <el-button @click="cancel">取消</el-button>
- <el-button class="primaryBtn" @click="save(0)">暂存</el-button>
- <el-button type="primary" @click="save(1)">提交评分</el-button>
- </footer>
- <!-- 上一个 下一个 -->
- <div class="upDown-box" v-if="isDisabled && !gradeBegin">
- <div class="flex-box-ce flex-center-center fontColorB" style="height: 60px;">
- <div class="flex-1 yellow" v-if="!up.employeeID" style="text-align: center;border-right: 1px solid #f1f1f1;">已无待办</div>
- <div class="flex-1 flex-box-ce flex-center-center up-item" v-else style="border-right: 1px solid #f1f1f1;" @click="qieh(1)">
- <userImage :user_name="up.name" :img_url="up.img_url" width="40px" height="40px" fontSize="12"></userImage>
- <div class="upName font-flex-word">{{ up.name }}</div>
- <div>上一个</div>
- </div>
- <div class="flex-1 yellow" v-if="!down.employeeID" style="text-align: center;">已无待办</div>
- <div class="flex-1 flex-box-ce flex-center-center up-item" v-else @click="qieh(2)">
- <div>下一个</div>
- <div class="upName font-flex-word">{{ down.name }}</div>
- <userImage :user_name="down.name" :img_url="down.img_url" width="40px" height="40px" fontSize="12"></userImage>
- </div>
- </div>
- </div>
- <!-- 流程详情 -->
- <BrawerBox :drawerTitle="processDel.remarkDel + proNum" :footNo="false" :showDrawer.sync="isChecks">
- <template slot="main">
- <div class="processSty">
- <div v-for="(item, index) in processDel.target" :key="index" class="flex-box flex-d-center proListSty">
- <div style="width:230px;" class="flex-box flex-d-center flex-h-ce">
- <div>
- <userImage class="fl" :id="item.employee_id" :user_name="item.employee_name" width="30px" height="30px" fontSize="12"></userImage>
- <span class="proName">{{ item.employee_name }}</span>
- </div>
- <el-tag v-if="processDel.status == 0" size="mini" type="warning" color="#ffe7d3" style="color:#ff8d00;">流程未到</el-tag>
- <!-- 针对任一人处理了,其他人显示无需处理 -->
- <template v-else-if="item.status == 1">
- <template v-if="processDel.multi_executor == 2 && getStrus()">
- <el-tag size="mini">无需处理</el-tag>
- </template>
- <template v-else>
- <el-tag size="mini">处理中</el-tag>
- </template>
- </template>
- <el-tag v-else-if="item.status == 2" size="mini" type="success">已处理</el-tag>
- </div>
- <!-- 主子管理员 并且当前节点里包括登录者-->
- <template v-if="$getRole(1) || item.employee_id == userInfo.id">
- <template v-if="processDel.code == 'score_supervisor' || processDel.code == 'special_scorer'">
- <!-- 指定评分人节点 -->
- <template v-if="processDel.code == 'score_supervisor'">
- <el-button v-if="transferBut && item.status == 1 && (processDel.transfer || $getRole(1))" class="proButt" @click="careOf(item)">转交</el-button>
- </template>
- <!-- 特定指标指定评分人,因为默认是可以转交的,所有没有 transfer 字段 -->
- <template v-else>
- <el-button v-if="transferBut && item.status == 1" class="proButt" @click="careOf(item)">转交</el-button>
- </template>
- </template>
- <template v-else-if="processDel.code == 'review' || processDel.code == 'confirm'">
- <el-button
- v-if="transferBut && item.status == 1 && (processDel.action.indexOf('transfer') >= 0 || $getRole(1))"
- class="proButt"
- @click="careOf(item)"
- >
- 转交
- </el-button>
- </template>
- <template v-else>
- <el-button v-if="transferBut && item.status == 1" class="proButt" @click="careOf(item)">转交</el-button>
- </template>
- </template>
- </div>
- </div>
- </template>
- </BrawerBox>
- <!-- 审批同意 -->
- <el-dialog title="意见说明" :visible.sync="examineConsent" width="500px" :close-on-click-modal="false">
- <el-input type="textarea" v-model="tDownList.comment" rows="4" placeholder="请输入意见说明(选填)"></el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="tDlose(1)">取 消</el-button>
- <el-button type="primary" @click="tDownOk(1)">确 定</el-button>
- </span>
- </el-dialog>
- <!--驳回评分 -->
- <BrawerBox drawerTitle="驳回评分" :showDrawer.sync="turnDown">
- <template slot="main">
- <el-form label-position="top" label-width="80px" :rules="rFlowRules" :model="tDownList" ref="tDownList" class="elFrom-margin">
- <el-form-item label="重置到" prop="node_id">
- <el-select v-model="tDownList.node_id" clearable placeholder="请选择阶段" style="width:100%;">
- <el-option v-for="item in rFlowArrive" :key="item.value" :label="item.label" :value="item.value"></el-option>
- </el-select>
- <el-select v-if="rUsers.length > 0" multiple v-model="tDownList.employee_id" clearable placeholder="请选择重置人员" style="width:100%;margin-top: 10px;">
- <el-option v-for="item in rUsers" :key="item.value" :label="item.label" :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="驳回说明" :required="true">
- <el-input type="textarea" rows="7" placeholder="请输入驳回意见(必填)" v-model="tDownList.comment"></el-input>
- </el-form-item>
- </el-form>
- </template>
- <template slot="footer">
- <el-button plain size="" @click="tDlose(0)">取消</el-button>
- <el-button type="primary" @click="tDownOk(0, 'tDownList')">确认</el-button>
- </template>
- </BrawerBox>
- <!-- 重置流程 -->
- <BrawerBox drawerTitle="重置流程" :showDrawer.sync="resetFlow">
- <template slot="main">
- <el-form label-position="top" :rules="rFlowRules" :model="rFlowList" ref="rFlowList" label-width="80px" class="elFrom-margin">
- <el-form-item label="操作">
- <el-radio-group v-model="rFlowList.type">
- <el-radio :label="1">把流程重置到指定节点</el-radio>
- <el-radio :label="2">读取最新的考核模板并重置流程</el-radio>
- </el-radio-group>
- </el-form-item>
- <div v-if="rFlowList.type == 2" style="color: #666;font-size: 12px;position: relative;top: -20px;" class="red">确认后流程将重新开始,回到最开始的节点</div>
- <el-form-item label="指标处理" v-if="rFlowList.type == 2">
- <el-radio-group v-model="rFlowList.overwrite_mode">
- <el-radio :label="2">保留已制定指标</el-radio>
- <el-radio :label="1">重置指标</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="指定节点" prop="node_id" v-if="rFlowList.type == 1">
- <el-select v-model="rFlowList.node_id" clearable placeholder="请选择阶段" style="width:100%;">
- <el-option v-for="item in rFlowArrive" :key="item.value" :label="item.label" :value="item.value"></el-option>
- </el-select>
- <el-select v-if="rUsers.length > 0" multiple v-model="rFlowList.employee_id" clearable placeholder="请选择重置人员" style="width:100%;margin-top: 10px;">
- <el-option v-for="item in rUsers" :key="item.value" :label="item.label" :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="说明" prop="comment">
- <el-input type="textarea" rows="6" placeholder="请输入说明(必填)" v-model="rFlowList.comment" maxlength="200" show-word-limit></el-input>
- </el-form-item>
- </el-form>
- </template>
- <template slot="footer">
- <el-button plain @click="resetFlow = false">取消</el-button>
- <el-button type="primary" @click="rFlowOk('rFlowList')">确认</el-button>
- </template>
- </BrawerBox>
- <!-- 跟踪管理 -->
- <TrackManagement
- :showDrawer.sync="isTrack"
- :isCz="!isCzData"
- :recordMemberIds="recordMemberIds"
- :id="employeeID"
- :apList="apList"
- :assessId="employID"
- @confirm="employeeDet"
- :planIndex="planIndex"
- ></TrackManagement>
- <!-- 执行计划 -->
- <ActionPlan :showDrawer.sync="isPlan" :isCz="!isCzData" :id="employeeID" :apList="apList" :assessId="employID" @confirm="employeeDet" :planIndex="planIndex"></ActionPlan>
- <!-- 沟通反馈 -->
- <BrawerBox drawerTitle="沟通反馈" :showDrawer.sync="communication">
- <template slot="main">
- <el-input type="textarea" v-model="communicationVal" rows="10" placeholder="请输入反馈内容(必填)" maxlength="200" show-word-limit></el-input>
- <div style="height: 20px;"></div>
- <el-checkbox v-model="ding_msg" :true-label="1" :false-label="0">发送钉钉通知</el-checkbox>
- <div class="aite" @click="selectUser = true">@</div>
- <el-tag style="margin: 0 5px;" v-for="(tag, index) in tags" :key="tag.id" closable @close="handleClose(tag, index)">{{ tag.name }}</el-tag>
- </template>
- <template slot="footer">
- <span class="dialog-footer">
- <el-button @click="communication = false">取 消</el-button>
- <el-button type="primary" @click="saveCommunication()">确 定</el-button>
- </span>
- </template>
- </BrawerBox>
- <!-- 沟通反馈 -->
- <EmployeeSelector title="选择@人员" :is_filtration_creator="false" :visible.sync="selectUser" @confirm="confirmCreator" />
- <!-- 转交 -->
- <EmployeeSelector title="选择人员" :is_filtration_creator="false" :multi="false" :isChecKedAll="false" :visible.sync="careOfSelector" @confirm="confirmcareOf" />
- <!-- 评分说明 -->
- <el-dialog title="评分说明" :visible.sync="isShowPf" width="500px" :close-on-click-modal="false">
- <el-input type="textarea" v-model="pfText" rows="4" placeholder="请输入评分说明" maxlength="100" show-word-limit></el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="isShowPf = false">取 消</el-button>
- <el-button type="primary" @click="updateText()">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 撤销操作 -->
- <el-dialog title="撤销" :visible.sync="isShowCx" width="500px" :close-on-click-modal="false">
- <el-input type="textarea" v-model="cxText" rows="4" placeholder="请输入撤销理由" maxlength="200" show-word-limit></el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="isShowCx = false">取 消</el-button>
- <el-button type="primary" @click="revocation()">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 调整目标反馈 -->
- <el-dialog title="调整目标" :visible.sync="isAdjustment" :close-on-click-modal="false" width="700px">
- <div>
- <el-radio-group v-model="radio">
- <div class="flex-box-v">
- <el-radio :label="1" style="margin-bottom: 30px;">
- 仅修改指标内容,不重置流程
- <br />
- <span style="font-size: 12px;color: #C0C4CF;padding-left: 25px;padding-top: 5px;">不影响进行中的考核流程,只对指标内容和信息进行修改</span>
- </el-radio>
- <el-radio :label="2">
- 修改指标,并重置考核流程
- <br />
- <span style="font-size: 12px;color: #C0C4CF;padding-left: 25px;">修改指标并按照新的流程来进行考核,已评分和已审批的记录也会被重置</span>
- </el-radio>
- >
- </div>
- </el-radio-group>
- </div>
- <span slot="footer">
- <el-button @click="isAdjustment = false">取消</el-button>
- <el-button type="primary" @click="setDataAccess">确定</el-button>
- </span>
- </el-dialog>
- <!-- 评分确认 -->
- <el-dialog title="请确认您的评分" :visible.sync="isPoint" :close-on-click-modal="false" width="700px">
- <div>
- <el-table :data="pointList" :header-cell-style="{ background: '#ECF5FF' }" border>
- <el-table-column prop="name" min-width="150" label="指标">
- <template slot="header" slot-scope="scope">
- <span>
- 指标(
- <span style="color:#ff9600;">每项指标评分</span>
- )
- </span>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="score_remark" label="评分说明"></el-table-column> -->
- <el-table-column prop="score" label="评分" align="left"></el-table-column>
- </el-table>
- </div>
- <span slot="footer">
- <el-button @click="isPoint = false">返回修改</el-button>
- <el-button type="primary" @click="score">确定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import BrawerBox from '@/components/public/BrawerBox';
- import PageHead from '@/components/public/PageHead'; //头部---返回
- import Record from '@/components/public/Record';
- import ActionPlan from '@/components/public/ActionPlan';
- import TableBox from '@/components/public/TableBox';
- import TrackManagement from '@/components/public/TrackManagement';
- import EmployeeSelector from '@/components/public/EmployeeSelector';
- export default {
- name: 'staffAssDet',
- components: {
- PageHead,
- BrawerBox,
- Record,
- ActionPlan,
- TableBox,
- TrackManagement,
- EmployeeSelector
- },
- data() {
- return {
- radio: 1,
- isAdjustment: false,
- gradeList: [],
- dropdownMenu: [{ key: 'a', name: '重置流程', isShow: true }, { key: 'b', name: '调整目标', isShow: true }],
- lingScore_infos: [],
- staffLoad: false, //loading
- tableLoad: false, //loading
- execution: '目标制定并确认完毕后,进入到【执行中】阶段,期间员工执行计划,上级跟踪过程。管理员可以点击【开始评分】后,进入结果数据收集和评分阶段',
- isChecks: false, //侧边弹窗
- headvalue: '',
- headoptions: [],
- employeeID: 0, //考核记录ID
- employID: 0, //当前角色ID
- empDetList: {},
- remployee: {}, //被考核人员信息
- flow: [], //步骤
- atPresentFlow: 0, //当前步骤ID
- dimension: [], //维度表格信息
- config: {}, //配置
- tableData: [],
- communication: false, //沟通
- communicationVal: '',
- tags: [], //沟通@人员
- selectUser: false,
- nowFLow: '', //当前的流程
- turnDown: false, //驳回开关
- tDownArrive: [], //驳回到--数据
- tDownList: {
- node_id: '', //重置到某个节点,
- employee_id: [], //重置到节点的某个用户 0表示驳回到节点
- comment: '' //审核意见
- },
- userInfo: this.$getUserData(),
- processDel: {}, //流程侧边栏
- proNum: '', //流程侧边栏头部
- calc_dimension: 0, //是否参与权重
- revocationNodeId: 1, //撤销节点ID
- isShowCx: false,
- cxText: '',
- //按钮显示隐藏
- revocationShow: false, //是否可以撤销
- gradeButShow: false, //评分
- actionButShow: true, //执行计划
- recordsManagement: true, //管理记录
- examineButShow: false, //审批
- isAction: false, //驳回控制
- resultButShow: false, //结果值录入
- gradeBegin: false, //评分确定
- scoreTab: {}, //评分表头
- record: [], //考核记录
- planIndex: [], //执行计划的下标,当点击表格查看时用到
- apList: [], //执行计划数据
- isPlan: false, //计划弹窗
- // 重置流程
- resetFlow: false,
- rFlowArrive: [], //重置节点数据
- rUsers: [], //重置用户数据
- rFlowList: {
- type: 1, //重置类型 1 流程内重置 2 重读维度流程 重置
- node_id: '', //重置到某个节点, (type 1 必填)
- employee_id: [], //重置到节点的某个用户 0表示驳回到节点 (type 1 必填)
- overwrite_mode: 2, //1 从原来考核表覆写,2 从个人考核包重置 (type 2 必填)
- comment: '' //审核意见
- },
- rFlowRules: {
- node_id: [{ required: true, message: '请选择重置节点', trigger: 'change' }],
- comment: [{ required: true, message: '请填写重置说明', trigger: 'blur' }]
- },
- feedbackBut: false, //沟通反馈按钮
- isTrack: false, //跟踪管理
- weight: '指标权重(0%)',
- packageName: '', //考核包名称 结果值录入用到
- ruleScore: 1, //1-指标均要评分 2-评分总结
- thecurrentFlow: '', //当前节点
- tabTotaScore: 0, //表格展示的总分
- mandatoryScore: false, //指标说明是否必填
- mandatoryNote: false, //总分说明是否必填(暂不做)
- scoreInfo: [], //各个节点的人评的总分
- examineConsent: false, //审批
- transferBut: false, //转交按钮
- careOfSelector: false, //转交选人
- careOfPeopleId: 0, //转交的 -- 转出ID
- isCs: false, //是否抄送人进入(抄送人能看到全部评分内容)
- isShowTargetBtn: false, // 目标制定相关
- isShowConfirmBtn: false, //目标确认按钮
- isUpdateIndex: false, //确认人是否允许修改指标
- has_finish: false, //是否归档
- // 评分说明弹窗
- isShowPf: false,
- pfText: '',
- indexText: {
- //定位评分说明
- e: 0,
- index: 0
- },
- isShowOneselfScore: false, //是否只看自己的评分内容
- // 控制上下
- isDisabled: false,
- up: {},
- down: {},
- package_id: '',
- recordMemberIds: [],
- pendingList: '',
- page: 1,
- isJz: true,
- activeName: '', //待办带进来的节点类型
- // 评分确认列表
- pointList: [],
- pointData: {},
- isPoint: false,
- publicity: 0,
- isSuperior: false,
- ding_msg:0
- };
- },
- computed: {
- isCzData() {
- if (this.gradeBegin) {
- return true;
- }
- if (this.has_finish) {
- return true;
- }
- return false;
- },
- isShowOneself() {
- return function(value) {
- if (!this.isShowOneselfScore) {
- if (value.employee_id == this.userInfo.id) {
- return true;
- } else {
- return false;
- }
- } else {
- return true;
- }
- };
- }
- },
- watch: {
- isAdjustment(val) {
- if (!val) {
- this.radio = 1;
- }
- },
- isShowOneselfScore() {
- this.tableLoad = true;
- setTimeout(() => {
- this.tableLoad = false;
- }, 500);
- },
- examineConsent(val) {
- if (!val) {
- this.tDownList = {
- node_id: '', //重置到某个节点,
- employee_id: [], //重置到节点的某个用户 0表示驳回到节点
- comment: '' //审核意见
- };
- }
- },
- isChecks(val) {
- if (!val) {
- this.transferBut = false;
- }
- },
- headvalue(id) {
- this.headoptions.some(item => {
- if (item.id == id) {
- this.packageName = item.name;
- return true;
- }
- });
- // let data = {
- // //缓存的数据用于录入结果后返回页面复原数据
- // employeeID: this.employeeID,
- // employID: this.employID,
- // assID: id
- // };
- // this.$setCache('staffAssDet', data);
- if (this.pendingList) {
- this.employeeDet();
- } else {
- this.employeeDet(true);
- }
- },
- resetFlow(val) {
- if (!val) {
- this.rFlowList = {
- type: 1, //重置类型 1 流程内重置 2 重读维度流程 重置
- node_id: '', //重置到某个节点, (type 1 必填)
- employee_id: [], //重置到节点的某个用户 0表示驳回到节点 (type 1 必填)
- overwrite_mode: 1, //1 从原来考核表覆写,2 从个人考核包重置 (type 2 必填)
- comment: '' //审核意见
- };
- this.$nextTick(() => {
- this.$refs.rFlowList.resetFields();
- });
- }
- },
- 'rFlowList.node_id'(val) {
- if (!val) {
- this.rUsers = [];
- return false;
- }
- this.rFlowArrive.some(item => {
- if (val == item.id) {
- let users = [];
- item.target.map(item2 => {
- if (item2.status == 2) {
- users.push({ value: item2.employee_id, label: item2.employee_name });
- }
- });
- this.rUsers = users;
- return true;
- }
- });
- },
- 'tDownList.node_id'(val) {
- if (!val) {
- this.rUsers = [];
- return false;
- }
- this.rFlowArrive.some(item => {
- if (val == item.id) {
- let users = [];
- item.target.map(item2 => {
- if (item2.status == 2) {
- users.push({ value: item2.employee_id, label: item2.employee_name });
- }
- });
- this.rUsers = users;
- return true;
- }
- });
- },
- flow(val) {
- //重置要用到
- let executionIndex = 0; //执行中下标
- let targetIndex = 0; //目标下标(处理中的)
- let isNoe = true; //是否完成了整个流程
- val.forEach((item, index) => {
- item.index = index + 1;
- if (item.status == 1) {
- targetIndex = index;
- isNoe = false;
- }
- });
- if (targetIndex == 0 && isNoe) {
- //当流程执行完会是0
- targetIndex = val.length;
- }
- let rFlowArrive = val.slice(executionIndex, targetIndex);
- // 过滤掉 抄送与执行中节点,还有节点人员为空的节点
- var arrs = [];
- rFlowArrive.forEach((item, index) => {
- item.value = item.id;
- item.label = item.index + '.' + item.remarks;
- if (item.code == 'cc' || item.code == 'execution' || item.target.length == 0) {
- return;
- }
- arrs.push(item);
- });
- this.rFlowArrive = arrs;
- },
- communication(val) {
- if (!val) {
- this.tags = [];
- this.communicationVal = '';
- }
- },
- isFlow(val) {
- if (!val) {
- this.target = [];
- }
- },
- isShowPf(val) {
- if (!val) {
- this.pfText = '';
- this.indexText = { e: 0, index: 0 };
- }
- }
- },
- created() {
- // let staffAssDet = this.$getCache('staffAssDet'); //缓存的数据
- // if (staffAssDet) {
- // this.employeeID = staffAssDet.employeeID; //个人记录ID
- // this.employID = staffAssDet.employID; //被考核人ID
- // this.assList(staffAssDet.assID);
- // } else {
- this.employeeID = Number(this.$route.query.employeeID); //个人记录ID
- this.employID = Number(this.$route.query.employeeIDs); //被考核人ID
- this.assList(this.$route.query.assID);
- // }
- // 是否显示上下人
- if (this.$route.query.pendingList) {
- this.pendingList = JSON.parse(this.$route.query.pendingList);
- this.activeName = this.$route.query.activeName;
- this.page = this.$route.query.page || 1;
- this.isDisabled = true;
- } else {
- this.isDisabled = false;
- this.activeName = '';
- }
- },
- methods: {
- // 获取待办数据
- getAgency() {
- if (!this.isJz) {
- return false;
- }
- this.page = this.page + 1;
- this.$axios('get', '/api/per/package/msg/agency', { node_type: this.activeName, status: 0, page: this.page, page_size: 10 }).then(res => {
- let list = res.data.data.list;
- let pendingList = [];
- list.forEach(item => {
- if (item.remark.employee_id) {
- //被考核人
- let userInfo = this.$getEmployeeList()[item.remark.employee_id];
- item.userInfo = userInfo;
- pendingList.push({ name: userInfo.name, img_url: userInfo.img_url, employeeID: item.remark.packageEmployee_id, package_name: item.remark.package_name });
- }
- });
- if (list.length < 10) {
- this.isJz = false;
- }
- this.pendingList.push(...pendingList);
- });
- },
- //撤销
- revocation() {
- let params = {
- id: this.employeeID,
- node_id: this.revocationNodeId,
- comment: this.cxText
- };
- this.$axios('post', '/api/per/package/revoke', params)
- .then(res => {
- if (res.data.code == 1) {
- this.$message.success('撤销成功');
- this.employeeDet();
- }
- })
- .finally(() => {
- this.isShowCx = false;
- this.cxText = '';
- });
- },
- // 判断是否能点击列表打开管理记录
- isShowGl() {
- if ((this.$getRole(2) || this.$getRole(3)) && this.recordMemberIds.indexOf(this.$getUserData().id) >= 0) {
- return false;
- } else {
- return true;
- }
- },
- qieh(index) {
- this.employeeID = index == 1 ? this.up.employeeID : this.down.employeeID;
- this.employeeDet('', () => {
- let data = {
- //缓存的数据用于录入结果后返回页面复原数据
- employeeID: this.employeeID,
- employID: this.remployee.id,
- assID: this.package_id
- };
- this.$setCache('staffAssDet', data);
- });
- },
- updateText() {
- let list = this.dimension[this.indexText.e];
- this.indexText.index == 1 ? (list.score_remark = this.pfText) : (list.total_score_comment = this.pfText);
- this.$set(this.dimension, this.indexText.e, list);
- this.isShowPf = false;
- },
- // 填写评分说明
- showPf(e, index) {
- let list = this.dimension[e];
- let text = index == 1 ? list.score_remark : list.total_score_comment; //判断是指标说明,还是总分说明
- this.indexText = { e: e, index: index };
- this.pfText = text;
- this.isShowPf = true;
- },
- // 目标确认-提交
- submit() {
- this.$confirm('请确认提交制定的指标,提交后不能再自行修改!', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消'
- })
- .then(() => {
- let data = {
- id: this.employeeID,
- node_id: this.atPresentFlow,
- submit: 1,
- dimension: JSON.stringify(this.apList)
- };
- this.$axios('post', '/api/per/package/target_set', data).then(res => {
- if (res.data.code == 1) {
- this.$message.success('提交成功');
- this.employeeDet();
- }
- });
- })
- .catch(() => {
- console.log('取消');
- });
- },
- // 判断是否当前被考核人的上级
- getSuperior() {
- this.$axios('get', '/api/per/user/manager_list', { id_code: this.$returnCode(this.remployee.id) }).then(res => {
- let superiorList = res.data.data; //被考核人上级
- superiorList.some(item => {
- if (item.id == this.userInfo.id) {
- this.isSuperior = true;
- return true;
- }
- });
- });
- },
- //判断当有一个人完成,其他显示无需操作
- getStrus() {
- let is = false;
- if (this.processDel.multi_executor == 2) {
- this.processDel.target.some(item => {
- if (item.status == 2) {
- is = true;
- return true;
- }
- });
- return is;
- } else {
- return false;
- }
- },
- //转交
- careOf(data) {
- this.careOfPeopleId = data.employee_id;
- this.careOfSelector = true;
- },
- //转交选人
- confirmcareOf(list) {
- let data = {
- id: this.employeeID, //个人考核记录ID
- node_id: this.processDel.id, //节点ID
- to_employee_id_code: this.$returnCode(list.employee[0].id), //接收用户ID
- from_employee_id_code: this.$returnCode(this.careOfPeopleId) //转出用户ID
- };
- this.$axios('post', '/api/per/package/transfer', data).then(res => {
- if (res.data.code == 1) {
- this.$message.success('转交成功');
- this.isChecks = false;
- this.employeeDet();
- }
- });
- },
- // 打开结果值录入
- openResult() {
- this.$router.push({
- name: 'resultSet',
- query: { id: this.employeeID, packageName: this.packageName }
- });
- },
- // 打开目标制定
- openFormulate() {
- this.$router.push({
- name: 'formulate',
- query: { id: this.employeeID, packageName: this.packageName, nodeId: this.atPresentFlow }
- });
- },
- //打开管理记录
- openTrack(index) {
- this.planIndex = index;
- this.isTrack = true;
- },
- //打开执行计划
- openPlan(index) {
- this.planIndex = index;
- this.isPlan = true;
- },
- //评分--取消
- cancel() {
- this.$confirm('是否暂存当前页面内容?', '提示', {
- confirmButtonText: '暂存',
- cancelButtonText: '不暂存'
- })
- .then(() => {
- this.save(0);
- })
- .catch(() => {
- this.employeeDet();
- this.gradeBegin = false;
- });
- },
- //评分提交
- save(num) {
- let data = {
- id: this.employeeID, //个人考核包ID
- is_submit: num, //是否提交 0否(暂存) 1 是
- node_id: this.atPresentFlow //当前节点
- };
- let point_info = []; //各项评分数据
- let sumData = {
- //总分数据
- total_score: '',
- total_score_comment: ''
- };
- this.dimension.forEach(item => {
- let resultInfo = {};
- if (this.ruleScore == 1 && !item.totalScore) {
- //各项评分
- resultInfo = {
- //评分信息--只评总分不需要
- score: item.score_grade ? item.score_grade : '', //单项目结果值
- score_remark: item.score_remark,
- dimension_key: item.dimension_key, //维度索引
- index_key: item.index_key, //指标索引
- index_id: item.id, //指标ID
- name: item.name,
- // 用于计算分数
- d_weight: item.dimension_weight, //维度权重
- weight: item.weight, //指标权重
- type: item.type //所属指标种类 1-量化指标 2-行为价值观指标 3-额外加分项 4-额外扣分项
- };
- point_info.push(resultInfo);
- } else {
- //等于2:只评总分
- if (item.totalScore) {
- sumData = {
- total_score: item.score_grade ? item.score_grade : '',
- total_score_comment: item.total_score_comment
- };
- }
- }
- });
- let isMust = true,isExplain = true; //isMust验证评分,isExplain验证说明
- if (num == 1) {
- //提交验证必填
- if (this.ruleScore == 1) {
- //各项评分
- point_info.forEach(item => {
- if (this.mandatoryScore) {
- //评分说明必填
- if (!item.score_remark) {
- isExplain = false;
- }
- }
- if (!item.score) {
- isMust = false;
- }
- });
- if (!isMust) {
- this.$message.warning('请输入所有评分');
- return false;
- }
- if (!isExplain) {
- this.$message.warning('请输入所有评分说明');
- return false;
- }
- } else {
- //总分
- if (!sumData.total_score) {
- this.$message.warning('请输入评分总分');
- return false;
- }
- if (this.mandatoryScore) {
- if (!sumData.total_score_comment){
- this.$message.warning('请输入总分说明');
- return false;
- }
- }
- }
- }
- if (this.ruleScore == 1) {
- data.total_score = this.fomatFloat(this.totalPointsCount(point_info), 2); //计算的个人评出的总分(保留小数后两位)
- } else {
- data.total_score = this.fomatFloat(sumData.total_score, 2); //计算的个人评出的总分(保留小数后两位)
- data.total_score_comment = sumData.total_score_comment;
- }
- data.point_info = JSON.stringify(point_info); // 评分信息 -- 填所有评分时必须的字段(传入某指标的分数、说明、维度索引、制表索引、指标ID)
- data.num=num;//判断是暂存还是提交
- let pointList = JSON.parse(JSON.stringify(point_info));
- pointList.push({
- name: '总分',
- score: data.total_score,
- score_remark: data.total_score_comment
- });
- this.pointList = pointList;
- this.pointData = data;
- if (this.ruleScore == 1&&num) {
- //只评总分不需要弹窗
- this.isPoint = true;
- } else {
- this.score();
- }
- },
- score() {
- this.$axios('post', '/api/per/package/submit_score', this.pointData).then(res => {
- this.$message.success(this.pointData.num==0? '暂存成功':'评分成功');
- this.gradeBegin = false;
- this.isPoint = false;
- this.employeeDet();
- });
- },
- fomatFloat(src, pos) {
- return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
- },
- //计算总分
- totalPointsCount(data) {
- let ct = this.empDetList.calc_type; //1-加和计算 2-加权计算
- let cd = this.empDetList.calc_dimension; //是否维度权重参与计算 1-是 0-否
- let num = 0;
- data.forEach(item => {
- if (item.score) {
- if (item.type == 3) {
- //3-额外加分项
- num += Number(item.score);
- } else if (item.type == 4) {
- //4-额外扣分项 不计算
- num -= Number(item.score);
- } else {
- if (ct == 1 && cd == 0) {
- //加和
- num += Number(item.score);
- } else if (ct == 1 && cd == 1) {
- //加和--维度权重参与计算
- num += Number(item.score) * Number(item.d_weight / 100);
- } else if (ct == 2 && cd == 0) {
- //加权
- num += Number(item.score) * Number(item.weight / 100);
- } else if (ct == 2 && cd == 1) {
- //加权--维度权重参与计算
- num += Number(item.score) * Number(item.d_weight / 100) * Number(item.weight / 100);
- }
- }
- }
- });
- return num;
- },
- sgradeBlur(e) {
- let list = this.dimension[e];
- let tPoints = [];
- this.dimension.forEach(item => {
- if (item.score_grade) {
- tPoints.push({
- score: item.score_grade, //分值
- d_weight: item.dimension_weight, //维度权重
- weight: item.weight, //指标权重
- type: item.type //所属指标种类 1-量化指标 2-行为价值观指标 3-额外加分项 4-额外扣分项
- });
- }
- });
- this.tabTotaScore = this.fomatFloat(this.totalPointsCount(tPoints), 2);
- },
- sgradeInp(e, item) {
- //e当前行 ,item用于判断当前输入是否超过评分上限
- let list = this.dimension[e];
- if (item) {
- if (item.type == 3 || item.type == 4) {
- if (item.point_limit != '-') {
- if (item.score_grade > Number(item.point_limit)) {
- this.$message.error('评分超过上限');
- list.score_grade = '';
- this.$set(this.dimension, e, list);
- return false;
- }
- }
- }
- }
- this.$set(this.dimension, e, list);
- },
- //绩效包列表
- assList(assID) {
- let params = {
- page: 0, //当期页
- employee_id_code: this.$returnCode(this.employID),
- };
- this.staffLoad = true;
- this.$axios('get', '/api/per/package/list', params).then(res => {
- if (res.data.code == 1) {
- this.headoptions = res.data.data.list;
- this.headvalue = Number(assID);
- }
- });
- },
- setUpD() {
- let pendingList = this.pendingList;
- this.up = {};
- this.down = {};
- pendingList.some((item, index) => {
- if (this.employeeID == item.employeeID) {
- this.packageName = item.package_name;
- if (pendingList[index - 1]) {
- this.up = pendingList[index - 1];
- }
- if (pendingList[index + 1]) {
- this.down = pendingList[index + 1];
- }
- if (index == pendingList.length - 2 && pendingList.length >= 10) {
- //如果当点击到待办人员的倒数第二个,加载剩余的
- this.getAgency();
- }
- return true;
- }
- });
- },
- // 绩效考核详情
- employeeDet(is, func = function() {}) {
- let params = {};
- // 重置按钮状态
- (this.revocationShow = false), (this.gradeButShow = false);
- this.examineButShow = false;
- this.isAction = false;
- this.resultButShow = false;
- this.isShowTargetBtn = false;
- this.isShowConfirmBtn = false;
- this.isUpdateIndex = false;
- this.atPresentFlow = 0;
- this.nowFLow = '';
- if (is) {
- params.package_id = this.headvalue;
- params.employee_id_code = this.$returnCode(this.employID); //用户ID
- } else {
- params.id = this.employeeID; //个人考核记录ID
- }
- this.staffLoad = true;
- this.$axios('get', '/api/per/package/employee/info', params)
- .then(res => {
- if (res.data.code == 1) {
- let data = res.data.data;
- this.has_finish = data.has_finish;
- this.recordMemberIds = data.record_member_ids;
- this.empDetList = data;
- this.employeeID = data.id; //考核记录id
- this.package_id = data.package_id;
- this.publicity = data.publicity;
- if (this.pendingList) {
- this.setUpD();
- }
- this.remployee = this.$getEmployeeList()[data.relevance_employee.id]; //被考核人员信息
- this.remployee.deptList = data.relevance_employee.dept_list; //部门
- data.flow.map(item => {
- if (item.target && item.target.length > 0) {
- item.target.map(item2 => {
- item2.employee_name = this.$getEmployeeList()[item2.employee_id].name;
- });
- }
- });
- this.flow = data.flow; //流程
- this.config = data.config;
- this.calc_dimension = data.calc_dimension; //是否参与权重
- this.apList = JSON.parse(JSON.stringify(data.dimension));
- this.scoreInfo = data.score_info; //各个节点的人评的总分
- // 沟通反馈是否启用
- this.feedbackBut = data.config.assessment.feedback == '1' ? true : false;
- let point_scope = data.config.assessment.point_scope; //评分可见权限
- let point_comment = data.config.assessment.point_comment; //说明可见权限
- let executor = {}; //与当前登录账号相同的执行人
- let review = {}; //与当前登录账号相同的审批人
- data.flow.forEach((item, index) => {
- if (item.code == 'execution') {
- //查找 已开始或已结束的执行节点中有无当前账号
- if (item.status != 0) {
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id) {
- executor = tar; //存入与当前登录账号相同的执行人
- executor.newCode = 'employee'; //保存执行人节点code
- }
- });
- }
- }
- if (item.code == 'review') {
- //查找 已开始或已结束的审批节点中有无当前账号
- if (item.status != 0) {
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id) {
- review = tar; //存入与当前登录账号相同的审批人
- review.newCode = 'reviewer'; //保存审批人节点code
- }
- });
- }
- }
- //当前步骤
- if (item.status == 1) {
- // 判断是否显示撤销按钮
- if (item.code != 'cc') {
- this.isRevocation(item, data.flow[index - 1]);
- }
- this.nowFLow = item.code;
- this.atPresentFlow = item.id;
- this.setBtn(item); //其他按钮控制
- if (item.code == 'target' || item.code == 'confirm') {
- //当是目标制定,目标确认时,隐藏调整目标按钮
- this.dropdownMenu[1].isShow = false;
- } else {
- this.dropdownMenu[1].isShow = true;
- }
- //审批按钮
- if (item.code == 'review') {
- let reviewif = false;
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id && tar.status == 1) {
- reviewif = true;
- }
- });
- this.examineButShow = reviewif ? true : false;
- this.isAction = item.action.indexOf('refuse') >= 0 ? true : false;
- }
- }
- let remName = item.remark;
- item.target.forEach((add, att) => {
- remName += add.employee_name;
- remName += item.target.length - att > 1 ? ',' : '';
- });
- item.remarks = remName;
- item.remarkDel = item.remark.split(':')[0];
- });
-
- if (this.atPresentFlow == 0) {
- //如果当前节点id为0,代表此考核详情已完毕,把最后一个节点作为当前节点
- this.atPresentFlow = data.flow[data.flow.length - 1].id;
- // 判断抄送节点里是否包含当前登录者
- let cs = data.flow[data.flow.length - 1];
- cs.target.some(item => {
- if (item.employee_id == this.userInfo.id) {
- this.isCs = true;
- return true;
- }
- });
- }
- //整合表格格式
- let dimension = data.dimension;
- let dimeTab = [];
- let gradeTab = [];
- let weight = 0; //权重统计
- dimension.forEach((item, keys) => {
- item.index.forEach((arr, index) => {
- weight += Number(arr.weight);
- arr.wdLeg = 0; //其他这个指标集合的指标给值为0
- item.index[0].wdLeg = item.index.length; //找出这个指标集合的第一个并给与他的长度
- arr.theDimension = item.name;
- arr.dimension_weight = item.dimension_weight; //维度权重
- arr.score_infos = [];
- arr.planIndex = [keys, index]; //当打开执行计划时的下标
- arr.per_remark = this.initData(arr.per_remark);
- arr.remark = this.initData(arr.remark);
- arr.target = this.initData(arr.target);
- arr.result = this.initData(arr.result);
- arr.point_limit = this.initData(arr.point_limit);
- if (item.index_type == 3 || item.index_type == 4) {
- arr.weight = this.initData(Number(arr.weight));
- }
- // 权限区分
- arr.score_info.forEach((list, auto) => {
- if (list.id <= this.atPresentFlow) {
- //atPresentFlow为当前节点id。。数据-id <= 当前节点id . :筛选出当前节点及之前的评分节点的数据
- list.employees.forEach(emplo => {
- //获取code
- data.flow.forEach(codes => {
- if (codes.id == list.id) {
- emplo.code = codes.code;
- codes.target.some(tar => {
- //找到每个评分人获取评分状态
- if (tar.employee_id == emplo.employee_id) {
- emplo.status = tar.status;
- return true;
- }
- });
- }
- });
- emplo.id = list.id;
- emplo.newKey = Number(emplo.id + '' + emplo.employee_id); //给一个唯一key,目的:找到不同节点的相同的人 去重
- arr.score_infos.push(emplo);
- gradeTab.push(emplo);
- });
- }
- });
- dimeTab.push(arr);
- });
- });
- this.weight = '指标权重(' + weight + '%)';
- let poiSco = data.config.assessment.point_scope; //评分可见权限
- let poicom = data.config.assessment.point_comment; //说明可见权限
- let duplicat = this.duplicateRemoval(gradeTab, 'newKey');
- duplicat.forEach(item => {
- if (item.code == 'review') {
- //审批
- item.newCode = 'reviewer';
- } else if (item.code == 'execution') {
- //执行中
- item.newCode = 'employee';
- } else if (item.code == 'score_supervisor') {
- //指定上级
- item.newCode = 'manager';
- } else if (item.code == 'special_scorer') {
- //特定上级
- item.newCode = 'special';
- }
- //item为评分数据,数据内只有两个节点:指定(score_supervisor,权限名:manager) 特定上级(special_scorer,权限名:special)
- //poiSco 评分权限
- //poicom 说明权限
- //executor 执行人中的当前登陆账号
- //review 审批人中的当前登陆账号
- if (executor.employee_id) {
- //若有数据,那么当前登录账号必定在执行人中并且执行节点正在执行或已结束(哪怕正在执行也无所谓,前方已经过滤评分数据,会得到[])
- if (poiSco[executor.newCode] == '2') {
- //已有数据并且为2 ‘查看所有的’ ,那就可以将所有的评分权限都改为 ‘2’
- for (let i in poiSco) {
- poiSco[i] = '2';
- }
- }
- if (poicom[executor.newCode] == '2') {
- //说明同上
- for (let i in poicom) {
- poicom[i] = '2';
- }
- }
- }
- if (review.employee_id) {
- //审批节点--同上 (审批节点默认为2,可以直接全部变成2)
- if (poiSco[review.newCode] == '2') {
- for (let i in poiSco) {
- poiSco[i] = '2';
- }
- }
- if (poicom[review.newCode] == '2') {
- //说明同上
- for (let i in poicom) {
- poicom[i] = '2';
- }
- }
- }
- if (item.employee_id == executor.employee_id) {
- //判断当前评分数据是否 与 执行节点的当前帐号一致
- if (poiSco[executor.newCode] == '2') {
- //如果一致并且执行节点为‘2’即查看所有,那么就修改当前 评分数据 的权限也为‘2’
- poiSco[item.newCode] = '2';
- }
- if (poicom[executor.newCode] == '2') {
- //执行中的 -- 说明权限-同上
- poicom[item.newCode] = '2';
- }
- }
- if (item.employee_id == review.employee_id) {
- //判断当前评分数据是否 与 审批节点的当前帐号一致
- if (poiSco[review.newCode] == '2') {
- poiSco[item.newCode] = '2';
- }
- if (poicom[review.newCode] == '2') {
- //审批的 -- 说明权限-同上
- poicom[item.newCode] = '2';
- }
- }
- });
- let poiSOk = false; //评分--为true时所有评分可看
- let poiCOk = false; //说明--为true时所有说明可看
- duplicat.forEach(item => {
- if (poiSco[item.newCode] == '1' && item.employee_id == this.userInfo.id) {
- item.poiSco = true;
- } else if (poiSco[item.newCode] == '2') {
-
- //当前 评分 数据权限等于2时并且 (当前数据id为登陆账号 或 执行中权限等于2(代表当前登陆账号为执行中的一员 或 审批权限等于2(代表当前登陆账号为审批中的一员)) 时,所有评分都可见
- if (item.employee_id == this.userInfo.id || poiSco[executor.newCode] == '2' || poiSco[review.newCode] == '2') {
- poiSOk = true;
- }
- }
- //说明可见权限。
- if (poicom[item.newCode] == '1' && item.employee_id == this.userInfo.id) {
- //说明--同上
- item.poicom = true;
- } else if (poicom[item.newCode] == '2') {
- if (item.employee_id == this.userInfo.id || poicom[executor.newCode] == '2' || poicom[review.newCode] == '2') {
- poiCOk = true;
- }
- }
- });
- duplicat.forEach(item => {
- if (poiSOk || this.$getRole(1) || this.isCs) {
- item.poiSco = true;
- }
- if (poiCOk || this.$getRole(1) || this.isCs) {
- item.poicom = true;
- }
- });
- //遍历列表总分
- let scoreListInfo = [];
- let totSco = false;
- let points = []; //最终显示评分
- this.scoreInfo.forEach(item => {
- item.employees.forEach(arr => {
- arr.newKey = Number(item.id + '' + arr.employee_id);
- arr.codeId = item.id;
- scoreListInfo.push(arr);
- });
- });
- duplicat.forEach((item, index) => {
- scoreListInfo.forEach(arr => {
- if (item.newKey == arr.newKey) {
- item.totalScore = arr.point;
- item.comment = arr.comment;
- if (arr.point) {
- totSco = true;
- }
- }
- });
- if (item.status != 2 && item.id != this.atPresentFlow) {
- delete duplicat[index]
- } else {
- points.push(item);
- }
- });
- points.sort(this.rule('id')); //跟距ID排序
-
- this.lingScore_infos = points; //表格 评分、说明 头部
- let toScore = {
- theDimension: '总分',
- wdLeg: 0,
- toScore: true
- };
- if (totSco) {
- let poiScoDimeTab = false;
- duplicat.forEach(item => {
- if (item.poiSco) {
- poiScoDimeTab = true;
- }
- });
- if (poiScoDimeTab) {
- dimeTab.push(toScore);
- this.$nextTick(() => {
- //刷新总分--行
- dimeTab.forEach((item, index) => {
- if (item.toScore) {
- this.sgradeInp(index);
- }
- });
- });
- }
- }
- //流程结束后的判断
- this.pdLc();
- if (data.publicity == 1 && (!this.nowFLow || this.nowFLow == 'review')) {
- //判断是否公开,并且是审批节点或者流程结束,(流程结束nowFLow为空)
- dimeTab[0].final_point = data.final_point; //考核结果--总分
- dimeTab[0].final_level = data.final_level; //考核结果--等级
- dimeTab[0].doing_id = 11;
- dimeTab[0].zfLeg = dimeTab.length;
- }
- this.dimension = dimeTab; //表格数据
- //记录
- let record = res.data.data.record;
- record.forEach(item => {
- item.userData = this.$getEmployeeList()[item.employee_id];
- });
- this.record = record;
- func();
- }
- })
- .finally(() => {
- this.staffLoad = false;
- this.getSuperior();
- });
- },
- // 判断是否显示撤销按钮
- isRevocation(dqItem, upItem) {
- // 当前只需要评分节点需要撤回
- //当前节点包含自己并且其他任意一人未完成的显示按钮
- if (dqItem.code == 'score_supervisor' || dqItem.code == 'special_scorer') {
- dqItem.target.some((item, index) => {
- if (item.employee_id == this.userInfo.id && item.status == 2) {
- dqItem.target.some((item2, index2) => {
- if (item2.status == 1) {
- this.revocationNodeId = dqItem.id;
- this.revocationShow = true;
- return true;
- }
- });
- }
- });
- }
- let is = true; //判断当前节点人员是否有完成的
- //上一节点中包含登录者并且是完成的状态显示按钮
- if (upItem) {
- dqItem.target.some((item, index) => {
- if (item.status == 2) {
- is = false;
- }
- });
- if (upItem.code == 'score_supervisor' || upItem.code == 'special_scorer') {
- upItem.target.some((item, index) => {
- if (item.employee_id == this.userInfo.id && item.status == 2 && is) {
- this.revocationNodeId = upItem.id;
- this.revocationShow = true;
- return true;
- }
- });
- }
- }
- },
- pdLc() {
- let flow = JSON.parse(JSON.stringify(this.flow)).reverse(); //反转流程,找第一个评分节点
- //流程结束,但是最后一个“评分”节点里有自己显示撤销
- if (this.publicity == 1) {
- flow.some(item => {
- if (item.code == 'review' || item.code == 'cc') {
- return true;
- }
- if (item.code == 'score_supervisor' || item.code == 'special_scorer') {
- item.target.some(e => {
- if (e.employee_id == this.userInfo.id && e.status == 2) {
- this.revocationNodeId = item.id;
- this.revocationShow = true;
- return true;
- }
- });
- return true;
- }
- });
- }
- },
- // 各按钮控制
- setBtn(item) {
- // 目标制定
- if (item.code == 'target') {
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id && tar.status == 1) {
- this.isShowTargetBtn = true;
- }
- });
- return;
- }
- // 目标确认
- if (item.code == 'confirm') {
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id && tar.status == 1) {
- this.isShowConfirmBtn = true;
- }
- });
- this.isUpdateIndex = item.action.indexOf('index') >= 0 ? true : false;
- return;
- }
- //评分按钮
- if (item.code == 'score_self' || item.code == 'score_mutual' || item.code == 'score_supervisor' || item.code == 'special_scorer') {
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id && tar.status == 1) {
- this.gradeButShow = true;
- }
- });
- return;
- }
- //结果值录入按钮
- if (item.code == 'result_value') {
- item.target.forEach(tar => {
- if (tar.employee_id == this.userInfo.id) {
- this.resultButShow = true;
- }
- });
- return;
- }
- },
- //去重
- duplicateRemoval(data, name) {
- let bbt = {};
- let abbts = data.reduce((cur, next) => {
- bbt[next[name]] ? '' : (bbt[next[name]] = true && cur.push(next));
- return cur;
- }, []);
- return abbts;
- },
- //跟距ID排序
- rule(key) {
- return function(a, b) {
- // sort 默认接受a,b两个参数表示数组中的值
- var value1 = a[key];
- var value2 = b[key];
- return value1 - value2;
- };
- },
- groupBy(data, params) {
- const groups = {};
- data.forEach(v => {
- const group = JSON.stringify(v[params]);
- groups[group] = groups[group] || [];
- groups[group].push(v);
- });
- return Object.values(groups);
- },
- //数据初始化,没有值或者空数组的显示-
- initData(str) {
- if (str == null) {
- return str ? str : '-';
- }
- if (typeof str == 'object') {
- return str.length > 0 ? str : '-';
- } else {
- return str ? str : '-';
- }
- },
- // 根据数据结构显示table,
- getTableItem(str) {
- let dimension = this.dimension;
- let is = false;
- dimension.some(item => {
- for (var key in item) {
- if (str == key) {
- if (typeof item[key] == 'object') {
- //是数组并且长度大于0
- if (item[key].length > 0) {
- is = true;
- return true;
- }
- } else {
- if (key == 'target') {
- if (item[key] != '0' && item[key] != '-') {
- //是有数据并且!= -
- is = true;
- return true;
- }
- } else {
- if (item[key] != '-') {
- //是有数据并且!= -
- is = true;
- return true;
- }
- }
- }
- }
- }
- });
- return is;
- },
- //流程点击
- processDet(data) {
- console.log(JSON.stringify(data))
- this.processDel = data;
- this.isChecks = true;
- if (data.target.length == 0) {
- this.proNum = '';
- } else {
- let arr = 0;
- data.target.forEach((item, index) => {
- if (item.status == 2) {
- arr++;
- }
- });
- this.proNum = '(' + arr + '/' + data.target.length + ')';
- }
- let code = this.processDel.code;
- if (this.processDel.status == 1) {
- //当是目标制定,目标确认 结果值录入,上级评分,指定人评分,审批时显示转交按钮
- if (code == 'target' || code == 'confirm' || code == 'score_supervisor' || code == 'special_scorer' || code == 'result_value' || code == 'review') {
- this.transferBut = true;
- } //当上级评分,指定人评分,判断是否具有转交权限
- }
- },
- handleCommand(val) {
- //管理选项
- if (val == 'a') {
- //重置流程
- this.resetFlow = true;
- } else if (val == 'b') {
- this.isAdjustment = true;
- }
- },
- //
- setDataAccess() {
- this.isAdjustment = false;
- if (this.radio == 2) {
- //调整目标
- this.$router.push({
- name: 'adjustment',
- query: { id: this.employeeID }
- });
- } else {
- //调整目标
- this.$router.push({
- name: 'adjustment2',
- query: { id: this.employeeID }
- });
- }
- },
- // 沟通反馈
- saveCommunication() {
- if (!this.communicationVal) {
- this.$message.error('请输入沟通内容');
- return false;
- }
- let target_id = this.tags.map(item => {
- return item.id;
- });
- this.$axios('post', '/api/per/package/negotiation', {
- id: this.employeeID,
- content: this.communicationVal,
- target_id: JSON.stringify(target_id),
- ding_msg:this.ding_msg,
- }).then(res => {
- this.$message.success('已沟通');
- this.employeeDet();
- this.ding_msg=0;
- this.communication = false;
- });
- },
- confirmCreator(e) {
- this.tags = e.employee;
- },
- handleClose(tag, index) {
- this.tags.splice(index, 1);
- },
- //评分按钮
- gradeClick() {
- this.gradeBegin = true;
- let dnsion = [];
- this.dimension.forEach(item => {
- if (!item.toScore) {
- item.score_infos.forEach(arr => {
- if (arr.employee_id == this.userInfo.id && arr.id == this.atPresentFlow) {
- item.score_grade = arr.point; //某指标的分数
- item.score_remark = arr.remark; //评分说明
- dnsion.push(item);
- }
- });
- }
- });
- let data = {};
- dnsion.forEach(item => {
- item.wdLeg = 0;
- });
- let totalScore = {
- theDimension: '总分',
- wdLeg: 0,
- totalScore: true
- };
- this.flow.forEach(item => {
- if (item.code == 'score_supervisor' && item.status == 1) {
- this.ruleScore = item.rule == 2 ? 2 : 1; //1-指标均要评分 2-评分总结
- this.thecurrentFlow = 'score_supervisor';
- totalScore.codeId = item.id;
- } else if (item.code == 'special_scorer' && item.status == 1) {
- this.ruleScore = 1;
- }
- if ((item.code == 'score_supervisor' && item.status == 1) || (item.code == 'special_scorer' && item.status == 1)) {
- //上级评分,特定评分 评分人必填项
- item.action.forEach(arr => {
- this.mandatoryScore = arr == 'comment' ? true : false; //指标说明是否必填
- });
- }
- });
- this.scoreInfo.forEach(item => {
- item.employees.forEach(arr => {
- if (arr.employee_id == this.userInfo.id) {
- this.tabTotaScore = arr.point ? arr.point : 0;
- if (item.id == totalScore.codeId && this.ruleScore == 2) {
- totalScore.score_grade = arr.point;
- totalScore.total_score_comment = arr.comment ? arr.comment : '';
- }
- }
- });
- });
- let dimenList = [];
- let users = []; //当前节点的自己的信息
- this.flow.forEach(item => {
- //根据流程当前节点,找节点的人员中的登陆者
- if (item.status == 1) {
- item.target.some(arr => {
- if (arr.employee_id == this.userInfo.id) {
- arr.flowStatusId = item.id; //当前节点的ID
- users = arr;
- return true;
- }
- });
- }
- });
- users.list.forEach(att => {
- //获取当前节点审批人员中的登陆者
- dnsion.forEach((add, index) => {
- if (att.index_id == add.id && att.dimension_key == add.planIndex[0] && att.index_key == add.planIndex[1]) {
- //因为不同维度下可能存在相同的指标,所以也要判断他的维度是否一致
- add.dimension_key = att.dimension_key; //维度索引
- add.index_key = att.index_key; //指标索引
- add.score_infos.forEach(user => {
- //显示的文案,找到当前登录人
- if (user.id == users.flowStatusId) {
- if (user.employee_id == this.userInfo.id) {
- this.scoreTab.title = user.title;
- this.scoreTab.explain = user.title.split(':')[0] + '说明';
- }
- }
- });
- dimenList.push(add);
- }
- });
- });
- dimenList.push(totalScore);
- this.$nextTick(() => {
- this.dimension = dimenList;
- });
- },
- gradeTurn() {
- //评分驳回按钮
- this.turnDown = true;
- },
- gradeOk() {
- //评分驳回按钮
- this.examineConsent = true;
- },
- tDownOk(num, formName) {
- let tDownList = this.tDownList;
- if (num == 1) {
- let data = {
- id: this.employeeID, //个人考核包ID
- agree: 1, //同意1 驳回0
- c_node_id: this.atPresentFlow, //当前节点ID
- comment: tDownList.comment //审核意见
- };
- this.tDownHttpJx(1, data);
- } else if (num == 0) {
- //驳回
- this.$refs[formName].validate(valid => {
- if (valid) {
- if (tDownList.employee_id.length == 0) {
- this.$message.error('至少选择一名重置人员');
- return false;
- }
- if (!tDownList.comment) {
- this.$message.error('请输入驳回说明');
- return false;
- }
- this.$confirm('流程将驳回到选中节点,已完成的节点需要重新进行处理,确认重置流程?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- let data = {
- id: this.employeeID, //个人考核包ID
- agree: 0, //同意1 驳回0
- node_id: tDownList.node_id, //重置到某个节点, (type 1 必填)
- c_node_id: this.atPresentFlow, //当前节点ID
- employee_id_code: this.$returnCode(tDownList.employee_id), //重置到节点的某个用户 string(JSOn)
- comment: tDownList.comment //审核意见
- };
- this.tDownHttpJx(0, data);
- })
- .catch(() => {});
- } else {
- return false;
- }
- });
- }
- },
- tDownHttpJx(num, data) {
- this.$axios('post', '/api/per/package/review', data).then(res => {
- this.$message.success('提交成功');
- this.tDlose(num);
- this.employeeDet();
- });
- },
- tDlose(num) {
- //驳回侧边栏关闭
- if (num == 0) {
- this.turnDown = false;
- } else if (num == 1) {
- this.examineConsent = false;
- }
- },
- //重置确定
- rFlowOk(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- let rFlowList = this.rFlowList;
- if (rFlowList.type == 1) {
- if (rFlowList.employee_id.length == 0) {
- this.$message.error('至少选择一名重置人员');
- return false;
- }
- }
- this.$confirm('流程将重置,已完成的节点需要重新进行处理,确认重置流程?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- let data;
- if (rFlowList.type == 1) {
- data = {
- id: this.employeeID, //个人考核包ID
- type: rFlowList.type, //重置类型 1 流程内重置 2 重读维度流程 重置
- node_id: rFlowList.node_id, //重置到某个节点, (type 1 必填)
- employee_id_code: this.$returnCode(rFlowList.employee_id), //重置到节点的某个用户 string(JSOn)
- comment: rFlowList.comment //审核意见
- };
- } else {
- data = {
- id: this.employeeID, //个人考核包ID
- type: rFlowList.type, //重置类型 1 流程内重置 2 重读维度流程 重置
- overwrite_mode: rFlowList.overwrite_mode, //1 从原来考核表覆写,2 从个人考核包重置 (type 2 必填)
- comment: rFlowList.comment //审核意见
- };
- }
- this.$axios('post', 'api/per/package/reset_flow', data).then(res => {
- this.$message.success('提交成功');
- this.resetFlow = false;
- this.employeeDet();
- });
- })
- .catch(() => {});
- } else {
- return false;
- }
- });
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (!this.gradeBegin && !row.toScore) {
- if (columnIndex === 0) {
- return {
- rowspan: row.wdLeg,
- colspan: 1
- };
- }
- }
- if (row.zfLeg) {
- //考核结果、绩效等级
- if (column.label == '考核结果' || column.label == '绩效等级') {
- if (rowIndex != 1) {
- return {
- rowspan: row.zfLeg,
- colspan: 1
- };
- } else {
- return {
- rowspan: 0,
- colspan: 0
- };
- }
- }
- }
- }
- },
- beforeRouteLeave(to, from, next) {
- if (to.name != 'formulate' && to.name != 'resultSet') {
- localStorage.removeItem('staffAssDet');
- }
- next();
- }
- };
- </script>
- <style scoped lang="scss">
- .guidang {
- margin-left: 20px;
- width: 70px;
- animation: example 1s;
- }
- @keyframes example {
- from {
- transform: scale(1.4);
- }
- to {
- transform: scale(1);
- }
- }
- .popover-box {
- opacity: 1;
- border-radius: 4px;
- width: 250px;
- }
- .popover-title {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- text-align: center;
- color: #ffcb00;
- margin-bottom: 10px;
- }
- .popover-content {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- opacity: 1;
- color: #fff;
- }
- .result {
- border: 2px solid #ff9600;
- padding: 5px 10px;
- color: #ff9600;
- text-align: center;
- }
- .flow-img {
- width: 20px;
- position: absolute;
- right: -30px;
- }
- .all {
- position: relative;
- font-size: 14px;
- background-color: #fff;
- padding: 20px;
- header {
- margin-bottom: 60px;
- .head {
- border-top: 1px solid #e6e6e6;
- border-bottom: 1px solid #e6e6e6;
- padding: 20px 0;
- margin-top: 10px;
- }
- .head2User {
- .headTname {
- padding: 7px 0 0 15px;
- div {
- padding: 0 0 3px 0;
- font-size: 15px;
- }
- span {
- font-size: 13px;
- color: #969696;
- }
- }
- }
- }
- }
- .upDown-box {
- position: fixed;
- bottom: 10px;
- left: 50%;
- background-color: #fff;
- z-index: 100;
- width: 370px;
- height: 60px;
- border-radius: 100px;
- margin-left: -185px;
- box-shadow: 0 0 5px #999999;
- }
- .upName {
- width: 80px;
- text-align: center;
- padding: 0 5px;
- font-weight: 600;
- }
- .up-item {
- cursor: pointer;
- }
- .up-item:hover {
- cursor: pointer;
- color: #238dfa;
- }
- .shuru {
- border-bottom: 1px solid #dcdfe6;
- cursor: pointer;
- color: #c0c4cc;
- line-height: 36px;
- height: 36px;
- }
- .aite {
- padding: 10px;
- font-size: 16px;
- cursor: pointer;
- width: 40px;
- }
- .aite:hover {
- color: #26a2ff;
- }
- .flow-item-start,
- .flow-item {
- background-color: #ecf5ff;
- height: 60px;
- min-width: 280px;
- position: relative;
- margin-right: 40px;
- margin-top: 20px;
- padding: 0 10px;
- border-radius: 5px;
- }
- .flow-box {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- width: 230px;
- display: inline-block;
- }
- // .flow-item-start::after {
- // position: absolute;
- // content: '';
- // width: 0;
- // height: 0;
- // border-top: 18px solid transparent;
- // border-left: 20px solid #f4f6f9;
- // border-bottom: 18px solid transparent;
- // border-radius: 2px;
- // top: 0;
- // right: -20px;
- // }
- // .flow-item::before {
- // content: '';
- // position: absolute;
- // width: 0;
- // height: 0;
- // border-top: 18px solid transparent;
- // border-left: 20px solid #fff;
- // border-bottom: 18px solid transparent;
- // border-radius: 2px;
- // top: 0;
- // left: 0px;
- // }
- // .flow-item::after {
- // content: '';
- // position: absolute;
- // width: 0;
- // height: 0;
- // border-top: 18px solid transparent;
- // border-left: 20px solid #f4f6f9;
- // border-bottom: 18px solid transparent;
- // border-radius: 2px;
- // top: 0;
- // right: -20px;
- // }
- .el-icon-warning-outline {
- color: #848484;
- position: relative;
- top: 1px;
- }
- .flow-item-color {
- background-color: #409eff;
- color: #fff;
- .detailsPonit {
- color: #ffffff;
- }
- .el-icon-warning-outline {
- color: #ffffff;
- }
- }
- .detailsPonit {
- margin-left: 10px;
- font-size: 14px;
- color: #848484;
- cursor: pointer;
- }
- .flow-item-color::after {
- border-left: 20px solid #409eff;
- }
- .feedDoalog {
- ::v-deep .el-dialog__body {
- padding: 0 20px 30px;
- }
- }
- .mentSty {
- max-width: 300px;
- height: 23px;
- display: inline-block;
- }
- // .button-width {
- // button {
- // width: 80px;
- // }
- // }
- .elFrom-margin {
- ::v-deep .el-form-item__label {
- padding: 0;
- }
- padding: 0 20px 0 0;
- }
- .processSty {
- margin-top: -20px;
- .proListSty {
- border-bottom: 1px solid #e2e2e2;
- padding: 17px 0;
- .proButt {
- color: #4799ff;
- border: 1px solid #78a1ff;
- font-size: 14px;
- padding: 0px 10px;
- height: 30px;
- }
- .proName {
- font-size: 15px;
- line-height: 30px;
- padding-left: 8px;
- }
- }
- }
- .footer {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- border-top: 1px solid #e8e8e8;
- padding: 12px 30px;
- z-index: 100;
- }
- .dian {
- position: absolute;
- right: 10px;
- }
- </style>
|