index.vue 122 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323
  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. this.importDialog = false;
  1943. } else {
  1944. this.$message({
  1945. message: res.msg,
  1946. type: "error",
  1947. });
  1948. }
  1949. },
  1950. (error) => {
  1951. this.importingData = false;
  1952. this.$refs.upload.clearFiles();
  1953. this.listLoading = false;
  1954. this.$message({
  1955. message: error,
  1956. type: "error",
  1957. });
  1958. }
  1959. );
  1960. }
  1961. },
  1962. //分页
  1963. handleCurrentChange(val) {
  1964. this.page = val;
  1965. this.getUser(1);
  1966. },
  1967. handleSizeChange(val) {
  1968. this.size = val;
  1969. this.getUser(1);
  1970. },
  1971. //获取所有员工的列表
  1972. getUser(e) {
  1973. if (e != 1) {
  1974. this.page = 1;
  1975. }
  1976. // console.log(12345)
  1977. this.listLoading = true;
  1978. this.http.post(
  1979. this.port.manage.list,
  1980. {
  1981. departmentId: this.depData.id,
  1982. pageIndex: this.page,
  1983. pageSize: this.size,
  1984. keyword: this.keyword,
  1985. status: this.status,
  1986. // role: this.role
  1987. roleId: this.roleId,
  1988. onlyDirect: this.onlyDirect ? "1" : "0",
  1989. },
  1990. (res) => {
  1991. this.listLoading = false;
  1992. if (res.code == "ok") {
  1993. this.list = res.data.records;
  1994. this.total = res.data.total;
  1995. } else {
  1996. this.$message({
  1997. message: res.msg,
  1998. type: "error",
  1999. });
  2000. }
  2001. },
  2002. (error) => {
  2003. this.listLoading = false;
  2004. this.$message({
  2005. message: error,
  2006. type: "error",
  2007. });
  2008. }
  2009. );
  2010. },
  2011. resetPwd(user) {
  2012. this.$confirm(this.$t('wanttoor') + user.name + this.$t('resetyourpassword'), this.$t('saresetyourpassword'), {
  2013. confirmButtonText: this.$t('btn.determine'),
  2014. cancelButtonText: this.$t('btn.cancel'),
  2015. type: "warning",
  2016. })
  2017. .then(() => {
  2018. this.http.post(
  2019. "/user/resetPwd",
  2020. { userId: user.id },
  2021. (res) => {
  2022. if (res.code == "ok") {
  2023. this.$message({
  2024. message: this.$t('linglingling'),
  2025. type: "success",
  2026. });
  2027. } else {
  2028. this.$message({
  2029. message: res.msg,
  2030. type: "error",
  2031. });
  2032. }
  2033. },
  2034. (error) => {
  2035. this.listLoading = false;
  2036. this.$message({
  2037. message: error,
  2038. type: "error",
  2039. });
  2040. }
  2041. );
  2042. })
  2043. .catch(() => {});
  2044. },
  2045. // 新增、编辑人员
  2046. openInsertDialog(row) {
  2047. if (row != null) {
  2048. var list = JSON.parse(JSON.stringify(row)),
  2049. arr = [],
  2050. array = [];
  2051. if (list.departmentCascade != "0" && list.departmentCascade != null) {
  2052. if (list.departmentCascade.indexOf(",") > -1) {
  2053. arr = list.departmentCascade.split(",");
  2054. } else {
  2055. arr = [].concat(list.departmentCascade);
  2056. }
  2057. }
  2058. for (var i in arr) {
  2059. array.push(parseInt(arr[i]));
  2060. }
  2061. // console.log(list, '数据')
  2062. // this.insertForm = {
  2063. // id: list.id,
  2064. // name: list.name,
  2065. // phone: list.phone,
  2066. // // role: list.role,
  2067. // roleId: list.roleId,
  2068. // monthCost:list.monthCost,
  2069. // cost: list.cost,
  2070. // departmentId: array.reverse(),
  2071. // salaryType: list.salaryType,
  2072. // costApplyDate: list.costApplyDate,
  2073. // position: list.position
  2074. // };
  2075. this.addUserId = list.id;
  2076. this.http.post(
  2077. "/user/getUserInfo",
  2078. {
  2079. userId: list.id,
  2080. },
  2081. (res) => {
  2082. if (res.code == "ok") {
  2083. this.insertForm = {
  2084. id: res.data.id,
  2085. name: res.data.name,
  2086. phone: res.data.phone,
  2087. roleId: res.data.roleId,
  2088. monthCost: res.data.monthCost,
  2089. cost: res.data.cost,
  2090. departmentId: array.reverse(),
  2091. salaryType: res.data.salaryType,
  2092. costApplyDate: res.data.costApplyDate,
  2093. // inductionDate: res.data.inductionDate,
  2094. position: res.data.position,
  2095. certJson: res.data.certList,
  2096. plateMap: {},
  2097. superiorId: res.data.superiorId,
  2098. plate1: res.data.plate1,
  2099. plate2: res.data.plate2,
  2100. plate3: res.data.plate3,
  2101. plate4: res.data.plate4,
  2102. plate5: res.data.plate5,
  2103. jobNumber: res.data.jobNumber
  2104. };
  2105. this.$set(this.insertForm, 'inductionDate', res.data.inductionDate)
  2106. this.getUserCustomConfig(1);
  2107. } else {
  2108. this.$message({
  2109. message: res.msg,
  2110. type: "error",
  2111. });
  2112. }
  2113. },
  2114. (error) => {
  2115. this.listLoading = false;
  2116. this.$message({
  2117. message: error,
  2118. type: "error",
  2119. });
  2120. }
  2121. );
  2122. this.title = this.$t('editorialstaff');
  2123. } else {
  2124. this.addUserId = "";
  2125. this.insertForm = {
  2126. id: null,
  2127. name: null,
  2128. phone: null,
  2129. // role: null,
  2130. roleId: null,
  2131. monthCost: null,
  2132. cost: null,
  2133. departmentId: null,
  2134. salaryType: 0,
  2135. costApplyDate: util.formatDate.format(new Date(), "yyyy-MM-dd"),
  2136. inductionDate: util.formatDate.format(new Date(), "yyyy-MM-dd"),
  2137. position: "",
  2138. certJson: [],
  2139. plateMap: {},
  2140. plate1: null,
  2141. plate2: null,
  2142. plate3: null,
  2143. plate4: null,
  2144. plate5: null,
  2145. jobNumber:null,
  2146. };
  2147. this.title = this.$t('addorialstaff');
  2148. this.getUserCustomConfig();
  2149. // this.insertForm.plateMap['定义测试文本'] = '测试文本'
  2150. // console.log('insertForm',this.insertForm);
  2151. }
  2152. this.dialogVisible = true;
  2153. console.log(this.insertForm);
  2154. },
  2155. submitInsert() {
  2156. var form = {};
  2157. var ssR = this.upRepeat(this.insertForm.certJson);
  2158. var trs = true;
  2159. this.$refs.form12.validate((valid) => {
  2160. if (valid) {
  2161. this.submitLoading = true;
  2162. if (ssR) {
  2163. this.$message({
  2164. message: this.$t('repeat'),
  2165. type: "error",
  2166. });
  2167. this.submitLoading = false;
  2168. return false;
  2169. }
  2170. for (var s in this.insertForm.certJson) {
  2171. if (
  2172. !this.insertForm.certJson[s].certDate ||
  2173. !this.insertForm.certJson[s].certId
  2174. ) {
  2175. trs = false;
  2176. }
  2177. }
  2178. if (!trs) {
  2179. this.$message({
  2180. message: this.$t('certificateisincomplete'),
  2181. type: "error",
  2182. });
  2183. this.submitLoading = false;
  2184. return false;
  2185. }
  2186. form = {
  2187. name: this.insertForm.name,
  2188. phone: this.insertForm.phone,
  2189. // role: this.insertForm.role,
  2190. roleId: this.insertForm.roleId,
  2191. monthCost: this.insertForm.monthCost,
  2192. cost: this.insertForm.cost,
  2193. salaryType: this.insertForm.salaryType,
  2194. position: this.insertForm.position,
  2195. certJson: JSON.stringify(this.insertForm.certJson),
  2196. // certJson: this.insertForm.certJson
  2197. inductionDate: this.insertForm.inductionDate,
  2198. plate1: this.insertForm.plate1,
  2199. plate2: this.insertForm.plate2,
  2200. plate3: this.insertForm.plate3,
  2201. plate4: this.insertForm.plate4,
  2202. plate5: this.insertForm.plate5,
  2203. jobNumber: this.insertForm.jobNumber,
  2204. };
  2205. // for(let i=0;i<5;i++) {
  2206. // if(this.insertFormPlates[i]){
  2207. // form[this.suoying[i]] = this.insertFormPlates[i]
  2208. // }
  2209. // }
  2210. // console.log(form, 'form')
  2211. if (this.insertForm.id != null) {
  2212. form.id = this.insertForm.id;
  2213. }
  2214. if (this.insertForm.superiorId) {
  2215. form.superiorId = this.insertForm.superiorId;
  2216. }
  2217. if (this.insertForm.costApplyDate != null) {
  2218. form.costApplyDate = this.insertForm.costApplyDate;
  2219. }
  2220. if (this.insertForm.departmentId != null) {
  2221. form.departmentId =
  2222. this.insertForm.departmentId[
  2223. this.insertForm.departmentId.length - 1
  2224. ];
  2225. }
  2226. if (!ssR && trs) {
  2227. this.http.post(
  2228. this.port.manage.insert,
  2229. form,
  2230. (res) => {
  2231. this.submitLoading = false;
  2232. if (res.code == "ok") {
  2233. this.$message({
  2234. message:
  2235. this.insertForm.id != null ? this.$t('xiu-gai') : this.$t('create') + this.$t('other.successful'),
  2236. type: "success",
  2237. });
  2238. this.dialogVisible = false;
  2239. this.getUser();
  2240. this.getUsers();
  2241. } else {
  2242. this.$message({
  2243. message: res.msg,
  2244. type: "error",
  2245. });
  2246. }
  2247. },
  2248. (error) => {
  2249. this.listLoading = false;
  2250. this.$message({
  2251. message: error,
  2252. type: "error",
  2253. });
  2254. }
  2255. );
  2256. }
  2257. }
  2258. });
  2259. // console.log(form, '提交的数据')
  2260. // return
  2261. // console.log(ssR, trs)
  2262. },
  2263. // 切换角色
  2264. switchRole(index) {
  2265. this.listLoading = true;
  2266. this.http.post(
  2267. this.port.manage.permission,
  2268. { id: this.list[index].id },
  2269. (res) => {
  2270. this.listLoading = false;
  2271. if (res.code == "ok") {
  2272. this.$message({
  2273. message: this.$t('switchingroles'),
  2274. type: "success",
  2275. });
  2276. //重新读取列表
  2277. this.getUser();
  2278. } else {
  2279. this.$message({
  2280. message: res.msg,
  2281. type: "error",
  2282. });
  2283. }
  2284. },
  2285. (error) => {
  2286. this.listLoading = false;
  2287. this.$message({
  2288. message: error,
  2289. type: "error",
  2290. });
  2291. }
  2292. );
  2293. },
  2294. // 删除用户
  2295. setActive(item, isActive) {
  2296. var txt = isActive == 1 ? this.$t('enable') : this.$t('ting-yong');
  2297. this.$confirm(this.$t('sureyouwantto') + txt + " " + item.name + this.$t('ma'), this.$t('zhang-hao') + txt, {
  2298. confirmButtonText: this.$t('btn.determine'),
  2299. cancelButtonText: this.$t('btn.cancel'),
  2300. type: "warning",
  2301. })
  2302. .then(() => {
  2303. this.listLoading = true;
  2304. this.http.post(
  2305. "/user/setActive",
  2306. { id: item.id, isActive: isActive },
  2307. (res) => {
  2308. this.listLoading = false;
  2309. if (res.code == "ok") {
  2310. this.$message({
  2311. message: txt + this.$t('other.successful'),
  2312. type: "success",
  2313. });
  2314. //重新读取列表
  2315. this.getUser();
  2316. } else {
  2317. this.$message({
  2318. message: res.msg,
  2319. type: "error",
  2320. });
  2321. }
  2322. },
  2323. (error) => {
  2324. this.listLoading = false;
  2325. this.$message({
  2326. message: error,
  2327. type: "error",
  2328. });
  2329. }
  2330. );
  2331. })
  2332. .catch(() => {});
  2333. },
  2334. // 修改老板的成本
  2335. openInsertDialog1(row) {
  2336. var list1 = JSON.parse(JSON.stringify(row)),
  2337. arr1 = [],
  2338. array1 = [];
  2339. if (list1.departmentCascade != "0" && list1.departmentCascade != null) {
  2340. if (list1.departmentCascade.indexOf(",") > -1) {
  2341. arr1 = list1.departmentCascade.split(",");
  2342. } else {
  2343. arr1 = [].concat(list1.departmentCascade);
  2344. }
  2345. }
  2346. for (var i in arr1) {
  2347. array1.push(parseInt(arr1[i]));
  2348. }
  2349. this.http.post(
  2350. "/user/getUserInfo",
  2351. {
  2352. userId: list1.id,
  2353. },
  2354. (res) => {
  2355. if (res.code == "ok") {
  2356. this.insertForm = {
  2357. id: res.data.id,
  2358. name: res.data.name,
  2359. phone: res.data.phone,
  2360. roleId: res.data.roleId,
  2361. monthCost: res.data.monthCost,
  2362. cost: res.data.cost,
  2363. departmentId: array1.reverse(),
  2364. salaryType: res.data.salaryType,
  2365. costApplyDate: res.data.costApplyDate,
  2366. inductionDate: res.data.inductionDate,
  2367. position: res.data.position,
  2368. certJson: res.data.certList,
  2369. plateMap: {},
  2370. superiorId: res.data.superiorId,
  2371. jobNumber: res.data.jobNumber,
  2372. };
  2373. } else {
  2374. this.$message({
  2375. message: res.msg,
  2376. type: "error",
  2377. });
  2378. }
  2379. },
  2380. (error) => {
  2381. this.listLoading = false;
  2382. this.$message({
  2383. message: error,
  2384. type: "error",
  2385. });
  2386. }
  2387. );
  2388. // console.log(list1)
  2389. // this.insertForm = {
  2390. // id: list1.id,
  2391. // name: list1.name,
  2392. // phone: list1.phone,
  2393. // roleId: list1.roleId,
  2394. // monthCost:list1.monthCost,
  2395. // cost: list1.cost,
  2396. // departmentId: array1.reverse(),
  2397. // salaryType: list1.salaryType,
  2398. // name: list1.name,
  2399. // position: list1.position,
  2400. // certJson: list1.certJson
  2401. // };
  2402. this.dialogVisible1 = true;
  2403. },
  2404. submitInsert1() {
  2405. var form = {};
  2406. this.$refs.form1.validate((valid) => {
  2407. if (valid) {
  2408. this.submitLoading = true;
  2409. form = {
  2410. id: this.insertForm.id,
  2411. name: this.insertForm.name,
  2412. phone: this.insertForm.phone,
  2413. roleId: this.insertForm.roleId,
  2414. monthCost: this.insertForm.monthCost,
  2415. cost: this.insertForm.cost,
  2416. position: this.insertForm.position,
  2417. certJson: this.insertForm.certJson,
  2418. inductionDate: this.insertForm.inductionDate,
  2419. jobNumber: this.insertForm.jobNumber,
  2420. };
  2421. if (this.insertForm.departmentId != null) {
  2422. form.departmentId =
  2423. this.insertForm.departmentId[
  2424. this.insertForm.departmentId.length - 1
  2425. ];
  2426. }
  2427. if (this.insertForm.costApplyDate != null) {
  2428. form.costApplyDate = this.insertForm.costApplyDate;
  2429. }
  2430. if (this.insertForm.superiorId) {
  2431. form.superiorId = this.insertForm.superiorId;
  2432. }
  2433. this.http.post(
  2434. this.port.manage.insert,
  2435. form,
  2436. (res) => {
  2437. this.submitLoading = false;
  2438. if (res.code == "ok") {
  2439. this.$message({
  2440. message: this.$t('message.modifyTheSuccess'),
  2441. type: "success",
  2442. });
  2443. this.dialogVisible1 = false;
  2444. //重新读取列表
  2445. this.getUser();
  2446. this.getUsers();
  2447. } else {
  2448. this.$message({
  2449. message: res.msg,
  2450. type: "error",
  2451. });
  2452. }
  2453. },
  2454. (error) => {
  2455. this.listLoading = false;
  2456. this.$message({
  2457. message: error,
  2458. type: "error",
  2459. });
  2460. }
  2461. );
  2462. }
  2463. });
  2464. },
  2465. // 获取部门列表
  2466. getDepartment() {
  2467. this.http.post(
  2468. this.port.manage.depList,
  2469. {},
  2470. (res) => {
  2471. if (res.code == "ok") {
  2472. var list = res.data,
  2473. list1 = JSON.parse(JSON.stringify(res.data));
  2474. list.splice(0, 0, {
  2475. id: -1,
  2476. label: this.$t('lable.allStaff'),
  2477. });
  2478. list.push({
  2479. id: 0,
  2480. label: this.$t('lable.unassigned'),
  2481. });
  2482. this.data = list;
  2483. console.log(list, "部门数据")
  2484. this.option = this.changeArr(list1);
  2485. } else {
  2486. this.$message({
  2487. message: res.msg,
  2488. type: "error",
  2489. });
  2490. }
  2491. },
  2492. (error) => {
  2493. this.$message({
  2494. message: error,
  2495. type: "error",
  2496. });
  2497. }
  2498. );
  2499. },
  2500. // 修改数组
  2501. changeArr(arr) {
  2502. for (var i = 0; i < arr.length; i++) {
  2503. if (arr[i].id != -1 && arr[i].id != 0) {
  2504. if (arr[i].children != null && arr[i].children.length > 0) {
  2505. arr[i].children = this.changeArr(arr[i].children);
  2506. }
  2507. arr[i].id && (arr[i].value = arr[i].id);
  2508. delete arr[i].id;
  2509. }
  2510. }
  2511. for (var i in arr) {
  2512. if (arr[i].id == -1 || arr[i].id == 0) {
  2513. arr.splice(i, 1);
  2514. }
  2515. }
  2516. return arr;
  2517. },
  2518. // 部门列表点击
  2519. handleNodeClick(data) {
  2520. this.theValues(data)
  2521. console.log(data)
  2522. if (this.depData == null || data.id != this.depData.id) {
  2523. this.depData = data;
  2524. this.page = 1;
  2525. this.getUser();
  2526. }
  2527. },
  2528. theValues(obj) {
  2529. if(obj.id != '-1') {
  2530. this.translation = '2'
  2531. } else {
  2532. this.translation = '1'
  2533. }
  2534. },
  2535. // 新增、修改部门
  2536. createDepartment(i) {
  2537. console.log(i, '看看')
  2538. setTimeout(() => {
  2539. var that = this;
  2540. if (i == -2) {
  2541. //创建子部门
  2542. that.depForm = {
  2543. id: null,
  2544. name: null,
  2545. parentId: null,
  2546. managerId: null,
  2547. };
  2548. if (that.depData.id != -1 && that.depData.id != 0) {
  2549. that.depForm.parentId = that.depData.id;
  2550. }
  2551. that.depTitle = this.$t('subdepartment');
  2552. } else if (i == -1) {
  2553. //创建一级部门
  2554. that.depForm = {
  2555. id: null,
  2556. name: null,
  2557. parentId: null,
  2558. managerId: null,
  2559. };
  2560. that.depTitle = this.$t('addsubdepartment');
  2561. } else {
  2562. console.log(that.depData, '看看值')
  2563. if (that.depData.managerId == "null") {
  2564. that.depData.managerId = "";
  2565. }
  2566. if (that.depData.reportAuditUserid == "null") {
  2567. that.depData.reportAuditUserid = "";
  2568. }
  2569. that.depForm = {
  2570. id: that.depData.id,
  2571. name: that.depData.label,
  2572. parentId: that.depData.parentId,
  2573. managerId: that.depData.managerId,
  2574. reportAuditUserid: that.depData.reportAuditUserid,
  2575. }
  2576. if(that.depData.otherManagerIds) {
  2577. if(Array.isArray(that.depData.otherManagerIds)) {
  2578. this.$set(that.depForm, 'otherManagerIds', that.depData.otherManagerIds)
  2579. } else {
  2580. this.$set(that.depForm, 'otherManagerIds', that.depData.otherManagerIds.split(','))
  2581. }
  2582. } else {
  2583. this.$set(that.depForm, 'otherManagerIds', [])
  2584. }
  2585. // console.log('点击编辑的时候', that.depData)
  2586. // if(that.depData.reportAuditUserid != null && that.depData.reportAuditUserid != "null" && that.depData.reportAuditUserid.length > 0) {
  2587. // that.depForm.reportAuditUserid = that.depData.reportAuditUserid
  2588. // }
  2589. that.depTitle = this.$t('editorialdepartment');
  2590. }
  2591. that.departmentVisible = true;
  2592. });
  2593. // if(i == -2) {//创建子部门
  2594. // this.depForm = {
  2595. // id: null,
  2596. // name: null,
  2597. // parentId: null,
  2598. // managerId: null,
  2599. // }
  2600. // if(this.depData.id != -1 && this.depData.id != 0) {
  2601. // this.depForm.parentId = this.depData.id;
  2602. // }
  2603. // this.depTitle = "新增子部门";
  2604. // } else if(i == -1) {//创建一级部门
  2605. // this.depForm = {
  2606. // id: null,
  2607. // name: null,
  2608. // parentId: null,
  2609. // managerId: null,
  2610. // }
  2611. // this.depTitle = "新增部门";
  2612. // } else {
  2613. // if(this.depData.managerId == "null") {
  2614. // this.depData.managerId = ''
  2615. // }
  2616. // if(this.depData.reportAuditUserid == "null") {
  2617. // this.depData.reportAuditUserid = ''
  2618. // }
  2619. // this.depForm = {
  2620. // id: this.depData.id,
  2621. // name: this.depData.label,
  2622. // parentId: this.depData.parentId,
  2623. // managerId: this.depData.managerId,
  2624. // reportAuditUserid: this.depData.reportAuditUserid
  2625. // }
  2626. // // if(this.depData.reportAuditUserid != null && this.depData.reportAuditUserid != "null" && this.depData.reportAuditUserid.length > 0) {
  2627. // // this.depForm.reportAuditUserid = this.depData.reportAuditUserid
  2628. // // }
  2629. // this.depTitle = "编辑部门";
  2630. // }
  2631. // this.departmentVisible = true;
  2632. },
  2633. submitDepartment() {
  2634. this.$refs.depForm.validate((valid) => {
  2635. if (valid) {
  2636. var form = {
  2637. name: this.depForm.name,
  2638. };
  2639. if (this.depForm.id != null) {
  2640. form.id = this.depForm.id;
  2641. }
  2642. if (this.depForm.parentId != null) {
  2643. form.parentId = this.depForm.parentId;
  2644. }
  2645. if (this.depForm.managerId) {
  2646. form.managerId = this.depForm.managerId;
  2647. }
  2648. // console.log(this.depForm)
  2649. if (this.depForm.reportAuditUserid && this.user.timeType.needDeptAudit) {
  2650. form.reportAuditUserid = this.depForm.reportAuditUserid;
  2651. }
  2652. // 其他负责人
  2653. if(this.depForm.otherManagerIds) {
  2654. form.otherManagerIds = this.depForm.otherManagerIds.toString();
  2655. }
  2656. this.http.post(
  2657. this.depForm.id == null
  2658. ? this.port.manage.add
  2659. : this.port.manage.edit,
  2660. form,
  2661. (res) => {
  2662. if (res.code == "ok") {
  2663. this.$message({
  2664. message: this.depForm.id == null ? this.$t('newsuccess') : this.$t('message.modifyTheSuccess'),
  2665. type: "success",
  2666. });
  2667. this.departmentVisible = false;
  2668. if (this.depForm.id != null) {
  2669. this.depData.label = form.name;
  2670. this.depData.managerId = form.managerId;
  2671. this.depData.otherManagerIds = form.otherManagerIds;
  2672. }
  2673. this.getDepartment();
  2674. } else {
  2675. this.$message({
  2676. message: res.msg,
  2677. type: "error",
  2678. });
  2679. }
  2680. },
  2681. (error) => {
  2682. this.listLoading = false;
  2683. this.$message({
  2684. message: error,
  2685. type: "error",
  2686. });
  2687. }
  2688. );
  2689. }
  2690. });
  2691. },
  2692. // 删除部门
  2693. deleteDep() {
  2694. var that = this;
  2695. setTimeout(() => {
  2696. that
  2697. .$confirm(this.$t('deletethedepartment') + that.depData.label + this.$t('ma'), this.$t('deletethedepartmentdsa'), {
  2698. confirmButtonText: this.$t('btn.determine'),
  2699. cancelButtonText: this.$t('btn.cancel'),
  2700. type: "warning",
  2701. })
  2702. .then(() => {
  2703. that.listLoading = true;
  2704. that.http.post(
  2705. that.port.manage.del,
  2706. { id: that.depData.id },
  2707. (res) => {
  2708. that.listLoading = false;
  2709. if (res.code == "ok") {
  2710. that.$message({
  2711. message: this.$t('message.successfullyDeleted'),
  2712. type: "success",
  2713. });
  2714. that.depData = {
  2715. id: -1,
  2716. label: this.$t('lable.allStaff'),
  2717. };
  2718. that.getDepartment();
  2719. that.getUser();
  2720. } else {
  2721. that.$message({
  2722. message: res.msg,
  2723. type: "error",
  2724. });
  2725. }
  2726. },
  2727. (error) => {
  2728. that.listLoading = false;
  2729. that.$message({
  2730. message: error,
  2731. type: "error",
  2732. });
  2733. }
  2734. );
  2735. })
  2736. .catch(() => {});
  2737. }, 100);
  2738. // this.$confirm( "确定要删除部门" + this.depData.label + "吗?", "删除部门", {
  2739. // confirmButtonText: "确定",
  2740. // cancelButtonText: "取消",
  2741. // type: "warning"
  2742. // })
  2743. // .then(() => {
  2744. // this.listLoading = true;
  2745. // this.http.post( this.port.manage.del, { id: this.depData.id },
  2746. // res => {
  2747. // this.listLoading = false;
  2748. // if (res.code == "ok") {
  2749. // this.$message({
  2750. // message: "删除成功",
  2751. // type: "success"
  2752. // });
  2753. // this.depData = {
  2754. // id: -1,
  2755. // label: '全部人员',
  2756. // }
  2757. // this.getDepartment();
  2758. // this.getUser();
  2759. // } else {
  2760. // this.$message({
  2761. // message: res.msg,
  2762. // type: "error"
  2763. // });
  2764. // }
  2765. // },
  2766. // error => {
  2767. // this.listLoading = false;
  2768. // this.$message({
  2769. // message: error,
  2770. // type: "error"
  2771. // });
  2772. // });
  2773. // })
  2774. // .catch(() => {});
  2775. },
  2776. // 关键搜索
  2777. searchList() {
  2778. // console.log(this.keyword)
  2779. this.listLoading = true;
  2780. this.http.post(
  2781. this.port.manage.list,
  2782. {
  2783. departmentId: this.depData.id,
  2784. pageIndex: this.page,
  2785. pageSize: this.size,
  2786. keyword: this.keyword,
  2787. status: this.status
  2788. },
  2789. (res) => {
  2790. this.listLoading = false;
  2791. if (res.code == "ok") {
  2792. this.list = res.data.records;
  2793. this.total = res.data.total;
  2794. } else {
  2795. this.$message({
  2796. message: res.msg,
  2797. type: "error",
  2798. });
  2799. }
  2800. },
  2801. (error) => {
  2802. this.listLoading = false;
  2803. this.$message({
  2804. message: error,
  2805. type: "error",
  2806. });
  2807. }
  2808. );
  2809. },
  2810. // 获取角色
  2811. acquireRole() {
  2812. // this.http.post('/permission/getFrontRoleList', {
  2813. this.http.post(
  2814. "/permission/getFrontRoleList",
  2815. {
  2816. companyId: this.user.companyId,
  2817. },
  2818. (res) => {
  2819. if (res.code == "ok") {
  2820. // console.log(res.data, '获取角色')
  2821. this.acquireRoleList = res.data;
  2822. var arr = [];
  2823. for (var i in res.data) {
  2824. if (res.data[i].rolename != this.$t('role.systemAdministrator')) {
  2825. arr.push(res.data[i]);
  2826. }
  2827. }
  2828. this.acquireRoleLists = arr;
  2829. } else {
  2830. this.$message({
  2831. message: res.msg,
  2832. type: "error",
  2833. });
  2834. }
  2835. },
  2836. (error) => {
  2837. this.$message({
  2838. message: error,
  2839. type: "error",
  2840. });
  2841. }
  2842. );
  2843. },
  2844. // 获取专业分类
  2845. getProfessional() {
  2846. this.http.post(
  2847. "/company-cert/list",
  2848. {},
  2849. (res) => {
  2850. if (res.code == "ok") {
  2851. this.managementTableData = res.data;
  2852. } else {
  2853. this.$message({
  2854. message: res.msg,
  2855. type: "error",
  2856. });
  2857. }
  2858. },
  2859. (error) => {
  2860. this.$message({
  2861. message: error,
  2862. type: "error",
  2863. });
  2864. }
  2865. );
  2866. },
  2867. addManagementDiologs() {
  2868. this.managementForm = { name: "" };
  2869. this.addManagementDiolog = true;
  2870. },
  2871. // 新增/编辑人员专业费雷
  2872. addManagementForm(formName) {
  2873. this.$refs[formName].validate((valid) => {
  2874. if (valid) {
  2875. this.http.post(
  2876. "/company-cert/addOrMod",
  2877. this.managementForm,
  2878. (res) => {
  2879. if (res.code == "ok") {
  2880. this.$message({
  2881. message: this.$t('operationissuccessful'),
  2882. type: "success",
  2883. });
  2884. this.getProfessional();
  2885. this.addManagementDiolog = false;
  2886. } else {
  2887. this.$message({
  2888. message: res.msg,
  2889. type: "error",
  2890. });
  2891. }
  2892. },
  2893. (error) => {
  2894. this.$message({
  2895. message: error,
  2896. type: "error",
  2897. });
  2898. }
  2899. );
  2900. } else {
  2901. // console.log('error submit!!');
  2902. return false;
  2903. }
  2904. });
  2905. },
  2906. // 编辑
  2907. editorManagementForm(item) {
  2908. this.managementForm = item;
  2909. this.addManagementDiolog = true;
  2910. },
  2911. // 删除专业
  2912. deteManagementForm(item) {
  2913. this.$confirm(
  2914. this.$t('operationmaycausedatalossAreyousuredeletethedata'),
  2915. this.$t('deletionofprofessionalcertificate'),
  2916. {
  2917. confirmButtonText: this.$t('btn.determine'),
  2918. cancelButtonText: this.$t('btn.cancel'),
  2919. type: "warning",
  2920. }
  2921. )
  2922. .then(() => {
  2923. this.http.post(
  2924. "/company-cert/delete",
  2925. {
  2926. id: item.id,
  2927. },
  2928. (res) => {
  2929. if (res.code == "ok") {
  2930. this.$message({
  2931. message: this.$t('operationissuccessful'),
  2932. type: "success",
  2933. });
  2934. this.getProfessional();
  2935. } else {
  2936. this.$message({
  2937. message: res.msg,
  2938. type: "error",
  2939. });
  2940. }
  2941. },
  2942. (error) => {
  2943. this.$message({
  2944. message: error,
  2945. type: "error",
  2946. });
  2947. }
  2948. );
  2949. })
  2950. .catch(() => {
  2951. this.$message({
  2952. type: "info",
  2953. message: this.$t('thedeletionhasbeencancelled'),
  2954. });
  2955. });
  2956. },
  2957. // 点击添加更多帧数
  2958. addCertificateList() {
  2959. var obj = {};
  2960. obj.certId = "";
  2961. obj.certName = "";
  2962. obj.certDate = "";
  2963. obj.id = "";
  2964. obj.userId = this.addUserId;
  2965. this.insertForm.certJson.push(obj);
  2966. },
  2967. // 选择专业帧数
  2968. changeManagement(is) {
  2969. var id = this.insertForm.certJson[is].certId;
  2970. for (var i in this.managementTableData) {
  2971. if (this.managementTableData[i].id == id) {
  2972. this.insertForm.certJson[is].certName =
  2973. this.managementTableData[i].name;
  2974. }
  2975. }
  2976. },
  2977. // 查重复
  2978. upRepeat(arr) {
  2979. var obj = {};
  2980. for (var i in arr) {
  2981. if (obj[arr[i].certName]) {
  2982. return true;
  2983. }
  2984. obj[arr[i].certName] = true;
  2985. }
  2986. return false;
  2987. },
  2988. // 删除帧数
  2989. deteFrames(i) {
  2990. this.insertForm.certJson.splice(i, 1);
  2991. },
  2992. getStaffCountMax() {
  2993. this.http.post(
  2994. "/company/getStaffCountMax",
  2995. {companyId:this.user.companyId},
  2996. (res) => {
  2997. if (res.code == "ok") {
  2998. this.user.company.staffCountMax = res.data;
  2999. }
  3000. },
  3001. (error) => {
  3002. this.$message({
  3003. message: error,
  3004. type: "error",
  3005. });
  3006. }
  3007. );
  3008. },
  3009. // // 获取企业微信的参数
  3010. // agentConfig() {
  3011. // var curUrl = location.href.split("#")[0];
  3012. // this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
  3013. // if (res.code == "ok") {
  3014. // wx.config({
  3015. // beta: true,
  3016. // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  3017. // appId: res.data.appid, // 必填,公众号的唯一标识
  3018. // timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  3019. // nonceStr: res.data.noncestr, // 必填,生成签名的随机串
  3020. // signature: res.data.sign, // 必填,签名,见附录1
  3021. // jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig']
  3022. // });
  3023. // var that = this;
  3024. // wx.ready(function(){
  3025. // // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
  3026. // that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
  3027. // if (res.code == "ok") {
  3028. // console.log()
  3029. // wx.agentConfig({
  3030. // corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
  3031. // agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
  3032. // timestamp: res.data.timestamp, // 必填,生成签名的时间戳
  3033. // nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
  3034. // signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  3035. // jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
  3036. // success: function (result) {
  3037. // console.log(result, '请求微信成功')
  3038. // console.log(window, 'window')
  3039. // // wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
  3040. // window.WWOpenData.bind(document.querySelector('ww-open-data'))
  3041. // },
  3042. // fail: function (res) {
  3043. // console.log('查看错误信息', res)
  3044. // if (res.errMsg.indexOf('function not exist') > -1) {
  3045. // alert('版本过低请升级')
  3046. // }
  3047. // },
  3048. // })
  3049. // }
  3050. // }, (error) => {
  3051. // console.log('查看错误信息' + res)
  3052. // if (error.errMsg.indexOf('function not exist') > -1) {
  3053. // alert('版本过低请升级')
  3054. // }
  3055. // })
  3056. // });
  3057. // }
  3058. // }, (error) => {
  3059. // console.log(error, '哦耶')
  3060. // })
  3061. // },
  3062. // 自定义组件事件
  3063. vueCasader(obj) {
  3064. if(obj.distinction == '1') {
  3065. let arr = []
  3066. arr.push(obj.id)
  3067. this.handleSelectionZzjgwillchange = arr
  3068. } else if(obj.distinction == '2') {
  3069. let arr = []
  3070. arr.push(obj.id)
  3071. this.insertForm.departmentId = arr
  3072. }
  3073. }
  3074. },
  3075. mounted() {
  3076. this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
  3077. this.getDepartment();
  3078. this.getUser();
  3079. this.getCompanyTimeSetting();
  3080. this.getUsers();
  3081. this.acquireRole();
  3082. this.getProfessional();
  3083. this.getStaffCountMax();
  3084. // 获取企业微信的参数
  3085. // if(this.user.companyId == '1081' || this.user.companyId == '7') {
  3086. // this.agentConfig()
  3087. // }
  3088. },
  3089. };
  3090. </script>
  3091. <style scoped>
  3092. .line {
  3093. width: 30px;
  3094. /* height: 500px; */
  3095. background: #f2f2f2;
  3096. cursor: w-resize;
  3097. }
  3098. .box-father {
  3099. border: 8px solid #000;
  3100. }
  3101. .line-second {
  3102. width: 10px;
  3103. /* background: red; */
  3104. }
  3105. .flex {
  3106. display: flex;
  3107. width: 100%;
  3108. }
  3109. .box-left {
  3110. flex: 0 0 400px;
  3111. /* height: 600px; */
  3112. /* background: blue; */
  3113. }
  3114. .box-right {
  3115. /* height: 600px; */
  3116. /* background: green; */
  3117. flex: 1;
  3118. }
  3119. .box-postion {
  3120. width: 200px;
  3121. /* height: 400px; */
  3122. background: #ccc;
  3123. }
  3124. </style>
  3125. <style lang="scss" scoped>
  3126. .imgFlex {
  3127. display: flex;
  3128. align-items: center;
  3129. }
  3130. .imgFlex p {
  3131. width: 100%;
  3132. text-align: center;
  3133. }
  3134. .imgFlex div {
  3135. padding: 10px;
  3136. display: flex;
  3137. align-content: space-between;
  3138. flex-wrap: wrap;
  3139. height: 600px;
  3140. }
  3141. .imgBor {
  3142. border-right: 1px solid #666;
  3143. border-left: 1px solid #666;
  3144. }
  3145. .custom-tree-node {
  3146. flex: 1;
  3147. display: flex;
  3148. align-items: center;
  3149. justify-content: space-between;
  3150. font-size: 14px;
  3151. padding-right: 8px;
  3152. }
  3153. .left {
  3154. border-right: 1px solid #f2f2f2;
  3155. overflow: hidden;
  3156. .department {
  3157. background:#f2f2f2;
  3158. line-height: 60px;
  3159. color:#666;
  3160. padding:0 10px;
  3161. height:60px;
  3162. font-size: 15px;
  3163. div {
  3164. float: right;
  3165. color: #20a0ff;
  3166. font-size: 14px;
  3167. cursor: pointer;
  3168. }
  3169. }
  3170. .tree {
  3171. overflow: auto;
  3172. }
  3173. }
  3174. .nowTime {
  3175. height: 40px;
  3176. line-height: 40px;
  3177. font-size: 16px;
  3178. color: #20a0ff;
  3179. margin-left: 10px;
  3180. cursor: pointer;
  3181. i {
  3182. margin-right: 10px;
  3183. }
  3184. }
  3185. .none {
  3186. display: none;
  3187. }
  3188. .block {
  3189. display: block;
  3190. }
  3191. </style>
  3192. <style lang="scss">
  3193. .tree {
  3194. .el-tree-node__label {
  3195. overflow-x: hidden;
  3196. white-space: nowrap;
  3197. text-overflow: ellipsis;
  3198. }
  3199. }
  3200. .el-divider--horizontal {
  3201. margin: 0px;
  3202. background:#f3f3f3;
  3203. }
  3204. //全局的作用范围
  3205. .el-tree-node__content {
  3206. height:36px;
  3207. }
  3208. .zhaunye {
  3209. display: flex;
  3210. justify-content: space-between;
  3211. padding: 0 5px 0 10px;
  3212. }
  3213. .certificateList {
  3214. width: 98%;
  3215. box-sizing: border-box;
  3216. margin: 0 10px 0 10px;
  3217. border: 1px solid rgb(194, 194, 194);
  3218. min-height: 200px;
  3219. max-height: 200px;
  3220. overflow: auto;
  3221. padding: 10px;
  3222. }
  3223. .moreAl {
  3224. display: flex;
  3225. width: 100%;
  3226. justify-content: center;
  3227. }
  3228. .moreLiList {
  3229. display: flex;
  3230. margin-bottom: 10px;
  3231. }
  3232. .moreLiList div {
  3233. line-height: 30px;
  3234. }
  3235. .moreLiList span {
  3236. display: inline-block;
  3237. margin-right: 15px;
  3238. }
  3239. .poAub {
  3240. position: absolute;
  3241. right: 10px;
  3242. }
  3243. </style>