publish_present.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <div id="publish-present">
  3. <el-row>
  4. <el-col :span="16" :offset="8"><h2>驻场招聘信息表</h2></el-col>
  5. </el-row>
  6. <el-row>
  7. <el-col :span="19" :offset="5"><h3>基本信息</h3></el-col>
  8. </el-row>
  9. <el-row>
  10. <el-col :span="7" :offset="5">项目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="19" :offset="5">项目名称:<span>{{title}}</span></el-col>
  15. </el-row>
  16. <el-row>
  17. <el-col :span="19" :offset="5">项目类型:<span>{{related_type}}</span><span style="display: none">{{job_type}}</span></el-col>
  18. </el-row>
  19. <el-row>
  20. <el-col :span="7" :offset="5">客户经理:<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 status"
  28. :key="item.statusValue"
  29. :label="item.label"
  30. :value="item.statusValue"
  31. ></el-option>
  32. </el-select>
  33. </div>
  34. </div>
  35. </el-col>
  36. </el-row>
  37. <el-row>
  38. <el-col :span="19" :offset="5"><h3>驻场信息</h3></el-col>
  39. </el-row>
  40. <el-row>
  41. <el-col :span="19" :offset="5" >
  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="warning"
  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="19" :offset="5">
  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="19" :offset="5">
  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="warning"
  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="19" :offset="5">职位方向:<span>{{directions}}</span><span style="display: none">{{match_directions}}</span></el-col>
  98. </el-row>
  99. <el-row>
  100. <el-col :span="19" :offset="5">技能要求:<span>{{skill}}</span><span style="display: none">{{match_skills}}</span></el-col>
  101. </el-row>
  102. <el-row>
  103. <el-col :span="15" :offset="5">工作内容:
  104. <el-alert
  105. title=""
  106. class="top"
  107. id="jobInfoAlert"
  108. type="warning"
  109. style="display: none"
  110. show-icon>
  111. </el-alert>
  112. <el-input
  113. type="textarea"
  114. :autosize="{ minRows: 5, maxRows: 4}"
  115. placeholder="请输入内容"
  116. v-model="job_description">
  117. </el-input>
  118. </el-col>
  119. </el-row>
  120. <el-row>
  121. <el-col :span="19" :offset="5">
  122. <el-button type="primary" @click="savePresent">保存</el-button>
  123. <el-button type="info" @click="cancelPresent">取消</el-button>
  124. </el-col>
  125. </el-row>
  126. </div>
  127. </template>
  128. <script>
  129. export default {
  130. data () {
  131. return {
  132. related_id:'',
  133. uid:'',
  134. title:'',
  135. related_type:'',
  136. job_type:'',
  137. manager:'',
  138. salary_from:'',
  139. salary_to:'',
  140. month:'',
  141. directions:'',
  142. match_skills:'',
  143. skill:'',
  144. job_description:'',
  145. match_directions:'',
  146. jump_url:'',
  147. status: [{
  148. statusValue: '0',
  149. label: '下架隐藏'
  150. }, {
  151. statusValue: '1',
  152. label: '开放中'
  153. }, {
  154. statusValue: '2',
  155. label: '停止申请'
  156. }, {
  157. statusValue: '3',
  158. label: '开发中'
  159. }, {
  160. statusValue: '4',
  161. label: '已结束'
  162. }],
  163. statusValue: '0',
  164. citys: [{
  165. city: '0',
  166. label: '不限'
  167. }, {
  168. city: '1',
  169. label: '北京'
  170. }, {
  171. city: '2',
  172. label: '上海'
  173. }, {
  174. city: '3',
  175. label: '广州'
  176. }, {
  177. city: '4',
  178. label: '深圳'
  179. }, {
  180. city: '5',
  181. label: '成都'
  182. }, {
  183. city: '6',
  184. label: '杭州'
  185. }],
  186. city: '0',
  187. }
  188. },
  189. mounted() {
  190. this.getPresentInfo();
  191. },
  192. methods: {
  193. async getPresentInfo() {
  194. let query = window.location.search.substring(1);
  195. let vars = query.split("&");
  196. let body = {
  197. 'job_id' : vars[0].split("=")[1],
  198. 'job_type' : vars[1].split("=")[1],
  199. };
  200. let url = window.location.href;
  201. if(url.indexOf('dev')!=-1){
  202. this.jump_url = 'https://dev.test.proginn.com/rooter/cloudjobitem/';
  203. } else if(url.indexOf('local')!=-1){
  204. this.jump_url = 'http://local.proginn.com/rooter/cloudjobitem/';
  205. } else {
  206. this.jump_url = 'https://proginn.com/rooter/cloudjobitem/';
  207. }
  208. const res = await this.$post("/api/admin/present_job/present_info",body);
  209. this.related_id = res.data.job.id;
  210. this.uid = res.data.job.uid;
  211. this.title = res.data.job.title2;
  212. this.related_type = res.data.job_type;
  213. this.manager = res.data.manager;
  214. this.salary_from = res.data.job.match_salary_min;
  215. this.salary_to = res.data.job.match_salary_max;
  216. this.month = res.data.job.month;
  217. this.directions = res.data.job.directions;
  218. this.match_skills = res.data.job.match_skills;
  219. this.skill = res.data.job.skill;
  220. this.statusValue = res.data.job.status;
  221. this.city = res.data.job.city;
  222. this.job_type = vars[1].split("=")[1];
  223. this.job_description = res.data.job.description;
  224. this.match_directions = res.data.job.match_directions;
  225. },
  226. async cancelPresent() {
  227. window.history.back();
  228. },
  229. async savePresent() {
  230. let flag = false;
  231. let salaryAlert = document.getElementById('salaryAlert');
  232. let monthAlert = document.getElementById('monthAlert');
  233. let jobInfoAlert = document.getElementById('jobInfoAlert');
  234. if (this.salary_from.length==0||this.salary_to.length==0){
  235. salaryAlert.innerText = '请正确输入薪酬范围';
  236. salaryAlert.style.display = 'block';
  237. flag = true;
  238. }
  239. if (this.month.length==0){
  240. monthAlert.innerText = '请输入驻场周期';
  241. monthAlert.style.display = 'block';
  242. flag = true;
  243. }
  244. if (this.job_description.length==0){
  245. jobInfoAlert.innerText = '请输入工作内容';
  246. jobInfoAlert.style.display = 'block';
  247. flag = true;
  248. }
  249. if (this.salary_from<1||this.salary_from>1000000||this.salary_to<1||this.salary_to>1000000||this.salary_from>=this.salary_to){
  250. salaryAlert.innerText = '薪酬填写范围1-1000000且前一个值要小于后一个值';
  251. salaryAlert.style.display = 'block';
  252. flag = true;
  253. }
  254. if ((this.month<1||this.month>99)&&this.month.length!=0){
  255. monthAlert.innerText = '驻场周期正确填写范围1-99';
  256. monthAlert.style.display = 'block';
  257. flag = true;
  258. }
  259. if (this.job_description.length>10000){
  260. jobInfoAlert.innerText = '工作内容填写最多10000个字符且不能为空';
  261. jobInfoAlert.style.display = 'block';
  262. flag = true;
  263. }
  264. if (flag){
  265. return false;
  266. }
  267. let body = {
  268. 'related_id' : this.related_id,
  269. 'title' : this.title,
  270. 'related_type' : this.job_type,
  271. 'status' : this.statusValue,
  272. 'salary_from' : this.salary_from,
  273. 'salary_to' : this.salary_to,
  274. 'city' : this.city,
  275. 'month' : this.month,
  276. 'job_direction' : this.match_directions,
  277. 'job_skills' : this.match_skills,
  278. 'job_description' :this.job_description
  279. }
  280. const res = await this.$post("/api/admin/present_job/present_edit",body);
  281. if (res.status==1) {
  282. alert(res.info);
  283. location.href=this.jump_url+this.related_id;
  284. }
  285. }
  286. }
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. .el-row {
  291. margin-bottom: 20px;
  292. }
  293. .top{
  294. margin-top: 10px;
  295. }
  296. </style>