index.vue 131 KB

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