gangws.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="flex align-center justify-between margin-bottom" @click="getPost">
  5. <view class=" text-bold">岗位</view>
  6. <view class="text-right flex align-center ">
  7. <view class="">{{postName?postName:'请选择岗位'}}</view>
  8. <view class="margin-left-sm">
  9. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  14. <view class="flex align-center justify-between" @click="getPostlist">
  15. <view class=" text-bold">专业</view>
  16. <view class="text-right flex align-center padding-tb-sm">
  17. <view>{{rulePostName? rulePostName:'请选择专业'}}</view>
  18. <view class="margin-left-sm">
  19. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  24. <view class="flex align-center justify-between" @click="getMonyList">
  25. <view class=" text-bold">工资</view>
  26. <view class="text-right flex align-center padding-tb-sm">
  27. <view>{{postPrice? postPrice:'请选择薪资'}}</view>
  28. <view class="margin-left-sm">
  29. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  34. <view class="flex align-center justify-between">
  35. <view class=" text-bold">人数</view>
  36. <view class="text-right flex align-center ">
  37. <u-input v-model="postPeopleNum" type="number" placeholder="请填写人数" placeholder-style="color:#999999;"
  38. @input="input" :clearable="false" />
  39. <view class="margin-left-sm">
  40. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  45. <view class="flex align-center justify-between" @click="SexShow=true">
  46. <view class=" text-bold">性别</view>
  47. <view class="text-right flex align-center margin-tb-sm">
  48. <view v-if="postSex">{{postSex}}</view>
  49. <view v-else style="color:#999999;">请选择性别</view>
  50. <view class="margin-left-sm">
  51. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  56. <view class="flex align-center justify-between" @click="getAgeList">
  57. <view class=" text-bold">年龄</view>
  58. <view class="text-right flex align-center padding-tb-sm">
  59. <view>{{postAge? postAge:'请选择年龄'}}</view>
  60. <view class="margin-left-sm">
  61. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="margin-tb-sm" style="width: 100%;height: 1rpx;background: #F2F2F2;"></view>
  66. <view class="flex align-center justify-between" @click="getxueliList">
  67. <view class=" text-bold">学历要求</view>
  68. <view class="text-right flex align-center padding-tb-sm">
  69. <view>{{education? education:'请选择学历'}}</view>
  70. <view class="margin-left-sm">
  71. <image src="../../static/images/my/right_icon.png" style="width: 12upx;height: 21upx;"></image>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="margin-lr " style="color: #82A9FE;" v-if="offlinePrice">
  77. 当前岗位线下需要支付{{offlinePrice?offlinePrice:'0'}}元,支付后保证金会退回账户。</view>
  78. <!-- 求职岗位 -->
  79. <u-select v-model="postShow" :list="postlist" @confirm="postConfirm"></u-select>
  80. <!-- 专业 -->
  81. <u-select v-model="show" :list="ErjiList" @confirm="postlistConfirm"></u-select>
  82. <!-- 性别 -->
  83. <u-select v-model="SexShow" :list="list" @confirm="SexConfirm"></u-select>
  84. <!-- 薪资 -->
  85. <u-select v-model="monyShow" :list="monyList" @confirm="moneyConfirm"></u-select>
  86. <!-- 年龄 -->
  87. <u-select v-model="ageShow" :list="ageList" @confirm="ageConfirm"></u-select>
  88. <!-- 学历选择 -->
  89. <u-select v-model="educationShow" :list="educationList" @confirm="educationyConfirm"></u-select>
  90. <view class="subbtn" @click="save">
  91. <view class="padding-left flex align-center" style="color: red;">
  92. <!-- <view class="text-df">¥</view> -->
  93. <view style="font-size: 48upx;">{{customizationPrices?customizationPrices:'0'}}<span style="font-size:24rpx;margin-left: 5rpx;margin-right: 5rpx;">积分</span></view>
  94. <view class=" margin-left-xs" style="color:#82A9FE;font-size: 22rpx;">*发布当前岗位需支付的保证金价格</view>
  95. </view>
  96. <view class="btn">保存</view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. export default {
  102. data() {
  103. return {
  104. educationList:[],
  105. educationShow:false,
  106. education:'',//学历
  107. ageShow:false,
  108. ageList:[],
  109. monyShow:false,
  110. monyList:[],//薪资列表
  111. postName: '', //岗位名称
  112. rulePostName: '', //岗位职称
  113. rulePostId: '',
  114. postMajor: [], //岗位专业
  115. postPeopleNum: '', //岗位人数
  116. postSex: '', //性别
  117. postAge: '', //年龄段
  118. postPrice: '', //岗位工资
  119. postShow: false, //一级岗位
  120. postlist: [],
  121. show: false, //二级岗位
  122. ErjiList: [],
  123. price: '',
  124. totalPrice: '',
  125. member: '', //1 会员
  126. SexShow: false, //性别
  127. list: [{
  128. value: '1',
  129. label: '男'
  130. }, {
  131. value: '2',
  132. label: '女'
  133. }, {
  134. value: '3',
  135. label: '男女不限'
  136. }],
  137. postDetailsList: [],
  138. postDetailsIndex: '',
  139. classify: '', //1.定制化 2.精准推送
  140. offlinePrice: '', //线下价格
  141. customizationPrice: '', //保证金价格
  142. customizationPrices: '', //保证金价格
  143. }
  144. },
  145. onLoad(e) {
  146. this.member = uni.getStorageSync('member')
  147. if(uni.getStorageSync('postDetailsList')){
  148. this.postDetailsList = uni.getStorageSync('postDetailsList')
  149. }
  150. if(e.index){ //修改
  151. this.postDetailsIndex = e.index
  152. let obj = this.postDetailsList[this.postDetailsIndex]
  153. this.postName = obj.postName
  154. this.rulePostName = obj.rulePostName
  155. this.ruleClassifyId = obj.ruleClassifyId
  156. this.rulePostId = obj.rulePostId
  157. this.getPostList()
  158. this.postPrice = obj.postPrice
  159. this.postPeopleNum = obj.postPeopleNum
  160. this.postSex = obj.postSex
  161. this.postAge = obj.postAge
  162. this.education = obj.education
  163. this.offlinePrice = obj.offlinePrice
  164. this.customizationPrices = obj.customizationPrices
  165. this.customizationPrice = obj.customizationPrice
  166. }
  167. },
  168. onShow() {
  169. },
  170. methods: {
  171. //学历选择
  172. educationyConfirm(e){
  173. this.education = e[0].value
  174. },
  175. //年龄选择
  176. ageConfirm(e){
  177. this.postAge = e[0].value
  178. },
  179. //学历
  180. getxueliList(){
  181. this.$Request.get('/app/dict/list', {
  182. type:'学历'
  183. }).then(res => {
  184. if (res.code == 0) {
  185. let arr = res.data
  186. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  187. this.educationList = arr
  188. this.educationShow = true
  189. }
  190. })
  191. },
  192. //年龄
  193. getAgeList(){
  194. this.$Request.get('/app/dict/list', {
  195. type:'年龄'
  196. }).then(res => {
  197. if (res.code == 0) {
  198. let arr = res.data
  199. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  200. this.ageList = arr
  201. this.ageShow = true
  202. }
  203. })
  204. },
  205. moneyConfirm(e){
  206. console.log(e)
  207. this.postPrice = e[0].value
  208. },
  209. //薪资列表
  210. getMonyList(){
  211. this.$Request.get('/app/dict/list', {
  212. type:'薪资'
  213. }).then(res => {
  214. if (res.code == 0) {
  215. let arr = res.data
  216. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  217. this.monyList = arr
  218. this.monyShow = true
  219. }
  220. })
  221. },
  222. input(e) {
  223. if(this.postPeopleNum==''){
  224. this.customizationPrices = this.customizationPrice
  225. }else{
  226. this.customizationPrices = parseInt(this.customizationPrice * this.postPeopleNum).toFixed(0)
  227. }
  228. },
  229. SexConfirm(e) { //选择性别
  230. this.postSex = e[0].label
  231. },
  232. //获取一级岗位
  233. getPost() {
  234. this.getClassifyList()
  235. },
  236. //获取岗位
  237. getClassifyList() {
  238. let data = {
  239. status: 1
  240. }
  241. this.$Request.get('/app/rule/selectRuleClassifyList', data).then(res => {
  242. if (res.code == 0) {
  243. var arr = []
  244. res.data.forEach((d, index) => {
  245. var data = {}
  246. data.label = d.ruleClassifyName
  247. data.value = d.ruleClassifyId
  248. data.offlinePrice = d.offlinePrice
  249. data.offlineMemberPrice = d.offlineMemberPrice
  250. data.customizationPrice = d.customizationPrice
  251. data.customizationMemberPrice = d.customizationMemberPrice
  252. arr.push(data)
  253. })
  254. this.postlist = arr
  255. this.postShow = true
  256. }
  257. })
  258. },
  259. postConfirm(e) {
  260. this.postName = e[0].label
  261. this.ruleClassifyId = e[0].value
  262. this.postlist.map(res=>{
  263. if(this.ruleClassifyId==res.value){
  264. if(this.member>0){//会员
  265. this.offlinePrice = res.offlineMemberPrice //会员线下价格
  266. this.customizationPrice = res.customizationMemberPrice //会员定金单价
  267. }else{//非会员
  268. this.offlinePrice = res.offlinePrice //非会员线下价格
  269. this.customizationPrice = res.customizationPrice //非会员定金单价
  270. }
  271. }
  272. })
  273. this.getPostList()
  274. },
  275. getPostlist() {
  276. this.show = true
  277. },
  278. //获取专业
  279. getPostList() {
  280. let data = {
  281. ruleClassifyId: this.ruleClassifyId
  282. }
  283. this.$Request.post('/app/rule/selectRulePostList', data).then(res => {
  284. if (res.code == 0) {
  285. var arr = []
  286. res.data.forEach((d, index) => {
  287. var data = {}
  288. data.label = d.rulePostName
  289. data.value = d.rulePostId
  290. arr.push(data)
  291. })
  292. this.ErjiList = arr
  293. }
  294. })
  295. },
  296. postlistConfirm(e) {
  297. this.rulePostName = e[0].label //专业名称
  298. this.rulePostId = e[0].value//专业id
  299. },
  300. save() {
  301. if (!this.postName) {
  302. uni.showToast({
  303. title: '请选择岗位',
  304. icon: 'none',
  305. duration: 1000
  306. })
  307. return
  308. }
  309. if (!this.rulePostName) {
  310. uni.showToast({
  311. title: '请选择专业',
  312. icon: 'none',
  313. duration: 1000
  314. })
  315. return
  316. }
  317. if (!this.postPrice) {
  318. uni.showToast({
  319. title: '请选择工资',
  320. icon: 'none',
  321. duration: 1000
  322. })
  323. return
  324. }
  325. if (!this.postPeopleNum) {
  326. uni.showToast({
  327. title: '请填写人数',
  328. icon: 'none',
  329. duration: 1000
  330. })
  331. return
  332. }
  333. if (!this.postSex) {
  334. uni.showToast({
  335. title: '请选择性别',
  336. icon: 'none',
  337. duration: 1000
  338. })
  339. return
  340. }
  341. if (!this.postPrice) {
  342. uni.showToast({
  343. title: '请填写工资',
  344. icon: 'none',
  345. duration: 1000
  346. })
  347. return
  348. }
  349. if (!this.postAge) {
  350. uni.showToast({
  351. title: '请选择年龄',
  352. icon: 'none',
  353. duration: 1000
  354. })
  355. return
  356. }
  357. if (!this.education) {
  358. uni.showToast({
  359. title: '请选择学历',
  360. icon: 'none',
  361. duration: 1000
  362. })
  363. return
  364. }
  365. let data = {
  366. postName: this.postName, //岗位名称
  367. ruleClassifyId: this.ruleClassifyId,
  368. rulePostName: this.rulePostName, //岗位职称
  369. rulePostId: this.rulePostId,
  370. postPeopleNum: this.postPeopleNum, //岗位人数
  371. postSex: this.postSex, //性别
  372. postAge: this.postAge, //年龄段
  373. offlinePrice: this.offlinePrice, //线下价格
  374. postPrice:this.postPrice,//薪资
  375. education:this.education,//学历要求
  376. customizationPrice: this.customizationPrice, //保证金价格
  377. customizationPrices:this.customizationPrices,//总积分
  378. }
  379. if(this.postDetailsIndex){
  380. this.postDetailsList[this.postDetailsIndex] = data //修改的时候直接替换数组
  381. }else{
  382. this.postDetailsList.push(data) //否则直接追加
  383. }
  384. console.log(this.postDetailsList)
  385. uni.setStorageSync('postDetailsList', this.postDetailsList)
  386. uni.navigateBack()
  387. }
  388. }
  389. }
  390. </script>
  391. <style lang="less">
  392. page {
  393. background: #F2F2F7;
  394. }
  395. .box {
  396. background: #FFFFFF;
  397. border-radius: 24upx;
  398. margin: 30upx;
  399. padding: 30upx;
  400. }
  401. .u-input__input {
  402. text-align: right !important;
  403. }
  404. .subbtn {
  405. width: 100%;
  406. display: flex;
  407. align-items: center;
  408. justify-content: space-between;
  409. background: #fff;
  410. border-radius: 10upx;
  411. height: 90upx;
  412. // padding: 30upx 0upx;
  413. color: #000;
  414. position: fixed;
  415. left: 0;
  416. right: 0;
  417. bottom: 0;
  418. z-index: 99;
  419. }
  420. .btn {
  421. background: #82A9FE;
  422. color: #FFFFFF;
  423. width: 30%;
  424. height: 90upx;
  425. line-height: 90upx;
  426. text-align: center;
  427. }
  428. </style>