index.vue 125 KB

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