index.vue 148 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986
  1. <template>
  2. <div class="home">
  3. <div class="grand flex">
  4. <div class="left-laowang" style="flex: 0 0 180px;overflow: hidden;">
  5. <el-col :span="24" class="left" :style="'height:'+ (tableHeight + 113) + 'px;'">
  6. <div class="department">
  7. <span><i class="iconfont firerock-iconzuzhijiegou" style="font-size:10px;" ></i>&nbsp;{{ $t('lable.department') }}</span>
  8. <div v-on:click="createDepartment(-1)" v-if="user.userNameNeedTranslate != '1'">
  9. <i class="fa fa-plus-circle"></i>
  10. {{ $t('create') }}
  11. </div>
  12. </div>
  13. <div style="width: 100%;display: flex">
  14. <el-button v-if="!adjustPosition" style="width: 100%;" size="small" @click="adjustPositionClick()">调整部门</el-button>
  15. <el-button v-if="adjustPosition" style="width: 50%" size="small" @click="adjustPosition = !adjustPosition,data = dataRepeat">取消</el-button>
  16. <el-button v-if="adjustPosition" style="width: 50%" size="small" @click="adjustPositionClick()">确定</el-button>
  17. </div>
  18. <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
  19. <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
  20. <el-tree :data="data"
  21. :props="defaultProps"
  22. :draggable="adjustPosition"
  23. :allow-drop="allowDrop"
  24. @node-drop="nodeDrop"
  25. style="padding-bottom:70px;"
  26. :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa">
  27. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node }" @mouseleave= mouseleave(data,$event) @mouseover= mouseover(data,$event)>
  28. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  29. <span v-if="user.userNameNeedTranslate == '1'">
  30. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  31. </span>
  32. <span v-else>
  33. {{ node.label }} <i v-if="node.data.ddDeptid != null" class="iconfont firerock-icondingding"></i>
  34. </span>
  35. <span v-if="node.label != $t('lable.allStaff') && node.label != $t('lable.unassigned') && adjustPosition" class="treeIons">
  36. <i class="el-icon-s-operation" style="color: #409eff"></i>
  37. </span>
  38. </span>
  39. <!-- <span v-if="node.label != '全部人员'" class="node none"> -->
  40. <span v-if="node.label != $t('lable.allStaff') && node.label != $t('lable.unassigned')" class="node none poAub">
  41. <el-button type="text" size="mini" @click="createDepartment(-2)" v-if="user.userNameNeedTranslate != '1'">
  42. <i class="el-icon-circle-plus-outline"></i> <!-- 新增 -->
  43. </el-button>
  44. <el-button type="text" size="mini" @click="deleteDep(null)" >
  45. <i class="el-icon-delete"></i> <!-- 删除 -->
  46. </el-button>
  47. </span>
  48. </span>
  49. </el-tree>
  50. </div>
  51. </el-col>
  52. </div>
  53. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;">
  54. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  55. -
  56. -
  57. -
  58. </div>
  59. </div>
  60. <div style="width: 200px; flex: 1; background: green" class="box-second-father">
  61. <el-col :span="24" class="right">
  62. <!--工具条-->
  63. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  64. <el-form :inline="true">
  65. <!-- <div style="width: 300px;display: inline-block;">
  66. <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
  67. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  68. </el-input>
  69. </div> -->
  70. <el-form-item>
  71. <div v-if="depData == null || depData.id == -1" class="nowTime" style="cursor:unset">
  72. <i class="fa fa-home"></i>{{ $t('lable.allStaff') }}
  73. </div>
  74. <div v-else-if="depData.id == 0" class="nowTime" style="cursor:unset">
  75. <i class="fa fa-home"></i>{{ $t('lable.unassigned') }}
  76. </div>
  77. <div v-else-if="depData != null && depData.id != -1 && depData.id != 0" class="nowTime" @click="createDepartment(0)">
  78. <i class="fa fa-pencil-square-o"></i>
  79. <!-- {{depData !=null ? depData.label : ''}} -->
  80. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  81. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  82. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  83. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  84. <!-- <i class="iconfont firerock-icondingding"></i> -->
  85. <!-- {{translation}} -->
  86. </div>
  87. </el-form-item>
  88. <el-form-item>
  89. <div style="color:#999;font-size:13px;">{{ $t('gong') }}<span :style="total>user.company.staffCountMax?'color:red;':''">{{total}}</span>{{ $t('other.people') }}
  90. <span v-if="depData == null || depData.id == -1">({{ $t('shangxian') }}{{user.company.staffCountMax}}{{$t('other.people')}})</span>
  91. <!-- <el-link style="font-size:13px;margin-left:10px" type="primary" :underline="false" @click="recordMsgDialog = true" v-if="recordMsg.result == 0">同步日志</el-link> -->
  92. </div>
  93. </el-form-item>
  94. <el-form-item style="float:right;" v-if="permissions.structureCustomConfig">
  95. <el-link type="primary" :underline="false" @click="customConfigShow">{{ $t('customConfiguration') }}</el-link>
  96. </el-form-item>
  97. <el-form-item style="float:right;" v-if="permissions.structureExport">
  98. <el-link type="primary" :underline="false" @click="showExportDialog">{{ $t('exportpersonnel') }}</el-link>
  99. </el-form-item>
  100. <el-form-item style="float:right;" v-if="user.timeType.syncDingding == 0 && permissions.structureAdd && user.userNameNeedTranslate != '1' && user.dingdingUserid == null">
  101. <el-link type="primary" :underline="false" @click="openInsertDialog(null)">{{ $t('addpersonnel') }}</el-link>
  102. </el-form-item>
  103. <!--导入薪资-->
  104. <el-form-item style="float:right;" v-if="permissions.structurePersonnel">
  105. <el-link type="primary" :underline="false" @click="importUserSalary(null)">{{ $t('importSalary') }}</el-link>
  106. </el-form-item>
  107. <el-form-item style="float:right;" v-if="user.timeType.syncDingding == 0 && permissions.structureImport && user.userNameNeedTranslate != '1' && user.dingdingUserid == null">
  108. <el-link type="primary" :underline="false" @click="importUserC">{{ $t('bulkimport') }}</el-link>
  109. </el-form-item>
  110. <el-form-item style="float:right;" v-if="user.corpwxUserid != null && permissions.structureImport && user.companyId==469">
  111. <el-link type="primary" :underline="false" @click="syncMembByCardTime">{{ $t('associateenterprisemicroidentity') }}</el-link>
  112. </el-form-item>
  113. <el-form-item style="float:right;" v-if="user.corpwxUserid != null && permissions.structureImport && user.companyId!=469">
  114. <!-- <el-link type="primary" v-if="user.userNameNeedTranslate != '1'" :underline="false" @click="syncWithCorpWxDayload">{{ $t('synchronizetheenterprisemicrodirectory') }}</el-link>
  115. <el-link type="primary" v-if="user.userNameNeedTranslate == '1'" :underline="false" @click="newSyncWithCorpWx">{{ $t('synchronizetheenterprisemicrodirectory') }}</el-link> -->
  116. <el-link type="primary" v-if="user.userNameNeedTranslate != '1'" :underline="false" @click="syncWithCorpWx">{{ $t('synchronizetheenterprisemicrodirectory') }}</el-link>
  117. <el-link type="primary" v-if="user.userNameNeedTranslate == '1'" :underline="false" @click="newSyncWithCorpWxDayload = true">{{ $t('synchronizetheenterprisemicrodirectory') }}</el-link>
  118. </el-form-item>
  119. <el-form-item style="float:right;" v-if="user.dingdingUserid != null && permissions.structureImport">
  120. <el-link type="primary" :underline="false" @click="showCorpDDSyncDialog">{{ $t('synchronizetheaddressbook') }}</el-link>
  121. </el-form-item>
  122. <el-form-item style="float:right;" v-if="user.feishuUserid != null && permissions.structureImport">
  123. <el-link type="primary" :underline="false" @click="syncFeishu">{{ '同步飞书通讯录' }}</el-link>
  124. </el-form-item>
  125. <el-form-item style="float:right;" v-if="user.timeType.syncAd==1">
  126. <el-link type="primary" :underline="false" @click="syncAd">{{ '同步AD域控通讯录'}}</el-link>
  127. </el-form-item>
  128. <!-- <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureImport">
  129. <el-link type="primary" :underline="false" href="./upload/人员导入模板.xlsx" download="人员导入模板.xlsx">模板下载</el-link>
  130. </el-form-item> -->
  131. <!-- <el-form-item v-if="depData != null && depData.id != -1 && depData.id != 0" style="float:right;border: 0.5px solid #20a0ff;height: 27px;margin-top: 6px;">
  132. </el-form-item> -->
  133. <!-- <el-form-item style="float:right;">
  134. <el-link type="danger" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="deleteDep(null)">删除部门</el-link>
  135. </el-form-item>
  136. <el-form-item style="float:right;">
  137. <el-link type="primary" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="createDepartment(-2)">新增子部门</el-link>
  138. </el-form-item> -->
  139. <el-form-item style="float:right;">
  140. <span style="color: #666666">{{ $t('jiao-se') }}</span>
  141. <el-select v-model="roleId" :placeholder="$t('defaultText.pleaseChoose')" @change="getUser()" style="width: 120px" clearable size="small">
  142. <!-- <el-option
  143. v-for="item in rolesa"
  144. :key="item.value"
  145. :label="item.label"
  146. :value="item.value">
  147. </el-option> -->
  148. <el-option v-for="item in acquireRoleList" :key="item.id" :label="item.rolename" :value="item.id"></el-option>
  149. </el-select>
  150. </el-form-item>
  151. <el-form-item style="float:right;">
  152. <span style="color: #666666">{{ $t('state.states') }}</span>
  153. <el-select v-model="status" :placeholder="$t('defaultText.pleaseChoose')" @change="getUser()" style="width: 120px" size="small">
  154. <el-option
  155. v-for="item in states"
  156. :key="item.value"
  157. :label="item.label"
  158. :value="item.value">
  159. </el-option>
  160. </el-select>
  161. </el-form-item>
  162. <el-form-item style="float:right;">
  163. <div style="width: 300px;display: inline-block;margin-top: 4px">
  164. <el-input v-model="keyword" class="input-with-select" placeholder="请输入" clearable="true" size="small">
  165. <el-select v-model="integer" slot="prepend" style="width: 80px">
  166. <el-option label="姓名" value="0"></el-option>
  167. <el-option label="电话" value="1"></el-option>
  168. <el-option label="工号" value="2"></el-option>
  169. </el-select>
  170. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  171. </el-input>
  172. </div>
  173. </el-form-item>
  174. <el-form-item style="float:right;" v-if="depData != null && depData.id != '-1'">
  175. <el-checkbox v-model="onlyDirect" @change="getUser()">{{ $t('directstaff') }}</el-checkbox>
  176. </el-form-item>
  177. </el-form>
  178. </el-col>
  179. <!--列表-->
  180. <el-table ref="handleSelectTable" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="handleSelectionZzjg">
  181. <el-table-column type="selection" width="50"></el-table-column>
  182. <el-table-column type="index" width="50">
  183. <template slot-scope="scope" >
  184. {{scope.$index+1+(page-1)*size}}
  185. </template>
  186. </el-table-column>
  187. <el-table-column prop="name" :label="$t('lable.name')" width="150">
  188. <template slot-scope="scope">
  189. <div class="classwxName">
  190. <span v-if="user.corpwxUserid && saasSyncContact == 0" class="classwxNameIon">
  191. <img src="../../assets/image/qiyeweix.png" alt="">
  192. </span>
  193. <div v-if="user.userNameNeedTranslate == 1">
  194. <ww-open-data type='userName' :openid='scope.row.name'></ww-open-data>
  195. </div>
  196. <div v-else>{{scope.row.name}}</div>
  197. </div>
  198. </template>
  199. </el-table-column>
  200. <el-table-column prop="jobNumber" :label="$t('Worknumber')" ></el-table-column>
  201. <el-table-column prop="phone" :label="$t('shou-ji')" width="120"></el-table-column>
  202. <el-table-column prop="departmentName" :label="$t('lable.department')" width="220">
  203. <template slot-scope="scope">
  204. <div>
  205. <div v-if="user.userNameNeedTranslate == 1">
  206. <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
  207. </div>
  208. <div v-else>{{scope.row.departmentName}}</div>
  209. </div>
  210. </template>
  211. </el-table-column>
  212. <el-table-column prop="superiorName" label="直属审核人" width="120" v-if="user.timeType.reportAuditType == 5 || user.timeType.reportAuditType == 6">
  213. <template slot-scope="scope">
  214. <div>
  215. <div v-if="user.userNameNeedTranslate == 1">
  216. <ww-open-data type='userName' :openid='scope.row.superiorCorpwxUserid'></ww-open-data>
  217. </div>
  218. <div v-else>{{scope.row.superiorName}}</div>
  219. </div>
  220. </template>
  221. </el-table-column>
  222. <el-table-column v-if="user.companyId==4374" :label="'员工类型'" width="100">
  223. <template slot-scope="scope">{{findValue('员工类型',scope.row.plateMap)}}</template>
  224. </el-table-column>
  225. <el-table-column :label="$t('jiao-se')" width="100">
  226. <template slot-scope="scope">{{scope.row.roleName}}</template>
  227. </el-table-column>
  228. <el-table-column prop="monthCost" :label="$t('monthcost')" align="right" v-if="permissions.structurePersonnel" width="140">
  229. <template slot-scope="scope">{{user.timeType.isSecretSalary==0?(scope.row.monthCost==null?0:scope.row.monthCost.toFixed(2)):'*'}} {{ $t('yuan') }}</template>
  230. </el-table-column>
  231. <el-table-column prop="cost" :label="$t('hourlywage')" v-if="permissions.structurePersonnel" width="150" align="right">
  232. <template slot-scope="scope">{{user.timeType.isSecretSalary==0?(scope.row.cost==null?0:scope.row.cost):'*'}} {{ $t('yuan') }}
  233. <el-link v-if="user.timeType.isSecretSalary==0" @click.native="showSalaryList(scope.row)"><i class="iconfont firerock-iconrecord"></i></el-link>
  234. </template>
  235. </el-table-column>
  236. <el-table-column :label="$t('state.states')" width="100">
  237. <template slot-scope="scope">
  238. <span>{{scope.row.isActive==0 ? $t('ting-yong')+(scope.row.inactiveDate != null? '(' + scope.row.inactiveDate + ')':''): $t('zai-zhi')}}</span>
  239. </template>
  240. </el-table-column>
  241. <el-table-column :label="$t('creationtime')" width="150" prop="createTime">
  242. </el-table-column>
  243. <el-table-column :label="$t('operation')" width="300" fixed="right">
  244. <template slot-scope="scope">
  245. <el-button size="mini" type="default" v-if="scope.row.roleName == $t('role.superAdministrator') && user.id == scope.row.id" @click="transferRole(scope.row)">{{ $t('transfer') }}</el-button>
  246. <el-button size="mini" type="default" v-if="scope.row.roleName != $t('role.superAdministrator') && user.userNameNeedTranslate != 1" @click="resetPwd(scope.row)">{{ $t('reset') }}</el-button>
  247. <el-button size="mini" type="default" v-if="(user.roleName == '超级管理员' || user.roleName == '系统管理员') && user.companyId == 936" @click="resetPwd(scope.row)">{{ $t('reset') }}</el-button>
  248. <!-- <el-button size="mini" type="primary" v-if="scope.row.roleName != $t('role.superAdministrator')" @click="openInsertDialog(scope.row)">{{ $t('bian-ji') }}</el-button> -->
  249. <el-button size="mini" type="primary" @click="openInsertDialog(scope.row, scope.row.roleName)">{{ $t('bian-ji') }}</el-button>
  250. <!-- <el-button size="mini" type="primary" v-if="scope.row.roleName == $t('role.superAdministrator')" @click="openInsertDialog1(scope.row)">{{ $t('bian-ji') }}</el-button> -->
  251. <!-- <el-button size="mini" type="danger" v-if="scope.row.roleName != $t('role.superAdministrator')" @click="deleteUser(scope.row)">删除</el-button> -->
  252. <el-button size="mini" type="default" v-if="scope.row.roleName != $t('role.superAdministrator') && scope.row.isActive==1" @click="showDeactiveDialog(scope.row)">{{ $t('ting-yong') }}</el-button>
  253. <el-button size="mini" type="success" v-if="scope.row.roleName != $t('role.superAdministrator') && scope.row.isActive==0" @click="setActive(scope.row, 1)">{{ $t('enable') }}</el-button>
  254. <el-button size="mini" type="default" v-if="scope.row.roleName != $t('role.superAdministrator') && scope.row.activeInfoByUser == 1" @click="transferActiveDialog(scope.row)">转让</el-button>
  255. </template>
  256. </el-table-column>
  257. </el-table>
  258. <!--工具条-->
  259. <el-col :span="24" class="toolbar">
  260. <!-- 123 -->
  261. <el-button size="small" @click="handleSelectionZzjgbtn1">{{ $t('btn.cancel') }}</el-button>
  262. <!-- <el-cascader v-model="handleSelectionZzjgwillchange" size="small" placeholder="请选择部门" style="width: 13%;margin-left: 1%;margin-right: 1%;font-size:12px"
  263. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  264. <el-button size="small" type="primary" @click="handleSelectionZzjgbtn2">修改</el-button> -->
  265. <el-button size="small" type="primary" @click="handleSelectionZzjgbtn3" v-if="user.userNameNeedTranslate != 1">{{ $t('modifyingDepartments') }}</el-button>
  266. <el-button size="small" type="primary" @click="handJue">{{ $t('modifyingRoles') }}</el-button>
  267. <el-button size="small" type="primary" @click="workingHoursDialogClick()">修正工时所属部门</el-button>
  268. <el-button size="small" type="primary" @click="handleSelectionUser()">批量启用员工</el-button>
  269. <el-pagination
  270. @size-change="handleSizeChange"
  271. @current-change="handleCurrentChange"
  272. :page-sizes="[20 , 50 , 80 , 100]"
  273. :page-size="size"
  274. :current-page="page"
  275. layout="total, sizes, prev, pager, next"
  276. :total="total"
  277. style="float:right;"
  278. ></el-pagination>
  279. </el-col>
  280. </el-col>
  281. </div>
  282. <!-- 修正工时所属部门 -->
  283. <el-dialog title="修正工时" :visible.sync="workingHoursDialog" width="650px" :before-close="handleClose">
  284. <div>
  285. <div class="workingHours">
  286. <el-radio v-model="workingHoursRadio" label="1">全部工时</el-radio>
  287. <el-radio v-model="workingHoursRadio" label="2">部分工时</el-radio>
  288. </div>
  289. <div class="workingHours workingHoursData" v-if="workingHoursRadio == 2">
  290. <span class="workingHoursSpan">日期范围</span>
  291. <el-date-picker v-model="workingHoursDatas" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
  292. </div>
  293. </div>
  294. <span slot="footer" class="dialog-footer">
  295. <el-button @click="workingHoursDialog = false">取 消</el-button>
  296. <el-button type="primary" @click="workingHours()">确 定</el-button>
  297. </span>
  298. </el-dialog>
  299. <!-- 批量修改弹出框 -->
  300. <el-dialog :title="$t('changes')" :visible.sync="handleSelectionZzjgshow" v-if="handleSelectionZzjgshow" width="30%">
  301. <el-form model="" label-width="20%">
  302. <el-form-item :label="$t('setupdepartment')">
  303. <!-- <el-cascader v-model="handleSelectionZzjgwillchange" placeholder="请选择部门" style="width: 60%;"
  304. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
  305. <el-cascader v-model="handleSelectionZzjgwillchange" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%;"
  306. :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  307. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="option" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  308. </el-form-item>
  309. </el-form>
  310. <div slot="footer" class="dialog-footer">
  311. <el-button @click="handleSelectionZzjgshow = false">{{ $t('btn.cancel') }}</el-button>
  312. <el-button type="primary" @click="handleSelectionZzjgbtn2">{{ $t('btn.determine') }}</el-button>
  313. </div>
  314. </el-dialog>
  315. <!-- 批量修改角色弹出框 -->
  316. <el-dialog :title="$t('changes')" :visible.sync="handljues" v-if="handljues" width="30%">
  317. <el-form model="" label-width="20%">
  318. <el-form-item :label="$t('settherole')">
  319. <el-select v-model="xiuRoleId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%">
  320. <el-option v-for="(item, index) in acquireRoleLists" :key="index" :label="item.rolename" :value="item.id"></el-option>
  321. </el-select>
  322. </el-form-item>
  323. </el-form>
  324. <div slot="footer" class="dialog-footer">
  325. <el-button @click="handljues = false">{{ $t('btn.cancel') }}</el-button>
  326. <el-button type="primary" @click="handTrue">{{ $t('btn.determine') }}</el-button>
  327. </div>
  328. </el-dialog>
  329. <!-- 新增部门 -->
  330. <el-dialog :title="depTitle" :visible.sync="departmentVisible" width="500px" >
  331. <el-form ref="depForm" :model="depForm" :rules="depRules" label-width="100px">
  332. <el-form-item :label="$t('departmentname')" prop="name">
  333. <el-input v-model="depForm.name" :placeholder="$t('peaseenterthe')" clearable style="width: 100%" v-if="user.userNameNeedTranslate != '1'"></el-input>
  334. <div v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depForm.name'></ww-open-data></div>
  335. </el-form-item>
  336. <!-- 主要负责人 -->
  337. <el-form-item :label="$t('Principalpersoninharge')" prop="managerId">
  338. <el-select v-model="depForm.managerId" filterable v-if="user.userNameNeedTranslate != '1'" clearable :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%">
  339. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  340. <span style="float: left">{{ item.name }}</span>
  341. <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
  342. </el-option>
  343. </el-select>
  344. <selectCat :size="'medium'" :filterable="true" :clearable="true" :widthStr="'360'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="depForm.managerId" :distinction="'3'" @selectCal="selectCal"></selectCat>
  345. </el-form-item>
  346. <!-- 其他负责人 -->
  347. <el-form-item :label="$t('responsiblepersons')" prop="managerId">
  348. <el-select v-model="depForm.otherManagerIds" filterable v-if="user.userNameNeedTranslate != '1'" clearable multiple style="width: 100%" :placeholder="$t('defaultText.pleaseChoose')" >
  349. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  350. <span style="float: left">{{ item.name }}</span>
  351. <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
  352. </el-option>
  353. </el-select>
  354. <selectCat :size="'medium'" :filterable="true" :widthStr="'360'" v-if="user.userNameNeedTranslate == '1' && departmentVisible" :subject="users" :subjectId="depForm.otherManagerIds" :distinction="'4'" :clearable="true" @selectCal="selectCal"></selectCat>
  355. </el-form-item>
  356. <!-- 直属领导 -->
  357. <el-form-item :label="$t('leadership')" prop="reportAuditUserid" v-if="user.timeType.needDeptAudit">
  358. <el-select v-model="depForm.reportAuditUserid" v-if="user.userNameNeedTranslate != '1'" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%">
  359. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  360. </el-select>
  361. <selectCat :size="'medium'" :widthStr="'360'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="depForm.reportAuditUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  362. </el-form-item>
  363. <!-- 是否推送到SAP -->
  364. <el-form-item :label="'推送至SAP'" prop="pushToSap" v-if="user.companyId==3092">
  365. <el-radio-group v-model="depForm.pushToSap">
  366. <el-radio :label="1">是</el-radio>
  367. <el-radio :label="0">否</el-radio>
  368. </el-radio-group>
  369. </el-form-item>
  370. </el-form>
  371. <span slot="footer" class="dialog-footer">
  372. <el-button @click="departmentVisible = false">{{ $t('btn.cancel') }}</el-button>
  373. <el-button type="primary" @click="submitDepartment" >{{ $t('btn.submit') }}</el-button>
  374. </span>
  375. </el-dialog>
  376. <!-- 新增/编辑人员的Dialog -->
  377. <el-dialog :title="title" :visible.sync="dialogVisible" width="580px" :top="'7.5vh'">
  378. <div style="height: 62vh;overflow: auto;">
  379. <el-form ref="form12" :model="insertForm" :rules="rules" label-width="100px">
  380. <el-form-item :label="$t('lable.name')" prop="name" v-if="user.userNameNeedTranslate != '1'">
  381. <el-input v-model="insertForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="user.userNameNeedTranslate == '1'"></el-input>
  382. </el-form-item>
  383. <el-form-item :label="$t('lable.name')" prop="name" v-if="user.userNameNeedTranslate == '1'">
  384. <div><ww-open-data type='userName' :openid='insertForm.name'></ww-open-data></div>
  385. </el-form-item>
  386. <el-form-item :label="$t('phone')" prop="phone">
  387. <el-input v-model="insertForm.phone" :placeholder="$t('peaseenterthe')" clearable></el-input>
  388. </el-form-item>
  389. <el-form-item :label="$t('Worknumber')" prop="jobNumber">
  390. <el-input v-model="insertForm.jobNumber" :placeholder="$t('peaseenterthe')" clearable></el-input>
  391. </el-form-item>
  392. <el-form-item :label="$t('payway')" prop="salaryType" v-if="permissions.structurePersonnel&&user.timeType.isSecretSalary==0">
  393. <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
  394. <el-radio :label="0" >{{ $t('fixedmonthlycost') }}</el-radio>
  395. <el-radio :label="1">{{ $t('hourlywages') }}</el-radio>
  396. </el-radio-group>
  397. </el-form-item>
  398. <el-form-item :label="$t('monthcost')" prop="monthCost" v-if="insertForm.salaryType == 0 && permissions.structurePersonnel&&user.timeType.isSecretSalary==0">
  399. <el-input v-model="insertForm.monthCost" id="mc" @input="oninput" :placeholder="$t('yuechengben')" clearable @keyup.native="restrictNumber('mc')"></el-input>
  400. <span style="color:orange;font-size:12px;">{{ $t('yuegongzuoo') }}{{timeType.monthDays}}{{ $t('time.day') }},{{$t('meitian')}}{{timeType.allday}}{{ $t('xiaoshi') }}</span>
  401. <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">{{ $t('modifyworkinghours') }}</el-link>
  402. </el-form-item>
  403. <el-form-item :label="$t('hourlywage')" prop="cost" v-if="permissions.structurePersonnel&&user.timeType.isSecretSalary==0">
  404. <el-input v-model="insertForm.cost" :disabled="insertForm.salaryType == 0" id="cc" style="width:120px;" @keyup.native="restrictNumber4('cc')"
  405. :placeholder="$t('yuechengbenxiaoshi')" clearable></el-input>
  406. <span style="margin-left:25px;">{{ $t('effectivedate') }}</span>
  407. <el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
  408. </el-form-item>
  409. <el-form-item :label="$t('lable.department')" prop="departmentId">
  410. <!-- <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  411. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
  412. <el-cascader v-model="insertForm.departmentId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 100%"
  413. :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable v-if="user.userNameNeedTranslate != 1"></el-cascader>
  414. <vueCascader :size="'medium'" :widthStr="'430'" :clearable="true && user.userNameNeedTranslate != 1" :subject="option" :subjectId="insertForm.departmentId" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
  415. </el-form-item>
  416. <el-form-item label="审核层级" v-if="user.timeType.reportAuditType == 6">
  417. <el-radio-group v-model="insertForm.onlyAuditOnce" >
  418. <el-radio :label="0" >两层审核</el-radio>
  419. <el-radio :label="1">一层审核</el-radio>
  420. </el-radio-group>
  421. </el-form-item>
  422. <el-form-item v-if="user.timeType.reportAuditType == 5 || user.timeType.reportAuditType == 6">
  423. <span slot="label">
  424. <span>直属审核人</span>
  425. <el-tooltip effect="dark" content="未设置时由所属部门负责人审核" placement="top-start">
  426. <i class="el-icon-question" style="color:#606266"></i>
  427. </el-tooltip>
  428. </span>
  429. <el-select v-model="insertForm.superiorId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" filterable clearable v-if="user.userNameNeedTranslate != 1">
  430. <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
  431. <span style="float: left">{{item.name}}</span>
  432. <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
  433. </el-option>
  434. </el-select>
  435. <selectCat :size="'medium'" :widthStr="'360'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="insertForm.superiorId" :distinction="'6'" @selectCal="selectCal"></selectCat>
  436. </el-form-item>
  437. <el-form-item :label="$t('jiao-se')" prop="roleId" v-if="roleNameFlg != $t('role.superAdministrator')">
  438. <el-select v-model="insertForm.roleId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%">
  439. <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
  440. <span style="float: left">{{item.rolename}}</span>
  441. <span style="float: right; color: #8492a6; font-size: 13px">{{item.roleDescribe}}</span>
  442. </el-option>
  443. </el-select>
  444. </el-form-item>
  445. <el-form-item :label="item.name" v-for="item,index in userCustomConfig" :key="item.id">
  446. <el-select v-if="item.type == 0" v-model="insertForm[suoying[index]]" :placeholder="$t('defaultText.pleaseChoose')" clearable style="width: 100%">
  447. <el-option v-for="option in item.itemList" :label="option.name" :value="option.name" :key="option.id">
  448. </el-option>
  449. </el-select>
  450. <el-input v-else v-model="insertForm[suoying[index]]" :placeholder="$t('peaseenterthe')" clearable></el-input>
  451. </el-form-item>
  452. <el-form-item :label="$t('entrytime')" prop="phone">
  453. <el-date-picker v-model="insertForm.inductionDate" value-format="yyyy-MM-dd"></el-date-picker>
  454. </el-form-item>
  455. <el-form-item label="离职日期" prop="inactiveDate" v-if="insertForm.isActive == 0">
  456. <el-date-picker v-model="insertForm.inactiveDate" value-format="yyyy-MM-dd"></el-date-picker>
  457. </el-form-item>
  458. <el-form-item :label="$t('postrank')" prop="phone">
  459. <el-input v-model="insertForm.position" :placeholder="$t('joblevel')" clearable></el-input>
  460. </el-form-item>
  461. <div class="zhaunye"><p>{{ $t('professionalcertificate') }}</p><p><el-link type="primary" @click="addCertificateList()">{{ $t('addprofessionalcertificate') }}</el-link><el-link v-if="permissions.structureCertificate" type="primary" @click="managementDiolog = true" style="margin-left: 20px">{{ $t('professionalCertificate inManagement') }}</el-link></p></div>
  462. <div class="certificateList">
  463. <div class="moreList">
  464. <div class="moreLiList" v-for="(item,index) in insertForm.certJson" :key="index">
  465. <div style="margin-right: 10px;width: 160px;">
  466. <el-select v-model="item.certId" :placeholder="$t('defaultText.pleaseChoose')" size="mini" @change="changeManagement(index)">
  467. <el-option v-for="item in managementTableData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
  468. </el-select>
  469. </div>
  470. <div><span>{{ $t('certificate') }}</span><el-date-picker size="mini" v-model="item.certDate" type="date" value-format="yyyy-MM-dd" :placeholder="$t('certificatedate')" style="width: 180px"></el-date-picker></div>
  471. <div style="color: red;margin-left: 15px;cursor:pointer;" @click="deteFrames(index)"><i class="el-icon-delete"></i></div>
  472. </div>
  473. </div>
  474. </div>
  475. </el-form>
  476. </div>
  477. <span slot="footer" class="dialog-footer">
  478. <!-- <el-button type="danger" @click="deleteUser(insertForm, '1')" style="float:left;">{{ $t('btn.delete') }}</el-button> -->
  479. <el-button type="danger" @click="deleteUserFlg = true" style="float:left;">{{ $t('btn.delete') }}</el-button>
  480. <el-button @click="dialogVisible=false">{{ $t('btn.cancel') }}</el-button>
  481. <el-button type="primary" @click="submitInsert('insertForm')" :loading="submitLoading">{{ $t('btn.submit') }}</el-button>
  482. </span>
  483. </el-dialog>
  484. <!-- 删除员工时转移日报 -->
  485. <el-dialog title="提示" :visible.sync="deleteUserFlg" width="600px" :before-close="handleClose">
  486. <div>
  487. <div class="deteee">确定删除该员工吗?</div>
  488. <div class="deteeeAce" v-if="deleteUserFlgData.isExistsReport">
  489. <div style="margin-right: 10px">将该员工的工时数据、参与的项目与任务转移 至</div>
  490. <el-select v-if="user.userNameNeedTranslate != 1" v-model="moveReportUserId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable size="small" filterable popper-class="managePopperClass">
  491. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  492. <span style="float: left">{{ item.name }}</span>
  493. <span style="float: right; color: #8492a6;">{{ item.jobNumber }}</span>
  494. </el-option>
  495. </el-select>
  496. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :widthStr="350" :subjectId="moveReportUserId" :distinction="'22'" :clearable="true" @selectCal="selectCal"></selectCat>
  497. </div>
  498. </div>
  499. <span slot="footer" class="dialog-footer">
  500. <el-button @click="deleteUserFlg = false">取 消</el-button>
  501. <el-button type="primary" @click="deleteUser(deleteUserFlgData)" :loading="deleteUserFlgloading">确 定</el-button>
  502. </span>
  503. </el-dialog>
  504. <el-dialog :title="$t('historicalpersonnelcost')" :visible.sync="userSalaryListDialog" width="750px" >
  505. <el-table :data="userSalaryList" highlight-current-row v-loading="listLoading" height="300px" style="width: 100%;">
  506. <el-table-column prop="userName" :label="$t('lable.name')" >
  507. <template slot-scope="scope">
  508. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  509. <span v-else>{{scope.row.userName}}</span>
  510. </template>
  511. </el-table-column>
  512. <el-table-column prop="indate" :label="$t('updatetime')" width="150px">
  513. </el-table-column>
  514. <el-table-column prop="salaryType" :label="$t('payway')" >
  515. <template slot-scope="scope" >
  516. {{scope.row.salaryType==0?$t('monthlysalary'):$t('hourlywages')}}
  517. </template>
  518. </el-table-column>
  519. <el-table-column prop="monthCost" :label="$t('monthlysalarys')" >
  520. <template slot-scope="scope" >
  521. {{scope.row.monthCost}} {{ $t('yuan') }}
  522. </template>
  523. </el-table-column>
  524. <el-table-column prop="cost" :label="$t('hourlywage')" >
  525. <template slot-scope="scope" >
  526. {{scope.row.cost}} {{ $t('yuan') }}
  527. </template>
  528. </el-table-column>
  529. <el-table-column >
  530. <template slot-scope="scope" >
  531. <el-button size="small" @click="delHisSalary(scope.row.id,scope.row.userId)">删除</el-button>
  532. </template>
  533. </el-table-column>
  534. </el-table>
  535. </el-dialog>
  536. <!--导出人员 -->
  537. <el-dialog :title="$t('exportingpeople')" :visible.sync="exportDialogVisible" width="550px" >
  538. <el-form label-width="100px">
  539. <el-form-item :label="$t('export.export')" >
  540. <el-radio-group v-model="containInvalid" >
  541. <el-radio :label="1" >{{ $t('lable.allStaff') }}</el-radio>
  542. <el-radio :label="0" >{{ $t('serviceonly') }}</el-radio>
  543. </el-radio-group>
  544. </el-form-item>
  545. </el-form>
  546. <span slot="footer" class="dialog-footer">
  547. <el-button type="primary" @click="exportUsers">{{ $t('export.export') }}</el-button>
  548. </span>
  549. </el-dialog>
  550. <!-- 转让超级管理员权限 -->
  551. <el-dialog :title="$t('permissiontotransfer')" :visible.sync="transferDialog" width="550px" >
  552. <el-form label-width="200px">
  553. <el-form-item :label="$t('administratorroleto')" >
  554. <el-select v-model="toUserId" style="width:300px" filterable clearable v-if="user.userNameNeedTranslate != '1'">
  555. <el-option v-for="item in allActiveUsers" :key="item.id" :value="item.id" :label="item.name">
  556. </el-option>
  557. </el-select>
  558. <selectCat :size="'medium'" :widthStr="'300'" v-if="user.userNameNeedTranslate == '1'" :subject="allActiveUsers" :subjectId="toUserId" :distinction="'12'" @selectCal="selectCal"></selectCat>
  559. </el-form-item>
  560. <el-form-item :label="$t('transferoftheirrole')" >
  561. <el-select v-model="myRoleId" style="width:300px">
  562. <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
  563. <span style="float: left">{{item.rolename}}</span>
  564. <span style="float: right; color: #8492a6; font-size: 13px">{{item.roleDescribe}}</span>
  565. </el-option>
  566. </el-select>
  567. </el-form-item>
  568. </el-form>
  569. <span slot="footer" class="dialog-footer">
  570. <el-button type="default" @click="transferDialog = false">{{ $t('btn.cancel') }}</el-button>
  571. <el-button type="primary" @click="showConfirmDialog">{{ $t('btn.determine') }}</el-button>
  572. </span>
  573. </el-dialog>
  574. <!--停用时选择日期 -->
  575. <el-dialog :title="$t('terminationstaff')" :visible.sync="deactiveDialog" width="550px" >
  576. <el-form label-width="200px">
  577. <el-form-item :label="$t('employeedeparture')" >
  578. <el-date-picker type="date" v-model="deactiveDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" :placeholder="$t('defaultText.pleaseChoose')" />
  579. </el-form-item>
  580. </el-form>
  581. <span slot="footer" class="dialog-footer">
  582. <el-button type="default" @click="deactiveDialog = false">{{ $t('btn.cancel') }}</el-button>
  583. <el-button type="primary" @click="confirmDeactive">{{ $t('btn.determine') }}</el-button>
  584. </span>
  585. </el-dialog>
  586. <!-- 管理专业证书 -->
  587. <el-dialog :title="$t('professionalCertificate inManagement')" :visible.sync="managementDiolog" width="500px" :before-close="handleClose">
  588. <div>
  589. <el-table :data="managementTableData" style="width: 100%" height="400">
  590. <el-table-column prop="name" :label="$t('names')" width="280"></el-table-column>
  591. <el-table-column :label="$t('operation')" width="180">
  592. <template slot-scope="scope">
  593. <div>
  594. <el-button type="primary" size="small" @click="editorManagementForm(scope.row)">{{ $t('bian-ji') }}</el-button>
  595. <el-button type="danger" size="small" @click="deteManagementForm(scope.row)">{{ $t('btn.delete') }}</el-button>
  596. </div>
  597. </template>
  598. </el-table-column>
  599. </el-table>
  600. </div>
  601. <span slot="footer" class="dialog-footer">
  602. <el-button @click="managementDiolog = false">{{ $t('Shutdown') }}</el-button>
  603. <el-button type="primary" @click="addManagementDiologs()">{{ $t('add') }}</el-button>
  604. </span>
  605. </el-dialog>
  606. <!-- 新增项目管理专业 -->
  607. <el-dialog :title="$t('addededitedmanagement')" :visible.sync="addManagementDiolog" width="500px" :before-close="handleClose">
  608. <div>
  609. <el-form :model="managementForm" :rules="managementFormRou" ref="managementForm" label-width="150px" class="demo-ruleForm">
  610. <el-form-item :label="$t('professionalCertificateName')" prop="name">
  611. <el-input v-model="managementForm.name" :placeholder="$t('peaseenterthe')"></el-input>
  612. </el-form-item>
  613. </el-form>
  614. </div>
  615. <span slot="footer" class="dialog-footer">
  616. <el-button @click="addManagementDiolog = false">{{ $t('btn.cancel') }}</el-button>
  617. <el-button type="primary" @click="addManagementForm('managementForm')">{{ $t('btn.submit') }}</el-button>
  618. </span>
  619. </el-dialog>
  620. <!-- 自定义配置项 -->
  621. <el-dialog :title="$t('managecustomconfigurationitems')" show-header="false" v-if="customConfigDialog" :visible.sync="customConfigDialog" :close-on-click-modal="false" customClass="customWidth" width="650px" top="20px">
  622. <div style="margin-left:30px;">
  623. <p v-for="item,index in customConfigList" :key="index">
  624. <el-input size="medium" v-model="item.name" :placeholder="$t('enteranameforacustomconfigurationitem')" style="width:200px;margin-right:20px" maxlength="8"></el-input>
  625. <el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="0" style="margin-right:10px;margin-left:10px">{{ $t('dropdown') }}</el-radio>
  626. <el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="1">{{ $t('input') }}</el-radio>
  627. <span style="display:inline-block;">
  628. <el-button v-if="cusItemTypes[index] == 0" type="primary" size="small" @click="getConfigItemBtn(item)">{{ $t('configurationoptions') }}</el-button>
  629. <span v-if="!item.id && item.name && item.type == 0" style="color:#999;font-size:13px">{{ $t('canconfiguretheoptions') }}</span>
  630. </span>
  631. <el-button style="margin-left:20px" type="danger" size="small" v-if="item.id" @click="customConfigDelete(item,index)">{{ $t('btn.delete') }}</el-button>
  632. </p>
  633. </div>
  634. <div slot="footer" class="dialog-footer">
  635. <el-button type="primary" @click="customConfigDialog = false" >{{ $t('Shutdown') }}</el-button>
  636. <!-- <el-button type="primary" @click="customConfigListAdd" :disabled="customConfigList.length >= 5">新增</el-button> -->
  637. <el-button type="primary" @click="customConfigListSave" :loading="saveBtnLoading">{{ $t('save') }}</el-button>
  638. </div>
  639. <!-- 为下拉时的选项配置 -->
  640. <el-dialog :title="$t('configurationoptions')" v-if="configItemDialog" :visible.sync="configItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px" append-to-body>
  641. <el-table :data="configItemList" height="400px" style="width:100%" key="configItemTable">
  642. <el-table-column prop="id" width="60" :label="$t('headerTop.serialNumber')">
  643. <template slot-scope="scope" >
  644. {{scope.$index + 1}}
  645. </template>
  646. </el-table-column>
  647. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  648. <el-table-column :label="$t('operation')" width="150">
  649. <template slot-scope="scope" >
  650. <el-button size="small" type="primary" @click="configItemAorM(scope.row)">{{ $t('bian-ji') }}</el-button>
  651. <el-button size="small" type="danger" @click="configItemDelete(scope.row)">{{ $t('btn.delete') }}</el-button>
  652. </template>
  653. </el-table-column>
  654. </el-table>
  655. <div slot="footer" class="dialog-footer">
  656. <el-button type="primary" @click="configItemDialog = false" >{{ $t('Shutdown') }}</el-button>
  657. <el-button type="primary" @click="configItemAorM" >{{ $t('newConfigurationOptions') }}</el-button>
  658. </div>
  659. <el-dialog :title="$t('addededitedconfigurationoptions')" v-if="configItemAorMDialog" :visible.sync="configItemAorMDialog" :close-on-click-modal="false" customClass="customWidth" width="500px" append-to-body>
  660. <span>{{ $t('names') }}</span>
  661. <el-input size="medium" v-model="AorMitem.name" :placeholder="$t('enteranameforacustomconfigurationitem')" style="width:200px;margin-right:20px" maxlength="8"></el-input>
  662. <div slot="footer" class="dialog-footer">
  663. <el-button type="primary" @click="configItemAorMDialog = false" >{{ $t('btn.cancel') }}</el-button>
  664. <el-button type="primary" @click="configItemAorMSure" >{{ $t('btn.submit') }}</el-button>
  665. </div>
  666. </el-dialog>
  667. </el-dialog>
  668. </el-dialog>
  669. <!-- 批量导入 -->
  670. <el-dialog :title="$t('batchimportofpersonnel')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  671. <p>1. {{ $t('other.download') }}
  672. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/人员导入模板.xlsx" :download="$t('personnelimporttemplate')+'.xlsx'">{{$t('personnelimporttemplate')}}.xlsx</el-link>
  673. </p>
  674. <p>2. {{ $t('exceltemplateanduploadit') }}。</p>
  675. <p style="display: flex;justify-content: center;padding-bottom:1em;">
  676. <el-upload ref="upload" action="#" :limit="1" :http-request="importUser" :show-file-list="false">
  677. <el-button type="primary" :underline="false" :loading="importingData">{{ $t('other.startImporting') }}</el-button>
  678. </el-upload>
  679. </p>
  680. </el-dialog>
  681. <!--薪资导入-->
  682. <el-dialog :title="$t('importSalary')" v-if="importUserSalaryDialog" :visible.sync="importUserSalaryDialog" customClass="customWidth" width="500px">
  683. <p>1. {{ $t('other.download') }}
  684. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/薪资导入模板.xlsx" :download="$t('salaryTemplate')+'.xlsx'">{{$t('salaryTemplate')}}.xlsx</el-link>
  685. </p>
  686. <p>2.
  687. {{ $t('Selectmonth') }}
  688. <el-date-picker v-model="ymonth" type="month" :placeholder="$t('Selectmonth')" format="yyyy-MM" value-format="yyyy-MM"></el-date-picker>
  689. <br/><span style="margin-left:10px;margin-top:8px;color:#999;">({{$t('Recalculatereportedcostsforthemonth')}})</span>
  690. </p>
  691. <p>3. {{ $t('exceltemplateanduploadit') }}。</p>
  692. <p style="display: flex;justify-content: center;padding-bottom:1em;">
  693. <el-upload ref="uploadSalaryRef" action="#" :limit="1" :http-request="importSalaryData" :show-file-list="false">
  694. <el-button type="primary" :underline="false" :loading="importingSalaryData">{{ $t('other.startImporting') }}</el-button>
  695. </el-upload>
  696. </p>
  697. </el-dialog>
  698. <el-dialog :title="$t('synchronizetheenterprisewechataddressbook')" v-if="showSyncCWDialog" :visible.sync="showSyncCWDialog" customClass="customWidth" width="500px">
  699. <p>{{ $t('oneWeix') }}
  700. <el-popover placement="top" width="1200" trigger="hover">
  701. <div class="imgFlex">
  702. <div><img src="../../assets/image/Step1.jpg" style="width: 380px"/> <p><b>{{ $t('firststep') }}</b></p> </div>
  703. <div class="imgBor"> <p></p> <img src="../../assets/image/Step2.jpg" style="width: 380px"/> <p><b>{{ $t('secondstep') }}</b></p></div>
  704. <div><img src="../../assets/image/Step3.jpg" style="width: 380px"/> <p><b>{{ $t('thirdstep') }}</b></p></div>
  705. </div>
  706. <i class="el-icon-question" slot="reference" />
  707. </el-popover>
  708. </p>
  709. <p>
  710. <el-input v-model="contactSecret" style="width:380px;" :disabled="!editSecret"/><el-button @click="editSecret?saveContactSecret():editSecret=true;" >{{editSecret?'保存':'修改'}}</el-button>
  711. </p>
  712. <p v-if="contactServer == null">
  713. {{ $t('twoWei') }}
  714. </p>
  715. <p v-if="contactServer == null" style="text-align:center;">
  716. <img
  717. style="width: 120px; height: 120px"
  718. src="../../assets/image/code.jpg" />
  719. </p>
  720. <p style="display: flex;justify-content: center;padding-bottom:1em;">
  721. <el-button type="primary" :underline="false" :loading="importingData" :disabled="!canSync" @click="startCorpWxImport">{{ $t('startsynchronization') }}</el-button>
  722. </p>
  723. </el-dialog>
  724. <el-dialog title="同步钉钉通讯录" v-if="showSyncDDDialog" :visible.sync="showSyncDDDialog" customClass="customWidth" width="500px">
  725. <p>{{ $t('areyousuretosynchronize') }}
  726. </p>
  727. <p>
  728. <el-checkbox v-model="isSyncContact" @change="setSyncContactDD()">人员所在部门与钉钉通讯录保持一致</el-checkbox>
  729. </p>
  730. <p style="display: flex;justify-content: center;padding-bottom:1em;">
  731. <el-button type="primary" :underline="false" :loading="importingData" @click="syncWithCorpDingding">{{ $t('startsynchronization') }}</el-button>
  732. </p>
  733. </el-dialog>
  734. <el-dialog :title="$t('correlationresults')" v-if="syncMembByCardTimeResultGialog" :visible.sync="syncMembByCardTimeResultGialog" customClass="customWidth" width="500px">
  735. <p style="padding-bottom:30px;">
  736. {{syncMembByCardTimeMsg}}
  737. </p>
  738. </el-dialog>
  739. <el-dialog title="同步日志" v-if="recordMsgDialog" :visible.sync="recordMsgDialog" customClass="customWidth" width="500px">
  740. <el-row style="height:70px;line-height:40px;padding-top:30px;padding-left:20px">
  741. <el-col :span="6">操作时间</el-col>
  742. <el-col :span="18">{{recordIndate(recordMsg.indate)}}</el-col>
  743. </el-row>
  744. <el-row style="height:70px;line-height:40px;padding-bottom:30px;padding-left:20px">
  745. <el-col :span="6">错误信息</el-col>
  746. <el-col :span="18">{{recordMsg.msg}}</el-col>
  747. </el-row>
  748. </el-dialog>
  749. <el-dialog :title="$t('synchronizetheenterprisemicrodirectory')" :visible.sync="newSyncWithCorpWxDayload" width="400px" :before-close="handleClose">
  750. <span>
  751. 同步前请联系企业微信管理员检查应用授权的可见范围 <br/>
  752. 路径:管理企业-应用管理-工时管家-可见范围
  753. </span>
  754. <span slot="footer" class="dialog-footer">
  755. <el-button type="primary" @click="visibleRange" v-if="wxManager">可见范围设置</el-button>
  756. <el-button type="primary" @click="newSyncWithCorpWx">开始同步</el-button>
  757. </span>
  758. </el-dialog>
  759. <el-dialog
  760. title="转移到"
  761. :visible.sync="transferActiveDialogFlag"
  762. width="20%">
  763. <span style="margin-left:25px;margin-right:5px;color:#606266;">转移到</span>
  764. <selectCat v-if="user.userNameNeedTranslate == 1" :subject="users" :subjectId="transferActive.takeoverId" :distinction="'23'" :clearable="true" @selectCal="selectCal"></selectCat>
  765. <span slot="footer" class="dialog-footer">
  766. <el-button @click="transferActiveDialogFlag = false">取 消</el-button>
  767. <el-button type="primary" @click="transferActiveMethod">确 定</el-button>
  768. </span>
  769. </el-dialog>
  770. </div>
  771. </div>
  772. </template>
  773. <script>
  774. // 左右滑動
  775. import dragMixin from "@/common/js/tensile.js";
  776. import util from "../../common/js/util";
  777. // 引入自定义级联组件
  778. import vueCascader from "@/components/cascader.vue"
  779. // 自定义select组件
  780. import selectCat from "@/components/select.vue"
  781. let that
  782. export default {
  783. name: "Home",
  784. components: {
  785. vueCascader,
  786. selectCat
  787. },
  788. mixins: [dragMixin],
  789. created() {
  790. let height = window.innerHeight;
  791. this.tableHeight = height - 195;
  792. const that = this;
  793. window.onresize = function temp() {
  794. that.tableHeight = window.innerHeight - 195;
  795. };
  796. this.initDrag([
  797. {
  798. type: "LR",
  799. domClass: {
  800. // 中间分割线的名字
  801. resize: "line-line",
  802. // 左侧盒子的名字
  803. left: "box-left",
  804. // 右侧盒子的名字
  805. right: "box-right",
  806. // 父级的名字
  807. box: "box-father",
  808. },
  809. otherInfo: {
  810. // 限制左边栏最低宽度
  811. leftWidth: 120,
  812. },
  813. },
  814. {
  815. type: "LR",
  816. domClass: {
  817. // 中间分割线的名字
  818. resize: "line-second",
  819. // 左侧盒子的名字
  820. left: "left-laowang",
  821. // 右侧盒子的名字
  822. right: "box-second-father",
  823. // 父级的名字
  824. box: "grand",
  825. },
  826. otherInfo: {
  827. // 限制左边栏最低宽度
  828. leftWidth: 120,
  829. },
  830. },
  831. ]);
  832. },
  833. data() {
  834. return {
  835. isSyncContact: false,
  836. showSyncDDDialog: false,
  837. transferActiveDialogFlag:false,
  838. transferActive:{
  839. handoverId:null,
  840. takeoverId:null
  841. },
  842. integer: '0',
  843. workingHoursDialog: false,
  844. workingHoursRadio: '1',
  845. workingHoursDatas: [],
  846. recordMsgDialog: false,
  847. recordMsg: {indate: [],msg:''},
  848. roleNameFlg: '',
  849. syncHistoryReport: true,
  850. ymonth: null,
  851. importingSalaryData: false,
  852. translation: '1', // 1、文字, 2、部门, 3、人员
  853. fullscreenLoading: false,
  854. syncMembByCardTimeResultGialog:false,
  855. syncMembByCardTimeMsg:null,
  856. editSecret: false,
  857. canSync: false,
  858. corpid: null,
  859. contactSecret: null,
  860. contactServer: null,
  861. showSyncCWDialog: false,
  862. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  863. handleSelectionZzjgshow: false,
  864. handljues: false,
  865. submitLoading: false,
  866. deactiveUser: null,
  867. deactiveDate: null,
  868. deactiveDialog: false,
  869. toUserId: null,
  870. myRoleId: null,
  871. allActiveUsers: [],
  872. transferDialog: false,
  873. containInvalid: 1,
  874. exportDialogVisible: false,
  875. roleArray: [
  876. this.$t('role.ordinaryEmployees'),
  877. this.$t('role.superAdministrator'),
  878. this.$t('role.systemAdministrator'),
  879. this.$t('role.companyTop'),
  880. this.$t('role.financialAdministrator'),
  881. this.$t('role.projectManager'),
  882. this.$t('role.companyLeadership'),
  883. ],
  884. roleDescArray: [
  885. { label: this.$t('role.ordinaryEmployees'), value: 0, desc: this.$t('eportandarticipate') },
  886. {
  887. label: this.$t('role.systemAdministrator'),
  888. value: 2,
  889. desc: this.$t('systemadministrators'),
  890. },
  891. // {label:"公司高层",value:3, desc:"查阅项目信息,人员工时情况"},
  892. {
  893. label: this.$t('role.financialAdministrator'),
  894. value: 4,
  895. desc: this.$t('financial'),
  896. },
  897. { label: this.$t('role.projectManager'), value: 5, desc: this.$t('createandmanageprojects') },
  898. {
  899. label: this.$t('role.companyLeadership'),
  900. value: 6,
  901. desc: this.$t('viewdailyreports'),
  902. },
  903. ],
  904. userSalaryList: [],
  905. userSalaryListDialog: false,
  906. value: {},
  907. user: JSON.parse(sessionStorage.getItem("user")),
  908. users: [],
  909. tableHeight: 0,
  910. listLoading: false,
  911. total: 0,
  912. page: 1,
  913. size: 20,
  914. list: [],
  915. data: [
  916. {
  917. id: -1,
  918. label: this.$t('lable.allStaff'),
  919. },
  920. {
  921. id: 0,
  922. label: this.$t('lable.unassigned'),
  923. },
  924. ],
  925. option: [],
  926. depData: {
  927. id: -1,
  928. label: this.$t('lable.allStaff'),
  929. },
  930. defaultProps: {
  931. children: "children",
  932. label: "label",
  933. },
  934. dialogVisible: false,
  935. title: "",
  936. insertForm: {
  937. id: null,
  938. name: null,
  939. phone: null,
  940. // role: null,
  941. roleId: null,
  942. monthCost: null,
  943. cost: null,
  944. departmentId: null,
  945. salaryType: 0,
  946. costApplyDate: util.formatDate.format(new Date(), "yyyy-MM-dd"),
  947. inductionDate: util.formatDate.format(new Date(), "yyyy-MM-dd"),
  948. position: "",
  949. certJson: [],
  950. plateMap: {},
  951. },
  952. rules: {
  953. name: [{ required: true, message: this.$t('defaultText.PleaseEnterYourName'), trigger: "blur" }],
  954. // phone: [{ required: true, message: "请输入电话", trigger: "blur" }],
  955. // role: [{ required: true, message: "请选择角色", trigger: "blur" }],
  956. roleId: [{ required: true, message: this.$t('pleaseselectroles'), trigger: "blur" }],
  957. cost: [{ required: true, message: this.$t('pleaseinputcost'), trigger: "blur" }],
  958. monthCost: [
  959. { required: true, message: this.$t('monthlycost'), trigger: "blur" },
  960. ],
  961. },
  962. managementFormRou: {
  963. name: [{ required: true, message: this.$t('pleaseenterprofessionalcertificate'), trigger: "blur" }],
  964. },
  965. departmentVisible: false,
  966. depTitle: "",
  967. depForm: {
  968. id: null,
  969. name: null,
  970. parentId: null,
  971. managerId: null,
  972. pushToSap:'1',
  973. },
  974. depRules: {
  975. name: [{ required: true, message: this.$t('pleaseenterthedepartmentname'), trigger: "blur" }],
  976. },
  977. timeType: {},
  978. keyword: "",
  979. rolesa: [
  980. {
  981. value: "",
  982. label: this.$t('all'),
  983. },
  984. {
  985. value: "6",
  986. label: this.$t('role.companyLeadership'),
  987. },
  988. {
  989. value: "2",
  990. label: this.$t('role.systemAdministrator'),
  991. },
  992. {
  993. value: "4",
  994. label: this.$t('role.financialAdministrator'),
  995. },
  996. {
  997. value: "5",
  998. label: this.$t('role.projectManager'),
  999. },
  1000. {
  1001. value: "0",
  1002. label: this.$t('role.ordinaryEmployees'),
  1003. },
  1004. ],
  1005. states: [
  1006. {
  1007. value: "",
  1008. label: this.$t('all'),
  1009. },
  1010. {
  1011. value: "1",
  1012. label: this.$t('zai-zhi'),
  1013. },
  1014. {
  1015. value: "0",
  1016. label: this.$t('ting-yong'),
  1017. }
  1018. ],
  1019. status: "1",
  1020. role: "",
  1021. jDarr: [],
  1022. importUserSalaryDialog: false,
  1023. handleSelectionZzjgDate: [],
  1024. handleSelectionZzjgwillchange: null,
  1025. acquireRoleList: [], // 角色列表
  1026. acquireRoleLists: [], // 没有超级管理员
  1027. roleId: "",
  1028. xiuRoleId: "",
  1029. managementDiolog: false,
  1030. addManagementDiolog: false,
  1031. managementForm: {
  1032. name: "",
  1033. },
  1034. managementTableData: [],
  1035. certificate: "",
  1036. addUserId: "",
  1037. userCustomConfig: [],
  1038. customConfigDialog: false,
  1039. importDialog: false,
  1040. importingData: false,
  1041. customConfigList: [],
  1042. cusItemTypes: [],
  1043. configItemList: [],
  1044. configItemId: null,
  1045. configItemDialog: false,
  1046. configItemAorMDialog: false,
  1047. AorMitem: {
  1048. name: null,
  1049. userCustomId: null,
  1050. id: null,
  1051. },
  1052. tableLoading: false,
  1053. suoying: ["plate1", "plate2", "plate3", "plate4", "plate5"],
  1054. insertFormPlates: [],
  1055. saveBtnLoading: false,
  1056. onlyDirect: false,
  1057. nextCursor: '',
  1058. newSyncWithCorpWxDayload: false,
  1059. wxManager: false,
  1060. adjustPosition: false,
  1061. dataRepeat: [],
  1062. deleteUserFlg: false,
  1063. deleteUserFlgData: {},
  1064. moveReportUserId: '',
  1065. deleteUserFlgloading: false
  1066. };
  1067. },
  1068. filters: {
  1069. acquireRoleName(value) {
  1070. for (var i in that.acquireRoleList) {
  1071. if (that.acquireRoleList[i].id == value) {
  1072. return that.acquireRoleList[i].rolename;
  1073. }
  1074. }
  1075. },
  1076. },
  1077. beforeCreate: function () {
  1078. that = this;
  1079. },
  1080. methods: {
  1081. delHisSalary(id, userId) {
  1082. this.$confirm('是否删除该记录?', this.$t('other.prompts'), {
  1083. confirmButtonText: this.$t('btn.determine'),
  1084. cancelButtonText: this.$t('btn.cancel'),
  1085. type: 'warning'
  1086. }).then(()=>{
  1087. this.http.post('/user/deleteUserSalaryById',{
  1088. id: id
  1089. },res => {
  1090. if(res.code == 'ok'){
  1091. this.$message({
  1092. message: '操作成功',
  1093. type: 'success'
  1094. })
  1095. this.reqSalaryList(userId);
  1096. }else {
  1097. this.$message({
  1098. message: res.msg,
  1099. type: 'error'
  1100. })
  1101. }
  1102. },error => {
  1103. this.$message({
  1104. message: error,
  1105. type: 'error'
  1106. })
  1107. })
  1108. }).catch(()=>{
  1109. this.$message({
  1110. message: this.$t('thedeletionhasbeencancelled'),
  1111. type: 'info'
  1112. })
  1113. })
  1114. },
  1115. statesPush(){
  1116. if(this.user.corpwxUserid != null && this.user.userNameNeedTranslate == 1){
  1117. var state = {value: "2",label: "可转让"}
  1118. this.states.push(state);
  1119. }
  1120. },
  1121. //继承账号弹窗
  1122. transferActiveDialog(row){
  1123. this.transferActiveDialogFlag = true;
  1124. this.transferActive.handoverId = row.id;
  1125. },
  1126. //继承账号
  1127. transferActiveMethod(){
  1128. if(this.transferActive.takeoverId == null){
  1129. this.$message({
  1130. message: "请选择接收人",
  1131. type: "error"
  1132. });
  1133. return;
  1134. }
  1135. this.transferActiveDialogFlag = false;
  1136. var handoverId = this.transferActive.handoverId
  1137. var takeoverId = this.transferActive.takeoverId
  1138. this.http.post('/wx-corp-info/batchTransferLicense', {handoverId,takeoverId},
  1139. res => {
  1140. if (res.code == "ok") {
  1141. this.$message({
  1142. message: res.msg,
  1143. type: "success"
  1144. });
  1145. } else {
  1146. this.$message({
  1147. message: res.msg,
  1148. type: "error"
  1149. });
  1150. }
  1151. },
  1152. error => {
  1153. this.$message({
  1154. message: error,
  1155. type: "error"
  1156. });
  1157. });
  1158. },
  1159. // 调整
  1160. adjustPositionClick() {
  1161. this.adjustPosition = !this.adjustPosition
  1162. if(!this.adjustPosition) {
  1163. this.queding()
  1164. }
  1165. },
  1166. getWxManager() {
  1167. this.http.post('/user/isManager', {},
  1168. res => {
  1169. if (res.code == "ok") {
  1170. let bur = res.data + ''
  1171. this.wxManager = bur == 'true'
  1172. } else {
  1173. this.$message({
  1174. message: res.msg,
  1175. type: "error"
  1176. });
  1177. }
  1178. },
  1179. error => {
  1180. this.$message({
  1181. message: error,
  1182. type: "error"
  1183. });
  1184. });
  1185. },
  1186. recordIndate(date){
  1187. let datestr = ''
  1188. datestr += date[0]
  1189. datestr += '-'
  1190. datestr += date[1] < 10 ? '0' + date[1] : date[1]
  1191. datestr += '-'
  1192. datestr += date[2] < 10 ? '0' + date[2] : date[2]
  1193. datestr += '\u3000'
  1194. datestr += date[3] < 10 ? '0' + date[3] : date[3]
  1195. datestr += ':'
  1196. datestr += date[4] < 10 ? '0' + date[4] : date[4]
  1197. datestr += ':'
  1198. datestr += date[5] < 10 ? '0' + date[5] : date[5]
  1199. return datestr
  1200. },
  1201. getRecordMsg(){
  1202. this.http.post('/company/getSyncInfo',{
  1203. },res => {
  1204. if(res.code == 'ok'){
  1205. if(res.data){
  1206. this.recordMsg = res.data
  1207. if(this.recordMsg.result == 0){
  1208. this.recordMsgDialog = true
  1209. }
  1210. }
  1211. }else{
  1212. this.$message({
  1213. message: res.msg,
  1214. type: 'error'
  1215. })
  1216. }
  1217. },err => {
  1218. this.$message({
  1219. message: err,
  1220. type: 'error'
  1221. })
  1222. })
  1223. },
  1224. syncMembByCardTime() {
  1225. this.syncMembByCardTimeResultGialog = true;
  1226. this.syncMembByCardTimeMsg = this.$t('synchronizingtheassociation');
  1227. this.http.post("/wxcorp/syncMembByCardTime",
  1228. {
  1229. companyId: this.user.companyId,
  1230. },
  1231. (res) => {
  1232. if (res.code == "ok") {
  1233. this.syncMembByCardTimeMsg = res.data;
  1234. this.getUser();
  1235. //人员同步成功,再去同步获取本月的人员
  1236. this.getCurMonthDayData();
  1237. } else {
  1238. this.syncMembByCardTimeMsg = res.msg;
  1239. }
  1240. },
  1241. (err) => {
  1242. this.syncMembByCardTimeMsg = err;
  1243. }
  1244. );
  1245. },
  1246. getCurMonthDayData() {
  1247. this.http.post("/wxcorp/getCurMonthDayData",
  1248. {
  1249. companyId: this.user.companyId,
  1250. },
  1251. (res) => {
  1252. if (res.code == "ok") {
  1253. } else {
  1254. }
  1255. },
  1256. (err) => {
  1257. }
  1258. );
  1259. },
  1260. saveContactSecret() {
  1261. if (!this.contactSecret) {
  1262. this.$message({
  1263. message: this.$t('booksecret'),
  1264. type: "error",
  1265. });
  1266. return;
  1267. }
  1268. this.http.post(
  1269. "/wx-corp-info/saveContactSecret",
  1270. {
  1271. corpid: this.corpid,
  1272. contactSecret: this.contactSecret,
  1273. },
  1274. (res) => {
  1275. if (res.code == "ok") {
  1276. this.$message({
  1277. message: this.$t('savesuccess'),
  1278. type: "success",
  1279. });
  1280. this.canSync = true;
  1281. } else {
  1282. this.$message({
  1283. message: res.msg,
  1284. type: "error",
  1285. });
  1286. }
  1287. },
  1288. (err) => {
  1289. this.tableLoading = false;
  1290. this.$message({
  1291. message: err,
  1292. type: "error",
  1293. });
  1294. }
  1295. );
  1296. },
  1297. startCorpWxImport() {
  1298. this.importingData = true;
  1299. this.http.post(
  1300. "/wxcorp/getCorpMembs",
  1301. {
  1302. corpId: this.corpid,
  1303. },
  1304. (res) => {
  1305. this.importingData = false;
  1306. if (res.code == "ok") {
  1307. this.showSyncCWDialog = false;
  1308. this.$message({
  1309. message: this.$t('synchronoussuccesss'),
  1310. type: "success",
  1311. });
  1312. this.getDepartment();
  1313. this.getUser();
  1314. this.getUsers();
  1315. } else {
  1316. this.$message({
  1317. message: res.msg,
  1318. type: "error",
  1319. });
  1320. }
  1321. },
  1322. (err) => {
  1323. this.tableLoading = false;
  1324. this.$message({
  1325. message: err,
  1326. type: "error",
  1327. });
  1328. }
  1329. );
  1330. },
  1331. //从企业微信同步通讯录
  1332. syncWithCorpWx() {
  1333. this.showSyncCWDialog = true;
  1334. this.editSecret = false;
  1335. this.http.post(
  1336. "/wx-corp-info/get",
  1337. {
  1338. companyId: this.user.companyId,
  1339. },
  1340. (res) => {
  1341. if (res.code == "ok") {
  1342. this.contactSecret = res.data.contactSecret;
  1343. this.contactServer = res.data.contactServer;
  1344. if (this.contactSecret && this.contactServer) {
  1345. this.canSync = true;
  1346. } else {
  1347. this.editSecret = true;
  1348. }
  1349. this.corpid = res.data.corpid;
  1350. } else {
  1351. this.$message({
  1352. message: res.msg,
  1353. type: "error",
  1354. });
  1355. }
  1356. },
  1357. (err) => {
  1358. this.tableLoading = false;
  1359. this.$message({
  1360. message: err,
  1361. type: "error",
  1362. });
  1363. }
  1364. );
  1365. },
  1366. // 从企业微信同步通讯录 (待测试)
  1367. newSyncWithCorpWx() {
  1368. const loading = this.$loading({
  1369. lock: true,
  1370. text: '同步中',
  1371. spinner: 'el-icon-loading',
  1372. background: 'rgba(0, 0, 0, 0.7)'
  1373. });
  1374. this.newSyncWithCorpWxDayload = false
  1375. this.http.post(
  1376. "/wxcorp/getCorpMembsFromPlatform",
  1377. {
  1378. companyId: this.user.companyId,
  1379. },
  1380. (res) => {
  1381. loading.close();
  1382. if (res.code == "ok") {
  1383. this.$message({
  1384. message: '同步成功',
  1385. type: "success",
  1386. });
  1387. this.getDepartment();
  1388. this.getUser();
  1389. this.getUsers();
  1390. } else {
  1391. this.$message({
  1392. message: res.msg,
  1393. type: "error",
  1394. });
  1395. }
  1396. },
  1397. (err) => {
  1398. loading.close();
  1399. this.tableLoading = false;
  1400. this.$message({
  1401. message: err,
  1402. type: "error",
  1403. });
  1404. }
  1405. );
  1406. },
  1407. showCorpDDSyncDialog() {
  1408. this.showSyncDDDialog = true;
  1409. this.http.post(
  1410. "/company-dingding/getSyncContact",
  1411. {},
  1412. (res) => {
  1413. if (res.code == "ok") {
  1414. this.isSyncContact = (res.data ==1?true: false);
  1415. }
  1416. },
  1417. (err) => {
  1418. this.$message({
  1419. message: err,
  1420. type: "error",
  1421. });
  1422. }
  1423. );
  1424. },
  1425. setSyncContactDD() {
  1426. this.http.post(
  1427. "/company-dingding/setSyncContact",
  1428. {isSync: this.isSyncContact?1:0},
  1429. (res) => {
  1430. if (res.code == "ok") {
  1431. } else {
  1432. this.$message({
  1433. message: res.msg,
  1434. type: "error",
  1435. });
  1436. }
  1437. },
  1438. (err) => {
  1439. this.$message({
  1440. message: err,
  1441. type: "error",
  1442. });
  1443. }
  1444. );
  1445. },
  1446. // 从钉钉同步通讯录
  1447. syncWithCorpDingding() {
  1448. this.importingData = true;
  1449. this.listLoading = true;
  1450. this.http.post(
  1451. "/company/syncCorpMembs",
  1452. {},
  1453. (res) => {
  1454. this.listLoading = false;
  1455. this.importingData = false;
  1456. if (res.code == "ok") {
  1457. this.showSyncDDDialog = false;
  1458. this.$message({
  1459. message: res.data,
  1460. type: "success",
  1461. });
  1462. this.getDepartment();
  1463. this.getUser();
  1464. this.getUsers();
  1465. } else {
  1466. this.$message({
  1467. message: res.msg,
  1468. type: "error",
  1469. });
  1470. }
  1471. },
  1472. (err) => {
  1473. this.listLoading = false;
  1474. this.$message({
  1475. message: err,
  1476. type: "error",
  1477. });
  1478. }
  1479. );
  1480. },
  1481. //根据key找到value
  1482. findValue(key,obj) {
  1483. for (let k in obj){
  1484. if (k===key){
  1485. return obj[k]
  1486. }
  1487. }
  1488. },
  1489. test() {
  1490. this.getCustomConfigList();
  1491. },
  1492. // 自定义配置项
  1493. customConfigShow() {
  1494. this.getCustomConfigList();
  1495. this.customConfigDialog = true;
  1496. },
  1497. getConfigItemBtn(item) {
  1498. this.configItemDialog = true;
  1499. this.AorMitem.userCustomId = item.id;
  1500. this.getConfigItem();
  1501. },
  1502. getConfigItem() {
  1503. // 获取配置下拉数据
  1504. this.http.post(
  1505. "/sub-user-custom/list",
  1506. {
  1507. userCustomId: this.AorMitem.userCustomId,
  1508. },
  1509. (res) => {
  1510. if (res.code == "ok") {
  1511. this.configItemList = res.data;
  1512. } else {
  1513. this.$message({
  1514. message: res.msg,
  1515. type: "error",
  1516. });
  1517. }
  1518. },
  1519. (err) => {
  1520. this.tableLoading = false;
  1521. this.$message({
  1522. message: err,
  1523. type: "error",
  1524. });
  1525. }
  1526. );
  1527. },
  1528. getCustomConfigList() {
  1529. // 获取自定义配置
  1530. this.http.post(
  1531. "/user-custom/list",
  1532. {},
  1533. (res) => {
  1534. if (res.code == "ok") {
  1535. let lists = JSON.parse(JSON.stringify(res.data));
  1536. this.userCustomConfig = JSON.parse(JSON.stringify(res.data));
  1537. // let lists = res.data
  1538. // this.customConfigList = res.data
  1539. this.customConfigList = [
  1540. { name: "", id: null, type: 1, companyId: null },
  1541. { name: "", id: null, type: 1, companyId: null },
  1542. { name: "", id: null, type: 1, companyId: null },
  1543. { name: "", id: null, type: 1, companyId: null },
  1544. { name: "", id: null, type: 1, companyId: null },
  1545. ];
  1546. for (let i in lists) {
  1547. this.$set(this.customConfigList[i], "name", lists[i].name);
  1548. this.$set(this.customConfigList[i], "id", lists[i].id);
  1549. this.$set(this.customConfigList[i], "type", lists[i].type);
  1550. this.$set(
  1551. this.customConfigList[i],
  1552. "companyId",
  1553. lists[i].companyId
  1554. );
  1555. }
  1556. // console.log('customConfigList',this.customConfigList);
  1557. this.cusItemTypes = [];
  1558. for (let j in this.customConfigList) {
  1559. if (
  1560. this.customConfigList[j].type == null ||
  1561. this.customConfigList[j].type == 0
  1562. ) {
  1563. this.customConfigList[j].type = 0;
  1564. this.cusItemTypes[j] = 0;
  1565. } else {
  1566. this.cusItemTypes[j] = 1;
  1567. }
  1568. }
  1569. } else {
  1570. this.$message({
  1571. message: res.msg,
  1572. type: "error",
  1573. });
  1574. }
  1575. },
  1576. (err) => {
  1577. this.$message({
  1578. message: err,
  1579. type: "error",
  1580. });
  1581. }
  1582. );
  1583. },
  1584. customConfigListSave() {
  1585. // 保存/修改自定义配置
  1586. // let jsonStr = ''
  1587. // for(let i in this.customConfigList){
  1588. // if(this.customConfigList[i].name){
  1589. // jsonStr += JSON.stringify(this.customConfigList[i]) + ','
  1590. // }
  1591. // }
  1592. // jsonStr = jsonStr.substring(0,jsonStr.length - 1)
  1593. // let jsonStr = []
  1594. this.saveBtnLoading = true;
  1595. let parameter = this.customConfigList.filter(
  1596. (item) => item.name.trim() != ""
  1597. );
  1598. this.http.post(
  1599. "/user-custom/addOrMod",
  1600. {
  1601. json: JSON.stringify(parameter),
  1602. },
  1603. (res) => {
  1604. if (res.code == "ok") {
  1605. this.getCustomConfigList();
  1606. this.saveBtnLoading = false;
  1607. this.$message({
  1608. message: this.$t('savesuccess'),
  1609. type: "success",
  1610. });
  1611. } else {
  1612. this.saveBtnLoading = false;
  1613. this.$message({
  1614. message: res.msg,
  1615. type: "error",
  1616. });
  1617. }
  1618. },
  1619. (err) => {
  1620. this.saveBtnLoading = false;
  1621. this.$message({
  1622. message: err,
  1623. type: "error",
  1624. });
  1625. }
  1626. );
  1627. },
  1628. customConfigDelete(item, index) {
  1629. if (item.id) {
  1630. this.http.post(
  1631. "/user-custom/delete",
  1632. {
  1633. id: item.id,
  1634. },
  1635. (res) => {
  1636. if (res.code == "ok") {
  1637. this.getCustomConfigList();
  1638. this.$message({
  1639. message: this.$t('message.successfullyDeleted'),
  1640. type: "success",
  1641. });
  1642. } else {
  1643. this.$message({
  1644. message: res.msg,
  1645. type: "error",
  1646. });
  1647. }
  1648. },
  1649. (err) => {
  1650. this.$message({
  1651. message: err,
  1652. type: "error",
  1653. });
  1654. }
  1655. );
  1656. } else {
  1657. this.customConfigList.splice(index, 1);
  1658. }
  1659. },
  1660. configItemAorM(item) {
  1661. this.configItemAorMDialog = true;
  1662. if (item) {
  1663. this.AorMitem.name = item.name;
  1664. this.AorMitem.id = item.id;
  1665. } else {
  1666. this.AorMitem.name = null;
  1667. this.AorMitem.id = null;
  1668. }
  1669. },
  1670. configItemAorMSure() {
  1671. // 新增/修改配置下拉选项
  1672. if (!this.AorMitem.name) {
  1673. this.$message({
  1674. message: this.$t('namecannotbeempty'),
  1675. type: "error",
  1676. });
  1677. return;
  1678. }
  1679. this.http.post(
  1680. "/sub-user-custom/addOrMod",
  1681. this.AorMitem,
  1682. (res) => {
  1683. if (res.code == "ok") {
  1684. this.configItemAorMDialog = false;
  1685. this.getConfigItem();
  1686. this.$message({
  1687. message: this.$t('message.submittedSuccessfully'),
  1688. type: "success",
  1689. });
  1690. } else {
  1691. this.$message({
  1692. message: res.msg,
  1693. type: "error",
  1694. });
  1695. }
  1696. },
  1697. (err) => {
  1698. this.$message({
  1699. message: err,
  1700. type: "error",
  1701. });
  1702. }
  1703. );
  1704. },
  1705. configItemDelete(item) {
  1706. // 删除配置下拉选项
  1707. this.http.post(
  1708. "/sub-user-custom/delete",
  1709. {
  1710. id: item.id,
  1711. },
  1712. (res) => {
  1713. if (res.code == "ok") {
  1714. this.getConfigItem();
  1715. this.$message({
  1716. message: this.$t('message.successfullyDeleted'),
  1717. type: "success",
  1718. });
  1719. } else {
  1720. this.$message({
  1721. message: res.msg,
  1722. type: "error",
  1723. });
  1724. }
  1725. },
  1726. (err) => {
  1727. this.$message({
  1728. message: err,
  1729. type: "error",
  1730. });
  1731. }
  1732. );
  1733. },
  1734. // 获取添加人员时的自定义配置信息
  1735. getUserCustomConfig(e) {
  1736. this.http.post(
  1737. "/user-custom/list",
  1738. {},
  1739. (res) => {
  1740. if (res.code == "ok") {
  1741. this.userCustomConfig = JSON.parse(JSON.stringify(res.data));
  1742. for (let i in this.userCustomConfig) {
  1743. if (this.userCustomConfig[i].type == 0) {
  1744. this.http.post(
  1745. "/sub-user-custom/list",
  1746. {
  1747. userCustomId: this.userCustomConfig[i].id,
  1748. },
  1749. (res) => {
  1750. if (res.code == "ok") {
  1751. // this.userCustomConfig[i].itemList = res.data
  1752. this.$set(this.userCustomConfig[i], "itemList", res.data);
  1753. } else {
  1754. this.$message({
  1755. message: res.msg,
  1756. type: "error",
  1757. });
  1758. }
  1759. },
  1760. (err) => {
  1761. this.$message({
  1762. message: err,
  1763. type: "error",
  1764. });
  1765. }
  1766. );
  1767. }
  1768. }
  1769. this.$nextTick(() => {
  1770. // let opt = this.users[0].plateMap[this.userCustomConfig[0].name]
  1771. // console.log('userCustomConfig',this.userCustomConfig);
  1772. // console.log('insertForm',this.insertForm);
  1773. });
  1774. } else {
  1775. this.$message({
  1776. message: res.msg,
  1777. type: "error",
  1778. });
  1779. }
  1780. },
  1781. (err) => {
  1782. this.$message({
  1783. message: err,
  1784. type: "error",
  1785. });
  1786. }
  1787. );
  1788. },
  1789. // customConfigListAdd(){
  1790. // this.customConfigList.push({
  1791. // name: '',
  1792. // type: 1
  1793. // })
  1794. // },
  1795. // 批量修改部门
  1796. handleSelectionZzjg(e) {
  1797. // if (e.length == 0) {
  1798. // this.handleSelectionZzjgshow = false
  1799. // }else{
  1800. // this.handleSelectionZzjgshow = true
  1801. // }
  1802. this.handleSelectionZzjgDate = e;
  1803. },
  1804. handleSelectionZzjgbtn1() {
  1805. this.handleSelectionZzjgshow = false;
  1806. this.$refs.handleSelectTable.clearSelection();
  1807. this.handleSelectionZzjgwillchange = null;
  1808. },
  1809. handleSelectionZzjgbtn2() {
  1810. if (this.handleSelectionZzjgwillchange == null) {
  1811. this.$message(this.$t('qing-xuan-ze-bu-men'));
  1812. return;
  1813. }
  1814. //接口调用样例代码如下
  1815. var ids = [];
  1816. for (
  1817. let index = 0;
  1818. index < this.handleSelectionZzjgDate.length;
  1819. index++
  1820. ) {
  1821. ids.push(this.handleSelectionZzjgDate[index].id);
  1822. }
  1823. var changeId =
  1824. this.handleSelectionZzjgwillchange[
  1825. this.handleSelectionZzjgwillchange.length - 1
  1826. ];
  1827. this.http.post(
  1828. "/user/batchUpdateDept",
  1829. {
  1830. userIds: JSON.stringify(ids),
  1831. deptId: changeId,
  1832. },
  1833. (res) => {
  1834. if (res.code == "ok") {
  1835. this.$message({
  1836. message: this.$t('message.modifyTheSuccess'),
  1837. type: "success",
  1838. });
  1839. this.getUser();
  1840. } else {
  1841. this.$message({
  1842. message: res.msg,
  1843. type: "error",
  1844. });
  1845. }
  1846. },
  1847. (error) => {
  1848. this.$message({
  1849. message: error,
  1850. type: "error",
  1851. });
  1852. }
  1853. );
  1854. // for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
  1855. // this.handleSelectionZzjgDate[index].departmentId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
  1856. // if (this.handleSelectionZzjgDate[index].role == 1) {
  1857. // this.submitInsert1(this.handleSelectionZzjgDate[index],1)
  1858. // }else{
  1859. // this.submitInsert(this.handleSelectionZzjgDate[index],1)
  1860. // }
  1861. // }
  1862. // this.handleSelectionZzjgwillchange = null
  1863. this.handleSelectionZzjgshow = false;
  1864. },
  1865. handleSelectionZzjgbtn3() {
  1866. if (this.handleSelectionZzjgDate.length == 0) {
  1867. this.$message(this.$t('pleaseselectpersonnel'));
  1868. return;
  1869. }
  1870. this.handleSelectionZzjgshow = true;
  1871. },
  1872. workingHoursDialogClick() {
  1873. let endDate = this.dayjs(`${new Date()}`).format('YYYY-MM-DD')
  1874. let startDate = this.dayjs(`${new Date()}`).format('YYYY-MM') + '-01'
  1875. this.workingHoursDatas = [startDate, endDate]
  1876. if (this.handleSelectionZzjgDate.length == 0) {
  1877. this.$message(this.$t('pleaseselectpersonnel'));
  1878. return;
  1879. }
  1880. this.workingHoursDialog = true
  1881. },
  1882. handJue() {
  1883. if (this.handleSelectionZzjgDate.length == 0) {
  1884. this.$message(this.$t('pleaseselectpersonnel'));
  1885. return;
  1886. }
  1887. for (var i in this.acquireRoleList) {
  1888. if (this.acquireRoleList[i].isDefault == 1) {
  1889. this.xiuRoleId = this.acquireRoleList[i].id;
  1890. }
  1891. }
  1892. this.handljues = true;
  1893. // console.log('触发了')
  1894. },
  1895. handleSelectionUser() {
  1896. // console.log(this.handleSelectionZzjgDate)
  1897. //接口调用样例代码如下
  1898. var ids = [];
  1899. for (
  1900. let index = 0;
  1901. index < this.handleSelectionZzjgDate.length;
  1902. index++
  1903. ) {
  1904. ids.push(this.handleSelectionZzjgDate[index].id);
  1905. }
  1906. // console.log(ids);
  1907. this.http.post(
  1908. "/user/setActiveByIds",
  1909. {
  1910. ids: JSON.stringify(ids),
  1911. isActive:1
  1912. },
  1913. (res) => {
  1914. if (res.code == "ok") {
  1915. this.$message({
  1916. message: this.$t('message.modifyTheSuccess'),
  1917. type: "success",
  1918. });
  1919. this.getUser();
  1920. } else {
  1921. this.$message({
  1922. message: res.msg,
  1923. type: "error",
  1924. });
  1925. }
  1926. },
  1927. (error) => {
  1928. this.$message({
  1929. message: error,
  1930. type: "error",
  1931. });
  1932. }
  1933. );
  1934. },
  1935. handTrue() {
  1936. var arr = [];
  1937. for (var i in this.handleSelectionZzjgDate) {
  1938. arr.push(this.handleSelectionZzjgDate[i].id);
  1939. }
  1940. this.http.post(
  1941. "/user/batchUpdateRole",
  1942. {
  1943. userIds: JSON.stringify(arr),
  1944. roleId: this.xiuRoleId,
  1945. },
  1946. (res) => {
  1947. if (res.code == "ok") {
  1948. this.$message({
  1949. message: this.$t('operationissuccessful'),
  1950. type: "success",
  1951. });
  1952. this.handljues = false;
  1953. this.getUser();
  1954. } else {
  1955. this.$message({
  1956. message: res.msg,
  1957. type: "error",
  1958. });
  1959. }
  1960. },
  1961. (error) => {
  1962. this.$message({
  1963. message: error,
  1964. type: "error",
  1965. });
  1966. }
  1967. );
  1968. },
  1969. // 转移日报
  1970. transferDaily() {
  1971. this.deleteUserFlgloading = true
  1972. this.http.post("/user/moveUserData", {
  1973. targetId: this.moveReportUserId,
  1974. sourceId: this.deleteUserFlgData.id
  1975. },
  1976. (res) => {
  1977. if (res.code == "ok") {
  1978. this.transferDailydete()
  1979. } else {
  1980. }
  1981. },
  1982. (error) => {
  1983. this.$message({
  1984. message: error,
  1985. type: "error",
  1986. });
  1987. });
  1988. },
  1989. transferDailydete() {
  1990. this.deleteUserFlgloading = true
  1991. this.http.post(
  1992. "/user/deleteUser",
  1993. {
  1994. // userId: targetUser.id,
  1995. userId: this.deleteUserFlgData.id,
  1996. },
  1997. (res) => {
  1998. this.deleteUserFlg = false
  1999. if (res.code == "ok") {
  2000. this.$message({
  2001. message: this.$t('message.successfullyDeleted'),
  2002. type: "success",
  2003. });
  2004. this.dialogVisible = false;
  2005. this.deleteUserFlgloading = false
  2006. this.getUser();
  2007. } else {
  2008. this.$message({
  2009. message: res.msg,
  2010. type: "error",
  2011. });
  2012. this.dialogVisible = false;
  2013. }
  2014. },
  2015. (error) => {
  2016. this.deleteUserFlg = false
  2017. this.$message({
  2018. message: error,
  2019. type: "error",
  2020. });
  2021. this.dialogVisible = false;
  2022. this.deleteUserFlgloading = false
  2023. }
  2024. );
  2025. },
  2026. deleteUser(targetUser) {
  2027. console.log(targetUser, '数据', this.deleteUserFlgData)
  2028. // this.$confirm(this.$t('deletthisemployee'), this.$t('other.prompts'), {
  2029. // //type: 'warning'
  2030. // }).then(() => {
  2031. this.dialogVisible = true
  2032. if(this.deleteUserFlgData.isExistsReport) {
  2033. this.transferDaily()
  2034. } else {
  2035. this.transferDailydete()
  2036. }
  2037. // this.http.post(
  2038. // "/user/deleteUser",
  2039. // {
  2040. // // userId: targetUser.id,
  2041. // userId: this.deleteUserFlgData.id,
  2042. // },
  2043. // (res) => {
  2044. // if (res.code == "ok") {
  2045. // this.$message({
  2046. // message: this.$t('message.successfullyDeleted'),
  2047. // type: "success",
  2048. // });
  2049. // this.dialogVisible = false;
  2050. // this.getUser();
  2051. // } else {
  2052. // this.$message({
  2053. // message: res.msg,
  2054. // type: "error",
  2055. // });
  2056. // this.dialogVisible = false;
  2057. // }
  2058. // },
  2059. // (error) => {
  2060. // this.$message({
  2061. // message: error,
  2062. // type: "error",
  2063. // });
  2064. // this.dialogVisible = false;
  2065. // }
  2066. // );
  2067. // });
  2068. },
  2069. chufa(data, b, c, e) {
  2070. if (this.depData == null || data.id != this.depData.id) {
  2071. // this.depData = data.id
  2072. this.depData = data;
  2073. this.page = 1;
  2074. this.getUser();
  2075. }
  2076. },
  2077. jieDian(a, b, c) {
  2078. var ids = a.id;
  2079. var arrs = this.jDarr;
  2080. arrs.push(ids);
  2081. this.jDarr = arrs;
  2082. },
  2083. shutDown(a, b, c) {
  2084. var ids = a.id;
  2085. var arrs = [];
  2086. for (var i in this.jDarr) {
  2087. if (this.jDarr[i] != ids) {
  2088. arrs.push(this.jDarr[i]);
  2089. }
  2090. }
  2091. this.jDarr = arrs;
  2092. },
  2093. mouseleave(data, $event) {
  2094. if($event.currentTarget && $event.currentTarget.firstElementChild && $event.currentTarget.firstElementChild.nextElementSibling && !this.adjustPosition) {
  2095. $event.currentTarget.firstElementChild.nextElementSibling.setAttribute(
  2096. "class",
  2097. "node none poAub"
  2098. );
  2099. }
  2100. },
  2101. mouseover(data, $event) {
  2102. if($event.currentTarget.lastChild.setAttribute && !this.adjustPosition) {
  2103. $event.currentTarget.lastChild.setAttribute("class", "node block poAub");
  2104. }
  2105. },
  2106. confirmDeactive() {
  2107. this.http.post(
  2108. "/user/deactiveUser",
  2109. {
  2110. id: this.deactiveUser.id,
  2111. inactiveDate: this.deactiveDate,
  2112. },
  2113. (res) => {
  2114. if (res.code == "ok") {
  2115. this.deactiveDialog = false;
  2116. this.$message({
  2117. message: this.$t('stopsuccess'),
  2118. type: "success",
  2119. });
  2120. this.getUser();
  2121. } else {
  2122. if(this.user.companyId==876||this.user.companyId==877||this.user.companyId==878){
  2123. this.$confirm('当前员工有待审核日报,确认停用并驳回日报吗?', '提示', {
  2124. confirmButtonText: '确定',
  2125. cancelButtonText: '取消',
  2126. type: 'warning'
  2127. }).then(() => {
  2128. this.http.post(
  2129. "/report/denyByCheckId",
  2130. { userId:this.deactiveUser.id },
  2131. (res) => {
  2132. if (res.code == "ok") {
  2133. this.$message({
  2134. message: this.$t('stopsuccess'),
  2135. type: "success",
  2136. });
  2137. } else {
  2138. this.$message({
  2139. message: res.msg,
  2140. type: "error",
  2141. });
  2142. }
  2143. },
  2144. (error) => {
  2145. this.listLoading = false;
  2146. this.$message({
  2147. message: error,
  2148. type: "error",
  2149. });
  2150. }
  2151. );
  2152. }).catch(() => {
  2153. this.$message({
  2154. type: 'info',
  2155. message: '已取消'
  2156. });
  2157. });
  2158. }else{
  2159. this.$message({
  2160. message: error,
  2161. type: "error",
  2162. });
  2163. }
  2164. }
  2165. },
  2166. (error) => {
  2167. this.$message({
  2168. message: error,
  2169. type: "error",
  2170. });
  2171. }
  2172. );
  2173. },
  2174. showDeactiveDialog(item) {
  2175. this.deactiveDialog = true;
  2176. this.deactiveUser = item;
  2177. },
  2178. restrictNumber(targetId) {
  2179. let inpu = document.getElementById(targetId);
  2180. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2181. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2182. inpu.value = inpu.value
  2183. .replace(".", "$#*")
  2184. .replace(/\./g, "")
  2185. .replace("$#*", "."); //去除其他"."
  2186. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, "$1.$2"); //限制只能输入两个小数
  2187. if (inpu.value.indexOf(".") < 0 && inpu.value != "") {
  2188. //首位是0的话去掉
  2189. inpu.value = parseFloat(inpu.value);
  2190. }
  2191. },
  2192. restrictNumber4(targetId) {
  2193. let inpu = document.getElementById(targetId);
  2194. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2195. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2196. inpu.value = inpu.value
  2197. .replace(".", "$#*")
  2198. .replace(/\./g, "")
  2199. .replace("$#*", "."); //去除其他"."
  2200. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d\d\d).*$/, "$1.$2"); //限制只能输入两个小数
  2201. if (inpu.value.indexOf(".") < 0 && inpu.value != "") {
  2202. //首位是0的话去掉
  2203. inpu.value = parseFloat(inpu.value);
  2204. }
  2205. },
  2206. showConfirmDialog() {
  2207. if (this.toUserId == null || this.toUserId == "") {
  2208. this.$message({
  2209. message: this.$t('wanttotransfer'),
  2210. type: "error",
  2211. });
  2212. return;
  2213. }
  2214. if (!this.myRoleId) {
  2215. this.$message({
  2216. message: this.$t('pleaseselectaftertransfer'),
  2217. type: "error",
  2218. });
  2219. return;
  2220. }
  2221. this.$confirm(
  2222. this.$t('superadministratorrole'),
  2223. this.$t('other.prompts'),
  2224. {
  2225. //type: 'warning'
  2226. }
  2227. ).then(() => {
  2228. this.http.post(
  2229. "/user/changeSysManager",
  2230. {
  2231. toUserId: this.toUserId,
  2232. myRoleId: this.myRoleId,
  2233. },
  2234. (res) => {
  2235. if (res.code == "ok") {
  2236. sessionStorage.removeItem("user");
  2237. this.$router.push("/login");
  2238. } else {
  2239. this.$message({
  2240. message: res.msg,
  2241. type: "error",
  2242. });
  2243. }
  2244. },
  2245. (error) => {
  2246. this.$message({
  2247. message: error,
  2248. type: "error",
  2249. });
  2250. }
  2251. );
  2252. });
  2253. },
  2254. transferRole() {
  2255. this.transferDialog = true;
  2256. this.http.post(
  2257. this.port.manage.list,
  2258. {
  2259. departmentId: -1,
  2260. pageIndex: 1,
  2261. // pageSize: 99999,
  2262. pageSize: -1,
  2263. },
  2264. (res) => {
  2265. if (res.code == "ok") {
  2266. this.allActiveUsers = res.data.records.filter(
  2267. (u) => u.isActive == 1 && u.id != this.user.id
  2268. );
  2269. } else {
  2270. this.$message({
  2271. message: res.msg,
  2272. type: "error",
  2273. });
  2274. }
  2275. },
  2276. (error) => {
  2277. this.$message({
  2278. message: error,
  2279. type: "error",
  2280. });
  2281. }
  2282. );
  2283. },
  2284. showExportDialog() {
  2285. this.exportDialogVisible = true;
  2286. },
  2287. exportUsers() {
  2288. this.http.post(
  2289. "/user/exportUsers",
  2290. {
  2291. containInvalid: this.containInvalid,
  2292. },
  2293. (res) => {
  2294. if (res.code == "ok") {
  2295. this.exportDialogVisible = false;
  2296. var aTag = document.createElement("a");
  2297. aTag.download = this.$t('listofallemployees') + ".xls";
  2298. aTag.href = res.data;
  2299. aTag.click();
  2300. } else {
  2301. this.$message({
  2302. message: res.msg,
  2303. type: "error",
  2304. });
  2305. }
  2306. },
  2307. (error) => {
  2308. this.$message({
  2309. message: error,
  2310. type: "error",
  2311. });
  2312. }
  2313. );
  2314. },
  2315. showSalaryList(item) {
  2316. this.userSalaryListDialog = true;
  2317. this.reqSalaryList(item.id);
  2318. },
  2319. reqSalaryList(userId) {
  2320. this.userSalaryList = [];
  2321. this.http.post(
  2322. "/user/getUserSalaryList",
  2323. {
  2324. id: userId,
  2325. },
  2326. (res) => {
  2327. if (res.code == "ok") {
  2328. this.userSalaryList = res.data;
  2329. } else {
  2330. this.$message({
  2331. message: res.msg,
  2332. type: "error",
  2333. });
  2334. }
  2335. },
  2336. (error) => {
  2337. this.$message({
  2338. message: error,
  2339. type: "error",
  2340. });
  2341. }
  2342. );
  2343. },
  2344. getUsers() {
  2345. this.http.post(
  2346. // this.port.manage.list,
  2347. '/user/getSimpleActiveUserList',
  2348. {},
  2349. (res) => {
  2350. if (res.code == "ok") {
  2351. // this.users = res.data.records;
  2352. this.users = res.data;
  2353. } else {
  2354. this.$message({
  2355. message: res.msg,
  2356. type: "error",
  2357. });
  2358. }
  2359. },
  2360. (error) => {
  2361. this.$message({
  2362. message: error,
  2363. type: "error",
  2364. });
  2365. }
  2366. );
  2367. },
  2368. onSalaryTypeChange(value) {
  2369. if (value == 1) {
  2370. this.insertForm.monthCost = null;
  2371. }
  2372. },
  2373. //选中部门
  2374. choseDept(value) {
  2375. // console.log(value);
  2376. },
  2377. //月成本输入变化
  2378. oninput(e) {
  2379. this.insertForm.cost = (
  2380. this.insertForm.monthCost /
  2381. this.timeType.monthDays /
  2382. this.timeType.allday
  2383. ).toFixed(4);
  2384. },
  2385. // 获取本公司的工作时间设置
  2386. getCompanyTimeSetting() {
  2387. this.http.post(
  2388. "/time-type/getCompanyTimeSetting",
  2389. {
  2390. companyId: this.user.companyId,
  2391. },
  2392. (res) => {
  2393. if (res.code == "ok") {
  2394. this.timeType = res.data;
  2395. this.saasSyncContact = res.saasSyncContact
  2396. } else {
  2397. this.$message({
  2398. message: res.msg,
  2399. type: "error",
  2400. });
  2401. }
  2402. },
  2403. (error) => {
  2404. this.listLoading = false;
  2405. this.$message({
  2406. message: error,
  2407. type: "error",
  2408. });
  2409. }
  2410. );
  2411. },
  2412. importUserC() {
  2413. this.importDialog = true;
  2414. },
  2415. importUserSalary() {
  2416. this.importUserSalaryDialog = true;
  2417. },
  2418. // 批量导入人员
  2419. importUser(item) {
  2420. //首先判断文件类型
  2421. let str = item.file.name.split(".");
  2422. let format = str[str.length - 1];
  2423. if (format != "xls" && format != "xlsx") {
  2424. this.$message({
  2425. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2426. type: "error",
  2427. });
  2428. } else {
  2429. this.listLoading = true;
  2430. let formData = new FormData();
  2431. formData.append("file", item.file);
  2432. this.importingData = true;
  2433. this.http.uploadFile(
  2434. this.port.manage.import,
  2435. formData,
  2436. (res) => {
  2437. this.importingData = false;
  2438. this.$refs.upload.clearFiles();
  2439. this.listLoading = false;
  2440. if (res.code == "ok") {
  2441. this.$message({
  2442. message: this.$t('other.importSuccess'),
  2443. type: "success",
  2444. });
  2445. //重新读取列表
  2446. this.getUser();
  2447. this.importDialog = false;
  2448. } else {
  2449. this.$message({
  2450. message: res.msg,
  2451. type: "error",
  2452. });
  2453. }
  2454. },
  2455. (error) => {
  2456. this.importingData = false;
  2457. this.$refs.upload.clearFiles();
  2458. this.listLoading = false;
  2459. this.$message({
  2460. message: error,
  2461. type: "error",
  2462. });
  2463. }
  2464. );
  2465. }
  2466. },
  2467. //导入人员薪资
  2468. importSalaryData(item) {
  2469. //首先判断文件类型
  2470. let str = item.file.name.split(".");
  2471. let format = str[str.length - 1];
  2472. if (format != "xls" && format != "xlsx") {
  2473. this.$message({
  2474. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2475. type: "error",
  2476. });
  2477. } else {
  2478. let formData = new FormData();
  2479. formData.append("file", item.file);
  2480. formData.append("ymonth", this.ymonth);
  2481. this.importingSalaryData = true;
  2482. this.http.uploadFile(
  2483. "/user/importMonthCost",
  2484. formData,
  2485. (res) => {
  2486. this.importingSalaryData = false;
  2487. this.$refs.uploadSalaryRef.clearFiles();
  2488. this.listLoading = false;
  2489. if (res.code == "ok") {
  2490. this.$message({
  2491. message: this.$t('other.importSuccess'),
  2492. type: "success",
  2493. });
  2494. //重新读取列表
  2495. this.getUser();
  2496. this.importUserSalaryDialog = false;
  2497. } else {
  2498. this.$message({
  2499. message: res.msg,
  2500. type: "error",
  2501. });
  2502. }
  2503. },
  2504. (error) => {
  2505. this.importingSalaryData = false;
  2506. this.$refs.uploadSalaryRef.clearFiles();
  2507. this.$message({
  2508. message: error,
  2509. type: "error",
  2510. });
  2511. }
  2512. );
  2513. }
  2514. },
  2515. //分页
  2516. handleCurrentChange(val) {
  2517. this.page = val;
  2518. this.getUser();
  2519. },
  2520. handleSizeChange(val) {
  2521. this.size = val;
  2522. this.page=1;
  2523. this.getUser();
  2524. },
  2525. //获取所有员工的列表
  2526. getUser() {
  2527. // console.log(12345)
  2528. this.listLoading = true;
  2529. this.http.post(
  2530. this.port.manage.list,
  2531. {
  2532. departmentId: this.depData.id,
  2533. pageIndex: this.page,
  2534. pageSize: this.size,
  2535. keyword: this.keyword,
  2536. status: this.status,
  2537. // role: this.role
  2538. roleId: this.roleId,
  2539. onlyDirect: this.onlyDirect ? "1" : "0",
  2540. cursor: this.nextCursor, // 游标
  2541. matchingType: this.integer
  2542. },
  2543. (res) => {
  2544. this.listLoading = false;
  2545. if (res.code == "ok") {
  2546. this.list = res.data.records;
  2547. this.total = res.data.total;
  2548. this.nextCursor = res.data.nextCursor
  2549. } else {
  2550. this.$message({
  2551. message: res.msg,
  2552. type: "error",
  2553. });
  2554. }
  2555. },
  2556. (error) => {
  2557. this.listLoading = false;
  2558. this.$message({
  2559. message: error,
  2560. type: "error",
  2561. });
  2562. }
  2563. );
  2564. },
  2565. syncFeishu(){
  2566. this.http.post(
  2567. "/feishu-info/getFeishuMembsFromPlatform",
  2568. {},
  2569. (res) => {
  2570. if (res.code == "ok") {
  2571. this.$message({
  2572. message: '同步成功',
  2573. type: "success",
  2574. });
  2575. } else {
  2576. this.$message({
  2577. message: res.msg,
  2578. type: "error",
  2579. });
  2580. }
  2581. },
  2582. (error) => {
  2583. this.listLoading = false;
  2584. this.$message({
  2585. message: error,
  2586. type: "error",
  2587. });
  2588. }
  2589. );
  2590. },
  2591. syncAd(){
  2592. this.http.post(
  2593. "/user/syncDeptWithAD",
  2594. {},
  2595. (res) => {
  2596. if (res.code == "ok") {
  2597. this.$message({
  2598. message: '同步成功',
  2599. type: "success",
  2600. });
  2601. } else {
  2602. this.$message({
  2603. message: res.msg,
  2604. type: "error",
  2605. });
  2606. }
  2607. },
  2608. (error) => {
  2609. this.listLoading = false;
  2610. this.$message({
  2611. message: error,
  2612. type: "error",
  2613. });
  2614. }
  2615. );
  2616. },
  2617. resetPwd(user) {
  2618. this.$confirm(this.$t('wanttoor') + user.name + this.$t('resetyourpassword'), this.$t('saresetyourpassword'), {
  2619. confirmButtonText: this.$t('btn.determine'),
  2620. cancelButtonText: this.$t('btn.cancel'),
  2621. type: "warning",
  2622. })
  2623. .then(() => {
  2624. this.http.post(
  2625. "/user/resetPwd",
  2626. { userId: user.id },
  2627. (res) => {
  2628. if (res.code == "ok") {
  2629. this.$message({
  2630. message: this.$t('linglingling'),
  2631. type: "success",
  2632. });
  2633. } else {
  2634. this.$message({
  2635. message: res.msg,
  2636. type: "error",
  2637. });
  2638. }
  2639. },
  2640. (error) => {
  2641. this.listLoading = false;
  2642. this.$message({
  2643. message: error,
  2644. type: "error",
  2645. });
  2646. }
  2647. );
  2648. })
  2649. .catch(() => {});
  2650. },
  2651. // 新增、编辑人员
  2652. openInsertDialog(row, roleNameFlg) {
  2653. this.roleNameFlg = roleNameFlg
  2654. if (row != null) {
  2655. var list = JSON.parse(JSON.stringify(row)),
  2656. arr = [],
  2657. array = [];
  2658. if (list.departmentCascade != "0" && list.departmentCascade != null) {
  2659. if (list.departmentCascade.indexOf(",") > -1) {
  2660. arr = list.departmentCascade.split(",");
  2661. } else {
  2662. arr = [].concat(list.departmentCascade);
  2663. }
  2664. }
  2665. for (var i in arr) {
  2666. array.push(parseInt(arr[i]));
  2667. }
  2668. // console.log(list, '数据')
  2669. // this.insertForm = {
  2670. // id: list.id,
  2671. // name: list.name,
  2672. // phone: list.phone,
  2673. // // role: list.role,
  2674. // roleId: list.roleId,
  2675. // monthCost:list.monthCost,
  2676. // cost: list.cost,
  2677. // departmentId: array.reverse(),
  2678. // salaryType: list.salaryType,
  2679. // costApplyDate: list.costApplyDate,
  2680. // position: list.position
  2681. // };
  2682. this.addUserId = list.id;
  2683. this.http.post(
  2684. "/user/getUserInfo",
  2685. {
  2686. userId: list.id,
  2687. },
  2688. (res) => {
  2689. if (res.code == "ok") {
  2690. this.deleteUserFlgData = res.data
  2691. this.insertForm = {
  2692. id: res.data.id,
  2693. name: res.data.name,
  2694. phone: res.data.phone,
  2695. roleId: res.data.roleId,
  2696. monthCost: res.data.monthCost ? res.data.monthCost : 0,
  2697. cost: res.data.cost ? res.data.cost : 0,
  2698. departmentId: array.reverse(),
  2699. salaryType: res.data.salaryType,
  2700. costApplyDate: res.data.costApplyDate,
  2701. // inductionDate: res.data.inductionDate,
  2702. inactiveDate: res.data.inactiveDate,
  2703. isActive: res.data.isActive,
  2704. position: res.data.position,
  2705. certJson: res.data.certList,
  2706. plateMap: {},
  2707. superiorId: res.data.superiorId,
  2708. plate1: res.data.plate1,
  2709. plate2: res.data.plate2,
  2710. plate3: res.data.plate3,
  2711. plate4: res.data.plate4,
  2712. plate5: res.data.plate5,
  2713. jobNumber: res.data.jobNumber,
  2714. onlyAuditOnce: res.data.onlyAuditOnce
  2715. };
  2716. this.$set(this.insertForm, 'inductionDate', res.data.inductionDate)
  2717. this.getUserCustomConfig(1);
  2718. } else {
  2719. this.$message({
  2720. message: res.msg,
  2721. type: "error",
  2722. });
  2723. }
  2724. },
  2725. (error) => {
  2726. this.listLoading = false;
  2727. this.$message({
  2728. message: error,
  2729. type: "error",
  2730. });
  2731. }
  2732. );
  2733. this.title = this.$t('editorialstaff');
  2734. } else {
  2735. this.addUserId = "";
  2736. this.insertForm = {
  2737. id: null,
  2738. name: null,
  2739. phone: null,
  2740. // role: null,
  2741. roleId: null,
  2742. monthCost: null,
  2743. cost: null,
  2744. departmentId: null,
  2745. salaryType: 0,
  2746. costApplyDate: util.formatDate.format(new Date(), "yyyy-MM-dd"),
  2747. inductionDate: util.formatDate.format(new Date(), "yyyy-MM-dd"),
  2748. position: "",
  2749. certJson: [],
  2750. plateMap: {},
  2751. plate1: null,
  2752. plate2: null,
  2753. plate3: null,
  2754. plate4: null,
  2755. plate5: null,
  2756. jobNumber:null,
  2757. onlyAuditOnce: 0,
  2758. };
  2759. this.title = this.$t('addorialstaff');
  2760. this.getUserCustomConfig();
  2761. // this.insertForm.plateMap['定义测试文本'] = '测试文本'
  2762. // console.log('insertForm',this.insertForm);
  2763. }
  2764. this.dialogVisible = true;
  2765. console.log(this.insertForm);
  2766. },
  2767. submitInsert() {
  2768. var form = {};
  2769. var ssR = this.upRepeat(this.insertForm.certJson);
  2770. var trs = true;
  2771. this.$refs.form12.validate((valid) => {
  2772. if (valid) {
  2773. this.submitLoading = true;
  2774. if (ssR) {
  2775. this.$message({
  2776. message: this.$t('repeat'),
  2777. type: "error",
  2778. });
  2779. this.submitLoading = false;
  2780. return false;
  2781. }
  2782. for (var s in this.insertForm.certJson) {
  2783. if (
  2784. !this.insertForm.certJson[s].certDate ||
  2785. !this.insertForm.certJson[s].certId
  2786. ) {
  2787. trs = false;
  2788. }
  2789. }
  2790. if (!trs) {
  2791. this.$message({
  2792. message: this.$t('certificateisincomplete'),
  2793. type: "error",
  2794. });
  2795. this.submitLoading = false;
  2796. return false;
  2797. }
  2798. form = {
  2799. name: this.insertForm.name,
  2800. phone: this.insertForm.phone,
  2801. // role: this.insertForm.role,
  2802. roleId: this.insertForm.roleId,
  2803. monthCost: this.insertForm.monthCost,
  2804. cost: this.insertForm.cost,
  2805. salaryType: this.insertForm.salaryType,
  2806. position: this.insertForm.position,
  2807. certJson: JSON.stringify(this.insertForm.certJson),
  2808. // certJson: this.insertForm.certJson
  2809. inductionDate: this.insertForm.inductionDate,
  2810. plate1: this.insertForm.plate1,
  2811. plate2: this.insertForm.plate2,
  2812. plate3: this.insertForm.plate3,
  2813. plate4: this.insertForm.plate4,
  2814. plate5: this.insertForm.plate5,
  2815. jobNumber: this.insertForm.jobNumber,
  2816. onlyAuditOnce: this.insertForm.onlyAuditOnce,
  2817. };
  2818. if (this.insertForm.isActive == 0) {
  2819. form.inactiveDate = this.insertForm.inactiveDate;
  2820. }
  2821. // for(let i=0;i<5;i++) {
  2822. // if(this.insertFormPlates[i]){
  2823. // form[this.suoying[i]] = this.insertFormPlates[i]
  2824. // }
  2825. // }
  2826. // console.log(form, 'form')
  2827. if (this.insertForm.id != null) {
  2828. form.id = this.insertForm.id;
  2829. }
  2830. if (this.insertForm.superiorId) {
  2831. form.superiorId = this.insertForm.superiorId;
  2832. }
  2833. if (this.insertForm.costApplyDate != null) {
  2834. form.costApplyDate = this.insertForm.costApplyDate;
  2835. }
  2836. if (this.insertForm.departmentId != null) {
  2837. form.departmentId =
  2838. this.insertForm.departmentId[
  2839. this.insertForm.departmentId.length - 1
  2840. ];
  2841. }
  2842. if (!ssR && trs) {
  2843. this.http.post(
  2844. this.port.manage.insert,
  2845. form,
  2846. (res) => {
  2847. this.submitLoading = false;
  2848. if (res.code == "ok") {
  2849. this.$message({
  2850. message:
  2851. this.insertForm.id != null ? this.$t('xiu-gai') : this.$t('create') + this.$t('other.successful'),
  2852. type: "success",
  2853. });
  2854. this.dialogVisible = false;
  2855. this.getUser();
  2856. this.getUsers();
  2857. } else {
  2858. this.$message({
  2859. message: res.msg,
  2860. type: "error",
  2861. });
  2862. }
  2863. },
  2864. (error) => {
  2865. this.listLoading = false;
  2866. this.$message({
  2867. message: error,
  2868. type: "error",
  2869. });
  2870. }
  2871. );
  2872. }
  2873. }
  2874. });
  2875. // console.log(form, '提交的数据')
  2876. // return
  2877. // console.log(ssR, trs)
  2878. },
  2879. // 切换角色
  2880. switchRole(index) {
  2881. this.listLoading = true;
  2882. this.http.post(
  2883. this.port.manage.permission,
  2884. { id: this.list[index].id },
  2885. (res) => {
  2886. this.listLoading = false;
  2887. if (res.code == "ok") {
  2888. this.$message({
  2889. message: this.$t('switchingroles'),
  2890. type: "success",
  2891. });
  2892. //重新读取列表
  2893. this.page=1;
  2894. this.getUser();
  2895. } else {
  2896. this.$message({
  2897. message: res.msg,
  2898. type: "error",
  2899. });
  2900. }
  2901. },
  2902. (error) => {
  2903. this.listLoading = false;
  2904. this.$message({
  2905. message: error,
  2906. type: "error",
  2907. });
  2908. }
  2909. );
  2910. },
  2911. // 删除用户
  2912. setActive(item, isActive) {
  2913. var txt = isActive == 1 ? this.$t('enable') : this.$t('ting-yong');
  2914. // this.$confirm(this.$t('sureyouwantto') + txt + " " + item.name + this.$t('ma'), this.$t('zhang-hao') + txt, {
  2915. this.$confirm(this.$t('sureyouwantto') + txt + '该员工' + this.$t('ma'), this.$t('zhang-hao') + txt, {
  2916. confirmButtonText: this.$t('btn.determine'),
  2917. cancelButtonText: this.$t('btn.cancel'),
  2918. type: "warning",
  2919. })
  2920. .then(() => {
  2921. this.listLoading = true;
  2922. this.http.post(
  2923. "/user/setActive",
  2924. { id: item.id, isActive: isActive },
  2925. (res) => {
  2926. this.listLoading = false;
  2927. if (res.code == "ok") {
  2928. this.$message({
  2929. message: txt + this.$t('other.successful'),
  2930. type: "success",
  2931. });
  2932. //重新读取列表
  2933. this.getUser();
  2934. } else {
  2935. this.$message({
  2936. message: res.msg,
  2937. type: "error",
  2938. });
  2939. }
  2940. },
  2941. (error) => {
  2942. this.listLoading = false;
  2943. this.$message({
  2944. message: error,
  2945. type: "error",
  2946. });
  2947. }
  2948. );
  2949. })
  2950. .catch(() => {});
  2951. },
  2952. // 获取部门列表
  2953. getDepartment() {
  2954. this.http.post(
  2955. this.port.manage.depList,
  2956. {},
  2957. (res) => {
  2958. if (res.code == "ok") {
  2959. var list = res.data,
  2960. list1 = JSON.parse(JSON.stringify(res.data));
  2961. list.splice(0, 0, {
  2962. id: -1,
  2963. label: this.$t('lable.allStaff'),
  2964. });
  2965. list.push({
  2966. id: 0,
  2967. label: this.$t('lable.unassigned'),
  2968. });
  2969. this.data = list;
  2970. this.dataRepeat = JSON.parse(JSON.stringify(list))
  2971. console.log(list, "部门数据")
  2972. this.option = this.changeArr(list1);
  2973. } else {
  2974. this.$message({
  2975. message: res.msg,
  2976. type: "error",
  2977. });
  2978. }
  2979. },
  2980. (error) => {
  2981. this.$message({
  2982. message: error,
  2983. type: "error",
  2984. });
  2985. }
  2986. );
  2987. },
  2988. // 修改数组
  2989. changeArr(arr) {
  2990. for (var i = 0; i < arr.length; i++) {
  2991. if (arr[i].id != -1 && arr[i].id != 0) {
  2992. if (arr[i].children != null && arr[i].children.length > 0) {
  2993. arr[i].children = this.changeArr(arr[i].children);
  2994. }
  2995. arr[i].id && (arr[i].value = arr[i].id);
  2996. delete arr[i].id;
  2997. }
  2998. }
  2999. for (var i in arr) {
  3000. if (arr[i].id == -1 || arr[i].id == 0) {
  3001. arr.splice(i, 1);
  3002. }
  3003. }
  3004. return arr;
  3005. },
  3006. // 部门列表点击
  3007. handleNodeClick(data) {
  3008. this.theValues(data)
  3009. console.log(data)
  3010. if (this.depData == null || data.id != this.depData.id) {
  3011. this.depData = data;
  3012. this.page = 1;
  3013. this.getUser();
  3014. }
  3015. },
  3016. theValues(obj) {
  3017. if(obj.id != '-1') {
  3018. this.translation = '2'
  3019. } else {
  3020. this.translation = '1'
  3021. }
  3022. },
  3023. // 新增、修改部门
  3024. createDepartment(i) {
  3025. console.log(i, '看看')
  3026. setTimeout(() => {
  3027. var that = this;
  3028. if (i == -2) {
  3029. //创建子部门user
  3030. that.depForm = {
  3031. id: null,
  3032. name: null,
  3033. parentId: null,
  3034. managerId: null,
  3035. };
  3036. if (that.depData.id != -1 && that.depData.id != 0) {
  3037. that.depForm.parentId = that.depData.id;
  3038. }
  3039. that.depTitle = this.$t('subdepartment');
  3040. } else if (i == -1) {
  3041. //创建一级部门
  3042. that.depForm = {
  3043. id: null,
  3044. name: null,
  3045. parentId: null,
  3046. managerId: null,
  3047. };
  3048. that.depTitle = this.$t('addsubdepartment');
  3049. } else {
  3050. console.log(that.depData, '看看值')
  3051. if (that.depData.managerId == "null") {
  3052. that.depData.managerId = "";
  3053. }
  3054. if (that.depData.reportAuditUserid == "null") {
  3055. that.depData.reportAuditUserid = "";
  3056. }
  3057. that.depForm = {
  3058. id: that.depData.id,
  3059. name: that.depData.label,
  3060. parentId: that.depData.parentId,
  3061. managerId: that.depData.managerId,
  3062. reportAuditUserid: that.depData.reportAuditUserid,
  3063. pushToSap:that.depData.pushToSap
  3064. }
  3065. if(that.depData.otherManagerIds) {
  3066. if(Array.isArray(that.depData.otherManagerIds)) {
  3067. this.$set(that.depForm, 'otherManagerIds', that.depData.otherManagerIds)
  3068. } else {
  3069. this.$set(that.depForm, 'otherManagerIds', that.depData.otherManagerIds.split(','))
  3070. }
  3071. } else {
  3072. this.$set(that.depForm, 'otherManagerIds', [])
  3073. }
  3074. // console.log('点击编辑的时候', that.depData)
  3075. // if(that.depData.reportAuditUserid != null && that.depData.reportAuditUserid != "null" && that.depData.reportAuditUserid.length > 0) {
  3076. // that.depForm.reportAuditUserid = that.depData.reportAuditUserid
  3077. // }
  3078. console.log(that.depForm, '<===== 最后的值')
  3079. that.depTitle = this.$t('editorialdepartment');
  3080. }
  3081. that.departmentVisible = true;
  3082. });
  3083. // if(i == -2) {//创建子部门
  3084. // this.depForm = {
  3085. // id: null,
  3086. // name: null,
  3087. // parentId: null,
  3088. // managerId: null,
  3089. // }
  3090. // if(this.depData.id != -1 && this.depData.id != 0) {
  3091. // this.depForm.parentId = this.depData.id;
  3092. // }
  3093. // this.depTitle = "新增子部门";
  3094. // } else if(i == -1) {//创建一级部门
  3095. // this.depForm = {
  3096. // id: null,
  3097. // name: null,
  3098. // parentId: null,
  3099. // managerId: null,
  3100. // }
  3101. // this.depTitle = "新增部门";
  3102. // } else {
  3103. // if(this.depData.managerId == "null") {
  3104. // this.depData.managerId = ''
  3105. // }
  3106. // if(this.depData.reportAuditUserid == "null") {
  3107. // this.depData.reportAuditUserid = ''
  3108. // }
  3109. // this.depForm = {
  3110. // id: this.depData.id,
  3111. // name: this.depData.label,
  3112. // parentId: this.depData.parentId,
  3113. // managerId: this.depData.managerId,
  3114. // reportAuditUserid: this.depData.reportAuditUserid
  3115. // }
  3116. // // if(this.depData.reportAuditUserid != null && this.depData.reportAuditUserid != "null" && this.depData.reportAuditUserid.length > 0) {
  3117. // // this.depForm.reportAuditUserid = this.depData.reportAuditUserid
  3118. // // }
  3119. // this.depTitle = "编辑部门";
  3120. // }
  3121. // this.departmentVisible = true;
  3122. },
  3123. submitDepartment() {
  3124. this.$refs.depForm.validate((valid) => {
  3125. if (valid) {
  3126. var form = {
  3127. name: this.depForm.name,
  3128. };
  3129. if (this.depForm.id != null) {
  3130. form.id = this.depForm.id;
  3131. }
  3132. if (this.depForm.parentId != null) {
  3133. form.parentId = this.depForm.parentId;
  3134. }
  3135. if (this.depForm.managerId) {
  3136. form.managerId = this.depForm.managerId;
  3137. }
  3138. if (this.depForm.pushToSap) {
  3139. form.pushToSap = this.depForm.pushToSap;
  3140. }
  3141. // console.log(this.depForm)
  3142. if (this.depForm.reportAuditUserid && this.user.timeType.needDeptAudit) {
  3143. form.reportAuditUserid = this.depForm.reportAuditUserid;
  3144. }
  3145. // 其他负责人
  3146. if(this.depForm.otherManagerIds) {
  3147. form.otherManagerIds = this.depForm.otherManagerIds.toString();
  3148. }
  3149. this.http.post(
  3150. this.depForm.id == null
  3151. ? this.port.manage.add
  3152. : this.port.manage.edit,
  3153. form,
  3154. (res) => {
  3155. if (res.code == "ok") {
  3156. this.$message({
  3157. message: this.depForm.id == null ? this.$t('newsuccess') : this.$t('message.modifyTheSuccess'),
  3158. type: "success",
  3159. });
  3160. this.departmentVisible = false;
  3161. if (this.depForm.id != null) {
  3162. this.depData.label = form.name;
  3163. this.depData.managerId = form.managerId;
  3164. this.depData.otherManagerIds = form.otherManagerIds;
  3165. }
  3166. this.getDepartment();
  3167. } else {
  3168. this.$message({
  3169. message: res.msg,
  3170. type: "error",
  3171. });
  3172. }
  3173. },
  3174. (error) => {
  3175. this.listLoading = false;
  3176. this.$message({
  3177. message: error,
  3178. type: "error",
  3179. });
  3180. }
  3181. );
  3182. }
  3183. });
  3184. },
  3185. // 删除部门
  3186. deleteDep() {
  3187. var that = this;
  3188. var txtMsg = this.user.userNameNeedTranslate == '1'?'确定要删除该部门吗?':this.$t('deletethedepartment') + that.depData.label + this.$t('ma')
  3189. setTimeout(() => {
  3190. that
  3191. .$confirm(txtMsg, this.$t('deletethedepartmentdsa'), {
  3192. confirmButtonText: this.$t('btn.determine'),
  3193. cancelButtonText: this.$t('btn.cancel'),
  3194. type: "warning",
  3195. })
  3196. .then(() => {
  3197. that.listLoading = true;
  3198. that.http.post(
  3199. that.port.manage.del,
  3200. { id: that.depData.id },
  3201. (res) => {
  3202. that.listLoading = false;
  3203. if (res.code == "ok") {
  3204. that.$message({
  3205. message: this.$t('message.successfullyDeleted'),
  3206. type: "success",
  3207. });
  3208. that.depData = {
  3209. id: -1,
  3210. label: this.$t('lable.allStaff'),
  3211. };
  3212. that.getDepartment();
  3213. this.page=1;
  3214. that.getUser();
  3215. } else {
  3216. that.$message({
  3217. message: res.msg,
  3218. type: "error",
  3219. });
  3220. }
  3221. },
  3222. (error) => {
  3223. that.listLoading = false;
  3224. that.$message({
  3225. message: error,
  3226. type: "error",
  3227. });
  3228. }
  3229. );
  3230. })
  3231. .catch(() => {});
  3232. }, 100);
  3233. // this.$confirm( "确定要删除部门" + this.depData.label + "吗?", "删除部门", {
  3234. // confirmButtonText: "确定",
  3235. // cancelButtonText: "取消",
  3236. // type: "warning"
  3237. // })
  3238. // .then(() => {
  3239. // this.listLoading = true;
  3240. // this.http.post( this.port.manage.del, { id: this.depData.id },
  3241. // res => {
  3242. // this.listLoading = false;
  3243. // if (res.code == "ok") {
  3244. // this.$message({
  3245. // message: "删除成功",
  3246. // type: "success"
  3247. // });
  3248. // this.depData = {
  3249. // id: -1,
  3250. // label: '全部人员',
  3251. // }
  3252. // this.getDepartment();
  3253. // this.getUser();
  3254. // } else {
  3255. // this.$message({
  3256. // message: res.msg,
  3257. // type: "error"
  3258. // });
  3259. // }
  3260. // },
  3261. // error => {
  3262. // this.listLoading = false;
  3263. // this.$message({
  3264. // message: error,
  3265. // type: "error"
  3266. // });
  3267. // });
  3268. // })
  3269. // .catch(() => {});
  3270. },
  3271. // 关键搜索
  3272. searchList() {
  3273. // console.log(this.keyword)
  3274. console.log(this.nextCursor, '游标')
  3275. this.listLoading = true;
  3276. this.http.post(
  3277. this.port.manage.list,
  3278. {
  3279. departmentId: this.depData.id,
  3280. pageIndex: this.page,
  3281. pageSize: this.size,
  3282. keyword: this.keyword,
  3283. status: this.keyword?'':this.status,//有姓名关键字时,按照全部状态搜索
  3284. roleId: this.roleId,
  3285. cursor: this.nextCursor,
  3286. onlyDirect: this.onlyDirect ? "1" : "0",
  3287. matchingType: this.integer
  3288. },
  3289. (res) => {
  3290. this.listLoading = false;
  3291. if (res.code == "ok") {
  3292. this.list = res.data.records;
  3293. this.total = res.data.total;
  3294. this.nextCursor = res.data.nextCursor
  3295. } else {
  3296. this.$message({
  3297. message: res.msg,
  3298. type: "error",
  3299. });
  3300. }
  3301. },
  3302. (error) => {
  3303. this.listLoading = false;
  3304. this.$message({
  3305. message: error,
  3306. type: "error",
  3307. });
  3308. }
  3309. );
  3310. },
  3311. // 获取角色
  3312. acquireRole() {
  3313. // this.http.post('/permission/getFrontRoleList', {
  3314. this.http.post(
  3315. "/permission/getFrontRoleList",
  3316. {
  3317. companyId: this.user.companyId,
  3318. },
  3319. (res) => {
  3320. if (res.code == "ok") {
  3321. // console.log(res.data, '获取角色')
  3322. this.acquireRoleList = res.data;
  3323. var arr = [];
  3324. for (var i in res.data) {
  3325. if (res.data[i].rolename != this.$t('role.systemAdministrator')) {
  3326. arr.push(res.data[i]);
  3327. }
  3328. }
  3329. this.acquireRoleLists = arr;
  3330. } else {
  3331. this.$message({
  3332. message: res.msg,
  3333. type: "error",
  3334. });
  3335. }
  3336. },
  3337. (error) => {
  3338. this.$message({
  3339. message: error,
  3340. type: "error",
  3341. });
  3342. }
  3343. );
  3344. },
  3345. // 获取专业分类
  3346. getProfessional() {
  3347. this.http.post(
  3348. "/company-cert/list",
  3349. {},
  3350. (res) => {
  3351. if (res.code == "ok") {
  3352. this.managementTableData = res.data;
  3353. } else {
  3354. this.$message({
  3355. message: res.msg,
  3356. type: "error",
  3357. });
  3358. }
  3359. },
  3360. (error) => {
  3361. this.$message({
  3362. message: error,
  3363. type: "error",
  3364. });
  3365. }
  3366. );
  3367. },
  3368. addManagementDiologs() {
  3369. this.managementForm = { name: "" };
  3370. this.addManagementDiolog = true;
  3371. },
  3372. // 新增/编辑人员专业费雷
  3373. addManagementForm(formName) {
  3374. this.$refs[formName].validate((valid) => {
  3375. if (valid) {
  3376. this.http.post(
  3377. "/company-cert/addOrMod",
  3378. this.managementForm,
  3379. (res) => {
  3380. if (res.code == "ok") {
  3381. this.$message({
  3382. message: this.$t('operationissuccessful'),
  3383. type: "success",
  3384. });
  3385. this.getProfessional();
  3386. this.addManagementDiolog = false;
  3387. } else {
  3388. this.$message({
  3389. message: res.msg,
  3390. type: "error",
  3391. });
  3392. }
  3393. },
  3394. (error) => {
  3395. this.$message({
  3396. message: error,
  3397. type: "error",
  3398. });
  3399. }
  3400. );
  3401. } else {
  3402. // console.log('error submit!!');
  3403. return false;
  3404. }
  3405. });
  3406. },
  3407. // 编辑
  3408. editorManagementForm(item) {
  3409. this.managementForm = item;
  3410. this.addManagementDiolog = true;
  3411. },
  3412. // 删除专业
  3413. deteManagementForm(item) {
  3414. this.$confirm(
  3415. this.$t('operationmaycausedatalossAreyousuredeletethedata'),
  3416. this.$t('deletionofprofessionalcertificate'),
  3417. {
  3418. confirmButtonText: this.$t('btn.determine'),
  3419. cancelButtonText: this.$t('btn.cancel'),
  3420. type: "warning",
  3421. }
  3422. )
  3423. .then(() => {
  3424. this.http.post(
  3425. "/company-cert/delete",
  3426. {
  3427. id: item.id,
  3428. },
  3429. (res) => {
  3430. if (res.code == "ok") {
  3431. this.$message({
  3432. message: this.$t('operationissuccessful'),
  3433. type: "success",
  3434. });
  3435. this.getProfessional();
  3436. } else {
  3437. this.$message({
  3438. message: res.msg,
  3439. type: "error",
  3440. });
  3441. }
  3442. },
  3443. (error) => {
  3444. this.$message({
  3445. message: error,
  3446. type: "error",
  3447. });
  3448. }
  3449. );
  3450. })
  3451. .catch(() => {
  3452. this.$message({
  3453. type: "info",
  3454. message: this.$t('thedeletionhasbeencancelled'),
  3455. });
  3456. });
  3457. },
  3458. // 点击添加更多帧数
  3459. addCertificateList() {
  3460. var obj = {};
  3461. obj.certId = "";
  3462. obj.certName = "";
  3463. obj.certDate = "";
  3464. obj.id = "";
  3465. obj.userId = this.addUserId;
  3466. this.insertForm.certJson.push(obj);
  3467. },
  3468. // 选择专业帧数
  3469. changeManagement(is) {
  3470. var id = this.insertForm.certJson[is].certId;
  3471. for (var i in this.managementTableData) {
  3472. if (this.managementTableData[i].id == id) {
  3473. this.insertForm.certJson[is].certName =
  3474. this.managementTableData[i].name;
  3475. }
  3476. }
  3477. },
  3478. // 查重复
  3479. upRepeat(arr) {
  3480. var obj = {};
  3481. for (var i in arr) {
  3482. if (obj[arr[i].certName]) {
  3483. return true;
  3484. }
  3485. obj[arr[i].certName] = true;
  3486. }
  3487. return false;
  3488. },
  3489. // 删除帧数
  3490. deteFrames(i) {
  3491. this.insertForm.certJson.splice(i, 1);
  3492. },
  3493. getStaffCountMax() {
  3494. this.http.post(
  3495. "/company/getStaffCountMax",
  3496. {companyId:this.user.companyId},
  3497. (res) => {
  3498. if (res.code == "ok") {
  3499. this.user.company.staffCountMax = res.data;
  3500. }
  3501. },
  3502. (error) => {
  3503. this.$message({
  3504. message: error,
  3505. type: "error",
  3506. });
  3507. }
  3508. );
  3509. },
  3510. // // 获取企业微信的参数
  3511. // agentConfig() {
  3512. // var curUrl = location.href.split("#")[0];
  3513. // this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
  3514. // if (res.code == "ok") {
  3515. // wx.config({
  3516. // beta: true,
  3517. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  3518. // appId: res.data.appid, // 必填,公众号的唯一标识
  3519. // timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  3520. // nonceStr: res.data.noncestr, // 必填,生成签名的随机串
  3521. // signature: res.data.sign, // 必填,签名,见附录1
  3522. // jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig']
  3523. // });
  3524. // var that = this;
  3525. // wx.ready(function(){
  3526. // // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
  3527. // that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
  3528. // if (res.code == "ok") {
  3529. // console.log()
  3530. // wx.agentConfig({
  3531. // corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
  3532. // agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
  3533. // timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  3534. // nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
  3535. // signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  3536. // jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
  3537. // success: function (result) {
  3538. // console.log(result, '请求微信成功')
  3539. // console.log(window, 'window')
  3540. // // wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
  3541. // window.WWOpenData.bind(document.querySelector('ww-open-data'))
  3542. // },
  3543. // fail: function (res) {
  3544. // console.log('查看错误信息', res)
  3545. // if (res.errMsg.indexOf('function not exist') > -1) {
  3546. // alert('版本过低请升级')
  3547. // }
  3548. // },
  3549. // })
  3550. // }
  3551. // }, (error) => {
  3552. // console.log('查看错误信息' + res)
  3553. // if (error.errMsg.indexOf('function not exist') > -1) {
  3554. // alert('版本过低请升级')
  3555. // }
  3556. // })
  3557. // });
  3558. // }
  3559. // }, (error) => {
  3560. // console.log(error, '哦耶')
  3561. // })
  3562. // },
  3563. // 自定义组件事件
  3564. vueCasader(obj) {
  3565. if(obj.distinction == '1') {
  3566. let arr = []
  3567. arr.push(obj.id)
  3568. this.handleSelectionZzjgwillchange = arr
  3569. } else if(obj.distinction == '2') {
  3570. let arr = []
  3571. arr.push(obj.id)
  3572. this.insertForm.departmentId = arr
  3573. }
  3574. } ,
  3575. // 自定义组件事件
  3576. selectCal(obj) {
  3577. if(obj.distinction == '4') {
  3578. this.depForm.otherManagerIds = obj.id
  3579. } else if(obj.distinction == '3') {
  3580. this.depForm.managerId = obj.id
  3581. } else if(obj.distinction == '5'){
  3582. this.depForm.reportAuditUserid = obj.id
  3583. } else if(obj.distinction == '12'){
  3584. this.toUserId = obj.id
  3585. } else if(obj.distinction == '22') {
  3586. console.log(obj, '返回')
  3587. this.moveReportUserId = obj.id
  3588. } else if(obj.distinction == '23') {
  3589. console.log(obj, '返回qwe')
  3590. this.transferActive.takeoverId = obj.id
  3591. } else if (obj.distinction == '6') {
  3592. this.insertForm.superiorId = obj.id;
  3593. }
  3594. },
  3595. // 企业微信可见范围设置
  3596. visibleRange() {
  3597. console.log('我点击可见范围设置')
  3598. wx.invoke('openAppManage', {}, function(res){
  3599. if(res.err_msg == "openAppManage:ok") {
  3600. // 调用成功
  3601. }
  3602. if(res.err_msg == "openAppManage:fail:no permission") {
  3603. // 调用人身份不符合
  3604. this.$message({message: '调用人身份不符合',type: "error"});
  3605. }
  3606. if(res.err_msg == "openAppManage:fail:unknown app") {
  3607. // 应用信息获取失败
  3608. this.$message({message: '应用信息获取失败',type: "error"});
  3609. }
  3610. if(res.err_msg == "openAppManage:fail:unsupported app type") {
  3611. // 应用类型不符合要求
  3612. this.$message({message: '应用类型不符合要求',type: "error"});
  3613. }
  3614. if(res.err_msg == "openAppManage:fail") {
  3615. // 其它错误
  3616. this.$message({message: '其它错误',type: "error"});
  3617. }
  3618. })
  3619. },
  3620. // 修正工时所属部门
  3621. workingHours() {
  3622. let obj = {
  3623. userIds: '',
  3624. startDate: '',
  3625. endDate: ''
  3626. }
  3627. if(this.workingHoursRadio == '2') {
  3628. obj.startDate = this.workingHoursDatas[0],
  3629. obj.endDate = this.workingHoursDatas[1]
  3630. }
  3631. let arr = []
  3632. for(var i in this.handleSelectionZzjgDate) {
  3633. arr.push(this.handleSelectionZzjgDate[i].id)
  3634. }
  3635. obj.userIds = arr.toString()
  3636. this.http.post('/report/correctWorkingTime', obj,
  3637. res => {
  3638. if (res.code == "ok") {
  3639. this.getUser();
  3640. this.workingHoursDialog = false
  3641. this.$message({message: '操作成功:'+res.data,type: "success"});
  3642. } else {
  3643. this.$message({message: res.msg,type: "error"});
  3644. }
  3645. },
  3646. error => {
  3647. this.$message({message: error,type: "error"});
  3648. });
  3649. },
  3650. // 拖拽时判定目标节点能否被放置
  3651. allowDrop(draggingNode, dropNode, type) {
  3652. // 判断他是否属于同一级
  3653. if(draggingNode.parent.id == dropNode.parent.id) {
  3654. // 禁止插入目标节点内
  3655. if(type != 'inner') {
  3656. return type
  3657. } else {
  3658. return false
  3659. }
  3660. } else {
  3661. return false
  3662. }
  3663. },
  3664. nodeDrop() {
  3665. console.log(this.data)
  3666. },
  3667. queding() {
  3668. console.log(JSON.stringify(this.data), '数据', this.data)
  3669. this.http.post('/department/sortList', {
  3670. list: JSON.stringify(this.data)
  3671. },
  3672. res => {
  3673. if (res.code == "ok") {
  3674. } else {
  3675. this.$message({message: res.msg,type: "error"});
  3676. }
  3677. },
  3678. error => {
  3679. this.$message({message: error,type: "error"});
  3680. });
  3681. }
  3682. },
  3683. mounted() {
  3684. this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
  3685. this.ymonth = util.formatDate.format(new Date(), "yyyy-MM");
  3686. this.getDepartment();
  3687. this.getUser();
  3688. this.getCompanyTimeSetting();
  3689. this.getUsers();
  3690. this.acquireRole();
  3691. this.getProfessional();
  3692. this.getStaffCountMax();
  3693. if(this.user.dingdingUserid != null || this.user.corpwxUserid != null){
  3694. this.getRecordMsg()
  3695. }
  3696. if(this.user.corpwxUserid != null && this.user.timeType.saasSyncContact == 1) {
  3697. this.getWxManager()
  3698. }
  3699. this.statesPush();
  3700. // 获取企业微信的参数
  3701. // if(this.user.companyId == '1081' || this.user.companyId == '7') {
  3702. // this.agentConfig()
  3703. // }
  3704. },
  3705. };
  3706. </script>
  3707. <style scoped>
  3708. .deteee{
  3709. font-size: 18px;
  3710. margin-bottom: 20px;
  3711. }
  3712. .deteeeAce {
  3713. display: flex;
  3714. align-items: center;
  3715. }
  3716. .treeIons {
  3717. float: right;
  3718. position: absolute;
  3719. right: 20px;
  3720. top: 0;
  3721. }
  3722. .classwxName{
  3723. display: flex;
  3724. flex-wrap: wrap;
  3725. }
  3726. .classwxNameIon {
  3727. width: 20px;
  3728. }
  3729. .classwxNameIon img {
  3730. width: 20px;
  3731. }
  3732. .workingHours {
  3733. padding: 0 60px;
  3734. }
  3735. .workingHoursData {
  3736. margin-top: 30px;
  3737. }
  3738. .workingHoursSpan {
  3739. display: inline-block;
  3740. margin-right: 20px;
  3741. }
  3742. .line {
  3743. width: 30px;
  3744. /* height: 500px; */
  3745. background: #f2f2f2;
  3746. cursor: w-resize;
  3747. }
  3748. .box-father {
  3749. border: 8px solid #000;
  3750. }
  3751. .line-second {
  3752. width: 10px;
  3753. /* background: red; */
  3754. }
  3755. .flex {
  3756. display: flex;
  3757. width: 100%;
  3758. }
  3759. .box-left {
  3760. flex: 0 0 400px;
  3761. /* height: 600px; */
  3762. /* background: blue; */
  3763. }
  3764. .box-right {
  3765. /* height: 600px; */
  3766. /* background: green; */
  3767. flex: 1;
  3768. }
  3769. .box-postion {
  3770. width: 200px;
  3771. /* height: 400px; */
  3772. background: #ccc;
  3773. }
  3774. </style>
  3775. <style lang="scss" scoped>
  3776. .imgFlex {
  3777. display: flex;
  3778. align-items: center;
  3779. }
  3780. .imgFlex p {
  3781. width: 100%;
  3782. text-align: center;
  3783. }
  3784. .imgFlex div {
  3785. padding: 10px;
  3786. display: flex;
  3787. align-content: space-between;
  3788. flex-wrap: wrap;
  3789. height: 600px;
  3790. }
  3791. .imgBor {
  3792. border-right: 1px solid #666;
  3793. border-left: 1px solid #666;
  3794. }
  3795. .custom-tree-node {
  3796. flex: 1;
  3797. display: flex;
  3798. align-items: center;
  3799. justify-content: space-between;
  3800. font-size: 14px;
  3801. padding-right: 8px;
  3802. }
  3803. .left {
  3804. border-right: 1px solid #f2f2f2;
  3805. overflow: hidden;
  3806. .department {
  3807. background:#f2f2f2;
  3808. line-height: 60px;
  3809. color:#666;
  3810. padding:0 10px;
  3811. height:60px;
  3812. font-size: 15px;
  3813. div {
  3814. float: right;
  3815. color: #20a0ff;
  3816. font-size: 14px;
  3817. cursor: pointer;
  3818. }
  3819. }
  3820. .tree {
  3821. overflow: auto;
  3822. }
  3823. }
  3824. .nowTime {
  3825. height: 40px;
  3826. line-height: 40px;
  3827. font-size: 16px;
  3828. color: #20a0ff;
  3829. margin-left: 10px;
  3830. cursor: pointer;
  3831. i {
  3832. margin-right: 10px;
  3833. }
  3834. }
  3835. .none {
  3836. display: none;
  3837. }
  3838. .block {
  3839. display: block;
  3840. }
  3841. </style>
  3842. <style lang="scss">
  3843. .tree {
  3844. .el-tree-node__label {
  3845. overflow-x: hidden;
  3846. white-space: nowrap;
  3847. text-overflow: ellipsis;
  3848. }
  3849. }
  3850. .el-divider--horizontal {
  3851. margin: 0px;
  3852. background:#f3f3f3;
  3853. }
  3854. //全局的作用范围
  3855. .el-tree-node__content {
  3856. height:36px;
  3857. }
  3858. .zhaunye {
  3859. display: flex;
  3860. justify-content: space-between;
  3861. padding: 0 5px 0 10px;
  3862. }
  3863. .certificateList {
  3864. width: 98%;
  3865. box-sizing: border-box;
  3866. margin: 0 10px 0 10px;
  3867. border: 1px solid rgb(194, 194, 194);
  3868. min-height: 200px;
  3869. max-height: 200px;
  3870. overflow: auto;
  3871. padding: 10px;
  3872. }
  3873. .moreAl {
  3874. display: flex;
  3875. width: 100%;
  3876. justify-content: center;
  3877. }
  3878. .moreLiList {
  3879. display: flex;
  3880. margin-bottom: 10px;
  3881. }
  3882. .moreLiList div {
  3883. line-height: 30px;
  3884. }
  3885. .moreLiList span {
  3886. display: inline-block;
  3887. margin-right: 15px;
  3888. }
  3889. .poAub {
  3890. position: absolute;
  3891. right: 10px;
  3892. }
  3893. </style>