shuishen
2021-08-14 f1ba84aea2a62bd2c4b6fd650535da0f657dc2c3
src/views/permit/permit.vue
@@ -1,71 +1,77 @@
<template>
  <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)"
          >查看许可证
        </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>
  <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 != '2'"
            >生成许可证
          </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"
@@ -97,7 +103,7 @@
              <span class="l-m-r-once">{{ item }}</span>
            </div>
          </div>
          <div class="licence-bottom">发证机关(印章)</div>
          <div class="licence-bottom">发证机关(南昌市公安局)</div>
          <div class="l-bottom">
            发证日期
            <span class="l-b-t">{{
@@ -120,7 +126,20 @@
        <el-button type="primary" @click="Print">打 印</el-button>
      </span>
    </el-dialog>
  </basic-container>
    <el-dialog
      title=""
      :visible.sync="dialogVisiblecc"
      width="30%"
      :modal-append-to-body="false"
    >
      <span>是否通过审核?</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closecc">通过</el-button>
        <el-button type="primary" @click="subcc">不通过</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
@@ -130,6 +149,9 @@
export default {
  data() {
    return {
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, //许可证抽屉
      licenceData: {
        row: {},
@@ -423,13 +445,15 @@
  methods: {
    Print() {
      //打印
      let subOutputRankPrint = document.getElementById("licence_box");
      let newContent = subOutputRankPrint.innerHTML;
      let oldContent = document.body.innerHTML;
      document.body.innerHTML = newContent;
      window.print();
      window.location.reload();
      document.body.innerHTML = oldContent;
      // let subOutputRankPrint = document.getElementById("licence_box");
      // let newContent = subOutputRankPrint.innerHTML;
      // let oldContent = document.body.innerHTML;
      // document.body.innerHTML = newContent;
      // window.print();
      // window.location.reload();
      // document.body.innerHTML = oldContent;
      this.$Print("#licence");
      // licence_box
    },
    handleCredentials(row) {
      this.$router.push({
@@ -474,32 +498,20 @@
      );
    },
    rowDel(row) {
      this.$confirm("确定对选择的许可进行审批?", {
        confirmButtonText: "通过",
        cancelButtonText: "不通过",
        type: "warning",
      })
        .then(() => {
          row.type = "0";
          return update(row);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        })
        .catch(() => {
          row.type = "1";
          update(row);
          this.onLoad(this.page);
          this.$message({
            type: "warning",
            message: "操作成功!",
          });
        });
      this.dialogVisiblecc = true;
      this.xukezData = row;
    },
    closecc() {
      this.xukezData.type = "0";
      this.dialogVisiblecc = false;
      return update(this.xukezData);
    },
    subcc() {
      this.xukezData.type = "1";
      this.dialogVisiblecc = false;
      return update(this.xukezData);
    },
    viewLicense(row) {
      //查看许可证
      this.licenceData.row = row;