full_time_push.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="main">
  3. <view class="form_group">
  4. <view class="lable re">职位名称</view>
  5. <input placeholder="请输入" v-model="item.title" />
  6. </view>
  7. <view class="form_group">
  8. <view class="lable re">职位类型</view>
  9. <picker :disabled="true" @click="go('/pages/job/position/classification')">
  10. <input placeholder="请选择" v-model="item.positionName" :disabled="true" />
  11. <view class="icon more">&#xe8f2;</view>
  12. </picker>
  13. </view>
  14. <view class="form_group">
  15. <view class="lable re">职位描述(要求)</view>
  16. <leditor ref="editor" v-model="item.contents" placeholder="请输入职位描述"></leditor>
  17. </view>
  18. <view class="form_group">
  19. <view class="lable re">经验要求</view>
  20. <picker :range="dict.experience" @change="picker($event, 'experience')">
  21. <input placeholder="请选择" v-model="item.experience" :disabled="true" />
  22. <view class="icon more">&#xe8f2;</view>
  23. </picker>
  24. </view>
  25. <view class="form_group">
  26. <view class="lable re">薪资范围</view>
  27. <multiSelector v-model="item.salary" :range="dict.salary" name="薪资" placeholder="请选择薪资范围"></multiSelector>
  28. </view>
  29. <view class="form_group">
  30. <view class="lable re">工作地点</view>
  31. <picker :disabled="true" @click="chooseLocation()">
  32. <input placeholder="请选择" v-model="item.location" :disabled="true" />
  33. <view class="icon more">&#xe8f2;</view>
  34. </picker>
  35. <input placeholder="请输入楼层/单元室/门牌号" v-model="item.mph" v-if="item.address" />
  36. <view class="bz">请仔细确认位置点,否置会影响求职者导航</view>
  37. </view>
  38. <button class="btn" @click="save()">{{ item.id ? '编辑' : '保存' }}</button>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. item: { type: 0 },
  46. dict: {
  47. positionName: this.util.getData('positionName'),
  48. experience: this.util.getData('experience'),
  49. salary: [['面议'], ['']]
  50. }
  51. };
  52. },
  53. onLoad(e) {
  54. if (e.id) {
  55. this.http.request({
  56. url: '/app/position/manage/detail/' + e.id,
  57. success: (res) => {
  58. this.item = res.data.data;
  59. this.$refs.editor.setContents();
  60. uni.setNavigationBarTitle({ title: '编辑职位' });
  61. }
  62. });
  63. }
  64. uni.$on('select_position', (res) => {
  65. this.item.positionName = res.title;
  66. this.item.positionId = res.id;
  67. this.$forceUpdate();
  68. });
  69. },
  70. methods: {
  71. picker(e, tag) {
  72. this.item[tag] = this.dict[tag][e.detail.value];
  73. this.$forceUpdate();
  74. },
  75. go(url) {
  76. uni.navigateTo({ url: url });
  77. },
  78. chooseLocation() {
  79. uni.chooseLocation({
  80. success: (res) => {
  81. let reg = /.+?(省|市|自治区|自治州|县|区)/g;
  82. let addressList = res.address.match(reg).toString().split(',');
  83. //注意区分直辖市;
  84. let city = addressList.length >= 3 ? addressList[1] : addressList[0];
  85. let region = addressList.length >= 3 ? addressList[2] : addressList[1];
  86. this.item.location = res.name;
  87. this.item.address = res.address;
  88. this.item.longitude = res.longitude;
  89. this.item.latitude = res.latitude;
  90. this.item.regionName = region;
  91. this.item.cityName = city;
  92. this.$forceUpdate();
  93. }
  94. });
  95. },
  96. save() {
  97. this.http.request({
  98. url: this.item.id ? '/app/position/manage/edit' : '/app/position/manage/add',
  99. data: this.item,
  100. method: 'POST',
  101. success: (res) => {
  102. //实名认证跳转
  103. if (res.data.code == 7878) {
  104. uni.showModal({
  105. title: '提示',
  106. content: res.data.msg,
  107. showCancel: false,
  108. success: (res) => {
  109. uni.navigateTo({ url: '/pages/user/auth' });
  110. }
  111. });
  112. return;
  113. }
  114. //企业认证跳转
  115. if (res.data.code == 7979) {
  116. uni.showModal({
  117. title: '提示',
  118. content: res.data.msg,
  119. showCancel: false,
  120. success: (res) => {
  121. uni.navigateTo({ url: '/pages/user/enterprise/index' });
  122. }
  123. });
  124. return;
  125. }
  126. uni.showToast({ title: '操作成功' });
  127. setTimeout(() => {
  128. uni.$emit('position');
  129. uni.navigateBack();
  130. }, 1500);
  131. }
  132. });
  133. }
  134. }
  135. };
  136. </script>
  137. <style lang="scss"></style>