保安服务企业管理-验收版本
liuyg
2021-09-09 81e8974f3544d7e58d528c2df973f7486809482c
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;
    },