index.vue 122 KB

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