index.vue 89 KB

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