byTrainee.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226
  1. <template>
  2. <div id="byTrainee">
  3. <div class="dis_fs">
  4. <div class="dis_left">
  5. <div class="dis_fs">
  6. <input type="text" class="inputSty" v-model="formData.searchKey" />
  7. <div class="btnSearchSty" @click="getStudent">查询</div>
  8. <div class="btnSearchSty" @click="getStudent(1)">重置</div>
  9. </div>
  10. <ul>
  11. <li
  12. class="listy"
  13. :class="active === item.userId ? 'active' : ''"
  14. v-for="(item, index) in studentList"
  15. :key="index"
  16. @click="changeNewActive(item)"
  17. >
  18. {{ item.realname }} {{ item.idCard }}
  19. </li>
  20. </ul>
  21. <el-pagination
  22. style="text-align: center"
  23. small
  24. layout="prev, pager, next"
  25. :total="total"
  26. :current-page.sync="formData.pageNum"
  27. @current-change="handleCurrentChange"
  28. >
  29. </el-pagination>
  30. </div>
  31. <div class="dis_right" v-if="active">
  32. <el-table
  33. ref="multipleTable"
  34. :data="tableData"
  35. border
  36. :header-cell-style="{
  37. 'background-color': '#eee',
  38. padding: '8px',
  39. color: '#333',
  40. }"
  41. @expand-change="expandChange"
  42. >
  43. <!-- 插槽 -->
  44. <el-table-column type="expand">
  45. <template slot-scope="props">
  46. <el-table
  47. ref="multipleTable"
  48. :data="props.row.children"
  49. border
  50. :header-cell-style="{
  51. 'background-color': '#eee',
  52. padding: '8px',
  53. color: '#333',
  54. }"
  55. >
  56. <el-table-column
  57. v-for="(item, index) in tableSet"
  58. :width="item.width"
  59. :key="index"
  60. :label="item.label"
  61. align="center"
  62. :show-overflow-tooltip="true"
  63. header-align="center"
  64. >
  65. <template slot-scope="scope">
  66. <div v-if="item.scope === 'isOptions'">
  67. <template v-for="(itemt, indext) in item.options">
  68. <span
  69. :key="indext"
  70. v-if="itemt.value === scope.row[item.prop]"
  71. >{{ itemt.label }}</span
  72. >
  73. </template>
  74. </div>
  75. <div v-else-if="item.scope === 'resultType'">
  76. {{ scope.row[item.prop1] }}
  77. <span
  78. :style="
  79. scope.row[item.prop2] === 1
  80. ? 'color:purple'
  81. : scope.row[item.prop2] === 0
  82. ? 'color:red;'
  83. : ''
  84. "
  85. >
  86. {{
  87. scope.row[item.prop2] === 1
  88. ? "通过"
  89. : scope.row[item.prop2] === 0
  90. ? "不通过"
  91. : ""
  92. }}
  93. </span>
  94. </div>
  95. <div v-else-if="item.scope === 'goodsInfos'">
  96. {{
  97. scope.row[item.prop1] +
  98. "-" +
  99. scope.row[item.prop2] +
  100. "-"
  101. }}<span style="color: red"
  102. >¥{{ scope.row[item.prop3] }}</span
  103. >
  104. </div>
  105. <div v-else-if="item.scope === 'applyInfos'">
  106. <div>{{ scope.row[item.prop] }}</div>
  107. {{
  108. $methodsTools.onlyForma(scope.row[item.prop1], false)
  109. }}
  110. {{
  111. scope.row[item.prop2]
  112. ? scope.row[item.prop2].replace("-", ":")
  113. : ""
  114. }}-{{
  115. scope.row[item.prop3]
  116. ? scope.row[item.prop3].replace("-", ":")
  117. : ""
  118. }}
  119. </div>
  120. <span v-else-if="item.scope === 'aTimeList'">{{
  121. scope.row[item.prop] === null
  122. ? "--"
  123. : $methodsTools.onlyForma(scope.row[item.prop])
  124. }}</span>
  125. <div v-else>{{ scope.row[item.prop] }}</div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column
  129. label="操作"
  130. align="center"
  131. fixed="right"
  132. width="180px"
  133. v-if="false"
  134. >
  135. <template slot-scope="scope">
  136. <el-button
  137. type="text"
  138. :disabled="
  139. scope.row.subscribeStatus === 2 ||
  140. scope.row.examStatus !== 0
  141. "
  142. @click="openClearYX(scope.row)"
  143. >取消预约</el-button
  144. ><el-button
  145. type="text"
  146. :disabled="scope.row.subscribeStatus === 2"
  147. @click="editExam(scope.row)"
  148. >考试登记</el-button
  149. ><el-button
  150. type="text"
  151. :disabled="scope.row.subscribeStatus === 2"
  152. @click="openZS(scope.row)"
  153. >成绩和证书登记</el-button
  154. >
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. </template></el-table-column
  159. >
  160. <!-- 插槽 -->
  161. <template v-for="(item, index) in tableList">
  162. <el-table-column
  163. v-if="item.scope !== 'inputs'"
  164. :width="item.width"
  165. :key="index"
  166. :label="item.label"
  167. align="center"
  168. :show-overflow-tooltip="true"
  169. header-align="center"
  170. >
  171. <template slot-scope="scope">
  172. <div v-if="item.scope === 'goodsName'">
  173. {{ scope.row[item.prop1] }}-{{ scope.row[item.prop2] }}-
  174. <span style="color: red">¥{{ scope.row[item.prop3] }}</span>
  175. </div>
  176. <div v-else-if="item.scope === 'numTypes'">
  177. 总:{{ scope.row[item.prop1] }} 消耗:{{
  178. scope.row[item.prop2]
  179. }}
  180. 剩余:{{ scope.row[item.prop1] - scope.row[item.prop2] }}
  181. <el-button type="text" @click="seeInfos(scope.row, item.type)"
  182. >查看</el-button
  183. >
  184. </div></template
  185. >
  186. </el-table-column></template
  187. >
  188. </el-table>
  189. <pagination
  190. :total="totalRight"
  191. :pageSize="tabSearchData.pageSize"
  192. :currentPage="tabSearchData.pageNum"
  193. @handleSizeChange="handleSizeChange"
  194. @handleCurrentChange="handleCurrentChanges"
  195. />
  196. </div>
  197. <p v-else style="text-align: center; width: 100%">请选择学员</p>
  198. </div>
  199. <el-dialog
  200. :visible.sync="dialogCG"
  201. width="560px"
  202. :show-close="false"
  203. :close-on-click-modal="false"
  204. >
  205. <div slot="title" class="hearders">
  206. <div class="leftTitle">考试登记</div>
  207. <div class="rightBoxs">
  208. <img
  209. src="@/assets/images/Close@2x.png"
  210. alt=""
  211. @click="dialogCG = false"
  212. />
  213. </div>
  214. </div>
  215. <div>
  216. <div class="aListBottom">{{ listData.realname }}</div>
  217. <el-form
  218. :model="listData"
  219. label-width="120px"
  220. class="demo-ruleForm"
  221. :rules="rules"
  222. ref="listData"
  223. >
  224. <el-form-item label="考试登记状态" prop="examStatus">
  225. <el-radio-group v-model="listData.examStatus">
  226. <el-radio :label="1">正常</el-radio>
  227. <el-radio :label="2">缺考</el-radio>
  228. <el-radio :label="3">作弊</el-radio>
  229. <el-radio :label="4">替考</el-radio>
  230. </el-radio-group>
  231. </el-form-item>
  232. <el-form-item label="考试登记补充" prop="remark">
  233. <el-input
  234. v-model="listData.remark"
  235. type="textarea"
  236. :rows="4"
  237. ></el-input>
  238. </el-form-item>
  239. </el-form>
  240. </div>
  241. <span slot="footer" class="dialog-footer">
  242. <el-button @click="dialogCG = false">取消</el-button>
  243. <el-button
  244. :disabled="
  245. listData.performance != null || listData.performance != undefined
  246. "
  247. type="primary"
  248. @click="submitChecks('listData')"
  249. >确定</el-button
  250. >
  251. </span>
  252. </el-dialog>
  253. <el-dialog
  254. :visible.sync="dialogDJ"
  255. width="420px"
  256. :show-close="false"
  257. :close-on-click-modal="false"
  258. >
  259. <div slot="title" class="hearders">
  260. <div class="leftTitle">取消预约</div>
  261. <div class="rightBoxs">
  262. <img
  263. src="@/assets/images/Close@2x.png"
  264. alt=""
  265. @click="dialogDJ = false"
  266. />
  267. </div>
  268. </div>
  269. <div>
  270. <div class="aListBottom">{{ listData.realname }}</div>
  271. <p style="margin: 0px">您确定要取消所选学员的考试预约吗?</p>
  272. <p style="margin: 0px">取消后将无法恢复,请慎重考虑!</p>
  273. </div>
  274. <span slot="footer" class="dialog-footer">
  275. <el-button @click="dialogDJ = false">取消</el-button>
  276. <el-button type="primary" @click="submitChecksDJ">确定</el-button>
  277. </span>
  278. </el-dialog>
  279. <el-dialog
  280. :visible.sync="dialogPLS"
  281. width="460px"
  282. :show-close="false"
  283. :close-on-click-modal="false"
  284. >
  285. <div slot="title" class="hearders">
  286. <div class="leftTitle">成绩和证书登记</div>
  287. <div class="rightBoxs">
  288. <img
  289. src="@/assets/images/Close@2x.png"
  290. alt=""
  291. @click="dialogPLS = false"
  292. />
  293. </div>
  294. </div>
  295. <div>
  296. <div class="aListBottom">{{ listData.realname }}</div>
  297. <el-form label-width="100px">
  298. <el-form-item label="考试成绩" required>
  299. <el-input-number
  300. :controls="false"
  301. v-model="listData.performance"
  302. :min="0"
  303. ></el-input-number
  304. >分
  305. </el-form-item>
  306. <el-form-item label="考试结果" required>
  307. <el-radio-group v-model="listData.result">
  308. <el-radio :label="1">通过</el-radio>
  309. <el-radio :label="0">不通过</el-radio>
  310. </el-radio-group>
  311. </el-form-item>
  312. <el-form-item label="证书编号">
  313. <el-input v-model="listData.certificateCode"></el-input>
  314. </el-form-item>
  315. <el-form-item label="登记补充">
  316. <el-input
  317. v-model="listData.remark"
  318. type="textarea"
  319. :rows="4"
  320. ></el-input>
  321. </el-form-item>
  322. </el-form>
  323. </div>
  324. <span slot="footer" class="dialog-footer">
  325. <el-button @click="dialogPLS = false">取消</el-button>
  326. <el-button type="primary" @click="submitChecksPals">确定</el-button>
  327. </span>
  328. </el-dialog>
  329. <el-dialog
  330. :visible.sync="dialoginfoWatch"
  331. width="760px"
  332. :show-close="false"
  333. :close-on-click-modal="false"
  334. >
  335. <div slot="title" class="hearders">
  336. <div class="leftTitle">
  337. {{
  338. activeInfoType === 1
  339. ? "考试次数"
  340. : activeInfoType === 2
  341. ? "前培次数"
  342. : "未知"
  343. }}
  344. </div>
  345. <div class="rightBoxs">
  346. <img
  347. src="@/assets/images/Close@2x.png"
  348. alt=""
  349. @click="dialoginfoWatch = false"
  350. />
  351. </div>
  352. </div>
  353. <div>
  354. <el-form :model="infoData" class="demo-form-inline" label-width="120px">
  355. <el-button type="info" style="margin-bottom: 20px" size="mini"
  356. >商品自带{{
  357. activeInfoType === 1
  358. ? "考试次数"
  359. : activeInfoType === 2
  360. ? "前培次数"
  361. : "未知"
  362. }}</el-button
  363. >
  364. <el-form-item label="商品名称:">
  365. <span
  366. >{{ infoData.goodsCode }}-{{ infoData.goodsName }}-¥{{
  367. infoData.standPrice
  368. }}</span
  369. >
  370. </el-form-item>
  371. <el-form-item
  372. :label="
  373. activeInfoType === 1
  374. ? '考试次数:'
  375. : activeInfoType === 2
  376. ? '前培次数:'
  377. : '未知'
  378. "
  379. >
  380. <span>{{
  381. activeInfoType === 1
  382. ? infoData.examNumber - infoData.examNumberAll
  383. : activeInfoType === 2
  384. ? infoData.doNumber - infoData.doNumberAll
  385. : ""
  386. }}</span>
  387. </el-form-item>
  388. <div v-if="activeInfoType === 1 && infoData.userExamGoodsSupplement && infoData.userExamGoodsSupplement.length > 0">
  389. <el-button type="info" style="margin-bottom: 20px" size="mini"
  390. >补考商品自带考试次数</el-button
  391. >
  392. <div
  393. v-for="(item, index) in infoData.userExamGoodsSupplement"
  394. :key="index"
  395. >
  396. <el-form-item label="商品名称:">
  397. <span
  398. >{{ item.code }}-{{ item.goodsName }}({{
  399. item.educationName +
  400. "-" +
  401. item.projectName +
  402. "-" +
  403. item.businessName
  404. }})-¥{{ item.standPrice }}</span
  405. >
  406. </el-form-item>
  407. <el-col :span="24"
  408. ><el-form-item label="考试次数:">{{
  409. item.examNumber
  410. }}</el-form-item></el-col
  411. >
  412. <!-- <el-col :span="16"
  413. ><el-form-item label="使用有效期:"
  414. >{{ $methodsTools.onlyForma(item.makeStartTime, false) }}至{{
  415. $methodsTools.onlyForma(item.makeEndTime, false)
  416. }}</el-form-item
  417. ></el-col
  418. > -->
  419. </div>
  420. </div>
  421. <div v-if="activeInfoType === 2 && infoData.userExamGoodsSupplementVos && infoData.userExamGoodsSupplementVos.length > 0">
  422. <el-button type="info" style="margin-bottom: 20px" size="mini"
  423. >前培商品自带前培次数</el-button
  424. >
  425. <div
  426. v-for="(item, index) in infoData.userExamGoodsSupplementVos"
  427. :key="index"
  428. >
  429. <el-form-item label="商品名称:">
  430. <span
  431. >{{ item.code }}-{{ item.goodsName }}({{
  432. item.educationName +
  433. "-" +
  434. item.projectName +
  435. "-" +
  436. item.businessName
  437. }})-¥{{ item.standPrice }}</span
  438. >
  439. </el-form-item>
  440. <el-col :span="24"
  441. ><el-form-item label="前培次数:">{{
  442. item.doNumber
  443. }}</el-form-item></el-col
  444. >
  445. <!-- <el-col :span="16"
  446. ><el-form-item label="使用有效期:"
  447. >{{ $methodsTools.onlyForma(item.makeStartTime, false) }}至{{
  448. $methodsTools.onlyForma(item.makeEndTime, false)
  449. }}</el-form-item
  450. ></el-col
  451. > -->
  452. </div>
  453. </div>
  454. <el-button type="info" style="margin-bottom: 20px" size="mini"
  455. >消耗{{
  456. activeInfoType === 1
  457. ? "考试次数"
  458. : activeInfoType === 2
  459. ? "前培次数"
  460. : "未知"
  461. }}</el-button
  462. >
  463. <el-form-item
  464. :label="
  465. activeInfoType === 1
  466. ? '考试次数:'
  467. : activeInfoType === 2
  468. ? '前培次数:'
  469. : '未知'
  470. "
  471. >
  472. <span>{{
  473. activeInfoType === 1
  474. ? infoData.expendNumber
  475. : activeInfoType === 2
  476. ? infoData.expendBefore
  477. : ""
  478. }}</span>
  479. </el-form-item>
  480. <el-button type="info" style="margin-bottom: 20px" size="mini">{{
  481. activeInfoType === 1
  482. ? "剩余考试次数"
  483. : activeInfoType === 2
  484. ? "剩余前培次数"
  485. : "未知"
  486. }}</el-button>
  487. <el-form-item
  488. :label="
  489. activeInfoType === 1
  490. ? '剩余考试次数:'
  491. : activeInfoType === 2
  492. ? '剩余前培次数:'
  493. : '未知'
  494. "
  495. >
  496. <span>{{
  497. activeInfoType === 1
  498. ? infoData.examNumber - infoData.expendNumber
  499. : activeInfoType === 2
  500. ? infoData.doNumber - infoData.expendBefore
  501. : ""
  502. }}</span>
  503. </el-form-item>
  504. </el-form>
  505. </div>
  506. <span slot="footer" class="dialog-footer">
  507. <el-button @click="dialoginfoWatch = false">取 消</el-button>
  508. </span>
  509. </el-dialog>
  510. </div>
  511. </template>
  512. <script>
  513. import pagination from "@/components/pagination";
  514. export default {
  515. name: "ByTrainee",
  516. components: { pagination },
  517. data() {
  518. return {
  519. active: "",
  520. studentList: [],
  521. formData: {
  522. pageNum: 1,
  523. pageSize: 10,
  524. },
  525. tabSearchData: {
  526. userId: "",
  527. pageNum: 1,
  528. pageSize: 10,
  529. },
  530. totalRight: 0,
  531. tableList: [
  532. {
  533. label: "所购商品",
  534. prop1: "goodsCode",
  535. prop2: "goodsName",
  536. prop3: "standPrice",
  537. scope: "goodsName",
  538. },
  539. {
  540. label: "考试次数",
  541. prop1: "examNumber",
  542. prop2: "expendNumber",
  543. scope: "numTypes",
  544. type: 1,
  545. },
  546. {
  547. label: "前培次数",
  548. prop1: "doNumber",
  549. prop2: "expendBefore",
  550. scope: "numTypes",
  551. type: 2,
  552. },
  553. ],
  554. tableData: [],
  555. tableSet: [
  556. {
  557. label: "预约考试",
  558. prop: "subscribeStatus",
  559. hidden: true,
  560. width: "130px",
  561. scope: "isOptions",
  562. options: [
  563. {
  564. label: "正常",
  565. value: 1,
  566. },
  567. {
  568. label: "取消",
  569. value: 2,
  570. },
  571. ],
  572. },
  573. {
  574. label: "前培标记",
  575. prop: "beforeStatus",
  576. hidden: true,
  577. width: "130px",
  578. scope: "isOptions",
  579. options: [
  580. {
  581. label: "已开通",
  582. value: 1,
  583. },
  584. {
  585. label: "未开通",
  586. value: 0,
  587. },
  588. ],
  589. },
  590. {
  591. label: "考试登记",
  592. prop: "examStatus",
  593. hidden: true,
  594. width: "130px",
  595. scope: "isOptions",
  596. options: [
  597. {
  598. label: "待登记",
  599. value: 0,
  600. },
  601. {
  602. label: "正常",
  603. value: 1,
  604. },
  605. {
  606. label: "缺考",
  607. value: 2,
  608. },
  609. {
  610. label: "作弊",
  611. value: 3,
  612. },
  613. {
  614. label: "替考",
  615. value: 4,
  616. },
  617. ],
  618. },
  619. {
  620. label: "考试成绩和结果",
  621. prop1: "performance",
  622. prop2: "result",
  623. hidden: true,
  624. width: "130px",
  625. scope: "resultType",
  626. },
  627. {
  628. label: "证书编号",
  629. prop: "certificateCode",
  630. hidden: true,
  631. width: "130px",
  632. },
  633. {
  634. label: "考试标题",
  635. prop: "applyName",
  636. hidden: true,
  637. width: "130px",
  638. },
  639. {
  640. label: "学员姓名",
  641. prop: "realname",
  642. hidden: true,
  643. width: "130px",
  644. },
  645. {
  646. label: "学员身份证",
  647. prop: "idCard",
  648. hidden: true,
  649. width: "170px",
  650. },
  651. {
  652. label: "所购商品",
  653. prop1: "goodsCode",
  654. prop2: "goodsName",
  655. prop3: "standPrice",
  656. hidden: true,
  657. width: "220px",
  658. scope: "goodsInfos",
  659. },
  660. {
  661. label: "学员报考类型",
  662. prop: "studentType",
  663. hidden: true,
  664. width: "130px",
  665. scope: "isOptions",
  666. options: [
  667. {
  668. label: "非补考学员",
  669. value: 1,
  670. },
  671. {
  672. label: "补考学员",
  673. value: 2,
  674. },
  675. ],
  676. },
  677. {
  678. label: "所报专业",
  679. prop: "categoryName",
  680. hidden: true,
  681. width: "130px",
  682. },
  683. {
  684. label: "预约场次(考试地点和时间)",
  685. prop: "applySiteAddress",
  686. prop1: "applySiteExamTime",
  687. prop2: "applySiteStartTime",
  688. prop3: "applySiteEndTime",
  689. hidden: true,
  690. width: "280px",
  691. scope: "applyInfos",
  692. },
  693. {
  694. label: "考试次数消耗",
  695. prop: "examExpend",
  696. hidden: true,
  697. width: "130px",
  698. },
  699. {
  700. label: "预约场次(考培地点和时间)",
  701. prop: "applySiteAddressTrain",
  702. prop1: "applySiteExamTrainTime",
  703. prop2: "applySiteStartTrainTime",
  704. prop3: "applySiteEndTrainTime",
  705. hidden: true,
  706. width: "280px",
  707. scope: "applyInfos",
  708. },
  709. {
  710. label: "前培次数消耗",
  711. prop: "beforeExpend",
  712. hidden: true,
  713. width: "130px",
  714. },
  715. {
  716. label: "创建时间",
  717. prop: "createTime",
  718. hidden: true,
  719. scope: "aTimeList",
  720. width: "160px",
  721. },
  722. ],
  723. total: 0,
  724. dialogDJ: false,
  725. dialogCG: false,
  726. dialogPLS: false,
  727. dialoginfoWatch: false,
  728. listData: {},
  729. infoData: {},
  730. activeInfoType: 0, //1考试次数2前培次数---头部标题变化
  731. rules: {
  732. examStatus: [
  733. { required: true, message: "请选择考试登记状态", trigger: "change" },
  734. ],
  735. },
  736. };
  737. },
  738. mounted() {
  739. this.getStudent();
  740. },
  741. activated() {
  742. this.getStudent();
  743. },
  744. methods: {
  745. seeInfos(row, int) {
  746. this.activeInfoType = int;
  747. this.$api
  748. .inquiresystemsubscribeUserExam({
  749. goodsId: row.goodsId,
  750. userId: row.userId,
  751. orderGoodsId:row.orderGoodsId
  752. })
  753. .then((res) => {
  754. this.infoData = JSON.parse(JSON.stringify(res.data));
  755. this.infoData.doNumberAll = 0;
  756. this.infoData.examNumberAll = 0;
  757. this.infoData.userExamGoodsSupplement.forEach((item) => {
  758. this.infoData.examNumberAll += item.examNumber;
  759. });
  760. this.infoData.userExamGoodsSupplementVos.forEach((item) => {
  761. this.infoData.doNumberAll += item.doNumber;
  762. });
  763. this.dialoginfoWatch = true;
  764. });
  765. },
  766. openZS(row) {
  767. if (row.examStatus !== 1) {
  768. this.$message.warning("考试登记状态为正常的计划才可执行该操作");
  769. return;
  770. }
  771. this.listData = JSON.parse(JSON.stringify(row));
  772. this.dialogPLS = true;
  773. },
  774. submitChecksPals() {
  775. if (!this.listData.performance && this.listData.performance !== 0) {
  776. this.$message.warning(`未填写考试成绩,请填写考试成绩!`);
  777. return;
  778. }
  779. if (!this.listData.result && this.listData.result !== 0) {
  780. this.$message.warning(`未选择考试结果,请选择考试结果!`);
  781. return;
  782. }
  783. var data = JSON.parse(JSON.stringify(this.listData));
  784. this.$api.appsystemsubscribe([data]).then((res) => {
  785. var dat = {
  786. subscribeId: this.listData.subscribeId,
  787. };
  788. this.$api.inquiresystemsubscribelist(dat).then((res) => {
  789. for (let k = 0; k < res.rows.length; k++) {
  790. for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
  791. for (
  792. let j = 0;
  793. j < res.rows[k].examApplySite[i].examApplySiteTime.length;
  794. j++
  795. ) {
  796. res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
  797. JSON.parse(
  798. res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
  799. );
  800. }
  801. }
  802. for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
  803. for (
  804. let j = 0;
  805. j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
  806. j++
  807. ) {
  808. res.rows[k].examApplySiteTrain[i].examApplySiteTime[
  809. j
  810. ].siteTime = JSON.parse(
  811. res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
  812. .siteTime
  813. );
  814. }
  815. }
  816. }
  817. let ast = res.rows[0];
  818. for (let i = 0; i < this.tableData.length; i++) {
  819. if (this.tableData[i].goodsId === data.goodsId) {
  820. for (let k = 0; k < this.tableData[i].children.length; k++) {
  821. if (
  822. this.tableData[i].children[k].subscribeId === data.subscribeId
  823. ) {
  824. this.$set(this.tableData[i].children, k, ast);
  825. }
  826. }
  827. }
  828. }
  829. this.$message.success("已修改成绩和证书登记");
  830. this.dialogPLS = false;
  831. });
  832. });
  833. },
  834. openClearYX(row) {
  835. this.listData = JSON.parse(JSON.stringify(row));
  836. this.dialogDJ = true;
  837. },
  838. submitChecksDJ() {
  839. var data = JSON.parse(JSON.stringify(this.listData));
  840. data.subscribeId = [data.subscribeId];
  841. data.subscribeStatus = 2;
  842. this.$api.editsystemsubscribe(data).then((res) => {
  843. var dat = {
  844. subscribeId: this.listData.subscribeId,
  845. };
  846. this.$api.inquiresystemsubscribelist(dat).then((res) => {
  847. for (let k = 0; k < res.rows.length; k++) {
  848. for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
  849. for (
  850. let j = 0;
  851. j < res.rows[k].examApplySite[i].examApplySiteTime.length;
  852. j++
  853. ) {
  854. res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
  855. JSON.parse(
  856. res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
  857. );
  858. }
  859. }
  860. for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
  861. for (
  862. let j = 0;
  863. j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
  864. j++
  865. ) {
  866. res.rows[k].examApplySiteTrain[i].examApplySiteTime[
  867. j
  868. ].siteTime = JSON.parse(
  869. res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
  870. .siteTime
  871. );
  872. }
  873. }
  874. }
  875. let ast = res.rows[0];
  876. for (let i = 0; i < this.tableData.length; i++) {
  877. if (this.tableData[i].goodsId === data.goodsId) {
  878. for (let k = 0; k < this.tableData[i].children.length; k++) {
  879. if (
  880. this.tableData[i].children[k].subscribeId ===
  881. data.subscribeId[0]
  882. ) {
  883. this.$set(this.tableData[i].children, k, ast);
  884. }
  885. }
  886. }
  887. }
  888. });
  889. this.$message.success("已取消预约");
  890. this.dialogDJ = false;
  891. });
  892. },
  893. editExam(row) {
  894. this.listData = JSON.parse(JSON.stringify(row));
  895. this.dialogCG = true;
  896. },
  897. submitChecks(formName) {
  898. this.$refs[formName].validate((valid) => {
  899. if (valid) {
  900. if (!this.listData.examStatus) {
  901. this.$message.warning("请选择考试登记状态");
  902. return;
  903. }
  904. this.submitForm();
  905. } else {
  906. console.log("error submit!!");
  907. return false;
  908. }
  909. });
  910. },
  911. submitForm() {
  912. var data = JSON.parse(JSON.stringify(this.listData));
  913. data.subscribeId = [data.subscribeId];
  914. this.$api.editsystemsubscribe(data).then((res) => {
  915. var dat = {
  916. subscribeId: this.listData.subscribeId,
  917. };
  918. this.$api.inquiresystemsubscribelist(dat).then((res) => {
  919. for (let k = 0; k < res.rows.length; k++) {
  920. for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
  921. for (
  922. let j = 0;
  923. j < res.rows[k].examApplySite[i].examApplySiteTime.length;
  924. j++
  925. ) {
  926. res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
  927. JSON.parse(
  928. res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
  929. );
  930. }
  931. }
  932. for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
  933. for (
  934. let j = 0;
  935. j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
  936. j++
  937. ) {
  938. res.rows[k].examApplySiteTrain[i].examApplySiteTime[
  939. j
  940. ].siteTime = JSON.parse(
  941. res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
  942. .siteTime
  943. );
  944. }
  945. }
  946. }
  947. let ast = res.rows[0];
  948. for (let i = 0; i < this.tableData.length; i++) {
  949. if (this.tableData[i].goodsId === data.goodsId) {
  950. for (let k = 0; k < this.tableData[i].children.length; k++) {
  951. if (
  952. this.tableData[i].children[k].subscribeId ===
  953. data.subscribeId[0]
  954. ) {
  955. this.$set(this.tableData[i].children, k, ast);
  956. }
  957. }
  958. }
  959. }
  960. });
  961. this.$message.success("考试登记修改成功");
  962. this.dialogCG = false;
  963. });
  964. },
  965. async expandChange(row, e) {
  966. if (e.length > 0) {
  967. //获取后台数据
  968. const result = await this.getApis({
  969. userId: row.userId,
  970. goodsId: row.goodsId,
  971. orderGoodsId:row.orderGoodsId
  972. });
  973. //便利table数组,找到符合本行数据,赋值
  974. this.tableData.forEach((item, index) => {
  975. if (row.orderGoodsId === item.orderGoodsId) {
  976. item.children = result;
  977. }
  978. });
  979. }
  980. },
  981. getApis(data) {
  982. return new Promise((resolve, reject) => {
  983. this.$api.inquiresystemsubscribelist(data).then((res) => {
  984. // for (let k = 0; k < res.rows.length; k++) {
  985. // for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
  986. // for (
  987. // let j = 0;
  988. // j < res.rows[k].examApplySite[i].examApplySiteTime.length;
  989. // j++
  990. // ) {
  991. // res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
  992. // JSON.parse(
  993. // res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
  994. // );
  995. // }
  996. // }
  997. // for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
  998. // for (
  999. // let j = 0;
  1000. // j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
  1001. // j++
  1002. // ) {
  1003. // res.rows[k].examApplySiteTrain[i].examApplySiteTime[
  1004. // j
  1005. // ].siteTime = JSON.parse(
  1006. // res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
  1007. // .siteTime
  1008. // );
  1009. // }
  1010. // }
  1011. // }
  1012. resolve(res.rows);
  1013. });
  1014. });
  1015. },
  1016. acs(int) {
  1017. if (int === 2) {
  1018. this.tabSearchData.pageSize = 10;
  1019. this.tabSearchData.pageNum = 1;
  1020. }
  1021. this.$api
  1022. .inquiresystemsubscribelistUserExam(this.tabSearchData)
  1023. .then((res) => {
  1024. this.totalRight = res.total;
  1025. this.active = this.tabSearchData.userId;
  1026. this.tableData = res.rows.map((item) => {
  1027. return {
  1028. ...item,
  1029. children: [],
  1030. //新增空数组children装展开行内容
  1031. };
  1032. });
  1033. });
  1034. },
  1035. changeNewActive(item) {
  1036. if (item.userId === this.active) {
  1037. return;
  1038. }
  1039. this.tabSearchData.userId = item.userId;
  1040. this.acs(2);
  1041. },
  1042. getStudent(int) {
  1043. if (int === 1) {
  1044. this.formData = {
  1045. pageNum: 1,
  1046. pageSize: 10,
  1047. };
  1048. }
  1049. this.$api.inquiresystemsubscribelistUser(this.formData).then((res) => {
  1050. this.total = res.total;
  1051. this.studentList = res.rows;
  1052. });
  1053. },
  1054. handleCurrentChange(v) {
  1055. this.formData.pageNum = v;
  1056. this.getStudent();
  1057. },
  1058. handleSizeChange(v) {
  1059. this.tabSearchData.pageSize = v;
  1060. this.tabSearchData.pageNum = 1;
  1061. this.acs();
  1062. },
  1063. handleCurrentChanges(v) {
  1064. this.tabSearchData.pageNum = v;
  1065. this.acs();
  1066. },
  1067. },
  1068. };
  1069. </script>
  1070. <style lang="less" scoped>
  1071. .dis_fs {
  1072. margin-top: 12px;
  1073. display: flex;
  1074. .dis_left {
  1075. min-width: 250px;
  1076. background-color: #eee;
  1077. margin-right: 20px;
  1078. padding: 10px 14px;
  1079. .inputSty {
  1080. width: 133px;
  1081. outline: none;
  1082. height: 26px;
  1083. }
  1084. .btnSearchSty {
  1085. border: 1px solid #666;
  1086. background-color: #fff;
  1087. padding: 0px 6px;
  1088. font-size: 14px;
  1089. height: 26px;
  1090. line-height: 26px;
  1091. border-left: none;
  1092. cursor: pointer;
  1093. }
  1094. }
  1095. .dis_right {
  1096. flex: 1;
  1097. }
  1098. }
  1099. .listy {
  1100. margin-bottom: 6px;
  1101. padding: 4px;
  1102. font-size: 14px;
  1103. cursor: pointer;
  1104. border: 1px solid transparent;
  1105. }
  1106. .active {
  1107. border: 1px solid #000;
  1108. background-color: #fff;
  1109. }
  1110. /deep/.el-button {
  1111. border-radius: 8px;
  1112. }
  1113. /deep/.el-dialog {
  1114. border-radius: 8px;
  1115. .el-dialog__header {
  1116. padding: 0;
  1117. .hearders {
  1118. height: 40px;
  1119. display: flex;
  1120. align-items: center;
  1121. justify-content: space-between;
  1122. padding: 0px 18px 0px 20px;
  1123. border-bottom: 1px solid #e2e2e2;
  1124. .leftTitle {
  1125. font-size: 14px;
  1126. font-weight: bold;
  1127. color: #2f4378;
  1128. }
  1129. .rightBoxs {
  1130. display: flex;
  1131. align-items: center;
  1132. img {
  1133. width: 14px;
  1134. height: 14px;
  1135. margin-left: 13px;
  1136. cursor: pointer;
  1137. }
  1138. }
  1139. }
  1140. }
  1141. .el-dialog__footer {
  1142. padding: 0;
  1143. .dialog-footer {
  1144. padding: 0px 40px;
  1145. height: 70px;
  1146. border-top: 1px solid #e2e2e2;
  1147. display: flex;
  1148. align-items: center;
  1149. justify-content: flex-end;
  1150. }
  1151. }
  1152. }
  1153. .imgBox {
  1154. width: 100%;
  1155. // height: 210px;
  1156. border: 1px solid #e2e2e2;
  1157. border-radius: 8px;
  1158. padding: 8px 8px 3px;
  1159. display: flex;
  1160. flex-direction: column;
  1161. align-items: center;
  1162. .imgLabel {
  1163. flex: 1;
  1164. width: 100%;
  1165. border: 1px dotted #e2e2e2;
  1166. color: #999;
  1167. font-size: 14px;
  1168. cursor: pointer;
  1169. border-radius: 8px;
  1170. .msPhoto {
  1171. display: flex;
  1172. justify-content: center;
  1173. align-items: center;
  1174. max-width: 100%;
  1175. max-height: 270px;
  1176. img {
  1177. max-width: 100%;
  1178. max-height: 270px;
  1179. }
  1180. }
  1181. .imgbbx {
  1182. display: flex;
  1183. flex-direction: column;
  1184. align-items: center;
  1185. justify-content: center;
  1186. width: 100%;
  1187. height: 100%;
  1188. i {
  1189. font-weight: bold;
  1190. margin: 14px 0;
  1191. font-size: 24px;
  1192. }
  1193. }
  1194. }
  1195. p {
  1196. margin: 5px 0px;
  1197. }
  1198. }
  1199. .aListBottom {
  1200. margin-bottom: 20px;
  1201. padding: 0px 6px;
  1202. border: 1px solid #999;
  1203. border-radius: 4px;
  1204. height: 30px;
  1205. line-height: 30px;
  1206. display: inline-block;
  1207. }
  1208. .liBVS {
  1209. margin-right: 20px;
  1210. margin-bottom: 12px;
  1211. padding: 0px 6px;
  1212. border: 1px solid #999;
  1213. border-radius: 4px;
  1214. height: 30px;
  1215. line-height: 30px;
  1216. display: inline-block;
  1217. float: left;
  1218. }
  1219. .clsw {
  1220. margin-left: 4px;
  1221. cursor: pointer;
  1222. color: #f56c6c;
  1223. }
  1224. </style>