index.vue 118 KB

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