Administrator
2021-07-12 a8e637a994d19f5e960e5355e5f381359eb2f704
Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
8 files modified
3 files added
590 ■■■■■ changed files
src/api/trainingRegistration/trainingRegistration.js 39 ●●●●● patch | view | raw | blame | history
src/router/views/index.js 13 ●●●●● patch | view | raw | blame | history
src/views/car/data.js 3 ●●●● patch | view | raw | blame | history
src/views/car/index.vue 14 ●●●● patch | view | raw | blame | history
src/views/dispatch/data.js 31 ●●●● patch | view | raw | blame | history
src/views/equipments/data.js 3 ●●●● patch | view | raw | blame | history
src/views/equipments/index.vue 13 ●●●● patch | view | raw | blame | history
src/views/gun/data.js 3 ●●●● patch | view | raw | blame | history
src/views/gun/index.vue 13 ●●●● patch | view | raw | blame | history
src/views/trainingRegistration/data.js 236 ●●●●● patch | view | raw | blame | history
src/views/trainingRegistration/index.vue 222 ●●●●● patch | view | raw | blame | history
src/api/trainingRegistration/trainingRegistration.js
New file
@@ -0,0 +1,39 @@
import request from '@/router/axios';
export const getdata = (current, size, params) => {
  return request({
    url: '/api/recruitment/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const adddata = (row) => {
  return request({
    url: '/api/recruitment/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/recruitment/submit',
    method: 'post',
    data: row
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/recruitment/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
src/router/views/index.js
@@ -259,4 +259,17 @@
        component: () =>
            import ( /* webpackChunkName: "views" */ '@/views/gun/index')
    }]
}, {
    path: '/trainingRegistration',
    component: Layout,
    redirect: '/trainingRegistration/index',
    children: [{
        path: 'index',
        name: '保安培训报名管理',
        meta: {
            i18n: 'dict'
        },
        component: () =>
            import ( /* webpackChunkName: "views" */ '@/views/trainingRegistration/index')
    }]
}]
src/views/car/data.js
@@ -70,8 +70,9 @@
        // addDisplay: true,
        // editDisplay: true,
        // viewDisplay: true,
        overHidden: true,
        // searchSpan: 5,
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=0",
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
        props: {
             label: "title",
            value: "id"
src/views/car/index.vue
@@ -31,12 +31,7 @@
<script>
import { data, column } from "./data";
import {
  getdata,
  adddata,
  update,
  remove,
} from "@/api/car/car";
import { getdata, adddata, update, remove } from "@/api/car/car";
export default {
  data() {
@@ -85,10 +80,13 @@
      //   this.$message.success("页码" + val);
    },
    rowSave(form, done, loading) {
      var that = this;
      // var that = this;
      //   var form = this.data[0];
      //   delete form.id;
      //   for (var k = 0; k < 13; k++) {
      // console.log
      form["deptId"] = form.tenantName;
      delete form.tenantName;
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
@@ -117,6 +115,8 @@
    },
    rowUpdate(row, index, done, loading) {
      console.log(row);
       row["deptId"] = row.tenantName;
      delete row.tenantName;
      update(row).then(
        () => {
          this.onLoad(this.page);
src/views/dispatch/data.js
@@ -68,13 +68,34 @@
        // //     trigger: "blur"
        // // }],
    },
    // {
    //     label: "行政区",
    //     prop: "addresss",
    //     labelWidth: 110,
    //     search: true,
    //     // width: 110,
    //     // overHidden: true
    // },
    {
        label: "行政区",
        prop: "addresss",
        label: "所属行政区",
        prop: "jurisdiction",
        // multiple: true,
        labelWidth: 110,
        search: true,
        // width: 110,
        // overHidden: true
        type: "tree",
        dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
        props: {
            label: "title",
            value: "id",
        },
        checkStrictly: true,
        slot: true,
        rules: [
            {
                required: true,
                message: "请选择所属行政区",
                trigger: "click",
            },
        ],
    },
    {
        label: "详细地址",
src/views/equipments/data.js
@@ -65,11 +65,12 @@
            message: "请输入组织机构",
            trigger: "blur"
        }],
        overHidden: true,
        // addDisplay: true,
        // editDisplay: true,
        // viewDisplay: true,
        // searchSpan: 5,
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=0",
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
        props: {
            label: "title",
            value: "id"
src/views/equipments/index.vue
@@ -31,12 +31,7 @@
<script>
import { data, column } from "./data";
import {
  getdata,
  adddata,
  update,
  remove,
} from "@/api/equipments/equipments";
import { getdata, adddata, update, remove } from "@/api/equipments/equipments";
export default {
  data() {
@@ -89,6 +84,8 @@
      //   var form = this.data[0];
      //   delete form.id;
      //   for (var k = 0; k < 13; k++) {
      form["deptId"] = form.tenantName;
      delete form.tenantName;
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
@@ -116,7 +113,9 @@
      this.onLoad(this.page);
    },
    rowUpdate(row, index, done, loading) {
      console.log(row);
      // console.log(row);
      row["deptId"] = row.tenantName;
      delete row.tenantName;
      update(row).then(
        () => {
          this.onLoad(this.page);
src/views/gun/data.js
@@ -71,8 +71,9 @@
        // addDisplay: true,
        // editDisplay: true,
        // viewDisplay: true,
        overHidden: true,
        // searchSpan: 5,
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=0",
        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
        props: {
            label: "title",
            value: "id"
src/views/gun/index.vue
@@ -31,12 +31,7 @@
<script>
import { data, column } from "./data";
import {
  getdata,
  adddata,
  update,
  remove,
} from "@/api/gun/gun";
import { getdata, adddata, update, remove } from "@/api/gun/gun";
export default {
  data() {
@@ -89,6 +84,8 @@
      //   var form = this.data[0];
      //   delete form.id;
      //   for (var k = 0; k < 13; k++) {
      form["deptId"] = form.tenantName;
      delete form.tenantName;
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
@@ -116,7 +113,9 @@
      this.onLoad(this.page);
    },
    rowUpdate(row, index, done, loading) {
      console.log(row);
      // console.log(row);
      row["deptId"] = row.tenantName;
      delete row.tenantName;
      update(row).then(
        () => {
          this.onLoad(this.page);
src/views/trainingRegistration/data.js
New file
@@ -0,0 +1,236 @@
var DIC = [
    {
        label: '招聘中',
        value: 1,
    }, {
        label: '停止招聘',
        value: 2,
    }
]
var DIC1 = [
    {
        label: '拥有',
        value: 1,
    }, {
        label: '未拥有',
        value: 2,
    }
]
var w = 160
    , s = 12;
export var column = [
    {
        label: "id",
        prop: "id",
        hide: true,
        editDisplay: false,
        addDisplay: false
    },
    {
        label: "保安单位",
        prop: "tenantName",
        hide: true,
        editDisplay: false,
        addDisplay: false
    },
    {
        label: "保安id",
        prop: "deptId",
        hide: true,
        editDisplay: false,
        addDisplay: false,
        value: JSON.parse(window.localStorage.getItem("saber-userInfo")).content.dept_id
    },//上面不显示
    {
        label: "招聘岗位",
        prop: "name",
        // search: true,
    },
    {
        label: "招聘人数",
        prop: "number",
        width: 70,
        // search: true,
    },
    {
        label: "保安证",
        prop: "permit",
        // addDisplay: true,
        // editDisplay: true,
        // viewDisplay: true,
        filter: false,
        type: 'tree',
        dicData: DIC1,
        searchSpan: 5,
        // dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
        // props: {
        //     label: "dictValue",
        //     value: "dictKey"
        // },
        // search: true,
        // type: "select",
    },
    {
        label: "学历要求",
        prop: "education",
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        searchSpan: 5,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        search: true,
        type: "select",
        // rules: [{
        //     required: true,
        //     message: "请选择学历",
        //     trigger: "blur"
        // }],
    },
    {
        label: "工作经验",
        prop: "experience",
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        searchSpan: 5,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=experienceType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        search: true,
        type: "select",
        // rules: [{
        //     required: true,
        //     message: "请选择工作经验",
        //     trigger: "blur"
        // }],
    },
    {
        label: "工作任务",
        prop: "workDesc",
        // search: true,
        width: 110,
        overHidden: true
    },
    {
        label: "福利",
        prop: "welfare",
        // search: true,
        searchSpan: 4,
        overHidden: true
    },
    {
        label: "最低薪资",
        prop: "minSalary",
        width: 70,
        // search: true,
        searchSpan: 4,
    },
    {
        label: "最高薪资",
        prop: "maxSalary",
        width: 70,
        search: true,
        searchSpan: 4,
    },
    {
        label: "单位性质",
        prop: "unitsNature",
        width: 70,
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=unitsNatureType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        // search: true,
        type: "select",
        // rules: [{
        //     required: false,
        //     message: "请选择单位规模",
        //     trigger: "blur"
        // }],
    },
    {
        label: "单位规模",
        prop: "unitsScale",
        addDisplay: true,
        editDisplay: true,
        viewDisplay: true,
        searchSpan: 4,
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=unitsScaleType",
        props: {
            label: "dictValue",
            value: "dictKey"
        },
        // search: true,
        type: "select",
        // rules: [{
        //     required: true,
        //     message: "请选择单位规模",
        //     trigger: "blur"
        // }],
    },
    {
        label: "联系人",
        prop: "linkman",
        // search: true,
    },
    {
        label: "联系人电话",
        prop: "phone",
        // search: true,
        width: 110,
    },
    {
        label: "详细地址",
        prop: "address",
        width: 110,
        // search: true,
        overHidden: true
    },
    {
        label: "开始时间",
        prop: "startTime",
        // search: true,
        type: "date",
        format: "yyyy-MM-dd hh:mm:ss",
        valueFormat: "timestamp",
        width: 88,
    },
    {
        label: "结束时间",
        prop: "endTime",
        // search: true,
        type: "date",
        format: "yyyy-MM-dd hh:mm:ss",
        valueFormat: "timestamp",
        width: 88,
    },
    {
        label: "招聘状态",
        // prop: "status",
        // search: true,
        // searchSpan: 4,
        width: 70,
        prop: 'status',
        filter: false,
        type: 'tree',
        dicData: DIC,
        // rules: [{
        //     required: true,
        //     message: "请选择单位规模",
        //     trigger: "blur"
        // }],
    },
]
src/views/trainingRegistration/index.vue
New file
@@ -0,0 +1,222 @@
<template>
  <div class="recruitmentManagement">
    <avue-crud
      :option="option"
      :data="data"
      :page.sync="page"
      ref="crudrec"
      @on-load="onLoad"
      :table-loading="loading"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @row-update="rowUpdate"
      @row-del="rowDel"
      @selection-change="selectionChange"
      @refresh-change="refreshChange"
    >
      <template slot="menuLeft">
        <el-button
          type="danger"
          size="small"
          plain
          icon="el-icon-delete"
          @click="handleDelete"
          >删 除
        </el-button>
      </template>
    </avue-crud>
  </div>
</template>
<script>
import { data, column } from "./data";
import {
  getdata,
  adddata,
  update,
  remove,
} from "@/api/trainingRegistration/trainingRegistration";
export default {
  data() {
    return {
      loading: true,
      selectionList: [],
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      query: {},
      data: [],
      option: {
        // card: true,
        tip: false,
        searchSize: "mini",
        searchMenuSpan: 6,
        height: 627,
        menuWidth: 160,
        align: "center",
        selection: true,
        column: column,
      },
    };
  },
  computed: {
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    sizeChange(val) {
      this.page1.currentPage = 1;
      this.page1.pageSize = val;
      this.getData();
      //   this.$message.success("行数" + val);
    },
    currentChange(val) {
      this.page1.currentPage = val;
      this.getData();
      //   this.$message.success("页码" + val);
    },
    rowSave(form, done, loading) {
      var that = this;
      //   var form = this.data[0];
      //   delete form.id;
      //   for (var k = 0; k < 13; k++) {
      adddata(form).then(
        (res) => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
      //   }
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    rowUpdate(row, index, done, loading) {
      console.log(row);
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crudrec.toggleSelection();
        });
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getdata(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        // console.log(res);
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        console.log(this.data);
        this.loading = false;
      });
    },
  },
  mounted() {
    // this.Ourdata = data;
    // this.getData();
    // this.onLoad(this.page);
    // var dept_id = JSON.parse(
    //   window.localStorage.getItem("saber-userInfo")
    // ).content.dept_id;
  },
};
</script>
<style lang="scss">
.recruitmentManagement {
  width: 100%;
  height: 100%;
  //   border: 1px solid #000;
  box-sizing: border-box;
}
// .el-card__body {
//   padding-bottom: 5px !important;
// }
// .avue-crud__tip,
// .el-tag,
// .el-tag--light {
//   padding: 0 !important;
// }
</style>