recheck.vue 6.33 KB
Newer Older
xulili's avatar
xulili committed
1
<template>
xulili's avatar
xulili committed
2
  <!-- 账号禁用审核 -->
xulili's avatar
xulili committed
3
  <div class="recheck-wrapper height100">
xulili's avatar
xulili committed
4 5 6 7 8
    <div class="search-container">
      <el-form :inline="true" :model="form">
        <el-form-item>
          <el-input
            v-model="form.name"
qzhxx's avatar
qzhxx committed
9
            placeholder="请输入账号名称或提交人"
xulili's avatar
xulili committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
            suffix-icon="el-icon-search"
            clearable
          >
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-select
            v-model="form.status"
            placeholder="请选择账号状态"
            clearable
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <div class="btn-group">
            <el-button type="primary" @click="handleSubmit">查询</el-button>
            <el-button @click="handleReset">重置</el-button>
          </div>
        </el-form-item>
      </el-form>
      <div class="page-tip">
        <span class="page-tip-title">页面说明:</span>
        <span class="page-tips"
          >展示所有禁用账号的申请,审核通过后,该账号状态为禁用,无法在系统中使用</span
        >
xulili's avatar
xulili committed
41
      </div>
xulili's avatar
xulili committed
42 43 44 45 46 47 48
    </div>
    <div class="table-content">
      <check-table
        class="noAdd"
        :feildList="feildList"
        :list="list"
        @action="handleAction"
xulili's avatar
xulili committed
49
        :currentPage="page._index"
xulili's avatar
xulili committed
50 51 52 53
      />
      <party-pagination :page="page" @changePage="handleChangeCurrent" />
    </div>
    <reject-dialog ref="rejectDialog" @success="getPageList()" />
xulili's avatar
xulili committed
54 55 56
  </div>
</template>
<script>
xulili's avatar
xulili committed
57 58 59
import { partyPagination } from "@/components/index";
import checkTable from "./components/checkTable";
import { rejectDialog } from "./checkDialog/index";
60
import { loginOut } from "@/config/loginOut";
xulili's avatar
xulili committed
61
export default {
xulili's avatar
xulili committed
62 63 64 65 66 67 68 69 70 71
  data() {
    return {
      form: {
        name: "",
        status: "",
      },
      options: [
        { label: "待初审", value: "TBC" },
        { label: "驳回", value: "REFUSED" },
        { label: "待复审", value: "TBCA" },
xulili's avatar
xulili committed
72
        { label: "通过", value: "APPROVED_FINAL" },
xulili's avatar
xulili committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
      ],
      feildList: [
        { prop: "content", label: "账号名称" },
        { prop: "orgName", label: "所在机构" },
        { prop: "userName", label: "提交人" },
        { prop: "createTime", label: "提交日期" },
        { prop: "status", label: "审核状态" },
        { prop: "", label: "操作", isEdit: true, width: 240 },
      ],
      list: [],
      activeRow: {},
      page: {
        _index: 1,
        _size: 10,
        total: 0,
      },
xulili's avatar
xulili committed
89 90
      type: "ACCOUNT",
      passStatus: "APPROVED_FINAL",
xulili's avatar
xulili committed
91
      //待初审 TBC, 驳回 REFUSED, 待复审 TBCA, 通过APPROVED_FINAL
xulili's avatar
xulili committed
92 93 94 95 96 97 98 99 100 101
    };
  },
  components: { partyPagination, checkTable, rejectDialog },
  mounted() {
    this.getFirstPageList();
  },
  methods: {
    // 查询数据
    handleSubmit() {
      this.getPageList();
xulili's avatar
xulili committed
102
    },
xulili's avatar
xulili committed
103 104 105
    handleReset() {
      this.form.name = "";
      this.form.status = "";
xulili's avatar
xulili committed
106
      this.getFirstPageList();
xulili's avatar
xulili committed
107 108
    },

xulili's avatar
xulili committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
    // 获取第一页数据列表
    getFirstPageList() {
      this.page._index = 1;
      this.getPageList();
    },
    getPageList() {
      let requestParams = {};
      requestParams._index = this.page._index;
      requestParams._size = this.page._size;
      requestParams.name = this.form.name;
      requestParams.status = this.form.status;
      this.$https(
        {
          method: "get",
          url: "audit/getUserList",
          authType: this.backToken,
xulili's avatar
xulili committed
125
        },
xulili's avatar
xulili committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
        requestParams
      )
        .then((res) => {
          if (res.status != 200) {
            this.getResWithOutData();
          } else {
            if (res.data.resultCode == 200) {
              this.list = res.data.data.records;
              this.page._size = res.data.data.size;
              this.page.total = res.data.data.total;
            } else {
              this.getResWithOutData();
            }
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 页面返回值为空
    getResWithOutData() {
      this.list = [];
      this.page = {
        _index: 1,
        _size: 10,
        total: 0,
      };
    },
    handleAction(params) {
      this.activeRow = params.row;
      switch (params.type) {
        case "reject":
          this.handleRject();
          break;
        case "pass":
          this.handlePass();
          break;
        default:
          break;
      }
    },
    // 驳回
    handleRject() {
xulili's avatar
xulili committed
169
      this.$refs.rejectDialog.activeRow = this.activeRow;
xulili's avatar
xulili committed
170 171 172 173 174
      this.$refs.rejectDialog.dialogVisible = true;
    },
    // 通过
    handlePass() {
      let params = {};
xulili's avatar
xulili committed
175
      let _this = this;
xulili's avatar
xulili committed
176
      params.id = this.activeRow.id;
xulili's avatar
xulili committed
177
      params.status = this.passStatus;
xulili's avatar
xulili committed
178 179 180
      params.type = this.type;
      params.refItemId = this.activeRow.refItemId;
      params.level = this.activeRow.status;
xulili's avatar
xulili committed
181

xulili's avatar
xulili committed
182 183 184 185 186
      this.$https(
        {
          method: "put",
          url: "audit/update",
          authType: this.backToken,
xulili's avatar
xulili committed
187
        },
xulili's avatar
xulili committed
188 189 190 191 192 193 194 195 196
        params
      )
        .then((res) => {
          if (res.status == 200) {
            if (res.data.resultCode == 200) {
              this.$message({
                type: "success",
                message: res.data.message,
              });
197 198 199 200 201 202 203 204 205 206
               debugger;
              if (_this.activeRow.status === "TBCA") {
                _this.$message({
                  message: "5s之后该账号退出登录",
                  type: "warning",
                });
                setTimeout(() => {
                  _this.logoutUser(params.refItemId);
                }, 5000);
              }
xulili's avatar
xulili committed
207
              this.getPageList();
208
             
xulili's avatar
xulili committed
209 210 211 212 213 214 215 216 217 218 219
            } else {
              this.$message.error(res.data.message);
            }
          } else {
            this.$message.error(res.data);
          }
        })
        .catch((err) => {
          console.log(res);
        });
    },
220 221 222 223 224 225 226 227 228
    // 复审通过之后 调用退出
    logoutUser(id) {
      let _this = this;
      _this.$https({
        method: "get",
        url: `logoutUser?id=${id}`,
        authType: this.backToken,
      });
    },
xulili's avatar
xulili committed
229
    // 翻页
xulili's avatar
xulili committed
230
    handleChangeCurrent(val) {
xulili's avatar
xulili committed
231 232 233 234 235
      this.page._index = val;
      this.getPageList();
    },
  },
};
xulili's avatar
xulili committed
236 237 238
</script>
<style lang="less" scoped>
</style>