index.vue 129 KB

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