index.vue 146 KB

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