index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :xs="24">
  5. <el-row :gutter="10" class="mb8">
  6. <el-col :span="1.5">
  7. <el-button
  8. type="primary"
  9. plain
  10. icon="el-icon-refresh"
  11. size="mini"
  12. @click="refreshTable1"
  13. >刷新</el-button>
  14. </el-col>
  15. <el-col :span="1.5">
  16. <el-button
  17. type="success"
  18. plain
  19. icon="el-icon-edit"
  20. size="mini"
  21. >批量确认已送</el-button>
  22. </el-col>
  23. </el-row>
  24. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  25. <el-table-column type="selection" width="50" align="center" />
  26. <el-table-column label="座号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
  27. <el-table-column label="更换件" align="center" key="className" prop="className" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  28. <el-table-column label="学员姓名" align="center" key="majorName" prop="majorName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
  29. <el-table-column label="状态" align="center" key="remark" prop="remark1" v-if="columns[3].visible" :show-overflow-tooltip="true" />
  30. <el-table-column label="申请时间" align="center" prop="createTime" v-if="columns[4].visible" width="160">
  31. <template slot-scope="scope">
  32. <span>{{ parseTime(scope.row.createTime) }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column
  36. label="操作"
  37. align="center"
  38. width="160"
  39. class-name="small-padding fixed-width"
  40. >
  41. <template slot-scope="scope">
  42. <el-button
  43. size="mini"
  44. type="text"
  45. icon="el-icon-position"
  46. @click="handleUpdate(scope.row)"
  47. >已送</el-button>
  48. <el-button
  49. size="mini"
  50. type="text"
  51. icon="el-icon-finished"
  52. @click="handleDelete(scope.row)"
  53. >驳回</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <pagination
  58. v-show="total>0"
  59. :total="total"
  60. :page.sync="queryParams.pageNum"
  61. :limit.sync="queryParams.pageSize"
  62. @pagination="getList"
  63. />
  64. </el-col>
  65. </el-row>
  66. <el-row style="margin-top: 2%;">
  67. <el-col>
  68. <el-row :gutter="10" class="mb8">
  69. <el-col :span="1.5">
  70. <el-button
  71. type="primary"
  72. plain
  73. icon="el-icon-refresh"
  74. size="mini"
  75. @click="refreshTable1"
  76. >刷新</el-button>
  77. </el-col>
  78. </el-row>
  79. <el-table v-loading="loading" :data="tableArr1" >
  80. <el-table-column label="座号" align="center" key="xuehao" prop="zuohao" v-if="tab_columns[0].visible" />
  81. <el-table-column label="模拟器状态" align="center" key="className" prop="monitype" v-if="tab_columns[1].visible" :show-overflow-tooltip="true" >
  82. <template scope="scope">
  83. <span v-if="scope.row.monitype==='就绪'" style="color: green">就绪</span>
  84. <span v-else-if="scope.row.monitype==='离线'" style="color: red">离线</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="学员学号" align="center" key="majorName" prop="xuehao" v-if="tab_columns[2].visible" :show-overflow-tooltip="true" />
  88. <el-table-column label="学员姓名" align="center" key="remark" prop="xingming" v-if="tab_columns[3].visible" :show-overflow-tooltip="true" />
  89. <el-table-column label="考试状态" align="center" prop="kaoshitype" v-if="tab_columns[4].visible" width="160">
  90. <template scope="scope">
  91. <span v-if="scope.row.kaoshitype==='已交卷'" style="color: green">已交卷</span>
  92. <span v-else-if="scope.row.kaoshitype==='未登录'" style="color: red">未登录</span>
  93. <span v-else-if="scope.row.kaoshitype==='已登录'" style="color: blue">已登录</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="考试成绩" align="center" prop="chengji" v-if="tab_columns[5].visible" width="160"></el-table-column>
  97. <el-table-column label="出题题目" align="center" prop="timu" v-if="tab_columns[6].visible" width="160"></el-table-column>
  98. <el-table-column label="故障现象" align="center" prop="xianxiang" v-if="tab_columns[7].visible" width="160"></el-table-column>
  99. <el-table-column label="可能原因" align="center" prop="reason" v-if="tab_columns[8].visible" width="160"></el-table-column>
  100. <el-table-column label="故障部位" align="center" prop="buwen" v-if="tab_columns[9].visible" width="160"></el-table-column>
  101. <el-table-column label="排除方法" align="center" prop="fangfa" v-if="tab_columns[10].visible" width="160"></el-table-column>
  102. <el-table-column label="修复结论" align="center" prop="jielun" v-if="tab_columns[11].visible" width="160"></el-table-column>
  103. </el-table>
  104. </el-col>
  105. </el-row>
  106. <el-row style="margin-top: 1%;">
  107. <el-form ref="form" :model="form" label-width="80px">
  108. <el-col v-for="(item, index) in tableArr2" :key="index">
  109. <div class="box">
  110. <div class="content1">{{ item.key }}</div>
  111. <div class="content2">{{ item.value1}}</div>
  112. <div class="content2">{{ item.value2}}</div>
  113. <div class="content2">{{ item.value3}}</div>
  114. <div class="content2">{{ item.value4}}</div>
  115. <div class="content2">{{ item.value5}}</div>
  116. <div class="content2">{{ item.value6}}</div>
  117. <div class="content2">{{ item.value7}}</div>
  118. <div class="content2">{{ item.value8}}</div>
  119. <div class="content2">{{ item.value9}}</div>
  120. <div class="content2">{{ item.value10}}</div>
  121. </div>
  122. </el-col>
  123. <el-col v-for="(item, index) in tableArr3" :key="index">
  124. <div class="box">
  125. <div class="content1">{{ item.key1 }}</div>
  126. <div class="content2">
  127. <!-- {{ item.value11}} -->
  128. <template >
  129. <input class="borderless-input_defen" name="duibie" v-model="item.value11"/>
  130. </template>
  131. </div>
  132. <div class="content2">
  133. <template >
  134. <input class="borderless-input_defen" name="duibie" v-model="item.value12"/>
  135. </template>
  136. <!-- {{ item.value12}} -->
  137. </div>
  138. <div class="content2">
  139. <template >
  140. <input class="borderless-input_defen" name="duibie" v-model="item.value13"/>
  141. </template>
  142. </div>
  143. <div class="content2">
  144. <template >
  145. <input class="borderless-input_defen" name="duibie" v-model="item.value14"/>
  146. </template>
  147. </div>
  148. <div class="content2">
  149. <template >
  150. <input class="borderless-input_defen" name="duibie" v-model="item.value15"/>
  151. </template>
  152. </div>
  153. <div class="content2">
  154. <template >
  155. <input class="borderless-input_defen" name="duibie" v-model="item.value16"/>
  156. </template>
  157. </div>
  158. <div class="content2">
  159. <template >
  160. <input class="borderless-input_defen" name="duibie" v-model="item.value17"/>
  161. </template>
  162. </div>
  163. <div class="content2">
  164. <template >
  165. <input class="borderless-input_defen" name="duibie" v-model="item.value18"/>
  166. </template>
  167. </div>
  168. <div class="content2">
  169. <template >
  170. <input class="borderless-input_defen" name="duibie" v-model="item.value19"/>
  171. </template>
  172. </div>
  173. <div class="content2">
  174. <template >
  175. <input class="borderless-input_defen" name="duibie" v-model="item.value110"/>
  176. </template>
  177. </div>
  178. </div>
  179. </el-col>
  180. </el-form>
  181. </el-row>
  182. <div slot="footer" style="margin-top: 2%; text-align: center;">
  183. <el-button type="primary">确认成绩并结束本批次考试</el-button>
  184. </div>
  185. </div>
  186. </template>
  187. <style>
  188. .borderless-input_defen {
  189. border: none;
  190. /* 移除边框 */
  191. outline: none; /* 移除点击输入框时浏览器自带的轮廓线 */
  192. text-align: center;
  193. width: 145px;
  194. }
  195. .box {
  196. width: 100%;
  197. height: 40px;
  198. display: flex;
  199. border-left: 1px solid #e9e9e9;
  200. border-top: 1px solid #e9e9e9;
  201. }
  202. .content1 {
  203. width: 80%;
  204. height: 40px;
  205. line-height: 40px;
  206. text-align: center;
  207. background-color: #fafafa;
  208. border-right: 1px solid #e9e9e9;
  209. border-bottom: 1px solid #e9e9e9;
  210. color:green;
  211. font-size: 14px;
  212. }
  213. .content2 {
  214. width: 60%;
  215. height: 40px;
  216. line-height: 40px;
  217. text-align: center;
  218. background-color: #fff;
  219. border-right: 1px solid #e9e9e9;
  220. border-bottom: 1px solid #e9e9e9;
  221. /* color: #b0b0b2; */
  222. font-size: 14px;
  223. }
  224. </style>
  225. <script>
  226. import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
  227. import { getToken } from "@/utils/auth";
  228. export default {
  229. // name: "User",
  230. dicts: ['sys_normal_disable', 'sys_user_sex'],
  231. data() {
  232. return {
  233. tableArr1: [{
  234. zuohao: '01',
  235. monitype: '就绪',
  236. xuehao: '2024001',
  237. xingming: '张三',
  238. kaoshitype: '未登录',
  239. chengji: '80',
  240. },
  241. {
  242. zuohao: '02',
  243. monitype: '离线',
  244. xuehao: '2024001',
  245. xingming: '李四',
  246. kaoshitype: '已登录',
  247. chengji: '80',
  248. },{
  249. zuohao: '03',
  250. monitype: '就绪',
  251. xuehao: '2024001',
  252. xingming: '张',
  253. kaoshitype: '已交卷',
  254. chengji: '80',
  255. },{
  256. zuohao: '04',
  257. monitype: '离线',
  258. xuehao: '2024001',
  259. xingming: '王',
  260. kaoshitype: '剩余时间',
  261. chengji: '80',
  262. },
  263. ],
  264. tableArr2: [
  265. {
  266. key: "座号",
  267. value1: "坐席1",
  268. value2: "坐席2",
  269. value3: "坐席3",
  270. value4: "坐席4",
  271. value5: "坐席5",
  272. value6: "坐席6",
  273. value7: "坐席7",
  274. value8: "坐席8",
  275. value9: "坐席9",
  276. value10: "坐席10",
  277. },
  278. {
  279. key: "姓名",
  280. value1: "张",
  281. value1: "李",
  282. },
  283. {
  284. key: "学号",
  285. value1: "2023004",
  286. value2: "2023007",
  287. }],
  288. tableArr3: [
  289. {
  290. key1: "一.排除故障(75分)",
  291. value11: "50",
  292. value12: "75",
  293. value13: "75",
  294. value14: "75",
  295. value15: "75",
  296. value16: "75",
  297. value17: "75",
  298. value18: "75",
  299. value19: "75",
  300. value110: "75",
  301. },
  302. {
  303. key1: "故障一未排除扣25分",
  304. value11: "50",
  305. value12: "75",
  306. value13: "75",
  307. value14: "75",
  308. value15: "75",
  309. value16: "75",
  310. value17: "75",
  311. value18: "75",
  312. value19: "75",
  313. value110: "75",
  314. },{
  315. key1: "故障二未排除扣25分",
  316. value11: "50",
  317. value12: "75",
  318. value13: "75",
  319. value14: "75",
  320. value15: "75",
  321. value16: "75",
  322. value17: "75",
  323. value18: "75",
  324. value19: "75",
  325. value110: "75",
  326. },{
  327. key1: "故障三未排除扣25分",
  328. value11: "50",
  329. value12: "75",
  330. value13: "75",
  331. value14: "75",
  332. value15: "75",
  333. value16: "75",
  334. value17: "75",
  335. value18: "75",
  336. value19: "75",
  337. value110: "75",
  338. },
  339. {
  340. key1: "二.修改报告表(15分)",
  341. value11: "15",
  342. value12: "15",
  343. value13: "15",
  344. value14: "15",
  345. value15: "15",
  346. value16: "15",
  347. value17: "15",
  348. value18: "15",
  349. value19: "15",
  350. value110: "15",
  351. },{
  352. key1: "故障现象少写或错写1条扣1分",
  353. value11: "50",
  354. value12: "15",
  355. value13: "15",
  356. value14: "15",
  357. value15: "15",
  358. value16: "15",
  359. value17: "15",
  360. value18: "15",
  361. value19: "15",
  362. value110: "15",
  363. },{
  364. key1: "可能原因少写或错写1条扣1分",
  365. value11: "50",
  366. value12: "75",
  367. value13: "15",
  368. value14: "15",
  369. value15: "15",
  370. value16: "15",
  371. value17: "15",
  372. value18: "15",
  373. value19: "15",
  374. value110: "15",
  375. },{
  376. key1: "故障部位少写或错写1条扣1分",
  377. value11: "50",
  378. value12: "15",
  379. value13: "15",
  380. value14: "15",
  381. value15: "15",
  382. value16: "15",
  383. value17: "15",
  384. value18: "15",
  385. value19: "15",
  386. value110: "15",
  387. },{
  388. key1: "排除方法少写或错写1条扣1分",
  389. value11: "15",
  390. value12: "15",
  391. value13: "15",
  392. value14: "15",
  393. value15: "15",
  394. value16: "15",
  395. value17: "15",
  396. value18: "15",
  397. value19: "15",
  398. value110: "15",
  399. },
  400. {
  401. key1: "修复结论错扣2分",
  402. value11: "50",
  403. value12: "15",
  404. value13: "15",
  405. value14: "15",
  406. value15: "15",
  407. value16: "15",
  408. value17: "15",
  409. value18: "15",
  410. value19: "15",
  411. value110: "15",
  412. },
  413. {
  414. key1: "三.维修时间(10分)",
  415. value11: "50",
  416. value12: "15",
  417. value13: "15",
  418. value14: "15",
  419. value15: "15",
  420. value16: "15",
  421. value17: "15",
  422. value18: "15",
  423. value19: "15",
  424. value110: "15",
  425. },
  426. {
  427. key1: "按每超时1分钟扣分的比例扣分",
  428. value11: "50",
  429. value12: "15",
  430. value13: "15",
  431. value14: "15",
  432. value15: "15",
  433. value16: "15",
  434. value17: "15",
  435. value18: "15",
  436. value19: "15",
  437. value110: "15",
  438. }],
  439. // 遮罩层
  440. loading: true,
  441. // 选中数组
  442. ids: [],
  443. // 非单个禁用
  444. single: true,
  445. // 非多个禁用
  446. multiple: true,
  447. // 显示搜索条件
  448. showSearch: true,
  449. // 总条数
  450. total: 0,
  451. // 用户表格数据
  452. userList: null,
  453. // 弹出层标题
  454. title: "",
  455. // 是否显示弹出层
  456. open: false,
  457. // 部门名称
  458. deptName: undefined,
  459. // 默认密码
  460. initPassword: undefined,
  461. // 日期范围
  462. dateRange: [],
  463. // 岗位选项
  464. postOptions: [],
  465. // 角色选项
  466. roleOptions: [],
  467. // 表单参数
  468. form: {},
  469. defaultProps: {
  470. children: "children",
  471. label: "label"
  472. },
  473. // 查询参数
  474. queryParams: {
  475. pageNum: 1,
  476. pageSize: 10,
  477. userName: undefined,
  478. phonenumber: undefined,
  479. status: undefined,
  480. },
  481. // 列信息
  482. columns: [
  483. { key: 0, label: `编号`, visible: true },
  484. { key: 1, label: `班级名称`, visible: true },
  485. { key: 2, label: `专业`, visible: true },
  486. { key: 3, label: `备注`, visible: true },
  487. { key: 4, label: `创建时间`, visible: true }
  488. ],
  489. tab_columns: [
  490. { key: 0, label: `座号`, visible: true },
  491. { key: 1, label: `模拟器状态`, visible: true },
  492. { key: 2, label: `学员学号`, visible: true },
  493. { key: 3, label: `学员姓名`, visible: true },
  494. { key: 4, label: `考试状态`, visible: true },
  495. { key: 5, label: `考试成绩`, visible: true },
  496. { key: 6, label: `出题题目`, visible: true },
  497. { key: 7, label: `故障现象`, visible: true },
  498. { key: 8, label: `可能原因`, visible: true },
  499. { key: 9, label: `故障部位`, visible: true },
  500. { key: 10, label: `排除方法`, visible: true },
  501. { key: 11, label: `修复结论`, visible: true },
  502. ],
  503. };
  504. },
  505. watch: {
  506. // 根据名称筛选部门树
  507. deptName(val) {
  508. this.$refs.tree.filter(val);
  509. }
  510. },
  511. created() {
  512. this.getList();
  513. // this.getDeptTree();
  514. this.getConfigKey("sys.user.initPassword").then(response => {
  515. this.initPassword = response.msg;
  516. });
  517. },
  518. methods: {
  519. // 刷新
  520. refreshTable1(){
  521. this.loading = true;
  522. listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  523. this.userList = response.rows;
  524. this.total = response.total;
  525. this.loading = false;
  526. }
  527. );
  528. },
  529. /** 查询用户列表 */
  530. getList() {
  531. this.loading = true;
  532. listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  533. this.userList = response.rows;
  534. this.total = response.total;
  535. this.loading = false;
  536. }
  537. );
  538. },
  539. // 筛选节点
  540. filterNode(value, data) {
  541. if (!value) return true;
  542. return data.label.indexOf(value) !== -1;
  543. },
  544. // 取消按钮
  545. cancel() {
  546. this.open = false;
  547. this.reset();
  548. },
  549. // 表单重置
  550. reset() {
  551. this.form = {
  552. userId: undefined,
  553. userName: undefined,
  554. nickName: undefined,
  555. password: undefined,
  556. phonenumber: undefined,
  557. email: undefined,
  558. sex: undefined,
  559. status: "0",
  560. remark: undefined,
  561. postIds: [],
  562. roleIds: []
  563. };
  564. this.resetForm("form");
  565. },
  566. /** 搜索按钮操作 */
  567. handleQuery() {
  568. this.queryParams.pageNum = 1;
  569. this.getList();
  570. },
  571. /** 重置按钮操作 */
  572. resetQuery() {
  573. this.dateRange = [];
  574. this.resetForm("queryForm");
  575. this.$refs.tree.setCurrentKey(null);
  576. },
  577. // 多选框选中数据
  578. handleSelectionChange(selection) {
  579. this.ids = selection.map(item => item.userId);
  580. this.single = selection.length != 1;
  581. this.multiple = !selection.length;
  582. },
  583. /** 提交按钮 */
  584. submitForm: function() {
  585. this.$refs["form"].validate(valid => {
  586. if (valid) {
  587. if (this.form.userId != undefined) {
  588. updateUser(this.form).then(response => {
  589. this.$modal.msgSuccess("修改成功");
  590. this.open = false;
  591. this.getList();
  592. });
  593. } else {
  594. addUser(this.form).then(response => {
  595. this.$modal.msgSuccess("新增成功");
  596. this.open = false;
  597. this.getList();
  598. });
  599. }
  600. }
  601. });
  602. },
  603. }
  604. };
  605. </script>