index.vue 140 KB

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