index.vue 144 KB

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