index.vue 160 KB

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