123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- <!--黑名单-->
- <template>
- <div class="app-container blacklist">
- <div class="blacklist-page" v-if="pageType == 1">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item label="学院" prop="deptId" style="margin-left:-30px;">
- <el-select v-model="queryParams.deptId" placeholder="请选择学院" clearable size="small">
- <el-option
- v-for="dict in deptOptions"
- :key="dict.deptId"
- :label="dict.deptName"
- :value="dict.deptId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="关键字" prop="searchValue">
- <el-input
- v-model="queryParams.searchValue"
- placeholder="请输入姓名/学号"
- clearable
- size="small"
- />
- </el-form-item>
- <el-form-item>
- <p class="inquire-button-one" @click="handleQuery">查询</p>
- <p class="reset-button-one" @click="resetQuery">重置</p>
- </el-form-item>
- </el-form>
- <el-table v-loading="loading" border :data="blacklistList" @sort-change="handleSelectionChange">
- <el-table-column label="姓名" align="left" prop="userName" />
- <el-table-column label="学号" align="left" prop="number" />
- <el-table-column label="学院" align="left" prop="deptName" />
- <el-table-column label="违规次数" align="left" sortable="custom" prop="total" />
- <el-table-column label="负面清单次数" align="left" sortable="custom" prop="negativeNum" />
- <el-table-column label="黑名单次数" align="left" sortable="custom" prop="blackNum" />
- <el-table-column label="信用分" align="left" prop="creditScore" />
- <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="230" v-if="tableButtonType">
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p"
- @click="goPage(2,scope.row)"
- v-hasPermi="['laboratory:blackdetail:list']"
- >历史记录</p>
- <p class="table-button-p"
- v-if="scope.row.blacklistStatus == 1"
- @click="handleDelete(scope.row)"
- v-hasPermi="['laboratory:blacklist:remove']"
- >移除黑名单</p>
- <p class="table-button-null"></p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- layout="total, prev, pager, next, sizes, jumper"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- <black-list-info v-if="pageType == 2" :propsData="propsData"></black-list-info>
- <!-- 移除黑名单 -->
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
- <el-form ref="form" :model="form" :rules="rules" label-width="90px">
- <el-form-item label="姓名:">
- <el-input v-model="form.userName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="学号:">
- <el-input v-model="form.number" :disabled="true" placeholder="请输入学号" />
- </el-form-item>
- <el-form-item label="学院:">
- <el-input v-model="form.deptName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="原因:" prop="reason">
- <el-input
- type="textarea"
- :autosize="{ minRows: 6, maxRows: 6}"
- placeholder="请输入原因"
- resize="none"
- v-model="form.reason">
- </el-input>
- </el-form-item>
- <el-form-item label="">
- <p style="font-size:14px;color:#999;margin:0;">提交后,该人员信用分自动恢复到合格分。</p>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancel">取 消</el-button>
- <el-button type="primary" @click="submitForm">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listBlacklist, getBlacklist, delBlacklist, addBlacklist, updateBlacklist, removeBlacklist } from "@/api/laboratory/blacklist";
- import { selectListUser } from "@/api/system/user";
- import { listDepartments,listbuildings } from "@/api/system/dept";
- import blackListInfo from "./blackListInfo.vue";
- export default {
- name: "Blacklist",
- components: {
- blackListInfo,
- },
- data() {
- return {
- tableButtonType:this.hasPermiDom(['laboratory:blackdetail:list','laboratory:blacklist:remove']),
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 黑名单表格数据
- blacklistList: [
- {
- id:"id",
- joinUserId:"joinUserId",
- blacklistStatus:"blacklistStatus",
- deptId:"deptId",
- },
- ],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize:20,
- searchValue: null,
- joinUserId: null,
- blacklistStatus: null,
- deptId: null,
- deptName: null,
- userId: null,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- reason:[
- {required: true, message: '请输入原因', trigger: 'blur'},
- { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
- ],
- },
- //新增-编辑状态
- disabledType:true,
- //人员
- optionsUser: [],
- //处置方案
- optionsTwo: [],
- // 日期范围
- dateRange: [],
- deptOptions:[],
- //页面状态
- pageType:1,
- propsData:{},
- };
- },
- created() {
- this.getList();
- this.getDicts("penaltyType").then(response => {
- this.optionsTwo = response.data;
- });
- },
- mounted(){
- this.getDeptList();
- },
- methods: {
- goPage(type,row){
- if(this.pageType!=type){
- if(type == 1){
- this.pageType = type;
- this.getList();
- }else if(type == 2){
- this.propsData.userId = row.id
- this.pageType = type;
- }
- }
- },
- /** 查询黑名单列表 */
- getList() {
- this.loading = true;
- if(this.dateRange&&this.dateRange.length>0)
- {
- this.queryParams.startTime=this.dateRange[0]
- this.queryParams.endTime=this.dateRange[1]
- }
- else
- {
- this.queryParams.startTime=null;
- this.queryParams.endTime=null
- }
- listBlacklist(this.queryParams).then(response => {
- this.blacklistList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- /** 查询学院列表 */
- getDeptList()
- {
- listDepartments().then(response => {
- // this.deptOptions = response.data;
- this.$set(this, 'deptOptions', response.data)
- });
- },
- // 处置类型字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.optionsTwo, row.penaltyType);
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- joinUserId: null,
- blacklistStatus: 0,
- deptId: null,
- deptName: null,
- userId: null,
- remark: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- // this.resetForm("queryForm");
- this.$set(this,'queryParams',{
- pageNum: 1,
- pageSize:20,
- deptId:"",
- searchValue: '',
- });
- this.dateRange = null;
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(type) {
- if(type.order == 'ascending'){
- this.queryParams.order = type.prop;//降
- this.queryParams.orderType = 'asc';//升ascending
- }else if(type.order == 'descending'){
- this.queryParams.order = type.prop;//降
- this.queryParams.orderType = 'desc';//降
- }else{
- this.queryParams.order = null;//无
- this.queryParams.orderType = null;//无
- }
- this.getList();
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.disabledType = false;
- this.open = true;
- this.title = "添加黑名单";
- },
- /** 修改按钮操作 */
- // handleUpdate(row) {
- // this.reset();
- // const id = row.id || this.ids.join()
- // getBlacklist(id).then(response => {
- // this.form = response.data;
- // this.disabledType = true;
- // this.open = true;
- // this.title = "修改黑名单";
- // });
- // },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- removeBlacklist(this.form).then(response => {
- this.msgSuccess("操作成功");
- this.open = false;
- this.getList();
- });
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- this.$set(this,'form',row);
- this.title = "移除黑名单";
- this.open = true;
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download('laboratory/blacklist/export', {
- ...this.queryParams
- }, `laboratory_blacklist.xlsx`)
- },
- /** 下列人员-懒加载 */
- userSelectList(query) {
- if (query !== '' && query.length>1) {
- this.loading = true;
- this.userSelectList.nickName=query;
- selectListUser(this.userSelectList).then(response => {
- this.optionsUser = response.data;
- this.loading = false;
- });
- } else {
- this.optionsUser = [];
- }
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .blacklist {
- display: flex!important;
- flex-direction: column;
- box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
- padding:20px!important;
- overflow: hidden;
- .blacklist-page{
- flex:1;
- display: flex!important;
- flex-direction: column;
- overflow: hidden;
- .button-box{
- display: flex;
- width:250px;
- margin:0 auto;
- }
- }
- }
- </style>
|