releaseInfoUrgent.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <!-- 商家-发布/编辑招聘信息-今日零工 -->
  2. <template>
  3. <view>
  4. <view class="contain">
  5. <view class="item">
  6. <view class="item_left">标题</view>
  7. <input type="text" @input="ipt" :data-key="'title'" :value="sub_data['title']" placeholder="请填写标题"
  8. class="item_right" />
  9. </view>
  10. <!-- 岗位详情 -->
  11. <view class="item">
  12. <view style="width: 100%;">
  13. <view
  14. style="padding-bottom: 15upx;display: flex;align-items: center;justify-content: space-between;">
  15. <view class="item_left bold_tit">详情</view>
  16. <image @click="upload_img" style="width: 40upx;height: 40upx;margin-right: 15upx;"
  17. src="../../static/add_img.png">
  18. </image>
  19. </view>
  20. <textarea style="width: 100%;margin-top: 15upx;" @input="ipt" :data-key="'work_desc'"
  21. :value="sub_data['work_desc']" placeholder='请输入详情' class="item_right" />
  22. <image @click="delete_img" v-if="sub_data.profile_photo" style="width: 100%;margin-top: 15upx;"
  23. mode="widthFix" :src="sub_data.profile_photo"></image>
  24. </view>
  25. </view>
  26. <view class="item">
  27. <view class="item_left">需求人数</view>
  28. <input type="number" @input="ipt" :data-key="'need_total'" :value="sub_data['need_total']"
  29. placeholder="请填写需求人数" class="item_right" />
  30. </view>
  31. <view class="item">
  32. <view class="item_left">性别</view>
  33. <view class="item_right">
  34. <radio-group @change="radio_change" data-key="gender_mode">
  35. <label>
  36. <radio color="#f7942e" value="0" :checked="sub_data.gender_mode==0" />
  37. <text>不限</text>
  38. </label>
  39. <label style="margin-left: 30upx;">
  40. <radio color="#f7942e" value="1" :checked="sub_data.gender_mode==1" />
  41. <text>仅男</text>
  42. </label>
  43. <label style="margin-left: 30upx;">
  44. <radio color="#f7942e" value="2" :checked="sub_data.gender_mode==2" />
  45. <text>仅女</text>
  46. </label>
  47. </radio-group>
  48. </view>
  49. </view>
  50. <view class="item">
  51. <view class="item_left">年龄</view>
  52. <view class="item_right">
  53. <radio-group @change="radio_change" data-key="age_mode">
  54. <label>
  55. <radio color="#f7942e" value="0" :checked="sub_data.age_mode==0" />
  56. <text>不限</text>
  57. </label>
  58. <label style="margin-left: 30upx;">
  59. <radio color="#f7942e" value="1" :checked="sub_data.age_mode==1" />
  60. <text>选择年龄</text>
  61. </label>
  62. </radio-group>
  63. </view>
  64. </view>
  65. <view v-if="sub_data.age_mode==1" class="item">
  66. <view class="item_left">年龄范围</view>
  67. <view class="item_right age_range">
  68. <input style="text-align: center;" type="number" @input="ipt" data-key="age_min"
  69. :value="sub_data.age_min" placeholder="最小年龄(>16)" />
  70. <view>—</view>
  71. <input style="text-align: center;" type="number" @input="ipt" data-key="age_max"
  72. :value="sub_data.age_max" placeholder="最大年龄(<65)" />
  73. </view>
  74. </view>
  75. <view class="item">
  76. <view class="item_left">金额/人</view>
  77. <input type="number" @input="ipt" :data-key="'eve_feetotal'" :value="sub_data['eve_feetotal']"
  78. :placeholder="'请填写日金额'" class="item_right" />
  79. </view>
  80. <view class="instr">
  81. <view style="text-indent: 20upx;">平台会因供需情况收取相应的服务费再支付给应聘者</view>
  82. </view>
  83. <!-- 开始和结束时间 -->
  84. <view class="item">
  85. <view class="item_left">工作时间</view>
  86. <picker mode="time" :value="sub_data.begin_hour" start="00:00" end="23:59" data-key="begin_hour"
  87. @change="bindTimeChange">
  88. <view style="margin-right: 10upx;" class="uni-input choose_add choose_add4">{{sub_data.begin_hour}}
  89. </view>
  90. </picker>
  91. ~
  92. <picker mode="time" :value="sub_data.finish_hour" start="00:00" end="23:59" data-key="finish_hour"
  93. @change="bindTimeChange">
  94. <view style="margin-left: 10upx;" class="uni-input choose_add choose_add4">{{sub_data.finish_hour}}
  95. </view>
  96. </picker>
  97. <view style="margin-left: 15upx;">共{{calc_hours(sub_data.begin_hour, sub_data.finish_hour)}}小时</view>
  98. </view>
  99. <view style="clear: both;height: 10upx;"></view>
  100. <text
  101. style="color: #56c6b0;background-color: #e4fffa;padding: 6upx 20upx;border-radius: 8upx;">请预留充足时间,以供应聘者选择</text>
  102. <view class="item">
  103. <view class="item_left">联系电话</view>
  104. <input type="text" @input="ipt" :data-key="'linker_phone'" :value="sub_data['linker_phone']"
  105. placeholder="请填写联系电话" class="item_right" />
  106. </view>
  107. <view class="item">
  108. <view class="item_left">工作地点</view>
  109. <view @click="openAddress" style="display: flex;align-items: center;justify-content: flex-end;"
  110. class="item_right">
  111. <view style="max-width: 450upx;" class="nowrap">
  112. {{sub_data.work_addr?sub_data.work_addr :'选择工作地点'}}
  113. </view>
  114. <image style="width: 16upx;height: 32upx;margin-left: 12upx;margin-right: 20upx;"
  115. src="../../static/arrow_grey2.png">
  116. </image>
  117. </view>
  118. </view>
  119. </view>
  120. <view @click="sub()" style="margin-top: 60upx;" class="main_btn_m main_width">提交</view>
  121. <view style="height: 60upx;"></view>
  122. <uni-popup ref="popup" :mask-click="false">
  123. <view class="modal_box">
  124. <view style="color: #313131;text-align: center;font-size: 38upx;line-height: 90upx;">注意事项</view>
  125. <view class="mention">
  126. <view>1、商家在平台对应聘者的报名需及时处理,长时间不处理会被其他商家录用。</view>
  127. <view>2、免费发布招聘,录取应聘者需将工资垫付在平台,完工后请及时在平台内确认。</view>
  128. <view>3、每个报名者已把报名押金预付到平台,未到协定岗位者报名押金将全部补偿给商家。</view>
  129. <view>4、录取应聘者后因自身原因违约,取消工作,则扣除相应工资补偿给应聘者。</view>
  130. </view>
  131. <view class="modal_btn">
  132. <view @click="close_modal()" class="modal_btn_cancel">取消</view>
  133. <view @click="sub_data_req()" class="modal_btn_confirm">发布</view>
  134. </view>
  135. </view>
  136. </uni-popup>
  137. </view>
  138. </template>
  139. <script>
  140. import commonData from '../../commonData.js'
  141. import commonFun from '../../commonFun.js'
  142. export default {
  143. data() {
  144. return {
  145. id: null,
  146. url: '&WsAjaxBiz=Trader&WsAjaxAction=entityDataHandle',
  147. releaseInfo: commonData.releaseInfo,
  148. calc_hours: commonFun.calc_hours,
  149. calc_date: commonFun.calc_date,
  150. sub_data: { //提交的数据
  151. settle_catalog: 0, //是否批量招聘
  152. age_mode: 0, //年龄, 0-不限;1-限制
  153. gender_mode: 0, //性别, 0-不限;1-限男;2-限女;
  154. meals_providing: 0, //是否管饭 0-不管;1-管饭;
  155. enroll_audit: 1, //是否需要审核
  156. settle_mode: 0, //核销模式
  157. begin_hour: '08:00',
  158. finish_hour: '17:00',
  159. work_addr1: '',
  160. work_addr: '', //工作地点
  161. work_addr_lng: '', //经度117.333
  162. work_addr_lat: '', //纬度39.33
  163. },
  164. total_sal: '', //计算页面总金额
  165. }
  166. },
  167. onLoad(e) {
  168. // e.id = 399
  169. if (e.id) {
  170. this.get_data(e.id)
  171. } else {
  172. let sub_data = {
  173. ...this.sub_data,
  174. }
  175. this.sub_data = sub_data
  176. let DRAFT = uni.getStorageSync('DRAFT1')
  177. if (DRAFT && DRAFT.title) {
  178. uni.showModal({
  179. title: '是否使用草稿内容?',
  180. content: '草稿标题:' + DRAFT.title,
  181. success: (res) => {
  182. if (res.confirm) {
  183. DRAFT.id = ''
  184. this.sub_data = {
  185. ...DRAFT,
  186. }
  187. } else {
  188. // 不使用草稿,则清空草稿
  189. uni.setStorageSync('DRAFT1', '')
  190. }
  191. }
  192. })
  193. }
  194. }
  195. },
  196. methods: {
  197. // 获取数据
  198. get_data(bizId) {
  199. console.log('发布招聘请求id',bizId)
  200. // return
  201. commonFun.requestUrl(this.url, {
  202. bizCatalog: 'RecruitEntity',
  203. handleMode: 'fetch',
  204. bizId
  205. }, res => {
  206. console.log('发布招聘获取招聘详情',res)
  207. if (res.status) {
  208. let sub_data = res.data.Result
  209. sub_data.eve_feetotal = sub_data.feetotal
  210. this.sub_data = sub_data
  211. console.log('编辑页面获取发布详情')
  212. console.log(this.sub_data)
  213. }
  214. })
  215. },
  216. // 提交数据
  217. sub_data_req() {
  218. this.close_modal()
  219. uni.showLoading({
  220. title: '加载中...',
  221. mask: true
  222. })
  223. let sub_data = this.sub_data
  224. sub_data.feetotal = sub_data.eve_feetotal
  225. sub_data.urgent_level = 1
  226. sub_data.linker_name = '今日零工'
  227. sub_data.id = ''
  228. let params = {
  229. bizCatalog: 'RecruitEntity',
  230. handleMode: 'upsertLaunchAudit',
  231. bizData: sub_data
  232. }
  233. console.log('发布请求数据')
  234. console.log(params.bizData)
  235. // return
  236. commonFun.requestUrl(this.url, params, res => {
  237. console.log('发布返回数据')
  238. console.log(res)
  239. uni.hideLoading()
  240. if (res.status) {
  241. uni.showModal({
  242. content: '发布成功',
  243. showCancel: false,
  244. success: () => {
  245. uni.navigateBack({
  246. delta: 1
  247. });
  248. }
  249. })
  250. } else {
  251. if (res.data && res.data.ErrCode && res.data.ErrCode == 'NoEnoughCount') {
  252. uni.showModal({
  253. title: '剩余发布人数不足',
  254. content: '发布扣除' + this.sub_data.need_total + '人,当前剩余' + (res.data
  255. .ErrMsg.useFreeCount + res.data.ErrMsg
  256. .balance) + '人',
  257. confirmText: '去充值',
  258. success: (res2) => {
  259. if (res2.confirm) {
  260. uni.navigateTo({
  261. url: '/pages/personal/wallet?dvalue=' + res.data
  262. .ErrMsg.dvalue
  263. })
  264. }
  265. }
  266. })
  267. }
  268. }
  269. })
  270. },
  271. // 点击提交数据
  272. sub() {
  273. let sub_data = {
  274. ...this.sub_data,
  275. }
  276. sub_data.begin_datetime = commonFun.formatDate2(new Date())
  277. sub_data.finish_datetime = commonFun.formatDate2(new Date())
  278. console.log(this.sub_data)
  279. if (!sub_data.work_desc || !sub_data.title || !sub_data.need_total || !sub_data.eve_feetotal || !sub_data
  280. .linker_phone) {
  281. uni.showModal({
  282. content: '标题、详情、需求人数、金额/人、联系电话不允许为空',
  283. showCancel: false,
  284. });
  285. return
  286. }
  287. if (sub_data.work_addr == '') {
  288. uni.showModal({
  289. content: '请选择工作地点',
  290. showCancel: false,
  291. });
  292. return
  293. }
  294. if (sub_data.age_mode == 1) {
  295. let age_min = Number(sub_data.age_min)
  296. let age_max = Number(sub_data.age_max)
  297. if (isNaN(age_min) || isNaN(age_max) || age_min < 1 || age_max < 1 || age_min >= age_max) {
  298. uni.showModal({
  299. content: '请输入正确的年龄范围!',
  300. showCancel: false,
  301. });
  302. return
  303. }
  304. }
  305. this.sub_data = sub_data
  306. this.open_modal()
  307. },
  308. // 单选事件
  309. radio_change(e) {
  310. let key = e.currentTarget.dataset.key
  311. let sub_data = {
  312. ...this.sub_data,
  313. }
  314. sub_data[key] = e.target.value
  315. this.sub_data = sub_data
  316. uni.setStorageSync('DRAFT1', sub_data)
  317. },
  318. // input和textarea的输入框输入事件
  319. ipt(e) {
  320. let key = e.currentTarget.dataset.key
  321. let sub_data = {
  322. ...this.sub_data
  323. }
  324. sub_data[key] = e.target.value
  325. this.sub_data = sub_data
  326. console.log(sub_data)
  327. uni.setStorageSync('DRAFT1', sub_data)
  328. },
  329. // 删除招聘图片
  330. delete_img() {
  331. uni.showModal({
  332. content: '确认删除头图?',
  333. success: (res) => {
  334. if (res.confirm) {
  335. let sub_data = {
  336. ...this.sub_data
  337. }
  338. sub_data.profile_photo = ''
  339. this.sub_data = sub_data
  340. uni.setStorageSync('DRAFT1', sub_data)
  341. }
  342. }
  343. })
  344. },
  345. // 上传招聘图片
  346. upload_img(e) {
  347. commonFun.uploadFileApiOSS(res => {
  348. if (res.status) {
  349. let sub_data = {
  350. ...this.sub_data
  351. }
  352. sub_data.profile_photo = res.data
  353. this.sub_data = sub_data
  354. uni.setStorageSync('DRAFT1', sub_data)
  355. }
  356. })
  357. },
  358. // 时间选择
  359. bindTimeChange(e) {
  360. const key = e.currentTarget.dataset.key
  361. const value = e.target.value
  362. let sub_data = {
  363. ...this.sub_data
  364. }
  365. sub_data[key] = value
  366. this.sub_data = sub_data
  367. uni.setStorageSync('DRAFT1', sub_data)
  368. },
  369. // 打开窗口
  370. open_modal() {
  371. this.$refs.popup.open('top')
  372. },
  373. // 关闭窗口
  374. close_modal() {
  375. this.$refs.popup.close('top')
  376. },
  377. // 打开地图
  378. openAddress() {
  379. uni.chooseLocation({
  380. success: (res) => {
  381. let sub_data = {
  382. ...this.sub_data,
  383. }
  384. sub_data['work_addr1'] = res.name
  385. sub_data['work_addr'] = res.address
  386. sub_data['work_addr_lng'] = res.longitude
  387. sub_data['work_addr_lat'] = res.latitude
  388. this.sub_data = sub_data
  389. uni.setStorageSync('DRAFT1', sub_data)
  390. },
  391. fail: (res) => {
  392. if (res.errMsg.indexOf('cancel') == -1) {
  393. uni.showModal({
  394. title: '打开地图失败',
  395. content: JSON.stringify(res)
  396. })
  397. }
  398. }
  399. });
  400. },
  401. }
  402. }
  403. </script>
  404. <style>
  405. .main_btn_m {
  406. background: #f7942e;
  407. color: white;
  408. line-height: 90upx;
  409. text-align: center;
  410. border-radius: 15upx;
  411. }
  412. .bold_tit {
  413. font-size: 30upx;
  414. color: #666666;
  415. font-weight: bold;
  416. }
  417. .item_date_picker {
  418. width: 280upx;
  419. }
  420. .choose_add4 {
  421. background-color: #ffffff;
  422. color: #f7942e;
  423. border: 4upx solid #f7942e;
  424. }
  425. .choose_add3 {
  426. width: 180upx !important;
  427. }
  428. .choose_add2 {
  429. background-color: #22a58f;
  430. }
  431. .instr {
  432. background-color: #fffaf6;
  433. padding: 20upx 0;
  434. }
  435. .instr view {
  436. color: #FE7632;
  437. font-size: 26upx;
  438. }
  439. .age_range {
  440. display: flex;
  441. align-items: center;
  442. }
  443. .item {
  444. border-bottom: 2upx solid #ececec;
  445. display: flex;
  446. align-items: center;
  447. width: 100%;
  448. padding: 30upx 0;
  449. }
  450. .item input.item_right {
  451. height: 70upx;
  452. font-size: 30upx !important;
  453. color: #000000;
  454. }
  455. .item textarea {
  456. font-size: 30upx;
  457. /* text-indent: 20upx; */
  458. height: 240upx;
  459. background-color: #fafafa;
  460. color: #000000;
  461. }
  462. .item_right {
  463. width: 70%;
  464. font-size: 28upx;
  465. }
  466. .item_left {
  467. width: 30%;
  468. color: #585858;
  469. font-size: 28upx !important;
  470. white-space: nowrap;
  471. overflow: hidden;
  472. text-overflow: ellipsis;
  473. }
  474. .contain {
  475. background-color: #ffffff;
  476. width: 94%;
  477. padding: 0 3% 3%;
  478. border-radius: 15upx;
  479. }
  480. page {
  481. background-color: #ffffff;
  482. }
  483. </style>