postMessage.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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"
  17. placeholder="请填写职位名称"></u-input>
  18. </view>
  19. </view>
  20. <!-- *薪资待遇 -->
  21. <view class="item">
  22. <view class="title">
  23. <text>*</text>薪资待遇
  24. </view>
  25. <view class="input2">
  26. <u-input type="number" v-model="formData.salary"
  27. placeholder="请填写薪资待遇"></u-input>
  28. </view>
  29. <view class="unit" >
  30. 元/天
  31. </view>
  32. <!-- <view class="icon" @click="showselect(0)">
  33. <u-icon name="arrow-right" color="#999999"></u-icon>
  34. </view> -->
  35. </view>
  36. <!--结算形式 -->
  37. <view class="item">
  38. <view class="title">
  39. <text>*</text>结算形式
  40. </view>
  41. <view class="input">
  42. <u-input type="select" v-model="settlementMethod"
  43. @click="showselect(1)" placeholder="请选择结算形式"></u-input>
  44. </view>
  45. </view>
  46. <!-- 行业 -->
  47. <view class="item">
  48. <view class="title">
  49. <text>*</text>行业
  50. </view>
  51. <view class="input">
  52. <u-input type="select" v-model="industry"
  53. @click="showselect(2)" placeholder="请选择行业"></u-input>
  54. </view>
  55. </view>
  56. <!-- 招聘人数 -->
  57. <view class="item">
  58. <view class="title">
  59. <text>*</text>招聘人数
  60. </view>
  61. <view class="input">
  62. <u-input type="number" v-model="formData.recruitingNumbers"
  63. placeholder="请填写招聘人数"></u-input>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 工作描述 -->
  68. <view class="job-description">
  69. <view class="title">
  70. <text>*</text>工作描述
  71. </view>
  72. <textarea class="textarea" v-model="formData.desc"
  73. placeholder="请简单描述工作内容及职位要求"></textarea>
  74. </view>
  75. <!-- 个人信息 -->
  76. <view class="information-group">
  77. <view class="headline">
  78. 基本信息
  79. </view>
  80. <!-- 联系人 -->
  81. <view class="item">
  82. <view class="title">
  83. <text>*</text>联系人
  84. </view>
  85. <view class="input">
  86. <u-input type="text" v-model="formData.contacts"
  87. placeholder="请填写联系人"></u-input>
  88. </view>
  89. </view>
  90. <!-- 联系电话 -->
  91. <view class="item">
  92. <view class="title">
  93. <text>*</text>联系电话
  94. </view>
  95. <view class="input">
  96. <u-input type="text" v-model="formData.contactsPhone"
  97. placeholder="请填写联系电话"></u-input>
  98. </view>
  99. </view>
  100. <!--工作地区 -->
  101. <view class="item">
  102. <view class="title">
  103. <text>*</text>工作地区
  104. </view>
  105. <view class="input">
  106. <u-input type="select" v-model="workArea"
  107. @click="showselect(3)" placeholder="请选择工作地区"></u-input>
  108. </view>
  109. </view>
  110. <!-- 详细地址 -->
  111. <view class="item">
  112. <view class="title">
  113. <text>*</text>详细地址
  114. </view>
  115. <view class="input">
  116. <u-input type="text" v-model="formData.address"
  117. placeholder="请填写详细的工作地址"></u-input>
  118. </view>
  119. </view>
  120. </view>
  121. <u-select v-model="show" value-name="value" label-name="name"
  122. :list="list" @confirm="confirm"></u-select>
  123. <button class="issue" @click="submit()"
  124. type="default">发布</button>
  125. </view>
  126. </template>
  127. <script>
  128. import * as API_weixin from '@/apis/weixin.js'
  129. import * as API from '@/apis/pagejs/packages.js'
  130. export default {
  131. data() {
  132. return {
  133. selectIndex:0,
  134. show: false,
  135. list: [],
  136. formData:{
  137. positionName:"",
  138. salary:"",
  139. settlementMethod:"",
  140. industry:"",
  141. recruitingNumbers:"",
  142. desc:"",
  143. contacts:"",
  144. contactsPhone:"",
  145. workArea:"",
  146. address:"",
  147. salaryForm:"2",
  148. },
  149. settlementMethod:"",
  150. salaryForm:"计时",
  151. industry:"",
  152. workArea:"",
  153. sqlList:[[],[],[],[],[],[],[]],
  154. valueList:[-1,-1,-1,-1,-1,-1],
  155. userInfo:{},
  156. id:"",
  157. }
  158. },
  159. onLoad(op){
  160. this.userInfo=this.carhelp.getPersonInfo()
  161. if(op.id){
  162. this.id=op.id
  163. this.getInfo()
  164. }
  165. //this.tel=this.userInfo.phone
  166. },
  167. methods: {
  168. getInfo(){
  169. uni.showLoading({
  170. title: "加载中",
  171. mask: true,
  172. })
  173. API.recruitDetail({
  174. recruitId:this.id
  175. }).then((res) => {
  176. uni.hideLoading()
  177. if(res.data.recruitInformationInfo){
  178. this.formData = res.data.recruitInformationInfo;
  179. var name=["salaryForm","settlementMethod","industry",]
  180. for(var i in name){
  181. console.log(name[i]+'N')
  182. this[name[i]]=this.formData[(name[i]+'N')]
  183. }
  184. this.workArea= this.formData.workArea
  185. }
  186. }).catch(error => {
  187. uni.showToast({icon: 'none',
  188. title: error,
  189. icon: "none"
  190. })
  191. })
  192. },
  193. confirm(e) {
  194. this.show = false;
  195. var name=["salaryForm","settlementMethod",
  196. "industry",
  197. "workArea",]
  198. this[name[this.selectIndex]]=e[0].label
  199. this.formData[name[this.selectIndex]]=e[0].value
  200. console.log(e)
  201. },
  202. showselect(k){
  203. this.selectIndex=k;
  204. if(this.sqlList[k].length==0){
  205. var name=['薪资形式','结算方式','意向行业','工作地区']
  206. uni.showLoading({
  207. title: "加载中",
  208. mask: true,
  209. })
  210. API_weixin.findListByCatalogName({
  211. name:name[k],
  212. }).then((res) => {
  213. uni.hideLoading();
  214. this.sqlList[k]=res.data.dictionaryList
  215. this.list=this.sqlList[k];
  216. this.show= true
  217. }).catch(error => {
  218. uni.showToast({icon: 'none',
  219. title: error
  220. })
  221. //this.getPhone()
  222. })
  223. }else{
  224. this.list=this.sqlList[k];
  225. this.show= true
  226. }
  227. },
  228. submit(){
  229. if(!this.formData.positionName){
  230. uni.showToast({icon: 'none',
  231. title: "请填写职位名称"
  232. })
  233. return
  234. }
  235. if(!this.formData.salary){
  236. uni.showToast({icon: 'none',
  237. title: "请填写薪资待遇"
  238. })
  239. return
  240. }
  241. if(!this.formData.settlementMethod){
  242. uni.showToast({icon: 'none',
  243. title: "请选择结算形式"
  244. })
  245. return
  246. }
  247. if(!this.formData.industry){
  248. uni.showToast({icon: 'none',
  249. title: "请选择行业"
  250. })
  251. return
  252. }
  253. if(!this.formData.recruitingNumbers){
  254. uni.showToast({icon: 'none',
  255. title: "请填写招聘人数"
  256. })
  257. return
  258. }
  259. if(!this.formData.desc){
  260. uni.showToast({icon: 'none',
  261. title: "请简单描述工作内容及职位要求"
  262. })
  263. return
  264. }
  265. if(!this.formData.contacts){
  266. uni.showToast({icon: 'none',
  267. title: "请填写联系人"
  268. })
  269. return
  270. }
  271. if(!this.formData.contactsPhone){
  272. uni.showToast({icon: 'none',
  273. title: "请填写联系电话"
  274. })
  275. return
  276. }
  277. if(!this.formData.workArea){
  278. uni.showToast({icon: 'none',
  279. title: "请选择工作地区"
  280. })
  281. return
  282. }
  283. if(!this.formData.address){
  284. uni.showToast({icon: 'none',
  285. title: "请填写详细的工作地址"
  286. })
  287. return
  288. }
  289. this.formData.workArea=this.workArea
  290. uni.showLoading({
  291. title: "加载中",
  292. mask: true,
  293. })
  294. API.createRecruit(this.formData).then((res) => {
  295. uni.hideLoading();
  296. const eventChannel = this.getOpenerEventChannel();
  297. eventChannel.emit('refreshData');
  298. uni.showModal({
  299. title: '提示',
  300. content: '发布成功,等待审核!',
  301. showCancel:false,
  302. success: function (res) {
  303. if (res.confirm) {
  304. uni.navigateBack()
  305. } else if (res.cancel) {
  306. console.log('用户点击取消');
  307. }
  308. }
  309. });
  310. }).catch(error => {
  311. uni.showToast({icon: 'none',
  312. title: error
  313. })
  314. //this.getPhone()
  315. })
  316. }
  317. }
  318. }
  319. </script>
  320. <style>
  321. page {
  322. background: #F0F0F2;
  323. padding-bottom: 150px;
  324. }
  325. </style>
  326. <style lang="scss" scoped>
  327. .information-group {
  328. margin: 32rpx;
  329. padding: 24rpx 32rpx;
  330. background-color: #fff;
  331. border-radius: 24rpx;
  332. .headline {
  333. color: rgba(16, 16, 16, 1);
  334. font-size: 36rpx;
  335. margin-bottom: 24rpx;
  336. font-family: 'PingFangSC-medium';
  337. }
  338. .item {
  339. display: flex;
  340. align-items: center;
  341. padding: 12rpx 0;
  342. border-bottom: 1px solid #f1f1f1;
  343. .title {
  344. color: rgba(51, 51, 51, 1);
  345. font-size: 32rpx;
  346. width: 148rpx;
  347. text {
  348. color: #EE3138
  349. }
  350. }
  351. .input {
  352. width: 450rpx;
  353. margin-left: 24rpx;
  354. /deep/.uni-input-input {
  355. color: rgba(51, 51, 51, 1);
  356. }
  357. }
  358. .input2 {
  359. width: 350rpx;
  360. margin-left: 24rpx;
  361. /deep/.uni-input-input {
  362. color: rgba(51, 51, 51, 1);
  363. }
  364. }
  365. .icon {
  366. margin-left: auto;
  367. }
  368. .unit {
  369. margin-left: auto;
  370. color: rgba(51, 51, 51, 1);
  371. font-size: 32rpx;
  372. }
  373. }
  374. }
  375. // 工作描述
  376. .job-description {
  377. margin: 24rpx 32rpx;
  378. background-color: #fff;
  379. border-radius: 12px;
  380. padding: 24rpx 32rpx;
  381. .title {
  382. color: #333333;
  383. font-size: 18px;
  384. font-family: 'PingFangSC-medium';
  385. }
  386. text {
  387. color: #FF0000;
  388. }
  389. .textarea {
  390. margin-top: 24rpx;
  391. line-height: 40rpx;
  392. width: 100%;
  393. height: 200rpx;
  394. }
  395. }
  396. /* 发布 */
  397. .issue {
  398. background-color: rgba(34, 149, 255, 1);
  399. color: rgba(241, 241, 241, 1);
  400. font-size: 18px;
  401. height: 96rpx;
  402. line-height: 96rpx;
  403. border-radius: 50px;
  404. position: fixed;
  405. left: 32rpx;
  406. right: 32rpx;
  407. bottom: 20rpx;
  408. z-index: 999;
  409. }
  410. </style>