index.vue 160 KB

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