From 2c54297d9bfb7bc87464c52d5a46a5058ee96bf1 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 12 Jul 2021 20:19:07 +0800
Subject: [PATCH] 装备,枪支,车辆管理,其他细节

---
 src/views/trainingRegistration/data.js               |  236 +++++++++++++++++++++++
 src/router/views/index.js                            |   13 +
 src/views/car/data.js                                |    3 
 src/api/trainingRegistration/trainingRegistration.js |   39 +++
 src/views/dispatch/data.js                           |   31 ++
 src/views/car/index.vue                              |   14 
 src/views/gun/data.js                                |    3 
 src/views/gun/index.vue                              |   13 
 src/views/trainingRegistration/index.vue             |  222 ++++++++++++++++++++++
 src/views/equipments/data.js                         |    3 
 src/views/equipments/index.vue                       |   13 
 11 files changed, 561 insertions(+), 29 deletions(-)

diff --git a/src/api/trainingRegistration/trainingRegistration.js b/src/api/trainingRegistration/trainingRegistration.js
new file mode 100644
index 0000000..35687d2
--- /dev/null
+++ b/src/api/trainingRegistration/trainingRegistration.js
@@ -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,
+    }
+  })
+}
\ No newline at end of file
diff --git a/src/router/views/index.js b/src/router/views/index.js
index 7ba0925..63e6afc 100644
--- a/src/router/views/index.js
+++ b/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')
+    }]
 }]
\ No newline at end of file
diff --git a/src/views/car/data.js b/src/views/car/data.js
index 433fe9f..1968321 100644
--- a/src/views/car/data.js
+++ b/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"
diff --git a/src/views/car/index.vue b/src/views/car/index.vue
index 7e16f4f..6d57a48 100644
--- a/src/views/car/index.vue
+++ b/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);
diff --git a/src/views/dispatch/data.js b/src/views/dispatch/data.js
index 7e15ff4..79a39fe 100644
--- a/src/views/dispatch/data.js
+++ b/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: "详细地址",
diff --git a/src/views/equipments/data.js b/src/views/equipments/data.js
index bab1bb1..41e25bc 100644
--- a/src/views/equipments/data.js
+++ b/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"
diff --git a/src/views/equipments/index.vue b/src/views/equipments/index.vue
index 480e476..924cfa2 100644
--- a/src/views/equipments/index.vue
+++ b/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);
diff --git a/src/views/gun/data.js b/src/views/gun/data.js
index 8cf444b..838266a 100644
--- a/src/views/gun/data.js
+++ b/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"
diff --git a/src/views/gun/index.vue b/src/views/gun/index.vue
index b1fe848..f020f46 100644
--- a/src/views/gun/index.vue
+++ b/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);
diff --git a/src/views/trainingRegistration/data.js b/src/views/trainingRegistration/data.js
new file mode 100644
index 0000000..704c0fc
--- /dev/null
+++ b/src/views/trainingRegistration/data.js
@@ -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"
+        // }],
+    },
+]
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
new file mode 100644
index 0000000..3206f12
--- /dev/null
+++ b/src/views/trainingRegistration/index.vue
@@ -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>
\ No newline at end of file

--
Gitblit v1.9.3