From b23f8f280ba34d10de78b0bb79d5eb1ba346ebc5 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 12 Jul 2021 20:14:39 +0800
Subject: [PATCH] 现实表现记录

---
 src/views/securityGuard/securityGuardDetail.vue |   86 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 13 deletions(-)

diff --git a/src/views/securityGuard/securityGuardDetail.vue b/src/views/securityGuard/securityGuardDetail.vue
index a40bf80..e4501d0 100644
--- a/src/views/securityGuard/securityGuardDetail.vue
+++ b/src/views/securityGuard/securityGuardDetail.vue
@@ -20,6 +20,9 @@
         :option="option2"
         :data="data2"
         :page.sync="page2"
+        @row-save="rowSave2"
+        @row-update="rowUpdate2"
+        @row-del="rowDel2"
         :table-loading="loading2"
         @refresh-change="refreshChange2"
       >
@@ -31,6 +34,7 @@
 <script>
 import { securityBaseInfoColumn, practitionersColumn,trackRecordColumn } from "./data";
 import {getUserPractitionersInfo} from "@/api/system/user";
+import {add,update,page,remove,getPerformanceInfo} from "@/api/performance/performance";
 export default {
   data() {
     return {
@@ -54,6 +58,8 @@
           },
         ],
       },
+      current:1,
+      size:10,
       cardid: "", 
       name: "",
       dispatcherCompany: "",
@@ -101,9 +107,8 @@
         column: practitionersColumn,
       },
       option2: {
-        card: false,
-        menu:false,
-        addBtn:false,
+        card: true,
+        menu:true,
         height:'auto',
         widtd:"auto",
         calcHeight: 54,
@@ -138,7 +143,7 @@
           this.loading1 = false;
       } else if (column.prop == "tab3") {
           //查询当前保安员的现实表现记录
-          this.getPractitionersPageInfo();
+          this.getPerformancePageInfo();
           this.loading2 = false;
       }
     },
@@ -150,16 +155,71 @@
             that.data1 = res1.data.data;
         })
     },
-    currentChange1(val) {
-      this.page1.currentPage = val;
-      this.onLoad1(this.page1, this.query1);
+    //查询当前保安员的现实表现记录信息
+    getPerformancePageInfo(){
+        //获取现实表现信息
+        var param = {
+          cardid:this.cardid
+        }
+        page(this.current,this.size,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;
+        })
     },
-    //
-    onLoad1(page, params = {}) {
-      this.loading1 = true;
-      params["dispatcherUnitId"] = this.id;
-      console.log(params, "get");
-    }
+    rowSave2(form, done, loading) {
+      form.cardid = this.cardid;
+      add(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.cardid = this.cardid;
+      update(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 remove(row.id);
+        })
+        .then(() => {
+          this.getPerformancePageInfo(this.page2);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
   },
   mounted() {
     this.typeTABS = this.optionTABS.column[0];

--
Gitblit v1.9.3