保安监管系统-验收版本
shuishen
2021-12-04 48d34b0def9f848d1b7f9ddd2cd0861341fb208d
src/views/securityCompany/regulatoryInformation.vue
@@ -2,32 +2,72 @@
 * @Author: Morpheus
 * @Date: 2021-07-07 17:30:05
 * @Last Modified by: liu
 * @Last Modified time: 2021-09-15 19:56:58
 * @Last Modified time: 2021-12-04 16:45:40
 * menu-name 监管信息
 */
<template>
  <basic-container class="regulatoryInformation">
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      v-model="form"
      ref="crud"
      @row-update="rowUpdates"
      @row-save="rowSave"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
    </avue-crud>
  </basic-container>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
      <el-tab-pane label="保安公司日常检查" name="first">
        <company :see="true"></company>
      </el-tab-pane>
      <el-tab-pane label="保安公司处罚" name="second">
        <basic-container class="regulatoryInformation">
          <avue-crud
            :option="option"
            :table-loading="loading"
            :data="data"
            :page.sync="page"
            :permission="permissionList"
            v-model="form"
            ref="crud"
            @row-update="rowUpdates"
            @row-save="rowSave"
            @row-del="rowDel"
            @search-change="searchChange"
            @search-reset="searchReset"
            @selection-change="selectionChange"
            @current-change="currentChange"
            @size-change="sizeChange"
            @refresh-change="refreshChange"
            @on-load="onLoad"
          >
          </avue-crud>
        </basic-container>
      </el-tab-pane>
      <!-- <el-tab-pane label="保安公司荣誉" name="third">角色管理</el-tab-pane> -->
      <el-tab-pane label="保安员日常检查" name="fourth">
        <securityStaff :see="true"></securityStaff>
      </el-tab-pane>
      <el-tab-pane label="保安员处罚" name="fifth">
        <basic-container class="regulatoryInformation">
          <avue-crud
            :option="option1"
            :table-loading="loading1"
            :data="data1"
            :page.sync="page1"
            :permission="permissionList"
            v-model="form1"
            ref="crud1"
            @row-update="rowUpdates1"
            @row-save="rowSave1"
            @row-del="rowDel1"
            @search-change="searchChange1"
            @search-reset="searchReset1"
            @selection-change="selectionChange1"
            @current-change="currentChange1"
            @size-change="sizeChange1"
            @refresh-change="refreshChange1"
            @on-load="onLoad1"
          >
          </avue-crud>
        </basic-container>
      </el-tab-pane>
      <el-tab-pane label="保安员荣誉" name="sixth">
        <honor :see="true"></honor>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
@@ -40,7 +80,16 @@
} from "@/api/regulatoryInformation/regulatoryInformation";
import { mapGetters } from "vuex";
import company from "../onSiteInspection/company.vue";
import securityStaff from "../onSiteInspection/securityStaff.vue";
import honor from "../management/computents/honor.vue";
import { getListSecurity } from "@/api/system/user";
export default {
  components: {
    company,
    securityStaff,
    honor,
  },
  data() {
    var dic = [
      {
@@ -77,6 +126,7 @@
      },
    ];
    return {
      activeName: "first",
      form: {},
      query: {},
      loading: true,
@@ -94,9 +144,8 @@
        // selection: true,
        // menu: false,
        selection: true,
        align: "center",
        height: "auto",
        height: "560",
        calcHeight: 30,
        tip: false,
        searchShow: true,
@@ -184,43 +233,106 @@
            // display: false,
          },
        ],
        // group: [
        //   {
        //     label: "详细信息",
        //     prop: "baseInfo",
        //     icon: "el-icon-user-solid",
        //     column: [
        //       {
        //         label: "公司名称",
        //         prop: "enterprisename",
        //         display: false,
        //       },
        //     ],
        //   },
        //   {
        //     label: "详细信息",
        //     prop: "detailInfo",
        //     icon: "el-icon-s-order",
        //     column: [],
        //   },
        //   {
        //     label: "职责信息",
        //     prop: "dutyInfo",
        //     icon: "el-icon-s-custom",
        //     column: [],
        //   },
        // ],
      },
      data: [
        // {
        //   deptid: "江西众泰保安公司",
        //   punishtype: 2,
        //   punishreason: "非法施工",
        //   punishresult: "没收全部非法所得财产,并罚款3W元",
        //   punishtime: "2021-01-01",
        //   punisnum: 110110110120,
        // },
      ],
      data1: [],
      form1: {},
      query1: {},
      loading1: true,
      page1: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList1: [],
      option1: {
        // 操作栏多余按钮去除
        // delBtn: false,
        // editBtn: false,
        addBtn: false,
        // selection: true,
        // menu: false,
        selection: true,
        align: "center",
        height: "580",
        calcHeight: 30,
        tip: false,
        menu: false,
        searchShow: false,
        searchMenuSpan: 6,
        searchShowBtn: false,
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        column: [
          {
            label: "姓名",
            prop: "realName",
            search: true,
            searchSpan: 3,
            width: 60,
            searchLabelWidth: 50,
            display: false,
          },
          {
            label: "性别",
            prop: "sex",
            width: 55,
            slot: true,
            type: "select",
            dicData: [
              {
                label: "男",
                value: 1,
              },
              {
                label: "女",
                value: 2,
              },
              {
                label: "未知",
                value: 3,
              },
            ],
            display: false,
          },
          {
            label: "身份证号码",
            prop: "cardid",
            search: true,
            searchLabelWidth: 90,
            searchSpan: 4,
            minWidth: 140,
            display: false,
          },
          {
            label: "联系电话",
            prop: "phone",
            minWidth: 95,
            display: false,
          },
          {
            label: "处罚详情",
            prop: "holdv",
            minWidth: 95,
            overHidden: true,
          },
          {
            label: "处罚内容",
            prop: "holdvs",
            minWidth: 95,
            overHidden: true,
          },
          {
            label: "处罚时间",
            prop: "holdvtime",
            minWidth: 95,
            overHidden: true,
          },
        ],
      },
      data1: [],
    };
  },
  computed: {
@@ -242,6 +354,9 @@
    },
  },
  methods: {
    handleClick(tab, event) {
      // console.log(tab, event);
    },
    rowSave(row, done, loading) {
      adddata(row).then(
        () => {
@@ -342,6 +457,110 @@
      });
    },
    rowSave1(row, done, loading) {
      adddata(row).then(
        () => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowUpdates1(row, index, done, loading) {
      // console.log(42342);
      update(row).then(
        () => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel1(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    // beforeOpen(done, type) {
    //   if (["edit", "view"].includes(type)) {
    //     getDetail(this.form.id).then((res) => {
    //       this.form = res.data.data;
    //     });
    //   }
    //   done();
    // },
    searchReset1() {
      this.query1 = {};
      this.onLoad1(this.page1);
    },
    searchChange1(params, done) {
      this.query1 = params;
      this.page1.currentPage = 1;
      this.onLoad1(this.page1, params);
      done();
    },
    selectionChange1(list) {
      this.selectionList1 = list;
    },
    selectionClear1() {
      this.selectionList1 = [];
      this.$refs.crud1.toggleSelection();
    },
    currentChange1(currentPage) {
      this.page1.currentPage = currentPage;
    },
    sizeChange1(pageSize) {
      this.page1.pageSize = pageSize;
    },
    refreshChange1() {
      this.onLoad1(this.page1, this.query1);
    },
    onLoad1(page, params = {}) {
      // this.loading = false;
      this.loading1 = true;
      params["hold"] = "3";
      getListSecurity(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query1)
      ).then((res) => {
        const data = res.data.data;
        this.page1.total = data.total;
        this.data1 = data.records;
        for (let k in this.data1) {
          this.data1[k]["holdvs"] = "吊销其保安证";
        }
        this.loading1 = false;
        // this.selectionClear();
      });
    },
    // 行单击
    handleRowClick(row) {
      // delete (row["name"]);