postMessage.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. <template>
  2. <view>
  3. <u-navbar back-text="发布求职信息" back-icon-size="28" back-icon-color="#ffffff"
  4. :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
  5. <!-- 基本信息 -->
  6. <view class="information-group">
  7. <view class="headline">
  8. 基本信息
  9. </view>
  10. <!-- 职位名称 -->
  11. <view class="item">
  12. <view class="title">
  13. <text>*</text>职位名称
  14. </view>
  15. <view class="input">
  16. <u-input type="text" v-model="formData.positionName" placeholder="请填写职位名称"></u-input>
  17. </view>
  18. </view>
  19. <!--结算形式 -->
  20. <view class="item">
  21. <view class="title">
  22. <text>*</text>结算形式
  23. </view>
  24. <view class="input">
  25. <u-input type="select" v-model="settlementMethod" @click="showselect(1)"
  26. placeholder="请选择结算形式"></u-input>
  27. </view>
  28. </view>
  29. <!-- *薪资待遇 -->
  30. <view class="item">
  31. <view class="title">
  32. <text>*</text>薪资待遇
  33. </view>
  34. <view class="input2">
  35. <u-input type="text" v-model="formData.salary" placeholder="请填写薪资待遇"></u-input>
  36. </view>
  37. <view class="unit">
  38. {{getUnit(formData)}}
  39. </view>
  40. <!-- <view class="icon" @click="showselect(0)">
  41. <u-icon name="arrow-right" color="#999999"></u-icon>
  42. </view> -->
  43. </view>
  44. <!-- 行业 -->
  45. <view class="item">
  46. <view class="title">
  47. <text>*</text>行业
  48. </view>
  49. <view class="input">
  50. <u-input type="select" v-model="industry" @click="popupShow=true" readonly
  51. placeholder="请选择行业"></u-input>
  52. </view>
  53. </view>
  54. <!-- 招聘人数 -->
  55. <view class="item">
  56. <view class="title">
  57. <text>*</text>招聘人数
  58. </view>
  59. <view class="input">
  60. <u-input type="number" v-model="formData.recruitingNumbers" placeholder="请填写招聘人数"></u-input>
  61. </view>
  62. </view>
  63. <!-- 招聘人数 -->
  64. <view class="item">
  65. <view class="title">
  66. 年龄要求
  67. </view>
  68. <view class="input">
  69. <u-input type="text" v-model="formData.ageRequirement" placeholder="请填写年龄要求"></u-input>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 工作描述 -->
  74. <view class="job-description">
  75. <view class="title">
  76. <text>*</text>工作描述
  77. </view>
  78. <textarea class="textarea" v-model="formData.desc" placeholder="请简单描述工作内容及职位要求"></textarea>
  79. </view>
  80. <!-- 个人信息 -->
  81. <view class="information-group">
  82. <view class="headline">
  83. 基本信息
  84. </view>
  85. <!-- 联系人 -->
  86. <view class="item">
  87. <view class="title">
  88. <text>*</text>联系人
  89. </view>
  90. <view class="input">
  91. <u-input type="text" v-model="formData.contacts" placeholder="请填写联系人"></u-input>
  92. </view>
  93. </view>
  94. <!-- 联系电话 -->
  95. <view class="item">
  96. <view class="title">
  97. <text>*</text>联系电话
  98. </view>
  99. <view class="input">
  100. <u-input type="text" v-model="formData.contactsPhone" placeholder="请填写联系电话"></u-input>
  101. </view>
  102. </view>
  103. <!--工作地区 -->
  104. <view class="item">
  105. <view class="title">
  106. <text>*</text>工作地区
  107. </view>
  108. <view class="input">
  109. <u-input type="select" v-model="workArea" @click="showselect(3)" placeholder="请选择工作地区"></u-input>
  110. </view>
  111. </view>
  112. <!-- 详细地址 -->
  113. <view class="item">
  114. <view class="title">
  115. <text>*</text>详细地址
  116. </view>
  117. <view class="input">
  118. <u-input type="text" v-model="formData.address" placeholder="请填写详细的工作地址"></u-input>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="information-group">
  123. <view class="headline">
  124. 展示图片<span>(最多上传5张)</span>
  125. </view>
  126. <u-upload ref="uUpload" :action="action" name="photoFile" :file-list="listPic"
  127. :form-data="formDataUpload" :header="header" width="180" max-count="5" @on-success="onSuccess">
  128. </u-upload>
  129. </view>
  130. <u-select v-model="show" value-name="value" label-name="name" :list="list" @confirm="confirm"></u-select>
  131. <button class="issue" @click="submit()" type="default">提交审核</button>
  132. <!-- 筛选框 -->
  133. <u-popup v-model="popupShow" @open="popupShowOpen" mode="bottom" border-radius="20" :closeable="true">
  134. <view class="popup-content">
  135. <view class="headline">
  136. 筛选
  137. </view>
  138. <!-- 行业 -->
  139. <view class="industry">
  140. <view class="title">
  141. <u-search v-model="querypop"></u-search>
  142. <view>意向行业 <span
  143. style="color: #4696f6;">{{isChecked!=-1?'已选中:'+industryList[isChecked].name:''}}</span>
  144. (向下拉可滑动)</view>
  145. </view>
  146. <!-- 选项 -->
  147. <scroll-view class="scrollview" scroll-y="true" style="height: 620rpx;">
  148. <view class="options">
  149. <view :class="{item,checked:isChecked==index}" v-for="(item,index) in industryList"
  150. v-show="item.name.indexOf(querypop)!=-1" :key="index" @click="changeChecked(index)">
  151. <!-- 快递跑腿/配送/分拣 -->{{item.name}}
  152. </view>
  153. </view>
  154. </scroll-view>
  155. </view>
  156. <!-- 结算方式 -->
  157. <view class="clearing-form" v-if="false">
  158. <view class="title">
  159. 结算方式
  160. </view>
  161. <!-- 选项 -->
  162. <view class="options">
  163. <view :class="{item,checked:wayChecked==index}" v-for="(item,index) in wayList" :key="index"
  164. @click="changeWayChecked(index)">
  165. {{item.name}}
  166. </view>
  167. </view>
  168. </view>
  169. <!-- 薪资形式 -->
  170. <view class="salary-form" v-if="false">
  171. <view class="title">
  172. 薪资形式
  173. </view>
  174. <!-- 选项 -->
  175. <view class="options ">
  176. <view :class="{item,checked:saralyChecked==index}" v-for="(item,index) in salaryList"
  177. :key="index" @click="changeSaralyChecked(index)">
  178. {{item.name}}
  179. </view>
  180. </view>
  181. </view>
  182. <view class="button">
  183. <button class="reset" @click="reset()">重置</button>
  184. <button class="confirm" @click="queryBtn()">确认</button>
  185. </view>
  186. </view>
  187. </u-popup>
  188. </view>
  189. </template>
  190. <script>
  191. import * as API_weixin from '@/apis/weixin.js'
  192. import * as API from '@/apis/pagejs/packages.js'
  193. export default {
  194. data() {
  195. return {
  196. querypop: "",
  197. popupShow: false,
  198. isChecked: -1,
  199. industryList: [],
  200. selectIndex: 0,
  201. show: false,
  202. list: [],
  203. formData: {
  204. positionName: "",
  205. salary: "",
  206. settlementMethod: "",
  207. industry: "",
  208. recruitingNumbers: "",
  209. desc: "",
  210. contacts: "",
  211. contactsPhone: "",
  212. workArea: "",
  213. address: "",
  214. salaryForm: "2",
  215. ageRequirement:"",
  216. images:"",
  217. },
  218. settlementMethod: "",
  219. salaryForm: "计时",
  220. industry: "",
  221. workArea: "",
  222. sqlList: [
  223. [],
  224. [{
  225. "name": "日结",
  226. "value": "1",
  227. },
  228. {
  229. "name": "周结",
  230. "value": "2",
  231. },
  232. {
  233. "name": "月结",
  234. "value": "3",
  235. }
  236. ],
  237. [],
  238. [],
  239. [],
  240. [],
  241. []
  242. ],
  243. valueList: [-1, -1, -1, -1, -1, -1],
  244. userInfo: {},
  245. id: "",
  246. formDataUpload:{},
  247. action: '',
  248. header: '',
  249. listPic: [],
  250. }
  251. },
  252. onLoad(op) {
  253. this.userInfo = this.carhelp.getPersonInfo()
  254. if (op.id) {
  255. this.id = op.id
  256. this.getInfo()
  257. } else {
  258. var enterpriseInfo = this.carhelp.getPersonInfoPlus().enterpriseInfo
  259. if(enterpriseInfo){
  260. this.formData.contacts = enterpriseInfo.contactsPersonId
  261. this.formData.address = enterpriseInfo.address
  262. }
  263. }
  264. this.action = process.car.BASE_URL+"uploadPicture";
  265. this.formDataUpload = {
  266. subFolder: "laborManagement"
  267. }
  268. var token = this.carhelp.getToken();
  269. this.header={
  270. 'Authorization': token,
  271. 'X-Requested-With': 'XMLHttpRequest'
  272. }
  273. //this.tel=this.userInfo.phone
  274. },
  275. methods: {
  276. onSuccess(data, index, lists, name) {
  277. console.log(this.$refs.uUpload.lists)
  278. if(data.result) {
  279. }
  280. },
  281. reset() {
  282. this.isChecked = -1;
  283. },
  284. queryBtn() {
  285. this.formData.industry = this.industryList[this.isChecked].value
  286. this.industry = this.industryList[this.isChecked].name
  287. this.popupShow = false;
  288. },
  289. changeChecked(index) {
  290. this.isChecked = index;
  291. },
  292. popupShowOpen() {
  293. if (this.industryList.length == 0) {
  294. uni.showLoading({
  295. title: "加载中",
  296. mask: true,
  297. })
  298. API_weixin.findListByCatalogName({
  299. name: '意向行业',
  300. }).then((res) => {
  301. uni.hideLoading();
  302. this.industryList = res.data.dictionaryList
  303. }).catch(error => {
  304. uni.showToast({
  305. icon: 'none',
  306. title: error
  307. })
  308. //this.getPhone()
  309. })
  310. }
  311. },
  312. getInfo() {
  313. uni.showLoading({
  314. title: "加载中",
  315. mask: true,
  316. })
  317. API.recruitDetail({
  318. recruitId: this.id
  319. }).then((res) => {
  320. uni.hideLoading()
  321. if (res.data.recruitInformationInfo) {
  322. this.formData = res.data.recruitInformationInfo;
  323. var name = ["salaryForm", "settlementMethod", "industry", ]
  324. for (var i in name) {
  325. //.log(name[i]+'N')
  326. this[name[i]] = this.formData[(name[i] + 'N')]
  327. }
  328. this.workArea = this.formData.workArea
  329. this.listPic=JSON.parse(this.formData.images)
  330. for(var i in this.listPic){
  331. var obj=this.listPic[i]
  332. obj.progress=100
  333. obj.error=false
  334. obj.response={
  335. code: 200,
  336. data: obj.url,
  337. message: null,
  338. result: true
  339. }
  340. }
  341. this.$refs.uUpload.lists=this.listPic
  342. }
  343. }).catch(error => {
  344. uni.showToast({
  345. icon: 'none',
  346. title: error,
  347. icon: "none"
  348. })
  349. })
  350. },
  351. confirm(e) {
  352. this.show = false;
  353. var name = ["salaryForm", "settlementMethod",
  354. "industry",
  355. "workArea",
  356. ]
  357. this[name[this.selectIndex]] = e[0].label
  358. this.formData[name[this.selectIndex]] = e[0].value
  359. //.log(e)
  360. },
  361. showselect(k) {
  362. this.selectIndex = k;
  363. if (this.sqlList[k].length == 0) {
  364. var name = ['薪资形式', '结算方式', '意向行业', '工作地区']
  365. uni.showLoading({
  366. title: "加载中",
  367. mask: true,
  368. })
  369. API_weixin.findListByCatalogName({
  370. name: name[k],
  371. }).then((res) => {
  372. uni.hideLoading();
  373. this.sqlList[k] = res.data.dictionaryList
  374. this.list = this.sqlList[k];
  375. this.show = true
  376. }).catch(error => {
  377. uni.showToast({
  378. icon: 'none',
  379. title: error
  380. })
  381. //this.getPhone()
  382. })
  383. } else {
  384. this.list = this.sqlList[k];
  385. this.show = true
  386. }
  387. },
  388. submit() {
  389. this.formData.images="";
  390. var imgs= this.$refs.uUpload.lists.filter(val => {
  391. return val.progress == 100;
  392. })
  393. if(imgs&&imgs.length){
  394. var str =imgs.map(item=>{
  395. return {
  396. name:"1.jpg",
  397. url:item.response.data
  398. }
  399. })
  400. console.log(str)
  401. this.formData.images=JSON.stringify(str);
  402. }
  403. if (!this.formData.positionName) {
  404. uni.showToast({
  405. icon: 'none',
  406. title: "请填写职位名称"
  407. })
  408. return
  409. }
  410. if (!this.formData.salary) {
  411. uni.showToast({
  412. icon: 'none',
  413. title: "请填写薪资待遇"
  414. })
  415. return
  416. }
  417. if (!this.formData.settlementMethod) {
  418. uni.showToast({
  419. icon: 'none',
  420. title: "请选择结算形式"
  421. })
  422. return
  423. }
  424. if (!this.formData.industry) {
  425. uni.showToast({
  426. icon: 'none',
  427. title: "请选择行业"
  428. })
  429. return
  430. }
  431. if (!this.formData.recruitingNumbers) {
  432. uni.showToast({
  433. icon: 'none',
  434. title: "请填写招聘人数"
  435. })
  436. return
  437. }
  438. if (!this.formData.desc) {
  439. uni.showToast({
  440. icon: 'none',
  441. title: "请简单描述工作内容及职位要求"
  442. })
  443. return
  444. }
  445. if (!this.formData.contacts) {
  446. uni.showToast({
  447. icon: 'none',
  448. title: "请填写联系人"
  449. })
  450. return
  451. }
  452. if (!this.formData.contactsPhone) {
  453. uni.showToast({
  454. icon: 'none',
  455. title: "请填写联系电话"
  456. })
  457. return
  458. }
  459. if (!this.formData.workArea) {
  460. uni.showToast({
  461. icon: 'none',
  462. title: "请选择工作地区"
  463. })
  464. return
  465. }
  466. if (!this.formData.address) {
  467. uni.showToast({
  468. icon: 'none',
  469. title: "请填写详细的工作地址"
  470. })
  471. return
  472. }
  473. this.formData.workArea = this.workArea
  474. uni.showLoading({
  475. title: "加载中",
  476. mask: true,
  477. })
  478. API.createRecruit(this.formData).then((res) => {
  479. uni.hideLoading();
  480. const eventChannel = this.getOpenerEventChannel();
  481. eventChannel.emit('refreshData');
  482. uni.showModal({
  483. title: '提示',
  484. content: '提交成功,等待审核!',
  485. showCancel: false,
  486. success: function(res) {
  487. if (res.confirm) {
  488. uni.navigateBack()
  489. } else if (res.cancel) {
  490. //.log('用户点击取消');
  491. }
  492. }
  493. });
  494. }).catch(error => {
  495. uni.showToast({
  496. icon: 'none',
  497. title: error
  498. })
  499. //this.getPhone()
  500. })
  501. }
  502. }
  503. }
  504. </script>
  505. <style>
  506. page {
  507. background: #F0F0F2;
  508. padding-bottom: 150px;
  509. }
  510. </style>
  511. <style lang="scss" scoped>
  512. .information-group {
  513. margin: 32rpx;
  514. padding: 24rpx 32rpx;
  515. background-color: #fff;
  516. border-radius: 24rpx;
  517. .headline {
  518. color: rgba(16, 16, 16, 1);
  519. font-size: 36rpx;
  520. margin-bottom: 24rpx;
  521. font-family: 'PingFangSC-medium';
  522. span{
  523. font-size: 24rpx;
  524. color: #9E9E9E;
  525. }
  526. }
  527. .item {
  528. display: flex;
  529. align-items: center;
  530. padding: 12rpx 0;
  531. border-bottom: 1px solid #f1f1f1;
  532. .title {
  533. color: rgba(51, 51, 51, 1);
  534. font-size: 32rpx;
  535. width: 148rpx;
  536. text {
  537. color: #EE3138
  538. }
  539. }
  540. .input {
  541. width: 450rpx;
  542. margin-left: 24rpx;
  543. /deep/.uni-input-input {
  544. color: rgba(51, 51, 51, 1);
  545. }
  546. }
  547. .input2 {
  548. width: 350rpx;
  549. margin-left: 24rpx;
  550. /deep/.uni-input-input {
  551. color: rgba(51, 51, 51, 1);
  552. }
  553. }
  554. .icon {
  555. margin-left: auto;
  556. }
  557. .unit {
  558. margin-left: auto;
  559. color: rgba(51, 51, 51, 1);
  560. font-size: 32rpx;
  561. }
  562. }
  563. }
  564. // 工作描述
  565. .job-description {
  566. margin: 24rpx 32rpx;
  567. background-color: #fff;
  568. border-radius: 12px;
  569. padding: 24rpx 32rpx;
  570. .title {
  571. color: #333333;
  572. font-size: 18px;
  573. font-family: 'PingFangSC-medium';
  574. }
  575. text {
  576. color: #FF0000;
  577. }
  578. .textarea {
  579. margin-top: 24rpx;
  580. line-height: 40rpx;
  581. width: 100%;
  582. height: 200rpx;
  583. }
  584. }
  585. /* 发布 */
  586. .issue {
  587. background-color: rgba(34, 149, 255, 1);
  588. color: rgba(241, 241, 241, 1);
  589. font-size: 18px;
  590. height: 96rpx;
  591. line-height: 96rpx;
  592. border-radius: 50px;
  593. position: fixed;
  594. left: 32rpx;
  595. right: 32rpx;
  596. bottom: 20rpx;
  597. z-index: 999;
  598. }
  599. // 筛选框
  600. .popup-content {
  601. padding: 32rpx;
  602. .headline {
  603. color: #101010;
  604. font-size: 40rpx;
  605. text-align: center;
  606. }
  607. //行业
  608. .industry,
  609. .clearing-form,
  610. .salary-form {
  611. margin-top: 16rpx;
  612. .title {
  613. font-size: 32rpx;
  614. color: #111111;
  615. }
  616. // 选项
  617. .options {
  618. display: flex;
  619. flex-wrap: wrap;
  620. margin-top: 24rpx;
  621. .item {
  622. height: 56rpx;
  623. line-height: 56rpx;
  624. min-width: 210rpx;
  625. text-align: center;
  626. margin-bottom: 16rpx;
  627. margin-right: 16rpx;
  628. color: #999999;
  629. background-color: #F3F3F4;
  630. border-radius: 4px;
  631. padding: 0 6rpx;
  632. }
  633. .checked {
  634. background-color: #2795FD;
  635. color: #fff;
  636. }
  637. }
  638. }
  639. .button {
  640. display: flex;
  641. margin-top: 8rpx;
  642. .reset:after {
  643. border: 0
  644. }
  645. .reset {
  646. color: #999999;
  647. background-color: #F3F3F4;
  648. width: 200rpx;
  649. height: 72rpx;
  650. line-height: 72rpx;
  651. border-radius: 8px;
  652. }
  653. .confirm {
  654. width: 440rpx;
  655. background-color: #2795FD;
  656. color: #fff;
  657. height: 72rpx;
  658. line-height: 72rpx;
  659. border-radius: 8px;
  660. }
  661. }
  662. }
  663. .salary-form,
  664. .clearing-form {
  665. .options {
  666. justify-content: start !important;
  667. }
  668. .item {
  669. margin-right: 24rpx;
  670. }
  671. }
  672. .scrollview {
  673. border: 1px #101010 dashed;
  674. }
  675. </style>