resumeList.vue 19 KB

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