index.vue 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043
  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" slot-scope="{ node }" @mouseleave= mouseleave(data,$event) @mouseover= mouseover(data,$event)>
  16. <span style="width: 100%;line-height: 36px; display: inline-block;">{{ node.label }}</span>
  17. <span v-if="node.label != '全部人员'" class="node none">
  18. <el-button type="text" size="mini" @click="createDepartment(-2)" >
  19. <i class="el-icon-circle-plus-outline"></i> <!-- 新增 -->
  20. </el-button>
  21. <el-button type="text" size="mini" @click="deleteDep(null)">
  22. <i class="el-icon-delete"></i> <!-- 删除 -->
  23. </el-button>
  24. </span>
  25. </span>
  26. </el-tree>
  27. </div>
  28. </el-col>
  29. <el-col :span="20" class="right">
  30. <!--工具条-->
  31. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  32. <el-form :inline="true">
  33. <!-- <div style="width: 300px;display: inline-block;">
  34. <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
  35. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  36. </el-input>
  37. </div> -->
  38. <el-form-item>
  39. <div v-if="depData == null || depData.id == -1" class="nowTime" style="cursor:unset">
  40. <i class="fa fa-home"></i>全部人员
  41. </div>
  42. <div v-else-if="depData.id == 0" class="nowTime" style="cursor:unset">
  43. <i class="fa fa-home"></i>未分配
  44. </div>
  45. <div v-else-if="depData != null && depData.id != -1 && depData.id != 0" class="nowTime" @click="createDepartment(0)">
  46. <i class="fa fa-pencil-square-o"></i>
  47. {{depData!=null?depData.label:''}}
  48. </div>
  49. </el-form-item>
  50. <el-form-item>
  51. <div style="color:#999;font-size:13px;">共{{total}}人</div>
  52. </el-form-item>
  53. <el-form-item style="float:right;" v-if="permissions.structureExport">
  54. <el-link type="primary" :underline="false" @click="showExportDialog">导出人员</el-link>
  55. </el-form-item>
  56. <el-form-item style="float:right;" v-if="!isDingShow && permissions.structureAdd">
  57. <el-link type="primary" :underline="false" @click="openInsertDialog(null)">添加人员</el-link>
  58. </el-form-item>
  59. <!-- 原来的 -->
  60. <!-- <el-form-item style="float:right;" v-if="depData != null && depData.id != -1 && depData.id != 0">
  61. <el-upload ref="upload" action="#" :limit="1" :http-request="importUser" :show-file-list="false">
  62. <el-link type="primary" :underline="false">批量导入</el-link>
  63. </el-upload>
  64. </el-form-item> -->
  65. <el-form-item style="float:right;" v-if="!isDingShow && permissions.structureImport">
  66. <el-upload ref="upload" action="#" :limit="1" :http-request="importUser" :show-file-list="false">
  67. <el-link type="primary" :underline="false">批量导入</el-link>
  68. </el-upload>
  69. </el-form-item>
  70. <el-form-item style="float:right;" v-if="!isDingShow && permissions.structureImport">
  71. <el-link type="primary" :underline="false" href="./upload/人员导入模板.xlsx" download="人员导入模板.xlsx">模板下载</el-link>
  72. </el-form-item>
  73. <!-- <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;">
  74. </el-form-item> -->
  75. <!-- <el-form-item style="float:right;">
  76. <el-link type="danger" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="deleteDep(null)">删除部门</el-link>
  77. </el-form-item>
  78. <el-form-item style="float:right;">
  79. <el-link type="primary" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="createDepartment(-2)">新增子部门</el-link>
  80. </el-form-item> -->
  81. <el-form-item style="float:right;">
  82. <span style="color: #666666">角色</span>
  83. <el-select v-model="roleId" placeholder="请选择" @change="getUser()" style="width: 120px" clearable>
  84. <!-- <el-option
  85. v-for="item in rolesa"
  86. :key="item.value"
  87. :label="item.label"
  88. :value="item.value">
  89. </el-option> -->
  90. <el-option v-for="item in acquireRoleList" :key="item.id" :label="item.rolename" :value="item.id"></el-option>
  91. </el-select>
  92. </el-form-item>
  93. <el-form-item style="float:right;">
  94. <span style="color: #666666">状态</span>
  95. <el-select v-model="status" placeholder="请选择" @change="getUser()" style="width: 120px">
  96. <el-option
  97. v-for="item in states"
  98. :key="item.value"
  99. :label="item.label"
  100. :value="item.value">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item style="float:right;">
  105. <div style="width: 250px;display: inline-block;">
  106. <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
  107. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  108. </el-input>
  109. </div>
  110. </el-form-item>
  111. </el-form>
  112. </el-col>
  113. <!--列表-->
  114. <el-table ref="handleSelectTable" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="handleSelectionZzjg">
  115. <el-table-column type="selection" width="50"></el-table-column>
  116. <el-table-column type="index" width="50">
  117. <template slot-scope="scope" >
  118. {{scope.$index+1+(page-1)*size}}
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="name" label="姓名" sortable></el-table-column>
  122. <el-table-column prop="phone" label="手机" width="120"></el-table-column>
  123. <el-table-column prop="departmentName" label="部门" sortable></el-table-column>
  124. <el-table-column label="角色" width="100">
  125. <template slot-scope="scope">{{scope.row.roleName}}</template>
  126. </el-table-column>
  127. <el-table-column prop="monthCost" label="月成本" sortable v-if="permissions.structurePersonnel">
  128. <template slot-scope="scope">{{scope.row.monthCost==null?0:scope.row.monthCost}} 元</template>
  129. </el-table-column>
  130. <el-table-column prop="cost" label="时薪" sortable v-if="permissions.structurePersonnel">
  131. <template slot-scope="scope">{{scope.row.cost==null?0:scope.row.cost}} 元
  132. <el-link @click.native="showSalaryList(scope.row)"><i class="iconfont firerock-iconrecord"></i></el-link>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="操作" width="330">
  136. <template slot-scope="scope">
  137. <el-button size="mini" type="default" v-if="scope.row.roleName == '超级管理员' && user.id == scope.row.id" @click="transferRole(scope.row)">转让</el-button>
  138. <el-button size="mini" type="default" v-if="scope.row.roleName != '超级管理员'" @click="resetPwd(scope.row)">重置</el-button>
  139. <el-button size="mini" type="primary" v-if="scope.row.roleName != '超级管理员'" @click="openInsertDialog(scope.$index)">编辑</el-button>
  140. <el-button size="mini" type="primary" v-if="scope.row.roleName == '超级管理员'" @click="openInsertDialog1(scope.$index)">编辑</el-button>
  141. <el-button size="mini" type="danger" v-if="scope.row.roleName != '超级管理员'" @click="deleteUser(scope.row)">删除</el-button>
  142. <el-button size="mini" type="default" v-if="scope.row.roleName != '超级管理员' && scope.row.isActive==1" @click="showDeactiveDialog(scope.row)">停用</el-button>
  143. <el-button size="mini" type="success" v-if="scope.row.roleName != '超级管理员' && scope.row.isActive==0" @click="setActive(scope.row, 1)">启用</el-button>
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. <!--工具条-->
  148. <el-col :span="24" class="toolbar">
  149. <!-- 123 -->
  150. <el-button size="small" @click="handleSelectionZzjgbtn1">取消</el-button>
  151. <!-- <el-cascader v-model="handleSelectionZzjgwillchange" size="small" placeholder="请选择部门" style="width: 13%;margin-left: 1%;margin-right: 1%;font-size:12px"
  152. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  153. <el-button size="small" type="primary" @click="handleSelectionZzjgbtn2">修改</el-button> -->
  154. <el-button size="small" type="primary" @click="handleSelectionZzjgbtn3">批量修改部门</el-button>
  155. <el-button size="small" type="primary" @click="handJue">批量修改角色</el-button>
  156. <el-pagination
  157. @size-change="handleSizeChange"
  158. @current-change="handleCurrentChange"
  159. :page-sizes="[20 , 50 , 80 , 100]"
  160. :page-size="size"
  161. layout="total, sizes, prev, pager, next"
  162. :total="total"
  163. style="float:right;"
  164. ></el-pagination>
  165. </el-col>
  166. </el-col>
  167. <!-- 批量修改弹出框 -->
  168. <el-dialog title="批量修改" :visible.sync="handleSelectionZzjgshow" v-if="handleSelectionZzjgshow" width="30%">
  169. <el-form model="" label-width="20%">
  170. <el-form-item label="修改部门">
  171. <!-- <el-cascader v-model="handleSelectionZzjgwillchange" placeholder="请选择部门" style="width: 60%;"
  172. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
  173. <el-cascader v-model="handleSelectionZzjgwillchange" placeholder="请选择部门" style="width: 60%;"
  174. :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  175. </el-form-item>
  176. </el-form>
  177. <div slot="footer" class="dialog-footer">
  178. <el-button @click="handleSelectionZzjgshow = false">取消</el-button>
  179. <el-button type="primary" @click="handleSelectionZzjgbtn2">确定</el-button>
  180. </div>
  181. </el-dialog>
  182. <!-- 批量修改角色弹出框 -->
  183. <el-dialog title="批量修改" :visible.sync="handljues" v-if="handljues" width="30%">
  184. <el-form model="" label-width="20%">
  185. <el-form-item label="修改角色">
  186. <el-select v-model="xiuRoleId" placeholder="请选择" style="width: 100%">
  187. <el-option v-for="(item, index) in acquireRoleLists" :key="index" :label="item.rolename" :value="item.id"></el-option>
  188. </el-select>
  189. </el-form-item>
  190. </el-form>
  191. <div slot="footer" class="dialog-footer">
  192. <el-button @click="handljues = false">取消</el-button>
  193. <el-button type="primary" @click="handTrue">确定</el-button>
  194. </div>
  195. </el-dialog>
  196. <!-- 新增部门 -->
  197. <el-dialog :title="depTitle" :visible.sync="departmentVisible" width="400px" >
  198. <el-form ref="depForm" :model="depForm" :rules="depRules" label-width="80px">
  199. <el-form-item label="部门名称" prop="name">
  200. <el-input v-model="depForm.name" placeholder="请输入部门名称" clearable></el-input>
  201. </el-form-item>
  202. <el-form-item label="负责人" prop="managerId">
  203. <el-select v-model="depForm.managerId" filterable clearable placeholder="请选择部门负责人" >
  204. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  205. </el-select>
  206. </el-form-item>
  207. <!-- 直属领导 -->
  208. <el-form-item label="直属领导" prop="reportAuditUserid">
  209. <el-select v-model="depForm.reportAuditUserid" filterable clearable placeholder="请选择直属领导" >
  210. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  211. </el-select>
  212. </el-form-item>
  213. </el-form>
  214. <span slot="footer" class="dialog-footer">
  215. <el-button @click="departmentVisible = false">取消</el-button>
  216. <el-button type="primary" @click="submitDepartment" >提交</el-button>
  217. </span>
  218. </el-dialog>
  219. <!-- 新增/编辑人员的Dialog -->
  220. <el-dialog :title="title" :visible.sync="dialogVisible" width="550px" >
  221. <el-form ref="form1" :model="insertForm" :rules="rules" label-width="80px">
  222. <el-form-item label="名字" prop="name">
  223. <el-input v-model="insertForm.name" placeholder="请输入姓名" clearable></el-input>
  224. </el-form-item>
  225. <el-form-item label="电话" prop="phone">
  226. <el-input v-model="insertForm.phone" placeholder="请输入电话号码" clearable></el-input>
  227. </el-form-item>
  228. <el-form-item label="薪酬方式" prop="salaryType" v-if="permissions.structurePersonnel">
  229. <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
  230. <el-radio :label="0" >固定月成本</el-radio>
  231. <el-radio :label="1">计时工资</el-radio>
  232. </el-radio-group>
  233. </el-form-item>
  234. <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0 && permissions.structurePersonnel">
  235. <el-input v-model="insertForm.monthCost" id="mc" @input="oninput" placeholder="请输入月成本,单位:元" clearable @keyup.native="restrictNumber('mc')"></el-input>
  236. <span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
  237. <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
  238. </el-form-item>
  239. <el-form-item label="时薪" prop="cost" v-if="permissions.structurePersonnel">
  240. <el-input v-model="insertForm.cost" :disabled="insertForm.salaryType == 0" id="cc" style="width:120px;" @keyup.native="restrictNumber('cc')"
  241. placeholder="请输入成本 单位:元/小时" clearable></el-input>
  242. <span style="margin-left:25px;">生效日期</span>
  243. <el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
  244. </el-form-item>
  245. <el-form-item label="部门" prop="departmentId">
  246. <!-- <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  247. :options="option" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader> -->
  248. <el-cascader v-model="insertForm.departmentId" placeholder="请选择部门" style="width: 100%"
  249. :options="option" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  250. </el-form-item>
  251. <el-form-item label="角色" prop="roleId">
  252. <el-select v-model="insertForm.roleId" placeholder="请选择角色" style="width: 100%">
  253. <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
  254. <span style="float: left">{{item.rolename}}</span>
  255. <span style="float: right; color: #8492a6; font-size: 13px">{{item.roleDescribe}}</span>
  256. </el-option>
  257. </el-select>
  258. </el-form-item>
  259. <el-form-item label="入职时间" prop="phone">
  260. <el-date-picker v-model="insertForm.inductionDate" value-format="yyyy-MM-dd"></el-date-picker>
  261. </el-form-item>
  262. <el-form-item label="岗位职级" prop="phone">
  263. <el-input v-model="insertForm.position" placeholder="请输入岗位职级别" clearable></el-input>
  264. </el-form-item>
  265. <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>
  266. <div class="certificateList">
  267. <div class="moreList">
  268. <div class="moreLiList" v-for="(item,index) in insertForm.certJson" :key="index">
  269. <div style="margin-right: 10px;width: 160px;">
  270. <el-select v-model="item.certId" placeholder="请选择专业证书" size="mini" @change="changeManagement(index)">
  271. <el-option v-for="item in managementTableData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
  272. </el-select>
  273. </div>
  274. <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>
  275. <div style="color: red;margin-left: 15px;cursor:pointer;" @click="deteFrames(index)"><i class="el-icon-delete"></i></div>
  276. </div>
  277. </div>
  278. </div>
  279. </el-form>
  280. <span slot="footer" class="dialog-footer">
  281. <el-button @click="dialogVisible=false">取消</el-button>
  282. <el-button type="primary" @click="submitInsert" :loading="submitLoading">提交</el-button>
  283. </span>
  284. </el-dialog>
  285. <!-- 编辑超级管理员的Dialog -->
  286. <el-dialog title="编辑人员" :visible.sync="dialogVisible1" width="550px" >
  287. <el-form ref="form1" :model="insertForm" :rules="rules" label-width="80px">
  288. <el-form-item label="名字" prop="name">
  289. <el-input v-model="insertForm.name" placeholder="请输入姓名" clearable></el-input>
  290. </el-form-item>
  291. <el-form-item label="薪酬方式" prop="salaryType" v-if="permissions.structurePersonnel">
  292. <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
  293. <el-radio :label="0" >固定月成本</el-radio>
  294. <el-radio :label="1">计时工资</el-radio>
  295. </el-radio-group>
  296. </el-form-item>
  297. <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0 && permissions.structurePersonnel" >
  298. <el-input v-model="insertForm.monthCost" id="monthCost" @input="oninput" @keyup.native="restrictNumber('monthCost')" placeholder="请输入月成本,单位:元" clearable></el-input>
  299. <span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
  300. <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
  301. </el-form-item>
  302. <el-form-item label="时薪" prop="cost" v-if="permissions.structurePersonnel">
  303. <el-input v-model="insertForm.cost" id="cost" :disabled="insertForm.salaryType == 0" @keyup.native="restrictNumber('cost')" style="width:120px;"
  304. placeholder="请输入成本 单位:元/小时" clearable></el-input>
  305. <span style="margin-left:25px;">生效日期</span>
  306. <el-date-picker v-model="insertForm.costApplyDate" value-format="yyyy-MM-dd"></el-date-picker>
  307. </el-form-item>
  308. <el-form-item label="部门" prop="departmentId">
  309. <el-cascader v-model="insertForm.departmentId"
  310. placeholder="请选择部门"
  311. style="width: 100%"
  312. :options="option"
  313. :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"
  314. clearable></el-cascader>
  315. </el-form-item>
  316. </el-form>
  317. <span slot="footer" class="dialog-footer">
  318. <el-button @click="dialogVisible1=false">取消</el-button>
  319. <el-button type="primary" @click="submitInsert1" :loading="submitLoading">提交</el-button>
  320. </span>
  321. </el-dialog>
  322. <el-dialog title="人员历史成本" :visible.sync="userSalaryListDialog" width="550px" >
  323. <el-table :data="userSalaryList" highlight-current-row v-loading="listLoading" height="300px" style="width: 100%;">
  324. <el-table-column prop="userName" label="姓名" ></el-table-column>
  325. <el-table-column prop="indate" label="更新时间" width="150px">
  326. </el-table-column>
  327. <el-table-column prop="salaryType" label="薪酬方式" >
  328. <template slot-scope="scope" >
  329. {{scope.row.salaryType==0?"固定月薪":"计时工资"}}
  330. </template>
  331. </el-table-column>
  332. <el-table-column prop="monthCost" label="月薪" >
  333. <template slot-scope="scope" >
  334. {{scope.row.monthCost}}元
  335. </template>
  336. </el-table-column>
  337. <el-table-column prop="cost" label="时薪" >
  338. <template slot-scope="scope" >
  339. {{scope.row.cost}}元
  340. </template>
  341. </el-table-column>
  342. </el-table>
  343. </el-dialog>
  344. <!--导出人员 -->
  345. <el-dialog title="导出人员列表" :visible.sync="exportDialogVisible" width="550px" >
  346. <el-form label-width="100px">
  347. <el-form-item label="导出" >
  348. <el-radio-group v-model="containInvalid" >
  349. <el-radio :label="1" >全部人员</el-radio>
  350. <el-radio :label="0" >仅活跃人员</el-radio>
  351. </el-radio-group>
  352. </el-form-item>
  353. </el-form>
  354. <span slot="footer" class="dialog-footer">
  355. <el-button type="primary" @click="exportUsers">导出</el-button>
  356. </span>
  357. </el-dialog>
  358. <!-- 转让超级管理员权限 -->
  359. <el-dialog title="权限转让" :visible.sync="transferDialog" width="550px" >
  360. <el-form label-width="200px">
  361. <el-form-item label="转让超级管理员角色至" >
  362. <el-select v-model="toUserId" style="width:300px" filterable clearable>
  363. <el-option v-for="item in allActiveUsers" :key="item.id" :value="item.id" :label="item.name">
  364. </el-option>
  365. </el-select>
  366. </el-form-item>
  367. <el-form-item label="转让后自己的角色" >
  368. <el-select v-model="myRoleId" style="width:300px">
  369. <el-option v-for="item in acquireRoleList" :label="item.rolename" :value="item.id" :key="item.name">
  370. <span style="float: left">{{item.rolename}}</span>
  371. <span style="float: right; color: #8492a6; font-size: 13px">{{item.roleDescribe}}</span>
  372. </el-option>
  373. </el-select>
  374. </el-form-item>
  375. </el-form>
  376. <span slot="footer" class="dialog-footer">
  377. <el-button type="default" @click="transferDialog = false">取消</el-button>
  378. <el-button type="primary" @click="showConfirmDialog">确定</el-button>
  379. </span>
  380. </el-dialog>
  381. <!--停用时选择日期 -->
  382. <el-dialog title="离职停用员工" :visible.sync="deactiveDialog" width="550px" >
  383. <el-form label-width="200px">
  384. <el-form-item label="员工离职日期" >
  385. <el-date-picker type="date" v-model="deactiveDate" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="请选择" />
  386. </el-form-item>
  387. </el-form>
  388. <span slot="footer" class="dialog-footer">
  389. <el-button type="default" @click="deactiveDialog = false">取消</el-button>
  390. <el-button type="primary" @click="confirmDeactive">确定</el-button>
  391. </span>
  392. </el-dialog>
  393. <!-- 管理专业证书 -->
  394. <el-dialog title="管理专业证书" :visible.sync="managementDiolog" width="500px" :before-close="handleClose">
  395. <div>
  396. <el-table :data="managementTableData" style="width: 100%" height="400">
  397. <el-table-column prop="name" label="名称" width="280"></el-table-column>
  398. <el-table-column label="操作" width="180">
  399. <template slot-scope="scope">
  400. <div>
  401. <el-button type="primary" size="small" @click="editorManagementForm(scope.row)">编辑</el-button>
  402. <el-button type="danger" size="small" @click="deteManagementForm(scope.row)">删除</el-button>
  403. </div>
  404. </template>
  405. </el-table-column>
  406. </el-table>
  407. </div>
  408. <span slot="footer" class="dialog-footer">
  409. <el-button @click="managementDiolog = false">关 闭</el-button>
  410. <el-button type="primary" @click="addManagementDiologs()">新 增</el-button>
  411. </span>
  412. </el-dialog>
  413. <!-- 新增项目管理专业 -->
  414. <el-dialog title="新增/编辑管理专业证书" :visible.sync="addManagementDiolog" width="500px" :before-close="handleClose">
  415. <div>
  416. <el-form :model="managementForm" :rules="managementFormRou" ref="managementForm" label-width="150px" class="demo-ruleForm">
  417. <el-form-item label="专业证书名称" prop="name">
  418. <el-input v-model="managementForm.name" placeholder="请输入专业证书名称"></el-input>
  419. </el-form-item>
  420. </el-form>
  421. </div>
  422. <span slot="footer" class="dialog-footer">
  423. <el-button @click="addManagementDiolog = false">取 消</el-button>
  424. <el-button type="primary" @click="addManagementForm('managementForm')">提 交</el-button>
  425. </span>
  426. </el-dialog>
  427. </section>
  428. </template>
  429. <script>
  430. import util from "../../common/js/util";
  431. let that
  432. export default {
  433. data() {
  434. return {
  435. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  436. isDingShow : false,
  437. handleSelectionZzjgshow: false,
  438. handljues: false,
  439. submitLoading:false,
  440. deactiveUser:null,
  441. deactiveDate:null,
  442. deactiveDialog:false,
  443. toUserId:null,
  444. myRoleId: null,
  445. allActiveUsers:[],
  446. transferDialog: false,
  447. containInvalid:1,
  448. exportDialogVisible: false,
  449. roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","财务管理员", "项目管理员","公司领导"],
  450. roleDescArray:[{label:"普通员工",value:0, desc:"填报日报,参与项目协作"},
  451. {label:"系统管理员",value:2, desc:"具有除了创建系统管理员之外的全部功能"},
  452. // {label:"公司高层",value:3, desc:"查阅项目信息,人员工时情况"},
  453. {label:"财务管理员",value:4, desc:"财务核算成本,费用报销审核,负责组织架构管理"},
  454. {label:"项目管理员",value:5, desc:"创建和管理项目"},
  455. {label:"公司领导",value:6, desc:"查看日报、工时成本统计、财务核算、项目和报表"},
  456. ],
  457. userSalaryList:[],
  458. userSalaryListDialog: false,
  459. value:{},
  460. user: JSON.parse(sessionStorage.getItem("user")),
  461. users:[],
  462. tableHeight: 0,
  463. listLoading: false,
  464. total: 0,
  465. page: 1,
  466. size: 20,
  467. list: [],
  468. data: [
  469. {
  470. id: -1,
  471. label: '全部人员',
  472. },
  473. {
  474. id: 0,
  475. label: '未分配',
  476. }
  477. ],
  478. option: [],
  479. depData: {
  480. id: -1,
  481. label: '全部人员',
  482. },
  483. defaultProps: {
  484. children: 'children',
  485. label: 'label'
  486. },
  487. dialogVisible: false,
  488. title: "",
  489. insertForm: {
  490. id: null,
  491. name: null,
  492. phone: null,
  493. // role: null,
  494. roleId: null,
  495. monthCost:null,
  496. cost: null,
  497. departmentId: null,
  498. salaryType:0,
  499. costApplyDate: '2021-04-09',
  500. inductionDate: '2021-04-09',
  501. position: '',
  502. certJson: []
  503. },
  504. rules: {
  505. name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
  506. // phone: [{ required: true, message: "请输入电话", trigger: "blur" }],
  507. // role: [{ required: true, message: "请选择角色", trigger: "blur" }],
  508. roleId: [{ required: true, message: "请选择角色", trigger: "blur" }],
  509. cost: [{ required: true, message: "请输入成本", trigger: "blur" }],
  510. monthCost:[{ required: true, message: "请输入月成本", trigger: "blur" }]
  511. },
  512. managementFormRou: {
  513. name: [{ required: true, message: "请输入专业证书", trigger: "blur" }],
  514. },
  515. dialogVisible1: false,
  516. departmentVisible: false,
  517. depTitle: '',
  518. depForm: {
  519. id: null,
  520. name: null,
  521. parentId: null,
  522. managerId: null,
  523. },
  524. depRules: {
  525. name: [{ required: true, message: "请输入部门名称", trigger: "blur" }],
  526. },
  527. timeType:{},
  528. keyword: '',
  529. rolesa: [{
  530. value: '',
  531. label: '全部'
  532. }, {
  533. value: '6',
  534. label: '公司领导'
  535. }, {
  536. value: '2',
  537. label: '系统管理员'
  538. }, {
  539. value: '4',
  540. label: '财务管理员'
  541. }, {
  542. value: '5',
  543. label: '项目管理员'
  544. }, {
  545. value: '0',
  546. label: '普通员工'
  547. }],
  548. states: [{
  549. value: '',
  550. label: '全部'
  551. }, {
  552. value: '1',
  553. label: '活跃'
  554. }, {
  555. value: '0',
  556. label: '停用'
  557. }],
  558. status: '',
  559. role: '',
  560. jDarr: [],
  561. handleSelectionZzjgDate:[],
  562. handleSelectionZzjgwillchange : null,
  563. acquireRoleList: [], // 角色列表
  564. acquireRoleLists: [], // 没有超级管理员
  565. roleId: '',
  566. xiuRoleId: '',
  567. managementDiolog: false,
  568. addManagementDiolog: false,
  569. managementForm: {
  570. name: ''
  571. },
  572. managementTableData: [],
  573. certificate: '',
  574. addUserId: ''
  575. };
  576. },
  577. filters: {
  578. acquireRoleName(value) {
  579. for(var i in that.acquireRoleList) {
  580. if(that.acquireRoleList[i].id == value) {
  581. return that.acquireRoleList[i].rolename
  582. }
  583. }
  584. }
  585. },
  586. beforeCreate: function () {
  587. that = this;
  588. },
  589. methods: {
  590. // 批量修改部门
  591. handleSelectionZzjg(e){
  592. // if (e.length == 0) {
  593. // this.handleSelectionZzjgshow = false
  594. // }else{
  595. // this.handleSelectionZzjgshow = true
  596. // }
  597. this.handleSelectionZzjgDate = e
  598. },
  599. handleSelectionZzjgbtn1(){
  600. this.handleSelectionZzjgshow = false
  601. this.$refs.handleSelectTable.clearSelection()
  602. this.handleSelectionZzjgwillchange = null
  603. },
  604. handleSelectionZzjgbtn2(){
  605. if (this.handleSelectionZzjgwillchange == null) {
  606. this.$message('请选择部门');
  607. return
  608. }
  609. //接口调用样例代码如下
  610. var ids = [];
  611. for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
  612. ids.push(this.handleSelectionZzjgDate[index].id)
  613. }
  614. var changeId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
  615. this.http.post('/user/batchUpdateDept', {
  616. userIds: JSON.stringify(ids),
  617. deptId: changeId
  618. },
  619. res => {
  620. if (res.code == "ok") {
  621. this.$message({
  622. message: '修改成功',
  623. type: "success"
  624. });
  625. this.getUser()
  626. } else {
  627. this.$message({
  628. message: res.msg,
  629. type: "error"
  630. });
  631. }
  632. },
  633. error => {
  634. this.$message({
  635. message: error,
  636. type: "error"
  637. });
  638. });
  639. // for (let index = 0; index < this.handleSelectionZzjgDate.length; index++) {
  640. // this.handleSelectionZzjgDate[index].departmentId = this.handleSelectionZzjgwillchange[this.handleSelectionZzjgwillchange.length - 1]
  641. // if (this.handleSelectionZzjgDate[index].role == 1) {
  642. // this.submitInsert1(this.handleSelectionZzjgDate[index],1)
  643. // }else{
  644. // this.submitInsert(this.handleSelectionZzjgDate[index],1)
  645. // }
  646. // }
  647. // this.handleSelectionZzjgwillchange = null
  648. this.handleSelectionZzjgshow = false
  649. },
  650. handleSelectionZzjgbtn3(){
  651. if(this.handleSelectionZzjgDate.length == 0){
  652. this.$message('请选择');
  653. return
  654. }
  655. this.handleSelectionZzjgshow = true
  656. },
  657. handJue() {
  658. if(this.handleSelectionZzjgDate.length == 0){
  659. this.$message('请选择');
  660. return
  661. }
  662. for(var i in this.acquireRoleList) {
  663. if(this.acquireRoleList[i].isDefault == 1) {
  664. this.xiuRoleId = this.acquireRoleList[i].id
  665. }
  666. }
  667. this.handljues = true
  668. console.log('触发了')
  669. },
  670. handTrue() {
  671. var arr = []
  672. for(var i in this.handleSelectionZzjgDate) {
  673. arr.push(this.handleSelectionZzjgDate[i].id)
  674. }
  675. this.http.post('/user/batchUpdateRole', {
  676. userIds: JSON.stringify(arr),
  677. roleId: this.xiuRoleId
  678. },
  679. res => {
  680. if (res.code == "ok") {
  681. this.$message({
  682. message: '操作成功',
  683. type: "success"
  684. });
  685. this.handljues = false
  686. this.getUser()
  687. } else {
  688. this.$message({
  689. message: res.msg,
  690. type: "error"
  691. });
  692. }
  693. },
  694. error => {
  695. this.$message({
  696. message: error,
  697. type: "error"
  698. });
  699. });
  700. },
  701. deleteUser(targetUser) {
  702. this.$confirm("确定要删除该员工吗?", "提示", {
  703. //type: 'warning'
  704. }).then(() => {
  705. this.http.post('/user/deleteUser', {
  706. userId: targetUser.id,
  707. },
  708. res => {
  709. if (res.code == "ok") {
  710. this.$message({
  711. message: '删除成功',
  712. type: "success"
  713. });
  714. this.getUser()
  715. } else {
  716. this.$message({
  717. message: res.msg,
  718. type: "error"
  719. });
  720. }
  721. },
  722. error => {
  723. this.$message({
  724. message: error,
  725. type: "error"
  726. });
  727. });
  728. })
  729. },
  730. chufa(data, b, c, e) {
  731. if(this.depData == null || data.id != this.depData.id) {
  732. // this.depData = data.id
  733. this.depData = data;
  734. this.page = 1;
  735. this.getUser();
  736. }
  737. },
  738. jieDian(a, b, c) {
  739. var ids = a.id
  740. var arrs = this.jDarr
  741. arrs.push(ids)
  742. this.jDarr = arrs
  743. },
  744. shutDown(a, b, c) {
  745. var ids = a.id
  746. var arrs = []
  747. for (var i in this.jDarr) {
  748. if(this.jDarr[i] != ids) {
  749. arrs.push(this.jDarr[i])
  750. }
  751. }
  752. this.jDarr = arrs
  753. },
  754. mouseleave(data,$event){
  755. $event.currentTarget.firstElementChild.nextElementSibling.setAttribute('class','node none')
  756. },
  757. mouseover(data,$event){
  758. $event.currentTarget.lastChild.setAttribute('class','node block');
  759. },
  760. confirmDeactive() {
  761. this.http.post('/user/deactiveUser', {
  762. id: this.deactiveUser.id,
  763. inactiveDate: this.deactiveDate
  764. },
  765. res => {
  766. if (res.code == "ok") {
  767. this.deactiveDialog = false;
  768. this.$message({
  769. message: '停用成功',
  770. type: "success"
  771. });
  772. // this.getUsers();
  773. this.getUser()
  774. } else {
  775. this.$message({
  776. message: res.msg,
  777. type: "error"
  778. });
  779. }
  780. },
  781. error => {
  782. this.$message({
  783. message: error,
  784. type: "error"
  785. });
  786. });
  787. },
  788. showDeactiveDialog(item) {
  789. this.deactiveDialog = true;
  790. this.deactiveUser = item;
  791. },
  792. restrictNumber(targetId) {
  793. let inpu = document.getElementById(targetId);
  794. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  795. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  796. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  797. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  798. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  799. inpu.value = parseFloat(inpu.value);
  800. }
  801. },
  802. showConfirmDialog() {
  803. if (this.toUserId == null || this.toUserId == '') {
  804. this.$message({
  805. message: '请选择要转让的人员',
  806. type: "error"
  807. });
  808. return;
  809. }
  810. if (!this.myRoleId) {
  811. this.$message({
  812. message: '请选择转让后您自己的角色',
  813. type: "error"
  814. });
  815. return;
  816. }
  817. this.$confirm("您将失去超级管理员角色,需要重新登录。确定要转让吗?", "提示", {
  818. //type: 'warning'
  819. }).then(() => {
  820. this.http.post('/user/changeSysManager', {
  821. toUserId: this.toUserId,
  822. myRoleId: this.myRoleId
  823. },
  824. res => {
  825. if (res.code == "ok") {
  826. sessionStorage.removeItem("user");
  827. this.$router.push("/login");
  828. } else {
  829. this.$message({
  830. message: res.msg,
  831. type: "error"
  832. });
  833. }
  834. },
  835. error => {
  836. this.$message({
  837. message: error,
  838. type: "error"
  839. });
  840. });
  841. });
  842. },
  843. transferRole() {
  844. this.transferDialog = true;
  845. this.http.post(this.port.manage.list, {
  846. departmentId: -1,
  847. pageIndex: 1,
  848. pageSize: 99999,
  849. keyword: this.keyword
  850. },
  851. res => {
  852. if (res.code == "ok") {
  853. this.allActiveUsers = res.data.records.filter(u=>u.isActive == 1 && u.id != this.user.id);
  854. } else {
  855. this.$message({
  856. message: res.msg,
  857. type: "error"
  858. });
  859. }
  860. },
  861. error => {
  862. this.$message({
  863. message: error,
  864. type: "error"
  865. });
  866. });
  867. },
  868. showExportDialog() {
  869. this.exportDialogVisible = true;
  870. },
  871. exportUsers() {
  872. this.http.post('/user/exportUsers', {
  873. containInvalid: this.containInvalid
  874. },
  875. res => {
  876. if (res.code == "ok") {
  877. this.exportDialogVisible = false;
  878. var aTag = document.createElement('a');
  879. aTag.download = "全部员工列表.xls";
  880. aTag.href = res.data;
  881. aTag.click();
  882. } else {
  883. this.$message({
  884. message: res.msg,
  885. type: "error"
  886. });
  887. }
  888. },
  889. error => {
  890. this.$message({
  891. message: error,
  892. type: "error"
  893. });
  894. });
  895. },
  896. showSalaryList(item) {
  897. this.userSalaryListDialog = true;
  898. this.userSalaryList = [];
  899. this.http.post('/user/getUserSalaryList', {
  900. id: item.id
  901. },
  902. res => {
  903. if (res.code == "ok") {
  904. this.userSalaryList = res.data;
  905. } else {
  906. this.$message({
  907. message: res.msg,
  908. type: "error"
  909. });
  910. }
  911. },
  912. error => {
  913. this.$message({
  914. message: error,
  915. type: "error"
  916. });
  917. });
  918. },
  919. getUsers() {
  920. this.http.post(this.port.manage.list, {
  921. departmentId: -1,
  922. pageIndex: 1,
  923. pageSize: 99999,
  924. keyword: this.keyword
  925. },
  926. res => {
  927. if (res.code == "ok") {
  928. this.users = res.data.records;
  929. } else {
  930. this.$message({
  931. message: res.msg,
  932. type: "error"
  933. });
  934. }
  935. },
  936. error => {
  937. this.$message({
  938. message: error,
  939. type: "error"
  940. });
  941. });
  942. },
  943. onSalaryTypeChange(value) {
  944. if (value == 1) {
  945. this.insertForm.monthCost = null;
  946. }
  947. },
  948. //选中部门
  949. choseDept(value) {
  950. console.log(value);
  951. },
  952. //月成本输入变化
  953. oninput(e) {
  954. this.insertForm.cost = (this.insertForm.monthCost/this.timeType.monthDays/this.timeType.allday).toFixed(2);
  955. },
  956. // 获取本公司的工作时间设置
  957. getCompanyTimeSetting() {
  958. this.http.post('/time-type/getCompanyTimeSetting',{
  959. companyId: this.user.companyId
  960. },
  961. res => {
  962. if (res.code == "ok") {
  963. this.timeType = res.data;
  964. } else {
  965. this.$message({
  966. message: res.msg,
  967. type: "error"
  968. });
  969. }
  970. },
  971. error => {
  972. this.listLoading = false;
  973. this.$message({
  974. message: error,
  975. type: "error"
  976. });
  977. }
  978. );
  979. },
  980. // 批量导入人员
  981. importUser(item) {
  982. //首先判断文件类型
  983. let str = item.file.name.split(".");
  984. let format = str[str.length - 1];
  985. if (format != "xls" && format != "xlsx") {
  986. this.$message({
  987. message: "请选择.xls或.xlsx文件",
  988. type: "error"
  989. });
  990. } else {
  991. this.listLoading = true;
  992. let formData = new FormData();
  993. formData.append("file", item.file);
  994. this.http.uploadFile( this.port.manage.import, formData,
  995. res => {
  996. this.$refs.upload.clearFiles();
  997. this.listLoading = false;
  998. if (res.code == "ok") {
  999. this.$message({
  1000. message: "导入成功",
  1001. type: "success"
  1002. });
  1003. //重新读取列表
  1004. this.getUser();
  1005. } else {
  1006. this.$message({
  1007. message: res.msg,
  1008. type: "error"
  1009. });
  1010. }
  1011. },
  1012. error => {
  1013. this.$refs.upload.clearFiles();
  1014. this.listLoading = false;
  1015. this.$message({
  1016. message: error,
  1017. type: "error"
  1018. });
  1019. });
  1020. }
  1021. },
  1022. //分页
  1023. handleCurrentChange(val) {
  1024. this.page = val;
  1025. this.getUser();
  1026. },
  1027. handleSizeChange(val) {
  1028. this.size = val;
  1029. this.getUser();
  1030. },
  1031. //获取所有员工的列表
  1032. getUser() {
  1033. console.log(12345)
  1034. this.listLoading = true;
  1035. this.http.post( this.port.manage.list, {
  1036. departmentId: this.depData.id,
  1037. pageIndex: this.page,
  1038. pageSize: this.size,
  1039. keyword: this.keyword,
  1040. status: this.status,
  1041. // role: this.role
  1042. roleId: this.roleId
  1043. },
  1044. res => {
  1045. this.listLoading = false;
  1046. if (res.code == "ok") {
  1047. this.list = res.data.records;
  1048. this.total = res.data.total;
  1049. } else {
  1050. this.$message({
  1051. message: res.msg,
  1052. type: "error"
  1053. });
  1054. }
  1055. },
  1056. error => {
  1057. this.listLoading = false;
  1058. this.$message({
  1059. message: error,
  1060. type: "error"
  1061. });
  1062. });
  1063. },
  1064. resetPwd(user) {
  1065. this.$confirm( "确定要为" + user.name + "重置密码吗?", "重置密码", {
  1066. confirmButtonText: "确定",
  1067. cancelButtonText: "取消",
  1068. type: "warning"
  1069. })
  1070. .then(() => {
  1071. this.http.post('/user/resetPwd', { userId: user.id },
  1072. res => {
  1073. if (res.code == "ok") {
  1074. this.$message({
  1075. message: "密码已重置为000000,请通知员工及时修改",
  1076. type: "success"
  1077. });
  1078. } else {
  1079. this.$message({
  1080. message: res.msg,
  1081. type: "error"
  1082. });
  1083. }
  1084. },
  1085. error => {
  1086. this.listLoading = false;
  1087. this.$message({
  1088. message: error,
  1089. type: "error"
  1090. });
  1091. });
  1092. })
  1093. .catch(() => {});
  1094. },
  1095. // 新增、编辑人员
  1096. openInsertDialog(i) {
  1097. if (i != null) {
  1098. var list = JSON.parse(JSON.stringify(this.list[i])) , arr = [] , array = [];
  1099. if(list.departmentCascade!='0' && list.departmentCascade!=null) {
  1100. if(list.departmentCascade.indexOf(",")>-1) {
  1101. arr = list.departmentCascade.split(",");
  1102. } else {
  1103. arr = [].concat(list.departmentCascade)
  1104. }
  1105. }
  1106. for(var i in arr) {
  1107. array.push(parseInt(arr[i]))
  1108. }
  1109. // console.log(list, '数据')
  1110. // this.insertForm = {
  1111. // id: list.id,
  1112. // name: list.name,
  1113. // phone: list.phone,
  1114. // // role: list.role,
  1115. // roleId: list.roleId,
  1116. // monthCost:list.monthCost,
  1117. // cost: list.cost,
  1118. // departmentId: array.reverse(),
  1119. // salaryType: list.salaryType,
  1120. // costApplyDate: list.costApplyDate,
  1121. // position: list.position
  1122. // };
  1123. this.addUserId = list.id
  1124. this.http.post('/user/getUserInfo', {
  1125. userId: list.id
  1126. },
  1127. res => {
  1128. if (res.code == "ok") {
  1129. this.insertForm = {
  1130. id: res.data.id,
  1131. name: res.data.name,
  1132. phone: res.data.phone,
  1133. roleId: res.data.roleId,
  1134. monthCost:res.data.monthCost,
  1135. cost: res.data.cost,
  1136. departmentId: array.reverse(),
  1137. salaryType: res.data.salaryType,
  1138. costApplyDate: res.data.costApplyDate,
  1139. inductionDate: res.data.inductionDate,
  1140. position: res.data.position,
  1141. certJson: res.data.certList
  1142. };
  1143. } else {
  1144. this.$message({
  1145. message: res.msg,
  1146. type: "error"
  1147. });
  1148. }
  1149. },
  1150. error => {
  1151. this.listLoading = false;
  1152. this.$message({
  1153. message: error,
  1154. type: "error"
  1155. });
  1156. });
  1157. this.title = "编辑人员"
  1158. } else {
  1159. this.addUserId = ''
  1160. this.insertForm = {
  1161. id: null,
  1162. name: null,
  1163. phone: null,
  1164. // role: null,
  1165. roleId: null,
  1166. monthCost:null,
  1167. cost: null,
  1168. departmentId: null,
  1169. salaryType:0,
  1170. costApplyDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
  1171. inductionDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
  1172. position: '',
  1173. certJson: [],
  1174. };
  1175. this.title = "新增人员"
  1176. }
  1177. this.dialogVisible = true;
  1178. },
  1179. submitInsert() {
  1180. var form = {}
  1181. var ssR = this.upRepeat(this.insertForm.certJson)
  1182. var trs = true
  1183. this.$refs.form1.validate(valid => {
  1184. if (valid) {
  1185. this.submitLoading = true;
  1186. if(ssR) {
  1187. this.$message({
  1188. message: '重复证书',
  1189. type: 'error'
  1190. });
  1191. this.submitLoading = false;
  1192. return false
  1193. }
  1194. for(var s in this.insertForm.certJson) {
  1195. if(!this.insertForm.certJson[s].certDate || !this.insertForm.certJson[s].certId) {
  1196. trs = false
  1197. }
  1198. }
  1199. if(!trs) {
  1200. this.$message({
  1201. message: '证书未填写完整',
  1202. type: 'error'
  1203. });
  1204. this.submitLoading = false;
  1205. return false
  1206. }
  1207. form = {
  1208. name: this.insertForm.name,
  1209. phone: this.insertForm.phone,
  1210. // role: this.insertForm.role,
  1211. roleId: this.insertForm.roleId,
  1212. monthCost: this.insertForm.monthCost,
  1213. cost: this.insertForm.cost,
  1214. salaryType: this.insertForm.salaryType,
  1215. position: this.insertForm.position,
  1216. certJson: JSON.stringify(this.insertForm.certJson),
  1217. // certJson: this.insertForm.certJson
  1218. inductionDate: this.insertForm.inductionDate
  1219. };
  1220. if (this.insertForm.id != null) {
  1221. form.id = this.insertForm.id;
  1222. }
  1223. if (this.insertForm.costApplyDate != null) {
  1224. form.costApplyDate = this.insertForm.costApplyDate;
  1225. }
  1226. if (this.insertForm.departmentId != null) {
  1227. form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
  1228. }
  1229. }
  1230. });
  1231. console.log(form, '提交的数据')
  1232. // return
  1233. console.log(ssR, trs)
  1234. if(!ssR && trs) {
  1235. this.http.post( this.port.manage.insert, form,
  1236. res => {
  1237. this.submitLoading = false;
  1238. if (res.code == "ok") {
  1239. this.$message({
  1240. message: this.insertForm.id != null ? "修改" : "创建" + "成功",
  1241. type: "success"
  1242. });
  1243. this.dialogVisible = false;
  1244. this.getUser();
  1245. this.getUsers()
  1246. } else {
  1247. this.$message({
  1248. message: res.msg,
  1249. type: "error"
  1250. });
  1251. }
  1252. },
  1253. error => {
  1254. this.listLoading = false;
  1255. this.$message({
  1256. message: error,
  1257. type: "error"
  1258. });
  1259. });
  1260. }
  1261. },
  1262. // 切换角色
  1263. switchRole(index) {
  1264. this.listLoading = true;
  1265. this.http.post( this.port.manage.permission, { id: this.list[index].id },
  1266. res => {
  1267. this.listLoading = false;
  1268. if (res.code == "ok") {
  1269. this.$message({
  1270. message: "切换角色成功",
  1271. type: "success"
  1272. });
  1273. //重新读取列表
  1274. this.getUser();
  1275. } else {
  1276. this.$message({
  1277. message: res.msg,
  1278. type: "error"
  1279. });
  1280. }
  1281. },
  1282. error => {
  1283. this.listLoading = false;
  1284. this.$message({
  1285. message: error,
  1286. type: "error"
  1287. });
  1288. });
  1289. },
  1290. // 删除用户
  1291. setActive(item, isActive) {
  1292. var txt = isActive==1?"启用":"停用";
  1293. this.$confirm( "确定要"+txt +" " + item.name + " 吗?", "账号"+txt, {
  1294. confirmButtonText: "确定",
  1295. cancelButtonText: "取消",
  1296. type: "warning"
  1297. })
  1298. .then(() => {
  1299. this.listLoading = true;
  1300. this.http.post('/user/setActive', { id: item.id, isActive: isActive},
  1301. res => {
  1302. this.listLoading = false;
  1303. if (res.code == "ok") {
  1304. this.$message({
  1305. message: txt+"成功",
  1306. type: "success"
  1307. });
  1308. //重新读取列表
  1309. this.getUser();
  1310. } else {
  1311. this.$message({
  1312. message: res.msg,
  1313. type: "error"
  1314. });
  1315. }
  1316. },
  1317. error => {
  1318. this.listLoading = false;
  1319. this.$message({
  1320. message: error,
  1321. type: "error"
  1322. });
  1323. });
  1324. })
  1325. .catch(() => {});
  1326. },
  1327. // 修改老板的成本
  1328. openInsertDialog1(i) {
  1329. var list1 = JSON.parse(JSON.stringify(this.list[i])) , arr1 = [] , array1 = [];
  1330. if(list1.departmentCascade!='0' && list1.departmentCascade!=null) {
  1331. if(list1.departmentCascade.indexOf(",")>-1) {
  1332. arr1 = list1.departmentCascade.split(",");
  1333. } else {
  1334. arr1 = [].concat(list1.departmentCascade)
  1335. }
  1336. }
  1337. for(var i in arr1) {
  1338. array1.push(parseInt(arr1[i]))
  1339. }
  1340. console.log(list1)
  1341. this.insertForm = {
  1342. id: list1.id,
  1343. name: list1.name,
  1344. phone: list1.phone,
  1345. roleId: list1.roleId,
  1346. monthCost:list1.monthCost,
  1347. cost: list1.cost,
  1348. departmentId: array1.reverse(),
  1349. salaryType: list1.salaryType,
  1350. name: list1.name,
  1351. position: list1.position,
  1352. certJson: list1.certJson
  1353. };
  1354. this.dialogVisible1 = true;
  1355. },
  1356. submitInsert1() {
  1357. var form = {}
  1358. this.$refs.form1.validate(valid => {
  1359. if (valid) {
  1360. this.submitLoading = true;
  1361. form = {
  1362. id: this.insertForm.id,
  1363. name: this.insertForm.name,
  1364. phone: this.insertForm.phone,
  1365. roleId: this.insertForm.roleId,
  1366. monthCost: this.insertForm.monthCost,
  1367. cost: this.insertForm.cost,
  1368. position: this.insertForm.position,
  1369. certJson: this.insertForm.certJson,
  1370. inductionDate: this.insertForm.inductionDate
  1371. };
  1372. if (this.insertForm.departmentId != null) {
  1373. form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
  1374. }
  1375. if (this.insertForm.costApplyDate != null) {
  1376. form.costApplyDate = this.insertForm.costApplyDate;
  1377. }
  1378. }
  1379. });
  1380. this.http.post( this.port.manage.insert, form,
  1381. res => {
  1382. this.submitLoading = false;
  1383. if (res.code == "ok") {
  1384. this.$message({
  1385. message: "修改成功",
  1386. type: "success"
  1387. });
  1388. this.dialogVisible1 = false;
  1389. //重新读取列表
  1390. this.getUser();
  1391. this.getUsers()
  1392. } else {
  1393. this.$message({
  1394. message: res.msg,
  1395. type: "error"
  1396. });
  1397. }
  1398. },
  1399. error => {
  1400. this.listLoading = false;
  1401. this.$message({
  1402. message: error,
  1403. type: "error"
  1404. });
  1405. });
  1406. },
  1407. // 获取部门列表
  1408. getDepartment() {
  1409. this.http.post( this.port.manage.depList, {},
  1410. res => {
  1411. if (res.code == "ok") {
  1412. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1413. list.splice(0,0,{
  1414. id: -1,
  1415. label: '全部人员',
  1416. })
  1417. list.push({
  1418. id: 0,
  1419. label: '未分配',
  1420. })
  1421. this.data = list;
  1422. console.log(list, "部门数据")
  1423. this.option = this.changeArr(list1);
  1424. } else {
  1425. this.$message({
  1426. message: res.msg,
  1427. type: "error"
  1428. });
  1429. }
  1430. },
  1431. error => {
  1432. this.$message({
  1433. message: error,
  1434. type: "error"
  1435. });
  1436. });
  1437. },
  1438. // 修改数组
  1439. changeArr(arr) {
  1440. for (var i = 0; i < arr.length; i++) {
  1441. if(arr[i].id != -1 && arr[i].id != 0) {
  1442. if (arr[i].children != null && arr[i].children.length>0) {
  1443. arr[i].children = this.changeArr(arr[i].children);
  1444. }
  1445. arr[i].id && (arr[i].value = arr[i].id);
  1446. delete arr[i].id;
  1447. }
  1448. }
  1449. for(var i in arr) {
  1450. if(arr[i].id == -1 || arr[i].id == 0) {
  1451. arr.splice(i,1)
  1452. }
  1453. }
  1454. return arr;
  1455. },
  1456. // 部门列表点击
  1457. handleNodeClick(data) {
  1458. console.log(data, 999)
  1459. if(this.depData == null || data.id != this.depData.id) {
  1460. this.depData = data;
  1461. this.page = 1;
  1462. this.getUser();
  1463. }
  1464. },
  1465. // 新增、修改部门
  1466. createDepartment(i) {
  1467. setTimeout(() => {
  1468. var that = this
  1469. if(i == -2) {//创建子部门
  1470. that.depForm = {
  1471. id: null,
  1472. name: null,
  1473. parentId: null,
  1474. managerId: null,
  1475. }
  1476. if(that.depData.id != -1 && that.depData.id != 0) {
  1477. that.depForm.parentId = that.depData.id;
  1478. }
  1479. that.depTitle = "新增子部门";
  1480. } else if(i == -1) {//创建一级部门
  1481. that.depForm = {
  1482. id: null,
  1483. name: null,
  1484. parentId: null,
  1485. managerId: null,
  1486. }
  1487. that.depTitle = "新增部门";
  1488. } else {
  1489. if(that.depData.managerId == "null") {
  1490. that.depData.managerId = ''
  1491. }
  1492. if(that.depData.reportAuditUserid == "null") {
  1493. that.depData.reportAuditUserid = ''
  1494. }
  1495. that.depForm = {
  1496. id: that.depData.id,
  1497. name: that.depData.label,
  1498. parentId: that.depData.parentId,
  1499. managerId: that.depData.managerId,
  1500. reportAuditUserid: that.depData.reportAuditUserid
  1501. }
  1502. // if(that.depData.reportAuditUserid != null && that.depData.reportAuditUserid != "null" && that.depData.reportAuditUserid.length > 0) {
  1503. // that.depForm.reportAuditUserid = that.depData.reportAuditUserid
  1504. // }
  1505. that.depTitle = "编辑部门";
  1506. }
  1507. that.departmentVisible = true;
  1508. })
  1509. // if(i == -2) {//创建子部门
  1510. // this.depForm = {
  1511. // id: null,
  1512. // name: null,
  1513. // parentId: null,
  1514. // managerId: null,
  1515. // }
  1516. // if(this.depData.id != -1 && this.depData.id != 0) {
  1517. // this.depForm.parentId = this.depData.id;
  1518. // }
  1519. // this.depTitle = "新增子部门";
  1520. // } else if(i == -1) {//创建一级部门
  1521. // this.depForm = {
  1522. // id: null,
  1523. // name: null,
  1524. // parentId: null,
  1525. // managerId: null,
  1526. // }
  1527. // this.depTitle = "新增部门";
  1528. // } else {
  1529. // if(this.depData.managerId == "null") {
  1530. // this.depData.managerId = ''
  1531. // }
  1532. // if(this.depData.reportAuditUserid == "null") {
  1533. // this.depData.reportAuditUserid = ''
  1534. // }
  1535. // this.depForm = {
  1536. // id: this.depData.id,
  1537. // name: this.depData.label,
  1538. // parentId: this.depData.parentId,
  1539. // managerId: this.depData.managerId,
  1540. // reportAuditUserid: this.depData.reportAuditUserid
  1541. // }
  1542. // // if(this.depData.reportAuditUserid != null && this.depData.reportAuditUserid != "null" && this.depData.reportAuditUserid.length > 0) {
  1543. // // this.depForm.reportAuditUserid = this.depData.reportAuditUserid
  1544. // // }
  1545. // this.depTitle = "编辑部门";
  1546. // }
  1547. // this.departmentVisible = true;
  1548. },
  1549. submitDepartment() {
  1550. this.$refs.depForm.validate(valid => {
  1551. if (valid) {
  1552. var form = {
  1553. name: this.depForm.name,
  1554. };
  1555. if(this.depForm.id != null) {
  1556. form.id = this.depForm.id
  1557. }
  1558. if(this.depForm.parentId != null) {
  1559. form.parentId = this.depForm.parentId
  1560. }
  1561. if (this.depForm.managerId) {
  1562. form.managerId = this.depForm.managerId
  1563. }
  1564. console.log(this.depForm)
  1565. if (this.depForm.reportAuditUserid) {
  1566. form.reportAuditUserid = this.depForm.reportAuditUserid
  1567. }
  1568. this.http.post( this.depForm.id==null?this.port.manage.add:this.port.manage.edit, form,
  1569. res => {
  1570. if (res.code == "ok") {
  1571. this.$message({
  1572. message: this.depForm.id==null?"新增成功":"修改成功",
  1573. type: "success"
  1574. });
  1575. this.departmentVisible = false;
  1576. if (this.depForm.id !=null) {
  1577. this.depData.label = form.name;
  1578. this.depData.managerId = form.managerId;
  1579. }
  1580. this.getDepartment();
  1581. } else {
  1582. this.$message({
  1583. message: res.msg,
  1584. type: "error"
  1585. });
  1586. }
  1587. },
  1588. error => {
  1589. this.listLoading = false;
  1590. this.$message({
  1591. message: error,
  1592. type: "error"
  1593. });
  1594. });
  1595. }
  1596. });
  1597. },
  1598. // 删除部门
  1599. deleteDep() {
  1600. var that = this
  1601. setTimeout(() =>{
  1602. that.$confirm( "确定要删除部门" + that.depData.label + "吗?", "删除部门", {
  1603. confirmButtonText: "确定",
  1604. cancelButtonText: "取消",
  1605. type: "warning"
  1606. })
  1607. .then(() => {
  1608. that.listLoading = true;
  1609. that.http.post( that.port.manage.del, { id: that.depData.id },
  1610. res => {
  1611. that.listLoading = false;
  1612. if (res.code == "ok") {
  1613. that.$message({
  1614. message: "删除成功",
  1615. type: "success"
  1616. });
  1617. that.depData = {
  1618. id: -1,
  1619. label: '全部人员',
  1620. }
  1621. that.getDepartment();
  1622. that.getUser();
  1623. } else {
  1624. that.$message({
  1625. message: res.msg,
  1626. type: "error"
  1627. });
  1628. }
  1629. },
  1630. error => {
  1631. that.listLoading = false;
  1632. that.$message({
  1633. message: error,
  1634. type: "error"
  1635. });
  1636. });
  1637. })
  1638. .catch(() => {});
  1639. },100);
  1640. // this.$confirm( "确定要删除部门" + this.depData.label + "吗?", "删除部门", {
  1641. // confirmButtonText: "确定",
  1642. // cancelButtonText: "取消",
  1643. // type: "warning"
  1644. // })
  1645. // .then(() => {
  1646. // this.listLoading = true;
  1647. // this.http.post( this.port.manage.del, { id: this.depData.id },
  1648. // res => {
  1649. // this.listLoading = false;
  1650. // if (res.code == "ok") {
  1651. // this.$message({
  1652. // message: "删除成功",
  1653. // type: "success"
  1654. // });
  1655. // this.depData = {
  1656. // id: -1,
  1657. // label: '全部人员',
  1658. // }
  1659. // this.getDepartment();
  1660. // this.getUser();
  1661. // } else {
  1662. // this.$message({
  1663. // message: res.msg,
  1664. // type: "error"
  1665. // });
  1666. // }
  1667. // },
  1668. // error => {
  1669. // this.listLoading = false;
  1670. // this.$message({
  1671. // message: error,
  1672. // type: "error"
  1673. // });
  1674. // });
  1675. // })
  1676. // .catch(() => {});
  1677. },
  1678. // 关键搜索
  1679. searchList() {
  1680. console.log(this.keyword)
  1681. this.listLoading = true;
  1682. this.http.post( this.port.manage.list, {
  1683. departmentId: this.depData.id,
  1684. pageIndex: this.page,
  1685. pageSize: this.size,
  1686. keyword: this.keyword
  1687. },
  1688. res => {
  1689. this.listLoading = false;
  1690. if (res.code == "ok") {
  1691. this.list = res.data.records;
  1692. this.total = res.data.total;
  1693. } else {
  1694. this.$message({
  1695. message: res.msg,
  1696. type: "error"
  1697. });
  1698. }
  1699. },
  1700. error => {
  1701. this.listLoading = false;
  1702. this.$message({
  1703. message: error,
  1704. type: "error"
  1705. });
  1706. });
  1707. },
  1708. // 获取角色
  1709. acquireRole() {
  1710. // this.http.post('/permission/getFrontRoleList', {
  1711. this.http.post('/permission/getFrontRoleList', {
  1712. companyId: this.user.companyId
  1713. },
  1714. res => {
  1715. if (res.code == "ok") {
  1716. console.log(res.data, '获取角色')
  1717. this.acquireRoleList = res.data
  1718. var arr = []
  1719. for(var i in res.data) {
  1720. if(res.data[i].rolename != '系统管理员') {
  1721. arr.push(res.data[i])
  1722. }
  1723. }
  1724. this.acquireRoleLists = arr
  1725. } else {
  1726. this.$message({
  1727. message: res.msg,
  1728. type: "error"
  1729. });
  1730. }
  1731. },
  1732. error => {
  1733. this.$message({
  1734. message: error,
  1735. type: "error"
  1736. });
  1737. });
  1738. },
  1739. // 获取专业分类
  1740. getProfessional() {
  1741. this.http.post('/company-cert/list', {},
  1742. res => {
  1743. if (res.code == "ok") {
  1744. this.managementTableData = res.data
  1745. } else {
  1746. this.$message({
  1747. message: res.msg,
  1748. type: "error"
  1749. });
  1750. }
  1751. },
  1752. error => {
  1753. this.$message({
  1754. message: error,
  1755. type: "error"
  1756. });
  1757. });
  1758. },
  1759. addManagementDiologs() {
  1760. this.managementForm = {name: ''}
  1761. this.addManagementDiolog = true
  1762. },
  1763. // 新增/编辑人员专业费雷
  1764. addManagementForm(formName) {
  1765. this.$refs[formName].validate((valid) => {
  1766. if (valid) {
  1767. this.http.post('/company-cert/addOrMod', this.managementForm,
  1768. res => {
  1769. if (res.code == "ok") {
  1770. this.$message({
  1771. message: '操作成功',
  1772. type: "success"
  1773. });
  1774. this.getProfessional()
  1775. this.addManagementDiolog = false
  1776. } else {
  1777. this.$message({
  1778. message: res.msg,
  1779. type: "error"
  1780. });
  1781. }
  1782. },
  1783. error => {
  1784. this.$message({
  1785. message: error,
  1786. type: "error"
  1787. });
  1788. });
  1789. } else {
  1790. console.log('error submit!!');
  1791. return false;
  1792. }
  1793. });
  1794. },
  1795. // 编辑
  1796. editorManagementForm(item) {
  1797. this.managementForm = item
  1798. this.addManagementDiolog = true
  1799. },
  1800. // 删除专业
  1801. deteManagementForm(item) {
  1802. this.$confirm('该操作可能造成已有数据丢失,确定要删除吗?', '删除专业证书', {
  1803. confirmButtonText: '确定',
  1804. cancelButtonText: '取消',
  1805. type: 'warning'
  1806. }).then(() => {
  1807. this.http.post('/company-cert/delete', {
  1808. id: item.id
  1809. },
  1810. res => {
  1811. if (res.code == "ok") {
  1812. this.$message({
  1813. message: '操作成功',
  1814. type: "success"
  1815. });
  1816. this.getProfessional()
  1817. } else {
  1818. this.$message({
  1819. message: res.msg,
  1820. type: "error"
  1821. });
  1822. }
  1823. },
  1824. error => {
  1825. this.$message({
  1826. message: error,
  1827. type: "error"
  1828. });
  1829. });
  1830. }).catch(() => {
  1831. this.$message({
  1832. type: 'info',
  1833. message: '已取消删除'
  1834. });
  1835. });
  1836. },
  1837. // 点击添加更多帧数
  1838. addCertificateList() {
  1839. var obj = {}
  1840. obj.certId = ''
  1841. obj.certName = ''
  1842. obj.certDate = ''
  1843. obj.id = ''
  1844. obj.userId = this.addUserId
  1845. this.insertForm.certJson.push(obj)
  1846. },
  1847. // 选择专业帧数
  1848. changeManagement(is) {
  1849. var id = this.insertForm.certJson[is].certId
  1850. for(var i in this.managementTableData) {
  1851. if(this.managementTableData[i].id == id) {
  1852. this.insertForm.certJson[is].certName = this.managementTableData[i].name
  1853. }
  1854. }
  1855. },
  1856. // 查重复
  1857. upRepeat(arr) {
  1858. var obj = {};
  1859. for(var i in arr) {
  1860. if(obj[arr[i].certName]) {
  1861. return true;
  1862. }
  1863. obj[arr[i].certName] = true;
  1864. }
  1865. return false;
  1866. },
  1867. // 删除帧数
  1868. deteFrames(i) {
  1869. this.insertForm.certJson.splice(i, 1)
  1870. }
  1871. },
  1872. created() {
  1873. let height = window.innerHeight;
  1874. this.tableHeight = height - 195;
  1875. const that = this;
  1876. window.onresize = function temp() {
  1877. that.tableHeight = window.innerHeight - 195;
  1878. };
  1879. },
  1880. mounted() {
  1881. this.deactiveDate = util.formatDate.format(new Date(), 'yyyy-MM-dd');
  1882. this.getDepartment();
  1883. this.getUser();
  1884. this.getCompanyTimeSetting();
  1885. this.getUsers();
  1886. this.acquireRole();
  1887. this.isDingShow = this.$store.state.isDing;
  1888. this.getProfessional()
  1889. }
  1890. };
  1891. </script>
  1892. <style lang="scss" scoped>
  1893. .custom-tree-node {
  1894. flex: 1;
  1895. display: flex;
  1896. align-items: center;
  1897. justify-content: space-between;
  1898. font-size: 14px;
  1899. padding-right: 8px;
  1900. }
  1901. .left {
  1902. border-right: 1px solid #f2f2f2;
  1903. overflow: hidden;
  1904. .department {
  1905. background:#f2f2f2;
  1906. line-height: 60px;
  1907. color:#666;
  1908. padding:0 10px;
  1909. height:60px;
  1910. font-size: 15px;
  1911. div {
  1912. float: right;
  1913. color: #20a0ff;
  1914. font-size: 14px;
  1915. cursor: pointer;
  1916. }
  1917. }
  1918. .tree {
  1919. overflow: auto;
  1920. }
  1921. }
  1922. .nowTime {
  1923. height: 40px;
  1924. line-height: 40px;
  1925. font-size: 16px;
  1926. color: #20a0ff;
  1927. margin-left: 10px;
  1928. cursor: pointer;
  1929. i {
  1930. margin-right: 10px;
  1931. }
  1932. }
  1933. .none {
  1934. display: none;
  1935. }
  1936. .block {
  1937. display: block;
  1938. }
  1939. </style>
  1940. <style lang="scss">
  1941. .tree {
  1942. .el-tree-node__label {
  1943. overflow-x: hidden;
  1944. white-space: nowrap;
  1945. text-overflow: ellipsis;
  1946. }
  1947. }
  1948. .el-divider--horizontal {
  1949. margin: 0px;
  1950. background:#f3f3f3;
  1951. }
  1952. //全局的作用范围
  1953. .el-tree-node__content {
  1954. height:36px;
  1955. }
  1956. .zhaunye {
  1957. display: flex;
  1958. justify-content: space-between;
  1959. padding: 0 5px 0 10px;
  1960. }
  1961. .certificateList {
  1962. width: 98%;
  1963. box-sizing: border-box;
  1964. margin: 0 10px 0 10px;
  1965. border: 1px solid rgb(194, 194, 194);
  1966. min-height: 200px;
  1967. max-height: 200px;
  1968. overflow: auto;
  1969. padding: 10px;
  1970. }
  1971. .moreAl {
  1972. display: flex;
  1973. width: 100%;
  1974. justify-content: center;
  1975. }
  1976. .moreLiList {
  1977. display: flex;
  1978. margin-bottom: 10px;
  1979. }
  1980. .moreLiList div {
  1981. line-height: 30px;
  1982. }
  1983. .moreLiList span {
  1984. display: inline-block;
  1985. margin-right: 15px;
  1986. }
  1987. </style>