index.vue 160 KB

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