index.vue 126 KB

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