Browse Source

新增兼职招聘页面

wayne 6 years ago
parent
commit
47f3822934
3 changed files with 284 additions and 0 deletions
  1. 9 0
      components/menu/data.js
  2. 108 0
      pages/main/index/job.vue
  3. 167 0
      pages/main/index/jobs.vue

+ 9 - 0
components/menu/data.js

@@ -105,6 +105,15 @@ export default [
 		path: '',
 		subs: [
 			{
+				title: '兼职招聘',
+				path: baseUrl + 'jobs'
+			},
+			{
+				title: '兼职招聘详情',
+				path: baseUrl + 'job',
+				hidden: true
+			},
+			{
 				title: '云端工作',
 				path: baseUrl + 'cloud_job'
 			},

+ 108 - 0
pages/main/index/job.vue

@@ -0,0 +1,108 @@
+<template>
+  <div>
+    <div class="header">
+      <div class="header-left">
+        <div class="title-wrapper">
+          <div class="title">{{recruitData.title}}</div>
+          <div class="status" :style="{color: recruitData.statusColor}">{{recruitData.statusName}}</div>
+        </div>
+        <div class="salary">薪酬范围:{{recruitData.salaryName}}</div>
+        <div class="skill">技能:
+          <span v-for="(item,index) in recruitData.skills" :key="index">
+            <span v-if="index>0">,</span><span>{{item.name}}</span>
+          </span>
+        </div>
+        <div class="experience">经验:3-5年</div>
+      </div>
+      <div class="hader-right">
+
+      </div>
+    </div>
+    <div class="description-wrapper">
+      <div class="description-title">工作描述</div>
+      <div class="description-content">{{recruitData.description}}</div>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        recruitId: '',
+        recruitData: ''
+      }
+    },
+    mounted() {
+      this.recruitId = this.$route.query.id
+      this.getRecruit()
+    },
+    methods: {
+      async getRecruit() {
+        const recruitId = this.recruitId
+        const data = {
+          recruitId
+        }
+        let res = await this.$post("/api/admin/recruit/getRecruit", data);
+        if (res && res.status === 1) {
+          this.recruitData = res.data
+          console.log(this.recruitData)
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+.header {
+  display: flex;
+}
+.title-wrapper {
+  display: flex;
+  align-items: center;
+}
+.title {
+  line-height: 27px;
+  font-weight: bold;
+  font-size: 18px;
+  color: #101010;
+}
+.status {
+  margin-left: 6px;
+  line-height: 20px;
+  font-size: 14px;
+}
+.salary {
+  margin-top: 13px;
+  line-height: 24px;
+  font-size: 16px;
+  color: #101010;
+}
+.skill {
+  margin-top: 8px;
+  line-height: 24px;
+  font-size: 16px;
+  color: #101010; 
+}
+.experience {
+  margin-top: 8px;
+  line-height: 24px;
+  font-size: 16px;
+  color: #101010; 
+}
+.description-wrapper {
+  margin-top: 22px;
+}
+.description-title {
+  line-height: 27px;
+  font-weight: bold;
+  font-size: 18px;
+  color: #101010;
+}
+.description-content {
+  margin-top: 16px;
+  line-height: 24px;
+  font-size: 16px;
+  color: #101010;
+}
+</style>

+ 167 - 0
pages/main/index/jobs.vue

@@ -0,0 +1,167 @@
+<template>
+  <div>
+    <div class="count-list" v-if="auditData">
+      <div class="count-item">全部:{{auditData.countAllStatus}}</div>
+      <div class="count-item">审核中:{{auditData.countWaitAudit}}</div>
+      <div class="count-item">开放中:{{auditData.countOpen}}</div>
+    </div>
+    <div class="content" v-if="auditData && auditData.list">
+      <el-table :data="auditData.list" @row-click="clickRow" height="100%" border style="width: 100%">
+        <el-table-column prop="occupationId" label="岗位ID"></el-table-column>
+        <el-table-column prop="occupationName" label="职位类型"></el-table-column>
+        <el-table-column prop="workTypeName" label="工作方式"></el-table-column>
+        <el-table-column label="工作周期">
+          <template slot-scope="scope">
+            <span>{{scope.row.month}}个月</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="cityName" label="驻场地区"></el-table-column>
+        <el-table-column prop="salaryName" label="薪酬范围"></el-table-column>
+        <el-table-column prop="statusName" label="岗位状态"></el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div v-if="scope.row.status==='2'">
+              <el-button type="primary" class="btn" @click="handleApproveClick(scope.row.id)">通过</el-button>
+              <el-button type="primary" class="btn" @click="handleRejectClick(scope.row.id)">不通过</el-button>
+            </div>
+            <div v-if="scope.row.status==='3'">
+              <el-button type="primary" class="btn" @click="handleRejectClick(scope.row.id)">不通过</el-button>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <el-pagination class="order-footer" background layout="prev, pager, next" :page-size="20" :total="Number(auditData.total)" @current-change="handleCurrentChange"/>
+    <el-dialog title="请输入审核不通过的原因" :visible.sync="isDialogShow">
+      <el-form :model="form">
+        <el-form-item label="">
+          <el-input v-model="form.reason"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="handleCancleClick()">取 消</el-button>
+        <el-button type="primary" @click="handleComfirmClick()">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      page: 1,
+      auditData: "",
+      form: {
+        reason: ''
+      },
+      isDialogShow: false
+    };
+  },
+  mounted() {
+    this.getAuditList();
+  },
+  methods: {
+    async getAuditList() {
+      const page = this.page;
+      const data = {
+        page
+      };
+      let res = await this.$post("/api/admin/recruit/getAuditList", data);
+      if (res && res.status === 1) {
+        this.auditData = res.data;
+        console.log(this.auditData);
+      }
+    },
+    async handleApproveClick(recruitId) {
+      const action = 'approve'
+      const data = {
+        recruitId,
+        action
+      };
+      let res = await this.$post("/api/admin/recruit/audit", data);
+      if (res && res.status === 1) {
+        console.log(res)
+        this.$message({
+          message: res.info,
+          type: 'success'
+        })
+        this.getAuditList()
+      }
+    },
+    async handleRejectClick(recruitId) {
+      this.recruitId = recruitId
+      this.isDialogShow = true
+    },
+    handleCancleClick() {
+      this.form = {
+        reason: ''
+      }
+      this.isDialogShow = false
+    },
+    async handleComfirmClick() {
+      const recruitId = this.recruitId
+      const action = 'reject'
+      const reason = this.form.reason
+      const data = {
+        recruitId,
+        action,
+        reason
+      };
+      let res = await this.$post("/api/admin/recruit/audit", data);
+      if (res && res.status === 1) {
+        console.log(res)
+        this.$message({
+          message: res.info,
+          type: 'success'
+        })
+        this.getAuditList()
+      }
+      this.form = {
+        reason: ''
+      }
+      this.isDialogShow = false
+    },
+    handleCurrentChange(val) {
+      this.page = val
+      this.getAuditList()
+    },
+    clickRow(row) {
+      const id = row.id
+      this.$router.push({ 
+        path: "/main/job", 
+        query: { 
+          id 
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.count-list {
+  padding-bottom: 10px;
+  display: flex;
+  align-items: center;
+}
+
+.count-item {
+  margin-right: 20px;
+  font-size: 16px;
+}
+
+.content {
+  white-space: nowrap;
+  overflow-x: scroll;
+  height: calc(100vh - 150px);
+}
+
+.btn {
+  width: 80px;
+}
+
+.order-footer {
+  margin-top: 10px;
+}
+</style>