index.vue 149 KB

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