publish_present.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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></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></el-col>
  98. </el-row>
  99. <el-row>
  100. <el-col :span="19" :offset="5">技能要求:<span>{{skill}}</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. manager:'',
  137. salary_from:'',
  138. salary_to:'',
  139. month:'',
  140. directions:'',
  141. skill:'',
  142. job_description:'',
  143. status: [{
  144. statusValue: '0',
  145. label: '下架隐藏'
  146. }, {
  147. statusValue: '1',
  148. label: '开放中'
  149. }, {
  150. statusValue: '2',
  151. label: '停止申请'
  152. }, {
  153. statusValue: '3',
  154. label: '开发中'
  155. }, {
  156. statusValue: '4',
  157. label: '已结束'
  158. }],
  159. statusValue: '0',
  160. citys: [{
  161. city: '0',
  162. label: '不限'
  163. }, {
  164. city: '1',
  165. label: '北京'
  166. }, {
  167. city: '2',
  168. label: '上海'
  169. }, {
  170. city: '3',
  171. label: '广州'
  172. }, {
  173. city: '4',
  174. label: '深圳'
  175. }, {
  176. city: '5',
  177. label: '成都'
  178. }, {
  179. city: '6',
  180. label: '杭州'
  181. }],
  182. city: '0',
  183. }
  184. },
  185. mounted() {
  186. this.getPresentInfo();
  187. },
  188. methods: {
  189. async getPresentInfo() {
  190. let query = window.location.search.substring(1);
  191. let vars = query.split("&");
  192. let body = {
  193. 'job_id' : vars[0].split("=")[1],
  194. 'job_type' : vars[1].split("=")[1],
  195. }
  196. const res = await this.$post("/api/admin/present_job/present_info",body);
  197. this.related_id = res.data.job.id;
  198. this.uid = res.data.job.uid;
  199. this.title = res.data.job.title2;
  200. this.related_type = res.data.job_type;
  201. this.manager = res.data.manager;
  202. this.salary_from = res.data.job.match_salary_min;
  203. this.salary_to = res.data.job.match_salary_max;
  204. this.month = res.data.job.month;
  205. this.directions = res.data.job.directions;
  206. this.skill = res.data.job.skill;
  207. this.statusValue = res.data.job.status;
  208. this.city = res.data.job.city;
  209. this.job_description = res.data.job.description;
  210. },
  211. async cancelPresent() {
  212. window.history.back();
  213. },
  214. async savePresent() {
  215. let flag = false;
  216. let salaryAlert = document.getElementById('salaryAlert');
  217. let monthAlert = document.getElementById('monthAlert');
  218. let jobInfoAlert = document.getElementById('jobInfoAlert');
  219. if (this.salary_from.length==0||this.salary_to.length==0){
  220. salaryAlert.innerText = '请正确输入薪酬范围';
  221. salaryAlert.style.display = 'block';
  222. flag = true;
  223. }
  224. if (this.month.length==0){
  225. monthAlert.innerText = '请输入驻场周期';
  226. monthAlert.style.display = 'block';
  227. flag = true;
  228. }
  229. if (this.job_description.length==0){
  230. jobInfoAlert.innerText = '请输入工作内容';
  231. jobInfoAlert.style.display = 'block';
  232. flag = true;
  233. }
  234. if (this.salary_from<1||this.salary_from>1000000||this.salary_to<1||this.salary_to>1000000||this.salary_from>=this.salary_to){
  235. salaryAlert.innerText = '薪酬填写范围1-1000000且前一个值要小于后一个值';
  236. salaryAlert.style.display = 'block';
  237. flag = true;
  238. }
  239. if ((this.month<1||this.month>99)&&this.month.length!=0){
  240. monthAlert.innerText = '驻场周期正确填写范围1-99';
  241. monthAlert.style.display = 'block';
  242. flag = true;
  243. }
  244. if (this.job_description.length>10000){
  245. jobInfoAlert.innerText = '工作内容填写最多10000个字符且不能为空';
  246. jobInfoAlert.style.display = 'block';
  247. flag = true;
  248. }
  249. if (flag){
  250. return false;
  251. }
  252. let body = {
  253. 'related_id' : this.related_id,
  254. 'title' : this.title,
  255. 'related_type' : this.related_type,
  256. 'status' : this.statusValue,
  257. 'salary_from' : this.salary_from,
  258. 'salary_to' : this.salary_to,
  259. 'city' : this.city,
  260. 'month' : this.month,
  261. 'job_direction' : this.job_direction,
  262. 'job_skills' : this.job_skills,
  263. 'job_description' :this.job_description
  264. }
  265. const res = await this.$post("/api/admin/present_job/present_edit",body);
  266. if (res.status==1) {
  267. alert(res.info);
  268. self.location=document.referrer;
  269. }
  270. }
  271. }
  272. }
  273. </script>
  274. <style lang="scss" scoped>
  275. .el-row {
  276. margin-bottom: 20px;
  277. }
  278. .top{
  279. margin-top: 10px;
  280. }
  281. </style>