index.vue 130 KB

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