| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- <template>
- <div id="publish-present">
- <el-row>
- <el-col :span="16" :offset="8"><h2>驻场招聘信息表</h2></el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5"><h3>基本信息</h3></el-col>
- </el-row>
- <el-row>
- <el-col :span="7" :offset="5">项目ID:<span>{{related_id}}</span></el-col>
- <el-col :span="12" >需求方:<span>{{uid}}</span></el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">项目名称:<span>{{title}}</span></el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">项目类型:<span>{{related_type}}</span><span style="display: none">{{job_type}}</span></el-col>
- </el-row>
- <el-row>
- <el-col :span="7" :offset="5">客户经理:<span>{{manager}}</span></el-col>
- <el-col :span="12" >
- <div class="inlineb">
- <span class>开放状态:</span>
- <div class="inlineb">
- <el-select v-model="statusValue" >
- <el-option
- v-for="item of status"
- :key="item.statusValue"
- :label="item.label"
- :value="item.statusValue"
- ></el-option>
- </el-select>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5"><h3>驻场信息</h3></el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5" >
- <div class="inlineb">
- <span class>薪酬范围:</span>
- <div class="inlineb">
- ¥<el-input style="width: 230px;" v-model="salary_from" ></el-input>至
- </div>
- <div class="inlineb">
- ¥<el-input style="width: 230px;" v-model="salary_to" ></el-input>
- </div>
- <el-alert
- title=""
- class="top"
- id="salaryAlert"
- type="warning"
- style="display: none"
- show-icon>
- </el-alert>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">
- <div class="inlineb">
- <span class>驻场地点:</span>
- <div class="inlineb">
- <el-select v-model="city" >
- <el-option
- v-for="item of citys"
- :key="item.city"
- :label="item.label"
- :value="item.city"
- ></el-option>
- </el-select>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">
- <div class="inlineb">
- <span class>驻场周期:</span>
- <div class="inlineb">
- <el-input style="width: 230px;" v-model="month" ></el-input>个月
- </div>
- <el-alert
- title=""
- class="top"
- id="monthAlert"
- type="warning"
- style="display: none"
- show-icon>
- </el-alert>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">职位方向:<span>{{directions}}</span><span style="display: none">{{match_directions}}</span></el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">技能要求:<span>{{skill}}</span><span style="display: none">{{match_skills}}</span></el-col>
- </el-row>
- <el-row>
- <el-col :span="15" :offset="5">工作内容:
- <el-alert
- title=""
- class="top"
- id="jobInfoAlert"
- type="warning"
- style="display: none"
- show-icon>
- </el-alert>
- <el-input
- type="textarea"
- :autosize="{ minRows: 5, maxRows: 4}"
- placeholder="请输入内容"
- v-model="job_description">
- </el-input>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="19" :offset="5">
- <el-button type="primary" @click="savePresent">保存</el-button>
- <el-button type="info" @click="cancelPresent">取消</el-button>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- export default {
- data () {
- return {
- related_id:'',
- uid:'',
- title:'',
- related_type:'',
- job_type:'',
- manager:'',
- salary_from:'',
- salary_to:'',
- month:'',
- directions:'',
- match_skills:'',
- skill:'',
- job_description:'',
- match_directions:'',
- jump_url:'',
- status: [{
- statusValue: '0',
- label: '下架隐藏'
- }, {
- statusValue: '1',
- label: '开放中'
- }, {
- statusValue: '2',
- label: '停止申请'
- }, {
- statusValue: '3',
- label: '开发中'
- }, {
- statusValue: '4',
- label: '已结束'
- }],
- statusValue: '0',
- citys: [{
- city: '0',
- label: '不限'
- }, {
- city: '1',
- label: '北京'
- }, {
- city: '2',
- label: '上海'
- }, {
- city: '3',
- label: '广州'
- }, {
- city: '4',
- label: '深圳'
- }, {
- city: '5',
- label: '成都'
- }, {
- city: '6',
- label: '杭州'
- }],
- city: '0',
- }
- },
- mounted() {
- this.getPresentInfo();
- },
- methods: {
- async getPresentInfo() {
- let query = window.location.search.substring(1);
- let vars = query.split("&");
- let body = {
- 'job_id' : vars[0].split("=")[1],
- 'job_type' : vars[1].split("=")[1],
- };
- let url = window.location.href;
- if(url.indexOf('dev')!=-1){
- this.jump_url = 'https://dev.test.proginn.com/rooter/cloudjobitem/';
- } else if(url.indexOf('local')!=-1){
- this.jump_url = 'http://local.proginn.com/rooter/cloudjobitem/';
- } else {
- this.jump_url = 'https://proginn.com/rooter/cloudjobitem/';
- }
- const res = await this.$post("/api/admin/present_job/present_info",body);
- this.related_id = res.data.job.id;
- this.uid = res.data.job.uid;
- this.title = res.data.job.title2;
- this.related_type = res.data.job_type;
- this.manager = res.data.manager;
- this.salary_from = res.data.job.match_salary_min;
- this.salary_to = res.data.job.match_salary_max;
- this.month = res.data.job.month;
- this.directions = res.data.job.directions;
- this.match_skills = res.data.job.match_skills;
- this.skill = res.data.job.skill;
- this.statusValue = res.data.job.status;
- this.city = res.data.job.city;
- this.job_type = vars[1].split("=")[1];
- this.job_description = res.data.job.description;
- this.match_directions = res.data.job.match_directions;
- },
- async cancelPresent() {
- window.history.back();
- },
- async savePresent() {
- let flag = false;
- let salaryAlert = document.getElementById('salaryAlert');
- let monthAlert = document.getElementById('monthAlert');
- let jobInfoAlert = document.getElementById('jobInfoAlert');
- if (this.salary_from.length==0||this.salary_to.length==0){
- salaryAlert.innerText = '请正确输入薪酬范围';
- salaryAlert.style.display = 'block';
- flag = true;
- }
- if (this.month.length==0){
- monthAlert.innerText = '请输入驻场周期';
- monthAlert.style.display = 'block';
- flag = true;
- }
- if (this.job_description.length==0){
- jobInfoAlert.innerText = '请输入工作内容';
- jobInfoAlert.style.display = 'block';
- flag = true;
- }
- if (this.salary_from<1||this.salary_from>1000000||this.salary_to<1||this.salary_to>1000000||this.salary_from>=this.salary_to){
- salaryAlert.innerText = '薪酬填写范围1-1000000且前一个值要小于后一个值';
- salaryAlert.style.display = 'block';
- flag = true;
- }
- if ((this.month<1||this.month>99)&&this.month.length!=0){
- monthAlert.innerText = '驻场周期正确填写范围1-99';
- monthAlert.style.display = 'block';
- flag = true;
- }
- if (this.job_description.length>10000){
- jobInfoAlert.innerText = '工作内容填写最多10000个字符且不能为空';
- jobInfoAlert.style.display = 'block';
- flag = true;
- }
- if (flag){
- return false;
- }
- let body = {
- 'related_id' : this.related_id,
- 'title' : this.title,
- 'related_type' : this.job_type,
- 'status' : this.statusValue,
- 'salary_from' : this.salary_from,
- 'salary_to' : this.salary_to,
- 'city' : this.city,
- 'month' : this.month,
- 'job_direction' : this.match_directions,
- 'job_skills' : this.match_skills,
- 'job_description' :this.job_description
- }
- const res = await this.$post("/api/admin/present_job/present_edit",body);
- if (res.status==1) {
- alert(res.info);
- location.href=this.jump_url+this.related_id;
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .el-row {
- margin-bottom: 20px;
- }
- .top{
- margin-top: 10px;
- }
- </style>
|