index.vue 148 KB

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