Administrator
2021-11-03 a984f4167d833d04ab3d38c2914b33b775bc252f
制证申请,导出
4 files modified
124 ■■■■ changed files
src/api/accreditationRecords/accreditationRecords.js 11 ●●●●● patch | view | raw | blame | history
src/views/accreditationRecords/accreditationRecords.vue 104 ●●●● patch | view | raw | blame | history
src/views/securityGuard/securityGuard.vue 7 ●●●●● patch | view | raw | blame | history
src/views/trainExam/performance.vue 2 ●●● patch | view | raw | blame | history
src/api/accreditationRecords/accreditationRecords.js
@@ -13,6 +13,17 @@
    })
}
export const getAccreditationRecords = (id) => {
    return request({
        url: '/api/accreditationRecords/details',
        method: 'get',
        params: {
            id,
        }
    })
}
export const remove = (ids) => {
    return request({
        url: '/api/accreditationRecords/remove',
src/views/accreditationRecords/accreditationRecords.vue
@@ -9,6 +9,7 @@
      @row-del="rowDel"
      v-model="form"
      :permission="permissionList"
      :search.sync="questionBankSearch"
      @row-update="rowUpdate"
      @row-save="rowSave"
      :before-open="beforeOpen"
@@ -31,6 +32,15 @@
          plain
          @click="handleDelete"
          >删 除
        </el-button>
        <el-button
          type="warning"
          size="small"
          plain
          icon="el-icon-download"
          v-if="permission.trainExam_performance_export"
          @click="handleExport"
          >保安员证信息导出
        </el-button>
        <!-- v-if="permission.notice_delete" -->
      </template>
@@ -70,16 +80,18 @@
  remove,
  update,
  add,
  getAccreditationRecords
} from "@/api/accreditationRecords/accreditationRecords";
import { getDept } from "@/api/system/dept";
import { mapGetters } from "vuex";
import { mapState } from "vuex";
import Qs from "qs";
export default {
  data() {
    return {
      form: {},
      query: {},
      questionBankSearch: {},
      loading: true,
      deptCategory: "",
      deptId: "",
@@ -105,7 +117,7 @@
        index: true,
        stripe: true,
        viewBtn: true,
        selection: true,
        // selection: true,
        excelBtn: false,
        addBtnText: "发布",
        addTitle: "发布",
@@ -114,13 +126,34 @@
        dialogClickModal: false,
        column: [
          {
            label: "通知时间",
            prop: "releaseTimeRange",
            type: "datetime",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchRange: true,
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            search: true,
            searchSpan:6,
            rules: [
              {
                required: true,
                message: "请输入通知时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "姓名",
            prop: "realName",
            search: true,
            searchSpan: 3,
            width:100,
            searchLabelWidth: 50,
            display: false,
            // display: false,
          },
          // {
          //   label: "所属保安公司",
@@ -153,7 +186,6 @@
              // },
              slot: true,
              searchSpan: 5,
              display: false,
              search: true,
              minWidth: 200
          },
@@ -170,12 +202,10 @@
            search: true,
            searchLabelWidth: 90,
            searchSpan: 5,
            display: false,
          },
          {
            label: "年龄",
            prop: "age",
            display: false,
          },
          {
            label: "保安证编号",
@@ -363,7 +393,7 @@
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getNotice(this.form.id).then((res) => {
        getAccreditationRecords(this.form.id).then((res) => {
          this.form = res.data.data;
        });
      }
@@ -391,21 +421,21 @@
          ? (that.deptCategory = true)
          : (that.deptCategory = false);
        // const { releaseTimeRange } = this.query;
        const { releaseTimeRange } = this.query;
        params["jurisdiction"] = this.jurisdiction;
        params["type"] = 1;
        let values = {
          ...params,
        };
        // if (releaseTimeRange) {
        //   values = {
        //     ...params,
        //     startTime: releaseTimeRange[0],
        //     endTime: releaseTimeRange[1],
        //     ...this.query,
        //   };
        //   values.releaseTimeRange = null;
        // }
        if (releaseTimeRange) {
          values = {
            ...params,
            startTime: releaseTimeRange[0],
            endTime: releaseTimeRange[1],
            ...this.query,
          };
          values.releaseTimeRange = null;
        }
        this.loading = true;
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data;
@@ -416,6 +446,46 @@
        });
      });
    },
    //保安员证信息导出
    handleExport() {
      this.$confirm("是否导出保安员证信息数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        //获取查询条件
        console.log(this.questionBankSearch, 456);
        const { releaseTimeRange } = this.questionBankSearch;
        if (releaseTimeRange) {
            this.questionBankSearch['startTime'] = releaseTimeRange[0];
            this.questionBankSearch['endTime'] = releaseTimeRange[1];
        }
        var data = {
          deptName: this.questionBankSearch.deptName,
          idCardNo: this.questionBankSearch.idCardNo,
          realName: this.questionBankSearch.realName,
          securityNumber: this.questionBankSearch.securityNumber,
          startTime: this.questionBankSearch.securityName,
          endTime: this.questionBankSearch.examName,
        };
        //导出
        if (
          this.userInfo.role_name == "保安公司管理员" ||
          this.userInfo.role_name == "保安"
        ) {
          //如果是保安公司管理员
          data["deptId"] = this.userInfo.dept_id;
        }
        if (this.userInfo.role_name == "培训公司管理员") {
          //如果是培训公司管理员
          data["trainUnitId"] = this.userInfo.dept_id;
        }
        data["examType"] = 2;
        //序列号url形式,用&拼接
        data = Qs.stringify(data);
        window.open(`/api/accreditationRecords/export-security-paper?` + data);
      });
    },
  },
};
</script>
src/views/securityGuard/securityGuard.vue
@@ -791,6 +791,13 @@
              {
                label: "联系地址",
                prop: "address",
                rules: [
                  {
                    required: true,
                    message: "请输入联系地址",
                    trigger: "click",
                  },
                ],
              },
              {
                label: "户口所在地",
src/views/trainExam/performance.vue
@@ -797,7 +797,7 @@
        type: "warning",
      }).then(() => {
        //获取查询条件
        console.log(this.questionBankSearch, 456);
        // console.log(this.questionBankSearch, 456);
        var data = {
          account: this.questionBankSearch.account,
          companyName: this.questionBankSearch.companyName,