| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <template>
- <div id="publish-present">
- <el-row>
- <el-col :span="24" align="center">
- <h2>驻场招聘信息表</h2>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="19">
- <h3>基本信息</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- 项目ID:
- <span>{{related_id}}</span>
- </el-col>
- <el-col :span="12">
- 需求方:
- <span>{{uid}}</span>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- 项目名称:
- <span>{{title}}</span>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- 项目类型:
- <span>{{related_type}}</span>
- <span style="display: none">{{job_type}}</span>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- 客户经理:
- <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 openStatus"
- :key="item.id"
- :label="item.label"
- :value="item.id"
- ></el-option>
- </el-select>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <h3>驻场信息</h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <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="error" style="display: none" show-icon></el-alert>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <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="24">
- <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="error" style="display: none" show-icon></el-alert>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div class="inlineb">
- <span class>工作年限:</span>
- <div class="inlineb">
- <el-input style="width: 230px;" v-model="work_year"></el-input>年
- </div>
- <el-alert title class="top" id="workYear" type="error" style="display: none" show-icon></el-alert>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <div class="inlineb">
- <span class>是否有文件:</span>
- <div class="inlineb">
- <el-select v-model="file">
- <el-option v-for="item of files" :key="item.id" :label="item.label" :value="item.id"></el-option>
- </el-select>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- 职位方向:
- <span>{{directions}}</span>
- <span style="display: none">{{match_directions}}</span>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- 技能要求:
- <span>{{skill}}</span>
- <span style="display: none">{{match_skills}}</span>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="20">
- 工作内容:
- <el-alert title class="top" id="jobInfoAlert" type="error" 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="24">
- <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: "",
- work_year: "",
- directions: "",
- match_skills: "",
- skill: "",
- job_description: "",
- match_directions: "",
- jump_url: "",
- citys: [
- {
- city: "0",
- label: "不限"
- },
- {
- city: "1",
- label: "北京"
- },
- {
- city: "2",
- label: "上海"
- },
- {
- city: "3",
- label: "广州"
- },
- {
- city: "4",
- label: "深圳"
- },
- {
- city: "5",
- label: "成都"
- },
- {
- city: "6",
- label: "杭州"
- }
- ],
- city: "0",
- openStatus: [
- {
- id: 0,
- label: "下架隐藏"
- },
- {
- id: 1,
- label: "开放中"
- },
- {
- id: 2,
- label: "停止申请"
- },
- {
- id: 3,
- label: "开发中"
- },
- {
- id: 4,
- label: "已结束"
- }
- ],
- statusValue: 0,
- files: [
- {
- id: "1",
- label: "是"
- },
- {
- id: "0",
- label: "否"
- }
- ],
- file: "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;
- this.jump_url =
- this.$store.state.domainConfig.siteUrl + "/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 ? res.data.job.month : "";
- this.work_year = res.data.job.work_year ? res.data.job.work_year : "";
- 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 ? res.data.job.status : 0;
- this.city = res.data.job.city ? res.data.job.city : "0";
- this.file = res.data.job.show_file ? res.data.job.show_file : "0";
- 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");
- let workYearAlert = document.getElementById("workYear");
- if (this.work_year.length == 0) {
- workYearAlert.innerText = "请输入工作年限";
- workYearAlert.style.display = "block";
- flag = true;
- }
- 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.work_year < 0 || this.work_year > 99) &&
- this.work_year.length != 0
- ) {
- workYearAlert.innerText = "工作年限正确填写范围0-99";
- workYearAlert.style.display = "block";
- flag = true;
- }
- this.salary_from = parseInt(this.salary_from);
- this.salary_to = parseInt(this.salary_to);
- 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,
- show_file: this.file,
- month: this.month,
- work_year: this.work_year,
- 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>
|