LiuJ 1 săptămână în urmă
părinte
comite
7fd7fcb9e7

+ 17 - 0
src/router/index.js

@@ -482,6 +482,23 @@ export const constantRoutes = [
           }
         ]
       },
+      {
+        path: '/jobHuntingListApply',
+        component: Layout,
+        children: [
+          {
+            name: '',
+            path: '',
+            component: () => import('@/views/news/jobHuntingListApply'),
+            meta: {
+              title: '求职信息',
+              hidden: true,
+              breadcrumb: true
+            }
+          }
+        ]
+      },
+
       {
         path: '/addJobHunting',
         component: Layout,

+ 17 - 4
src/views/news/addJobHunting.vue

@@ -489,7 +489,7 @@ export default {
         cat_arr_id: [{ required: true, trigger: 'blur', validator: validateArray }],
       },
       //1.3富文本编辑器配置
-      
+
       //1.4图片上传
       //获取父级导航池
       parentKey: 0,//获取父级导航
@@ -729,7 +729,6 @@ export default {
           formCopy.website_id = formCopy.web_site_id == 0 ? this.websiteid : formCopy.web_site_id;
           // 去掉 formCopy.web_site_id
           delete formCopy.web_site_id;
-
           if (formCopy.website_id == 0) {
             this.$message.error('请选择站点名称');
             return;
@@ -750,7 +749,14 @@ export default {
             item = formatLocalDate(item);
           });
           console.log(new Date().getTime(), '-------------------校验结束------------------');
-
+          //判断用户身份
+          if (this.creatNews_user_type == 10000) {
+            console.log("用户身份为管理员,无需审核直接发布!")
+            this.form.status = 2;
+          } else {
+            console.log("用户身份为其他用户,提交到审核!")
+            this.form.status = 1;
+          }
           this.$store.dispatch('news/addJobHunting', formCopy).then(res => {
             if (res.code == 200) {
               //汇报结果
@@ -928,7 +934,14 @@ export default {
             item = formatLocalDate(item);
           });
           console.log(new Date().getTime(), '-------------------校验结束------------------');
-
+          //判断用户身份
+          if (this.creatNews_user_type == 10000) {
+            console.log("用户身份为管理员,无需审核直接发布!")
+            this.form.status = 2;
+          } else {
+            console.log("用户身份为其他用户,提交到审核!")
+            this.form.status = 1;
+          }
           this.$store.dispatch('news/updateJobHunting', formCopy).then(res => {
             //记录结束时间
             let endTime = new Date().getTime(); //计算时间差

+ 8 - 0
src/views/news/jobHuntingList.vue

@@ -35,6 +35,13 @@
             <el-table-column prop="username" label="标题名称" width=""></el-table-column>
             <el-table-column prop="category_name" label="分类" width=""></el-table-column>
             <el-table-column prop="website_name" label="网站名称" width=""></el-table-column>
+            <el-table-column prop="status" label="审核状态" width="">
+              <template slot-scope="scope">
+                <div v-if="scope.row.status == 1">待审核</div>
+                <div v-if="scope.row.status == 2">已审核</div>
+                <div v-if="scope.row.status == 3">已拒绝</div>
+              </template>
+            </el-table-column>
             <el-table-column prop="updated_at" label="更新时间" width=""></el-table-column>
 
             <el-table-column fixed="right" label="操作" width="200" header-align="center">
@@ -87,6 +94,7 @@ export default {
         category_name: "",//导航池id
         website_name: "",//网站名称
         type_id: "",//发布类型
+        status: 2,//状态
 
         page: 1,//当前是第几页
         page_size: 10,//一共多少条

+ 294 - 0
src/views/news/jobHuntingListApply.vue

@@ -0,0 +1,294 @@
+<template>
+  <div class="mainBox">
+    <!--搜索功能 start------------------------------------------------------------>
+    <div class="layerBox_search">
+      <div class="layerBoxLine">
+        <el-row>
+          <el-col :span="8">
+            <div class="searchBox">
+              <div class="searchTitle">标签名称</div>
+              <el-input placeholder="请输入标签名称" autocomplete="off" v-model="getApiData.username" />
+            </div>
+          </el-col>
+
+        </el-row>
+      </div>
+    </div>
+    <div class="layerBoxNoBg">
+      <div>
+        <el-button type="primary" @click="goCreat">发布求职信息</el-button>
+      </div>
+      <div>
+        <el-button @click="clearSearchList">重置</el-button>
+        <el-button type="primary" @click="getData('search')">搜索</el-button>
+      </div>
+    </div>
+    <!--搜索功能 end------------------------------------------------------------>
+
+    <!--表格内容 start------------------------------------------------------------>
+    <div class="layerBox">
+      <tableTitle :name="tableDivTitle" />
+      <el-row>
+        <template>
+          <el-table :data="tableData" style="width: 100%">
+            <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
+            <el-table-column prop="username" label="标题名称" width=""></el-table-column>
+            <el-table-column prop="category_name" label="分类" width=""></el-table-column>
+            <el-table-column prop="website_name" label="网站名称" width=""></el-table-column>
+            <el-table-column prop="status" label="审核状态" width="">
+              <template slot-scope="scope">
+                <div v-if="scope.row.status == 1">待审核</div>
+                <div v-if="scope.row.status == 2">已审核</div>
+                <div v-if="scope.row.status == 3">已拒绝</div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="updated_at" label="更新时间" width=""></el-table-column>
+
+            <el-table-column fixed="right" label="操作" width="300" header-align="center">
+              <template slot-scope="scope">
+                <div class="listBtnBox">
+                  <div class="listMainBtn" @click="getUpRow(scope.row.id, tableData)"><i class="el-icon-check"></i>审核
+                  </div>
+                  <div class="listDeleteBtn" @click="deleteRow(scope.row.id, tableData)"><i
+                      class="el-icon-delete"></i>删除</div>
+                  <div class="listEditBtn" @click="goEdit(scope.row.id, tableData)"><i
+                      class="el-icon-edit-outline"></i>编辑</div>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+        </template>
+      </el-row>
+    </div>
+    <!--分页 start------------------------------------------------------------>
+    <!--弹出框1:外部表单弹出框 start------------------------------------------------------------>
+    <el-dialog title="请输入驳回理由" :visible.sync="examineWindow" :close-on-click-modal="false">
+      <el-form :model="form" ref="form" :rules="formRules" label-position="left">
+        <div class="formDiv">
+          <el-form-item label="驳回原因:" :label-width="formLabelWidth" prop="reason" class="custom-align-right">
+            <el-input type="textarea" v-model="form.reason" class="custom-textarea" placeholder="请输入驳回原因"
+              :rows="3"></el-input>
+          </el-form-item>
+        </div>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <div>
+          <el-button type="info" @click="examineWindow = false">取消</el-button>
+          <el-button type="primary" @click="examineToServe">确定</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!--弹出框1:外部表单弹出框 end------------------------------------------------------------>
+    <div class="alignBox">
+      <el-row>
+        <el-col :span="24">
+          <el-pagination @size-change="handleSizeChange" :current-page="getApiData.page"
+            @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper"
+            :total="allCount"></el-pagination>
+        </el-col>
+      </el-row>
+    </div>
+    <!--分页 end------------------------------------------------------------>
+    <!--表格内容 end------------------------------------------------------------>
+  </div>
+</template>
+
+<script>
+//表格标题
+import tableTitle from './components/tableTitle';
+//引入公用样式
+import '@/styles/global.less';
+
+export default {
+  components: {
+    tableTitle,//表格标题
+  },
+  data() {
+    return {
+      //1.列表和分页相关 start ------------------------------------------------------------>
+      tableDivTitle: "求职信息列表",
+      tableData: [],//内容
+      editId: 0,//要修改的网站id
+      examineWindow: false,//审核窗口
+      //提交驳回
+      form: {
+        reason: ""
+      },
+      getApiData: {
+        name: "",//标题
+        category_name: "",//导航池id
+        website_name: "",//网站名称
+        type_id: "",//发布类型
+        status1: 1,//审核状态 1待审核 2已审核 3已拒绝
+        page: 1,//当前是第几页
+        page_size: 10,//一共多少条
+      },
+      allCount: 0,//总条数
+      //分页相关 end ------------------------------------------------------------>
+    }
+  },
+  methods: {
+    //提交驳回内容
+    examineToServe(id) {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          let data = {
+            id: this.editId,
+            status: 3,//驳回status
+            reason: this.form.reason
+          }
+          this.$store.dispatch('news/updateJobHuntingStatus', data).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                type: 'success',
+                message: '操作成功!'
+              });
+              this.getData();
+              this.form.reason = "";//清空上一次的输入
+              this.examineWindow = false;
+            }
+          })
+        } else {
+          this.$message.error("驳回理由不能为空!")
+        }
+      })
+    },
+    getUpRow(id) {
+      //设置待审核的id
+      this.editId = id;
+      console.log(id)
+      this.$confirm('将此商品通过审核吗?', '提示', {
+        confirmButtonText: '通过',
+        cancelButtonText: '拒绝',
+        type: 'warning'
+      }).then(() => {
+        this.upRow(id, 2)
+      }).catch(() => {
+        //输入驳回理由
+        console.log("驳回")
+        this.examineWindow = true;
+      })
+    },
+    upRow(id, status) {
+      let data = {
+        id: id,
+        status: status
+      }
+      this.$store.dispatch('news/updateJobHuntingStatus', data).then(res => {
+        if (res.code == 200) {
+          this.$message({
+            type: 'success',
+            message: '商品状态已修改!'
+          });
+          this.getData();
+        }
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '已取消删除'
+        });
+      });
+    },
+    //1.列表和分页相关 start ------------------------------------------------------------>
+    //1.1 开始请求列表信息方法
+    getData(type) {
+      if (type == "search") {
+        this.getApiData.page = 1;
+      }
+      console.log(this.getApiData, '--1-1--')
+      this.$store.dispatch('news/getJobHuntingList', this.getApiData).then(res => {
+        //格式化:islink=0为不使用外面 islink=1为使用外链
+        //status=1为显示 status=2为不显示
+        console.log(res.data, '-111--2-')
+        let data = [];
+        for (let item of res.data.rows) {
+          item.username = item.username + '简历'
+          item.category_name = '求职信息'
+
+          data.push(item)
+        }
+        this.tableData = res.data.rows; //给与内容
+        this.allCount = res.data.count; //给与总条数
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '网络错误,请重试!'
+        });
+      })
+    },
+    //1.2 删除内容
+    deleteRow(id) {
+      this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log("当前删除:" + id)
+        this.$store.dispatch('news/delJobHunting', { id: id }).then(res => {
+          this.getData();
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'warning',
+            message: '网络错误,请重试!'
+          });
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'warning',
+          message: '已取消删除'
+        });
+      });
+    },
+
+    //1.4 列表内容分页
+    //直接跳转
+    handleSizeChange(val) {
+      this.getApiData.page = val;
+      this.getData();
+    },
+    //1.5 点击分页
+    handleCurrentChange(val) {
+      this.getApiData.page = val;
+      this.getData();
+    },
+    //1.6 重置按钮
+    clearSearchList() {
+      this.tableData = [];
+      this.getApiData.username = "";
+
+      this.getApiData.page = 1;
+      this.getApiData.pageSize = 10;
+      this.getData();
+    },
+    //列表和分页相关 end ------------------------------------------------------------>
+
+    //2.添加求职信息start ------------------------------------------------------------>
+    //跳转到求职信息发布页面
+    goCreat() {
+      this.$router.push({
+        path: '/addJobHunting',
+      });
+    },
+    goEdit(id) {
+      let data = {
+        id: id
+      }
+      this.$router.push({
+        path: '/addJobHunting',
+        query: data
+      });
+    }
+    //添加求职信息end ------------------------------------------------------------>
+  },
+  mounted() {
+    //1.获得初始数据
+    this.getData();
+  }
+}
+</script>
+
+<style scoped lang="less"></style>