index.vue 126 KB

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