updataGangws.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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. console.log(obj,'*******************')
  154. this.postName = obj.postName
  155. this.rulePostName = obj.rulePostName
  156. this.ruleClassifyId = obj.ruleClassifyId
  157. this.rulePostId = obj.rulePostId
  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.customizationPrices = obj.customizationPrices
  164. this.customizationPrice = obj.customizationPrice
  165. this.getinit()
  166. }
  167. },
  168. onShow() {
  169. },
  170. methods: {
  171. getinit(){
  172. let data = {
  173. status: 1
  174. }
  175. this.$Request.get('/app/rule/selectRuleClassifyList', data).then(res => {
  176. if (res.code == 0) {
  177. var arr = []
  178. res.data.forEach((d, index) => {
  179. var data = {}
  180. data.label = d.ruleClassifyName
  181. data.value = d.ruleClassifyId
  182. data.offlinePrice = d.offlinePrice
  183. data.offlineMemberPrice = d.offlineMemberPrice
  184. data.customizationPrice = d.customizationPrice
  185. data.customizationMemberPrice = d.customizationMemberPrice
  186. arr.push(data)
  187. })
  188. this.postlist = arr
  189. this.postlist.map(item=>{
  190. if(this.ruleClassifyId==item.value){
  191. if(this.member>0){//会员
  192. this.offlinePrice = item.offlineMemberPrice //会员线下价格
  193. }else{//非会员
  194. this.offlinePrice = item.offlinePrice //非会员线下价格
  195. }
  196. }
  197. })
  198. }
  199. })
  200. },
  201. //学历选择
  202. educationyConfirm(e){
  203. this.education = e[0].value
  204. },
  205. //年龄选择
  206. ageConfirm(e){
  207. this.postAge = e[0].value
  208. },
  209. //学历
  210. getxueliList(){
  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.educationList = arr
  218. this.educationShow = true
  219. }
  220. })
  221. },
  222. //年龄
  223. getAgeList(){
  224. this.$Request.get('/app/dict/list', {
  225. type:'年龄'
  226. }).then(res => {
  227. if (res.code == 0) {
  228. let arr = res.data
  229. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  230. this.ageList = arr
  231. this.ageShow = true
  232. }
  233. })
  234. },
  235. moneyConfirm(e){
  236. console.log(e)
  237. this.postPrice = e[0].value
  238. },
  239. //薪资列表
  240. getMonyList(){
  241. this.$Request.get('/app/dict/list', {
  242. type:'薪资'
  243. }).then(res => {
  244. if (res.code == 0) {
  245. let arr = res.data
  246. arr = JSON.parse(JSON.stringify(arr).replace(/code/g,'label'))
  247. this.monyList = arr
  248. this.monyShow = true
  249. }
  250. })
  251. },
  252. input(e) {
  253. if(this.postPeopleNum==''){
  254. this.customizationPrices = this.customizationPrice
  255. }else{
  256. this.customizationPrices = parseInt(this.customizationPrice * this.postPeopleNum).toFixed(0)
  257. }
  258. },
  259. SexConfirm(e) { //选择性别
  260. this.postSex = e[0].label
  261. },
  262. //获取一级岗位
  263. getPost() {
  264. this.getClassifyList()
  265. },
  266. //获取岗位
  267. getClassifyList() {
  268. let data = {
  269. status: 1
  270. }
  271. this.$Request.get('/app/rule/selectRuleClassifyList', data).then(res => {
  272. if (res.code == 0) {
  273. var arr = []
  274. res.data.forEach((d, index) => {
  275. var data = {}
  276. data.label = d.ruleClassifyName
  277. data.value = d.ruleClassifyId
  278. data.offlinePrice = d.offlinePrice
  279. data.offlineMemberPrice = d.offlineMemberPrice
  280. data.customizationPrice = d.customizationPrice
  281. data.customizationMemberPrice = d.customizationMemberPrice
  282. arr.push(data)
  283. })
  284. this.postlist = arr
  285. this.postShow = true
  286. }
  287. })
  288. },
  289. postConfirm(e) {
  290. this.postName = e[0].label
  291. this.ruleClassifyId = e[0].value
  292. this.postlist.map(res=>{
  293. if(this.ruleClassifyId==res.value){
  294. if(this.member>0){//会员
  295. this.offlinePrice = res.offlineMemberPrice //会员线下价格
  296. this.customizationPrice = res.customizationMemberPrice //会员定金单价
  297. }else{//非会员
  298. this.offlinePrice = res.offlinePrice //非会员线下价格
  299. this.customizationPrice = res.customizationPrice //非会员定金单价
  300. }
  301. }
  302. })
  303. this.input();
  304. this.getPostList()
  305. },
  306. getPostlist() {
  307. this.show = true
  308. },
  309. //获取专业
  310. getPostList() {
  311. let data = {
  312. ruleClassifyId: this.ruleClassifyId
  313. }
  314. this.$Request.post('/app/rule/selectRulePostList', data).then(res => {
  315. if (res.code == 0) {
  316. var arr = []
  317. res.data.forEach((d, index) => {
  318. var data = {}
  319. data.label = d.rulePostName
  320. data.value = d.rulePostId
  321. arr.push(data)
  322. })
  323. this.ErjiList = arr
  324. }
  325. })
  326. },
  327. postlistConfirm(e) {
  328. this.rulePostName = e[0].label //专业名称
  329. this.rulePostId = e[0].value//专业id
  330. },
  331. save() {
  332. if (!this.postName) {
  333. uni.showToast({
  334. title: '请选择岗位',
  335. icon: 'none',
  336. duration: 1000
  337. })
  338. return
  339. }
  340. if (!this.rulePostName) {
  341. uni.showToast({
  342. title: '请选择专业',
  343. icon: 'none',
  344. duration: 1000
  345. })
  346. return
  347. }
  348. if (!this.postPrice) {
  349. uni.showToast({
  350. title: '请选择工资',
  351. icon: 'none',
  352. duration: 1000
  353. })
  354. return
  355. }
  356. if (!this.postPeopleNum) {
  357. uni.showToast({
  358. title: '请填写人数',
  359. icon: 'none',
  360. duration: 1000
  361. })
  362. return
  363. }
  364. if (!this.postSex) {
  365. uni.showToast({
  366. title: '请选择性别',
  367. icon: 'none',
  368. duration: 1000
  369. })
  370. return
  371. }
  372. if (!this.postPrice) {
  373. uni.showToast({
  374. title: '请填写工资',
  375. icon: 'none',
  376. duration: 1000
  377. })
  378. return
  379. }
  380. if (!this.postAge) {
  381. uni.showToast({
  382. title: '请选择年龄',
  383. icon: 'none',
  384. duration: 1000
  385. })
  386. return
  387. }
  388. if (!this.education) {
  389. uni.showToast({
  390. title: '请选择学历',
  391. icon: 'none',
  392. duration: 1000
  393. })
  394. return
  395. }
  396. let data = {
  397. postName: this.postName, //岗位名称
  398. ruleClassifyId: this.ruleClassifyId,
  399. rulePostName: this.rulePostName, //岗位职称
  400. rulePostId: this.rulePostId,
  401. postPeopleNum: this.postPeopleNum, //岗位人数
  402. postSex: this.postSex, //性别
  403. postAge: this.postAge, //年龄段
  404. offlinePrice: this.offlinePrice, //线下价格
  405. postPrice:this.postPrice,//薪资
  406. education:this.education,//学历要求
  407. customizationPrice: this.customizationPrice, //保证金价格
  408. customizationPrices:this.customizationPrices,//总积分
  409. }
  410. if(this.postDetailsIndex){
  411. this.postDetailsList[this.postDetailsIndex] = data //修改的时候直接替换数组
  412. }else{
  413. this.postDetailsList.push(data) //否则直接追加
  414. }
  415. console.log(this.postDetailsList)
  416. uni.setStorageSync('postDetailsList', this.postDetailsList)
  417. uni.navigateBack()
  418. }
  419. }
  420. }
  421. </script>
  422. <style lang="less">
  423. page {
  424. background: #F2F2F7;
  425. }
  426. .box {
  427. background: #FFFFFF;
  428. border-radius: 24upx;
  429. margin: 30upx;
  430. padding: 30upx;
  431. }
  432. .u-input__input {
  433. text-align: right !important;
  434. }
  435. .subbtn {
  436. width: 100%;
  437. display: flex;
  438. align-items: center;
  439. justify-content: space-between;
  440. background: #fff;
  441. border-radius: 10upx;
  442. height: 90upx;
  443. // padding: 30upx 0upx;
  444. color: #000;
  445. position: fixed;
  446. left: 0;
  447. right: 0;
  448. bottom: 0;
  449. z-index: 99;
  450. }
  451. .btn {
  452. background: #82A9FE;
  453. color: #FFFFFF;
  454. width: 30%;
  455. height: 90upx;
  456. line-height: 90upx;
  457. text-align: center;
  458. }
  459. </style>