index.vue 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640
  1. <template>
  2. <section>
  3. <el-col :span="4" class="left" :style="'height:'+ (tableHeight + 113) + 'px;'">
  4. <div class="department">
  5. <span><i class="iconfont firerock-iconzuzhijiegou" style="font-size:10px;" ></i>&nbsp;部门</span>
  6. <div v-on:click="createDepartment(-1)">
  7. <i class="fa fa-plus-circle"></i>
  8. 创建
  9. </div>
  10. </div>
  11. <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
  12. <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
  13. <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
  14. <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">
  15. <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)>
  16. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">{{ node.label }}</span>
  17. <!-- <span v-if="node.label != '全部人员'" class="node none"> -->
  18. <span v-if="node.label != '全部人员'" class="node none poAub">
  19. <el-button type="text" size="mini" @click="createDepartment(-2)" >
  20. <i class="el-icon-circle-plus-outline"></i> <!-- 新增 -->
  21. </el-button>
  22. <el-button type="text" size="mini" @click="deleteDep(null)">
  23. <i class="el-icon-delete"></i> <!-- 删除 -->
  24. </el-button>
  25. </span>
  26. </span>
  27. </el-tree>
  28. </div>
  29. </el-col>
  30. <el-col :span="20" class="right">
  31. <!--工具条-->
  32. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  33. <el-form :inline="true">
  34. <!-- <div style="width: 300px;display: inline-block;">
  35. <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
  36. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  37. </el-input>
  38. </div> -->
  39. <el-form-item>
  40. <div v-if="depData == null || depData.id == -1" class="nowTime" style="cursor:unset">
  41. <i class="fa fa-home"></i>全部人员
  42. </div>
  43. <div v-else-if="depData.id == 0" class="nowTime" style="cursor:unset">
  44. <i class="fa fa-home"></i>未分配
  45. </div>
  46. <div v-else-if="depData != null && depData.id != -1 && depData.id != 0" class="nowTime" @click="createDepartment(0)">
  47. <i class="fa fa-pencil-square-o"></i>
  48. {{depData!=null?depData.label:''}}
  49. </div>
  50. </el-form-item>
  51. <el-form-item>
  52. <div style="color:#999;font-size:13px;">共{{total}}人</div>
  53. </el-form-item>
  54. <el-form-item style="float:right;" v-if="permissions.structureCustomConfig">
  55. <el-link type="primary" :underline="false" @click="customConfigShow">自定义配置</el-link>
  56. </el-form-item>
  57. <el-form-item style="float:right;" v-if="permissions.structureExport">
  58. <el-link type="primary" :underline="false" @click="showExportDialog">导出人员</el-link>
  59. </el-form-item>
  60. <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureAdd">
  61. <el-link type="primary" :underline="false" @click="openInsertDialog(null)">添加人员</el-link>
  62. </el-form-item>
  63. <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureImport">
  64. <el-link type="primary" :underline="false" @click="importUserC">批量导入</el-link>
  65. </el-form-item>
  66. <el-form-item style="float:right;" v-if="user.corpwxUserid != null && permissions.structureImport">
  67. <el-link type="primary" :underline="false" @click="syncWithCorpWx">同步企微通讯录</el-link>
  68. </el-form-item>
  69. <!-- <el-form-item style="float:right;" v-if="user.dingdingUserid == null && permissions.structureImport">
  70. <el-link type="primary" :underline="false" href="./upload/人员导入模板.xlsx" download="人员导入模板.xlsx">模板下载</el-link>
  71. </el-form-item> -->
  72. <!-- <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;">
  73. </el-form-item> -->
  74. <!-- <el-form-item style="float:right;">
  75. <el-link type="danger" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="deleteDep(null)">删除部门</el-link>
  76. </el-form-item>
  77. <el-form-item style="float:right;">
  78. <el-link type="primary" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="createDepartment(-2)">新增子部门</el-link>
  79. </el-form-item> -->
  80. <el-form-item style="float:right;">
  81. <span style="color: #666666">角色</span>
  82. <el-select v-model="roleId" placeholder="请选择" @change="getUser()" style="width: 120px" clearable>
  83. <!-- <el-option
  84. v-for="item in rolesa"
  85. :key="item.value"
  86. :label="item.label"
  87. :value="item.value">
  88. </el-option> -->
  89. <el-option v-for="item in acquireRoleList" :key="item.id" :label="item.rolename" :value="item.id"></el-option>
  90. </el-select>
  91. </el-form-item>
  92. <el-form-item style="float:right;">
  93. <span style="color: #666666">状态</span>
  94. <el-select v-model="status" placeholder="请选择" @change="getUser()" style="width: 120px">
  95. <el-option
  96. v-for="item in states"
  97. :key="item.value"
  98. :label="item.label"
  99. :value="item.value">
  100. </el-option>
  101. </el-select>
  102. </el-form-item>
  103. <el-form-item style="float:right;">
  104. <div style="width: 250px;display: inline-block;">
  105. <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
  106. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  107. </el-input>
  108. </div>
  109. </el-form-item>
  110. </el-form>
  111. </el-col>
  112. <!--列表-->
  113. <el-table ref="handleSelectTable" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="handleSelectionZzjg">
  114. <el-table-column type="selection" width="50"></el-table-column>
  115. <el-table-column type="index" width="50">
  116. <template slot-scope="scope" >
  117. {{scope.$index+1+(page-1)*size}}
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="name" label="姓名" ></el-table-column>
  121. <el-table-column prop="phone" label="手机" width="120"></el-table-column>
  122. <el-table-column prop="departmentName" label="部门" ></el-table-column>
  123. <el-table-column label="角色" width="100">
  124. <template slot-scope="scope">{{scope.row.roleName}}</template>
  125. </el-table-column>
  126. <el-table-column prop="monthCost" label="月成本" v-if="permissions.structurePersonnel">
  127. <template slot-scope="scope">{{user.timeType.isSecretSalary==0?(scope.row.monthCost==null?0:scope.row.monthCost):'*'}} 元</template>
  128. </el-table-column>
  129. <el-table-column prop="cost" label="时薪" v-if="permissions.structurePersonnel">
  130. <template slot-scope="scope">{{user.timeType.isSecretSalary==0?(scope.row.cost==null?0:scope.row.cost):'*'}} 元
  131. <el-link v-if="user.timeType.isSecretSalary==0" @click.native="showSalaryList(scope.row)"><i class="iconfont firerock-iconrecord"></i></el-link>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="状态" width="160">
  135. <template slot-scope="scope">
  136. <span>{{scope.row.isActive==0 ? '离职(' + scope.row.inactiveDate + ')' : '在职'}}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="操作" width="300">
  140. <template slot-scope="scope">
  141. <el-button size="mini" type="default" v-if="scope.row.roleName == '超级管理员' && user.id == scope.row.id" @click="transferRole(scope.row)">转让</el-button>
  142. <el-button size="mini" type="default" v-if="scope.row.roleName != '超级管理员'" @click="resetPwd(scope.row)">重置</el-button>
  143. <el-button size="mini" type="primary" v-if="scope.row.roleName != '超级管理员'" @click="openInsertDialog(scope.row)">编辑</el-button>
  144. <el-button size="mini" type="primary" v-if="scope.row.roleName == '超级管理员'" @click="openInsertDialog1(scope.row)">编辑</el-button>
  145. <!-- <el-button size="mini" type="danger" v-if="scope.row.roleName != '超级管理员'" @click="deleteUser(scope.row)">删除</el-button> -->
  146. <el-button size="mini" type="default" v-if="scope.row.roleName != '超级管理员' && scope.row.isActive==1" @click="showDeactiveDialog(scope.row)">停用</el-button>
  147. <el-button size="mini" type="success" v-if="scope.row.roleName != '超级管理员' && scope.row.isActive==0" @click="setActive(scope.row, 1)">启用</el-button>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. <!--工具条-->
  152. <el-col :span="24" class="toolbar">
  153. <!-- 123 -->
  154. <el-button size="small" @click="handleSelectionZzjgbtn1">取消</el-button>
  155. <!-- <el-cascader v-model="handleSelectionZzjgwillchange" size="small" placeholder="请选择部门" style="width: 13%;margin-left: 1%;margin-right: 1%;font-size:12px"
  156. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  157. <el-button size="small" type="primary" @click="handleSelectionZzjgbtn2">修改</el-button> -->
  158. <el-button size="small" type="primary" @click="handleSelectionZzjgbtn3">批量修改部门</el-button>
  159. <el-button size="small" type="primary" @click="handJue">批量修改角色</el-button>
  160. <el-pagination
  161. @size-change="handleSizeChange"
  162. @current-change="handleCurrentChange"
  163. :page-sizes="[20 , 50 , 80 , 100]"
  164. :page-size="size"
  165. layout="total, sizes, prev, pager, next"
  166. :total="total"
  167. style="float:right;"
  168. ></el-pagination>
  169. </el-col>
  170. </el-col>
  171. <!-- 批量修改弹出框 -->
  172. <el-dialog title="批量修改" :visible.sync="handleSelectionZzjgshow" v-if="handleSelectionZzjgshow" width="30%">
  173. <el-form model="" label-width="20%">
  174. <el-form-item label="设置部门">
  175. <!-- <el-cascader v-model="handleSelectionZzjgwillchange" placeholder="请选择部门" style="width: 60%;"
  176. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
  177. <el-cascader v-model="handleSelectionZzjgwillchange" placeholder="请选择部门" style="width: 100%;"
  178. :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  179. </el-form-item>
  180. </el-form>
  181. <div slot="footer" class="dialog-footer">
  182. <el-button @click="handleSelectionZzjgshow = false">取消</el-button>
  183. <el-button type="primary" @click="handleSelectionZzjgbtn2">确定</el-button>
  184. </div>
  185. </el-dialog>
  186. <!-- 批量修改角色弹出框 -->
  187. <el-dialog title="批量修改" :visible.sync="handljues" v-if="handljues" width="30%">
  188. <el-form model="" label-width="20%">
  189. <el-form-item label="设置角色">
  190. <el-select v-model="xiuRoleId" placeholder="请选择" style="width: 100%">
  191. <el-option v-for="(item, index) in acquireRoleLists" :key="index" :label="item.rolename" :value="item.id"></el-option>
  192. </el-select>
  193. </el-form-item>
  194. </el-form>
  195. <div slot="footer" class="dialog-footer">
  196. <el-button @click="handljues = false">取消</el-button>
  197. <el-button type="primary" @click="handTrue">确定</el-button>
  198. </div>
  199. </el-dialog>
  200. <!-- 新增部门 -->
  201. <el-dialog :title="depTitle" :visible.sync="departmentVisible" width="400px" >
  202. <el-form ref="depForm" :model="depForm" :rules="depRules" label-width="80px">
  203. <el-form-item label="部门名称" prop="name">
  204. <el-input v-model="depForm.name" placeholder="请输入部门名称" clearable></el-input>
  205. </el-form-item>
  206. <el-form-item label="负责人" prop="managerId">
  207. <el-select v-model="depForm.managerId" filterable clearable placeholder="请选择部门负责人" >
  208. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  209. </el-select>
  210. </el-form-item>
  211. <!-- 直属领导 -->
  212. <el-form-item label="直属领导" prop="reportAuditUserid">
  213. <el-select v-model="depForm.reportAuditUserid" filterable clearable placeholder="请选择直属领导" >
  214. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  215. </el-select>
  216. </el-form-item>
  217. </el-form>
  218. <span slot="footer" class="dialog-footer">
  219. <el-button @click="departmentVisible = false">取消</el-button>
  220. <el-button type="primary" @click="submitDepartment" >提交</el-button>
  221. </span>
  222. </el-dialog>
  223. <!-- 新增/编辑人员的Dialog -->
  224. <el-dialog :title="title" :visible.sync="dialogVisible" width="550px" >
  225. <el-form ref="form12" :model="insertForm" :rules="rules" label-width="80px">
  226. <el-form-item label="名字" prop="name">
  227. <el-input v-model="insertForm.name" placeholder="请输入姓名" clearable></el-input>
  228. </el-form-item>
  229. <el-form-item label="电话" prop="phone">
  230. <el-input v-model="insertForm.phone" placeholder="请输入电话号码" clearable></el-input>
  231. </el-form-item>
  232. <el-form-item label="薪酬方式" prop="salaryType" v-if="permissions.structurePersonnel&&user.timeType.isSecretSalary==0">
  233. <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
  234. <el-radio :label="0" >固定月成本</el-radio>
  235. <el-radio :label="1">计时工资</el-radio>
  236. </el-radio-group>
  237. </el-form-item>
  238. <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0 && permissions.structurePersonnel&&user.timeType.isSecretSalary==0">
  239. <el-input v-model="insertForm.monthCost" id="mc" @input="oninput" placeholder="请输入月成本,单位:元" clearable @keyup.native="restrictNumber('mc')"></el-input>
  240. <span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
  241. <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
  242. </el-form-item>
  243. <el-form-item label="时薪" prop="cost" v-if="permissions.structurePersonnel&&user.timeType.isSecretSalary==0">
  244. <el-input v-model="insertForm.cost" :disabled="insertForm.salaryType == 0" id="cc" style="width:120px;" @keyup.native="restrictNumber('cc')"
  245. placeholder="请输入成本 单位:元/小时" clearable></el-input>
  246. <span style="margin-left:25px;">生效日期</span>
  247. <el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
  248. </el-form-item>
  249. <el-form-item label="部门" prop="departmentId">
  250. <!-- <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  251. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
  252. <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  253. :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  254. </el-form-item>
  255. <el-form-item label="直属上级">
  256. <el-select v-model="insertForm.superiorId" placeholder="请选择" style="width: 100%" filterable clearable>
  257. <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
  258. <span style="float: left">{{item.name}}</span>
  259. <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
  260. </el-option>
  261. </el-select>
  262. </el-form-item>
  263. <el-form-item label="角色" prop="roleId">
  264. <el-select v-model="insertForm.roleId" placeholder="请选择角色" style="width: 100%">
  265. <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
  266. <span style="float: left">{{item.rolename}}</span>
  267. <span style="float: right; color: #8492a6; font-size: 13px">{{item.roleDescribe}}</span>
  268. </el-option>
  269. </el-select>
  270. </el-form-item>
  271. <el-form-item :label="item.name" v-for="item,index in userCustomConfig" :key="item.id">
  272. <el-select v-if="item.type == 0" v-model="insertForm[suoying[index]]" placeholder="请选择" clearable style="width: 100%">
  273. <el-option v-for="option in item.itemList" :label="option.name" :value="option.name" :key="option.id">
  274. </el-option>
  275. </el-select>
  276. <el-input v-else v-model="insertForm[suoying[index]]" placeholder="请输入" clearable></el-input>
  277. </el-form-item>
  278. <el-form-item label="入职时间" prop="phone">
  279. <el-date-picker v-model="insertForm.inductionDate" value-format="yyyy-MM-dd"></el-date-picker>
  280. </el-form-item>
  281. <el-form-item label="岗位职级" prop="phone">
  282. <el-input v-model="insertForm.position" placeholder="请输入岗位职级别" clearable></el-input>
  283. </el-form-item>
  284. <div class="zhaunye"><p>专业证书</p><p><el-link type="primary" @click="addCertificateList()">添加更多证书</el-link><el-link v-if="permissions.structureCertificate" type="primary" @click="managementDiolog = true" style="margin-left: 20px">管理专业证书</el-link></p></div>
  285. <div class="certificateList">
  286. <div class="moreList">
  287. <div class="moreLiList" v-for="(item,index) in insertForm.certJson" :key="index">
  288. <div style="margin-right: 10px;width: 160px;">
  289. <el-select v-model="item.certId" placeholder="请选择专业证书" size="mini" @change="changeManagement(index)">
  290. <el-option v-for="item in managementTableData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
  291. </el-select>
  292. </div>
  293. <div><span>证书日期</span><el-date-picker size="mini" v-model="item.certDate" type="date" value-format="yyyy-MM-dd" placeholder="选择证书日期" style="width: 180px"></el-date-picker></div>
  294. <div style="color: red;margin-left: 15px;cursor:pointer;" @click="deteFrames(index)"><i class="el-icon-delete"></i></div>
  295. </div>
  296. </div>
  297. </div>
  298. </el-form>
  299. <span slot="footer" class="dialog-footer">
  300. <el-button type="danger" @click="deleteUser(insertForm)" style="float:left;">删除</el-button>
  301. <el-button @click="dialogVisible=false">取消</el-button>
  302. <el-button type="primary" @click="submitInsert('insertForm')" :loading="submitLoading">提交</el-button>
  303. </span>
  304. </el-dialog>
  305. <!-- 编辑超级管理员的Dialog -->
  306. <el-dialog title="编辑人员" :visible.sync="dialogVisible1" width="550px" >
  307. <el-form ref="form1" :model="insertForm" :rules="rules" label-width="80px">
  308. <el-form-item label="名字" prop="name">
  309. <el-input v-model="insertForm.name" placeholder="请输入姓名" clearable></el-input>
  310. </el-form-item>
  311. <el-form-item label="薪酬方式" prop="salaryType" v-if="permissions.structurePersonnel">
  312. <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
  313. <el-radio :label="0" >固定月成本</el-radio>
  314. <el-radio :label="1">计时工资</el-radio>
  315. </el-radio-group>
  316. </el-form-item>
  317. <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0 && permissions.structurePersonnel" >
  318. <el-input v-model="insertForm.monthCost" id="monthCost" @input="oninput" @keyup.native="restrictNumber('monthCost')" placeholder="请输入月成本,单位:元" clearable></el-input>
  319. <span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
  320. <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
  321. </el-form-item>
  322. <el-form-item label="时薪" prop="cost" v-if="permissions.structurePersonnel">
  323. <el-input v-model="insertForm.cost" id="cost" :disabled="insertForm.salaryType == 0" @keyup.native="restrictNumber('cost')" style="width:120px;"
  324. placeholder="请输入成本 单位:元/小时" clearable></el-input>
  325. <span style="margin-left:25px;">生效日期</span>
  326. <el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
  327. </el-form-item>
  328. <el-form-item label="部门" prop="departmentId">
  329. <el-cascader v-model="insertForm.departmentId"
  330. placeholder="请选择部门"
  331. style="width: 100%"
  332. :options="option"
  333. :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"
  334. clearable></el-cascader>
  335. </el-form-item>
  336. <el-form-item label="直属上级">
  337. <el-select v-model="insertForm.superiorId" placeholder="请选择" style="width: 100%" filterable clearable>
  338. <el-option v-for="item in users" :label="item.name" :value="item.id" :key="item.id" :disabled="item.id == insertForm.id">
  339. <span style="float: left">{{item.name}}</span>
  340. <span style="float: right; color: #8492a6; font-size: 13px">{{item.departmentName}}</span>
  341. </el-option>
  342. </el-select>
  343. </el-form-item>
  344. </el-form>
  345. <span slot="footer" class="dialog-footer">
  346. <el-button @click="dialogVisible1=false">取消</el-button>
  347. <el-button type="primary" @click="submitInsert1" :loading="submitLoading">提交</el-button>
  348. </span>
  349. </el-dialog>
  350. <el-dialog title="人员历史成本" :visible.sync="userSalaryListDialog" width="550px" >
  351. <el-table :data="userSalaryList" highlight-current-row v-loading="listLoading" height="300px" style="width: 100%;">
  352. <el-table-column prop="userName" label="姓名" ></el-table-column>
  353. <el-table-column prop="indate" label="更新时间" width="150px">
  354. </el-table-column>
  355. <el-table-column prop="salaryType" label="薪酬方式" >
  356. <template slot-scope="scope" >
  357. {{scope.row.salaryType==0?"固定月薪":"计时工资"}}
  358. </template>
  359. </el-table-column>
  360. <el-table-column prop="monthCost" label="月薪" >
  361. <template slot-scope="scope" >
  362. {{scope.row.monthCost}}元
  363. </template>
  364. </el-table-column>
  365. <el-table-column prop="cost" label="时薪" >
  366. <template slot-scope="scope" >
  367. {{scope.row.cost}}元
  368. </template>
  369. </el-table-column>
  370. </el-table>
  371. </el-dialog>
  372. <!--导出人员 -->
  373. <el-dialog title="导出人员列表" :visible.sync="exportDialogVisible" width="550px" >
  374. <el-form label-width="100px">
  375. <el-form-item label="导出" >
  376. <el-radio-group v-model="containInvalid" >
  377. <el-radio :label="1" >全部人员</el-radio>
  378. <el-radio :label="0" >仅活跃人员</el-radio>
  379. </el-radio-group>
  380. </el-form-item>
  381. </el-form>
  382. <span slot="footer" class="dialog-footer">
  383. <el-button type="primary" @click="exportUsers">导出</el-button>
  384. </span>
  385. </el-dialog>
  386. <!-- 转让超级管理员权限 -->
  387. <el-dialog title="权限转让" :visible.sync="transferDialog" width="550px" >
  388. <el-form label-width="200px">
  389. <el-form-item label="转让超级管理员角色至" >
  390. <el-select v-model="toUserId" style="width:300px" filterable clearable>
  391. <el-option v-for="item in allActiveUsers" :key="item.id" :value="item.id" :label="item.name">
  392. </el-option>
  393. </el-select>
  394. </el-form-item>
  395. <el-form-item label="转让后自己的角色" >
  396. <el-select v-model="myRoleId" style="width:300px">
  397. <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
  398. <span style="float: left">{{item.rolename}}</span>
  399. <span style="float: right; color: #8492a6; font-size: 13px">{{item.roleDescribe}}</span>
  400. </el-option>
  401. </el-select>
  402. </el-form-item>
  403. </el-form>
  404. <span slot="footer" class="dialog-footer">
  405. <el-button type="default" @click="transferDialog = false">取消</el-button>
  406. <el-button type="primary" @click="showConfirmDialog">确定</el-button>
  407. </span>
  408. </el-dialog>
  409. <!--停用时选择日期 -->
  410. <el-dialog title="离职停用员工" :visible.sync="deactiveDialog" width="550px" >
  411. <el-form label-width="200px">
  412. <el-form-item label="员工离职日期" >
  413. <el-date-picker type="date" v-model="deactiveDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择" />
  414. </el-form-item>
  415. </el-form>
  416. <span slot="footer" class="dialog-footer">
  417. <el-button type="default" @click="deactiveDialog = false">取消</el-button>
  418. <el-button type="primary" @click="confirmDeactive">确定</el-button>
  419. </span>
  420. </el-dialog>
  421. <!-- 管理专业证书 -->
  422. <el-dialog title="管理专业证书" :visible.sync="managementDiolog" width="500px" :before-close="handleClose">
  423. <div>
  424. <el-table :data="managementTableData" style="width: 100%" height="400">
  425. <el-table-column prop="name" label="名称" width="280"></el-table-column>
  426. <el-table-column label="操作" width="180">
  427. <template slot-scope="scope">
  428. <div>
  429. <el-button type="primary" size="small" @click="editorManagementForm(scope.row)">编辑</el-button>
  430. <el-button type="danger" size="small" @click="deteManagementForm(scope.row)">删除</el-button>
  431. </div>
  432. </template>
  433. </el-table-column>
  434. </el-table>
  435. </div>
  436. <span slot="footer" class="dialog-footer">
  437. <el-button @click="managementDiolog = false">关 闭</el-button>
  438. <el-button type="primary" @click="addManagementDiologs()">新 增</el-button>
  439. </span>
  440. </el-dialog>
  441. <!-- 新增项目管理专业 -->
  442. <el-dialog title="新增/编辑管理专业证书" :visible.sync="addManagementDiolog" width="500px" :before-close="handleClose">
  443. <div>
  444. <el-form :model="managementForm" :rules="managementFormRou" ref="managementForm" label-width="150px" class="demo-ruleForm">
  445. <el-form-item label="专业证书名称" prop="name">
  446. <el-input v-model="managementForm.name" placeholder="请输入专业证书名称"></el-input>
  447. </el-form-item>
  448. </el-form>
  449. </div>
  450. <span slot="footer" class="dialog-footer">
  451. <el-button @click="addManagementDiolog = false">取 消</el-button>
  452. <el-button type="primary" @click="addManagementForm('managementForm')">提 交</el-button>
  453. </span>
  454. </el-dialog>
  455. <!-- 自定义配置项 -->
  456. <el-dialog title="自定义配置项管理" show-header="false" v-if="customConfigDialog" :visible.sync="customConfigDialog" :close-on-click-modal="false" customClass="customWidth" width="650px" top="20px">
  457. <div style="margin-left:30px;">
  458. <p v-for="item,index in customConfigList" :key="index">
  459. <el-input size="medium" v-model="item.name" placeholder="请输入自定义配置项名称" style="width:200px;margin-right:20px" maxlength="8"></el-input>
  460. <el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="0" style="margin-right:10px;margin-left:10px">下拉</el-radio>
  461. <el-radio size="medium" :disabled="!item.name" v-model="item.type" :label="1">输入</el-radio>
  462. <span style="display:inline-block;">
  463. <el-button v-if="cusItemTypes[index] == 0" type="primary" size="small" @click="getConfigItemBtn(item)">配置选项</el-button>
  464. <span v-if="!item.id && item.name && item.type == 0" style="color:#999;font-size:13px">保存后可配置选项</span>
  465. </span>
  466. <el-button style="margin-left:20px" type="danger" size="small" v-if="item.id" @click="customConfigDelete(item,index)">删除</el-button>
  467. </p>
  468. </div>
  469. <div slot="footer" class="dialog-footer">
  470. <el-button type="primary" @click="customConfigDialog = false" >关闭</el-button>
  471. <!-- <el-button type="primary" @click="customConfigListAdd" :disabled="customConfigList.length >= 5">新增</el-button> -->
  472. <el-button type="primary" @click="customConfigListSave" :loading="saveBtnLoading">保存</el-button>
  473. </div>
  474. <!-- 为下拉时的选项配置 -->
  475. <el-dialog title="配置选项" v-if="configItemDialog" :visible.sync="configItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px" append-to-body>
  476. <el-table :data="configItemList" height="400px" style="width:100%" key="configItemTable">
  477. <el-table-column prop="id" width="60" label="序号">
  478. <template slot-scope="scope" >
  479. {{scope.$index + 1}}
  480. </template>
  481. </el-table-column>
  482. <el-table-column prop="name" label="名称" ></el-table-column>
  483. <el-table-column label="操作" width="150">
  484. <template slot-scope="scope" >
  485. <el-button size="small" type="primary" @click="configItemAorM(scope.row)">编辑</el-button>
  486. <el-button size="small" type="danger" @click="configItemDelete(scope.row)">删除</el-button>
  487. </template>
  488. </el-table-column>
  489. </el-table>
  490. <div slot="footer" class="dialog-footer">
  491. <el-button type="primary" @click="configItemDialog = false" >关闭</el-button>
  492. <el-button type="primary" @click="configItemAorM" >新增配置选项</el-button>
  493. </div>
  494. <el-dialog title="新增/编辑配置选项" v-if="configItemAorMDialog" :visible.sync="configItemAorMDialog" :close-on-click-modal="false" customClass="customWidth" width="500px" append-to-body>
  495. <span>名称</span>
  496. <el-input size="medium" v-model="AorMitem.name" placeholder="请输入自定义配置项名称" style="width:200px;margin-right:20px" maxlength="8"></el-input>
  497. <div slot="footer" class="dialog-footer">
  498. <el-button type="primary" @click="configItemAorMDialog = false" >取消</el-button>
  499. <el-button type="primary" @click="configItemAorMSure" >提交</el-button>
  500. </div>
  501. </el-dialog>
  502. </el-dialog>
  503. </el-dialog>
  504. <!-- 批量导入 -->
  505. <el-dialog title="人员批量导入" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  506. <p>1. 下载
  507. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/人员导入模板.xlsx" download="人员导入模板.xlsx">人员导入模板.xlsx</el-link>
  508. </p>
  509. <p>2. 填写excel模板,并上传。</p>
  510. <p style="display: flex;justify-content: center;padding-bottom:1em;">
  511. <el-upload ref="upload" action="#" :limit="1" :http-request="importUser" :show-file-list="false">
  512. <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
  513. </el-upload>
  514. </p>
  515. </el-dialog>
  516. <el-dialog title="同步企业微信通讯录" v-if="showSyncCWDialog" :visible.sync="showSyncCWDialog" customClass="customWidth" width="500px">
  517. <p>填写企业微信通讯录Secret
  518. <el-popover placement="top" width="1200" trigger="hover">
  519. <div class="imgFlex">
  520. <div><img src="../../assets/image/Step1.jpg" style="width: 380px"/> <p><b>第一步:进入管理后台</b></p> </div>
  521. <div class="imgBor"> <p></p> <img src="../../assets/image/Step2.jpg" style="width: 380px"/> <p><b>第二步:进入通讯录同步</b></p></div>
  522. <div><img src="../../assets/image/Step3.jpg" style="width: 380px"/> <p><b>第三步:查看Secret</b></p></div>
  523. </div>
  524. <i class="el-icon-question" slot="reference" />
  525. </el-popover>
  526. </p>
  527. <p>
  528. <el-input v-model="contactSecret" style="width:380px;" :disabled="!editSecret"/><el-button @click="editSecret?saveContactSecret():editSecret=true;" >{{editSecret?'保存':'修改'}}</el-button>
  529. </p>
  530. <p style="display: flex;justify-content: center;padding-bottom:1em;">
  531. <el-button type="primary" :underline="false" :loading="importingData" :disabled="!canSync" @click="startCorpWxImport">开始同步</el-button>
  532. </p>
  533. </el-dialog>
  534. </section>
  535. </template>
  536. <script>
  537. import util from "../../common/js/util";
  538. let that
  539. export default {
  540. data() {
  541. return {
  542. editSecret: false,
  543. canSync: false,
  544. corpid:null,
  545. contactSecret:null,
  546. showSyncCWDialog: false,
  547. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  548. handleSelectionZzjgshow: false,
  549. handljues: false,
  550. submitLoading:false,
  551. deactiveUser:null,
  552. deactiveDate:null,
  553. deactiveDialog:false,
  554. toUserId:null,
  555. myRoleId: null,
  556. allActiveUsers:[],
  557. transferDialog: false,
  558. containInvalid:1,
  559. exportDialogVisible: false,
  560. roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员","公司领导"],
  561. roleDescArray:[{label:"普通员工",value:0, desc:"填报日报,参与项目协作"},
  562. {label:"系统管理员",value:2, desc:"具有除了创建系统管理员之外的全部功能"},
  563. // {label:"公司高层",value:3, desc:"查阅项目信息,人员工时情况"},
  564. {label:"财务管理员",value:4, desc:"财务核算成本,费用报销审核,负责组织架构管理"},
  565. {label:"项目管理员",value:5, desc:"创建和管理项目"},
  566. {label:"公司领导",value:6, desc:"查看日报、工时成本统计、财务核算、项目和报表"},
  567. ],
  568. userSalaryList:[],
  569. userSalaryListDialog: false,
  570. value:{},
  571. user: JSON.parse(sessionStorage.getItem("user")),
  572. users:[],
  573. tableHeight: 0,
  574. listLoading: false,
  575. total: 0,
  576. page: 1,
  577. size: 20,
  578. list: [],
  579. data: [
  580. {
  581. id: -1,
  582. label: '全部人员',
  583. },
  584. {
  585. id: 0,
  586. label: '未分配',
  587. }
  588. ],
  589. option: [],
  590. depData: {
  591. id: -1,
  592. label: '全部人员',
  593. },
  594. defaultProps: {
  595. children: 'children',
  596. label: 'label'
  597. },
  598. dialogVisible: false,
  599. title: "",
  600. insertForm: {
  601. id: null,
  602. name: null,
  603. phone: null,
  604. // role: null,
  605. roleId: null,
  606. monthCost:null,
  607. cost: null,
  608. departmentId: null,
  609. salaryType:0,
  610. costApplyDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
  611. inductionDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
  612. position: '',
  613. certJson: [],
  614. plateMap:{}
  615. },
  616. rules: {
  617. name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
  618. // phone: [{ required: true, message: "请输入电话", trigger: "blur" }],
  619. // role: [{ required: true, message: "请选择角色", trigger: "blur" }],
  620. roleId: [{ required: true, message: "请选择角色", trigger: "blur" }],
  621. cost: [{ required: true, message: "请输入成本", trigger: "blur" }],
  622. monthCost:[{ required: true, message: "请输入月成本", trigger: "blur" }]
  623. },
  624. managementFormRou: {
  625. name: [{ required: true, message: "请输入专业证书", trigger: "blur" }],
  626. },
  627. dialogVisible1: false,
  628. departmentVisible: false,
  629. depTitle: '',
  630. depForm: {
  631. id: null,
  632. name: null,
  633. parentId: null,
  634. managerId: null,
  635. },
  636. depRules: {
  637. name: [{ required: true, message: "请输入部门名称", trigger: "blur" }],
  638. },
  639. timeType:{},
  640. keyword: '',
  641. rolesa: [{
  642. value: '',
  643. label: '全部'
  644. }, {
  645. value: '6',
  646. label: '公司领导'
  647. }, {
  648. value: '2',
  649. label: '系统管理员'
  650. }, {
  651. value: '4',
  652. label: '财务管理员'
  653. }, {
  654. value: '5',
  655. label: '项目管理员'
  656. }, {
  657. value: '0',
  658. label: '普通员工'
  659. }],
  660. states: [{
  661. value: '',
  662. label: '全部'
  663. }, {
  664. value: '1',
  665. label: '活跃'
  666. }, {
  667. value: '0',
  668. label: '停用'
  669. }],
  670. status: '',
  671. role: '',
  672. jDarr: [],
  673. handleSelectionZzjgDate:[],
  674. handleSelectionZzjgwillchange : null,
  675. acquireRoleList: [], // 角色列表
  676. acquireRoleLists: [], // 没有超级管理员
  677. roleId: '',
  678. xiuRoleId: '',
  679. managementDiolog: false,
  680. addManagementDiolog: false,
  681. managementForm: {
  682. name: ''
  683. },
  684. managementTableData: [],
  685. certificate: '',
  686. addUserId: '',
  687. userCustomConfig: [],
  688. customConfigDialog: false,
  689. importDialog: false,
  690. importingData: false,
  691. customConfigList: [],
  692. cusItemTypes: [],
  693. configItemList: [],
  694. configItemId: null,
  695. configItemDialog: false,
  696. configItemAorMDialog: false,
  697. AorMitem: {
  698. name: null,
  699. userCustomId: null,
  700. id: null
  701. },
  702. tableLoading: false,
  703. suoying: ['plate1','plate2','plate3','plate4','plate5'],
  704. insertFormPlates: [],
  705. saveBtnLoading: false
  706. };
  707. },
  708. filters: {
  709. acquireRoleName(value) {
  710. for(var i in that.acquireRoleList) {
  711. if(that.acquireRoleList[i].id == value) {
  712. return that.acquireRoleList[i].rolename
  713. }
  714. }
  715. }
  716. },
  717. beforeCreate: function () {
  718. that = this;
  719. },
  720. methods: {
  721. saveContactSecret() {
  722. if (!this.contactSecret) {
  723. this.$message({
  724. message: '请输入通讯录secret',
  725. type: 'error'
  726. })
  727. return;
  728. }
  729. this.http.post('/wx-corp-info/saveContactSecret',{
  730. corpid: this.corpid,
  731. contactSecret:this.contactSecret
  732. },res => {
  733. if(res.code == 'ok'){
  734. this.$message({
  735. message: '保存成功',
  736. type: 'success'
  737. })
  738. this.canSync = true;
  739. }else {
  740. this.$message({
  741. message: res.msg,
  742. type: 'error'
  743. })
  744. }
  745. },err => {
  746. this.tableLoading = false
  747. this.$message({
  748. message: err,
  749. type: 'error'
  750. })
  751. })
  752. },
  753. startCorpWxImport() {
  754. this.importingData = true;
  755. this.http.post('/wxcorp/getCorpMembs',{
  756. corpId: this.corpid
  757. },res => {
  758. this.importingData = false;
  759. if(res.code == 'ok'){
  760. this.showSyncCWDialog = false;
  761. this.$message({
  762. message: '同步完成',
  763. type: "success"
  764. });
  765. this.getDepartment();
  766. this.getUser();
  767. this.getUsers();
  768. }else {
  769. this.$message({
  770. message: res.msg,
  771. type: 'error'
  772. })
  773. }
  774. },err => {
  775. this.tableLoading = false
  776. this.$message({
  777. message: err,
  778. type: 'error'
  779. })
  780. })
  781. },
  782. //从企业微信同步通讯录
  783. syncWithCorpWx() {
  784. this.showSyncCWDialog = true;
  785. this.editSecret = false;
  786. this.http.post('/wx-corp-info/get',{
  787. companyId: this.user.companyId
  788. },res => {
  789. if(res.code == 'ok'){
  790. this.contactSecret = res.data.contactSecret;
  791. if (this.contactSecret) {
  792. this.canSync = true;
  793. } else {
  794. this.editSecret = true;
  795. }
  796. this.corpid = res.data.corpid;
  797. }else {
  798. this.$message({
  799. message: res.msg,
  800. type: 'error'
  801. })
  802. }
  803. },err => {
  804. this.tableLoading = false
  805. this.$message({
  806. message: err,
  807. type: 'error'
  808. })
  809. })
  810. },
  811. test(){
  812. this.getCustomConfigList()
  813. },
  814. // 自定义配置项
  815. customConfigShow(){
  816. this.getCustomConfigList()
  817. this.customConfigDialog = true
  818. },
  819. getConfigItemBtn(item){
  820. this.configItemDialog = true
  821. this.AorMitem.userCustomId = item.id
  822. this.getConfigItem()
  823. },
  824. getConfigItem(){ // 获取配置下拉数据
  825. this.http.post('/sub-user-custom/list',{
  826. userCustomId: this.AorMitem.userCustomId
  827. },res => {
  828. if(res.code == 'ok'){
  829. this.configItemList = res.data
  830. }else {
  831. this.$message({
  832. message: res.msg,
  833. type: 'error'
  834. })
  835. }
  836. },err => {
  837. this.tableLoading = false
  838. this.$message({
  839. message: err,
  840. type: 'error'
  841. })
  842. })
  843. },
  844. getCustomConfigList(){ // 获取自定义配置
  845. this.http.post('/user-custom/list',{},
  846. res => {
  847. if(res.code == 'ok'){
  848. let lists = JSON.parse(JSON.stringify(res.data))
  849. this.userCustomConfig = JSON.parse(JSON.stringify(res.data))
  850. // let lists = res.data
  851. // this.customConfigList = res.data
  852. this.customConfigList = [
  853. { name: '', id: null, type: 1, companyId: null },
  854. { name: '', id: null, type: 1, companyId: null },
  855. { name: '', id: null, type: 1, companyId: null },
  856. { name: '', id: null, type: 1, companyId: null },
  857. { name: '', id: null, type: 1, companyId: null },
  858. ]
  859. for(let i in lists){
  860. this.$set(this.customConfigList[i],'name',lists[i].name)
  861. this.$set(this.customConfigList[i],'id',lists[i].id)
  862. this.$set(this.customConfigList[i],'type',lists[i].type)
  863. this.$set(this.customConfigList[i],'companyId',lists[i].companyId)
  864. }
  865. // console.log('customConfigList',this.customConfigList);
  866. this.cusItemTypes = []
  867. for(let j in this.customConfigList){
  868. if(this.customConfigList[j].type == null || this.customConfigList[j].type == 0){
  869. this.customConfigList[j].type = 0
  870. this.cusItemTypes[j] = 0
  871. }else{
  872. this.cusItemTypes[j] = 1
  873. }
  874. }
  875. }else {
  876. this.$message({
  877. message: res.msg,
  878. type: 'error'
  879. })
  880. }
  881. },err => {
  882. this.$message({
  883. message: err,
  884. type: 'error'
  885. })
  886. })
  887. },
  888. customConfigListSave(){ // 保存/修改自定义配置
  889. // let jsonStr = ''
  890. // for(let i in this.customConfigList){
  891. // if(this.customConfigList[i].name){
  892. // jsonStr += JSON.stringify(this.customConfigList[i]) + ','
  893. // }
  894. // }
  895. // jsonStr = jsonStr.substring(0,jsonStr.length - 1)
  896. // let jsonStr = []
  897. this.saveBtnLoading = true
  898. let parameter = this.customConfigList.filter(item => item.name.trim() != '')
  899. this.http.post('/user-custom/addOrMod',{
  900. json: JSON.stringify(parameter)
  901. },res => {
  902. if(res.code == 'ok'){
  903. this.getCustomConfigList()
  904. this.saveBtnLoading = false
  905. this.$message({
  906. message: '保存成功',
  907. type: 'success'
  908. })
  909. }else {
  910. this.saveBtnLoading = false
  911. this.$message({
  912. message: res.msg,
  913. type: 'error'
  914. })
  915. }
  916. },err => {
  917. this.saveBtnLoading = false
  918. this.$message({
  919. message: err,
  920. type: 'error'
  921. })
  922. })
  923. },
  924. customConfigDelete(item,index){
  925. if(item.id){
  926. this.http.post('/user-custom/delete',{
  927. id: item.id
  928. },res => {
  929. if(res.code == 'ok'){
  930. this.getCustomConfigList()
  931. this.$message({
  932. message: '删除成功',
  933. type: 'success'
  934. })
  935. }else {
  936. this.$message({
  937. message: res.msg,
  938. type: 'error'
  939. })
  940. }
  941. },err => {
  942. this.$message({
  943. message: err,
  944. type: 'error'
  945. })
  946. })
  947. }else{
  948. this.customConfigList.splice(index,1)
  949. }
  950. },
  951. configItemAorM(item){
  952. this.configItemAorMDialog = true
  953. if(item){
  954. this.AorMitem.name = item.name
  955. this.AorMitem.id = item.id
  956. }else{
  957. this.AorMitem.name = null
  958. this.AorMitem.id = null
  959. }
  960. },
  961. configItemAorMSure(){ // 新增/修改配置下拉选项
  962. if(!this.AorMitem.name){
  963. this.$message({
  964. message: '名称不能为空',
  965. type: 'error'
  966. })
  967. return
  968. }
  969. this.http.post('/sub-user-custom/addOrMod',this.AorMitem,res => {
  970. if(res.code == 'ok'){
  971. this.configItemAorMDialog = false
  972. this.getConfigItem()
  973. this.$message({
  974. message: '提交成功',
  975. type: 'success'
  976. })
  977. }else {
  978. this.$message({
  979. message: res.msg,
  980. type: 'error'
  981. })
  982. }
  983. },err => {
  984. this.$message({
  985. message: err,
  986. type: 'error'
  987. })
  988. })
  989. },
  990. configItemDelete(item){ // 删除配置下拉选项
  991. this.http.post('/sub-user-custom/delete',{
  992. id: item.id
  993. },res => {
  994. if(res.code == 'ok'){
  995. this.getConfigItem()
  996. this.$message({
  997. message: '删除成功',
  998. type: 'success'
  999. })
  1000. }else {
  1001. this.$message({
  1002. message: res.msg,
  1003. type: 'error'
  1004. })
  1005. }
  1006. },err => {
  1007. this.$message({
  1008. message: err,
  1009. type: 'error'
  1010. })
  1011. })
  1012. },
  1013. // 获取添加人员时的自定义配置信息
  1014. getUserCustomConfig(e){
  1015. this.http.post('/user-custom/list',{},
  1016. res => {
  1017. if(res.code == 'ok'){
  1018. this.userCustomConfig = JSON.parse(JSON.stringify(res.data))
  1019. for(let i in this.userCustomConfig){
  1020. if(this.userCustomConfig[i].type == 0){
  1021. this.http.post('/sub-user-custom/list',{
  1022. userCustomId: this.userCustomConfig[i].id
  1023. },res => {
  1024. if(res.code == 'ok'){
  1025. // this.userCustomConfig[i].itemList = res.data
  1026. this.$set(this.userCustomConfig[i],'itemList',res.data)
  1027. }else {
  1028. this.$message({
  1029. message: res.msg,
  1030. type: 'error'
  1031. })
  1032. }
  1033. },err => {
  1034. this.$message({
  1035. message: err,
  1036. type: 'error'
  1037. })
  1038. })
  1039. }
  1040. }
  1041. this.$nextTick(()=>{
  1042. // let opt = this.users[0].plateMap[this.userCustomConfig[0].name]
  1043. // console.log('userCustomConfig',this.userCustomConfig);
  1044. // console.log('insertForm',this.insertForm);
  1045. })
  1046. }else {
  1047. this.$message({
  1048. message: res.msg,
  1049. type: 'error'
  1050. })
  1051. }
  1052. },err => {
  1053. this.$message({
  1054. message: err,
  1055. type: 'error'
  1056. })
  1057. })
  1058. },
  1059. // customConfigListAdd(){
  1060. // this.customConfigList.push({
  1061. // name: '',
  1062. // type: 1
  1063. // })
  1064. // },
  1065. // 批量修改部门
  1066. handleSelectionZzjg(e){
  1067. // if (e.length == 0) {
  1068. // this.handleSelectionZzjgshow = false
  1069. // }else{
  1070. // this.handleSelectionZzjgshow = true
  1071. // }
  1072. this.handleSelectionZzjgDate = e
  1073. },
  1074. handleSelectionZzjgbtn1(){
  1075. this.handleSelectionZzjgshow = false
  1076. this.$refs.handleSelectTable.clearSelection()
  1077. this.handleSelectionZzjgwillchange = null
  1078. },
  1079. handleSelectionZzjgbtn2(){
  1080. if (this.handleSelectionZzjgwillchange == null) {
  1081. this.$message('请选择部门');
  1082. return
  1083. }
  1084. //接口调用样例代码如下
  1085. var ids = [];
  1086. for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
  1087. ids.push(this.handleSelectionZzjgDate[index].id)
  1088. }
  1089. var changeId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
  1090. this.http.post('/user/batchUpdateDept', {
  1091. userIds: JSON.stringify(ids),
  1092. deptId: changeId
  1093. },
  1094. res => {
  1095. if (res.code == "ok") {
  1096. this.$message({
  1097. message: '修改成功',
  1098. type: "success"
  1099. });
  1100. this.getUser()
  1101. } else {
  1102. this.$message({
  1103. message: res.msg,
  1104. type: "error"
  1105. });
  1106. }
  1107. },
  1108. error => {
  1109. this.$message({
  1110. message: error,
  1111. type: "error"
  1112. });
  1113. });
  1114. // for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
  1115. // this.handleSelectionZzjgDate[index].departmentId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
  1116. // if (this.handleSelectionZzjgDate[index].role == 1) {
  1117. // this.submitInsert1(this.handleSelectionZzjgDate[index],1)
  1118. // }else{
  1119. // this.submitInsert(this.handleSelectionZzjgDate[index],1)
  1120. // }
  1121. // }
  1122. // this.handleSelectionZzjgwillchange = null
  1123. this.handleSelectionZzjgshow = false
  1124. },
  1125. handleSelectionZzjgbtn3(){
  1126. if(this.handleSelectionZzjgDate.length == 0){
  1127. this.$message('请选择人员');
  1128. return
  1129. }
  1130. this.handleSelectionZzjgshow = true
  1131. },
  1132. handJue() {
  1133. if(this.handleSelectionZzjgDate.length == 0){
  1134. this.$message('请选择人员');
  1135. return
  1136. }
  1137. for(var i in this.acquireRoleList) {
  1138. if(this.acquireRoleList[i].isDefault == 1) {
  1139. this.xiuRoleId = this.acquireRoleList[i].id
  1140. }
  1141. }
  1142. this.handljues = true
  1143. // console.log('触发了')
  1144. },
  1145. handTrue() {
  1146. var arr = []
  1147. for(var i in this.handleSelectionZzjgDate) {
  1148. arr.push(this.handleSelectionZzjgDate[i].id)
  1149. }
  1150. this.http.post('/user/batchUpdateRole', {
  1151. userIds: JSON.stringify(arr),
  1152. roleId: this.xiuRoleId
  1153. },
  1154. res => {
  1155. if (res.code == "ok") {
  1156. this.$message({
  1157. message: '操作成功',
  1158. type: "success"
  1159. });
  1160. this.handljues = false
  1161. this.getUser()
  1162. } else {
  1163. this.$message({
  1164. message: res.msg,
  1165. type: "error"
  1166. });
  1167. }
  1168. },
  1169. error => {
  1170. this.$message({
  1171. message: error,
  1172. type: "error"
  1173. });
  1174. });
  1175. },
  1176. deleteUser(targetUser) {
  1177. this.$confirm("确定要删除该员工吗?", "提示", {
  1178. //type: 'warning'
  1179. }).then(() => {
  1180. this.http.post('/user/deleteUser', {
  1181. userId: targetUser.id,
  1182. },
  1183. res => {
  1184. if (res.code == "ok") {
  1185. this.$message({
  1186. message: '删除成功',
  1187. type: "success"
  1188. });
  1189. this.getUser()
  1190. } else {
  1191. this.$message({
  1192. message: res.msg,
  1193. type: "error"
  1194. });
  1195. }
  1196. },
  1197. error => {
  1198. this.$message({
  1199. message: error,
  1200. type: "error"
  1201. });
  1202. });
  1203. })
  1204. },
  1205. chufa(data, b, c, e) {
  1206. if(this.depData == null || data.id != this.depData.id) {
  1207. // this.depData = data.id
  1208. this.depData = data;
  1209. this.page = 1;
  1210. this.getUser();
  1211. }
  1212. },
  1213. jieDian(a, b, c) {
  1214. var ids = a.id
  1215. var arrs = this.jDarr
  1216. arrs.push(ids)
  1217. this.jDarr = arrs
  1218. },
  1219. shutDown(a, b, c) {
  1220. var ids = a.id
  1221. var arrs = []
  1222. for (var i in this.jDarr) {
  1223. if(this.jDarr[i] != ids) {
  1224. arrs.push(this.jDarr[i])
  1225. }
  1226. }
  1227. this.jDarr = arrs
  1228. },
  1229. mouseleave(data,$event){
  1230. $event.currentTarget.firstElementChild.nextElementSibling.setAttribute('class','node none poAub')
  1231. },
  1232. mouseover(data,$event){
  1233. $event.currentTarget.lastChild.setAttribute('class','node block poAub');
  1234. },
  1235. confirmDeactive() {
  1236. this.http.post('/user/deactiveUser', {
  1237. id: this.deactiveUser.id,
  1238. inactiveDate: this.deactiveDate
  1239. },
  1240. res => {
  1241. if (res.code == "ok") {
  1242. this.deactiveDialog = false;
  1243. this.$message({
  1244. message: '停用成功',
  1245. type: "success"
  1246. });
  1247. // this.getUsers();
  1248. this.getUser()
  1249. } else {
  1250. this.$message({
  1251. message: res.msg,
  1252. type: "error"
  1253. });
  1254. }
  1255. },
  1256. error => {
  1257. this.$message({
  1258. message: error,
  1259. type: "error"
  1260. });
  1261. });
  1262. },
  1263. showDeactiveDialog(item) {
  1264. this.deactiveDialog = true;
  1265. this.deactiveUser = item;
  1266. },
  1267. restrictNumber(targetId) {
  1268. let inpu = document.getElementById(targetId);
  1269. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1270. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1271. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1272. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1273. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1274. inpu.value = parseFloat(inpu.value);
  1275. }
  1276. },
  1277. showConfirmDialog() {
  1278. if (this.toUserId == null || this.toUserId == '') {
  1279. this.$message({
  1280. message: '请选择要转让的人员',
  1281. type: "error"
  1282. });
  1283. return;
  1284. }
  1285. if (!this.myRoleId) {
  1286. this.$message({
  1287. message: '请选择转让后您自己的角色',
  1288. type: "error"
  1289. });
  1290. return;
  1291. }
  1292. this.$confirm("您将失去超级管理员角色,需要重新登录。确定要转让吗?", "提示", {
  1293. //type: 'warning'
  1294. }).then(() => {
  1295. this.http.post('/user/changeSysManager', {
  1296. toUserId: this.toUserId,
  1297. myRoleId: this.myRoleId
  1298. },
  1299. res => {
  1300. if (res.code == "ok") {
  1301. sessionStorage.removeItem("user");
  1302. this.$router.push("/login");
  1303. } else {
  1304. this.$message({
  1305. message: res.msg,
  1306. type: "error"
  1307. });
  1308. }
  1309. },
  1310. error => {
  1311. this.$message({
  1312. message: error,
  1313. type: "error"
  1314. });
  1315. });
  1316. });
  1317. },
  1318. transferRole() {
  1319. this.transferDialog = true;
  1320. this.http.post(this.port.manage.list, {
  1321. departmentId: -1,
  1322. pageIndex: 1,
  1323. pageSize: 99999
  1324. },
  1325. res => {
  1326. if (res.code == "ok") {
  1327. this.allActiveUsers = res.data.records.filter(u=>u.isActive == 1 && u.id != this.user.id);
  1328. } else {
  1329. this.$message({
  1330. message: res.msg,
  1331. type: "error"
  1332. });
  1333. }
  1334. },
  1335. error => {
  1336. this.$message({
  1337. message: error,
  1338. type: "error"
  1339. });
  1340. });
  1341. },
  1342. showExportDialog() {
  1343. this.exportDialogVisible = true;
  1344. },
  1345. exportUsers() {
  1346. this.http.post('/user/exportUsers', {
  1347. containInvalid: this.containInvalid
  1348. },
  1349. res => {
  1350. if (res.code == "ok") {
  1351. this.exportDialogVisible = false;
  1352. var aTag = document.createElement('a');
  1353. aTag.download = "全部员工列表.xls";
  1354. aTag.href = res.data;
  1355. aTag.click();
  1356. } else {
  1357. this.$message({
  1358. message: res.msg,
  1359. type: "error"
  1360. });
  1361. }
  1362. },
  1363. error => {
  1364. this.$message({
  1365. message: error,
  1366. type: "error"
  1367. });
  1368. });
  1369. },
  1370. showSalaryList(item) {
  1371. this.userSalaryListDialog = true;
  1372. this.userSalaryList = [];
  1373. this.http.post('/user/getUserSalaryList', {
  1374. id: item.id
  1375. },
  1376. res => {
  1377. if (res.code == "ok") {
  1378. this.userSalaryList = res.data;
  1379. } else {
  1380. this.$message({
  1381. message: res.msg,
  1382. type: "error"
  1383. });
  1384. }
  1385. },
  1386. error => {
  1387. this.$message({
  1388. message: error,
  1389. type: "error"
  1390. });
  1391. });
  1392. },
  1393. getUsers() {
  1394. this.http.post(this.port.manage.list, {
  1395. departmentId: -1,
  1396. pageIndex: 1,
  1397. pageSize: 99999,
  1398. keyword: this.keyword
  1399. },
  1400. res => {
  1401. if (res.code == "ok") {
  1402. this.users = res.data.records;
  1403. } else {
  1404. this.$message({
  1405. message: res.msg,
  1406. type: "error"
  1407. });
  1408. }
  1409. },
  1410. error => {
  1411. this.$message({
  1412. message: error,
  1413. type: "error"
  1414. });
  1415. });
  1416. },
  1417. onSalaryTypeChange(value) {
  1418. if (value == 1) {
  1419. this.insertForm.monthCost = null;
  1420. }
  1421. },
  1422. //选中部门
  1423. choseDept(value) {
  1424. // console.log(value);
  1425. },
  1426. //月成本输入变化
  1427. oninput(e) {
  1428. this.insertForm.cost = (this.insertForm.monthCost/this.timeType.monthDays/this.timeType.allday).toFixed(2);
  1429. },
  1430. // 获取本公司的工作时间设置
  1431. getCompanyTimeSetting() {
  1432. this.http.post('/time-type/getCompanyTimeSetting',{
  1433. companyId: this.user.companyId
  1434. },
  1435. res => {
  1436. if (res.code == "ok") {
  1437. this.timeType = res.data;
  1438. } else {
  1439. this.$message({
  1440. message: res.msg,
  1441. type: "error"
  1442. });
  1443. }
  1444. },
  1445. error => {
  1446. this.listLoading = false;
  1447. this.$message({
  1448. message: error,
  1449. type: "error"
  1450. });
  1451. }
  1452. );
  1453. },
  1454. importUserC(){
  1455. this.importDialog = true
  1456. },
  1457. // 批量导入人员
  1458. importUser(item) {
  1459. //首先判断文件类型
  1460. let str = item.file.name.split(".");
  1461. let format = str[str.length - 1];
  1462. if (format != "xls" && format != "xlsx") {
  1463. this.$message({
  1464. message: "请选择.xls或.xlsx文件",
  1465. type: "error"
  1466. });
  1467. } else {
  1468. this.listLoading = true;
  1469. let formData = new FormData();
  1470. formData.append("file", item.file);
  1471. this.importingData = true
  1472. this.http.uploadFile( this.port.manage.import, formData,
  1473. res => {
  1474. this.importingData = false
  1475. this.$refs.upload.clearFiles();
  1476. this.listLoading = false;
  1477. if (res.code == "ok") {
  1478. this.$message({
  1479. message: "导入成功",
  1480. type: "success"
  1481. });
  1482. //重新读取列表
  1483. this.getUser();
  1484. } else {
  1485. this.$message({
  1486. message: res.msg,
  1487. type: "error"
  1488. });
  1489. }
  1490. },
  1491. error => {
  1492. this.importingData = false
  1493. this.$refs.upload.clearFiles();
  1494. this.listLoading = false;
  1495. this.$message({
  1496. message: error,
  1497. type: "error"
  1498. });
  1499. });
  1500. }
  1501. },
  1502. //分页
  1503. handleCurrentChange(val) {
  1504. this.page = val;
  1505. this.getUser();
  1506. },
  1507. handleSizeChange(val) {
  1508. this.size = val;
  1509. this.getUser();
  1510. },
  1511. //获取所有员工的列表
  1512. getUser() {
  1513. // console.log(12345)
  1514. this.listLoading = true;
  1515. this.http.post( this.port.manage.list, {
  1516. departmentId: this.depData.id,
  1517. pageIndex: this.page,
  1518. pageSize: this.size,
  1519. keyword: this.keyword,
  1520. status: this.status,
  1521. // role: this.role
  1522. roleId: this.roleId
  1523. },
  1524. res => {
  1525. this.listLoading = false;
  1526. if (res.code == "ok") {
  1527. this.list = res.data.records;
  1528. this.total = res.data.total;
  1529. } else {
  1530. this.$message({
  1531. message: res.msg,
  1532. type: "error"
  1533. });
  1534. }
  1535. },
  1536. error => {
  1537. this.listLoading = false;
  1538. this.$message({
  1539. message: error,
  1540. type: "error"
  1541. });
  1542. });
  1543. },
  1544. resetPwd(user) {
  1545. this.$confirm( "确定要为" + user.name + "重置密码吗?", "重置密码", {
  1546. confirmButtonText: "确定",
  1547. cancelButtonText: "取消",
  1548. type: "warning"
  1549. })
  1550. .then(() => {
  1551. this.http.post('/user/resetPwd', { userId: user.id },
  1552. res => {
  1553. if (res.code == "ok") {
  1554. this.$message({
  1555. message: "密码已重置为000000,请通知员工及时修改",
  1556. type: "success"
  1557. });
  1558. } else {
  1559. this.$message({
  1560. message: res.msg,
  1561. type: "error"
  1562. });
  1563. }
  1564. },
  1565. error => {
  1566. this.listLoading = false;
  1567. this.$message({
  1568. message: error,
  1569. type: "error"
  1570. });
  1571. });
  1572. })
  1573. .catch(() => {});
  1574. },
  1575. // 新增、编辑人员
  1576. openInsertDialog(row) {
  1577. if (row != null) {
  1578. var list = JSON.parse(JSON.stringify(row)) , arr = [] , array = [];
  1579. if(list.departmentCascade!='0' && list.departmentCascade!=null) {
  1580. if(list.departmentCascade.indexOf(",")>-1) {
  1581. arr = list.departmentCascade.split(",");
  1582. } else {
  1583. arr = [].concat(list.departmentCascade)
  1584. }
  1585. }
  1586. for(var i in arr) {
  1587. array.push(parseInt(arr[i]))
  1588. }
  1589. // console.log(list, '数据')
  1590. // this.insertForm = {
  1591. // id: list.id,
  1592. // name: list.name,
  1593. // phone: list.phone,
  1594. // // role: list.role,
  1595. // roleId: list.roleId,
  1596. // monthCost:list.monthCost,
  1597. // cost: list.cost,
  1598. // departmentId: array.reverse(),
  1599. // salaryType: list.salaryType,
  1600. // costApplyDate: list.costApplyDate,
  1601. // position: list.position
  1602. // };
  1603. this.addUserId = list.id
  1604. this.http.post('/user/getUserInfo', {
  1605. userId: list.id
  1606. },
  1607. res => {
  1608. if (res.code == "ok") {
  1609. this.insertForm = {
  1610. id: res.data.id,
  1611. name: res.data.name,
  1612. phone: res.data.phone,
  1613. roleId: res.data.roleId,
  1614. monthCost:res.data.monthCost,
  1615. cost: res.data.cost,
  1616. departmentId: array.reverse(),
  1617. salaryType: res.data.salaryType,
  1618. costApplyDate: res.data.costApplyDate,
  1619. inductionDate: res.data.inductionDate,
  1620. position: res.data.position,
  1621. certJson: res.data.certList,
  1622. plateMap: {},
  1623. superiorId: res.data.superiorId,
  1624. plate1: res.data.plate1,
  1625. plate2: res.data.plate2,
  1626. plate3: res.data.plate3,
  1627. plate4: res.data.plate4,
  1628. plate5: res.data.plate5,
  1629. };
  1630. this.getUserCustomConfig(1)
  1631. } else {
  1632. this.$message({
  1633. message: res.msg,
  1634. type: "error"
  1635. });
  1636. }
  1637. },
  1638. error => {
  1639. this.listLoading = false;
  1640. this.$message({
  1641. message: error,
  1642. type: "error"
  1643. });
  1644. });
  1645. this.title = "编辑人员"
  1646. } else {
  1647. this.addUserId = ''
  1648. this.insertForm = {
  1649. id: null,
  1650. name: null,
  1651. phone: null,
  1652. // role: null,
  1653. roleId: null,
  1654. monthCost:null,
  1655. cost: null,
  1656. departmentId: null,
  1657. salaryType:0,
  1658. costApplyDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
  1659. inductionDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
  1660. position: '',
  1661. certJson: [],
  1662. plateMap: {},
  1663. plate1: null,
  1664. plate2: null,
  1665. plate3: null,
  1666. plate4: null,
  1667. plate5: null,
  1668. };
  1669. this.title = "新增人员"
  1670. this.getUserCustomConfig()
  1671. // this.insertForm.plateMap['定义测试文本'] = '测试文本'
  1672. // console.log('insertForm',this.insertForm);
  1673. }
  1674. this.dialogVisible = true;
  1675. console.log(this.insertForm);
  1676. },
  1677. submitInsert() {
  1678. var form = {}
  1679. var ssR = this.upRepeat(this.insertForm.certJson)
  1680. var trs = true
  1681. this.$refs.form12.validate(valid => {
  1682. if (valid) {
  1683. this.submitLoading = true;
  1684. if(ssR) {
  1685. this.$message({
  1686. message: '重复证书',
  1687. type: 'error'
  1688. });
  1689. this.submitLoading = false;
  1690. return false
  1691. }
  1692. for(var s in this.insertForm.certJson) {
  1693. if(!this.insertForm.certJson[s].certDate || !this.insertForm.certJson[s].certId) {
  1694. trs = false
  1695. }
  1696. }
  1697. if(!trs) {
  1698. this.$message({
  1699. message: '证书未填写完整',
  1700. type: 'error'
  1701. });
  1702. this.submitLoading = false;
  1703. return false
  1704. }
  1705. form = {
  1706. name: this.insertForm.name,
  1707. phone: this.insertForm.phone,
  1708. // role: this.insertForm.role,
  1709. roleId: this.insertForm.roleId,
  1710. monthCost: this.insertForm.monthCost,
  1711. cost: this.insertForm.cost,
  1712. salaryType: this.insertForm.salaryType,
  1713. position: this.insertForm.position,
  1714. certJson: JSON.stringify(this.insertForm.certJson),
  1715. // certJson: this.insertForm.certJson
  1716. inductionDate: this.insertForm.inductionDate,
  1717. plate1: this.insertForm.plate1,
  1718. plate2: this.insertForm.plate2,
  1719. plate3: this.insertForm.plate3,
  1720. plate4: this.insertForm.plate4,
  1721. plate5: this.insertForm.plate5,
  1722. };
  1723. // for(let i=0;i<5;i++) {
  1724. // if(this.insertFormPlates[i]){
  1725. // form[this.suoying[i]] = this.insertFormPlates[i]
  1726. // }
  1727. // }
  1728. // console.log(form, 'form')
  1729. if (this.insertForm.id != null) {
  1730. form.id = this.insertForm.id;
  1731. }
  1732. if (this.insertForm.superiorId){
  1733. form.superiorId = this.insertForm.superiorId
  1734. }
  1735. if (this.insertForm.costApplyDate != null) {
  1736. form.costApplyDate = this.insertForm.costApplyDate;
  1737. }
  1738. if (this.insertForm.departmentId != null) {
  1739. form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
  1740. }
  1741. if(!ssR && trs) {
  1742. this.http.post( this.port.manage.insert, form,
  1743. res => {
  1744. this.submitLoading = false;
  1745. if (res.code == "ok") {
  1746. this.$message({
  1747. message: this.insertForm.id != null ? "修改" : "创建" + "成功",
  1748. type: "success"
  1749. });
  1750. this.dialogVisible = false;
  1751. this.getUser();
  1752. this.getUsers()
  1753. } else {
  1754. this.$message({
  1755. message: res.msg,
  1756. type: "error"
  1757. });
  1758. }
  1759. },
  1760. error => {
  1761. this.listLoading = false;
  1762. this.$message({
  1763. message: error,
  1764. type: "error"
  1765. });
  1766. });
  1767. }
  1768. }
  1769. });
  1770. // console.log(form, '提交的数据')
  1771. // return
  1772. // console.log(ssR, trs)
  1773. },
  1774. // 切换角色
  1775. switchRole(index) {
  1776. this.listLoading = true;
  1777. this.http.post( this.port.manage.permission, { id: this.list[index].id },
  1778. res => {
  1779. this.listLoading = false;
  1780. if (res.code == "ok") {
  1781. this.$message({
  1782. message: "切换角色成功",
  1783. type: "success"
  1784. });
  1785. //重新读取列表
  1786. this.getUser();
  1787. } else {
  1788. this.$message({
  1789. message: res.msg,
  1790. type: "error"
  1791. });
  1792. }
  1793. },
  1794. error => {
  1795. this.listLoading = false;
  1796. this.$message({
  1797. message: error,
  1798. type: "error"
  1799. });
  1800. });
  1801. },
  1802. // 删除用户
  1803. setActive(item, isActive) {
  1804. var txt = isActive==1?"启用":"停用";
  1805. this.$confirm( "确定要"+txt +" " + item.name + " 吗?", "账号"+txt, {
  1806. confirmButtonText: "确定",
  1807. cancelButtonText: "取消",
  1808. type: "warning"
  1809. })
  1810. .then(() => {
  1811. this.listLoading = true;
  1812. this.http.post('/user/setActive', { id: item.id, isActive: isActive},
  1813. res => {
  1814. this.listLoading = false;
  1815. if (res.code == "ok") {
  1816. this.$message({
  1817. message: txt+"成功",
  1818. type: "success"
  1819. });
  1820. //重新读取列表
  1821. this.getUser();
  1822. } else {
  1823. this.$message({
  1824. message: res.msg,
  1825. type: "error"
  1826. });
  1827. }
  1828. },
  1829. error => {
  1830. this.listLoading = false;
  1831. this.$message({
  1832. message: error,
  1833. type: "error"
  1834. });
  1835. });
  1836. })
  1837. .catch(() => {});
  1838. },
  1839. // 修改老板的成本
  1840. openInsertDialog1(row) {
  1841. var list1 = JSON.parse(JSON.stringify(row)) , arr1 = [] , array1 = [];
  1842. if(list1.departmentCascade!='0' && list1.departmentCascade!=null) {
  1843. if(list1.departmentCascade.indexOf(",")>-1) {
  1844. arr1 = list1.departmentCascade.split(",");
  1845. } else {
  1846. arr1 = [].concat(list1.departmentCascade)
  1847. }
  1848. }
  1849. for(var i in arr1) {
  1850. array1.push(parseInt(arr1[i]))
  1851. }
  1852. this.http.post('/user/getUserInfo', {
  1853. userId: list1.id
  1854. },
  1855. res => {
  1856. if (res.code == "ok") {
  1857. this.insertForm = {
  1858. id: res.data.id,
  1859. name: res.data.name,
  1860. phone: res.data.phone,
  1861. roleId: res.data.roleId,
  1862. monthCost:res.data.monthCost,
  1863. cost: res.data.cost,
  1864. departmentId: array1.reverse(),
  1865. salaryType: res.data.salaryType,
  1866. costApplyDate: res.data.costApplyDate,
  1867. inductionDate: res.data.inductionDate,
  1868. position: res.data.position,
  1869. certJson: res.data.certList,
  1870. plateMap: {},
  1871. superiorId: res.data.superiorId,
  1872. }
  1873. } else {
  1874. this.$message({
  1875. message: res.msg,
  1876. type: "error"
  1877. });
  1878. }},
  1879. error => {
  1880. this.listLoading = false;
  1881. this.$message({
  1882. message: error,
  1883. type: "error"
  1884. });
  1885. });
  1886. // console.log(list1)
  1887. // this.insertForm = {
  1888. // id: list1.id,
  1889. // name: list1.name,
  1890. // phone: list1.phone,
  1891. // roleId: list1.roleId,
  1892. // monthCost:list1.monthCost,
  1893. // cost: list1.cost,
  1894. // departmentId: array1.reverse(),
  1895. // salaryType: list1.salaryType,
  1896. // name: list1.name,
  1897. // position: list1.position,
  1898. // certJson: list1.certJson
  1899. // };
  1900. this.dialogVisible1 = true;
  1901. },
  1902. submitInsert1() {
  1903. var form = {}
  1904. this.$refs.form1.validate(valid => {
  1905. if (valid) {
  1906. this.submitLoading = true;
  1907. form = {
  1908. id: this.insertForm.id,
  1909. name: this.insertForm.name,
  1910. phone: this.insertForm.phone,
  1911. roleId: this.insertForm.roleId,
  1912. monthCost: this.insertForm.monthCost,
  1913. cost: this.insertForm.cost,
  1914. position: this.insertForm.position,
  1915. certJson: this.insertForm.certJson,
  1916. inductionDate: this.insertForm.inductionDate
  1917. };
  1918. if (this.insertForm.departmentId != null) {
  1919. form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
  1920. }
  1921. if (this.insertForm.costApplyDate != null) {
  1922. form.costApplyDate = this.insertForm.costApplyDate;
  1923. }
  1924. if (this.insertForm.superiorId){
  1925. form.superiorId = this.insertForm.superiorId
  1926. }
  1927. this.http.post( this.port.manage.insert, form,
  1928. res => {
  1929. this.submitLoading = false;
  1930. if (res.code == "ok") {
  1931. this.$message({
  1932. message: "修改成功",
  1933. type: "success"
  1934. });
  1935. this.dialogVisible1 = false;
  1936. //重新读取列表
  1937. this.getUser();
  1938. this.getUsers()
  1939. } else {
  1940. this.$message({
  1941. message: res.msg,
  1942. type: "error"
  1943. });
  1944. }
  1945. },
  1946. error => {
  1947. this.listLoading = false;
  1948. this.$message({
  1949. message: error,
  1950. type: "error"
  1951. });
  1952. });
  1953. }
  1954. });
  1955. },
  1956. // 获取部门列表
  1957. getDepartment() {
  1958. this.http.post( this.port.manage.depList, {},
  1959. res => {
  1960. if (res.code == "ok") {
  1961. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1962. list.splice(0,0,{
  1963. id: -1,
  1964. label: '全部人员',
  1965. })
  1966. list.push({
  1967. id: 0,
  1968. label: '未分配',
  1969. })
  1970. this.data = list;
  1971. // console.log(list, "部门数据")
  1972. this.option = this.changeArr(list1);
  1973. } else {
  1974. this.$message({
  1975. message: res.msg,
  1976. type: "error"
  1977. });
  1978. }
  1979. },
  1980. error => {
  1981. this.$message({
  1982. message: error,
  1983. type: "error"
  1984. });
  1985. });
  1986. },
  1987. // 修改数组
  1988. changeArr(arr) {
  1989. for (var i = 0; i < arr.length; i++) {
  1990. if(arr[i].id != -1 && arr[i].id != 0) {
  1991. if (arr[i].children != null && arr[i].children.length>0) {
  1992. arr[i].children = this.changeArr(arr[i].children);
  1993. }
  1994. arr[i].id && (arr[i].value = arr[i].id);
  1995. delete arr[i].id;
  1996. }
  1997. }
  1998. for(var i in arr) {
  1999. if(arr[i].id == -1 || arr[i].id == 0) {
  2000. arr.splice(i,1)
  2001. }
  2002. }
  2003. return arr;
  2004. },
  2005. // 部门列表点击
  2006. handleNodeClick(data) {
  2007. // console.log(data, 999)
  2008. if(this.depData == null || data.id != this.depData.id) {
  2009. this.depData = data;
  2010. this.page = 1;
  2011. this.getUser();
  2012. }
  2013. },
  2014. // 新增、修改部门
  2015. createDepartment(i) {
  2016. setTimeout(() => {
  2017. var that = this
  2018. if(i == -2) {//创建子部门
  2019. that.depForm = {
  2020. id: null,
  2021. name: null,
  2022. parentId: null,
  2023. managerId: null,
  2024. }
  2025. if(that.depData.id != -1 && that.depData.id != 0) {
  2026. that.depForm.parentId = that.depData.id;
  2027. }
  2028. that.depTitle = "新增子部门";
  2029. } else if(i == -1) {//创建一级部门
  2030. that.depForm = {
  2031. id: null,
  2032. name: null,
  2033. parentId: null,
  2034. managerId: null,
  2035. }
  2036. that.depTitle = "新增部门";
  2037. } else {
  2038. if(that.depData.managerId == "null") {
  2039. that.depData.managerId = ''
  2040. }
  2041. if(that.depData.reportAuditUserid == "null") {
  2042. that.depData.reportAuditUserid = ''
  2043. }
  2044. that.depForm = {
  2045. id: that.depData.id,
  2046. name: that.depData.label,
  2047. parentId: that.depData.parentId,
  2048. managerId: that.depData.managerId,
  2049. reportAuditUserid: that.depData.reportAuditUserid
  2050. }
  2051. // if(that.depData.reportAuditUserid != null && that.depData.reportAuditUserid != "null" && that.depData.reportAuditUserid.length > 0) {
  2052. // that.depForm.reportAuditUserid = that.depData.reportAuditUserid
  2053. // }
  2054. that.depTitle = "编辑部门";
  2055. }
  2056. that.departmentVisible = true;
  2057. })
  2058. // if(i == -2) {//创建子部门
  2059. // this.depForm = {
  2060. // id: null,
  2061. // name: null,
  2062. // parentId: null,
  2063. // managerId: null,
  2064. // }
  2065. // if(this.depData.id != -1 && this.depData.id != 0) {
  2066. // this.depForm.parentId = this.depData.id;
  2067. // }
  2068. // this.depTitle = "新增子部门";
  2069. // } else if(i == -1) {//创建一级部门
  2070. // this.depForm = {
  2071. // id: null,
  2072. // name: null,
  2073. // parentId: null,
  2074. // managerId: null,
  2075. // }
  2076. // this.depTitle = "新增部门";
  2077. // } else {
  2078. // if(this.depData.managerId == "null") {
  2079. // this.depData.managerId = ''
  2080. // }
  2081. // if(this.depData.reportAuditUserid == "null") {
  2082. // this.depData.reportAuditUserid = ''
  2083. // }
  2084. // this.depForm = {
  2085. // id: this.depData.id,
  2086. // name: this.depData.label,
  2087. // parentId: this.depData.parentId,
  2088. // managerId: this.depData.managerId,
  2089. // reportAuditUserid: this.depData.reportAuditUserid
  2090. // }
  2091. // // if(this.depData.reportAuditUserid != null && this.depData.reportAuditUserid != "null" && this.depData.reportAuditUserid.length > 0) {
  2092. // // this.depForm.reportAuditUserid = this.depData.reportAuditUserid
  2093. // // }
  2094. // this.depTitle = "编辑部门";
  2095. // }
  2096. // this.departmentVisible = true;
  2097. },
  2098. submitDepartment() {
  2099. this.$refs.depForm.validate(valid => {
  2100. if (valid) {
  2101. var form = {
  2102. name: this.depForm.name,
  2103. };
  2104. if(this.depForm.id != null) {
  2105. form.id = this.depForm.id
  2106. }
  2107. if(this.depForm.parentId != null) {
  2108. form.parentId = this.depForm.parentId
  2109. }
  2110. if (this.depForm.managerId) {
  2111. form.managerId = this.depForm.managerId
  2112. }
  2113. // console.log(this.depForm)
  2114. if (this.depForm.reportAuditUserid) {
  2115. form.reportAuditUserid = this.depForm.reportAuditUserid
  2116. }
  2117. this.http.post( this.depForm.id==null?this.port.manage.add:this.port.manage.edit, form,
  2118. res => {
  2119. if (res.code == "ok") {
  2120. this.$message({
  2121. message: this.depForm.id==null?"新增成功":"修改成功",
  2122. type: "success"
  2123. });
  2124. this.departmentVisible = false;
  2125. if (this.depForm.id !=null) {
  2126. this.depData.label = form.name;
  2127. this.depData.managerId = form.managerId;
  2128. }
  2129. this.getDepartment();
  2130. } else {
  2131. this.$message({
  2132. message: res.msg,
  2133. type: "error"
  2134. });
  2135. }
  2136. },
  2137. error => {
  2138. this.listLoading = false;
  2139. this.$message({
  2140. message: error,
  2141. type: "error"
  2142. });
  2143. });
  2144. }
  2145. });
  2146. },
  2147. // 删除部门
  2148. deleteDep() {
  2149. var that = this
  2150. setTimeout(() =>{
  2151. that.$confirm( "确定要删除部门" + that.depData.label + "吗?", "删除部门", {
  2152. confirmButtonText: "确定",
  2153. cancelButtonText: "取消",
  2154. type: "warning"
  2155. })
  2156. .then(() => {
  2157. that.listLoading = true;
  2158. that.http.post( that.port.manage.del, { id: that.depData.id },
  2159. res => {
  2160. that.listLoading = false;
  2161. if (res.code == "ok") {
  2162. that.$message({
  2163. message: "删除成功",
  2164. type: "success"
  2165. });
  2166. that.depData = {
  2167. id: -1,
  2168. label: '全部人员',
  2169. }
  2170. that.getDepartment();
  2171. that.getUser();
  2172. } else {
  2173. that.$message({
  2174. message: res.msg,
  2175. type: "error"
  2176. });
  2177. }
  2178. },
  2179. error => {
  2180. that.listLoading = false;
  2181. that.$message({
  2182. message: error,
  2183. type: "error"
  2184. });
  2185. });
  2186. })
  2187. .catch(() => {});
  2188. },100);
  2189. // this.$confirm( "确定要删除部门" + this.depData.label + "吗?", "删除部门", {
  2190. // confirmButtonText: "确定",
  2191. // cancelButtonText: "取消",
  2192. // type: "warning"
  2193. // })
  2194. // .then(() => {
  2195. // this.listLoading = true;
  2196. // this.http.post( this.port.manage.del, { id: this.depData.id },
  2197. // res => {
  2198. // this.listLoading = false;
  2199. // if (res.code == "ok") {
  2200. // this.$message({
  2201. // message: "删除成功",
  2202. // type: "success"
  2203. // });
  2204. // this.depData = {
  2205. // id: -1,
  2206. // label: '全部人员',
  2207. // }
  2208. // this.getDepartment();
  2209. // this.getUser();
  2210. // } else {
  2211. // this.$message({
  2212. // message: res.msg,
  2213. // type: "error"
  2214. // });
  2215. // }
  2216. // },
  2217. // error => {
  2218. // this.listLoading = false;
  2219. // this.$message({
  2220. // message: error,
  2221. // type: "error"
  2222. // });
  2223. // });
  2224. // })
  2225. // .catch(() => {});
  2226. },
  2227. // 关键搜索
  2228. searchList() {
  2229. // console.log(this.keyword)
  2230. this.listLoading = true;
  2231. this.http.post( this.port.manage.list, {
  2232. departmentId: this.depData.id,
  2233. pageIndex: this.page,
  2234. pageSize: this.size,
  2235. keyword: this.keyword
  2236. },
  2237. res => {
  2238. this.listLoading = false;
  2239. if (res.code == "ok") {
  2240. this.list = res.data.records;
  2241. this.total = res.data.total;
  2242. } else {
  2243. this.$message({
  2244. message: res.msg,
  2245. type: "error"
  2246. });
  2247. }
  2248. },
  2249. error => {
  2250. this.listLoading = false;
  2251. this.$message({
  2252. message: error,
  2253. type: "error"
  2254. });
  2255. });
  2256. },
  2257. // 获取角色
  2258. acquireRole() {
  2259. // this.http.post('/permission/getFrontRoleList', {
  2260. this.http.post('/permission/getFrontRoleList', {
  2261. companyId: this.user.companyId
  2262. },
  2263. res => {
  2264. if (res.code == "ok") {
  2265. // console.log(res.data, '获取角色')
  2266. this.acquireRoleList = res.data
  2267. var arr = []
  2268. for(var i in res.data) {
  2269. if(res.data[i].rolename != '系统管理员') {
  2270. arr.push(res.data[i])
  2271. }
  2272. }
  2273. this.acquireRoleLists = arr
  2274. } else {
  2275. this.$message({
  2276. message: res.msg,
  2277. type: "error"
  2278. });
  2279. }
  2280. },
  2281. error => {
  2282. this.$message({
  2283. message: error,
  2284. type: "error"
  2285. });
  2286. });
  2287. },
  2288. // 获取专业分类
  2289. getProfessional() {
  2290. this.http.post('/company-cert/list', {},
  2291. res => {
  2292. if (res.code == "ok") {
  2293. this.managementTableData = res.data
  2294. } else {
  2295. this.$message({
  2296. message: res.msg,
  2297. type: "error"
  2298. });
  2299. }
  2300. },
  2301. error => {
  2302. this.$message({
  2303. message: error,
  2304. type: "error"
  2305. });
  2306. });
  2307. },
  2308. addManagementDiologs() {
  2309. this.managementForm = {name: ''}
  2310. this.addManagementDiolog = true
  2311. },
  2312. // 新增/编辑人员专业费雷
  2313. addManagementForm(formName) {
  2314. this.$refs[formName].validate((valid) => {
  2315. if (valid) {
  2316. this.http.post('/company-cert/addOrMod', this.managementForm,
  2317. res => {
  2318. if (res.code == "ok") {
  2319. this.$message({
  2320. message: '操作成功',
  2321. type: "success"
  2322. });
  2323. this.getProfessional()
  2324. this.addManagementDiolog = false
  2325. } else {
  2326. this.$message({
  2327. message: res.msg,
  2328. type: "error"
  2329. });
  2330. }
  2331. },
  2332. error => {
  2333. this.$message({
  2334. message: error,
  2335. type: "error"
  2336. });
  2337. });
  2338. } else {
  2339. // console.log('error submit!!');
  2340. return false;
  2341. }
  2342. });
  2343. },
  2344. // 编辑
  2345. editorManagementForm(item) {
  2346. this.managementForm = item
  2347. this.addManagementDiolog = true
  2348. },
  2349. // 删除专业
  2350. deteManagementForm(item) {
  2351. this.$confirm('该操作可能造成已有数据丢失,确定要删除吗?', '删除专业证书', {
  2352. confirmButtonText: '确定',
  2353. cancelButtonText: '取消',
  2354. type: 'warning'
  2355. }).then(() => {
  2356. this.http.post('/company-cert/delete', {
  2357. id: item.id
  2358. },
  2359. res => {
  2360. if (res.code == "ok") {
  2361. this.$message({
  2362. message: '操作成功',
  2363. type: "success"
  2364. });
  2365. this.getProfessional()
  2366. } else {
  2367. this.$message({
  2368. message: res.msg,
  2369. type: "error"
  2370. });
  2371. }
  2372. },
  2373. error => {
  2374. this.$message({
  2375. message: error,
  2376. type: "error"
  2377. });
  2378. });
  2379. }).catch(() => {
  2380. this.$message({
  2381. type: 'info',
  2382. message: '已取消删除'
  2383. });
  2384. });
  2385. },
  2386. // 点击添加更多帧数
  2387. addCertificateList() {
  2388. var obj = {}
  2389. obj.certId = ''
  2390. obj.certName = ''
  2391. obj.certDate = ''
  2392. obj.id = ''
  2393. obj.userId = this.addUserId
  2394. this.insertForm.certJson.push(obj)
  2395. },
  2396. // 选择专业帧数
  2397. changeManagement(is) {
  2398. var id = this.insertForm.certJson[is].certId
  2399. for(var i in this.managementTableData) {
  2400. if(this.managementTableData[i].id == id) {
  2401. this.insertForm.certJson[is].certName = this.managementTableData[i].name
  2402. }
  2403. }
  2404. },
  2405. // 查重复
  2406. upRepeat(arr) {
  2407. var obj = {};
  2408. for(var i in arr) {
  2409. if(obj[arr[i].certName]) {
  2410. return true;
  2411. }
  2412. obj[arr[i].certName] = true;
  2413. }
  2414. return false;
  2415. },
  2416. // 删除帧数
  2417. deteFrames(i) {
  2418. this.insertForm.certJson.splice(i, 1)
  2419. }
  2420. },
  2421. created() {
  2422. let height = window.innerHeight;
  2423. this.tableHeight = height - 195;
  2424. const that = this;
  2425. window.onresize = function temp() {
  2426. that.tableHeight = window.innerHeight - 195;
  2427. };
  2428. },
  2429. mounted() {
  2430. this.deactiveDate = util.formatDate.format(new Date(), 'yyyy-MM-dd');
  2431. this.getDepartment();
  2432. this.getUser();
  2433. this.getCompanyTimeSetting();
  2434. this.getUsers();
  2435. this.acquireRole();
  2436. this.getProfessional()
  2437. }
  2438. };
  2439. </script>
  2440. <style lang="scss" scoped>
  2441. .imgFlex {
  2442. display: flex;
  2443. align-items: center;
  2444. }
  2445. .imgFlex p {
  2446. width: 100%;
  2447. text-align: center;
  2448. }
  2449. .imgFlex div {
  2450. padding: 10px;
  2451. display: flex;
  2452. align-content: space-between;
  2453. flex-wrap: wrap;
  2454. height: 600px;
  2455. }
  2456. .imgBor {
  2457. border-right: 1px solid #666;
  2458. border-left: 1px solid #666;
  2459. }
  2460. .custom-tree-node {
  2461. flex: 1;
  2462. display: flex;
  2463. align-items: center;
  2464. justify-content: space-between;
  2465. font-size: 14px;
  2466. padding-right: 8px;
  2467. }
  2468. .left {
  2469. border-right: 1px solid #f2f2f2;
  2470. overflow: hidden;
  2471. .department {
  2472. background:#f2f2f2;
  2473. line-height: 60px;
  2474. color:#666;
  2475. padding:0 10px;
  2476. height:60px;
  2477. font-size: 15px;
  2478. div {
  2479. float: right;
  2480. color: #20a0ff;
  2481. font-size: 14px;
  2482. cursor: pointer;
  2483. }
  2484. }
  2485. .tree {
  2486. overflow: auto;
  2487. }
  2488. }
  2489. .nowTime {
  2490. height: 40px;
  2491. line-height: 40px;
  2492. font-size: 16px;
  2493. color: #20a0ff;
  2494. margin-left: 10px;
  2495. cursor: pointer;
  2496. i {
  2497. margin-right: 10px;
  2498. }
  2499. }
  2500. .none {
  2501. display: none;
  2502. }
  2503. .block {
  2504. display: block;
  2505. }
  2506. </style>
  2507. <style lang="scss">
  2508. .tree {
  2509. .el-tree-node__label {
  2510. overflow-x: hidden;
  2511. white-space: nowrap;
  2512. text-overflow: ellipsis;
  2513. }
  2514. }
  2515. .el-divider--horizontal {
  2516. margin: 0px;
  2517. background:#f3f3f3;
  2518. }
  2519. //全局的作用范围
  2520. .el-tree-node__content {
  2521. height:36px;
  2522. }
  2523. .zhaunye {
  2524. display: flex;
  2525. justify-content: space-between;
  2526. padding: 0 5px 0 10px;
  2527. }
  2528. .certificateList {
  2529. width: 98%;
  2530. box-sizing: border-box;
  2531. margin: 0 10px 0 10px;
  2532. border: 1px solid rgb(194, 194, 194);
  2533. min-height: 200px;
  2534. max-height: 200px;
  2535. overflow: auto;
  2536. padding: 10px;
  2537. }
  2538. .moreAl {
  2539. display: flex;
  2540. width: 100%;
  2541. justify-content: center;
  2542. }
  2543. .moreLiList {
  2544. display: flex;
  2545. margin-bottom: 10px;
  2546. }
  2547. .moreLiList div {
  2548. line-height: 30px;
  2549. }
  2550. .moreLiList span {
  2551. display: inline-block;
  2552. margin-right: 15px;
  2553. }
  2554. .poAub {
  2555. position: absolute;
  2556. right: 10px;
  2557. }
  2558. </style>