index.vue 144 KB

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