index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <!--用户数据1-->
  5. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  6. <el-form-item label="考试名称" prop="userName">
  7. <el-input
  8. v-model="queryParams.userName"
  9. placeholder="请输入考试名称"
  10. clearable
  11. style="width: 150px"
  12. @keyup.enter.native="handleQuery"
  13. />
  14. </el-form-item>
  15. <el-form-item label="考试状态" prop="status">
  16. <el-select
  17. v-model="queryParams.status"
  18. placeholder="考试状态"
  19. clearable
  20. style="width: 150px"
  21. >
  22. <el-option
  23. v-for="dict in dict.type.sys_normal_disable"
  24. :key="dict.value"
  25. :label="dict.label"
  26. :value="dict.value"
  27. />
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="考试时间">
  31. <el-date-picker
  32. v-model="dateRange"
  33. style="width: 240px"
  34. value-format="yyyy-MM-dd"
  35. type="daterange"
  36. range-separator="-"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. ></el-date-picker>
  40. </el-form-item>
  41. <el-form-item label="模拟器类型" prop="userName">
  42. <el-input
  43. v-model="queryParams.userName"
  44. placeholder="请输入模拟器类型"
  45. clearable
  46. style="width: 240px"
  47. @keyup.enter.native="handleQuery"
  48. />
  49. </el-form-item>
  50. <el-form-item label="创建时间">
  51. <el-date-picker
  52. style="width: 240px"
  53. value-format="yyyy-MM-dd"
  54. type="daterange"
  55. range-separator="-"
  56. start-placeholder="开始日期"
  57. end-placeholder="结束日期"
  58. ></el-date-picker>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  62. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  63. </el-form-item>
  64. </el-form>
  65. <el-row :gutter="10" class="mb8">
  66. <el-col :span="1.5">
  67. <el-button
  68. type="primary"
  69. plain
  70. icon="el-icon-plus"
  71. size="mini"
  72. @click="handleAdd"
  73. v-hasPermi="['simulator:task:add']"
  74. >新增</el-button>
  75. </el-col>
  76. <el-col :span="1.5">
  77. <el-button
  78. type="success"
  79. plain
  80. icon="el-icon-edit"
  81. size="mini"
  82. :disabled="single"
  83. @click="handleUpdate"
  84. v-hasPermi="['simulator:user:edit']"
  85. >修改</el-button>
  86. </el-col>
  87. <el-col :span="1.5">
  88. <el-button
  89. type="danger"
  90. plain
  91. icon="el-icon-delete"
  92. size="mini"
  93. :disabled="multiple"
  94. @click="handleDelete"
  95. v-hasPermi="['simulator:user:remove']"
  96. >删除</el-button>
  97. </el-col>
  98. <el-col :span="1.5">
  99. <el-button
  100. type="warning"
  101. plain
  102. icon="el-icon-s-operation"
  103. size="mini"
  104. :disabled="single"
  105. @click="handleKaoshi"
  106. >当前考试</el-button>
  107. </el-col>
  108. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
  109. </el-row>
  110. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  111. <el-table-column type="selection" width="50" align="center" />
  112. <!-- <el-table-column label="编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> -->
  113. <el-table-column label="考试名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  114. <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[2].visible" :show-overflow-tooltip="true" />
  115. <el-table-column label="模拟器类型" align="center" key="liexing" prop="liexing" v-if="columns[3].visible" :show-overflow-tooltip="true" />
  116. <el-table-column label="创建老师" align="center" key="creater" prop="creater" v-if="columns[4].visible" :show-overflow-tooltip="true" />
  117. <el-table-column label="考试状态" align="center" key="status" v-if="columns[5].visible">
  118. <template slot-scope="scope">
  119. <el-switch
  120. v-model="scope.row.status"
  121. active-value="0"
  122. inactive-value="1"
  123. @change="handleStatusChange(scope.row)"
  124. ></el-switch>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
  128. <template slot-scope="scope">
  129. <span>{{ parseTime(scope.row.createTime) }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column
  133. label="操作"
  134. align="center"
  135. width="160"
  136. class-name="small-padding fixed-width"
  137. >
  138. <template slot-scope="scope">
  139. <el-button
  140. size="mini"
  141. type="text"
  142. icon="el-icon-edit"
  143. @click="handleUpdate(scope.row)"
  144. v-hasPermi="['simulator:user:edit']"
  145. >修改</el-button>
  146. <el-button
  147. size="mini"
  148. type="text"
  149. icon="el-icon-delete"
  150. @click="handleDelete(scope.row)"
  151. v-hasPermi="['simulator:user:remove']"
  152. >删除</el-button>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <pagination
  157. v-show="total>0"
  158. :total="total"
  159. :page.sync="queryParams.pageNum"
  160. :limit.sync="queryParams.pageSize"
  161. @pagination="getList"
  162. />
  163. </el-row>
  164. <!-- 添加或修改用户配置对话框 -->
  165. <el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
  166. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  167. <el-row>
  168. <el-col :span="12">
  169. <el-form-item label="型号">
  170. <el-select v-model="selectedEquip" placeholder="请选择模拟器类型" style="width: 100%;">
  171. <el-option
  172. value="请选择"
  173. >请选择</el-option>
  174. <el-option
  175. v-for="dict in dict.type.sim_equip_type"
  176. :key="dict.value"
  177. :label="dict.label"
  178. :value="dict.value"
  179. ></el-option>
  180. </el-select>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="12">
  184. <el-form-item label="出题方式" prop="userName">
  185. <el-select v-model="selectedEquip" placeholder="请选择出题方式" style="width: 70%;">
  186. <el-option
  187. value="请选择"
  188. >请选择</el-option>
  189. <el-option
  190. v-for="dict in dict.type.sim_equip_type"
  191. :key="dict.value"
  192. :label="dict.label"
  193. :value="dict.value"
  194. ></el-option>
  195. </el-select>
  196. <el-button type="primary" round style="margin-left: 5%;" @click="handleSelectType">自选考题编辑</el-button>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="12">
  200. <el-form-item label="日期范围" prop="field101">
  201. <el-date-picker type="daterange" v-model="form.field101" format="yyyy-MM-dd"
  202. value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始日期" end-placeholder="结束日期"
  203. range-separator="至" clearable></el-date-picker>
  204. </el-form-item>
  205. </el-col>
  206. <el-col :span="12">
  207. <el-form-item label="考试名称" prop="userName">
  208. <el-input placeholder="请输入考试名称" maxlength="30" />
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="12">
  212. <el-form-item label="考试时长" prop="userName">
  213. <el-input placeholder="请输入考试时长" maxlength="30" />
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. </el-form>
  218. <el-descriptions title="班级列表" :column="3" ></el-descriptions>
  219. <el-row :gutter="20">
  220. <el-col :xs="24">
  221. <el-row :gutter="10" class="mb8">
  222. <el-col :span="1.5">
  223. <el-button
  224. type="primary"
  225. plain
  226. icon="el-icon-plus"
  227. size="mini"
  228. @click="handleAdd"
  229. v-hasPermi="['system:user:add']"
  230. >添加</el-button>
  231. </el-col>
  232. <el-col :span="1.5">
  233. <el-button
  234. type="success"
  235. plain
  236. icon="el-icon-edit"
  237. size="mini"
  238. :disabled="single"
  239. @click="handleUpdate"
  240. v-hasPermi="['system:user:edit']"
  241. >修改</el-button>
  242. </el-col>
  243. <el-col :span="1.5">
  244. <el-button
  245. type="danger"
  246. plain
  247. icon="el-icon-delete"
  248. size="mini"
  249. :disabled="multiple"
  250. @click="handleDelete"
  251. v-hasPermi="['system:user:remove']"
  252. >删除</el-button>
  253. </el-col>
  254. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
  255. </el-row>
  256. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  257. <el-table-column type="selection" width="50" align="center" />
  258. <el-table-column label="区队/班级" align="center" key="className" prop="className" v-if="columns[0].visible" :show-overflow-tooltip="true" />
  259. <el-table-column label="专业名称" align="center" key="majorName" prop="majorName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  260. <el-table-column label="全部学员数量" align="center" key="remark" prop="remark" v-if="columns[2].visible" :show-overflow-tooltip="true" />
  261. <el-table-column
  262. label="操作"
  263. align="center"
  264. width="160"
  265. class-name="small-padding fixed-width"
  266. >
  267. <template slot-scope="scope">
  268. <el-button
  269. size="mini"
  270. type="text"
  271. icon="el-icon-edit"
  272. @click="handleUpdate(scope.row)"
  273. v-hasPermi="['system:user:edit']"
  274. >修改</el-button>
  275. <el-button
  276. size="mini"
  277. type="text"
  278. icon="el-icon-delete"
  279. @click="handleDelete(scope.row)"
  280. v-hasPermi="['system:user:remove']"
  281. >删除</el-button>
  282. </template>
  283. </el-table-column>
  284. </el-table>
  285. <pagination
  286. v-show="total>0"
  287. :total="total"
  288. :page.sync="queryParams.pageNum"
  289. :limit.sync="queryParams.pageSize"
  290. @pagination="getList"
  291. />
  292. </el-col>
  293. </el-row>
  294. <h4 class="h4" style="font-size: 16px;font-weight: bold;margin-left: 2%;">统计情况</h4>
  295. <div class="shixiang">
  296. <div>本次考试班级数量:2</div>
  297. <div>计划参加考试学员数量:34</div>
  298. <div>每批次考试学员数量:34</div>
  299. <div>计划考试批次:5</div>
  300. </div>
  301. <div slot="footer" class="dialog-footer" style="margin-top: 10%;">
  302. <el-button type="primary" @click="submitForm">添加考试</el-button>
  303. <el-button @click="cancel">取 消</el-button>
  304. </div>
  305. </el-dialog>
  306. <!-- 自选题目编辑 -->
  307. <el-dialog :title="title" :visible.sync="selectopen" width="70%" append-to-body>
  308. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  309. <el-row>
  310. <el-col :span="12">
  311. <el-form-item label="型号">
  312. <el-select v-model="selectedEquip" placeholder="请选择模拟器型号">
  313. <el-option
  314. value="请选择"
  315. >请选择</el-option>
  316. <el-option
  317. v-for="dict in dict.type.sim_equip_type"
  318. :key="dict.value"
  319. :label="dict.label"
  320. :value="dict.value"
  321. ></el-option>
  322. </el-select>
  323. </el-form-item>
  324. </el-col>
  325. <div style="text-align: right;">
  326. <el-button @click="toggleSelection(tableData_tm)">选择全部</el-button>
  327. <el-button @click="toggleSelection()">取消选择</el-button>
  328. </div>
  329. </el-row>
  330. <el-table
  331. :data="tableData_tm" border ref="multipleTable" @selection-change="handleSelectionRow"
  332. :span-method="objectSpanMethod"
  333. style="width:100%;text-align:center;margin-left:10px; margin-top:10px">
  334. <el-table-column
  335. prop="xinghao"
  336. label="型号">
  337. </el-table-column>
  338. <el-table-column
  339. prop="xianxiang"
  340. label="故障现象">
  341. </el-table-column>
  342. <el-table-column
  343. prop="name"
  344. label="故障部位">
  345. </el-table-column>
  346. <el-table-column
  347. type="selection" prop="ids"
  348. label="ID"
  349. width="55"></el-table-column>
  350. </el-table>
  351. </el-form>
  352. <div slot="footer" class="dialog-footer">
  353. <el-button type="primary" @click="submitForm">确定</el-button>
  354. <el-button @click="cancel">取 消</el-button>
  355. </div>
  356. </el-dialog>
  357. </div>
  358. </template>
  359. <style>
  360. .el-table__header tr th .cell{
  361. text-align: center;
  362. }
  363. .el-table__row .cell {
  364. text-align: center;
  365. }
  366. .shixiang{
  367. margin-left: 2%;
  368. height: 30px;
  369. line-height: 30px;
  370. padding-left: 0%;
  371. }
  372. </style>
  373. <script>
  374. import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
  375. import { getToken } from "@/utils/auth";
  376. import Treeselect from "@riophae/vue-treeselect";
  377. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  378. export default {
  379. name: "Task",
  380. dicts: ['sim_equip_type'],
  381. components: { Treeselect },
  382. data() {
  383. return {
  384. multipleSelection: [],
  385. selectedEquip: '',
  386. selectedZjEquip: '',
  387. tableData_tm: [
  388. {
  389. ids:1,
  390. xinghao: 'FZD04B型侦毒器',
  391. xianxiang: '开机无响应',
  392. name: '1.电源开关',
  393. },{
  394. ids:2,
  395. name: '2.DC/DC转换芯片',
  396. },{
  397. ids:3,
  398. xianxiang: '开机后按抽气开关,微电机不工作',
  399. name: '3.微电机',
  400. },{
  401. ids:4,
  402. name: '4.Q2',
  403. },{
  404. ids:5,
  405. xianxiang: '抽气流量不足',
  406. name: '5.滤网',
  407. },{
  408. ids:6,
  409. name: '6.调速电位器',
  410. },{
  411. ids:7,
  412. xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
  413. name: '7.加热指示灯',
  414. },{
  415. ids:8,
  416. name: '8.热敏开关',
  417. },
  418. {
  419. ids:9,
  420. xianxiang: '不能正常工作',
  421. name: '9.外壳及零件',
  422. },{
  423. ids:10,
  424. xianxiang: '电压低',
  425. name: '10.供电模块',
  426. },{
  427. ids:11,
  428. xianxiang: '抽气指示灯不亮',
  429. name: '11.抽气指示灯',
  430. },
  431. {
  432. ids:21,
  433. xinghao:'FZB006型毒剂报警器',
  434. xianxiang: '仪器无法开机',
  435. name: '1.薄膜开关FPC排线',
  436. },{
  437. ids:22,
  438. name: '2.主控板开机电路',
  439. },
  440. {
  441. ids:23,
  442. xianxiang: '蜂鸣器自检时,声音异常',
  443. name: '3.蜂鸣器出声口',
  444. },{
  445. ids:24,
  446. name: '4.接口接线板',
  447. },{
  448. ids:25,
  449. xianxiang: '仪器进入检测界面后,通入检测剂不报警',
  450. name: '5.检测剂',
  451. },{
  452. ids:26,
  453. name: '6.主控板信号采集电路',
  454. },
  455. {
  456. ids:27,
  457. xianxiang: '显示屏无显示',
  458. name: '7.主控板显示屏供电电路',
  459. },{
  460. ids:28,
  461. name: '8.显示屏',
  462. },
  463. {
  464. ids:29,
  465. xianxiang: '长时间不进入“检测中”',
  466. name: '9.干燥管',
  467. },{
  468. ids:210,
  469. name: '10.维护管',
  470. },
  471. {
  472. ids:211,
  473. xianxiang: '不能正常工作',
  474. name: '11.外壳及零件',
  475. },{
  476. ids:212,
  477. xianxiang: '电压低',
  478. name: '12.供电模块',
  479. },{
  480. ids:213,
  481. xianxiang: '无法开机',
  482. name: '13.DC/DC',
  483. },
  484. {
  485. ids:31,
  486. xinghao: '防化兵用毒剂报警器',
  487. xianxiang: '仪器无法开机',
  488. name: '1.FFC排线',
  489. },{
  490. ids:32,
  491. name: '2.汇总主控板',
  492. },{
  493. ids:33,
  494. xianxiang: '开机后,显示屏无显示',
  495. name: '3.显控报警板',
  496. },{
  497. ids:34,
  498. name: '4.显示屏',
  499. },{
  500. ids:35,
  501. xianxiang: '检测状态下模拟剂不报警',
  502. name: '5.汇总主控板信号采集电路',
  503. },{
  504. ids:36,
  505. name: '6.检测剂',
  506. },{
  507. ids:37,
  508. xianxiang: '长时间不能进入检测状态',
  509. name: '7.干燥管',
  510. },{
  511. ids:38,
  512. name: '8.维护管',
  513. },{
  514. ids:39,
  515. xianxiang: '固液检测/气体检测模式切换失败',
  516. name: '9.固液检测单元与主控板连接线',
  517. },{
  518. ids:310,
  519. name: '10.汇总主控板固液通信电路',
  520. },{
  521. ids:311,
  522. name: '11.切换按键',
  523. },{
  524. ids:312,
  525. xianxiang: '有毒有害气体检测模块不报警',
  526. name: '12.高压驱动板与汇总主控板连接线',
  527. },{
  528. ids:313,
  529. name: '13.汇总主控板毒害模块通信电路',
  530. },{
  531. ids:314,
  532. xianxiang: '不能正常工作',
  533. name: '14.外壳及零件',
  534. },{
  535. ids:315,
  536. xianxiang: '电压低',
  537. name: '15.供电模块',
  538. },{
  539. ids:316,
  540. xianxiang: '无法开机',
  541. name: '16.DC/DC',
  542. },
  543. ],
  544. // 遮罩层
  545. loading: true,
  546. // 选中数组
  547. ids: [],
  548. // 非单个禁用
  549. single: true,
  550. // 非多个禁用
  551. multiple: true,
  552. // 显示搜索条件
  553. showSearch: true,
  554. // 总条数
  555. total: 0,
  556. // 用户表格数据
  557. userList: null,
  558. // 弹出层标题
  559. title: "",
  560. // 部门树选项
  561. deptOptions: undefined,
  562. // 是否显示弹出层
  563. open: false,
  564. //自检弹出框
  565. zijianopen:false,
  566. // 自选题目编辑
  567. selectopen:false,
  568. // 部门名称
  569. deptName: undefined,
  570. // 默认密码
  571. initPassword: undefined,
  572. // 日期范围
  573. dateRange: [],
  574. // 岗位选项
  575. postOptions: [],
  576. // 角色选项
  577. roleOptions: [],
  578. // 表单参数
  579. form: {
  580. field101: null,
  581. },
  582. defaultProps: {
  583. children: "children",
  584. label: "label"
  585. },
  586. // 用户导入参数
  587. upload: {
  588. // 是否显示弹出层(用户导入)
  589. open: false,
  590. // 弹出层标题(用户导入)
  591. title: "",
  592. // 是否禁用上传
  593. isUploading: false,
  594. // 是否更新已经存在的用户数据
  595. updateSupport: 0,
  596. // 设置上传的请求头部
  597. headers: { Authorization: "Bearer " + getToken() },
  598. // 上传的地址
  599. url: process.env.VUE_APP_BASE_API + "/simulator/user/importData"
  600. },
  601. // 查询参数
  602. queryParams: {
  603. pageNum: 1,
  604. pageSize: 10,
  605. userName: undefined,
  606. phonenumber: undefined,
  607. status: undefined,
  608. deptId: undefined
  609. },
  610. // 列信息
  611. columns: [
  612. { key: 0, label: `编号`, visible: true },
  613. { key: 1, label: `考试名称`, visible: true },
  614. { key: 2, label: `考试时间`, visible: true },
  615. { key: 3, label: `模拟器类型`, visible: true },
  616. { key: 4, label: `考试状态`, visible: true },
  617. { key: 5, label: `创建老师`, visible: true },
  618. { key: 6, label: `创建时间`, visible: true }
  619. ],
  620. // 表单校验
  621. rules: {
  622. }
  623. };
  624. },
  625. watch: {
  626. // 根据名称筛选部门树
  627. deptName(val) {
  628. this.$refs.tree.filter(val);
  629. },
  630. selectedEquip(newValue) {
  631. // console.log(newValue);
  632. // 根据newValue更新tableData
  633. // this.tableData = this.getNewTableData(newValue);
  634. // console.log(this.getNewTableData(newValue);
  635. if(newValue == 1){
  636. this.tableData_tm = [{
  637. ids:1,
  638. xinghao: 'FZD04B型侦毒器',
  639. xianxiang: '开机无响应',
  640. name: '1.电源开关',
  641. },{
  642. ids:2,
  643. name: '2.DC/DC转换芯片',
  644. },{
  645. ids:3,
  646. xianxiang: '开机后按抽气开关,微电机不工作',
  647. name: '3.微电机',
  648. },{
  649. ids:4,
  650. name: '4.Q2',
  651. },{
  652. ids:5,
  653. xianxiang: '抽气流量不足',
  654. name: '5.滤网',
  655. },{
  656. ids:6,
  657. name: '6.调速电位器',
  658. },{
  659. ids:7,
  660. xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
  661. name: '7.加热指示灯',
  662. },{
  663. ids:8,
  664. name: '8.热敏开关',
  665. },
  666. {
  667. ids:9,
  668. xianxiang: '不能正常工作',
  669. name: '9.外壳及零件',
  670. },{
  671. ids:10,
  672. xianxiang: '电压低',
  673. name: '10.供电模块',
  674. },{
  675. ids:11,
  676. xianxiang: '抽气指示灯不亮',
  677. name: '11.抽气指示灯',
  678. }];
  679. }else if(newValue == 2){
  680. this.tableData_tm = [{
  681. ids:21,
  682. xinghao:'FZB006型毒剂报警器',
  683. xianxiang: '仪器无法开机',
  684. name: '1.薄膜开关FPC排线',
  685. },{
  686. ids:22,
  687. name: '2.主控板开机电路',
  688. },
  689. {
  690. ids:23,
  691. xianxiang: '蜂鸣器自检时,声音异常',
  692. name: '3.蜂鸣器出声口',
  693. },{
  694. ids:24,
  695. name: '4.接口接线板',
  696. },{
  697. ids:25,
  698. xianxiang: '仪器进入检测界面后,通入检测剂不报警',
  699. name: '5.检测剂',
  700. },{
  701. ids:26,
  702. name: '6.主控板信号采集电路',
  703. },
  704. {
  705. ids:27,
  706. xianxiang: '显示屏无显示',
  707. name: '7.主控板显示屏供电电路',
  708. },{
  709. ids:28,
  710. name: '8.显示屏',
  711. },
  712. {
  713. ids:29,
  714. xianxiang: '长时间不进入“检测中”',
  715. name: '9.干燥管',
  716. },{
  717. ids:210,
  718. name: '10.维护管',
  719. },
  720. {
  721. ids:211,
  722. xianxiang: '不能正常工作',
  723. name: '11.外壳及零件',
  724. },{
  725. ids:212,
  726. xianxiang: '电压低',
  727. name: '12.供电模块',
  728. },{
  729. ids:213,
  730. xianxiang: '无法开机',
  731. name: '13.DC/DC',
  732. }]
  733. }else if(newValue == 3){
  734. this.tableData_tm = [{
  735. ids:31,
  736. xinghao: '防化兵用毒剂报警器',
  737. xianxiang: '仪器无法开机',
  738. name: '1.FFC排线',
  739. },{
  740. ids:32,
  741. name: '2.汇总主控板',
  742. },{
  743. ids:33,
  744. xianxiang: '开机后,显示屏无显示',
  745. name: '3.显控报警板',
  746. },{
  747. ids:34,
  748. name: '4.显示屏',
  749. },{
  750. ids:35,
  751. xianxiang: '检测状态下模拟剂不报警',
  752. name: '5.汇总主控板信号采集电路',
  753. },{
  754. ids:36,
  755. name: '6.检测剂',
  756. },{
  757. ids:37,
  758. xianxiang: '长时间不能进入检测状态',
  759. name: '7.干燥管',
  760. },{
  761. ids:38,
  762. name: '8.维护管',
  763. },{
  764. ids:39,
  765. xianxiang: '固液检测/气体检测模式切换失败',
  766. name: '9.固液检测单元与主控板连接线',
  767. },{
  768. ids:310,
  769. name: '10.汇总主控板固液通信电路',
  770. },{
  771. ids:311,
  772. name: '11.切换按键',
  773. },{
  774. ids:312,
  775. xianxiang: '有毒有害气体检测模块不报警',
  776. name: '12.高压驱动板与汇总主控板连接线',
  777. },{
  778. ids:313,
  779. name: '13.汇总主控板毒害模块通信电路',
  780. },{
  781. ids:314,
  782. xianxiang: '不能正常工作',
  783. name: '14.外壳及零件',
  784. },{
  785. ids:315,
  786. xianxiang: '电压低',
  787. name: '15.供电模块',
  788. },{
  789. ids:316,
  790. xianxiang: '无法开机',
  791. name: '16.DC/DC',
  792. }]
  793. }
  794. },
  795. },
  796. created() {
  797. this.getList();
  798. //this.getDeptTree();
  799. this.getConfigKey("sys.user.initPassword").then(response => {
  800. this.initPassword = response.msg;
  801. });
  802. },
  803. methods: {
  804. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  805. // console.log(this.selectedEquip+'@@@')
  806. //第一列型号
  807. if(columnIndex === 0) {
  808. if(this.selectedEquip==2){
  809. if(rowIndex==0){
  810. return { rowspan: 13, colspan: 1 };
  811. }
  812. return { rowspan: 0, colspan: 0 };
  813. }else if(this.selectedEquip==3){
  814. if(rowIndex==0){
  815. return { rowspan: 16, colspan: 1 };
  816. }
  817. return { rowspan: 0, colspan: 0};
  818. }else{
  819. if(rowIndex==0){
  820. return { rowspan: 11, colspan: 1 };
  821. }else if(rowIndex==11){
  822. return { rowspan: 13, colspan: 1 };
  823. }else if(rowIndex==24){
  824. return { rowspan: 16, colspan: 1 };
  825. }else{
  826. return { rowspan: 0, colspan: 0 };
  827. }
  828. }
  829. }
  830. //第二列故障现象
  831. if(columnIndex === 1) {
  832. if(this.selectedEquip==2){
  833. // console.log(rowIndex+'####')
  834. if(rowIndex<9 && rowIndex % 2 === 0){
  835. return { rowspan: 2, colspan: 1 };
  836. }else if((rowIndex>9&&rowIndex<13)){
  837. return { rowspan: 1, colspan: 1 };
  838. }else{
  839. return { rowspan: 0, colspan: 0 };
  840. }
  841. }else if(this.selectedEquip==3){
  842. if(rowIndex<7 && rowIndex % 2 === 0){
  843. return { rowspan: 2, colspan: 1 };
  844. }else if((rowIndex==8)){
  845. return { rowspan: 3, colspan: 1 };
  846. }else if(rowIndex==11){
  847. return { rowspan: 2, colspan: 1 };
  848. }else if(rowIndex>12 && rowIndex<16){
  849. return { rowspan: 1, colspan: 1 };
  850. }else{
  851. return { rowspan: 0, colspan: 0 };
  852. }
  853. }else{
  854. if(rowIndex<7 && rowIndex % 2 === 0){
  855. return { rowspan: 2, colspan: 1 };
  856. }else if((rowIndex>7&&rowIndex<11) || (rowIndex>20&&rowIndex<24) || (rowIndex>36)){
  857. return { rowspan: 1, colspan: 1 };
  858. }else if((rowIndex==35) || (rowIndex>10 && rowIndex<20) && rowIndex % 2 === 1){
  859. return { rowspan: 2, colspan: 1 };
  860. }else if(rowIndex>23 && rowIndex<32 && rowIndex % 2 === 0){
  861. return { rowspan: 2, colspan: 1 };
  862. }else if(rowIndex==32){
  863. return { rowspan: 3, colspan: 1 };
  864. }else{
  865. return { rowspan: 0, colspan: 0 };
  866. }
  867. }
  868. }
  869. //故障部位 和 选择
  870. if(columnIndex === 2 || columnIndex === 3){
  871. //return { rowspan: 1, colspan: 1 };
  872. }
  873. },
  874. handleSelectionRow(val) {
  875. this.multipleSelection = val;
  876. },
  877. // 根据选择的option获取新的数据
  878. // getNewTableData(option) {
  879. // // 逻辑处理返回新的数据数组
  880. // return [
  881. // // ...新数据
  882. // ];
  883. // },
  884. toggleSelection(rows) {
  885. if (rows) {
  886. rows.forEach(row => {
  887. this.$refs.multipleTable.toggleRowSelection(row);
  888. console.log(row.ids+'###')
  889. console.log(row.name+'@@@')
  890. });
  891. } else {
  892. this.$refs.multipleTable.clearSelection();
  893. }
  894. },
  895. handleSelectionRow(val) {
  896. this.multipleSelection = val;
  897. },
  898. /** 查询用户列表 */
  899. getList() {
  900. this.loading = true;
  901. listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  902. //将返回值注释
  903. this.userList = response.rows;
  904. this.total = response.total;
  905. this.loading = false;
  906. }
  907. );
  908. },
  909. /** 查询部门下拉树结构 */
  910. getDeptTree() {
  911. deptTreeSelect().then(response => {
  912. this.deptOptions = response.data;
  913. });
  914. },
  915. // 筛选节点
  916. filterNode(value, data) {
  917. if (!value) return true;
  918. return data.label.indexOf(value) !== -1;
  919. },
  920. // 节点单击事件
  921. handleNodeClick(data) {
  922. this.queryParams.deptId = data.id;
  923. this.handleQuery();
  924. },
  925. // 用户状态修改
  926. handleStatusChange(row) {
  927. let text = row.status === "0" ? "启用" : "停用";
  928. this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
  929. return changeUserStatus(row.userId, row.status);
  930. }).then(() => {
  931. this.$modal.msgSuccess(text + "成功");
  932. }).catch(function() {
  933. row.status = row.status === "0" ? "1" : "0";
  934. });
  935. },
  936. // 取消按钮
  937. cancel() {
  938. this.open = false;
  939. this.zijianopen = false;
  940. this.selectopen = false;
  941. this.reset();
  942. },
  943. // 表单重置
  944. reset() {
  945. this.form = {
  946. userId: undefined,
  947. deptId: undefined,
  948. userName: undefined,
  949. password: undefined,
  950. phonenumber: undefined,
  951. email: undefined,
  952. sex: undefined,
  953. status: "0",
  954. remark: undefined,
  955. postIds: [],
  956. roleIds: []
  957. };
  958. this.resetForm("form");
  959. },
  960. /** 搜索按钮操作 */
  961. handleQuery() {
  962. this.queryParams.pageNum = 1;
  963. this.getList();
  964. },
  965. /** 重置按钮操作 */
  966. resetQuery() {
  967. this.dateRange = [];
  968. this.resetForm("queryForm");
  969. this.queryParams.deptId = undefined;
  970. this.$refs.tree.setCurrentKey(null);
  971. this.handleQuery();
  972. },
  973. // 多选框选中数据
  974. handleSelectionChange(selection) {
  975. this.ids = selection.map(item => item.userId);
  976. this.single = selection.length != 1;
  977. this.multiple = !selection.length;
  978. },
  979. /** 新增按钮操作 */
  980. handleAdd() {
  981. this.reset();
  982. getUser().then(response => {
  983. this.postOptions = response.posts;
  984. this.roleOptions = response.roles;
  985. this.open = true;
  986. this.title = "新增考试";
  987. this.form.password = this.initPassword;
  988. });
  989. },
  990. /** 修改按钮操作 */
  991. handleUpdate(row) {
  992. this.reset();
  993. const userId = row.userId || this.ids;
  994. getUser(userId).then(response => {
  995. this.form = response.data;
  996. this.postOptions = response.posts;
  997. this.roleOptions = response.roles;
  998. this.$set(this.form, "postIds", response.postIds);
  999. this.$set(this.form, "roleIds", response.roleIds);
  1000. this.open = true;
  1001. this.title = "修改用户";
  1002. this.form.password = "";
  1003. });
  1004. },
  1005. /** 当前考试查询 */
  1006. handleKaoshi(row) {
  1007. const kaoshiId = row.jobId || 0;
  1008. this.$router.push('/peoples/present/ids/' + kaoshiId)
  1009. },
  1010. /** 总选题目编辑按钮操作 */
  1011. handleSelectType(row) {
  1012. this.reset();
  1013. const userId = row.userId || this.ids;
  1014. getUser(userId).then(response => {
  1015. this.form = response.data;
  1016. this.selectopen = true;
  1017. // this.open = false;
  1018. this.title = "选择考题";
  1019. });
  1020. },
  1021. /** 提交按钮 */
  1022. submitForm: function() {
  1023. this.$refs["form"].validate(valid => {
  1024. if (valid) {
  1025. if (this.form.userId != undefined) {
  1026. updateUser(this.form).then(response => {
  1027. this.$modal.msgSuccess("修改成功");
  1028. this.open = false;
  1029. this.getList();
  1030. });
  1031. } else {
  1032. addUser(this.form).then(response => {
  1033. this.$modal.msgSuccess("新增成功");
  1034. this.open = false;
  1035. this.getList();
  1036. });
  1037. }
  1038. }
  1039. });
  1040. },
  1041. /** 删除按钮操作 */
  1042. handleDelete(row) {
  1043. const userIds = row.userId || this.ids;
  1044. this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
  1045. return delUser(userIds);
  1046. }).then(() => {
  1047. this.getList();
  1048. this.$modal.msgSuccess("删除成功");
  1049. }).catch(() => {});
  1050. },
  1051. }
  1052. };
  1053. </script>