index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>人力资源表
  5. </h2>
  6. <div class="m-core">
  7. <div class="newBand" v-permission="'employeeInfo/insert'" @click="openTypes('create')">添加</div>
  8. <!-- 搜索标题 -->
  9. <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
  10. <el-form-item>
  11. <el-input placeholder="姓名手机号" v-model.trim="searchForm.userNameOrIdOrMobile" clearable></el-input>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-select v-model.trim="searchForm.sourceFrom"
  15. clearable
  16. filterable
  17. placeholder="请选择信息来源">
  18. <el-option label="BOSS"
  19. value="BOSS"></el-option>
  20. <el-option label="转介绍"
  21. value="转介绍"></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-select v-model.trim="searchForm.status"
  26. clearable
  27. filterable
  28. placeholder="请选择人员状态">
  29. <el-option label="未录用"
  30. value="NOT_EMPLOYED"></el-option>
  31. <el-option label="面试中"
  32. value="INTERVIEWING"></el-option>
  33. <el-option label="储备"
  34. value="RESERVE"></el-option>
  35. <el-option label="兼职"
  36. value="PART_TIME"></el-option>
  37. <el-option label="全职"
  38. value="FULL_TIME"></el-option>
  39. <el-option label="离职"
  40. value="DIMISSION"></el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-select v-model.trim="searchForm.position"
  45. clearable
  46. filterable
  47. placeholder="请选择职位">
  48. <el-option label="指导老师"
  49. value="ADVISER"></el-option>
  50. <el-option label="教务老师"
  51. value="ACADEMIC"></el-option>
  52. <el-option label="乐队指导"
  53. value="TEACHING"></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item>
  57. <el-select v-model.trim="searchForm.organId"
  58. placeholder='请选择分部'
  59. clearable
  60. filterable
  61. >
  62. <el-option v-for='(item,index) in organList'
  63. :key="index"
  64. :value="item.id"
  65. :label="item.name"
  66. >
  67. </el-option>
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item
  71. prop="subjectIds"
  72. :label-width="formLabelWidth"
  73. >
  74. <el-select
  75. v-model.trim="searchForm.subjectId"
  76. clearable
  77. filterable
  78. placeholder='请选择声部'
  79. >
  80. <el-option v-for='(item,index) in subjectList'
  81. :key="index"
  82. :value="item.id"
  83. :label="item.name"
  84. >
  85. </el-option>
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item>
  89. <el-button @click="getList" type="danger">搜索</el-button>
  90. <el-button @click="onReSet" type="primary" style="background-color: #409EFF;border-color: #409EFF;">重置</el-button>
  91. </el-form-item>
  92. </el-form>
  93. <div class="tableWrap">
  94. <el-table :data="tableList"
  95. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  96. <el-table-column width="120px" align="center" prop="id" label="编号"></el-table-column>
  97. <el-table-column align="center" prop="realName" label="姓名">
  98. <template slot-scope="scope">
  99. <el-tooltip class="item" effect="dark" :content="scope.row.realName" placement="top">
  100. <span>{{ scope.row.realName}}</span>
  101. </el-tooltip>
  102. </template>
  103. </el-table-column>
  104. <el-table-column align="center" prop="mobileNo" label="手机号"></el-table-column>
  105. <el-table-column align="center" prop="wechatNo" label="微信"></el-table-column>
  106. <el-table-column align="center" label="学历信息">
  107. <template slot-scope="scope">
  108. <el-button @click="openEducation(scope.row)" type="text">查看学历</el-button>
  109. </template>
  110. </el-table-column>
  111. <el-table-column align="center" prop="subjectName" label="声部" width="200px">
  112. <template slot-scope="scope">
  113. <el-tooltip class="item" effect="dark" :content="scope.row.subjectName" placement="top">
  114. <span>{{ scope.row.subjectName}}</span>
  115. </el-tooltip>
  116. </template>
  117. </el-table-column>
  118. <el-table-column align="center" prop="liveCity" label="所在城市"></el-table-column>
  119. <el-table-column align="center" prop="intentionCity" label="工作意向" width="100px">
  120. <template slot-scope="scope">
  121. <el-tooltip class="item" effect="dark" :content="scope.row.intentionCity" placement="top">
  122. <span>{{ scope.row.intentionCity}}</span>
  123. </el-tooltip>
  124. </template>
  125. </el-table-column>
  126. <el-table-column align="center" prop="assessmentResult" label="评估结果" width="200px">
  127. <template slot-scope="scope">
  128. <el-tooltip class="item" effect="dark" :content="scope.row.assessmentResult" placement="top">
  129. <span>{{ scope.row.assessmentResult}}</span>
  130. </el-tooltip>
  131. </template>
  132. </el-table-column>
  133. <el-table-column align="center" prop="otherComment" label="其它综合情况" width="200px">
  134. <template slot-scope="scope">
  135. <el-tooltip class="item" effect="dark" :content="scope.row.otherComment" placement="top">
  136. <span>{{ scope.row.otherComment}}</span>
  137. </el-tooltip>
  138. </template>
  139. </el-table-column>
  140. <el-table-column align="center" prop="sourceFrom" label="信息来源"></el-table-column>
  141. <el-table-column align="center" prop="entryDate" label="入职时间" width="150px">
  142. <template slot-scope="scope">
  143. {{ scope.row.entryDate | dayjsFormat}}
  144. </template>
  145. </el-table-column>
  146. <el-table-column align="center" prop="position" label="职位">
  147. <template slot-scope="scope">
  148. {{ scope.row.position | jobType }}
  149. </template>
  150. </el-table-column>
  151. <el-table-column align="center" prop="organName" label="分部"></el-table-column>
  152. <el-table-column align="center" prop="isProbationPeriod" label="是否试用期">
  153. <template slot-scope="scope">
  154. {{ typeof scope.row.isProbationPeriod === 'boolean' ? scope.row.isProbationPeriod ? '是' : '否' : '' }}
  155. </template>
  156. </el-table-column>
  157. <el-table-column align="center" prop="status" label="人员状态">
  158. <template slot-scope="scope">
  159. {{ scope.row.status | hrStatus }}
  160. </template>
  161. </el-table-column>
  162. <el-table-column align="center" prop="idCard" label="证件号码" width="200px"></el-table-column>
  163. <el-table-column align="center" prop="age" label="年龄">
  164. <template slot-scope="scope">
  165. {{ scope.row.age > 0 ? scope.row.age : '' }}
  166. </template>
  167. </el-table-column>
  168. <el-table-column align="center" prop="gender" label="性别">
  169. <template slot-scope="scope">
  170. {{ typeof scope.row.gender === 'boolean' ? scope.row.gender ? '男' : '女' : '' }}
  171. </template>
  172. </el-table-column>
  173. <el-table-column align="center" prop="bankCardNo" label="银行卡号" width="200px"></el-table-column>
  174. <el-table-column align="center" prop="bankAddress" label="开户行" width="200px"></el-table-column>
  175. <el-table-column align="center" prop="emergencyContactName" label="紧急联系人"></el-table-column>
  176. <el-table-column align="center" prop="emergencyContactRelation" label="紧急联系人关系"></el-table-column>
  177. <el-table-column align="center" prop="emergencyContactPhone" label="紧急联系人电话"></el-table-column>
  178. <el-table-column align="center" prop="updateTime" label="最后一次操作时间时间" width="160px"></el-table-column>
  179. <el-table-column align="center" prop="operatorName" label="归属管理HR"></el-table-column>
  180. <el-table-column align="center" prop="resignationDate" label="离职时间" width="150px">
  181. <template slot-scope="scope">
  182. {{ scope.row.resignationDate | dayjsFormat}}
  183. </template>
  184. </el-table-column>
  185. <el-table-column align="center" label="操作" fixed="right">
  186. <template slot-scope="scope">
  187. <el-button v-permission="'employeeInfo/update'" @click="openTypes('update', scope.row)" type="text">修改</el-button>
  188. </template>
  189. </el-table-column>
  190. </el-table>
  191. <pagination
  192. :total="pageInfo.total"
  193. :page.sync="pageInfo.page"
  194. :limit.sync="pageInfo.limit"
  195. :page-sizes="pageInfo.page_size"
  196. @pagination="getList"
  197. />
  198. </div>
  199. </div>
  200. <el-dialog
  201. :title="formTitle[formActionTitle]"
  202. :visible.sync="typeStatus"
  203. destroy-on-close
  204. :close-on-click-modal="false"
  205. @close="onFormClose('ruleForm')"
  206. width="1050px"
  207. >
  208. <hrform :detail.sync="rowDetail" :organList="organList" :subjectList="subjectList" :close="onFormClose" :getList="getList" />
  209. </el-dialog>
  210. <el-dialog
  211. title="查看学历信息"
  212. :visible.sync="educationVisible"
  213. destroy-on-close
  214. :close-on-click-modal="false"
  215. @close="educationVisible = false"
  216. width="600px"
  217. >
  218. <el-table :data="educationList"
  219. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  220. <el-table-column align="center" prop="level" label="学历"></el-table-column>
  221. <el-table-column align="center" prop="school" label="毕业学校"></el-table-column>
  222. <el-table-column align="center" prop="year" label="毕业时间">
  223. <template slot-scope="scope">
  224. {{ scope.row.year | dayjsFormat}}
  225. </template>
  226. </el-table-column>
  227. </el-table>
  228. </el-dialog>
  229. </div>
  230. </template>
  231. <script>
  232. import pagination from "@/components/Pagination/index";
  233. import dayjs from 'dayjs'
  234. import hrform from './form'
  235. // import store from '@/store'
  236. import {
  237. helpCenterCatalogList,
  238. employeeInfo,
  239. helpCenterContentModify,
  240. helpCenterContentDelete
  241. } from "@/api/appTenant";
  242. import { getEmployeeOrgan, getSubject } from '@/api/buildTeam'
  243. import { subjectListTree } from '@/api/specialSetting'
  244. const initSearch = {
  245. organId: '',
  246. jobNature: '',
  247. position: '',
  248. subjectId: '',
  249. userNameOrIdOrMobile: '',
  250. }
  251. export default {
  252. components: { pagination, hrform },
  253. name: "helpCategory",
  254. data() {
  255. return {
  256. searchForm: {
  257. ...initSearch
  258. },
  259. educationVisible: false,
  260. treeList: [],
  261. tableList: [],
  262. educationList: [],
  263. formActionTitle: "create",
  264. formTitle: {
  265. create: "添加人员",
  266. update: "修改人员"
  267. },
  268. typeStatus: false, // 添加教学点
  269. formLabelWidth: "100px",
  270. form: {
  271. title: null, // 标题
  272. content: null, // 内容
  273. catalogId: null, // 分类编号
  274. },
  275. rules: {
  276. title: [{ required: true, message: "请输入标题", trigger: "blur" }],
  277. content: [{ required: true, message: "请输入内容", trigger: "blur" }],
  278. catalogId: [{ required: true, message: "请输入选择分类", trigger: "blur" }]
  279. // subjectIds: [{ required: true, message: "请选择声部组合", trigger: "change" }]
  280. },
  281. pageInfo: {
  282. // 分页规则
  283. limit: 10, // 限制显示条数
  284. page: 1, // 当前页
  285. total: 0, // 总条数
  286. page_size: [10, 20, 40, 50] // 选择限制显示条数
  287. },
  288. rowDetail: null,
  289. tempTreeList: [],
  290. organList: [],
  291. subjectList: [],
  292. };
  293. },
  294. activated() {
  295. this.getList();
  296. this.getSubjectList()
  297. // this.getTreeList()
  298. },
  299. computed: {
  300. subjectListObj() {
  301. const data = {}
  302. for (let i = 0; i < this.subjectList.length; i++) {
  303. const item = this.subjectList[i];
  304. data[item.id] = item.name
  305. }
  306. return data
  307. },
  308. organListObj() {
  309. const data = {}
  310. for (let i = 0; i < this.organList.length; i++) {
  311. const item = this.organList[i];
  312. data[item.id] = item.name
  313. }
  314. return data
  315. }
  316. },
  317. mounted() {
  318. this.getList();
  319. // this.getTreeList()
  320. getEmployeeOrgan().then(res => {
  321. if (res.code == 200) {
  322. this.organList = res.data;
  323. }
  324. })
  325. this.getSubjectList()
  326. },
  327. methods: {
  328. getSubjectList() {
  329. getSubject({
  330. delFlag: 0,
  331. tenantId: 1,
  332. }).then(res => {
  333. let result = res.data
  334. if (res.code == 200) {
  335. // let tempArray = []
  336. // result.rows.forEach((item, index) => {
  337. // let subject = []
  338. // item.subjects.forEach(s => {
  339. // subject.push({
  340. // value: s.id,
  341. // label: s.name
  342. // })
  343. // })
  344. // tempArray[index] = {
  345. // label: item.name,
  346. // options: subject
  347. // }
  348. // })
  349. this.subjectList = result
  350. }
  351. })
  352. },
  353. openEducation(row) {
  354. try {
  355. this.educationList = row.educationalBackground ? JSON.parse(row.educationalBackground) : []
  356. this.educationVisible = true
  357. } catch (error) {
  358. this.$message.error('数据解析失败')
  359. }
  360. },
  361. onTypeDelOpeation(row) {
  362. this.$confirm('您是否删除该内容?', '提示', {
  363. confirmButtonText: '确定',
  364. cancelButtonText: '取消',
  365. type: 'warning'
  366. }).then(() => {
  367. helpCenterContentDelete({ id: row.id }).then(res => {
  368. this.messageTips('删除', res)
  369. })
  370. }).catch(() => {
  371. })
  372. },
  373. onReSet() {
  374. this.searchForm = {...initSearch}
  375. this.getList()
  376. },
  377. onTypeSubmit(formName) {
  378. // 添加数据
  379. this.$refs[formName].validate(valid => {
  380. if (valid) {
  381. if (this.formActionTitle == "create") {
  382. let params = {
  383. title: this.form.title, // 标题
  384. content: this.form.content, // 内容
  385. catalogId: this.form.catalogId[this.form.catalogId.length - 1], // 分类编号
  386. }
  387. helpCenterContentModify(params).then(res => {
  388. this.messageTips("添加", res);
  389. });
  390. } else if (this.formActionTitle == "update") {
  391. let params = {
  392. id: this.form.id,
  393. title: this.form.title, // 标题
  394. content: this.form.content, // 内容
  395. catalogId: this.form.catalogId[this.form.catalogId.length - 1], // 分类编号
  396. }
  397. helpCenterContentModify(params).then(res => {
  398. this.messageTips("修改", res);
  399. });
  400. }
  401. } else {
  402. return false;
  403. }
  404. });
  405. },
  406. messageTips(title, res) {
  407. if (res.code == 200) {
  408. this.$message.success(title + "成功");
  409. this.typeStatus = false;
  410. this.getList();
  411. } else {
  412. this.$message.error(res.msg);
  413. }
  414. },
  415. getList() {
  416. let params = {
  417. ...this.searchForm,
  418. page: this.pageInfo.page,
  419. rows: this.pageInfo.limit
  420. }
  421. employeeInfo(params).then(res => {
  422. let result = res.data;
  423. if (res.code == 200) {
  424. this.tableList = result.rows;
  425. this.pageInfo.total = result.total
  426. }
  427. });
  428. },
  429. getTreeList() {
  430. helpCenterCatalogList({
  431. parentId: 0
  432. }).then(res => {
  433. let result = res.data;
  434. if (res.code == 200) {
  435. this.treeList = this.setTableData(result);
  436. }
  437. });
  438. },
  439. setTableData (result) {
  440. let list = []
  441. list = result.map(res => {
  442. let tempList = {}
  443. tempList = {
  444. value: res.id,
  445. label: res.text,
  446. parentId: res.parentId
  447. }
  448. if (res.children && res.children.length > 0) {
  449. tempList.children = this.setTableData(res.children)
  450. }
  451. return tempList
  452. })
  453. return list
  454. },
  455. openTypes(type, row) {
  456. this.rowDetail = {...row}
  457. this.typeStatus = true
  458. this.formActionTitle = type
  459. if (type == "update") {
  460. // 修改的时候赋值
  461. this.form = {
  462. id: row.id,
  463. title: row.title, // 标题
  464. content: row.content, // 内容
  465. catalogId: this.getAllIds(row), // 分类编号
  466. };
  467. }
  468. },
  469. onToUrl() {
  470. this.$router.push('/insideSetting/helpCategory')
  471. },
  472. getAllIds(row) {
  473. let idAndParent=[];// idAndParent保存 Tree所有节点的id和parentId
  474. this.getIdAndParent(this.treeList,idAndParent);
  475. let parentIds = []; // 用于保存选中节点的父节点及父节点的父节点
  476. this.getId(row.catalogId, parentIds, idAndParent);
  477. return parentIds.reverse(); //反转数组
  478. },
  479. getIdAndParent(tree, idAndParentIds) {// idAndParentIds用来保存所有节点的id,parentId
  480. // 对原有的数据结构进行遍历,拿出所有节点的id,parentId到一个一维数组中。
  481. tree.forEach(item => {
  482. let mid = {
  483. id: item.value,
  484. parentId: item.parentId,
  485. };
  486. idAndParentIds.push(mid);
  487. if (item.children) {
  488. this.getIdAndParent(item.children, idAndParentIds);
  489. }
  490. });
  491. },
  492. getId(id, parentIds, idAndParent) {
  493. idAndParent.forEach(item => {
  494. if (item.id == id) {
  495. parentIds.push(id);
  496. if (item.parentId != -1) {
  497. this.getId(item.parentId, parentIds, idAndParent);
  498. }
  499. }
  500. });
  501. },
  502. onFormClose(formName) {
  503. this.rowDetail = null
  504. this.typeStatus = false
  505. // 关闭弹窗重置验证
  506. this.form = {
  507. title: null, // 标题
  508. content: null, // 内容
  509. catalogId: [], // 分类编号
  510. }
  511. // this.$refs.cascader.handleClear()
  512. // this.$refs[formName].resetFields();
  513. }
  514. }
  515. };
  516. </script>
  517. <style lang="scss" scoped>
  518. .el-button--primary {
  519. background: #14928a;
  520. border-color: #14928a;
  521. color: #fff;
  522. &:hover,
  523. &:active,
  524. &:focus {
  525. background: #14928a;
  526. border-color: #14928a;
  527. color: #fff;
  528. }
  529. }
  530. /deep/.el-date-editor.el-input {
  531. width: 100% !important;
  532. }
  533. /deep/.el-select {
  534. width: 100% !important;
  535. }
  536. /deep/.el-table .cell {
  537. display: -webkit-box;
  538. overflow: hidden;
  539. max-height: 45px;
  540. text-overflow: ellipsis;
  541. -webkit-line-clamp: 3;
  542. -webkit-box-orient: vertical;
  543. }
  544. /deep/.el-dialog__body {
  545. padding: 10px 20px;
  546. }
  547. .newBand {
  548. display: inline-block;
  549. }
  550. </style>