Administrator
2022-04-11 79d9fc857559982b00b68b2d709807bdc4cd286f
src/views/accreditationRecords/accreditationRecordsPaper.vue
@@ -2,10 +2,12 @@
  <basic-container
    :class="[
      'desk1',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch' : '',
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
    ]"
  >
    <avue-crud
      class="tablesss"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -27,6 +29,20 @@
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot-scope="{ row }" slot="auditStatus">
        <el-tag class="dtype">
          {{
            row.auditStatus == 1
              ? "待审核"
              : row.auditStatus == 2
              ? "审核通过"
              : "审核不通过"
          }}
          <i class="zc" v-if="row.auditStatus == 2"></i>
          <i class="yj" v-if="row.auditStatus == 3"></i>
          <i class="gz" v-if="row.auditStatus == 1"></i>
        </el-tag>
      </template>
      <template slot="menuLeft">
        <el-button
          style="display: none"
@@ -65,13 +81,17 @@
          @click="handleSecurityAudit"
          >批量审批
        </el-button>
        <!--图例 components-->
        <span>
          <Legend :datas="datalistLIU"></Legend>
        </span>
      </template>
      <template slot-scope="{ row }" slot="category">
        <el-tag>{{ row.categoryName }}</el-tag>
      </template>
      <template slot-scope="{ row }" slot="userType">
      <!-- <template slot-scope="{ row }" slot="userType">
        {{ row.userType == 6 ? "已制证" : row.userType == 7 ? "未制证" : "" }}
      </template>
      </template> -->
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          style="display: none"
@@ -197,7 +217,7 @@
  add,
  getAccreditationRecords,
  audit,
  batchAudit,
  batchAudit
} from "@/api/accreditationRecords/accreditationRecords";
import { updatePaperTime } from "@/api/system/user";
import { getDept } from "@/api/system/dept";
@@ -205,7 +225,11 @@
import { mapState } from "vuex";
import Qs from "qs";
import { getToken } from "@/util/auth";
import Legend from "@/components/liu-legend/Legend";
export default {
  components: {
    Legend
  },
  data() {
    return {
      check: false,
@@ -216,9 +240,22 @@
        realName: "",
        securityNumber: "",
        idCardNo: "",
        registered: "",
        registered: ""
      },
      datalistLIU: [
        {
          color: "#29C093",
          text: "审核通过"
        },
        {
          color: "#F34A4A",
          text: "审核不通过"
        },
        {
          color: "#F48F57",
          text: "待审核"
        }
      ],
      Audit: {},
      dialogFormVisible: false,
      dialogBatchAudit: false,
@@ -255,34 +292,34 @@
              {
                required: true,
                message: "请选择审核类型",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            dicData: [
              {
                label: "待审核",
                value: 1,
                value: 1
              },
              {
                label: "审核通过",
                value: 2,
                value: 2
              },
              {
                label: "审核不通过",
                value: 3,
              },
            ],
                value: 3
              }
            ]
          },
          {
            label: "审核明细",
            span: 24,
            type: "textarea",
            prop: "auditDetail",
          },
        ],
            prop: "auditDetail"
          }
        ]
      },
      batchAudit: {
        number: 0,
        number: 0
      },
      optionBatchAudit: {
        height: "auto",
@@ -308,7 +345,7 @@
            span: 24,
            value: 0,
            disabled: true,
            labelWidth: 110,
            labelWidth: 110
          },
          {
            label: "审核状态",
@@ -324,31 +361,31 @@
              {
                required: true,
                message: "请选择审核类型",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            dicData: [
              {
                label: "待审核",
                value: 1,
                value: 1
              },
              {
                label: "审核通过",
                value: 2,
                value: 2
              },
              {
                label: "审核不通过",
                value: 3,
              },
            ],
                value: 3
              }
            ]
          },
          {
            label: "审核明细",
            span: 24,
            type: "textarea",
            prop: "auditDetail",
          },
        ],
            prop: "auditDetail"
          }
        ]
      },
      choiceList: [],
      form: {},
@@ -365,7 +402,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      selectionList: [],
      option: {
@@ -377,6 +414,7 @@
        searchMenuSpan: 6,
        selection: true,
        reserveSelection: true,
        align: "center",
        tip: true,
        border: true,
        index: true,
@@ -390,6 +428,7 @@
        menuWidth: 180,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        searchIndex: 5, //收缩展示数量
        column: [
          {
            label: "申请时间",
@@ -408,9 +447,9 @@
              {
                required: true,
                message: "请输入申请时间",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "姓名",
@@ -418,7 +457,7 @@
            search: true,
            searchSpan: 3,
            width: 90,
            searchLabelWidth: 50,
            searchLabelWidth: 50
            // display: false,
          },
          // {
@@ -442,7 +481,6 @@
          // },
          {
            label: "企业名称",
            searchLabelWidth: "110",
            prop: "deptName",
            // type: "tree",
            // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
@@ -454,14 +492,14 @@
            searchSpan: 5,
            search: true,
            overHidden: true,
            minWidth: 200,
            minWidth: 200
          },
          {
            label: "性别",
            prop: "sex",
            width: 60,
            type: "select",
            display: false,
            display: false
          },
          {
            label: "身份证号码",
@@ -469,18 +507,19 @@
            search: true,
            searchLabelWidth: 90,
            minWidth: 110,
            searchSpan: 4,
            searchSpan: 5
          },
          {
            label: "年龄",
            prop: "age",
            width: 50,
            width: 50
          },
          {
            label: "照片",
            prop: "avatar",
            type: "upload",
            listType: "picture-img",
            width: 60
          },
          {
            label: "保安证编号",
@@ -488,9 +527,9 @@
            search: true,
            searchLabelWidth: 90,
            minWidth: 90,
            searchSpan: 3,
            searchSpan: 4,
            addDisplay: false,
            editDisplay: false,
            editDisplay: false
            // hide: true,
          },
          {
@@ -501,7 +540,7 @@
            width: 80,
            // searchSpan: 4,
            addDisplay: false,
            editDisplay: false,
            editDisplay: false
            // hide: true,
          },
          {
@@ -509,10 +548,10 @@
            prop: "applyUnit",
            search: true,
            searchLabelWidth: 120,
            minWidth: 105,
            searchSpan: 4,
            minWidth: 160,
            searchSpan: 5,
            addDisplay: false,
            editDisplay: false,
            editDisplay: false
            // hide: true,
          },
          {
@@ -523,7 +562,7 @@
            minWidth: 105,
            // searchSpan: 4,
            addDisplay: false,
            editDisplay: false,
            editDisplay: false
            // hide: true,
          },
          {
@@ -532,8 +571,8 @@
            type: "select",
            search: true,
            searchLabelWidth: 90,
            width: 90,
            searchSpan: 3,
            width: 110,
            searchSpan: 4,
            addDisplay: false,
            editDisplay: false,
            hide: false,
@@ -541,17 +580,17 @@
            dicData: [
              {
                label: "待审核",
                value: 1,
                value: 1
              },
              {
                label: "审核通过",
                value: 2,
                value: 2
              },
              {
                label: "审核不通过",
                value: 3,
              },
            ],
                value: 3
              }
            ]
          },
          {
            label: "审核明细",
@@ -560,28 +599,32 @@
            addDisplay: false,
            editDisplay: false,
            hide: false,
            display: false,
            display: false
          },
          {
            label: "是否制证",
            prop: "userType",
            prop: "status",
            type: "select",
            slot: true,
            search: true,
            editDisplay: false,
            addDisplay: false,
            searchSpan: 3,
            searchSpan: 4,
            width: 69,
            dicData: [
              {
                label: "全部",
                value: 3
              },
              {
                label: "已制证",
                value: 6,
                value: 2
              },
              {
                label: "未制证",
                value: 7,
              },
            ],
                value: 1
              }
            ]
          },
          {
            label: "有无照片",
@@ -590,7 +633,7 @@
            search: true,
            searchLabelWidth: 90,
            minWidth: 105,
            searchSpan: 3,
            searchSpan: 4,
            addDisplay: false,
            editDisplay: false,
            hide: true,
@@ -598,21 +641,21 @@
            dicData: [
              {
                label: "全部",
                value: 3,
                value: 3
              },
              {
                label: "有",
                value: 1,
                value: 1
              },
              {
                label: "无",
                value: 2,
              },
            ],
          },
        ],
                value: 2
              }
            ]
          }
        ]
      },
      data: [],
      data: []
    };
  },
  computed: {
@@ -625,29 +668,30 @@
          false
        ),
        delBtn: this.vaildData(null, false),
        editBtn: this.vaildData(null, false),
        editBtn: this.vaildData(null, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
      userInfo: state => state.user.userInfo
    })
  },
  mounted() {
    this.getDeptInfo(this.userInfo.dept_id);
    this.$store.commit("setWindowSizeHeightAdd");
    // if (this.userInfo.roleName == "办证管理员") {
    //   this.search["userType"] = 7;
    // }
  },
  created() {
    if (this.userInfo.role_name == "办证管理员") {
      this.questionBankSearch["userType"] = 7;
      this.questionBankSearch["status"] = 1;
      this.questionBankSearch["auditStatus"] = 2;
    }
    if (this.userInfo.role_name == "公安管理员") {
@@ -665,7 +709,7 @@
    //获取当前用户部门信息
    getDeptInfo(deptId) {
      var that = this;
      getDept(deptId).then((res) => {
      getDept(deptId).then(res => {
        var deptCategory = res.data.data.deptCategory;
        deptCategory == 1
          ? (that.deptCategory = true)
@@ -678,8 +722,8 @@
        path: `/resource/uploadNotice`,
        query: {
          deptId: row.deptId,
          noticeId: row.id,
        },
          noticeId: row.id
        }
      });
    },
    rowSave(row, done, loading) {
@@ -695,11 +739,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -743,7 +787,7 @@
        onEnd: () => {
          this.updateUserInfo();
          // console.log('打印完成', Date.parse(new Date()));
        },
        }
      });
    },
    getNewTime() {
@@ -779,7 +823,7 @@
      const data = {
        id: this.certificateObj.userId,
        userType: 6,
        paperTime: date,
        paperTime: date
      };
      updatePaperTime(data);
      this.onLoad(this.page);
@@ -797,9 +841,10 @@
      }
      const data = {
        ids: str,
        type: 2,
        auditStatus: row.auditStatus,
        auditDetail: row.auditDetail,
        auditUser: this.userInfo.Id,
        auditUser: this.userInfo.Id
      };
      //提交申请
      batchAudit(data).then(
@@ -809,13 +854,13 @@
          that.dialogBatchAudit = false;
          this.$message({
            type: "success",
            message: "操作成功",
            message: "操作成功"
          });
          //清除选项
          that.$refs.crud.toggleSelection();
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -833,11 +878,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -848,7 +893,7 @@
      if (this.choiceList.length == 0) {
        this.$message({
          message: "未选择保安员",
          type: "warning",
          type: "warning"
        });
        return;
      }
@@ -859,7 +904,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
@@ -868,7 +913,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -885,9 +930,10 @@
    submit(row, done, loading) {
      const data = {
        id: row.id,
        type: 2,
        auditStatus: row.auditStatus,
        auditDetail: row.auditDetail,
        auditUser: this.userInfo.Id,
        auditUser: this.userInfo.Id
      };
      audit(data).then(
@@ -896,11 +942,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -917,7 +963,7 @@
      this.choiceList = [];
      for (let k in list) {
        this.choiceList.push({
          id: list[k].id,
          id: list[k].id
        });
      }
    },
@@ -934,7 +980,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
@@ -943,14 +989,14 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getAccreditationRecords(this.form.id).then((res) => {
        getAccreditationRecords(this.form.id).then(res => {
          this.form = res.data.data;
        });
      }
@@ -982,28 +1028,29 @@
        //如果是培训公司管理员
        params["createUser"] = this.userInfo.Id;
      }
      if (this.userInfo.role_name == "公安管理员") {
      if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警") {
        //如果是公安管理员
        params["jurisdiction"] = this.userInfo.jurisdiction;
      }
      let values = {
        ...params,
        ...params
      };
      if (releaseTimeRange) {
        values = {
          ...params,
          startTime: releaseTimeRange[0],
          endTime: releaseTimeRange[1],
          ...this.query,
          ...this.query
        };
        values.releaseTimeRange = null;
      }
      this.loading = true;
      getList(page.currentPage, page.pageSize, values).then((res) => {
      getList(page.currentPage, page.pageSize, values).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.$store.commit("setWindowSizeHeightAdd");
        this.selectionClear();
      });
    },
@@ -1012,7 +1059,7 @@
      this.$confirm("是否导出证书制证信息数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      }).then(() => {
        //获取查询条件
        const { releaseTimeRange } = this.questionBankSearch;
@@ -1022,7 +1069,7 @@
        }
        var data = {
          type: 2,
          userType: this.questionBankSearch.userType,
          status: this.questionBankSearch.status,
          applyUnit: this.questionBankSearch.applyUnit,
          auditStatus: this.questionBankSearch.auditStatus,
          deptName: this.questionBankSearch.deptName,
@@ -1031,7 +1078,7 @@
          securityNumber: this.questionBankSearch.securityNumber,
          startTime: this.questionBankSearch.startTime,
          endTime: this.questionBankSearch.endTime,
          isAvatar: this.questionBankSearch.isAvatar,
          isAvatar: this.questionBankSearch.isAvatar
        };
        // data['Blade-Auth'] = getToken;
        //导出
@@ -1043,7 +1090,7 @@
          //如果是培训公司管理员
          data["createUser"] = this.userInfo.Id;
        }
        if (this.userInfo.role_name == "公安管理员") {
        if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警") {
          //如果是公安管理员
          data["jurisdiction"] = this.userInfo.jurisdiction;
        }
@@ -1061,7 +1108,7 @@
      this.$confirm("是否导出证书打印信息数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      }).then(() => {
        //获取查询条件
        const { releaseTimeRange } = this.questionBankSearch;
@@ -1071,7 +1118,7 @@
        }
        var data = {
          type: 2,
          userType: this.questionBankSearch.userType,
          status: this.questionBankSearch.status,
          applyUnit: this.questionBankSearch.applyUnit,
          auditStatus: this.questionBankSearch.auditStatus,
          deptName: this.questionBankSearch.deptName,
@@ -1080,7 +1127,7 @@
          securityNumber: this.questionBankSearch.securityNumber,
          startTime: this.questionBankSearch.startTime,
          endTime: this.questionBankSearch.endTime,
          isAvatar: this.questionBankSearch.isAvatar,
          isAvatar: this.questionBankSearch.isAvatar
        };
        //导出
        if (this.userInfo.role_name == "保安公司管理员") {
@@ -1091,7 +1138,7 @@
          //如果是培训公司管理员
          data["createUser"] = this.userInfo.Id;
        }
        if (this.userInfo.role_name == "公安管理员") {
        if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警") {
          //如果是公安管理员
          data["jurisdiction"] = this.userInfo.jurisdiction;
        }
@@ -1103,8 +1150,8 @@
          }=${getToken()}&` + data
        );
      });
    },
  },
    }
  }
};
</script>
@@ -1315,4 +1362,50 @@
  line-height: 40px;
  letter-spacing: 2px;
}
.dtype {
  width: 100%;
  padding-left: 0px;
}
.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: 4px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
</style>