index.vue 163 KB

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