index.vue 149 KB

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