resumeList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. <!--
  2. * @Description: create
  3. * @Version: 1.0
  4. * @Autor: XuTongZhang
  5. * @Date: 2020-07-30 09:53:19
  6. * @LastEditors: XuTongZhang
  7. * @LastEditTime: 2020-08-12 15:35:50
  8. -->
  9. <template>
  10. <div class="indexPage">
  11. <v-input
  12. :btn="btn"
  13. :list="list"
  14. @del="delAll"
  15. @notice="noticeAll"
  16. @through="throughAll"
  17. @eliminate="eliminateAll"
  18. @undetermined="undeterminedAll"
  19. @search="search"
  20. ></v-input>
  21. <el-radio-group v-model="isCollapse" size="medium" style="margin-bottom: 20px;">
  22. <el-radio-button :label="0">未读</el-radio-button>
  23. <el-radio-button :label="1">适合</el-radio-button>
  24. <el-radio-button :label="2">不适合</el-radio-button>
  25. <el-radio-button :label="3">待定</el-radio-button>
  26. <el-radio-button :label="4">已通知</el-radio-button>
  27. </el-radio-group>
  28. <v-table
  29. :key="isCollapse"
  30. :table="isCollapse===4?throughTable:table"
  31. :tableList="tableList"
  32. :sortType="true"
  33. :queryData="queryData"
  34. :form="searchForm"
  35. @details="details"
  36. @notice="notice"
  37. @through="through"
  38. @eliminate="eliminate"
  39. @del="del"
  40. @undetermined="undetermined"
  41. @toVedio="toVedio"
  42. @selection-change="selection"
  43. id="id"
  44. ></v-table>
  45. <v-pager @page="callPage" :total="totalrecords"></v-pager>
  46. <el-dialog
  47. :visible.sync="dialogFormVisible"
  48. width="600px"
  49. :before-close="close"
  50. :close-on-click-modal="false"
  51. >
  52. <el-form :model="form" ref="form" label-width="140px" :rules="rules" label-position="left">
  53. <el-form-item label-width="0">
  54. <div class="title">通知群发列表</div>
  55. <div class="content">
  56. <el-tag
  57. v-for="(item, index) in copyPickList"
  58. :key="item"
  59. closable
  60. @close="copyPickList.splice(index, 1)"
  61. type="success"
  62. >{{tableList.some(i => i.id === item) ? tableList.find(i => i.id === item).delivererName : ''}}</el-tag>
  63. </div>
  64. </el-form-item>
  65. <el-form-item label="选择群发模板" prop="templateId">
  66. <el-select v-model="form.templateId" placeholder="请选择群发模板">
  67. <el-option
  68. v-for="item in downList"
  69. :key="item.id"
  70. :label="item.templateName"
  71. :value="item.id"
  72. ></el-option>
  73. </el-select>
  74. <!-- <div v-else>{{this.downList1.some(i => i.id === form.processId) ? this.downList1.find(i => i.id === form.processId).processName : ''}}</div> -->
  75. </el-form-item>
  76. <el-form-item label="群发邮箱">139820930@qq.com</el-form-item>
  77. <el-form-item>
  78. <el-button @click="close">取消</el-button>
  79. <el-button type="primary" @click="launch">立即发出</el-button>
  80. </el-form-item>
  81. </el-form>
  82. </el-dialog>
  83. </div>
  84. </template>
  85. <script>
  86. export default {
  87. data () {
  88. return {
  89. tableList: [],
  90. dialogFormVisible: false,
  91. page: 1,
  92. isCollapse: 0,
  93. totalrecords: 0,
  94. pickList: [],
  95. copyPickList: [],
  96. downList: [],
  97. form: {},
  98. searchForm: {},
  99. rules: {
  100. templateId: [
  101. { required: true, message: '请选择群发模板', trigger: 'blur' }
  102. ]
  103. },
  104. list: [
  105. {
  106. placeholder: '请输入关键字查询',
  107. props: 'condition'
  108. },
  109. {
  110. type: 'select',
  111. placeholder: '性别',
  112. props: 'delivererSex',
  113. options: [
  114. { label: '男', value: 1 },
  115. { label: '女', value: 0 }
  116. ]
  117. },
  118. {
  119. type: 'select',
  120. placeholder: '来源',
  121. props: 'resumeFrom',
  122. options: [
  123. { label: '51job', value: 0 },
  124. { label: '智联', value: 1 },
  125. { label: '58同城', value: 2 }
  126. ]
  127. },
  128. {
  129. placeholder: '请输入投递职位',
  130. props: 'positionApplied'
  131. }
  132. ],
  133. btn: [
  134. {
  135. name: '确定',
  136. type: 'primary',
  137. method: 'search'
  138. },
  139. {
  140. name: '标记待定',
  141. type: 'success',
  142. method: 'undetermined'
  143. },
  144. {
  145. name: '标记通过',
  146. type: 'primary',
  147. method: 'through'
  148. },
  149. {
  150. name: '标题淘汰',
  151. type: 'warning',
  152. method: 'eliminate'
  153. },
  154. {
  155. name: '删除',
  156. type: 'danger',
  157. method: 'del'
  158. }
  159. ],
  160. table: {
  161. selection: true,
  162. column: [
  163. {
  164. label: '编号',
  165. props: 'id'
  166. },
  167. {
  168. label: '姓名',
  169. props: 'delivererName'
  170. },
  171. {
  172. label: '性别',
  173. props: 'delivererSex',
  174. options: ['女', '男']
  175. },
  176. {
  177. label: '简历来源',
  178. props: 'resumeFrom',
  179. options: ['51job', '智联招聘', '58同城']
  180. },
  181. {
  182. label: '简历投递时间',
  183. props: 'createTime'
  184. },
  185. {
  186. label: '简历投递职位',
  187. props: 'positionApplied'
  188. },
  189. {
  190. label: '工作年限',
  191. props: 'delivererWorkExp'
  192. },
  193. {
  194. label: '学历',
  195. props: 'delivererEducation'
  196. },
  197. {
  198. label: '联系电话',
  199. props: 'delivererPhone'
  200. }
  201. ],
  202. width: 420,
  203. handle: [
  204. {
  205. title: '查看简历',
  206. method: 'details',
  207. type: 'info'
  208. },
  209. {
  210. title: '标记待定',
  211. method: 'undetermined',
  212. type: 'success'
  213. },
  214. {
  215. title: '标记通过',
  216. method: 'through',
  217. type: 'primary'
  218. },
  219. {
  220. title: '标记淘汰',
  221. method: 'eliminate',
  222. type: 'warning'
  223. },
  224. {
  225. title: '删除',
  226. method: 'del',
  227. type: 'danger'
  228. }
  229. ]
  230. },
  231. throughTable: {
  232. selection: true,
  233. column: [
  234. {
  235. label: '编号',
  236. props: 'id'
  237. },
  238. {
  239. label: '姓名',
  240. props: 'delivererName'
  241. },
  242. {
  243. label: '性别',
  244. props: 'delivererSex',
  245. options: ['女', '男']
  246. },
  247. {
  248. label: '简历来源',
  249. props: 'resumeFrom',
  250. options: ['51job', '智联招聘', '58同城']
  251. },
  252. {
  253. label: '简历投递时间',
  254. props: 'createTime'
  255. },
  256. {
  257. label: '当前状态',
  258. props: 'interviewStatus',
  259. options: ['未面试', '已面试']
  260. },
  261. {
  262. label: '简历投递职位',
  263. props: 'positionApplied'
  264. },
  265. {
  266. label: '工作年限',
  267. props: 'delivererWorkExp'
  268. },
  269. {
  270. label: '学历',
  271. props: 'delivererEducation'
  272. },
  273. {
  274. label: '联系电话',
  275. props: 'delivererPhone'
  276. }
  277. ],
  278. width: 300,
  279. handle: [
  280. {
  281. title: '查看简历',
  282. method: 'details',
  283. type: 'info'
  284. },
  285. {
  286. title: '查看视频',
  287. method: 'toVedio',
  288. type: 'warning',
  289. props: 'interviewStatus',
  290. key: 1
  291. },
  292. {
  293. title: '删除',
  294. method: 'del',
  295. type: 'danger'
  296. }
  297. ]
  298. }
  299. }
  300. },
  301. mounted () {
  302. this.queryData()
  303. this.queryDownList()
  304. },
  305. methods: {
  306. queryData (form = {}) {
  307. let page = this.page
  308. this.searchForm = form
  309. let reqdata = form
  310. switch (this.isCollapse) {
  311. case 0:
  312. reqdata.isPass = 0
  313. reqdata.isSendInviteMail = 0
  314. break
  315. case 1:
  316. reqdata.isPass = 1
  317. reqdata.isSendInviteMail = 0
  318. break
  319. case 2:
  320. reqdata.isPass = 2
  321. reqdata.isSendInviteMail = 0
  322. break
  323. case 3:
  324. reqdata.isPass = 3
  325. reqdata.isSendInviteMail = 0
  326. break
  327. case 4:
  328. reqdata.isPass = 1
  329. reqdata.isSendInviteMail = 1
  330. break
  331. default:
  332. break
  333. }
  334. this.$api
  335. .post('/resumeInfo/queryResumeList', {
  336. reqdata,
  337. page
  338. })
  339. .then((res) => {
  340. this.totalrecords = res.totalrecords
  341. this.tableList = res.list
  342. })
  343. },
  344. queryDownList () {
  345. this.$api
  346. .post('/template/queryTemplateList', {
  347. reqdata: {}
  348. })
  349. .then((res) => {
  350. this.downList = res.list
  351. })
  352. // this.$api
  353. // .post('/position/queryPositionList', {
  354. // reqdata: {}
  355. // })
  356. // .then((res) => {
  357. // this.list[3].options = res.list.map((item) => ({
  358. // value: item.id,
  359. // label: item.positionName
  360. // }))
  361. // })
  362. },
  363. search (form) {
  364. this.queryData(form)
  365. },
  366. details ({ id }) {
  367. this.$api
  368. .post('/resumeInfo/queryResumeInfoDetail', {
  369. reqdata: {
  370. id
  371. }
  372. })
  373. .then((res) => {
  374. res.object.filePath ? window.open(this.$img + res.object.filePath) : this.$message({ type: 'info', message: '无此人简历' })
  375. })
  376. },
  377. launch () {
  378. let a
  379. this.$refs['form'].validate((valid) => {
  380. a = valid
  381. })
  382. if (!a) return
  383. let resumeInfoStatusList = this.copyPickList.map(item => ({ id: item, templateId: this.form.templateId }))
  384. this.copyPickList.length
  385. ? this.$api
  386. .post('/resumeInfo/sendInviteMail', {
  387. reqdata: {
  388. resumeInfoStatusList
  389. }
  390. })
  391. .then((res) => {
  392. this.$message({
  393. message: '通知成功',
  394. type: 'success'
  395. })
  396. this.close()
  397. this.queryData(this.searchForm)
  398. })
  399. : this.$message({ type: 'info', message: '请添加需要通知的对象' })
  400. },
  401. notice (row) {
  402. this.open()
  403. this.copyPickList = [row.id]
  404. },
  405. noticeAll () {
  406. this.pickList.length
  407. ? this.open()
  408. : this.$message({ type: 'info', message: '请选择需要通知的对象' })
  409. },
  410. through (row, type = false) {
  411. let ids = type ? row : [row.id]
  412. let resumeInfoStatusList = ids.map(item => ({ id: item, isPass: 1 }))
  413. this.$api
  414. .post('/resumeInfo/changeReadType', {
  415. reqdata: {
  416. resumeInfoStatusList
  417. }
  418. })
  419. .then((res) => {
  420. this.queryData(this.searchForm)
  421. })
  422. },
  423. throughAll () {
  424. this.pickList.length
  425. ? this.through(this.copyPickList, true)
  426. : this.$message({ type: 'info', message: '请选择通过的应聘者' })
  427. },
  428. eliminate (row, type = false) {
  429. let ids = type ? row : [row.id]
  430. let resumeInfoStatusList = ids.map(item => ({ id: item, isPass: 2 }))
  431. this.$api
  432. .post('/resumeInfo/changeReadType', {
  433. reqdata: {
  434. resumeInfoStatusList
  435. }
  436. })
  437. .then((res) => {
  438. this.queryData(this.searchForm)
  439. })
  440. },
  441. eliminateAll () {
  442. this.pickList.length
  443. ? this.eliminate(this.pickList, true)
  444. : this.$message({ type: 'info', message: '请选择被淘汰的应聘者' })
  445. },
  446. del (row, type = false) {
  447. let ids = type ? row : [row.id]
  448. let resumeInfoStatusList = ids.map(item => ({ id: item, status: 1 }))
  449. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  450. confirmButtonText: '确定',
  451. cancelButtonText: '取消',
  452. type: 'warning'
  453. })
  454. .then(() => {
  455. this.$api
  456. .post('/resumeInfo/deleteResumeInfo', {
  457. reqdata: {
  458. resumeInfoStatusList
  459. }
  460. })
  461. .then((res) => {
  462. this.queryData(this.searchForm)
  463. this.$message({
  464. type: 'success',
  465. message: '删除成功!'
  466. })
  467. })
  468. })
  469. .catch(() => {
  470. this.$message({
  471. type: 'info',
  472. message: '已取消删除'
  473. })
  474. })
  475. },
  476. delAll () {
  477. this.pickList.length
  478. ? this.del(this.pickList, true)
  479. : this.$message({ type: 'info', message: '请选择需要删除的内容' })
  480. },
  481. undetermined (row, type = false) {
  482. let ids = type ? row : [row.id]
  483. let resumeInfoStatusList = ids.map(item => ({ id: item, isPass: 3 }))
  484. this.$api
  485. .post('/resumeInfo/changeReadType', {
  486. reqdata: {
  487. resumeInfoStatusList
  488. }
  489. })
  490. .then((res) => {
  491. this.queryData(this.searchForm)
  492. })
  493. },
  494. undeterminedAll () {
  495. this.pickList.length
  496. ? this.undetermined(this.pickList, true)
  497. : this.$message({ type: 'info', message: '请选择待定的应聘者' })
  498. },
  499. toVedio () {
  500. window.open('candidateList')
  501. },
  502. selection (val) {
  503. this.$set(this.$data, 'pickList', val)
  504. },
  505. open () {
  506. this.dialogFormVisible = true
  507. },
  508. close () {
  509. this.dialogFormVisible = false
  510. this.form = {}
  511. this.copyPickList = Array.from(this.pickList)
  512. },
  513. callPage (val) {
  514. this.page = val
  515. this.queryData(this.searchForm)
  516. }
  517. },
  518. watch: {
  519. pickList () {
  520. this.copyPickList = Array.from(this.pickList)
  521. },
  522. isCollapse () {
  523. this.queryData(this.searchForm)
  524. this.$set(
  525. this.table,
  526. 'handle',
  527. this.isCollapse === 0
  528. ? [
  529. {
  530. title: '查看简历',
  531. method: 'details',
  532. type: 'info'
  533. },
  534. {
  535. title: '标记待定',
  536. method: 'undetermined',
  537. type: 'success'
  538. },
  539. {
  540. title: '标记通过',
  541. method: 'through',
  542. type: 'primary'
  543. },
  544. {
  545. title: '标记淘汰',
  546. method: 'eliminate',
  547. type: 'warning'
  548. },
  549. {
  550. title: '标记待定',
  551. method: 'undetermined',
  552. type: 'warning'
  553. }
  554. // {
  555. // title: '删除',
  556. // method: 'del',
  557. // type: 'danger'
  558. // }
  559. ]
  560. : this.isCollapse === 1
  561. ? [
  562. {
  563. title: '查看简历',
  564. method: 'details',
  565. type: 'info'
  566. },
  567. {
  568. title: '标记淘汰',
  569. method: 'eliminate',
  570. type: 'warning'
  571. },
  572. {
  573. title: '通知面试',
  574. method: 'notice',
  575. type: 'success'
  576. }
  577. ]
  578. : this.isCollapse === 2
  579. ? [
  580. {
  581. title: '查看简历',
  582. method: 'details',
  583. type: 'info'
  584. },
  585. {
  586. title: '标记通过',
  587. method: 'through',
  588. type: 'primary'
  589. },
  590. {
  591. title: '删除',
  592. method: 'del',
  593. type: 'danger'
  594. }
  595. ]
  596. : [
  597. {
  598. title: '查看简历',
  599. method: 'details',
  600. type: 'info'
  601. },
  602. {
  603. title: '通知面试',
  604. method: 'notice',
  605. type: 'success'
  606. },
  607. {
  608. title: '标记通过',
  609. method: 'through',
  610. type: 'primary'
  611. },
  612. {
  613. title: '标记淘汰',
  614. method: 'eliminate',
  615. type: 'warning'
  616. }
  617. ]
  618. )
  619. this.$set(
  620. this.$data,
  621. 'btn',
  622. this.isCollapse === 0
  623. ? [
  624. {
  625. name: '确定',
  626. type: 'primary',
  627. method: 'search'
  628. },
  629. {
  630. name: '标记待定',
  631. type: 'success',
  632. method: 'undetermined'
  633. },
  634. {
  635. name: '标记通过',
  636. type: 'primary',
  637. method: 'through'
  638. },
  639. {
  640. name: '标题淘汰',
  641. type: 'warning',
  642. method: 'eliminate'
  643. },
  644. {
  645. name: '删除',
  646. type: 'danger',
  647. method: 'del'
  648. }
  649. ]
  650. : this.isCollapse === 1
  651. ? [
  652. {
  653. name: '确定',
  654. type: 'primary',
  655. method: 'search'
  656. },
  657. {
  658. name: '通知面试',
  659. type: 'success',
  660. method: 'notice'
  661. },
  662. {
  663. name: '标题淘汰',
  664. type: 'warning',
  665. method: 'eliminate'
  666. }
  667. ]
  668. : this.isCollapse === 2
  669. ? [
  670. {
  671. name: '确定',
  672. type: 'primary',
  673. method: 'search'
  674. },
  675. {
  676. name: '标记通过',
  677. type: 'primary',
  678. method: 'through'
  679. },
  680. {
  681. name: '删除',
  682. type: 'danger',
  683. method: 'del'
  684. }
  685. ]
  686. : this.isCollapse === 3
  687. ? [
  688. {
  689. name: '确定',
  690. type: 'primary',
  691. method: 'search'
  692. },
  693. {
  694. name: '标记通过',
  695. type: 'primary',
  696. method: 'through'
  697. },
  698. {
  699. name: '删除',
  700. type: 'danger',
  701. method: 'del'
  702. }
  703. ]
  704. : [
  705. {
  706. name: '确定',
  707. type: 'primary',
  708. method: 'search'
  709. },
  710. {
  711. name: '删除',
  712. type: 'danger',
  713. method: 'del'
  714. }
  715. ]
  716. )
  717. this.$set(
  718. this.table,
  719. 'width',
  720. this.isCollapse === 0
  721. ? 420 : this.isCollapse === 1
  722. ? 300 : this.isCollapse === 2
  723. ? 300 : 400
  724. )
  725. }
  726. }
  727. }
  728. </script>
  729. <style lang="scss" scoped>
  730. .title {
  731. font-size: 20px;
  732. font-weight: bold;
  733. }
  734. .content {
  735. min-height: 50px;
  736. > span {
  737. margin: 5px;
  738. }
  739. }
  740. </style>