From 81e8974f3544d7e58d528c2df973f7486809482c Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 09 Sep 2021 17:40:31 +0800
Subject: [PATCH] 保安员管理

---
 src/views/securityGuard/securityGuardDetail.vue |   16 +-
 src/views/securityGuard/securityGuard.vue       |  270 ++++++++++++++++++++++++++++++++++++++++++++
 src/api/performance/performance.js              |    8 
 src/views/securityGuard/data.js                 |   35 +++--
 4 files changed, 302 insertions(+), 27 deletions(-)

diff --git a/src/api/performance/performance.js b/src/api/performance/performance.js
index 8784ee9..761ee04 100644
--- a/src/api/performance/performance.js
+++ b/src/api/performance/performance.js
@@ -10,7 +10,7 @@
     })
 }
 
-export const page = (current, size, params) => {
+export const trackRecordpage = (current, size, params) => {
     return request({
         url: '/api/performance/page',
         method: 'get',
@@ -41,7 +41,7 @@
 //     })
 // }
 
-export const add = (row) => {
+export const trackRecordadd = (row) => {
     return request({
         url: '/api/performance/submit',
         method: 'post',
@@ -49,7 +49,7 @@
     })
 }
 
-export const update = (row) => {
+export const trackRecordupdate = (row) => {
     return request({
         url: '/api/performance/submit',
         method: 'post',
@@ -57,7 +57,7 @@
     })
 }
 
-export const remove = (ids) => {
+export const trackRecordremove = (ids) => {
     return request({
         url: '/api/performance/remove',
         method: 'post',
diff --git a/src/views/securityGuard/data.js b/src/views/securityGuard/data.js
index baeefd4..ae9ea83 100644
--- a/src/views/securityGuard/data.js
+++ b/src/views/securityGuard/data.js
@@ -335,6 +335,13 @@
     label: '岗位职责',
     prop: "responsibilities",
     formslot: true,
+
+}, {
+    label: '服务派遣单位',
+    prop: "serverDispatchUnit",
+    minWidth: 180,
+    overHidden: true,
+    formslot: true,
 }, {
     label: '入职时间',
     type: 'date',
@@ -407,15 +414,24 @@
     editDisplay: false,
     addDisplay: false
 }, {
-    label: '工作态度',
-    prop: "workingattitude",
+    label: '时间',
+    type: 'date',
+    format: "yyyy-MM-dd",
+    valueFormat: "yyyy-MM-dd",
+    prop: "time",
     formslot: true,
-}, {
-    label: '工作成效',
+},
+// {
+//     label: '工作态度',
+//     prop: "workingattitude",
+//     formslot: true,
+// }, 
+{
+    label: '工作表现',
     prop: "achievements",
     formslot: true,
 }, {
-    label: '表现',
+    label: '表现评定',
     prop: "score",
     type: "select",
     // dicUrl: "/api/blade-system/dict-biz/dictionary?code=scoreType",
@@ -447,14 +463,7 @@
         message: "请选择表现",
         trigger: "blur"
     }]
-}, {
-    label: '时间',
-    type: 'date',
-    format: "yyyy-MM-dd",
-    valueFormat: "yyyy-MM-dd",
-    prop: "time",
-    formslot: true,
-},
+}
     // {
     //     label: '服务公司',
     //     prop: "departmentName",
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 81ae69c..19bbc4c 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -142,6 +142,20 @@
               @click.stop="rowDellook(row)"
               >离职查询
             </el-button>
+            <el-button
+              icon="el-icon-edit"
+              :size="size"
+              :type="type"
+              @click.stop="trackRecord(row)"
+              >现实表现
+            </el-button>
+            <el-button
+              icon="el-icon-edit"
+              :size="size"
+              :type="type"
+              @click.stop="Experience(row)"
+              >从业记录
+            </el-button>
             <!-- <el-button
               icon="el-icon-edit"
               :size="size"
@@ -177,6 +191,40 @@
             <el-tag>{{ row.userTypeName }}</el-tag>
           </template>
         </avue-crud>
+        <el-dialog
+          title="从业记录"
+          append-to-body
+          :visible.sync="ExperienceVisible"
+          width="80%"
+        >
+          <avue-crud
+            :option="option1"
+            :data="data1"
+            :page.sync="page1"
+            :table-loading="loading1"
+            @row-save="rowSave1"
+            @row-update="rowUpdate1"
+            @row-del="rowDel1"
+          >
+          </avue-crud>
+        </el-dialog>
+        <el-dialog
+          title="现实表现"
+          append-to-body
+          :visible.sync="trackRecordVisible"
+        >
+          <avue-crud
+            :option="option2"
+            :data="data2"
+            :page.sync="page2"
+            @row-save="rowSave2"
+            @row-update="rowUpdate2"
+            @row-del="rowDel2"
+            :table-loading="loading2"
+          >
+          </avue-crud>
+        </el-dialog>
+
         <el-dialog
           title="用户角色配置"
           append-to-body
@@ -306,9 +354,28 @@
 import { mapGetters } from "vuex";
 import website from "@/config/website";
 import { getToken } from "@/util/auth";
-import { securityFormPageColumn } from "./data";
+import {
+  securityFormPageColumn,
+  trackRecordColumn,
+  practitionersColumn,
+} from "./data";
 import { mapState } from "vuex";
 
+import {
+  //现实表现
+  trackRecordadd,
+  trackRecordupdate,
+  trackRecordpage,
+  trackRecordremove,
+} from "@/api/performance/performance";
+import {
+  //从业记录
+  addExperience,
+  updateExperience,
+  getExperienceDetail,
+  experienceRemove,
+  getExperienceList,
+} from "@/api/experience/experience";
 export default {
   data() {
     const validatePass = (rule, value, callback) => {
@@ -328,6 +395,61 @@
       }
     };
     return {
+      //从业记录
+      securityid1: "",
+      ExperienceVisible: false,
+      loading1: true,
+      page1: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      query1: {},
+      data1: [],
+      option1: {
+        card: true,
+        menu: true,
+        height: 400,
+        widtd: "auto",
+        calcHeight: 54,
+        border: true, //liu
+        stripe: true,
+        tip: false,
+        index: true,
+        dialogClickModal: false,
+        headerAlign: "center",
+        align: "center",
+        column: practitionersColumn,
+      },
+      //现实表现
+      securityid2: "",
+      loading2: true,
+      page2: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      query2: {},
+      data1: [],
+      data2: [],
+      option2: {
+        card: true,
+        menu: true,
+        height: 400,
+        widtd: "auto",
+        calcHeight: 54,
+        border: true, //liu
+        stripe: true,
+        tip: false,
+        index: true,
+        dialogClickModal: false,
+        headerAlign: "center",
+        align: "center",
+        column: trackRecordColumn,
+      },
+      trackRecordData: [],
+      trackRecordVisible: false,
+
       securityid: "",
       excelBox1: false,
       excelBox2: false,
@@ -455,7 +577,7 @@
         align: "center",
         index: true,
         delBtnText: "注销",
-        menuWidth: 271,
+        menuWidth: 368,
         selection: true,
         viewBtn: true,
         defaultExpandAll: true,
@@ -923,6 +1045,150 @@
     this.search["status"] = 1;
   },
   methods: {
+    //从业记录↓
+    Experience(row) {
+      // console.log(row);
+      this.securityid1 = row.id;
+      this.getPractitionersPageInfo(this.page1);
+    },
+    getPractitionersPageInfo(page) {
+      var param = {
+        securityid: this.securityid1,
+      };
+      this.ExperienceVisible = true;
+      //获取用户从业信息
+      getExperienceList(page.currentPage, page.pageSize, param).then((res1) => {
+        const data = res1.data.data;
+        this.page1.total = data.total;
+        this.data1 = data.records;
+        this.loading1 = false;
+      });
+    },
+    rowSave1(form, done, loading) {
+      form.securityid = this.securityid1;
+      addExperience(form).then(
+        (res) => {
+          this.getPractitionersPageInfo(this.page1);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+      // }
+    },
+    rowUpdate1(row, index, done, loading) {
+      row.securityid = this.securityid1;
+      updateExperience(row).then(
+        () => {
+          this.getPractitionersPageInfo(this.page1);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel1(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return experienceRemove(row.id);
+        })
+        .then(() => {
+          this.getPractitionersPageInfo(this.page1);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    //从业记录↑
+    //现实表现↓
+    trackRecord(row) {
+      // console.log(row);
+      this.securityid2 = row.id;
+      this.getPerformancePageInfo(this.page2);
+    },
+    getPerformancePageInfo(page) {
+      var param = {
+        securityid: this.securityid2,
+      };
+      this.trackRecordVisible = true;
+      trackRecordpage(page.currentPage, page.pageSize, param).then((res2) => {
+        const data = res2.data.data;
+        this.page2.total = data.total;
+        this.data2 = data.records;
+        // console.log(this.data2, 1);
+        this.loading2 = false;
+      });
+    },
+    rowSave2(form, done, loading) {
+      form.securityid = this.securityid2;
+      trackRecordadd(form).then(
+        (res) => {
+          this.getPerformancePageInfo(this.page2);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+      // }
+    },
+    rowUpdate2(row, index, done, loading) {
+      row.securityid = this.securityid2;
+      trackRecordupdate(row).then(
+        () => {
+          this.getPerformancePageInfo(this.page2);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel2(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return trackRecordremove(row.id);
+        })
+        .then(() => {
+          this.getPerformancePageInfo(this.page2);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    //现实表现↑
     handleImport1() {
       this.excelBox1 = true;
     },
diff --git a/src/views/securityGuard/securityGuardDetail.vue b/src/views/securityGuard/securityGuardDetail.vue
index f4141d8..fca1bbd 100644
--- a/src/views/securityGuard/securityGuardDetail.vue
+++ b/src/views/securityGuard/securityGuardDetail.vue
@@ -103,10 +103,10 @@
 
 import {
   getPerformanceInfo,
-  add,
-  update,
-  page,
-  remove,
+  trackRecordadd,
+  trackRecordupdate,
+  trackRecordpage,
+  trackRecordremove,
   getER,
 } from "@/api/performance/performance";
 
@@ -286,7 +286,7 @@
       var param = {
         securityid: this.id,
       };
-      page(this.current, this.size, param).then((res2) => {
+      trackRecordpage(this.current, this.size, param).then((res2) => {
         const data = res2.data.data;
         this.page2.total = data.total;
         this.data2 = data.records;
@@ -297,7 +297,7 @@
 
     rowSave2(form, done, loading) {
       form.securityid = this.id;
-      add(form).then(
+      trackRecordadd(form).then(
         (res) => {
           this.getPerformancePageInfo(this.page2);
           this.$message({
@@ -334,7 +334,7 @@
     },
     rowUpdate2(row, index, done, loading) {
       row.securityid = this.id;
-      update(row).then(
+      trackRecordupdate(row).then(
         () => {
           this.getPerformancePageInfo(this.page2);
           this.$message({
@@ -373,7 +373,7 @@
         type: "warning",
       })
         .then(() => {
-          return remove(row.id);
+          return trackRecordremove(row.id);
         })
         .then(() => {
           this.getPerformancePageInfo(this.page2);

--
Gitblit v1.9.3