add.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <view>
  3. <!-- 顶部占位区域 -->
  4. <navBar title="求职意向" color="#000" />
  5. <!-- 表单 -->
  6. <view class="list flex justify-center">
  7. <view class="list-box">
  8. <view class="list-box-job flex justify-between align-center">
  9. <view class="list-box-job-l" @click="gotoJob('/package/jobIntention/jobList')">
  10. <view
  11. class="list-box-job-l-label"
  12. @click="gotoJob('/package/jobIntention/jobList')"
  13. >
  14. 期望岗位
  15. </view>
  16. <view
  17. class=""
  18. @click="gotoJob('/package/jobIntention/jobList')"
  19. style="width: 100%"
  20. >
  21. <u-input
  22. @click="gotoJob('/package/jobIntention/jobList')"
  23. disabled
  24. v-model="ruleClassifyName"
  25. :clearable="false"
  26. input-align="left"
  27. type="text"
  28. placeholder="请选择"
  29. />
  30. </view>
  31. </view>
  32. <view class="list-box-job-r" @click="gotoJob('/package/jobIntention/jobList')">
  33. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  34. </view>
  35. </view>
  36. <view class="list-box-line"></view>
  37. <view
  38. class="list-box-job flex justify-between align-center"
  39. @click="gotoJob('/package/jobIntention/city')"
  40. >
  41. <view class="list-box-job-l" @click="gotoJob('/package/jobIntention/city')">
  42. <view
  43. class="list-box-job-l-label"
  44. @click="gotoJob('/package/jobIntention/city')"
  45. >
  46. 期望地点
  47. </view>
  48. <view class="" style="width: 100%">
  49. <u-input
  50. disabled
  51. v-model="city"
  52. @click="gotoJob('/package/jobIntention/city')"
  53. :clearable="false"
  54. input-align="left"
  55. type="text"
  56. placeholder="如:北京"
  57. />
  58. </view>
  59. </view>
  60. <view class="list-box-job-r" @click="gotoJob('/package/jobIntention/city')">
  61. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  62. </view>
  63. </view>
  64. <view class="list-box-line"></view>
  65. <view
  66. class="list-box-job flex justify-between align-center"
  67. @click="gotoJob('/package/jobIntention/industry')"
  68. >
  69. <view class="list-box-job-l" @click="gotoJob('/package/jobIntention/industry')">
  70. <view
  71. class="list-box-job-l-label"
  72. @click="gotoJob('/package/jobIntention/industry')"
  73. >
  74. 期望行业
  75. </view>
  76. <view
  77. class=""
  78. @click="gotoJob('/package/jobIntention/industry')"
  79. style="width: 100%"
  80. >
  81. <u-input
  82. @click="gotoJob('/package/jobIntention/industry')"
  83. disabled
  84. v-model="industry"
  85. :clearable="false"
  86. input-align="left"
  87. type="text"
  88. placeholder="如:互联网/电子商务"
  89. />
  90. </view>
  91. </view>
  92. <view class="list-box-job-r" @click="gotoJob('/package/jobIntention/industry')">
  93. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  94. </view>
  95. </view>
  96. <view class="list-box-line"></view>
  97. <view
  98. class="list-box-job flex justify-between align-center"
  99. @click="getMonyList()"
  100. >
  101. <view class="list-box-job-l" @click="getMonyList()">
  102. <view class="list-box-job-l-label" @click="getMonyList()"> 期望薪资 </view>
  103. <view class="" style="width: 100%">
  104. <u-input
  105. disabled
  106. v-model="resumesCompensation"
  107. @click="getMonyList()"
  108. :clearable="false"
  109. input-align="left"
  110. type="text"
  111. placeholder="如:1W-2W"
  112. />
  113. </view>
  114. </view>
  115. <view class="list-box-job-r" @click="getMonyList()">
  116. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  117. </view>
  118. </view>
  119. <view class="list-box-line"></view>
  120. <view
  121. class="list-box-job flex justify-between align-center"
  122. @click="getPostType()"
  123. >
  124. <view class="list-box-job-l" @click="getPostType()">
  125. <view class="list-box-job-l-label" @click="getPostType()"> 工作性质 </view>
  126. <view class="" style="width: 100%">
  127. <u-input
  128. disabled
  129. v-model="workType"
  130. @click="getPostType()"
  131. :clearable="false"
  132. input-align="left"
  133. type="text"
  134. placeholder="如:全职"
  135. />
  136. </view>
  137. </view>
  138. <view class="list-box-job-r" @click="getPostType()">
  139. <u-icon name="arrow-right" color="#999999" size="28"></u-icon>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 确认 -->
  145. <view class="subbtn flex justify-center" @click="addjob()">
  146. <view class="subbtn-box flex justify-center align-center"> 保存 </view>
  147. </view>
  148. <!-- 薪资 -->
  149. <u-select v-model="monyShow" :list="monyList" @confirm="moneyConfirm"></u-select>
  150. <!-- 工作性质 -->
  151. <u-select v-model="workShow" :list="workTypes" @confirm="workConfirm"></u-select>
  152. </view>
  153. </template>
  154. <script>
  155. import navBar from "@/components/nav-bar/index.vue";
  156. export default {
  157. data() {
  158. return {
  159. statusBarHeight: 0,
  160. monyShow: false,
  161. monyList: [], //薪资列表
  162. resumesCompensation: "", //薪资
  163. workShow: false,
  164. workType: "", //工作性质
  165. workTypes: [],
  166. city: "", //城市
  167. ruleClassifyId: "", //岗位id
  168. ruleClassifyName: "", //岗位名称
  169. industry: "",
  170. classifyOneId: "", //岗位一级
  171. classifyTwoId: "", //岗位二级id
  172. isDefault: 0,
  173. };
  174. },
  175. components: {
  176. navBar,
  177. },
  178. onLoad() {
  179. // 获取状态栏高度
  180. const systemInfo = uni.getSystemInfoSync();
  181. this.statusBarHeight = systemInfo.statusBarHeight || 0;
  182. },
  183. onShow() {
  184. let that = this;
  185. //选择的岗位
  186. uni.$on("jobs", (info) => {
  187. that.ruleClassifyId = info.ruleClassifyId;
  188. that.ruleClassifyName = info.ruleClassifyName;
  189. // that.classifyOneId = info.ruleClassifyId1
  190. // that.classifyTwoId = info.ruleClassifyId2
  191. });
  192. //选择的城市
  193. uni.$on("city", (info) => {
  194. that.city = info.city;
  195. });
  196. //选择的行业
  197. uni.$on("industry", (info) => {
  198. that.industry = info.industry;
  199. });
  200. },
  201. methods: {
  202. /**
  203. * 提交求职期望
  204. */
  205. addjob() {
  206. if (!this.ruleClassifyId) {
  207. uni.showToast({
  208. title: "请选择期望岗位",
  209. icon: "none",
  210. });
  211. return;
  212. }
  213. if (!this.city) {
  214. uni.showToast({
  215. title: "请选择期望城市",
  216. icon: "none",
  217. });
  218. return;
  219. }
  220. if (!this.industry) {
  221. uni.showToast({
  222. title: "请选择期望行业",
  223. icon: "none",
  224. });
  225. return;
  226. }
  227. if (!this.resumesCompensation) {
  228. uni.showToast({
  229. title: "请选择期望薪资",
  230. icon: "none",
  231. });
  232. return;
  233. }
  234. if (!this.workType) {
  235. uni.showToast({
  236. title: "请选择工作性质",
  237. icon: "none",
  238. });
  239. return;
  240. }
  241. let data = {
  242. ruleClassifyId: this.ruleClassifyId, //岗位id
  243. ruleClassifyName: this.ruleClassifyName, //岗位名称
  244. citys: this.city, //工作城市
  245. salaryRange: this.resumesCompensation, //薪资范围
  246. industry: this.industry, //行业
  247. postType: this.workType, //工作性质
  248. isDefault: this.isDefault,
  249. // classifyOneId:this.classifyOneId,
  250. // classifyTwoId:this.classifyTwoId
  251. };
  252. this.$Request.postT("/app/intention/saveUpdate", data).then((res) => {
  253. if (res.code == 0) {
  254. uni.showToast({
  255. title: "添加成功",
  256. });
  257. setTimeout(() => {
  258. uni.navigateBack();
  259. }, 1000);
  260. } else {
  261. uni.showToast({
  262. title: res.msg,
  263. icon: "none",
  264. });
  265. }
  266. });
  267. },
  268. workConfirm(e) {
  269. this.workType = e[0].value;
  270. },
  271. moneyConfirm(e) {
  272. this.resumesCompensation = e[0].value;
  273. },
  274. /**
  275. * 工作性质
  276. */
  277. getPostType() {
  278. this.$Request
  279. .get("/app/dict/list", {
  280. type: "工作性质",
  281. })
  282. .then((res) => {
  283. if (res.code == 0) {
  284. let arr = res.data;
  285. arr = JSON.parse(JSON.stringify(arr).replace(/code/g, "label"));
  286. this.workTypes = arr;
  287. this.workShow = true;
  288. }
  289. });
  290. },
  291. /**
  292. * 薪资列表
  293. */
  294. getMonyList() {
  295. this.$Request
  296. .get("/app/dict/list", {
  297. type: "薪资",
  298. })
  299. .then((res) => {
  300. if (res.code == 0) {
  301. let arr = res.data;
  302. arr = JSON.parse(JSON.stringify(arr).replace(/code/g, "label"));
  303. this.monyList = arr;
  304. this.monyShow = true;
  305. }
  306. });
  307. },
  308. gotoJob(url) {
  309. uni.navigateTo({
  310. url: url,
  311. });
  312. },
  313. },
  314. };
  315. </script>
  316. <style lang="scss">
  317. page {
  318. background-color: #f2f2f7;
  319. }
  320. .list {
  321. width: 100%;
  322. // height: 795rpx;
  323. margin-top: 30rpx;
  324. .list-box {
  325. width: 686rpx;
  326. height: 100;
  327. background-color: #ffffff;
  328. border-radius: 24rpx;
  329. .list-box-job {
  330. width: 606rpx;
  331. height: 164rpx;
  332. margin: 0 auto;
  333. .list-box-job-l {
  334. width: 80%;
  335. }
  336. .list-box-job-r {
  337. width: 30rpx;
  338. }
  339. }
  340. .list-box-line {
  341. width: 650rpx;
  342. height: 1rpx;
  343. border: 1rpx solid #f2f2f2;
  344. }
  345. }
  346. }
  347. .subbtn {
  348. width: 100%;
  349. height: 88rpx;
  350. margin-top: 90rpx;
  351. .subbtn-box {
  352. width: 686rpx;
  353. height: 100%;
  354. background-color: #016bf6;
  355. border-radius: 44rpx;
  356. color: #ffffff;
  357. font-size: 32rpx;
  358. font-weight: bold;
  359. }
  360. }
  361. </style>