1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036 |
- <!--违规记录管理-->
- <template>
- <div class="app-container violation">
- <div class="violationPage" v-if="pageType==1">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" class="form-box" v-if="pageType==1">
- <el-form-item label="关键字" prop="searchValue" label-width="60px">
- <el-input
- v-model="queryParams.searchValue"
- placeholder="姓名/学号"
- clearable
- size="small"
- />
- </el-form-item>
- <el-form-item label="学院" prop="deptId" label-width="80px">
- <el-select v-model="queryParams.deptId" clearable placeholder="请选择学院">
- <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="status" label-width="50px">
- <el-select v-model="queryParams.status" placeholder="请选择状态">
- <el-option
- v-for="dict in deptOptionsTwo"
- :key="dict.deptId"
- :label="dict.deptName"
- :value="dict.deptId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item style="float: right;">
- <el-col :span="1.5">
- <p class="add-button-one-150"
- @click="handleAdd()"
- v-hasPermi="['laboratory:violation:add']"
- ><i class="el-icon-plus"></i>新增违规记录</p>
- </el-col>
- </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="violationList" @sort-change="handleSelectionChange" v-if="pageType==1">
- <el-table-column label="姓名" align="left" prop="userName" />
- <el-table-column label="学号" align="left" prop="stuNo" />
- <el-table-column label="学院" align="left" prop="deptName" />
- <el-table-column label="违规次数" align="left" sortable="custom" prop="violationNum" />
- <el-table-column label="负面清单次数" align="left" sortable="custom" prop="negativeListNum" />
- <el-table-column label="黑名单次数" align="left" sortable="custom" prop="blackListNum" />
- <el-table-column label="信用分" align="left" prop="creditScore" />
- <el-table-column label="当前状态" align="left" prop="status">
- <template slot-scope="scope">
- {{scope.row.status == 1?'正常':(scope.row.status == 2?'负面清单':(scope.row.status == 3?'黑名单':''))}}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="200" 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:violationHistoryRecord:list']"
- >历史记录</p>
- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
- v-hasPermi="['laboratory:blacklist:remove','laboratory:blacklist:add','laboratory:negativeListRecords:remove']">
- <p class="table-button-p">更多>></p>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="1" v-show="scope.row.isBlackList == 1"
- v-hasPermi="['laboratory:blacklist:remove']">移除黑名单</el-dropdown-item>
- <el-dropdown-item command="2" v-show="scope.row.isBlackList != 1"
- v-hasPermi="['laboratory:blacklist:add']">加入黑名单</el-dropdown-item>
- <el-dropdown-item command="3" v-show="scope.row.isNegative == 1"
- v-hasPermi="['laboratory:negativeListRecords:remove']">移除负面清单</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <p class="table-button-null"></p>
- <!--<p class="table-button-warning-120"-->
- <!--v-if="scope.row.isBlackList == 1"-->
- <!--style="margin-right:10px;"-->
- <!--@click="blacklistClick(scope.row)"-->
- <!--v-hasPermi="['laboratory:blacklist:remove']"-->
- <!-->移除黑名单</p>-->
- <!--<p class="table-button-warning-120"-->
- <!--v-if="scope.row.isBlackList != 1"-->
- <!--style="margin-right:10px;"-->
- <!--@click="blacklistClick(scope.row)"-->
- <!--v-hasPermi="['laboratory:blacklist:add']"-->
- <!-->加入黑名单</p>-->
- <!--<p v-if="scope.row.isNegative == 1"-->
- <!--class="table-button-success-120"-->
- <!--@click="checklistClick(scope.row)"-->
- <!--v-hasPermi="['laboratory:negativeListRecords:remove']"-->
- <!-->移除负面清单</p>-->
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-if="pageType==1"
- v-show="total>0"
- :total="total"
- layout="total, prev, pager, next, sizes, jumper"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- <!-- 新增违规 -->
- <el-dialog :title="title" :visible.sync="open" width="720px" append-to-body>
- <el-form ref="form" :model="form" :rules="addRules" label-width="120px">
- <el-form-item label="姓名:" prop="userId">
- <el-select
- style="width:480px;"
- @change="userChange"
- v-model="form.userId"
- filterable
- remote
- placeholder="请输入至少2个字符"
- :remote-method="userSelectList"
- :loading="loading">
- <el-option
- v-for="item in optionsUser"
- :key="item.userId"
- :label="item.nickName"
- :value="item.userId">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="学号:" style="width:600px;">
- <el-input v-model="form.stuNo" :disabled="true" placeholder="请选择学员"/>
- </el-form-item>
- <el-form-item label="学院:" style="width:600px;">
- <el-input v-model="form.deptName" :disabled="true" placeholder="请选择学员" />
- </el-form-item>
- <el-form-item label="实验室" prop="laboratoryId">
- <el-select v-model="form.laboratoryId" style="width:480px;" placeholder="请选择实验室"
- @change="subjectChange">
- <el-option
- v-for="item in subjectOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="选择违规项" prop="reason">
- <el-select v-model="form.reason" style="width:480px;" placeholder="请选择违规项">
- <el-option
- v-for="item in violationSiteTypeList"
- :key="item.id"
- :label="item.violationName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="违规原因:" prop="violationReasons" style="width:600px;" v-if="form.reason==-1">
- <el-input
- v-model="form.violationReasons"
- placeholder="请输入违规原因"
- maxLength="50"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="扣除信用分值:" prop="deductionVal" style="width:600px;" v-if="form.reason==-1">
- <el-input
- v-model="form.deductionVal"
- placeholder="请输入"
- maxLength="5"
- @input="getIntegralMatchingRules">
- </el-input>
- </el-form-item>
- <el-form-item label="处理方式" prop="checkListTwo">
- <el-form-item label="">
- <el-checkbox-group v-model="form.checkList" style="display: inline-block;width:220px;">
- <el-checkbox label="warningStatus">警告<span style="color:#999;">(系统推送警告消息)</span></el-checkbox>
- </el-checkbox-group>
- <el-checkbox-group v-model="form.checkList" style="display: inline-block;width:160px;">
- <el-checkbox label="interviewStatus">约谈<span style="color:#999;">(线下约谈)</span></el-checkbox>
- </el-checkbox-group>
- <el-checkbox-group v-model="form.checkListTwo" style="display: inline-block;width:100px;">
- <el-checkbox label="testStatus">考试</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <div>
- <div style="width:480px;margin-right:20px;display: flex;">
- <el-checkbox-group v-model="form.checkListTwo" @change="(data)=>checkClickOne(data,'xx')" style="height:40px;line-height:40px;width:80px;">
- <el-checkbox label="learnStatus">学习</el-checkbox>
- </el-checkbox-group>
- <p v-if="form.learnStatusType" style="margin:0;line-height:40px;">学习时长:</p>
- <el-form-item label="" prop="learnHour" v-if="form.learnStatusType" style="margin-bottom:20px;">
- <el-input
- style="width:150px;"
- v-model="form.learnHour"
- placeholder="请输入"
- maxLength="5"
- clearable
- size="small">
- <template slot="append">时</template>
- </el-input>
- </el-form-item>
- <p style="width:30px;"></p>
- <el-form-item label="" prop="learnMinute" v-if="form.learnStatusType" style="margin-bottom:20px;">
- <el-input
- style="width:150px;"
- v-model="form.learnMinute"
- placeholder="请输入"
- maxLength="5"
- clearable
- size="small">
- <template slot="append">分</template>
- </el-input>
- </el-form-item>
- </div>
- <div class="for-check-box" style="display: flex;">
- <el-checkbox-group v-model="form.checkListTwo" @change="(data)=>checkClickTwo(data,'zt')" style="height:40px;line-height:40px;width:80px;">
- <el-checkbox label="practiceStatus">做题</el-checkbox>
- </el-checkbox-group>
- <p v-if="form.practiceStatusType" style="margin:0;line-height:40px;">题目数量:</p>
- <el-form-item label="" prop="numberTopics" v-if="form.practiceStatusType" style="margin-bottom:20px;">
- <el-input
- style="width:150px;"
- v-model="form.numberTopics"
- placeholder="请输入"
- maxLength="5"
- clearable
- size="small">
- <template slot="append">道</template>
- </el-input>
- </el-form-item>
- <p style="width:87px;text-align: right;margin:0;line-height:40px;" v-if="form.practiceStatusType">正确率:</p>
- <el-form-item label="" prop="numberAccuracy" v-if="form.practiceStatusType" style="margin-bottom:20px;">
- <el-input
- style="width:150px;"
- v-model="form.numberAccuracy"
- placeholder="请输入"
- maxLength="5"
- clearable
- size="small">
- <template slot="append">%</template>
- </el-input>
- </el-form-item>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="处理天数时限" prop="handleDay" style="margin-bottom:0;">
- <el-input
- v-model="form.handleDay"
- placeholder="请输入"
- maxLength="5"
- clearable
- style="width:200px;">
- <template slot="append">天</template>
- </el-input>
- </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>
- <!-- 移除黑名单 -->
- <el-dialog :title="title" :visible.sync="form1Open" width="500px" append-to-body>
- <el-form ref="form1" :model="form1" :rules="rules1" label-width="90px">
- <el-form-item label="姓名:">
- <el-input v-model="form1.userName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="学号:">
- <el-input v-model="form1.stuNo" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="学院:">
- <el-input v-model="form1.deptName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="原因:" prop="reason">
- <el-input
- type="textarea"
- :autosize="{ minRows: 6, maxRows: 6}"
- placeholder="请输入原因"
- maxLength="50"
- resize="none"
- v-model="form1.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="form1Off">取 消</el-button>
- <el-button type="primary" @click="submitForm1">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 加入黑名单 -->
- <el-dialog :title="title" :visible.sync="form2Open" width="720px" append-to-body>
- <el-form ref="form2" :model="form2" :rules="rules2" label-width="120px">
- <el-form-item label="姓名:" style="width:600px;">
- <el-input v-model="form2.userName" :disabled="true" placeholder="请输入姓名"/>
- </el-form-item>
- <el-form-item label="学号:" style="width:600px;">
- <el-input v-model="form2.stuNo" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="学院:" style="width:600px;">
- <el-input v-model="form2.deptName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="原因:" prop="reason" style="width:600px;">
- <el-input
- type="textarea"
- :autosize="{ minRows: 6, maxRows: 6}"
- placeholder="请输入原因"
- maxLength="50"
- resize="none"
- v-model="form2.reason">
- </el-input>
- </el-form-item>
- <el-form-item label="处理天数时限" prop="handleDay" style="margin-bottom:0;">
- <el-input
- v-model="form2.handleDay"
- placeholder="请输入"
- maxLength="5"
- clearable
- style="width:200px;">
- <template slot="append">天</template>
- </el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="form2Off">取 消</el-button>
- <el-button type="primary" @click="submitForm2">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 移除负面清单 -->
- <el-dialog :title="title" :visible.sync="form3Open" width="500px" append-to-body>
- <el-form ref="form3" :model="form3" :rules="rules3" label-width="90px">
- <el-form-item label="姓名:">
- <el-input v-model="form3.userName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="学号:">
- <el-input v-model="form3.stuNo" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="学院:">
- <el-input v-model="form3.deptName" :disabled="true" placeholder="请输入姓名" />
- </el-form-item>
- <el-form-item label="原因:" prop="reason">
- <el-input
- type="textarea"
- :autosize="{ minRows: 6, maxRows: 6}"
- placeholder="请输入原因"
- maxLength="50"
- resize="none"
- v-model="form3.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="form3Off">取 消</el-button>
- <el-button type="primary" @click="submitForm3">确 定</el-button>
- </div>
- </el-dialog>
- <violation-info v-if="pageType==2" :propsData="propsData"></violation-info>
- </div>
- </template>
- <script>
- import { listViolation, getViolation, delViolation, addViolation, updateViolation,joinBlackList,delBlacklist ,violationSiteType ,addViolationHistory,blackAdd,getIntegralMatchingRules } from "@/api/laboratory/violation";
- import { delNegivelist } from "@/api/laboratory/negativeListRecords";
- import { addBlacklist } from "@/api/laboratory/blacklist";
- import { listDepartments } from "@/api/system/dept";
- import violationInfo from "./violationInfo.vue";
- import { selectListUser } from "@/api/system/user";
- import { getSubjectDictByViolation } from "@/api/laboratory/violation";
- export default {
- name: "Violation",
- components: {
- violationInfo
- },
- data() {
- return {
- tableButtonType:this.hasPermiDom(['laboratory:violationHistoryRecord:list','laboratory:blacklist:remove','laboratory:blacklist:add','laboratory:negativeListRecords:remove']),
- pageType:1,
- propsData:{},
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 违规记录表格数据
- violationList: [],
- // 弹出层标题
- title: "",
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize:20,
- userName: null,
- searchValue: null,
- stuNo: null,
- status: null,
- joinUserId: null,
- negativeId: null,
- violationType: null,
- violationContent: null,
- deptId: null,
- deptName: null,
- userId: null,
- beginTime: null,
- endTime: null,
- violationReasons: null
- },
- // 是否显示弹出层
- open: false,
- form1Open:false,
- form2Open:false,
- form3Open:false,
- // 表单参数
- form: {},
- form1: {},
- form2: {},
- form3: {},
- // 表单校验
- rules: {
- joinUserId:[
- {required: true, message: '请选择人员', trigger: 'blur'}
- ],
- violationTypes:[
- {required: true, message: '请选择违规内容', trigger: 'blur'}
- ],
- penaltyType:[
- {required: true, message: '请选择处置方案', trigger: 'blur'}
- ],
- reason:[
- {required: true, message: '请输入原因', trigger: 'blur'},
- { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
- ],
- checkListTwo: [
- { required: true, message: "请在考试/学习/做题中至少选择一种", trigger: "blur" }
- ],
- learnHour: [
- { required: true, message: "请输入小时", trigger: "blur" },
- { required: true, message: "请输入小时", validator: this.spaceJudgment, trigger: "blur" }
- ],
- learnMinute: [
- { required: true, message: "请输入分钟", trigger: "blur" },
- { required: true, message: "请输入分钟", validator: this.spaceJudgment, trigger: "blur" }
- ],
- numberTopics: [
- { required: true, message: "请输入数量", trigger: "blur" },
- { required: true, message: "请输入数量", validator: this.spaceJudgment, trigger: "blur" }
- ],
- numberAccuracy: [
- { required: true, message: "请输入百分比", trigger: "blur" },
- { required: true, message: "请输入百分比", validator: this.spaceJudgment, trigger: "blur" }
- ],
- handleDay: [
- { required: true, message: "请输入处理天数时限", trigger: "blur" },
- { required: true, message: "请输入处理天数时限", validator: this.spaceJudgment, trigger: "blur" }
- ],
- },
- rules1: {
- reason:[
- {required: true, message: '请输入原因', trigger: 'blur'},
- { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
- ],
- },
- rules2: {
- reason:[
- {required: true, message: '请输入原因', trigger: 'blur'},
- { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
- ],
- handleDay: [
- { required: true, message: "请输入处理天数时限", trigger: "blur" },
- { required: true, message: "请输入处理天数时限", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- },
- rules3: {
- reason:[
- {required: true, message: '请输入原因', trigger: 'blur'},
- { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
- ],
- },
- addRules:{
- userId:[
- {required: true, message: '请输入姓名', trigger: 'blur'},
- { required: true, message: "请输入姓名", validator: this.spaceJudgment, trigger: "blur" }
- ],
- laboratoryId:[
- {required: true, message: '请选择实验室', trigger: 'blur'}
- ],
- reason:[
- {required: true, message: '请选择违规项', trigger: 'blur'}
- ],
- violationReasons:[
- {required: true, message: '请输入违规原因', trigger: 'blur'},
- { required: true, message: "请输入违规原因", validator: this.spaceJudgment, trigger: "blur" }
- ],
- deductionVal:[
- {required: true, message: '请输入扣除信用分值', trigger: 'blur'},
- { required: true, message: "请输入扣除信用分值", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- checkListTwo:[
- {required: true, message: '请在考试/学习/做题中至少选择一项', trigger: 'blur'}
- ],
- learnHour: [
- { required: true, message: "请输入小时", trigger: "blur" },
- { required: true, message: "请输入小时", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- learnMinute: [
- { required: true, message: "请输入分钟", trigger: "blur" },
- { required: true, message: "请输入分钟", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- numberTopics: [
- { required: true, message: "请输入数量", trigger: "blur" },
- { required: true, message: "请输入数量", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- numberAccuracy: [
- { required: true, message: "请输入百分比", trigger: "blur" },
- { required: true, message: "请输入百分比", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- handleDay: [
- { required: true, message: "请输入处理天数时限", trigger: "blur" },
- { required: true, message: "请输入处理天数时限", validator: this.spaceJudgment, trigger: "blur" },
- { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
- ],
- },
- //违规类型
- violationTypeOptions: [],
- //处罚类型
- penaltyTypeOptions: [],
- //人员
- optionsUser: [],
- //详情数据
- infoData:{},
- violationId:"",
- violCount: "",
- lastHandleTime: "",
- lastViolTime: "",
- // newViolationTypes: null,
- //黑名单弹窗开关
- openTwo:false,
- //黑名单弹窗数据
- formTwo:{},
- //处罚方式列表
- optionsTwo:[],
- //学院
- deptOptions:[],
- //状态
- deptOptionsTwo:[
- {deptId:0,deptName:"全部"},
- {deptId:1,deptName:"正常"},
- {deptId:2,deptName:"负面清单"},
- {deptId:3,deptName:"黑名单"},
- ],
- // 是否显示移除负面清单弹出层
- checklistOpen: false,
- // 是否显示移除加入黑名单弹出层
- blacklistOpen: false,
- //实验室列表
- subjectOptions:[],
- //违规类型列表
- violationSiteTypeList:[],
- //处罚列表
- punishmentList:[],
- };
- },
- created() {
- this.getList();
- this.getDicts("lab_violation_rules").then(response => {
- this.violationTypeOptions = response.data;
- })
- this.getDicts("penaltyType").then(response => {
- this.penaltyTypeOptions = response.data;
- this.optionsTwo = response.data;
- })
- this.getDeptList();
- // this.getSubjectDictByViolation();
- this.violationSiteType();
- },
- methods: {
- //勾选方法
- checkClickOne(data,name){
- if(name == 'xx'){
- let num = 0;
- for(let i=0;i<data.length;i++){
- if('learnStatus' == data[i]){
- num++
- }
- }
- this.form.learnStatusType = num != 0;
- }
- },
- checkClickTwo(data,name){
- if(name == 'zt'){
- let num = 0;
- for(let i=0;i<data.length;i++){
- if('practiceStatus' == data[i]){
- num++
- }
- }
- this.form.practiceStatusType = num != 0;
- }
- },
- // 更多操作触发
- handleCommand(command, row) {
- switch (command) {
- case "1":
- this.blacklistClick(row);
- break;
- case "2":
- this.blacklistClick(row);
- break;
- case "3":
- this.checklistClick(row);
- break;
- default:
- break;
- }
- },
- //负面清单按钮
- checklistClick(row){
- row.buttonType = 2;
- this.$set(this,"form3",row);
- this.title = "移除负面清单";
- this.form.negativeId = row.negativeId;
- this.form3Open = true;
- },
- //黑名单按钮
- blacklistClick(row){
- if(row.isBlackList == 1){
- row.buttonType = 1;
- this.$set(this,"form1",row);
- this.title = "移除黑名单";
- this.form1Open = true;
- }else if(row.isBlackList == 0){
- this.title = "加入黑名单";
- let obj = JSON.parse(JSON.stringify(row));
- obj.buttonType = 3;
- obj.checkList = [];
- obj.checkListTwo = [];
- obj.learnStatusType = false;
- obj.practiceStatusType = false;
- this.$set(this,"form2",obj);
- this.form2Open = true;
- }
- },
- //页面切换
- goPage(type,row){
- if(this.pageType!=type){
- if(type == 1){
- this.pageType = type;
- this.getList();
- }else if(type == 2){
- this.propsData.userId = row.joinUserId;
- this.pageType = type;
- }
- }
- },
- /** 查询违规记录列表 */
- getList() {
- this.loading = true;
- listViolation(this.queryParams).then(response => {
- this.violationList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- console.log("123")
- this.open = false;
- // this.reset();
- },
- // 取消按钮
- form1Off(){
- this.form1Open = false;
- },
- form2Off(){
- this.form2Open = false;
- },
- form3Off(){
- this.form3Open = false;
- },
- /** 提交按钮 */
- submitForm1(){
- this.$refs["form1"].validate(valid => {
- if (valid) {
- //移除黑名单
- let obj = {
- id:this.form1.id,
- joinUserId:this.form1.joinUserId,
- reason:this.form1.reason,
- };
- delBlacklist(obj).then(response => {
- this.form1Open = false;
- this.$set(this,'form1',{})
- this.msgSuccess("操作成功");
- this.getList();
- });
- }
- });
- },
- submitForm2(){
- this.$refs["form2"].validate(valid => {
- if (valid) {
- if(this.form2.buttonType == 3){
- let obj = {
- id:this.form2.id,
- joinUserId:this.form2.joinUserId,
- reason:this.form2.reason,
- // deductionVal:this.form2.deductionVal,
- handleDay:this.form2.handleDay,
- };
- blackAdd(obj).then(response => {
- this.form2Open = false;
- this.$set(this,'form2',{})
- this.msgSuccess("操作成功");
- this.getList();
- });
- }
- }
- });
- },
- submitForm3() {
- this.$refs["form3"].validate(valid => {
- if (valid) {
- if(this.form3.buttonType == 2){
- //移除负面清单
- let obj = {
- id:this.form3.negativeId,
- userId:this.form3.joinUserId,
- reason:this.form3.reason,
- handAct:true,
- };
- delNegivelist(obj).then(response => {
- this.form3Open = false;
- this.$set(this,'form3',{})
- this.msgSuccess("操作成功");
- this.getList();
- });
- }
- }
- });
- },
- cancelTwo() {
- this.blacklistOpen = false;
- this.checklistOpen = false;
- // this.reset();
- },
- resetTwo(){
- this.formTwo = {};
- },
- // 表单重置
- reset() {
- this.form = {};
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- // this.resetForm("queryForm");
- this.$set(this,'queryParams',{
- pageNum: 1,
- pageSize:20,
- });
- 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();
- let obj = {
- userId:"",
- userName:"",
- deptName:"",
- reason:"",
- checkList:[],
- checkListTwo:[],
- learnStatusType:false,
- practiceStatusType:false,
- }
- console.log("123")
- this.$set(this,"form",obj);
- this.optionsUser = [];
- this.title = "新增违规记录";
- this.open = true;
- },
- /** 新增违规 */
- submitForm() {
- let self = this;
- this.$refs["form"].validate(valid => {
- if (valid) {
- let obj = {
- userId:this.form.userId,
- deptId:this.form.deptId,
- userName:this.form.nickName,
- stuNo:this.form.stuNo,
- deptName:this.form.deptName,
- laboratoryId:this.form.laboratoryId,
- reason:this.form.reason,
- deductionVal:this.form.deductionVal,
- handleDay:this.form.handleDay,
- violationReasons:this.form.violationReasons,
- };
- for(let i=0;i<self.subjectOptions.length;i++){
- if(self.form.laboratoryId == self.subjectOptions[i].id){
- obj.laboratoryName = self.subjectOptions[i].name
- }
- }
- //处理二级多选--警告/约谈
- let warningStatusNum = 0;
- let interviewStatusNum = 0;
- for(let o=0;o<this.form.checkList.length;o++){
- if(this.form.checkList[o] == 'warningStatus'){
- warningStatusNum++
- }
- if(this.form.checkList[o] == 'interviewStatus'){
- interviewStatusNum++
- }
- }
- if(warningStatusNum == 0){
- obj.warningStatus = "";
- }else{
- obj.warningStatus = 1;
- }
- if(interviewStatusNum == 0){
- obj.interviewStatus = "";
- }else{
- obj.interviewStatus = 1;
- }
- //处理二级多选--考试
- let testStatusNum = 0;
- for(let o=0;o<this.form.checkListTwo.length;o++){
- if(this.form.checkListTwo[o] == 'testStatus'){
- testStatusNum++
- }
- }
- if(testStatusNum == 0){
- obj.testStatus = "";
- }else{
- obj.testStatus = 1;
- }
- //处理二级多选--学习
- if(this.form.learnStatusType){
- obj.learnStatus = 1;
- obj.learnHour = this.form.learnHour;
- obj.learnMinute = this.form.learnMinute;
- }else{
- obj.learnStatus = "";
- obj.learnHour = "";
- obj.learnMinute = "";
- }
- //处理二级多选--做题
- if(this.form.practiceStatusType){
- obj.practiceStatus = 1;
- obj.numberTopics = this.form.numberTopics;
- obj.numberAccuracy = this.form.numberAccuracy;
- }else{
- obj.practiceStatus = "";
- obj.numberTopics = "";
- obj.numberAccuracy = "";
- }
- addViolationHistory(obj).then(response => {
- this.msgSuccess("操作成功");
- this.open = false;
- this.getList();
- });
- }
- });
- },
- //人员选中
- userChange(data){
- let self = this;
- for(let i=0;i<self.optionsUser.length;i++){
- if(data == self.optionsUser[i].userId){
- this.form.stuNo = self.optionsUser[i].userName;
- this.form.deptId = self.optionsUser[i].deptId;
- this.form.deptName = self.optionsUser[i].deptName;
- this.form.nickName = self.optionsUser[i].nickName;
- this.form.laboratoryId = '';
- this.getSubjectDictByViolation();
- }
- }
- },
- //处罚方式懒加载
- getIntegralMatchingRules(query){
- if (query !== '') {
- this.loading = true;
- let obj = {
- creditScore : this.form.deductionVal
- };
- getIntegralMatchingRules(obj).then(res => {
- this.loading = false;
- if(res.data.id){
- //判断-约谈
- if(res.data.warningStatus == 1){
- this.form.checkList.push('interviewStatus')
- }
- //判断-警告
- if(res.data.warningStatus == 1){
- this.form.checkList.push('warningStatus')
- }
- //判断-考试
- if(res.data.testStatus == 1){
- this.form.checkListTwo.push('testStatus')
- }
- //判断-学习
- if(res.data.learnStatus == 1){
- this.form.checkListTwo.push('learnStatus')
- this.form.learnStatusType = true;
- this.form.learnHour = res.data.learnHour;
- this.form.learnMinute = res.data.learnMinute;
- }else{
- this.form.learnStatusType = false;
- }
- //判断-考试
- if(res.data.practiceStatus == 1){
- this.form.checkListTwo.push('practiceStatus')
- this.form.practiceStatusType = true;
- this.form.numberTopics = res.data.numberTopics;
- this.form.numberAccuracy = res.data.numberAccuracy;
- }else{
- this.form.practiceStatusType = false;
- }
- this.form.handleDay = res.data.handleDay;
- }
- });
- }
- },
- //人员懒加载
- userSelectList(query) {
- if (query !== '' && query.length>1) {
- this.loading = true;
- let obj = {
- nickName : query,
- userType: 22,
- };
- selectListUser(obj).then(response => {
- this.optionsUser = response.data;
- this.loading = false;
- });
- } else {
- this.optionsUser = [];
- }
- },
- /** 查询学院列表 */
- getDeptList() {
- listDepartments().then(response => {
- this.$set(this, 'deptOptions', response.data)
- });
- },
- //查询实验室列表
- getSubjectDictByViolation(){
- if(!this.form.deptId){
- this.msgError('请先选择人员');
- return
- }
- let obj = {
- deptId:this.form.deptId
- }
- getSubjectDictByViolation(obj).then(response => {
- this.subjectOptions = response.data;
- });
- },
- //选中实验室
- subjectChange(e){
- console.log("e",e)
- this.$set(this.form,'laboratoryId',e);
- this.$forceUpdate();
- },
- //查询实验室列表
- violationSiteType(){
- violationSiteType({}).then(response => {
- this.violationSiteTypeList = response.data;
- this.violationSiteTypeList.push({"id":"-1","violationName":"其他"});
- });
- },
- }
- };
- </script>
- <style scoped lang="scss">
- .violation {
- display: flex!important;
- flex-direction: column;
- box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
- overflow: hidden;
- .violationPage{
- flex:1;
- display: flex!important;
- flex-direction: column;
- overflow: hidden;
- padding:20px!important;
- }
- .button-box{
- width:200px;
- display: flex;
- margin:0 auto;
- }
- }
- </style>
|