zhengpz
2021-08-14 f11c3ba45925e41f26296fc3d03fba9b777d5910
src/views/record/record.vue
@@ -45,7 +45,16 @@
          :size="size"
          :type="type"
          @click.stop="rowDel(row)"
          >备案审批
          v-show="row.type == 2"
          >审批
        </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">
@@ -57,9 +66,54 @@
        </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>
    <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>
  </basic-container>
</template>
<script>
import { getList, getDetail, add, update, remove } from "@/api/record/record";
import { mapGetters } from "vuex";
@@ -67,6 +121,10 @@
export default {
  data() {
    return {
      dialogVisiblecc: false, //许可证审核抽屉
      xukezData: {},
      dialogVisible: false, // 备案审批打印的
      form: {},
      query: {},
      loading: true,
@@ -129,7 +187,7 @@
            ],
          },
          {
            label: "成立日期",
            label: "注册时间",
            prop: "establishtime",
            type: "date",
            format: "yyyy-MM-dd",
@@ -137,7 +195,7 @@
            rules: [
              {
                required: true,
                message: "请输入成立日期",
                message: "请输入注册时间",
                trigger: "blur",
              },
            ],
@@ -284,6 +342,21 @@
            ],
          },
          {
            label: "审批时间",
            hide: true,
            prop: "examinetime",
            type: "date",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
            rules: [
              {
                required: true,
                message: "请输入审批时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "发证时间",
            hide: true,
            prop: "officetime",
@@ -337,6 +410,7 @@
        ],
      },
      data: [],
      rowData: null,
    };
  },
  computed: {
@@ -358,6 +432,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",
@@ -401,22 +485,55 @@
      );
    },
    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: "操作成功!",
          });
        });
      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);
    },
    // 审批打印
    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) {
@@ -488,7 +605,7 @@
        this.selectionClear();
      });
    },
    rowStyle({ row, column, rowIndex }) {
    rowStyle({ row }) {
      if (row.dtype != null && row.dtype != "") {
        if (row.dtype == "2") {
          return {
@@ -505,7 +622,7 @@
  },
};
</script>
<style scoped>
.dtype {
  width: 80px;
@@ -557,4 +674,45 @@
  width: 80px;
  /*padding-right: 40px !important;*/
}
</style>
.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>