index.vue 118 KB

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