liuyg
2021-08-27 5945431ebd096385f8326212d19e95f2521ee87a
许可备案
1 files modified
14 files added
4 files deleted
5956 ■■■■■ changed files
public/img/permit/服务许可背景图.png patch | view | raw | blame | history
src/api/licenseApproval/permit.js 50 ●●●●● patch | view | raw | blame | history
src/api/licenseApproval/record.js 50 ●●●●● patch | view | raw | blame | history
src/api/licenseApproval/recordk.js 50 ●●●●● patch | view | raw | blame | history
src/api/licenseApproval/revoke.js 50 ●●●●● patch | view | raw | blame | history
src/api/resource/attachOnce.js 53 ●●●●● patch | view | raw | blame | history
src/router/views/index.js 15 ●●●●● patch | view | raw | blame | history
src/static/img/permit/服务许可背景图.png patch | view | raw | blame | history
src/views/approvalOflicenseFiling/permit.vue 10 ●●●●● patch | view | raw | blame | history
src/views/approvalOflicenseFiling/record.vue 10 ●●●●● patch | view | raw | blame | history
src/views/approvalOflicenseFiling/recordk.vue 10 ●●●●● patch | view | raw | blame | history
src/views/approvalOflicenseFiling/revoke.vue 10 ●●●●● patch | view | raw | blame | history
src/views/licenseApproval/branchOffice.vue 849 ●●●●● patch | view | raw | blame | history
src/views/licenseApproval/cancellationOfFiling.vue 888 ●●●●● patch | view | raw | blame | history
src/views/licenseApproval/crossRegion.vue 888 ●●●●● patch | view | raw | blame | history
src/views/licenseApproval/securityGuard.vue 828 ●●●●● patch | view | raw | blame | history
src/views/licenseApproval/securityPermit.vue 889 ●●●●● patch | view | raw | blame | history
src/views/licenseApproval/securityTraining.vue 888 ●●●●● patch | view | raw | blame | history
src/views/resource/attachOnce.vue 418 ●●●●● patch | view | raw | blame | history
public/img/permit/服务许可背景图.png
src/api/licenseApproval/permit.js
New file
@@ -0,0 +1,50 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
  return request({
    url: '/api/permit/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/permit/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/permit/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/permit/save',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/permit/update',
    method: 'post',
    data: row
  })
}
src/api/licenseApproval/record.js
New file
@@ -0,0 +1,50 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
  return request({
    url: '/api/record/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/record/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/record/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/record/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/record/update',
    method: 'post',
    data: row
  })
}
src/api/licenseApproval/recordk.js
New file
@@ -0,0 +1,50 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
  return request({
    url: '/api/recordk/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/recordk/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/recordk/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/recordk/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/recordk/submit',
    method: 'post',
    data: row
  })
}
src/api/licenseApproval/revoke.js
New file
@@ -0,0 +1,50 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
  return request({
    url: '/api/revoke/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/revoke/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/revoke/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/revoke/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/revoke/submit',
    method: 'post',
    data: row
  })
}
src/api/resource/attachOnce.js
New file
@@ -0,0 +1,53 @@
import request from '@/router/axios';
export const getList = (current, size, params, deptid, type) => {
  return request({
    url: '/api/blade-resource/attach/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      deptid,
      type,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/blade-resource/attach/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/blade-resource/attach/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/blade-resource/attach/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/blade-resource/attach/submit',
    method: 'post',
    data: row
  })
}
src/router/views/index.js
@@ -908,5 +908,18 @@
        component: () =>
            import( /* webpackChunkName: "views" */ '@/views/resource/uploadPolicyRelease')
    }]
}
}, {
    path: '/attachOnce',
    redirect: '/resource/attachOnce',
    component: Layout,
    children: [{
        path: 'index',
        name: '附件查看',
        meta: {
            i18n: 'index',
        },
        component: () =>
            import( /* webpackChunkName: "views" */ '@/views/resource/attachOnce')
    }]
},
]
src/static/img/permit/服务许可背景图.png
src/views/approvalOflicenseFiling/permit.vue
File was deleted
src/views/approvalOflicenseFiling/record.vue
File was deleted
src/views/approvalOflicenseFiling/recordk.vue
File was deleted
src/views/approvalOflicenseFiling/revoke.vue
File was deleted
src/views/licenseApproval/branchOffice.vue
New file
@@ -0,0 +1,849 @@
/*
 * @Author: liu
 * @Date: 2021-08-26 17:00:55
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-08-27 08:53:38
 */
<template>
  <div>
    <basic-container class="permit">
      <avue-crud
        :option="option"
        :table-loading="loading"
        :data="data"
        :page.sync="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crud"
        @row-update="rowUpdate"
        @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"
        :row-style="rowStyle"
      >
        <template slot="menuLeft">
          <el-button
            type="danger"
            size="small"
            icon="el-icon-delete"
            plain
            v-if="permission.permit_delete"
            @click="handleDelete"
            >删 除
          </el-button>
        </template>
        <template slot-scope="{ type, size, row }" slot="menu">
          <el-button
            icon="icon-zhengjian"
            :size="size"
            :type="type"
            class="zhengJian-icon"
            @click.stop="handleCredentials(row)"
            >附件审查</el-button
          >
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            v-if="row.type == '2'"
            @click.stop="rowDel(row)"
            >备案审批
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            v-show="row.type == 0"
            @click.stop="rowPrint(row)"
            >回执打印
          </el-button>
        </template>
        <template class="tdtype" slot-scope="{ row }" slot="type">
          <el-tag class="dtype">
            {{
              row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审批"
            }}
            <i class="gz" v-if="row.type == '0'"></i>
            <i class="yj" v-if="row.type == '1'"></i>
            <i class="zc" v-if="row.type == '2'"></i>
          </el-tag>
        </template>
      </avue-crud>
    </basic-container>
    <div
      v-if="dialogVisible"
      class="dialogVisibles"
      :class="classStyle == 'print' ? 'printstyle' : ''"
    >
      <div
        id="licence_box"
        :class="classStyle == 'print' ? 'printstyle' : ''"
        ref="licence"
      >
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
        <span slot="footer" class="dialog-footer no-print PrintBut">
          <el-button type="primary" @click="Print">打 印</el-button>
          <el-button type="primary" @click="closePrint"> 取 消 </el-button>
        </span>
      </div>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <div class="flots">
        <span class="f_title">是否通过审批?</span>
        <span class="f_body">请输入修改意见:</span>
        <textarea
          name="reworkmes"
          cols="40"
          rows="4"
          style="overflow: hidden"
          v-model="textareaShenpi"
        ></textarea>
        <div class="but">
          <el-button @click="closecc">通过</el-button>
          <el-button type="primary" @click="subcc">不通过</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/licenseApproval/record";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      classStyle: "print", //打印样式
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
        chiden: {},
      },
      textareaShenpi: "",
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        excelBtn: true,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        border: true,
        menuWidth: 300,
        labelWidth: 130,
        headerAlign: "center",
        align: "center",
        // border: false,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            searchLabelWidth: 80,
            searchSpan: 4,
            overHidden: true,
            width: 250,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            width: 82,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人电话",
            width: 106,
            prop: "representativecell",
            rules: [
              {
                required: true,
                message: "请输入法定代表人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人",
            prop: "contacts",
            width: 58,
            rules: [
              {
                required: true,
                message: "请输入联系人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人电话",
            width: 96,
            prop: "contactscell",
            rules: [
              {
                required: true,
                message: "请输入联系人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册时间",
            hide: true,
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            addDisplay: false,
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "许可类型",
            search: true,
            hide: true,
            prop: "ptype",
            type: "select",
            searchSpan: 4,
            dicData: [
              {
                label: "保安服务许可",
                value: "0",
              },
              {
                label: "保安培训许可",
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            width: 132,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, true),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
  methods: {
    Print() {
      this.$Print(this.$refs.licence);
    },
    handleCredentials(row) {
      // console.log(row, "21354");
      this.$router.push({
        path: "/attachOnce/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.cardid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      console.log(this.xukezData);
      update(this.xukezData);
      this.textareaShenpi = "";
      this.$message({
        type: "success",
        message: "审核通过!",
      });
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      update(this.xukezData);
      this.textareaShenpi = "";
      this.$message({
        type: "success",
        message: "审核不通过!",
      });
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;
      this.licenceData.chiden = {};
      this.licenceData.chiden["名称"] = row.enterprisename;
      this.licenceData.chiden["住所"] = row.address;
      this.licenceData.chiden["法定代表人"] = row.representative;
      this.licenceData.chiden["服务范围"] = row.industry;
      this.licenceData.chiden["注册资本"] = row.registeredcapital;
      this.licenceData.chiden["批准文号"] = row.registrationnumber;
      console.log(this.licenceData);
      this.dialogVisible = true;
    },
    closePrint() {
      this.dialogVisible = false;
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["ptype"] = 2;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    },
  },
};
</script>
<style scoped lang="scss">
.dtype {
  width: 80px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
#licence_box {
  position: relative;
  top: 15px;
  width: 1080px;
  height: 780px;
  background-color: #004ca7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.licence {
  width: 960px;
  height: 648px;
  background-color: #fff !important;
  background-image: url("../../static/img/permit/服务许可背景图.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 10%;
  color: #000;
}
.licence-head {
  width: 100%;
  height: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
}
.head-tid {
  position: relative;
  left: 70%;
}
.head-tid span {
  margin: 0 1rem;
}
.licence-main {
  width: 80%;
}
.l-m-once {
  width: 100%;
  height: 2rem;
  margin-top: 1rem;
}
.l-m-o-title {
  font-size: 1.3rem;
  width: 22%;
  text-align: justify;
  display: inline-block;
}
.l-m-r-once {
  font-size: 1.1rem;
  /* border: 1px solid #000; */
  display: inline-block;
  width: 77%;
}
.licence-bottom,
.l-bottom {
  position: relative;
  left: 60%;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}
.dialogVisibles {
  position: fixed;
  top: 0;
  left: -10%;
  height: 0;
  width: 120%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printstyle {
  background-color: #fff !important;
}
.PrintBut {
  margin-top: 15px;
}
.flots {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  span {
    display: inline-block;
  }
  .f_title {
    position: absolute;
    top: 15px;
    font-size: 18px;
  }
}
.but {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>
src/views/licenseApproval/cancellationOfFiling.vue
New file
@@ -0,0 +1,888 @@
/*
 * @Author: liu
 * @Date: 2021-08-26 17:00:04
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-08-26 20:11:41
 */
<template>
  <div>
    <basic-container class="permit">
      <avue-crud
        :option="option"
        :table-loading="loading"
        :data="data"
        :page.sync="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crud"
        @row-update="rowUpdate"
        @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"
        :row-style="rowStyle"
      >
        <template slot="menuLeft">
          <el-button
            type="danger"
            size="small"
            icon="el-icon-delete"
            plain
            v-if="permission.permit_delete"
            @click="handleDelete"
            >删 除
          </el-button>
        </template>
        <template slot-scope="{ type, size, row }" slot="menu">
          <el-button
            icon="icon-zhengjian"
            :size="size"
            :type="type"
            class="zhengJian-icon"
            @click.stop="handleCredentials(row)"
            >附件查阅
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="rowDel(row)"
            v-if="row.type == '2'"
            >许可审批
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="viewLicense(row)"
            v-if="row.type == '0'"
            >打印许可证
          </el-button>
        </template>
        <template class="tdtype" slot-scope="{ row }" slot="type">
          <el-tag class="dtype">
            {{
              row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核"
            }}
            <i class="gz" v-if="row.type == '0'"></i>
            <i class="yj" v-if="row.type == '1'"></i>
            <i class="zc" v-if="row.type == '2'"></i>
          </el-tag>
        </template>
      </avue-crud>
    </basic-container>
    <!-- <el-dialog
      :visible.sync="dialogVisible"
      :before-close="handleClose"
      :modal-append-to-body="false"
      width="1005px"
      top="10vh"
      class="printstyle"
    >
      <div id="licence_box">
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="Print">打 印</el-button>
      </span>
    </el-dialog> -->
    <div
      v-if="dialogVisible"
      class="dialogVisibles"
      :class="classStyle == 'print' ? 'printstyle' : ''"
    >
      <div
        id="licence_box"
        :class="classStyle == 'print' ? 'printstyle' : ''"
        ref="licence"
      >
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
        <span slot="footer" class="dialog-footer no-print PrintBut">
          <el-button type="primary" @click="Print">打 印</el-button>
          <el-button type="primary" @click="closePrint"> 取 消 </el-button>
        </span>
      </div>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <div class="flots">
        <span class="f_title">是否通过审核?</span>
        <span class="f_body">请输入修改意见:</span>
        <textarea
          name="reworkmes"
          cols="40"
          rows="4"
          style="overflow: hidden"
          v-model="textareaShenpi"
        ></textarea>
        <div class="but">
          <el-button @click="closecc">通过</el-button>
          <el-button type="primary" @click="subcc">不通过</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/licenseApproval/revoke";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      classStyle: "print", //打印样式
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
        chiden: {},
      },
      textareaShenpi: "",
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        excelBtn: true,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        border: true,
        menuWidth: 300,
        labelWidth: 130,
        headerAlign: "center",
        align: "center",
        // border: false,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            searchLabelWidth: 80,
            searchSpan: 4,
            overHidden: true,
            width: 250,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            width: 82,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人电话",
            width: 106,
            prop: "representativecell",
            rules: [
              {
                required: true,
                message: "请输入法定代表人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人",
            prop: "contacts",
            width: 58,
            rules: [
              {
                required: true,
                message: "请输入联系人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人电话",
            width: 96,
            prop: "contactscell",
            rules: [
              {
                required: true,
                message: "请输入联系人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册时间",
            hide: true,
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            addDisplay: false,
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "许可类型",
            search: true,
            hide: true,
            prop: "ptype",
            type: "select",
            searchSpan: 4,
            dicData: [
              {
                label: "保安服务许可",
                value: "0",
              },
              {
                label: "保安培训许可",
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            width: 132,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, true),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
  methods: {
    Print() {
      this.$Print(this.$refs.licence);
    },
    handleCredentials(row) {
      this.$router.push({
        path: "/attachOnce/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.cardid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      console.log(this.xukezData);
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;
      this.licenceData.chiden = {};
      this.licenceData.chiden["名称"] = row.enterprisename;
      this.licenceData.chiden["住所"] = row.address;
      this.licenceData.chiden["法定代表人"] = row.representative;
      this.licenceData.chiden["服务范围"] = row.industry;
      this.licenceData.chiden["注册资本"] = row.registeredcapital;
      this.licenceData.chiden["批准文号"] = row.registrationnumber;
      console.log(this.licenceData);
      this.dialogVisible = true;
    },
    closePrint() {
      this.dialogVisible = false;
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["ptype"] = 4;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    },
  },
};
</script>
<style scoped lang="scss">
.dtype {
  width: 80px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
#licence_box {
  position: relative;
  top: 15px;
  width: 1080px;
  height: 780px;
  background-color: #004ca7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.licence {
  width: 960px;
  height: 648px;
  background-color: #fff !important;
  background-image: url("../../static/img/permit/服务许可背景图.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 10%;
  color: #000;
}
.licence-head {
  width: 100%;
  height: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
}
.head-tid {
  position: relative;
  left: 70%;
}
.head-tid span {
  margin: 0 1rem;
}
.licence-main {
  width: 80%;
}
.l-m-once {
  width: 100%;
  height: 2rem;
  margin-top: 1rem;
}
.l-m-o-title {
  font-size: 1.3rem;
  width: 22%;
  text-align: justify;
  display: inline-block;
}
.l-m-r-once {
  font-size: 1.1rem;
  /* border: 1px solid #000; */
  display: inline-block;
  width: 77%;
}
.licence-bottom,
.l-bottom {
  position: relative;
  left: 60%;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}
.dialogVisibles {
  position: fixed;
  top: 0;
  left: -10%;
  height: 0;
  width: 120%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printstyle {
  background-color: #fff !important;
}
.PrintBut {
  margin-top: 15px;
}
.flots {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .f_title {
    position: absolute;
    top: 15px;
    font-size: 18px;
  }
}
.but {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>
src/views/licenseApproval/crossRegion.vue
New file
@@ -0,0 +1,888 @@
/*
 * @Author:liu
 * @Date: 2021-08-26 16:59:35
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-08-26 20:11:42
 */
<template>
  <div>
    <basic-container class="permit">
      <avue-crud
        :option="option"
        :table-loading="loading"
        :data="data"
        :page.sync="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crud"
        @row-update="rowUpdate"
        @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"
        :row-style="rowStyle"
      >
        <template slot="menuLeft">
          <el-button
            type="danger"
            size="small"
            icon="el-icon-delete"
            plain
            v-if="permission.permit_delete"
            @click="handleDelete"
            >删 除
          </el-button>
        </template>
        <template slot-scope="{ type, size, row }" slot="menu">
          <el-button
            icon="icon-zhengjian"
            :size="size"
            :type="type"
            class="zhengJian-icon"
            @click.stop="handleCredentials(row)"
            >附件查阅
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="rowDel(row)"
            v-if="row.type == '2'"
            >许可审批
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="viewLicense(row)"
            v-if="row.type == '0'"
            >打印许可证
          </el-button>
        </template>
        <template class="tdtype" slot-scope="{ row }" slot="type">
          <el-tag class="dtype">
            {{
              row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核"
            }}
            <i class="gz" v-if="row.type == '0'"></i>
            <i class="yj" v-if="row.type == '1'"></i>
            <i class="zc" v-if="row.type == '2'"></i>
          </el-tag>
        </template>
      </avue-crud>
    </basic-container>
    <!-- <el-dialog
      :visible.sync="dialogVisible"
      :before-close="handleClose"
      :modal-append-to-body="false"
      width="1005px"
      top="10vh"
      class="printstyle"
    >
      <div id="licence_box">
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="Print">打 印</el-button>
      </span>
    </el-dialog> -->
    <div
      v-if="dialogVisible"
      class="dialogVisibles"
      :class="classStyle == 'print' ? 'printstyle' : ''"
    >
      <div
        id="licence_box"
        :class="classStyle == 'print' ? 'printstyle' : ''"
        ref="licence"
      >
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
        <span slot="footer" class="dialog-footer no-print PrintBut">
          <el-button type="primary" @click="Print">打 印</el-button>
          <el-button type="primary" @click="closePrint"> 取 消 </el-button>
        </span>
      </div>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <div class="flots">
        <span class="f_title">是否通过审核?</span>
        <span class="f_body">请输入修改意见:</span>
        <textarea
          name="reworkmes"
          cols="40"
          rows="4"
          style="overflow: hidden"
          v-model="textareaShenpi"
        ></textarea>
        <div class="but">
          <el-button @click="closecc">通过</el-button>
          <el-button type="primary" @click="subcc">不通过</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/licenseApproval/recordk";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      classStyle: "print", //打印样式
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
        chiden: {},
      },
      textareaShenpi: "",
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        excelBtn: true,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        border: true,
        menuWidth: 300,
        labelWidth: 130,
        headerAlign: "center",
        align: "center",
        // border: false,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            searchLabelWidth: 80,
            searchSpan: 4,
            overHidden: true,
            width: 250,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            width: 82,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人电话",
            width: 106,
            prop: "representativecell",
            rules: [
              {
                required: true,
                message: "请输入法定代表人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人",
            prop: "contacts",
            width: 58,
            rules: [
              {
                required: true,
                message: "请输入联系人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人电话",
            width: 96,
            prop: "contactscell",
            rules: [
              {
                required: true,
                message: "请输入联系人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册时间",
            hide: true,
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            addDisplay: false,
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "许可类型",
            search: true,
            hide: true,
            prop: "ptype",
            type: "select",
            searchSpan: 4,
            dicData: [
              {
                label: "保安服务许可",
                value: "0",
              },
              {
                label: "保安培训许可",
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            width: 132,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, true),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
  methods: {
    Print() {
      this.$Print(this.$refs.licence);
    },
    handleCredentials(row) {
      this.$router.push({
        path: "/attachOnce/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.cardid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      console.log(this.xukezData);
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;
      this.licenceData.chiden = {};
      this.licenceData.chiden["名称"] = row.enterprisename;
      this.licenceData.chiden["住所"] = row.address;
      this.licenceData.chiden["法定代表人"] = row.representative;
      this.licenceData.chiden["服务范围"] = row.industry;
      this.licenceData.chiden["注册资本"] = row.registeredcapital;
      this.licenceData.chiden["批准文号"] = row.registrationnumber;
      console.log(this.licenceData);
      this.dialogVisible = true;
    },
    closePrint() {
      this.dialogVisible = false;
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["ptype"] = 5;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    },
  },
};
</script>
<style scoped lang="scss">
.dtype {
  width: 80px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
#licence_box {
  position: relative;
  top: 15px;
  width: 1080px;
  height: 780px;
  background-color: #004ca7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.licence {
  width: 960px;
  height: 648px;
  background-color: #fff !important;
  background-image: url("../../static/img/permit/服务许可背景图.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 10%;
  color: #000;
}
.licence-head {
  width: 100%;
  height: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
}
.head-tid {
  position: relative;
  left: 70%;
}
.head-tid span {
  margin: 0 1rem;
}
.licence-main {
  width: 80%;
}
.l-m-once {
  width: 100%;
  height: 2rem;
  margin-top: 1rem;
}
.l-m-o-title {
  font-size: 1.3rem;
  width: 22%;
  text-align: justify;
  display: inline-block;
}
.l-m-r-once {
  font-size: 1.1rem;
  /* border: 1px solid #000; */
  display: inline-block;
  width: 77%;
}
.licence-bottom,
.l-bottom {
  position: relative;
  left: 60%;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}
.dialogVisibles {
  position: fixed;
  top: 0;
  left: -10%;
  height: 0;
  width: 120%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printstyle {
  background-color: #fff !important;
}
.PrintBut {
  margin-top: 15px;
}
.flots {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .f_title {
    position: absolute;
    top: 15px;
    font-size: 18px;
  }
}
.but {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>
src/views/licenseApproval/securityGuard.vue
New file
@@ -0,0 +1,828 @@
/*
 * @Author: liu
 * @Date: 2021-08-26 16:57:58
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-08-26 20:11:44
 */
<template>
  <div>
    <basic-container class="permit">
      <avue-crud
        :option="option"
        :table-loading="loading"
        :data="data"
        :page.sync="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crud"
        @row-update="rowUpdate"
        @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"
        :row-style="rowStyle"
      >
        <template slot="menuLeft">
          <el-button
            type="danger"
            size="small"
            icon="el-icon-delete"
            plain
            v-if="permission.permit_delete"
            @click="handleDelete"
            >删 除
          </el-button>
        </template>
        <template slot-scope="{ type, size, row }" slot="menu">
          <el-button
            icon="icon-zhengjian"
            :size="size"
            :type="type"
            class="zhengJian-icon"
            @click.stop="handleCredentials(row)"
            >附件审查</el-button
          >
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            v-if="row.type == '2'"
            @click.stop="rowDel(row)"
            >备案审批
          </el-button>
        </template>
        <template class="tdtype" slot-scope="{ row }" slot="type">
          <el-tag class="dtype">
            {{
              row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核"
            }}
            <i class="gz" v-if="row.type == '0'"></i>
            <i class="yj" v-if="row.type == '1'"></i>
            <i class="zc" v-if="row.type == '2'"></i>
          </el-tag>
        </template>
      </avue-crud>
    </basic-container>
    <div
      v-if="dialogVisible"
      class="dialogVisibles"
      :class="classStyle == 'print' ? 'printstyle' : ''"
    >
      <div
        id="licence_box"
        :class="classStyle == 'print' ? 'printstyle' : ''"
        ref="licence"
      >
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
        <span slot="footer" class="dialog-footer no-print PrintBut">
          <el-button type="primary" @click="Print">打 印</el-button>
          <el-button type="primary" @click="closePrint"> 取 消 </el-button>
        </span>
      </div>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <div class="flots">
        <span class="f_title">是否通过审核?</span>
        <span class="f_body">请输入修改意见:</span>
        <textarea
          name="reworkmes"
          cols="40"
          rows="4"
          style="overflow: hidden"
          v-model="textareaShenpi"
        ></textarea>
        <div class="but">
          <el-button @click="closecc">通过</el-button>
          <el-button type="primary" @click="subcc">不通过</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/licenseApproval/record";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      classStyle: "print", //打印样式
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
        chiden: {},
      },
      textareaShenpi: "",
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        excelBtn: true,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        border: true,
        menuWidth: 300,
        labelWidth: 130,
        headerAlign: "center",
        align: "center",
        // border: false,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            searchLabelWidth: 80,
            searchSpan: 4,
            overHidden: true,
            width: 250,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            width: 82,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人电话",
            width: 106,
            prop: "representativecell",
            rules: [
              {
                required: true,
                message: "请输入法定代表人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人",
            prop: "contacts",
            width: 58,
            rules: [
              {
                required: true,
                message: "请输入联系人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人电话",
            width: 96,
            prop: "contactscell",
            rules: [
              {
                required: true,
                message: "请输入联系人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册时间",
            hide: true,
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            addDisplay: false,
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "许可类型",
            search: true,
            hide: true,
            prop: "ptype",
            type: "select",
            searchSpan: 4,
            dicData: [
              {
                label: "保安服务许可",
                value: "0",
              },
              {
                label: "保安培训许可",
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            width: 132,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, true),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
  methods: {
    Print() {
      this.$Print(this.$refs.licence);
    },
    handleCredentials(row) {
      this.$router.push({
        path: "/attachOnce/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.cardid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      console.log(this.xukezData);
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;
      this.licenceData.chiden = {};
      this.licenceData.chiden["名称"] = row.enterprisename;
      this.licenceData.chiden["住所"] = row.address;
      this.licenceData.chiden["法定代表人"] = row.representative;
      this.licenceData.chiden["服务范围"] = row.industry;
      this.licenceData.chiden["注册资本"] = row.registeredcapital;
      this.licenceData.chiden["批准文号"] = row.registrationnumber;
      console.log(this.licenceData);
      this.dialogVisible = true;
    },
    closePrint() {
      this.dialogVisible = false;
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["ptype"] = 3;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    },
  },
};
</script>
<style scoped lang="scss">
.dtype {
  width: 80px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
#licence_box {
  position: relative;
  top: 15px;
  width: 1080px;
  height: 780px;
  background-color: #004ca7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.licence {
  width: 960px;
  height: 648px;
  background-color: #fff !important;
  background-image: url("../../static/img/permit/服务许可背景图.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 10%;
  color: #000;
}
.licence-head {
  width: 100%;
  height: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
}
.head-tid {
  position: relative;
  left: 70%;
}
.head-tid span {
  margin: 0 1rem;
}
.licence-main {
  width: 80%;
}
.l-m-once {
  width: 100%;
  height: 2rem;
  margin-top: 1rem;
}
.l-m-o-title {
  font-size: 1.3rem;
  width: 22%;
  text-align: justify;
  display: inline-block;
}
.l-m-r-once {
  font-size: 1.1rem;
  /* border: 1px solid #000; */
  display: inline-block;
  width: 77%;
}
.licence-bottom,
.l-bottom {
  position: relative;
  left: 60%;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}
.dialogVisibles {
  position: fixed;
  top: 0;
  left: -10%;
  height: 0;
  width: 120%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printstyle {
  background-color: #fff !important;
}
.PrintBut {
  margin-top: 15px;
}
.flots {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .f_title {
    position: absolute;
    top: 15px;
    font-size: 18px;
  }
}
.but {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>
src/views/licenseApproval/securityPermit.vue
New file
@@ -0,0 +1,889 @@
/*
 * @Author: liu
 * @Date: 2021-08-26 16:22:20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-08-26 20:09:51
 */
<template>
  <div>
    <basic-container class="permit">
      <avue-crud
        :option="option"
        :table-loading="loading"
        :data="data"
        :page.sync="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crud"
        @row-update="rowUpdate"
        @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"
        :row-style="rowStyle"
      >
        <template slot="menuLeft">
          <el-button
            type="danger"
            size="small"
            icon="el-icon-delete"
            plain
            v-if="permission.permit_delete"
            @click="handleDelete"
            >删 除
          </el-button>
        </template>
        <template slot-scope="{ type, size, row }" slot="menu">
          <el-button
            icon="icon-zhengjian"
            :size="size"
            :type="type"
            class="zhengJian-icon"
            @click.stop="handleCredentials(row)"
            >附件查阅
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="rowDel(row)"
            v-if="row.type == '2'"
            >许可审批
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="viewLicense(row)"
            v-if="row.type == '0'"
            >打印许可证
          </el-button>
        </template>
        <template class="tdtype" slot-scope="{ row }" slot="type">
          <el-tag class="dtype">
            {{
              row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核"
            }}
            <i class="gz" v-if="row.type == '0'"></i>
            <i class="yj" v-if="row.type == '1'"></i>
            <i class="zc" v-if="row.type == '2'"></i>
          </el-tag>
        </template>
      </avue-crud>
    </basic-container>
    <!-- <el-dialog
      :visible.sync="dialogVisible"
      :before-close="handleClose"
      :modal-append-to-body="false"
      width="1005px"
      top="10vh"
      class="printstyle"
    >
      <div id="licence_box">
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="Print">打 印</el-button>
      </span>
    </el-dialog> -->
    <div
      v-if="dialogVisible"
      class="dialogVisibles"
      :class="classStyle == 'print' ? 'printstyle' : ''"
    >
      <div
        id="licence_box"
        :class="classStyle == 'print' ? 'printstyle' : ''"
        ref="licence"
      >
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
        <span slot="footer" class="dialog-footer no-print PrintBut">
          <el-button type="primary" @click="Print">打 印</el-button>
          <el-button type="primary" @click="closePrint"> 取 消 </el-button>
        </span>
      </div>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <div class="flots">
        <span class="f_title">是否通过审核?</span>
        <span class="f_body">请输入修改意见:</span>
        <textarea
          name="reworkmes"
          cols="40"
          rows="4"
          style="overflow: hidden"
          v-model="textareaShenpi"
        ></textarea>
        <div class="but">
          <el-button @click="closecc">通过</el-button>
          <el-button type="primary" @click="subcc">不通过</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/licenseApproval/permit";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      classStyle: "print", //打印样式
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
        chiden: {},
      },
      textareaShenpi: "",
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        excelBtn: true,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        border: true,
        menuWidth: 300,
        labelWidth: 130,
        headerAlign: "center",
        align: "center",
        // border: false,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            searchLabelWidth: 80,
            searchSpan: 4,
            overHidden: true,
            width: 250,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            width: 82,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人电话",
            width: 106,
            prop: "representativecell",
            rules: [
              {
                required: true,
                message: "请输入法定代表人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人",
            prop: "contacts",
            width: 58,
            rules: [
              {
                required: true,
                message: "请输入联系人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人电话",
            width: 96,
            prop: "contactscell",
            rules: [
              {
                required: true,
                message: "请输入联系人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册时间",
            hide: true,
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            addDisplay: false,
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "许可类型",
            search: true,
            hide: true,
            prop: "ptype",
            type: "select",
            searchSpan: 4,
            dicData: [
              {
                label: "保安服务许可",
                value: "0",
              },
              {
                label: "保安培训许可",
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            width: 132,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, true),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
  methods: {
    Print() {
      this.$Print(this.$refs.licence);
    },
    handleCredentials(row) {
      console.log(row, "21354");
      this.$router.push({
        path: "/attachOnce/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.cardid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      console.log(this.xukezData);
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;
      this.licenceData.chiden = {};
      this.licenceData.chiden["名称"] = row.enterprisename;
      this.licenceData.chiden["住所"] = row.address;
      this.licenceData.chiden["法定代表人"] = row.representative;
      this.licenceData.chiden["服务范围"] = row.industry;
      this.licenceData.chiden["注册资本"] = row.registeredcapital;
      this.licenceData.chiden["批准文号"] = row.registrationnumber;
      console.log(this.licenceData);
      this.dialogVisible = true;
    },
    closePrint() {
      this.dialogVisible = false;
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["ptype"] = 0;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    },
  },
};
</script>
<style scoped lang="scss">
.dtype {
  width: 80px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
#licence_box {
  position: relative;
  top: 15px;
  width: 1080px;
  height: 780px;
  background-color: #004ca7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.licence {
  width: 960px;
  height: 648px;
  background-color: #fff !important;
  background-image: url("../../static/img/permit/服务许可背景图.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 10%;
  color: #000;
}
.licence-head {
  width: 100%;
  height: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
}
.head-tid {
  position: relative;
  left: 70%;
}
.head-tid span {
  margin: 0 1rem;
}
.licence-main {
  width: 80%;
}
.l-m-once {
  width: 100%;
  height: 2rem;
  margin-top: 1rem;
}
.l-m-o-title {
  font-size: 1.3rem;
  width: 22%;
  text-align: justify;
  display: inline-block;
}
.l-m-r-once {
  font-size: 1.1rem;
  /* border: 1px solid #000; */
  display: inline-block;
  width: 77%;
}
.licence-bottom,
.l-bottom {
  position: relative;
  left: 60%;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}
.dialogVisibles {
  position: fixed;
  top: 0;
  left: -10%;
  height: 0;
  width: 120%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printstyle {
  background-color: #fff !important;
}
.PrintBut {
  margin-top: 15px;
}
.flots {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .f_title {
    position: absolute;
    top: 15px;
    font-size: 18px;
  }
}
.but {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>
src/views/licenseApproval/securityTraining.vue
New file
@@ -0,0 +1,888 @@
/*
 * @Author: liu
 * @Date: 2021-08-26 16:55:25
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2021-08-26 20:11:51
 */
<template>
  <div>
    <basic-container class="permit">
      <avue-crud
        :option="option"
        :table-loading="loading"
        :data="data"
        :page.sync="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crud"
        @row-update="rowUpdate"
        @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"
        :row-style="rowStyle"
      >
        <template slot="menuLeft">
          <el-button
            type="danger"
            size="small"
            icon="el-icon-delete"
            plain
            v-if="permission.permit_delete"
            @click="handleDelete"
            >删 除
          </el-button>
        </template>
        <template slot-scope="{ type, size, row }" slot="menu">
          <el-button
            icon="icon-zhengjian"
            :size="size"
            :type="type"
            class="zhengJian-icon"
            @click.stop="handleCredentials(row)"
            >附件查阅
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="rowDel(row)"
            v-if="row.type == '2'"
            >许可审批
          </el-button>
          <el-button
            icon="el-icon-edit"
            :size="size"
            :type="type"
            @click.stop="viewLicense(row)"
            v-if="row.type == '0'"
            >打印许可证
          </el-button>
        </template>
        <template class="tdtype" slot-scope="{ row }" slot="type">
          <el-tag class="dtype">
            {{
              row.type == "0" ? "通过" : row.type == "1" ? "不通过" : "待审核"
            }}
            <i class="gz" v-if="row.type == '0'"></i>
            <i class="yj" v-if="row.type == '1'"></i>
            <i class="zc" v-if="row.type == '2'"></i>
          </el-tag>
        </template>
      </avue-crud>
    </basic-container>
    <!-- <el-dialog
      :visible.sync="dialogVisible"
      :before-close="handleClose"
      :modal-append-to-body="false"
      width="1005px"
      top="10vh"
      class="printstyle"
    >
      <div id="licence_box">
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="Print">打 印</el-button>
      </span>
    </el-dialog> -->
    <div
      v-if="dialogVisible"
      class="dialogVisibles"
      :class="classStyle == 'print' ? 'printstyle' : ''"
    >
      <div
        id="licence_box"
        :class="classStyle == 'print' ? 'printstyle' : ''"
        ref="licence"
      >
        <div class="licence" id="licence" v-if="dialogVisible">
          <div class="licence-head">保安服务许可证</div>
          <div class="head-tid">
            洪公保服务
            <span class="fontStyle">{{
              licenceData.row.organizationcode
            }}</span>
            号
          </div>
          <div class="licence-main">
            <div
              class="l-m-once"
              v-for="(item, index, key) in licenceData.chiden"
              :key="key"
            >
              <span class="l-m-o-title"> {{ index }}: </span>
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(0, 4)
            }}</span
            >年
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(5, 7)
            }}</span>
            月
            <span class="l-b-t">{{
              licenceData.row.permitime.slice(8, 10)
            }}</span>
            日
          </div>
        </div>
        <span slot="footer" class="dialog-footer no-print PrintBut">
          <el-button type="primary" @click="Print">打 印</el-button>
          <el-button type="primary" @click="closePrint"> 取 消 </el-button>
        </span>
      </div>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <div class="flots">
        <span class="f_title">是否通过审核?</span>
        <span class="f_body">请输入修改意见:</span>
        <textarea
          name="reworkmes"
          cols="40"
          rows="4"
          style="overflow: hidden"
          v-model="textareaShenpi"
        ></textarea>
        <div class="but">
          <el-button @click="closecc">通过</el-button>
          <el-button type="primary" @click="subcc">不通过</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  getList,
  getDetail,
  add,
  update,
  remove,
} from "@/api/licenseApproval/permit";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      classStyle: "print", //打印样式
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
        chiden: {},
      },
      textareaShenpi: "",
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        excelBtn: true,
        tip: false,
        searchShowBtn: false,
        searchShow: true,
        searchMenuSpan: 8,
        border: true,
        menuWidth: 300,
        labelWidth: 130,
        headerAlign: "center",
        align: "center",
        // border: false,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "企业名称",
            search: true,
            prop: "enterprisename",
            searchLabelWidth: 80,
            searchSpan: 4,
            overHidden: true,
            width: 250,
            rules: [
              {
                required: true,
                message: "请输入企业名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "社会信用代码",
            prop: "creditcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入统一社会信用代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人",
            prop: "representative",
            width: 82,
            rules: [
              {
                required: true,
                message: "请输入法定代表人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "法定代表人电话",
            width: 106,
            prop: "representativecell",
            rules: [
              {
                required: true,
                message: "请输入法定代表人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人",
            prop: "contacts",
            width: 58,
            rules: [
              {
                required: true,
                message: "请输入联系人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "联系人电话",
            width: 96,
            prop: "contactscell",
            rules: [
              {
                required: true,
                message: "请输入联系人电话",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册时间",
            hide: true,
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            rules: [
              {
                required: true,
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册资本",
            prop: "registeredcapital",
            rules: [
              {
                required: true,
                message: "请输入注册资本",
                trigger: "blur",
              },
            ],
          },
          {
            label: "组织机构代码",
            prop: "organizationcode",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入组织机构代码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "工商注册号",
            hide: true,
            prop: "registrationnumber",
            rules: [
              {
                required: true,
                message: "请输入工商注册号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "纳税人识别号",
            prop: "identificationnumber",
            hide: true,
            rules: [
              {
                required: true,
                message: "请输入纳税人识别号",
                trigger: "blur",
              },
            ],
          },
          {
            label: "企业类型",
            hide: true,
            prop: "enterprises",
            rules: [
              {
                required: true,
                message: "请输入企业类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "注册地址",
            prop: "address",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入注册地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属地区",
            hide: true,
            prop: "region",
            rules: [
              {
                required: true,
                message: "请输入所属地区",
                trigger: "blur",
              },
            ],
          },
          {
            label: "登记机关",
            prop: "registration",
            overHidden: true,
            rules: [
              {
                required: true,
                message: "请输入登记机关",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属行业",
            hide: true,
            prop: "industry",
            rules: [
              {
                required: true,
                message: "请输入所属行业",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            addDisplay: false,
            type: "select",
            hide: true,
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "许可类型",
            search: true,
            hide: true,
            prop: "ptype",
            type: "select",
            searchSpan: 4,
            dicData: [
              {
                label: "保安服务许可",
                value: "0",
              },
              {
                label: "保安培训许可",
                value: "1",
              },
            ],
          },
          {
            label: "提交时间",
            prop: "permitime",
            overHidden: true,
            addDisplay: false,
            width: 132,
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "审核状态",
            prop: "type",
            addDisplay: false,
            type: "select",
            dicData: [
              {
                label: "通过",
                value: "0",
              },
              {
                label: "不通过",
                value: "1",
              },
              {
                label: "待审核",
                value: "2",
              },
            ],
          },
          {
            label: "经营范围",
            prop: "business",
            component: "AvueUeditor",
            hide: true,
            minRows: 6,
            span: 24,
            rules: [
              {
                required: true,
                message: "请输入经营范围",
                trigger: "blur",
              },
            ],
          },
        ],
      },
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.permit_add, false),
        viewBtn: this.vaildData(this.permission.permit_view, true),
        delBtn: this.vaildData(this.permission.permit_delete, false),
        editBtn: this.vaildData(this.permission.permit_edit, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  // mounted() {
  //     console.log(this.userInfo.dept_id);
  // },
  methods: {
    Print() {
      this.$Print(this.$refs.licence);
    },
    handleCredentials(row) {
      this.$router.push({
        path: "/attachOnce/index",
        // redirect: { name: "foo" },
        // query: { row: row },
        query: { deptid: row.cardid, type: "0" },
        // params: { row: row.identificationnumber },
      });
    },
    rowSave(row, done, loading) {
      row.deptid = this.userInfo.dept_id;
      add(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      console.log(this.xukezData);
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      this.xukezData["approve"] = this.textareaShenpi;
      update(this.xukezData);
      this.textareaShenpi = "";
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;
      this.licenceData.chiden = {};
      this.licenceData.chiden["名称"] = row.enterprisename;
      this.licenceData.chiden["住所"] = row.address;
      this.licenceData.chiden["法定代表人"] = row.representative;
      this.licenceData.chiden["服务范围"] = row.industry;
      this.licenceData.chiden["注册资本"] = row.registeredcapital;
      this.licenceData.chiden["批准文号"] = row.registrationnumber;
      console.log(this.licenceData);
      this.dialogVisible = true;
    },
    closePrint() {
      this.dialogVisible = false;
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      params["ptype"] = 1;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
            color: "#F34A4A",
          };
        }
        if (row.dtype == "1") {
          return {
            color: "#F48F57",
          };
        }
      }
    },
  },
};
</script>
<style scoped lang="scss">
.dtype {
  width: 80px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
.el-tag {
  display: inline-block;
  width: 80px;
  /*padding-right: 40px !important;*/
}
#licence_box {
  position: relative;
  top: 15px;
  width: 1080px;
  height: 780px;
  background-color: #004ca7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.licence {
  width: 960px;
  height: 648px;
  background-color: #fff !important;
  background-image: url("../../static/img/permit/服务许可背景图.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-sizing: border-box;
  padding: 10%;
  color: #000;
}
.licence-head {
  width: 100%;
  height: 1.8rem;
  font-size: 1.8rem;
  text-align: center;
}
.head-tid {
  position: relative;
  left: 70%;
}
.head-tid span {
  margin: 0 1rem;
}
.licence-main {
  width: 80%;
}
.l-m-once {
  width: 100%;
  height: 2rem;
  margin-top: 1rem;
}
.l-m-o-title {
  font-size: 1.3rem;
  width: 22%;
  text-align: justify;
  display: inline-block;
}
.l-m-r-once {
  font-size: 1.1rem;
  /* border: 1px solid #000; */
  display: inline-block;
  width: 77%;
}
.licence-bottom,
.l-bottom {
  position: relative;
  left: 60%;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}
.dialogVisibles {
  position: fixed;
  top: 0;
  left: -10%;
  height: 0;
  width: 120%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printstyle {
  background-color: #fff !important;
}
.PrintBut {
  margin-top: 15px;
}
.flots {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  .f_title {
    position: absolute;
    top: 15px;
    font-size: 18px;
  }
}
.but {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-content: center;
  justify-content: center;
}
</style>
src/views/resource/attachOnce.vue
New file
@@ -0,0 +1,418 @@
<template>
  <basic-container>
    <avue-crud
      :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
      :permission="permissionList"
      :before-open="beforeOpen"
      v-model="form"
      ref="crud"
      @row-del="rowDel"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot="menuLeft">
        <!--        <el-button type="primary"-->
        <!--                   size="small"-->
        <!--                   plain-->
        <!--                   icon="el-icon-upload2"-->
        <!--                   @click="handleUpload">上 传-->
        <!--        </el-button>-->
        <!--        <el-button type="danger"-->
        <!--                   size="small"-->
        <!--                   icon="el-icon-delete"-->
        <!--                   plain-->
        <!--                   @click="handleDelete">删 除-->
        <!--        </el-button>-->
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button
          type="text"
          icon="el-icon-download"
          size="small"
          @click="handleDownload(scope.row)"
          >下载
        </el-button>
        <el-button
          type="text"
          icon="el-icon-picture-outline-round"
          size="small"
          v-show="!fileFormat(scope.row)"
          @click="seeImages(scope.row)"
          >预览
        </el-button>
      </template>
      <template slot-scope="{ row }" slot="attachSize">
        <el-tag>{{ `${row.attachSize} KB` }}</el-tag>
      </template>
    </avue-crud>
    <el-dialog
      title="附件管理"
      append-to-body
      :visible.sync="attachBox"
      width="555px"
    >
      <avue-form
        ref="form"
        :option="attachOption"
        v-model="attachForm"
        :upload-after="uploadAfter"
      >
      </avue-form>
    </el-dialog>
    <el-dialog
      title="预览"
      append-to-body
      :visible.sync="imgSee"
      class="see-img-box"
    >
      <div class="img" :style="{ background: imgUrl }"></div>
    </el-dialog>
  </basic-container>
</template>
<script>
import { getList, getDetail, remove } from "@/api/resource/attachOnce";
import { mapGetters } from "vuex";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
export default {
  components: { ElImageViewer },
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      attachBox: false,
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        searchShowBtn: false,
        headerAlign: "center",
        border: true,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        column: [
          {
            label: "附件地址",
            prop: "link",
            rules: [
              {
                required: true,
                message: "请输入附件地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件域名",
            prop: "domain",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入附件域名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件名称",
            prop: "name",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入附件名称",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件原名",
            prop: "originalName",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入附件原名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件拓展名",
            prop: "extension",
            rules: [
              {
                required: true,
                message: "请输入附件拓展名",
                trigger: "blur",
              },
            ],
          },
          {
            label: "附件大小",
            prop: "attachSize",
            slot: true,
            rules: [
              {
                required: true,
                message: "请输入附件大小",
                trigger: "blur",
              },
            ],
          },
          {
            label: "所属机构",
            prop: "deptid",
            type: "select",
            dicUrl: "/api/blade-system/dept/selectIn",
            props: {
              label: "deptname",
              value: "deptid",
            },
          },
          {
            label: "类型",
            prop: "type",
            addDisplay: false,
            width: 80,
            type: "select",
            dicData: [
              {
                label: "许可审批",
                value: "0",
              },
              {
                label: "备案",
                value: "1",
              },
              {
                label: "撤销",
                value: "2",
              },
              {
                label: "跨区备案",
                value: "3",
              },
            ],
          },
        ],
      },
      data: [],
      attachForm: {},
      attachOption: {
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
            label: "附件上传",
            prop: "attachFile",
            type: "upload",
            drag: true,
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
            },
            action: "/api/blade-resource/oss/endpoint/put-file-attach?deptid=",
          },
        ],
      },
      imgSee: false,
      imgUrl: "",
    };
  },
  created() {
    var flag = false,
      i = 0,
      ind = null;
    this.$store.state.tags.tagList.forEach((item, index) => {
      if (item.label == "附件上传") {
        if (flag == false) {
          ind = index;
          flag = true;
        }
        i++;
      }
    });
    if (i > 1) {
      this.$store.state.tags.tagList.splice(ind, 1);
    }
    var deptid = this.$route.query.deptid;
    var type = this.$route.query.type;
    this.attachOption.column[0].action += deptid + "&type=" + type;
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: false,
        editBtn: false,
        viewBtn: false,
        delBtn: this.vaildData(this.permission.attach_delete, false),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    handleUpload() {
      this.attachBox = true;
    },
    uploadAfter(res, done, loading, column) {
      window.console.log(column);
      this.attachBox = false;
      this.refreshChange();
      done();
    },
    handleDownload(row) {
      window.open(`${row.link}`);
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    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.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      this.loading = true;
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query),
        this.$route.query.deptid,
        this.$route.query.type
      ).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
    },
    seeImages(row) {
      this.imgUrl = "";
      this.imgUrl = "url(" + row.link + ") center center / contain no-repeat";
      this.imgSee = true;
    },
    fileFormat(row) {
      var index = row.link.lastIndexOf(".");
      var ext = row.link.substr(index + 1);
      return (
        [
          "png",
          "jpg",
          "jpeg",
          "bmp",
          "gif",
          "webp",
          "psd",
          "svg",
          "tiff",
        ].indexOf(ext.toLowerCase()) == -1
      );
    },
  },
};
</script>
<style>
</style>