shuishen
2021-08-13 e8a728024b32be3d227e406c13aee47bb254d10f
src/views/record/record.vue
@@ -1,7 +1,6 @@
<template>
  <basic-container>
    <avue-crud
      :option="option"
        <avue-crud :option="option"
      :table-loading="loading"
      :data="data"
      :page.sync="page"
@@ -18,45 +17,78 @@
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
                   @on-load="onLoad">
      <template slot="menuLeft">
        <el-button
          type="danger"
                <el-button type="danger"
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.record_delete"
          @click="handleDelete"
          >删 除
                           @click="handleDelete">删 除
        </el-button>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          icon="icon-zhengjian"
            <template slot-scope="{ type, size, row }"
                      slot="menu">
                <el-button icon="icon-zhengjian"
          :size="size"
          :type="type"
          class="zhengJian-icon"
          @click.stop="handleCredentialsr(row)"
          >附件查阅</el-button
        >
        <el-button
          icon="el-icon-edit"
                           @click.stop="handleCredentialsr(row)">附件查阅</el-button>
                <el-button icon="el-icon-edit"
          :size="size"
          :type="type"
          @click.stop="rowDel(row)"
          >备案审批
                           v-show="row.type != 0 && row.type != 1"
                           @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">
            <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>
                    <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>
        <el-dialog :visible.sync="dialogVisible"
                   :modal-append-to-body="false"
                   width="920px"
                   top="15vh">
            <div id="examine_box"
                 v-if="dialogVisible">
                <div class="exam-box">
                    <h3>回执单</h3>
                    <p>
                        南昌市公安局已收到 <span>{{ rowData == null ? '' : rowData.enterprisename }}</span> 的相关备案申请!
                    </p>
                    <div class="examine-bottom">
                        <ul>
                            <li> 审批单位:<span>南昌市公安局</span> </li>
                            <li> 日期:<span>{{ rowData == null ? '' : rowData.examinetime }}</span> </li>
                        </ul>
                    </div>
                </div>
            </div>
            <span slot="footer"
                  class="dialog-footer">
                <el-button type="primary"
                           @click="Print">打 印</el-button>
            </span>
        </el-dialog>
  </basic-container>
</template>
@@ -67,6 +99,7 @@
export default {
  data() {
    return {
            dialogVisible: false, // 备案审批打印的
      form: {},
      query: {},
      loading: true,
@@ -337,6 +370,7 @@
        ],
      },
      data: [],
            rowData: null,
    };
  },
  computed: {
@@ -358,6 +392,16 @@
    },
  },
  methods: {
        Print () {
            //打印
            let subOutputRankPrint = document.getElementById("examine_box");
            let newContent = subOutputRankPrint.innerHTML;
            let oldContent = document.body.innerHTML;
            document.body.innerHTML = newContent;
            window.print();
            window.location.reload();
            document.body.innerHTML = oldContent;
        },
    handleCredentialsr(row) {
      this.$router.push({
        path: "/attach/index",
@@ -408,6 +452,7 @@
      })
        .then(() => {
          row.type = "0";
                    row.examinetime = this.getCurrentTime();
          return update(row);
        })
        .then(() => {
@@ -417,6 +462,25 @@
            message: "操作成功!",
          });
        });
        },
        // 审批打印
        rowPrint (row) {
            this.rowData = null;
            this.rowData = row;
            this.dialogVisible = true;
        },
        getCurrentTime () {
            let date = new Date();
            let dateYear = date.getFullYear(); //获取年
            let dateMonth = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1); //获取月
            let dateDate = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); //获取当日
            let dateHours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours(); //获取小时
            let dateMinutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(); //获取分钟
            let dateSeconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds(); //获取秒
            return dateYear + '-' + dateMonth + '-' + dateDate + ' ' + dateHours + ':' + dateMinutes + ':' +
                dateSeconds
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
@@ -557,4 +621,45 @@
  width: 80px;
  /*padding-right: 40px !important;*/
}
.exam-box {
    width: 100%;
    height: 360px;
    position: relative;
    padding: 10px;
    background: #fff !important;
    color: #000;
    box-sizing: border-box;
}
.exam-box h3 {
    margin: 0;
    text-align: center;
    font-size: 28px;
    letter-spacing: 10px;
    line-height: 46px;
}
.exam-box p {
    text-indent: 2em;
    font-size: 18px;
}
.exam-box .examine-bottom {
    position: absolute;
    bottom: 10px;
    right: 10px;
}
.exam-box li {
    list-style: none;
    font-size: 18px;
    line-height: 32px;
}
.exam-box span {
    text-decoration: underline;
}
</style>