index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. <!--违规记录管理-->
  2. <template>
  3. <div class="app-container violation">
  4. <div class="violationPage" v-if="pageType==1">
  5. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" class="form-box" v-if="pageType==1">
  6. <el-form-item label="关键字" prop="searchValue" label-width="60px">
  7. <el-input
  8. v-model="queryParams.searchValue"
  9. placeholder="姓名/学号"
  10. clearable
  11. size="small"
  12. />
  13. </el-form-item>
  14. <el-form-item label="学院" prop="deptId" label-width="80px">
  15. <el-select v-model="queryParams.deptId" clearable placeholder="请选择学院">
  16. <el-option
  17. v-for="dict in deptOptions"
  18. :key="dict.deptId"
  19. :label="dict.deptName"
  20. :value="dict.deptId"
  21. ></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="状态" prop="status" label-width="50px">
  25. <el-select v-model="queryParams.status" placeholder="请选择状态">
  26. <el-option
  27. v-for="dict in deptOptionsTwo"
  28. :key="dict.deptId"
  29. :label="dict.deptName"
  30. :value="dict.deptId"
  31. ></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item style="float: right;">
  35. <el-col :span="1.5">
  36. <p class="add-button-one-150"
  37. @click="handleAdd()"
  38. v-hasPermi="['laboratory:violation:add']"
  39. ><i class="el-icon-plus"></i>新增违规记录</p>
  40. </el-col>
  41. </el-form-item>
  42. <el-form-item>
  43. <p class="inquire-button-one" @click="handleQuery">查询</p>
  44. <p class="reset-button-one" @click="resetQuery">重置</p>
  45. </el-form-item>
  46. </el-form>
  47. <el-table v-loading="loading" border :data="violationList" @sort-change="handleSelectionChange" v-if="pageType==1">
  48. <el-table-column label="姓名" align="left" prop="userName" />
  49. <el-table-column label="学号" align="left" prop="stuNo" />
  50. <el-table-column label="学院" align="left" prop="deptName" />
  51. <el-table-column label="违规次数" align="left" sortable="custom" prop="violationNum" />
  52. <el-table-column label="负面清单次数" align="left" sortable="custom" prop="negativeListNum" />
  53. <el-table-column label="黑名单次数" align="left" sortable="custom" prop="blackListNum" />
  54. <el-table-column label="信用分" align="left" prop="creditScore" />
  55. <el-table-column label="当前状态" align="left" prop="status">
  56. <template slot-scope="scope">
  57. {{scope.row.status == 1?'正常':(scope.row.status == 2?'负面清单':(scope.row.status == 3?'黑名单':''))}}
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="200" v-if="tableButtonType">
  61. <template slot-scope="scope">
  62. <div class="table-button-box">
  63. <p class="table-button-null"></p>
  64. <p class="table-button-p"
  65. @click="goPage(2,scope.row)"
  66. v-hasPermi="['laboratory:violationHistoryRecord:list']"
  67. >历史记录</p>
  68. <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
  69. v-hasPermi="['laboratory:blacklist:remove','laboratory:blacklist:add','laboratory:negativeListRecords:remove']">
  70. <p class="table-button-p">更多>></p>
  71. <el-dropdown-menu slot="dropdown">
  72. <el-dropdown-item command="1" v-show="scope.row.isBlackList == 1"
  73. v-hasPermi="['laboratory:blacklist:remove']">移除黑名单</el-dropdown-item>
  74. <el-dropdown-item command="2" v-show="scope.row.isBlackList != 1"
  75. v-hasPermi="['laboratory:blacklist:add']">加入黑名单</el-dropdown-item>
  76. <el-dropdown-item command="3" v-show="scope.row.isNegative == 1"
  77. v-hasPermi="['laboratory:negativeListRecords:remove']">移除负面清单</el-dropdown-item>
  78. </el-dropdown-menu>
  79. </el-dropdown>
  80. <p class="table-button-null"></p>
  81. <!--<p class="table-button-warning-120"-->
  82. <!--v-if="scope.row.isBlackList == 1"-->
  83. <!--style="margin-right:10px;"-->
  84. <!--@click="blacklistClick(scope.row)"-->
  85. <!--v-hasPermi="['laboratory:blacklist:remove']"-->
  86. <!--&gt;移除黑名单</p>-->
  87. <!--<p class="table-button-warning-120"-->
  88. <!--v-if="scope.row.isBlackList != 1"-->
  89. <!--style="margin-right:10px;"-->
  90. <!--@click="blacklistClick(scope.row)"-->
  91. <!--v-hasPermi="['laboratory:blacklist:add']"-->
  92. <!--&gt;加入黑名单</p>-->
  93. <!--<p v-if="scope.row.isNegative == 1"-->
  94. <!--class="table-button-success-120"-->
  95. <!--@click="checklistClick(scope.row)"-->
  96. <!--v-hasPermi="['laboratory:negativeListRecords:remove']"-->
  97. <!--&gt;移除负面清单</p>-->
  98. </div>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. <pagination :page-sizes="[20, 30, 40, 50]"
  103. v-if="pageType==1"
  104. v-show="total>0"
  105. :total="total"
  106. layout="total, prev, pager, next, sizes, jumper"
  107. :page.sync="queryParams.pageNum"
  108. :limit.sync="queryParams.pageSize"
  109. @pagination="getList"
  110. />
  111. </div>
  112. <!-- 新增违规 -->
  113. <el-dialog :title="title" :visible.sync="open" width="720px" append-to-body>
  114. <el-form ref="form" :model="form" :rules="addRules" label-width="120px">
  115. <el-form-item label="姓名:" prop="userId">
  116. <el-select
  117. style="width:480px;"
  118. @change="userChange"
  119. v-model="form.userId"
  120. filterable
  121. remote
  122. placeholder="请输入至少2个字符"
  123. :remote-method="userSelectList"
  124. :loading="loading">
  125. <el-option
  126. v-for="item in optionsUser"
  127. :key="item.userId"
  128. :label="item.nickName"
  129. :value="item.userId">
  130. </el-option>
  131. </el-select>
  132. </el-form-item>
  133. <el-form-item label="学号:" style="width:600px;">
  134. <el-input v-model="form.stuNo" :disabled="true" placeholder="请选择学员"/>
  135. </el-form-item>
  136. <el-form-item label="学院:" style="width:600px;">
  137. <el-input v-model="form.deptName" :disabled="true" placeholder="请选择学员" />
  138. </el-form-item>
  139. <el-form-item label="实验室" prop="laboratoryId">
  140. <el-select v-model="form.laboratoryId" style="width:480px;" placeholder="请选择实验室"
  141. @change="subjectChange">
  142. <el-option
  143. v-for="item in subjectOptions"
  144. :key="item.id"
  145. :label="item.name"
  146. :value="item.id">
  147. </el-option>
  148. </el-select>
  149. </el-form-item>
  150. <el-form-item label="选择违规项" prop="reason">
  151. <el-select v-model="form.reason" style="width:480px;" placeholder="请选择违规项">
  152. <el-option
  153. v-for="item in violationSiteTypeList"
  154. :key="item.id"
  155. :label="item.violationName"
  156. :value="item.id">
  157. </el-option>
  158. </el-select>
  159. </el-form-item>
  160. <el-form-item label="违规原因:" prop="violationReasons" style="width:600px;" v-if="form.reason==-1">
  161. <el-input
  162. v-model="form.violationReasons"
  163. placeholder="请输入违规原因"
  164. maxLength="50"
  165. >
  166. </el-input>
  167. </el-form-item>
  168. <el-form-item label="扣除信用分值:" prop="deductionVal" style="width:600px;" v-if="form.reason==-1">
  169. <el-input
  170. v-model="form.deductionVal"
  171. placeholder="请输入"
  172. maxLength="5"
  173. @input="getIntegralMatchingRules">
  174. </el-input>
  175. </el-form-item>
  176. <el-form-item label="处理方式" prop="checkListTwo">
  177. <el-form-item label="">
  178. <el-checkbox-group v-model="form.checkList" style="display: inline-block;width:220px;">
  179. <el-checkbox label="warningStatus">警告<span style="color:#999;">(系统推送警告消息)</span></el-checkbox>
  180. </el-checkbox-group>
  181. <el-checkbox-group v-model="form.checkList" style="display: inline-block;width:160px;">
  182. <el-checkbox label="interviewStatus">约谈<span style="color:#999;">(线下约谈)</span></el-checkbox>
  183. </el-checkbox-group>
  184. <el-checkbox-group v-model="form.checkListTwo" style="display: inline-block;width:100px;">
  185. <el-checkbox label="testStatus">考试</el-checkbox>
  186. </el-checkbox-group>
  187. </el-form-item>
  188. <div>
  189. <div style="width:480px;margin-right:20px;display: flex;">
  190. <el-checkbox-group v-model="form.checkListTwo" @change="(data)=>checkClickOne(data,'xx')" style="height:40px;line-height:40px;width:80px;">
  191. <el-checkbox label="learnStatus">学习</el-checkbox>
  192. </el-checkbox-group>
  193. <p v-if="form.learnStatusType" style="margin:0;line-height:40px;">学习时长:</p>
  194. <el-form-item label="" prop="learnHour" v-if="form.learnStatusType" style="margin-bottom:20px;">
  195. <el-input
  196. style="width:150px;"
  197. v-model="form.learnHour"
  198. placeholder="请输入"
  199. maxLength="5"
  200. clearable
  201. size="small">
  202. <template slot="append">时</template>
  203. </el-input>
  204. </el-form-item>
  205. <p style="width:30px;"></p>
  206. <el-form-item label="" prop="learnMinute" v-if="form.learnStatusType" style="margin-bottom:20px;">
  207. <el-input
  208. style="width:150px;"
  209. v-model="form.learnMinute"
  210. placeholder="请输入"
  211. maxLength="5"
  212. clearable
  213. size="small">
  214. <template slot="append">分</template>
  215. </el-input>
  216. </el-form-item>
  217. </div>
  218. <div class="for-check-box" style="display: flex;">
  219. <el-checkbox-group v-model="form.checkListTwo" @change="(data)=>checkClickTwo(data,'zt')" style="height:40px;line-height:40px;width:80px;">
  220. <el-checkbox label="practiceStatus">做题</el-checkbox>
  221. </el-checkbox-group>
  222. <p v-if="form.practiceStatusType" style="margin:0;line-height:40px;">题目数量:</p>
  223. <el-form-item label="" prop="numberTopics" v-if="form.practiceStatusType" style="margin-bottom:20px;">
  224. <el-input
  225. style="width:150px;"
  226. v-model="form.numberTopics"
  227. placeholder="请输入"
  228. maxLength="5"
  229. clearable
  230. size="small">
  231. <template slot="append">道</template>
  232. </el-input>
  233. </el-form-item>
  234. <p style="width:87px;text-align: right;margin:0;line-height:40px;" v-if="form.practiceStatusType">正确率:</p>
  235. <el-form-item label="" prop="numberAccuracy" v-if="form.practiceStatusType" style="margin-bottom:20px;">
  236. <el-input
  237. style="width:150px;"
  238. v-model="form.numberAccuracy"
  239. placeholder="请输入"
  240. maxLength="5"
  241. clearable
  242. size="small">
  243. <template slot="append">%</template>
  244. </el-input>
  245. </el-form-item>
  246. </div>
  247. </div>
  248. </el-form-item>
  249. <el-form-item label="处理天数时限" prop="handleDay" style="margin-bottom:0;">
  250. <el-input
  251. v-model="form.handleDay"
  252. placeholder="请输入"
  253. maxLength="5"
  254. clearable
  255. style="width:200px;">
  256. <template slot="append">天</template>
  257. </el-input>
  258. </el-form-item>
  259. </el-form>
  260. <div slot="footer" class="dialog-footer">
  261. <el-button @click="cancel">取 消</el-button>
  262. <el-button type="primary" @click="submitForm">确 定</el-button>
  263. </div>
  264. </el-dialog>
  265. <!-- 移除黑名单 -->
  266. <el-dialog :title="title" :visible.sync="form1Open" width="500px" append-to-body>
  267. <el-form ref="form1" :model="form1" :rules="rules1" label-width="90px">
  268. <el-form-item label="姓名:">
  269. <el-input v-model="form1.userName" :disabled="true" placeholder="请输入姓名" />
  270. </el-form-item>
  271. <el-form-item label="学号:">
  272. <el-input v-model="form1.stuNo" :disabled="true" placeholder="请输入姓名" />
  273. </el-form-item>
  274. <el-form-item label="学院:">
  275. <el-input v-model="form1.deptName" :disabled="true" placeholder="请输入姓名" />
  276. </el-form-item>
  277. <el-form-item label="原因:" prop="reason">
  278. <el-input
  279. type="textarea"
  280. :autosize="{ minRows: 6, maxRows: 6}"
  281. placeholder="请输入原因"
  282. maxLength="50"
  283. resize="none"
  284. v-model="form1.reason">
  285. </el-input>
  286. </el-form-item>
  287. <el-form-item label="">
  288. <p style="font-size:14px;color:#999;margin:0;">提交后,该人员信用分自动恢复到合格分。</p>
  289. </el-form-item>
  290. </el-form>
  291. <div slot="footer" class="dialog-footer">
  292. <el-button @click="form1Off">取 消</el-button>
  293. <el-button type="primary" @click="submitForm1">确 定</el-button>
  294. </div>
  295. </el-dialog>
  296. <!-- 加入黑名单 -->
  297. <el-dialog :title="title" :visible.sync="form2Open" width="720px" append-to-body>
  298. <el-form ref="form2" :model="form2" :rules="rules2" label-width="120px">
  299. <el-form-item label="姓名:" style="width:600px;">
  300. <el-input v-model="form2.userName" :disabled="true" placeholder="请输入姓名"/>
  301. </el-form-item>
  302. <el-form-item label="学号:" style="width:600px;">
  303. <el-input v-model="form2.stuNo" :disabled="true" placeholder="请输入姓名" />
  304. </el-form-item>
  305. <el-form-item label="学院:" style="width:600px;">
  306. <el-input v-model="form2.deptName" :disabled="true" placeholder="请输入姓名" />
  307. </el-form-item>
  308. <el-form-item label="原因:" prop="reason" style="width:600px;">
  309. <el-input
  310. type="textarea"
  311. :autosize="{ minRows: 6, maxRows: 6}"
  312. placeholder="请输入原因"
  313. maxLength="50"
  314. resize="none"
  315. v-model="form2.reason">
  316. </el-input>
  317. </el-form-item>
  318. <el-form-item label="处理天数时限" prop="handleDay" style="margin-bottom:0;">
  319. <el-input
  320. v-model="form2.handleDay"
  321. placeholder="请输入"
  322. maxLength="5"
  323. clearable
  324. style="width:200px;">
  325. <template slot="append">天</template>
  326. </el-input>
  327. </el-form-item>
  328. </el-form>
  329. <div slot="footer" class="dialog-footer">
  330. <el-button @click="form2Off">取 消</el-button>
  331. <el-button type="primary" @click="submitForm2">确 定</el-button>
  332. </div>
  333. </el-dialog>
  334. <!-- 移除负面清单 -->
  335. <el-dialog :title="title" :visible.sync="form3Open" width="500px" append-to-body>
  336. <el-form ref="form3" :model="form3" :rules="rules3" label-width="90px">
  337. <el-form-item label="姓名:">
  338. <el-input v-model="form3.userName" :disabled="true" placeholder="请输入姓名" />
  339. </el-form-item>
  340. <el-form-item label="学号:">
  341. <el-input v-model="form3.stuNo" :disabled="true" placeholder="请输入姓名" />
  342. </el-form-item>
  343. <el-form-item label="学院:">
  344. <el-input v-model="form3.deptName" :disabled="true" placeholder="请输入姓名" />
  345. </el-form-item>
  346. <el-form-item label="原因:" prop="reason">
  347. <el-input
  348. type="textarea"
  349. :autosize="{ minRows: 6, maxRows: 6}"
  350. placeholder="请输入原因"
  351. maxLength="50"
  352. resize="none"
  353. v-model="form3.reason">
  354. </el-input>
  355. </el-form-item>
  356. <el-form-item label="">
  357. <p style="font-size:14px;color:#999;margin:0;">提交后,该人员信用分自动恢复到合格分。</p>
  358. </el-form-item>
  359. </el-form>
  360. <div slot="footer" class="dialog-footer">
  361. <el-button @click="form3Off">取 消</el-button>
  362. <el-button type="primary" @click="submitForm3">确 定</el-button>
  363. </div>
  364. </el-dialog>
  365. <violation-info v-if="pageType==2" :propsData="propsData"></violation-info>
  366. </div>
  367. </template>
  368. <script>
  369. import { listViolation, getViolation, delViolation, addViolation, updateViolation,joinBlackList,delBlacklist ,violationSiteType ,addViolationHistory,blackAdd,getIntegralMatchingRules } from "@/api/laboratory/violation";
  370. import { delNegivelist } from "@/api/laboratory/negativeListRecords";
  371. import { addBlacklist } from "@/api/laboratory/blacklist";
  372. import { listDepartments } from "@/api/system/dept";
  373. import violationInfo from "./violationInfo.vue";
  374. import { selectListUser } from "@/api/system/user";
  375. import { getSubjectDictByViolation } from "@/api/laboratory/violation";
  376. export default {
  377. name: "Violation",
  378. components: {
  379. violationInfo
  380. },
  381. data() {
  382. return {
  383. tableButtonType:this.hasPermiDom(['laboratory:violationHistoryRecord:list','laboratory:blacklist:remove','laboratory:blacklist:add','laboratory:negativeListRecords:remove']),
  384. pageType:1,
  385. propsData:{},
  386. // 遮罩层
  387. loading: true,
  388. // 选中数组
  389. ids: [],
  390. // 非单个禁用
  391. single: true,
  392. // 非多个禁用
  393. multiple: true,
  394. // 显示搜索条件
  395. showSearch: true,
  396. // 总条数
  397. total: 0,
  398. // 违规记录表格数据
  399. violationList: [],
  400. // 弹出层标题
  401. title: "",
  402. // 查询参数
  403. queryParams: {
  404. pageNum: 1,
  405. pageSize:20,
  406. userName: null,
  407. searchValue: null,
  408. stuNo: null,
  409. status: null,
  410. joinUserId: null,
  411. negativeId: null,
  412. violationType: null,
  413. violationContent: null,
  414. deptId: null,
  415. deptName: null,
  416. userId: null,
  417. beginTime: null,
  418. endTime: null,
  419. violationReasons: null
  420. },
  421. // 是否显示弹出层
  422. open: false,
  423. form1Open:false,
  424. form2Open:false,
  425. form3Open:false,
  426. // 表单参数
  427. form: {},
  428. form1: {},
  429. form2: {},
  430. form3: {},
  431. // 表单校验
  432. rules: {
  433. joinUserId:[
  434. {required: true, message: '请选择人员', trigger: 'blur'}
  435. ],
  436. violationTypes:[
  437. {required: true, message: '请选择违规内容', trigger: 'blur'}
  438. ],
  439. penaltyType:[
  440. {required: true, message: '请选择处置方案', trigger: 'blur'}
  441. ],
  442. reason:[
  443. {required: true, message: '请输入原因', trigger: 'blur'},
  444. { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
  445. ],
  446. checkListTwo: [
  447. { required: true, message: "请在考试/学习/做题中至少选择一种", trigger: "blur" }
  448. ],
  449. learnHour: [
  450. { required: true, message: "请输入小时", trigger: "blur" },
  451. { required: true, message: "请输入小时", validator: this.spaceJudgment, trigger: "blur" }
  452. ],
  453. learnMinute: [
  454. { required: true, message: "请输入分钟", trigger: "blur" },
  455. { required: true, message: "请输入分钟", validator: this.spaceJudgment, trigger: "blur" }
  456. ],
  457. numberTopics: [
  458. { required: true, message: "请输入数量", trigger: "blur" },
  459. { required: true, message: "请输入数量", validator: this.spaceJudgment, trigger: "blur" }
  460. ],
  461. numberAccuracy: [
  462. { required: true, message: "请输入百分比", trigger: "blur" },
  463. { required: true, message: "请输入百分比", validator: this.spaceJudgment, trigger: "blur" }
  464. ],
  465. handleDay: [
  466. { required: true, message: "请输入处理天数时限", trigger: "blur" },
  467. { required: true, message: "请输入处理天数时限", validator: this.spaceJudgment, trigger: "blur" }
  468. ],
  469. },
  470. rules1: {
  471. reason:[
  472. {required: true, message: '请输入原因', trigger: 'blur'},
  473. { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
  474. ],
  475. },
  476. rules2: {
  477. reason:[
  478. {required: true, message: '请输入原因', trigger: 'blur'},
  479. { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
  480. ],
  481. handleDay: [
  482. { required: true, message: "请输入处理天数时限", trigger: "blur" },
  483. { required: true, message: "请输入处理天数时限", validator: this.spaceJudgment, trigger: "blur" },
  484. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  485. ],
  486. },
  487. rules3: {
  488. reason:[
  489. {required: true, message: '请输入原因', trigger: 'blur'},
  490. { required: true, message: "请输入原因", validator: this.spaceJudgment, trigger: "blur" }
  491. ],
  492. },
  493. addRules:{
  494. userId:[
  495. {required: true, message: '请输入姓名', trigger: 'blur'},
  496. { required: true, message: "请输入姓名", validator: this.spaceJudgment, trigger: "blur" }
  497. ],
  498. laboratoryId:[
  499. {required: true, message: '请选择实验室', trigger: 'blur'}
  500. ],
  501. reason:[
  502. {required: true, message: '请选择违规项', trigger: 'blur'}
  503. ],
  504. violationReasons:[
  505. {required: true, message: '请输入违规原因', trigger: 'blur'},
  506. { required: true, message: "请输入违规原因", validator: this.spaceJudgment, trigger: "blur" }
  507. ],
  508. deductionVal:[
  509. {required: true, message: '请输入扣除信用分值', trigger: 'blur'},
  510. { required: true, message: "请输入扣除信用分值", validator: this.spaceJudgment, trigger: "blur" },
  511. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  512. ],
  513. checkListTwo:[
  514. {required: true, message: '请在考试/学习/做题中至少选择一项', trigger: 'blur'}
  515. ],
  516. learnHour: [
  517. { required: true, message: "请输入小时", trigger: "blur" },
  518. { required: true, message: "请输入小时", validator: this.spaceJudgment, trigger: "blur" },
  519. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  520. ],
  521. learnMinute: [
  522. { required: true, message: "请输入分钟", trigger: "blur" },
  523. { required: true, message: "请输入分钟", validator: this.spaceJudgment, trigger: "blur" },
  524. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  525. ],
  526. numberTopics: [
  527. { required: true, message: "请输入数量", trigger: "blur" },
  528. { required: true, message: "请输入数量", validator: this.spaceJudgment, trigger: "blur" },
  529. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  530. ],
  531. numberAccuracy: [
  532. { required: true, message: "请输入百分比", trigger: "blur" },
  533. { required: true, message: "请输入百分比", validator: this.spaceJudgment, trigger: "blur" },
  534. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  535. ],
  536. handleDay: [
  537. { required: true, message: "请输入处理天数时限", trigger: "blur" },
  538. { required: true, message: "请输入处理天数时限", validator: this.spaceJudgment, trigger: "blur" },
  539. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  540. ],
  541. },
  542. //违规类型
  543. violationTypeOptions: [],
  544. //处罚类型
  545. penaltyTypeOptions: [],
  546. //人员
  547. optionsUser: [],
  548. //详情数据
  549. infoData:{},
  550. violationId:"",
  551. violCount: "",
  552. lastHandleTime: "",
  553. lastViolTime: "",
  554. // newViolationTypes: null,
  555. //黑名单弹窗开关
  556. openTwo:false,
  557. //黑名单弹窗数据
  558. formTwo:{},
  559. //处罚方式列表
  560. optionsTwo:[],
  561. //学院
  562. deptOptions:[],
  563. //状态
  564. deptOptionsTwo:[
  565. {deptId:0,deptName:"全部"},
  566. {deptId:1,deptName:"正常"},
  567. {deptId:2,deptName:"负面清单"},
  568. {deptId:3,deptName:"黑名单"},
  569. ],
  570. // 是否显示移除负面清单弹出层
  571. checklistOpen: false,
  572. // 是否显示移除加入黑名单弹出层
  573. blacklistOpen: false,
  574. //实验室列表
  575. subjectOptions:[],
  576. //违规类型列表
  577. violationSiteTypeList:[],
  578. //处罚列表
  579. punishmentList:[],
  580. };
  581. },
  582. created() {
  583. this.getList();
  584. this.getDicts("lab_violation_rules").then(response => {
  585. this.violationTypeOptions = response.data;
  586. })
  587. this.getDicts("penaltyType").then(response => {
  588. this.penaltyTypeOptions = response.data;
  589. this.optionsTwo = response.data;
  590. })
  591. this.getDeptList();
  592. // this.getSubjectDictByViolation();
  593. this.violationSiteType();
  594. },
  595. methods: {
  596. //勾选方法
  597. checkClickOne(data,name){
  598. if(name == 'xx'){
  599. let num = 0;
  600. for(let i=0;i<data.length;i++){
  601. if('learnStatus' == data[i]){
  602. num++
  603. }
  604. }
  605. this.form.learnStatusType = num != 0;
  606. }
  607. },
  608. checkClickTwo(data,name){
  609. if(name == 'zt'){
  610. let num = 0;
  611. for(let i=0;i<data.length;i++){
  612. if('practiceStatus' == data[i]){
  613. num++
  614. }
  615. }
  616. this.form.practiceStatusType = num != 0;
  617. }
  618. },
  619. // 更多操作触发
  620. handleCommand(command, row) {
  621. switch (command) {
  622. case "1":
  623. this.blacklistClick(row);
  624. break;
  625. case "2":
  626. this.blacklistClick(row);
  627. break;
  628. case "3":
  629. this.checklistClick(row);
  630. break;
  631. default:
  632. break;
  633. }
  634. },
  635. //负面清单按钮
  636. checklistClick(row){
  637. row.buttonType = 2;
  638. this.$set(this,"form3",row);
  639. this.title = "移除负面清单";
  640. this.form.negativeId = row.negativeId;
  641. this.form3Open = true;
  642. },
  643. //黑名单按钮
  644. blacklistClick(row){
  645. if(row.isBlackList == 1){
  646. row.buttonType = 1;
  647. this.$set(this,"form1",row);
  648. this.title = "移除黑名单";
  649. this.form1Open = true;
  650. }else if(row.isBlackList == 0){
  651. this.title = "加入黑名单";
  652. let obj = JSON.parse(JSON.stringify(row));
  653. obj.buttonType = 3;
  654. obj.checkList = [];
  655. obj.checkListTwo = [];
  656. obj.learnStatusType = false;
  657. obj.practiceStatusType = false;
  658. this.$set(this,"form2",obj);
  659. this.form2Open = true;
  660. }
  661. },
  662. //页面切换
  663. goPage(type,row){
  664. if(this.pageType!=type){
  665. if(type == 1){
  666. this.pageType = type;
  667. this.getList();
  668. }else if(type == 2){
  669. this.propsData.userId = row.joinUserId;
  670. this.pageType = type;
  671. }
  672. }
  673. },
  674. /** 查询违规记录列表 */
  675. getList() {
  676. this.loading = true;
  677. listViolation(this.queryParams).then(response => {
  678. this.violationList = response.rows;
  679. this.total = response.total;
  680. this.loading = false;
  681. });
  682. },
  683. // 取消按钮
  684. cancel() {
  685. console.log("123")
  686. this.open = false;
  687. // this.reset();
  688. },
  689. // 取消按钮
  690. form1Off(){
  691. this.form1Open = false;
  692. },
  693. form2Off(){
  694. this.form2Open = false;
  695. },
  696. form3Off(){
  697. this.form3Open = false;
  698. },
  699. /** 提交按钮 */
  700. submitForm1(){
  701. this.$refs["form1"].validate(valid => {
  702. if (valid) {
  703. //移除黑名单
  704. let obj = {
  705. id:this.form1.id,
  706. joinUserId:this.form1.joinUserId,
  707. reason:this.form1.reason,
  708. };
  709. delBlacklist(obj).then(response => {
  710. this.form1Open = false;
  711. this.$set(this,'form1',{})
  712. this.msgSuccess("操作成功");
  713. this.getList();
  714. });
  715. }
  716. });
  717. },
  718. submitForm2(){
  719. this.$refs["form2"].validate(valid => {
  720. if (valid) {
  721. if(this.form2.buttonType == 3){
  722. let obj = {
  723. id:this.form2.id,
  724. joinUserId:this.form2.joinUserId,
  725. reason:this.form2.reason,
  726. // deductionVal:this.form2.deductionVal,
  727. handleDay:this.form2.handleDay,
  728. };
  729. blackAdd(obj).then(response => {
  730. this.form2Open = false;
  731. this.$set(this,'form2',{})
  732. this.msgSuccess("操作成功");
  733. this.getList();
  734. });
  735. }
  736. }
  737. });
  738. },
  739. submitForm3() {
  740. this.$refs["form3"].validate(valid => {
  741. if (valid) {
  742. if(this.form3.buttonType == 2){
  743. //移除负面清单
  744. let obj = {
  745. id:this.form3.negativeId,
  746. userId:this.form3.joinUserId,
  747. reason:this.form3.reason,
  748. handAct:true,
  749. };
  750. delNegivelist(obj).then(response => {
  751. this.form3Open = false;
  752. this.$set(this,'form3',{})
  753. this.msgSuccess("操作成功");
  754. this.getList();
  755. });
  756. }
  757. }
  758. });
  759. },
  760. cancelTwo() {
  761. this.blacklistOpen = false;
  762. this.checklistOpen = false;
  763. // this.reset();
  764. },
  765. resetTwo(){
  766. this.formTwo = {};
  767. },
  768. // 表单重置
  769. reset() {
  770. this.form = {};
  771. this.resetForm("form");
  772. },
  773. /** 搜索按钮操作 */
  774. handleQuery() {
  775. this.queryParams.pageNum = 1;
  776. this.getList();
  777. },
  778. /** 重置按钮操作 */
  779. resetQuery() {
  780. // this.resetForm("queryForm");
  781. this.$set(this,'queryParams',{
  782. pageNum: 1,
  783. pageSize:20,
  784. });
  785. this.handleQuery();
  786. },
  787. // 多选框选中数据
  788. handleSelectionChange(type) {
  789. if(type.order == 'ascending'){
  790. this.queryParams.order = type.prop;//降
  791. this.queryParams.orderType = 'asc';//升ascending
  792. }else if(type.order == 'descending'){
  793. this.queryParams.order = type.prop;//降
  794. this.queryParams.orderType = 'desc';//降
  795. }else{
  796. this.queryParams.order = null;//无
  797. this.queryParams.orderType = null;//无
  798. }
  799. this.getList();
  800. },
  801. /** 新增按钮操作 */
  802. handleAdd() {
  803. this.reset();
  804. let obj = {
  805. userId:"",
  806. userName:"",
  807. deptName:"",
  808. reason:"",
  809. checkList:[],
  810. checkListTwo:[],
  811. learnStatusType:false,
  812. practiceStatusType:false,
  813. }
  814. console.log("123")
  815. this.$set(this,"form",obj);
  816. this.optionsUser = [];
  817. this.title = "新增违规记录";
  818. this.open = true;
  819. },
  820. /** 新增违规 */
  821. submitForm() {
  822. let self = this;
  823. this.$refs["form"].validate(valid => {
  824. if (valid) {
  825. let obj = {
  826. userId:this.form.userId,
  827. deptId:this.form.deptId,
  828. userName:this.form.nickName,
  829. stuNo:this.form.stuNo,
  830. deptName:this.form.deptName,
  831. laboratoryId:this.form.laboratoryId,
  832. reason:this.form.reason,
  833. deductionVal:this.form.deductionVal,
  834. handleDay:this.form.handleDay,
  835. violationReasons:this.form.violationReasons,
  836. };
  837. for(let i=0;i<self.subjectOptions.length;i++){
  838. if(self.form.laboratoryId == self.subjectOptions[i].id){
  839. obj.laboratoryName = self.subjectOptions[i].name
  840. }
  841. }
  842. //处理二级多选--警告/约谈
  843. let warningStatusNum = 0;
  844. let interviewStatusNum = 0;
  845. for(let o=0;o<this.form.checkList.length;o++){
  846. if(this.form.checkList[o] == 'warningStatus'){
  847. warningStatusNum++
  848. }
  849. if(this.form.checkList[o] == 'interviewStatus'){
  850. interviewStatusNum++
  851. }
  852. }
  853. if(warningStatusNum == 0){
  854. obj.warningStatus = "";
  855. }else{
  856. obj.warningStatus = 1;
  857. }
  858. if(interviewStatusNum == 0){
  859. obj.interviewStatus = "";
  860. }else{
  861. obj.interviewStatus = 1;
  862. }
  863. //处理二级多选--考试
  864. let testStatusNum = 0;
  865. for(let o=0;o<this.form.checkListTwo.length;o++){
  866. if(this.form.checkListTwo[o] == 'testStatus'){
  867. testStatusNum++
  868. }
  869. }
  870. if(testStatusNum == 0){
  871. obj.testStatus = "";
  872. }else{
  873. obj.testStatus = 1;
  874. }
  875. //处理二级多选--学习
  876. if(this.form.learnStatusType){
  877. obj.learnStatus = 1;
  878. obj.learnHour = this.form.learnHour;
  879. obj.learnMinute = this.form.learnMinute;
  880. }else{
  881. obj.learnStatus = "";
  882. obj.learnHour = "";
  883. obj.learnMinute = "";
  884. }
  885. //处理二级多选--做题
  886. if(this.form.practiceStatusType){
  887. obj.practiceStatus = 1;
  888. obj.numberTopics = this.form.numberTopics;
  889. obj.numberAccuracy = this.form.numberAccuracy;
  890. }else{
  891. obj.practiceStatus = "";
  892. obj.numberTopics = "";
  893. obj.numberAccuracy = "";
  894. }
  895. addViolationHistory(obj).then(response => {
  896. this.msgSuccess("操作成功");
  897. this.open = false;
  898. this.getList();
  899. });
  900. }
  901. });
  902. },
  903. //人员选中
  904. userChange(data){
  905. let self = this;
  906. for(let i=0;i<self.optionsUser.length;i++){
  907. if(data == self.optionsUser[i].userId){
  908. this.form.stuNo = self.optionsUser[i].userName;
  909. this.form.deptId = self.optionsUser[i].deptId;
  910. this.form.deptName = self.optionsUser[i].deptName;
  911. this.form.nickName = self.optionsUser[i].nickName;
  912. this.form.laboratoryId = '';
  913. this.getSubjectDictByViolation();
  914. }
  915. }
  916. },
  917. //处罚方式懒加载
  918. getIntegralMatchingRules(query){
  919. if (query !== '') {
  920. this.loading = true;
  921. let obj = {
  922. creditScore : this.form.deductionVal
  923. };
  924. getIntegralMatchingRules(obj).then(res => {
  925. this.loading = false;
  926. if(res.data.id){
  927. //判断-约谈
  928. if(res.data.warningStatus == 1){
  929. this.form.checkList.push('interviewStatus')
  930. }
  931. //判断-警告
  932. if(res.data.warningStatus == 1){
  933. this.form.checkList.push('warningStatus')
  934. }
  935. //判断-考试
  936. if(res.data.testStatus == 1){
  937. this.form.checkListTwo.push('testStatus')
  938. }
  939. //判断-学习
  940. if(res.data.learnStatus == 1){
  941. this.form.checkListTwo.push('learnStatus')
  942. this.form.learnStatusType = true;
  943. this.form.learnHour = res.data.learnHour;
  944. this.form.learnMinute = res.data.learnMinute;
  945. }else{
  946. this.form.learnStatusType = false;
  947. }
  948. //判断-考试
  949. if(res.data.practiceStatus == 1){
  950. this.form.checkListTwo.push('practiceStatus')
  951. this.form.practiceStatusType = true;
  952. this.form.numberTopics = res.data.numberTopics;
  953. this.form.numberAccuracy = res.data.numberAccuracy;
  954. }else{
  955. this.form.practiceStatusType = false;
  956. }
  957. this.form.handleDay = res.data.handleDay;
  958. }
  959. });
  960. }
  961. },
  962. //人员懒加载
  963. userSelectList(query) {
  964. if (query !== '' && query.length>1) {
  965. this.loading = true;
  966. let obj = {
  967. nickName : query,
  968. userType: 22,
  969. };
  970. selectListUser(obj).then(response => {
  971. this.optionsUser = response.data;
  972. this.loading = false;
  973. });
  974. } else {
  975. this.optionsUser = [];
  976. }
  977. },
  978. /** 查询学院列表 */
  979. getDeptList() {
  980. listDepartments().then(response => {
  981. this.$set(this, 'deptOptions', response.data)
  982. });
  983. },
  984. //查询实验室列表
  985. getSubjectDictByViolation(){
  986. if(!this.form.deptId){
  987. this.msgError('请先选择人员');
  988. return
  989. }
  990. let obj = {
  991. deptId:this.form.deptId
  992. }
  993. getSubjectDictByViolation(obj).then(response => {
  994. this.subjectOptions = response.data;
  995. });
  996. },
  997. //选中实验室
  998. subjectChange(e){
  999. console.log("e",e)
  1000. this.$set(this.form,'laboratoryId',e);
  1001. this.$forceUpdate();
  1002. },
  1003. //查询实验室列表
  1004. violationSiteType(){
  1005. violationSiteType({}).then(response => {
  1006. this.violationSiteTypeList = response.data;
  1007. this.violationSiteTypeList.push({"id":"-1","violationName":"其他"});
  1008. });
  1009. },
  1010. }
  1011. };
  1012. </script>
  1013. <style scoped lang="scss">
  1014. .violation {
  1015. display: flex!important;
  1016. flex-direction: column;
  1017. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  1018. overflow: hidden;
  1019. .violationPage{
  1020. flex:1;
  1021. display: flex!important;
  1022. flex-direction: column;
  1023. overflow: hidden;
  1024. padding:20px!important;
  1025. }
  1026. .button-box{
  1027. width:200px;
  1028. display: flex;
  1029. margin:0 auto;
  1030. }
  1031. }
  1032. </style>