publish_present.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div id="publish-present">
  3. <el-row>
  4. <el-col :span="24" align="center"><h2>驻场招聘信息表</h2></el-col>
  5. </el-row>
  6. <el-row>
  7. <el-col :span="19"><h3>基本信息</h3></el-col>
  8. </el-row>
  9. <el-row>
  10. <el-col :span="12">项目ID:<span>{{related_id}}</span></el-col>
  11. <el-col :span="12" >需求方:<span>{{uid}}</span></el-col>
  12. </el-row>
  13. <el-row>
  14. <el-col :span="24" >项目名称:<span>{{title}}</span></el-col>
  15. </el-row>
  16. <el-row>
  17. <el-col :span="24">项目类型:<span>{{related_type}}</span><span style="display: none">{{job_type}}</span></el-col>
  18. </el-row>
  19. <el-row>
  20. <el-col :span="12">客户经理:<span>{{manager}}</span></el-col>
  21. <el-col :span="12" >
  22. <div class="inlineb">
  23. <span class>开放状态:</span>
  24. <div class="inlineb">
  25. <el-select v-model="statusValue" >
  26. <el-option
  27. v-for="item of openStatus"
  28. :key="item.id"
  29. :label="item.label"
  30. :value="item.id"
  31. ></el-option>
  32. </el-select>
  33. </div>
  34. </div>
  35. </el-col>
  36. </el-row>
  37. <el-row>
  38. <el-col :span="24"><h3>驻场信息</h3></el-col>
  39. </el-row>
  40. <el-row>
  41. <el-col :span="24" >
  42. <div class="inlineb">
  43. <span class>薪酬范围:</span>
  44. <div class="inlineb">
  45. ¥<el-input style="width: 230px;" v-model="salary_from" ></el-input>至
  46. </div>
  47. <div class="inlineb">
  48. ¥<el-input style="width: 230px;" v-model="salary_to" ></el-input>
  49. </div>
  50. <el-alert
  51. title=""
  52. class="top"
  53. id="salaryAlert"
  54. type="error"
  55. style="display: none"
  56. show-icon>
  57. </el-alert>
  58. </div>
  59. </el-col>
  60. </el-row>
  61. <el-row>
  62. <el-col :span="24">
  63. <div class="inlineb">
  64. <span class>驻场地点:</span>
  65. <div class="inlineb">
  66. <el-select v-model="city" >
  67. <el-option
  68. v-for="item of citys"
  69. :key="item.city"
  70. :label="item.label"
  71. :value="item.city"
  72. ></el-option>
  73. </el-select>
  74. </div>
  75. </div>
  76. </el-col>
  77. </el-row>
  78. <el-row>
  79. <el-col :span="24" >
  80. <div class="inlineb">
  81. <span class>驻场周期:</span>
  82. <div class="inlineb">
  83. <el-input style="width: 230px;" v-model="month" ></el-input>个月
  84. </div>
  85. <el-alert
  86. title=""
  87. class="top"
  88. id="monthAlert"
  89. type="error"
  90. style="display: none"
  91. show-icon>
  92. </el-alert>
  93. </div>
  94. </el-col>
  95. </el-row>
  96. <el-row>
  97. <el-col :span="24">
  98. <div class="inlineb">
  99. <span class>工作年限:</span>
  100. <div class="inlineb">
  101. <el-input style="width: 230px;" v-model="work_year" ></el-input>年
  102. </div>
  103. <el-alert
  104. title=""
  105. class="top"
  106. id="workYear"
  107. type="error"
  108. style="display: none"
  109. show-icon>
  110. </el-alert>
  111. </div>
  112. </el-col>
  113. </el-row>
  114. <el-row>
  115. <el-col :span="24">
  116. <div class="inlineb">
  117. <span class>是否有文件:</span>
  118. <div class="inlineb">
  119. <el-select v-model="file" >
  120. <el-option
  121. v-for="item of files"
  122. :key="item.id"
  123. :label="item.label"
  124. :value="item.id"
  125. ></el-option>
  126. </el-select>
  127. </div>
  128. </div>
  129. </el-col>
  130. </el-row>
  131. <el-row>
  132. <el-col :span="24">职位方向:<span>{{directions}}</span><span style="display: none">{{match_directions}}</span></el-col>
  133. </el-row>
  134. <el-row>
  135. <el-col :span="24">技能要求:<span>{{skill}}</span><span style="display: none">{{match_skills}}</span></el-col>
  136. </el-row>
  137. <el-row>
  138. <el-col :span="20">工作内容:
  139. <el-alert
  140. title=""
  141. class="top"
  142. id="jobInfoAlert"
  143. type="error"
  144. style="display: none"
  145. show-icon>
  146. </el-alert>
  147. <el-input
  148. type="textarea"
  149. :autosize="{ minRows: 5, maxRows: 4}"
  150. placeholder="请输入内容"
  151. v-model="job_description">
  152. </el-input>
  153. </el-col>
  154. </el-row>
  155. <el-row>
  156. <el-col :span="24">
  157. <el-button type="primary" @click="savePresent">保存</el-button>
  158. <el-button type="info" @click="cancelPresent">取消</el-button>
  159. </el-col>
  160. </el-row>
  161. </div>
  162. </template>
  163. <script>
  164. export default {
  165. data () {
  166. return {
  167. related_id:'',
  168. uid:'',
  169. title:'',
  170. related_type:'',
  171. job_type:'',
  172. manager:'',
  173. salary_from:'',
  174. salary_to:'',
  175. month:'',
  176. work_year:'',
  177. directions:'',
  178. match_skills:'',
  179. skill:'',
  180. job_description:'',
  181. match_directions:'',
  182. jump_url:'',
  183. citys: [{
  184. city: '0',
  185. label: '不限'
  186. }, {
  187. city: '1',
  188. label: '北京'
  189. }, {
  190. city: '2',
  191. label: '上海'
  192. }, {
  193. city: '3',
  194. label: '广州'
  195. }, {
  196. city: '4',
  197. label: '深圳'
  198. }, {
  199. city: '5',
  200. label: '成都'
  201. }, {
  202. city: '6',
  203. label: '杭州'
  204. }],
  205. city: '0',
  206. openStatus: [{
  207. id: 0,
  208. label: '下架隐藏'
  209. }, {
  210. id: 1,
  211. label: '开放中'
  212. }, {
  213. id: 2,
  214. label: '停止申请'
  215. }, {
  216. id: 3,
  217. label: '开发中'
  218. }, {
  219. id: 4,
  220. label: '已结束'
  221. }],
  222. statusValue: 0,
  223. files: [{
  224. id: '1',
  225. label: '是'
  226. }, {
  227. id: '0',
  228. label: '否'
  229. }],
  230. file: '0',
  231. }
  232. },
  233. mounted() {
  234. this.getPresentInfo();
  235. },
  236. methods: {
  237. async getPresentInfo() {
  238. let query = window.location.search.substring(1);
  239. let vars = query.split("&");
  240. let body = {
  241. 'job_id' : vars[0].split("=")[1],
  242. 'job_type' : vars[1].split("=")[1],
  243. };
  244. let url = window.location.href;
  245. if(url.indexOf('dev')!=-1){
  246. this.jump_url = 'https://dev.test.proginn.com/rooter/cloudjobitem/';
  247. } else if(url.indexOf('local')!=-1){
  248. this.jump_url = 'http://local.proginn.com/rooter/cloudjobitem/';
  249. } else {
  250. this.jump_url = 'https://proginn.com/rooter/cloudjobitem/';
  251. }
  252. const res = await this.$post("/api/admin/present_job/present_info",body);
  253. this.related_id = res.data.job.id;
  254. this.uid = res.data.job.uid;
  255. this.title = res.data.job.title2;
  256. this.related_type = res.data.job_type;
  257. this.manager = res.data.manager;
  258. this.salary_from = res.data.job.match_salary_min;
  259. this.salary_to = res.data.job.match_salary_max;
  260. this.month = res.data.job.month?res.data.job.month:'';
  261. this.work_year = res.data.job.work_year?res.data.job.work_year:'';
  262. this.directions = res.data.job.directions;
  263. this.match_skills = res.data.job.match_skills;
  264. this.skill = res.data.job.skill;
  265. this.statusValue = res.data.job.status?res.data.job.status:0;
  266. this.city = res.data.job.city?res.data.job.city:'0';
  267. this.file = res.data.job.show_file?res.data.job.show_file:'0';
  268. this.job_type = vars[1].split("=")[1];
  269. this.job_description = res.data.job.description;
  270. this.match_directions = res.data.job.match_directions;
  271. },
  272. async cancelPresent() {
  273. window.history.back();
  274. },
  275. async savePresent() {
  276. let flag = false;
  277. let salaryAlert = document.getElementById('salaryAlert');
  278. let monthAlert = document.getElementById('monthAlert');
  279. let jobInfoAlert = document.getElementById('jobInfoAlert');
  280. let workYearAlert = document.getElementById('workYear');
  281. if (this.work_year.length==0){
  282. workYearAlert.innerText = '请输入工作年限';
  283. workYearAlert.style.display = 'block';
  284. flag = true;
  285. }
  286. if (this.salary_from.length==0||this.salary_to.length==0){
  287. salaryAlert.innerText = '请正确输入薪酬范围';
  288. salaryAlert.style.display = 'block';
  289. flag = true;
  290. }
  291. if (this.month.length==0){
  292. monthAlert.innerText = '请输入驻场周期';
  293. monthAlert.style.display = 'block';
  294. flag = true;
  295. }
  296. if (this.job_description.length==0){
  297. jobInfoAlert.innerText = '请输入工作内容';
  298. jobInfoAlert.style.display = 'block';
  299. flag = true;
  300. }
  301. if ((this.work_year<0||this.work_year>99)&&this.work_year.length!=0){
  302. workYearAlert.innerText = '工作年限正确填写范围0-99';
  303. workYearAlert.style.display = 'block';
  304. flag = true;
  305. }
  306. this.salary_from = parseInt(this.salary_from);
  307. this.salary_to = parseInt(this.salary_to);
  308. if (this.salary_from<1||this.salary_from>1000000||this.salary_to<1||this.salary_to>1000000||this.salary_from>=this.salary_to){
  309. salaryAlert.innerText = '薪酬填写范围1-1000000且前一个值要小于后一个值';
  310. salaryAlert.style.display = 'block';
  311. flag = true;
  312. }
  313. if ((this.month<1||this.month>99)&&this.month.length!=0){
  314. monthAlert.innerText = '驻场周期正确填写范围1-99';
  315. monthAlert.style.display = 'block';
  316. flag = true;
  317. }
  318. if (this.job_description.length>10000){
  319. jobInfoAlert.innerText = '工作内容填写最多10000个字符且不能为空';
  320. jobInfoAlert.style.display = 'block';
  321. flag = true;
  322. }
  323. if (flag){
  324. return false;
  325. }
  326. let body = {
  327. 'related_id' : this.related_id,
  328. 'title' : this.title,
  329. 'related_type' : this.job_type,
  330. 'status' : this.statusValue,
  331. 'salary_from' : this.salary_from,
  332. 'salary_to' : this.salary_to,
  333. 'city' : this.city,
  334. 'show_file' : this.file,
  335. 'month' : this.month,
  336. 'work_year' : this.work_year,
  337. 'job_direction' : this.match_directions,
  338. 'job_skills' : this.match_skills,
  339. 'job_description' :this.job_description
  340. }
  341. const res = await this.$post("/api/admin/present_job/present_edit",body);
  342. if (res.status==1) {
  343. alert(res.info);
  344. location.href=this.jump_url+this.related_id;
  345. }
  346. }
  347. }
  348. }
  349. </script>
  350. <style lang="scss" scoped>
  351. .el-row {
  352. margin-bottom: 20px;
  353. }
  354. .top{
  355. margin-top: 10px;
  356. }
  357. </style>