index.vue 160 KB

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