index.vue 147 KB

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