特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

440 lines
9.5 KiB

4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
4 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="编辑招工信息" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="form">
  5. <view class="help-issue">
  6. <text>招工标题</text>
  7. <text style="color: #BD3624;">*</text>
  8. </view>
  9. <view class="form-sheet-cell">
  10. <input type="text" class="title-input"
  11. v-model="form.title"/>
  12. </view>
  13. <uv-cell
  14. title="所在城市"
  15. rightIconStyle="fontSize: 30rpx;"
  16. :value="form.areaId_dictText || '请选择所在城市'"
  17. @click="openPicker('areaId',$refs.addressListPicker)"
  18. isLink
  19. ></uv-cell>
  20. <uv-cell
  21. title="工作地点"
  22. rightIconStyle="fontSize: 30rpx;"
  23. :value="form.workAddress &&
  24. (form.workAddress.length > 12 ?
  25. form.workAddress.substring(0, 12) + '...' :
  26. form.workAddress)
  27. || '请选择招工地点'"
  28. @click="selectAddr"
  29. isLink
  30. ></uv-cell>
  31. <uv-cell
  32. title="所属工种"
  33. rightIconStyle="fontSize: 30rpx;"
  34. :value="form.typeId_dictText || '请选择所属工种'"
  35. @click="openPicker('typeId', $refs.jobTypeListPicker)"
  36. isLink
  37. ></uv-cell>
  38. <uv-cell
  39. title="工龄要求"
  40. rightIconStyle="fontSize: 30rpx;"
  41. :value="form.workAge || '请选择工龄要求'"
  42. @click="openPicker('workAge')"
  43. isLink
  44. ></uv-cell>
  45. <uv-cell
  46. title="学历要求"
  47. rightIconStyle="fontSize: 30rpx;"
  48. :value="form.qulification || '请选择学历要求'"
  49. @click="openPicker('qulification')"
  50. isLink
  51. ></uv-cell>
  52. <!-- <view class="form-sheet-cell">
  53. <view class="label">
  54. 工作地点
  55. </view>
  56. <view>
  57. 请选择招工地点
  58. </view>
  59. <view class="right-icon">
  60. <uv-icon
  61. name="arrow-right"
  62. ></uv-icon>
  63. </view>
  64. </view>
  65. <view class="form-sheet-cell">
  66. <view class="label">
  67. 学历要求
  68. </view>
  69. <view>
  70. 请选择学历要求
  71. </view>
  72. <view class="right-icon">
  73. <uv-icon
  74. name="arrow-right"
  75. ></uv-icon>
  76. </view>
  77. </view>
  78. <view class="form-sheet-cell">
  79. <view class="label">
  80. 工龄要求
  81. </view>
  82. <view>
  83. 请选择工龄要求
  84. </view>
  85. <view class="right-icon">
  86. <uv-icon
  87. name="arrow-right"
  88. ></uv-icon>
  89. </view>
  90. </view>
  91. <view class="form-sheet-cell">
  92. <view class="label">
  93. 所属工种
  94. </view>
  95. <view>
  96. 请选择工种
  97. </view>
  98. <view class="right-icon">
  99. <uv-icon
  100. name="arrow-right"
  101. ></uv-icon>
  102. </view>
  103. </view> -->
  104. <view class="form-sheet-cell">
  105. <view class="label">
  106. 薪资范围
  107. </view>
  108. <view class="price">
  109. <input placeholder="最小值" v-model="form.salaryLow" />
  110. ~
  111. <input placeholder="最大值" v-model="form.salaryUp" />
  112. </view>
  113. </view>
  114. <!-- <view class="form-sheet-cell">
  115. <view class="label">
  116. 结算方式
  117. </view>
  118. <uv-radio-group v-model="radiovalue">
  119. <view class="price">
  120. <uv-radio
  121. :customStyle="{margin: '8px'}"
  122. v-for="(item, index) in priceList"
  123. :key="index"
  124. iconSize="30rpx"
  125. size="40rpx"
  126. labelSize="26rpx"
  127. :label="item.name"
  128. :name="item.name">
  129. </uv-radio>
  130. </view>
  131. </uv-radio-group>
  132. </view> -->
  133. <view class="form-sheet-cell">
  134. <view class="label">
  135. 工作性质
  136. </view>
  137. <uv-radio-group v-model="form.natureId">
  138. <view class="price">
  139. <uv-radio
  140. :customStyle="{margin: '8px'}"
  141. v-for="(item, index) in natureList"
  142. :key="index"
  143. iconSize="30rpx"
  144. size="40rpx"
  145. labelSize="26rpx"
  146. :label="item.name"
  147. :name="item.id">
  148. </uv-radio>
  149. </view>
  150. </uv-radio-group>
  151. </view>
  152. <view class="form-sheet-cell">
  153. <view class="label">
  154. 联系电话
  155. </view>
  156. <input placeholder="请输入联系电话" v-model="form.phone" />
  157. </view>
  158. <view class="">
  159. <uv-textarea
  160. v-model="form.workDetail"
  161. count
  162. :maxlength="300"
  163. autoHeight
  164. placeholder="请输入职位详情"></uv-textarea>
  165. </view>
  166. <uv-picker ref="picker"
  167. :columns="columns"
  168. @confirm="pickerConfirm"></uv-picker>
  169. <uv-picker ref="jobTypeListPicker"
  170. :columns="[jobTypeList]"
  171. keyName="name"
  172. @confirm="pickerConfirm"></uv-picker>
  173. <uv-picker ref="addressListPicker"
  174. :columns="[addressList]"
  175. keyName="adress"
  176. @confirm="pickerConfirm"></uv-picker>
  177. <view class="uni-color-btn"
  178. @click="submit">
  179. 发布
  180. </view>
  181. </view>
  182. </view>
  183. </template>
  184. <script>
  185. import { mapState } from 'vuex'
  186. export default {
  187. data() {
  188. return {
  189. form : {
  190. // jobContext : '',
  191. phone : '',
  192. workAddress:'',
  193. title : '',
  194. workAge : '',
  195. natureId : 0,
  196. areaId_dictText : '',
  197. typeId_dictText : '',
  198. qulification : '',
  199. },
  200. radiovalue : '',
  201. priceList : [
  202. {
  203. name : '日结',
  204. },
  205. {
  206. name : '月结',
  207. },
  208. ],
  209. picker : {
  210. workAge : [
  211. '不限经验',
  212. ],
  213. qulification : [
  214. '不限学历',
  215. '初中',
  216. '高中',
  217. '专科',
  218. '本科',
  219. '研究生',
  220. '博士',
  221. ],
  222. jobTypeList : [],
  223. },
  224. pickerKey : 'workAge',
  225. jobId : 0,
  226. }
  227. },
  228. onLoad({jobId}) {
  229. if(jobId){
  230. this.jobId = jobId
  231. this.getDetail()
  232. }
  233. for (var i = 0; i < 30; i++) {
  234. this.picker.workAge.push((i + 1) + '年经验')
  235. }
  236. // this.form.addId = this.cityList[0].id
  237. this.form.natureId = this.natureList[0].id
  238. },
  239. computed : {
  240. columns(){
  241. return [this.picker[this.pickerKey]]
  242. },
  243. ...mapState(['natureList', 'jobTypeList', 'addressList']),
  244. },
  245. methods: {
  246. getDetail() {
  247. let data = {
  248. jobId: this.jobId
  249. }
  250. if (uni.getStorageSync('token')) {
  251. data.token = uni.getStorageSync('token')
  252. }
  253. this.$api('employeeQueryJobById', data, res => {
  254. if (res.code == 200) {
  255. let detail = res.result.jobInfo
  256. this.addressList.forEach(address => {
  257. if(address.id == detail.areaId){
  258. detail.areaId_dictText = address.adress
  259. }
  260. })
  261. this.jobTypeList.forEach(type => {
  262. if(type.id == detail.typeId){
  263. detail.typeId_dictText = type.name
  264. }
  265. })
  266. delete detail.createBy
  267. delete detail.createTime
  268. delete detail.headImage
  269. delete detail.hanHaiMember
  270. delete detail.updateTime
  271. delete detail.updateBy
  272. this.form = detail
  273. }
  274. })
  275. },
  276. openPicker(key, picker){
  277. this.pickerKey = key
  278. if(picker){
  279. picker.open()
  280. }else{
  281. this.$refs.picker.open()
  282. }
  283. },
  284. pickerConfirm(e){
  285. let data = e.value[0]
  286. if(data && data.id){
  287. this.form[this.pickerKey] = data.id
  288. this.form[this.pickerKey + '_dictText'] = data.name || data.adress
  289. }else{
  290. this.form[this.pickerKey] = data
  291. }
  292. },
  293. // 提交
  294. submit(){
  295. // if(this.fileList.length == 0){
  296. // return uni.showToast({
  297. // title: '请上传图片',
  298. // icon : 'none'
  299. // })
  300. // }
  301. if (this.$utils.verificationAll(this.form, {
  302. title: '请输入招工标题',
  303. workAddress : '请选择工作地点',
  304. workAge : '请选择工龄要求',
  305. // company : '请输入招聘公司',
  306. salaryLow : '请输入薪资范围',
  307. salaryUp : '请输入薪资范围',
  308. // iconText: '请输入标签',
  309. // userName: '请输入联系人',
  310. phone: '请输入联系电话',
  311. // jobContext : '请输入职位描述',
  312. qulification : '请选择学历要求',
  313. workDetail: '请输入职位详情',
  314. // gsContext : '请输入公司介绍',
  315. })) {
  316. return
  317. }
  318. this.$api(this.jobId ? 'updateJob' : 'addJob', this.form, res => {
  319. if(res.code == 200){
  320. uni.showToast({
  321. title: '发布成功!',
  322. icon: 'none'
  323. })
  324. setTimeout(uni.navigateBack, 1000, -1)
  325. }
  326. })
  327. },
  328. //地图上选择地址
  329. selectAddr() {
  330. uni.chooseLocation({
  331. success: (res) => {
  332. this.setAddress(res)
  333. }
  334. });
  335. },
  336. //提取用户选择的地址信息复制给表单数据
  337. setAddress(res) {
  338. //经纬度信息
  339. this.form.latitude = res.latitude
  340. this.form.longitude = res.longitude
  341. // if (res.name) { //用户直接选择城市的逻辑
  342. if (!res.address && res.name) { //用户直接选择城市的逻辑
  343. return this.form.workAddress = res.name
  344. }
  345. if (res.address || res.name) {
  346. return this.form.workAddress = res.address + res.name
  347. }
  348. this.form.workAddress = '' //用户啥都没选就点击勾选
  349. this.form.latitude = ''
  350. this.form.longitude = ''
  351. },
  352. }
  353. }
  354. </script>
  355. <style scoped lang="scss">
  356. .page{
  357. background-color: #fff;
  358. min-height: 100vh;
  359. box-sizing: border-box;
  360. color: #333333;
  361. font-size: 28rpx;
  362. /deep/ text{
  363. font-size: 28rpx !important;
  364. }
  365. .form{
  366. padding: 30rpx;
  367. .help-issue {
  368. margin: 20rpx;
  369. }
  370. .title-input{
  371. border: 1px solid $uni-color;
  372. width: 100%;
  373. border-radius: 10rpx;
  374. padding: 10rpx 20rpx;
  375. box-sizing: border-box;
  376. height: 65rpx;
  377. }
  378. .form-sheet-cell{
  379. display: flex;
  380. background-color: #fff;
  381. padding: 20rpx 30rpx;
  382. align-items: center;
  383. .label{
  384. width: 160rpx;
  385. }
  386. .price{
  387. display: flex;
  388. text-align: center;
  389. input{
  390. width: 150rpx;
  391. border: 1px solid $uni-color;
  392. margin: 0 10rpx;
  393. }
  394. }
  395. input{
  396. flex: 1;
  397. background-color: rgba($uni-color, 0.1);
  398. padding: 10rpx 20rpx;
  399. border-radius: 10rpx;
  400. }
  401. .right-icon{
  402. margin-left: auto;
  403. }
  404. }
  405. }
  406. /deep/ .uv-textarea{
  407. background-color: rgba($uni-color, 0.1) !important;
  408. min-height: 400rpx;
  409. }
  410. }
  411. </style>