index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. <template>
  2. <div id="studentMenu">
  3. <div class="dis__s">
  4. <div>
  5. <el-button
  6. :size="size"
  7. :type="active === 1 ? 'primary' : ''"
  8. @click="changeActive(1)"
  9. >班级学员</el-button
  10. >
  11. <el-button
  12. :size="size"
  13. :type="active === 2 ? 'primary' : ''"
  14. @click="changeActive(2)"
  15. >学时管理</el-button
  16. >
  17. </div>
  18. <div>
  19. <el-button
  20. size="small"
  21. v-if="statusShow.indexOf(1) !== -1"
  22. @click="uploadGF"
  23. >官方信息推送</el-button
  24. >
  25. <span
  26. style="font-size: 14px; margin: 0px 6px"
  27. v-if="statusShow.indexOf(1) !== -1"
  28. >已推送:{{ gfNum }}/{{ total }}</span
  29. >
  30. <el-button size="small" v-if="statusShow.indexOf(3) !== -1"
  31. >官方学习账号开通</el-button
  32. >
  33. <el-button
  34. size="small"
  35. v-if="statusShow.indexOf(3) !== -1"
  36. @click="moreActive(4)"
  37. >账号状态标记</el-button
  38. >
  39. <span
  40. style="font-size: 14px; margin: 0px 6px"
  41. v-if="statusShow.indexOf(3) !== -1"
  42. >已开通:{{ zhNum }}/{{ total }}</span
  43. >
  44. </div>
  45. </div>
  46. <table-list
  47. ref="tableList"
  48. :tableSets="tableSet"
  49. :tableData="tableData"
  50. :navText="navText"
  51. @addClick="addClick"
  52. :loading="loading"
  53. @editInfo="editInfo"
  54. >
  55. <template slot="customize">
  56. <el-button :size="size" type="success" @click="moreActive(1)"
  57. >结业</el-button
  58. >
  59. <!-- <el-button :size="size" type="warning" @click="moreActive(3)"
  60. >移除</el-button
  61. > -->
  62. <el-select
  63. @change="search(3)"
  64. v-model="formData.studyCountMore"
  65. placeholder="请选择"
  66. style="margin: 0px 10px"
  67. size="medium"
  68. >
  69. <el-option
  70. v-for="item in options"
  71. :key="item.value"
  72. :label="item.label"
  73. :value="item.value"
  74. >
  75. </el-option>
  76. </el-select>
  77. <el-button
  78. v-if="formData.studyCountMore === 2"
  79. :size="size"
  80. type="primary"
  81. @click="moreActive(2)"
  82. >选班</el-button
  83. >
  84. </template>
  85. <template slot="btn" slot-scope="props">
  86. <el-button type="text" @click="addClick(props.scope.row, 2)"
  87. >学员详情</el-button
  88. >
  89. <!-- <el-button type="text" @click="del(props.scope.row)">移除</el-button> -->
  90. </template>
  91. </table-list>
  92. <pagination
  93. :total="total"
  94. :pageSize="formData.pageSize"
  95. :currentPage="formData.pageNum"
  96. @handleSizeChange="handleSizeChange"
  97. @handleCurrentChange="handleCurrentChange"
  98. />
  99. <el-dialog
  100. :visible.sync="dialogVisible"
  101. width="560px"
  102. :show-close="false"
  103. :close-on-click-modal="false"
  104. >
  105. <div slot="title" class="hearders">
  106. <div class="leftTitle">
  107. {{
  108. stice == 1
  109. ? "批准结业"
  110. : stice == 4
  111. ? "学习账号开通状态标记"
  112. : stice == 3
  113. ? "移除学员"
  114. : ""
  115. }}
  116. </div>
  117. <div class="rightBoxs">
  118. <img
  119. src="@/assets/images/Close@2x.png"
  120. alt=""
  121. @click="dialogVisible = false"
  122. />
  123. </div>
  124. </div>
  125. <div>
  126. <ul>
  127. <li
  128. v-for="(item, index) in allCheckList"
  129. :key="index"
  130. class="btnLists"
  131. >
  132. {{ item.realName }}
  133. <i
  134. class="el-icon-close btnIcon"
  135. v-if="allCheckList.length > 1"
  136. @click="clearStudent(index)"
  137. ></i>
  138. </li>
  139. <div style="clear: both"></div>
  140. <p>
  141. {{
  142. stice == 1
  143. ? "所选学员,批转结业吗?"
  144. : stice == 3
  145. ? "是否移除所选中的学员?"
  146. : stice == 4
  147. ? "确定以上所选学员标记为【已开通账号】吗?"
  148. : ""
  149. }}
  150. </p>
  151. <el-radio-group v-model="finishStatusOS" v-if="stice == 1">
  152. <el-radio :label="1">是</el-radio>
  153. <el-radio :label="0">否</el-radio>
  154. </el-radio-group>
  155. </ul>
  156. </div>
  157. <span slot="footer" class="dialog-footer">
  158. <el-button @click="dialogVisible = false">取 消</el-button>
  159. <el-button type="primary" @click="submit">确 定</el-button>
  160. </span>
  161. </el-dialog>
  162. <el-dialog
  163. :visible.sync="dialogVisibleTable"
  164. width="1080px"
  165. :show-close="false"
  166. :close-on-click-modal="false"
  167. >
  168. <div slot="title" class="hearders">
  169. <div class="leftTitle">选择班级</div>
  170. <div class="rightBoxs">
  171. <img
  172. src="@/assets/images/Close@2x.png"
  173. alt=""
  174. @click="dialogVisibleTable = false"
  175. />
  176. </div>
  177. </div>
  178. <div>
  179. <el-row :gutter="20">
  180. <el-col :span="3">所属商品课程:</el-col>
  181. <el-col :span="21">
  182. <el-descriptions :labelStyle="{ width: '110px' }" border>
  183. <el-descriptions-item label="商品编码">{{
  184. obtainGoods.code
  185. }}</el-descriptions-item>
  186. <el-descriptions-item label="商品业务层级"
  187. >{{ obtainGoods.educationName }}-{{
  188. obtainGoods.projectName
  189. }}-{{ obtainGoods.businessName }}</el-descriptions-item
  190. >
  191. <el-descriptions-item label="学时">{{
  192. obtainGoods.classHours
  193. }}</el-descriptions-item>
  194. <el-descriptions-item label="年份">{{
  195. obtainGoods.year
  196. }}</el-descriptions-item>
  197. <el-descriptions-item label="商品名称">{{
  198. obtainGoods.goodsName
  199. }}</el-descriptions-item>
  200. <el-descriptions-item label="学习有效期"
  201. >{{
  202. $methodsTools.onlyForma(obtainGoods.studyStartTime, false)
  203. }}-{{
  204. $methodsTools.onlyForma(obtainGoods.studyEndTime, false)
  205. }}</el-descriptions-item
  206. >
  207. </el-descriptions>
  208. </el-col>
  209. </el-row>
  210. <p style="color: red">注:打勾,即代表选中;仅单选</p>
  211. <el-table
  212. ref="multipleTable"
  213. :data="tableDataClass"
  214. border
  215. :row-key="getRowKeys"
  216. :header-cell-style="{
  217. 'background-color': '#eee',
  218. padding: '8px',
  219. color: '#333',
  220. }"
  221. >
  222. <el-table-column label="" width="45" align="center">
  223. <template scope="scope">
  224. <el-radio
  225. class="radioTables"
  226. :label="scope.row.gradeId"
  227. v-model="templateRadio"
  228. :reserve-selection="true"
  229. @change.native="getTemplateRow(scope.$index, scope.row)"
  230. :disabled="
  231. parseInt(scope.row.studentUpper) -
  232. parseInt(scope.row.studentNum) <
  233. $refs.tableList.allCheckData.length
  234. ? true
  235. : false
  236. "
  237. >{{ "" }}</el-radio
  238. >
  239. </template>
  240. </el-table-column>
  241. <template v-for="(item, index) in tableListClass">
  242. <el-table-column
  243. v-if="item.scope !== 'inputs'"
  244. :width="item.width"
  245. :key="index"
  246. :label="item.label"
  247. align="center"
  248. :show-overflow-tooltip="true"
  249. header-align="center"
  250. >
  251. <template slot-scope="scope">
  252. <span v-if="item.scope === 'status'">
  253. {{
  254. scope.row[item.prop] === 1
  255. ? "有效"
  256. : scope.row[item.prop] === 0
  257. ? "无效"
  258. : "未知"
  259. }}
  260. </span>
  261. <span v-else-if="item.scope === 'openStatus'">
  262. {{ scope.row[item.prop] === 0 ? "未开班" : "已开班" }}
  263. {{
  264. scope.row[item.prop] === 1 ? scope.row["officialName"] : ""
  265. }}
  266. </span>
  267. <span v-else-if="item.scope === 'moreList'">
  268. {{
  269. scope.row[item.prop1] +
  270. "-" +
  271. scope.row[item.prop2] +
  272. "-" +
  273. scope.row[item.prop3]
  274. }}
  275. </span>
  276. <span v-else-if="item.scope === 'classNums'">
  277. {{ scope.row[item.prop1] + "/" + scope.row[item.prop2] }}
  278. </span>
  279. <span v-else-if="item.scope === 'timeTwo'">
  280. {{ $methodsTools.onlyForma(scope.row[item.prop1], false) }}-{{
  281. $methodsTools.onlyForma(scope.row[item.prop2], false)
  282. }}
  283. </span>
  284. <span v-else>{{ scope.row[item.prop] }}</span></template
  285. >
  286. </el-table-column></template
  287. >
  288. </el-table>
  289. <pagination
  290. :total="totalClass"
  291. :pageSize="formDataClass.pageSize"
  292. :currentPage="formDataClass.pageNum"
  293. @handleSizeChange="handleSizeChangeClass"
  294. @handleCurrentChange="handleCurrentChangeClass"
  295. />
  296. </div>
  297. <span slot="footer" class="dialog-footer">
  298. <el-button @click="dialogVisibleTable = false">取 消</el-button>
  299. <el-button type="primary" @click="submitTable">确 定</el-button>
  300. </span>
  301. </el-dialog>
  302. <el-dialog
  303. :visible.sync="dialogVisibleStudent"
  304. width="1060px"
  305. :show-close="false"
  306. :close-on-click-modal="false"
  307. >
  308. <div slot="title" class="hearders">
  309. <div class="leftTitle">学员详情</div>
  310. <div class="rightBoxs">
  311. <img
  312. src="@/assets/images/Close@2x.png"
  313. alt=""
  314. @click="dialogVisibleStudent = false"
  315. />
  316. </div>
  317. </div>
  318. <div>
  319. <el-row :gutter="20">
  320. <el-form label-position="right" label-width="130px" :model="listData">
  321. <el-col :span="6">
  322. <div class="dis_fs">
  323. <div class="photoSty1">
  324. <img
  325. style="width: 100%; height: 100%"
  326. v-if="!listData.oneInchPhotos"
  327. src="@/assets/404_images/wuyuxaog.png"
  328. alt=""
  329. />
  330. <el-image
  331. v-else
  332. style="width: 100%; height: 100%"
  333. :src="$methodsTools.splitImgHost(listData.oneInchPhotos)"
  334. :preview-src-list="[
  335. $methodsTools.splitImgHost(listData.oneInchPhotos),
  336. ]"
  337. >
  338. </el-image>
  339. <div class="pos_bottom">一寸头像图</div>
  340. </div>
  341. <div class="photoSty2">
  342. <img
  343. style="width: 100%; height: 100%"
  344. v-if="!listData.idCardImg1"
  345. src="@/assets/404_images/wuyuxaog.png"
  346. alt=""
  347. />
  348. <el-image
  349. v-else
  350. style="width: 100%; height: 100%"
  351. :src="$methodsTools.splitImgHost(listData.idCardImg1)"
  352. :preview-src-list="[
  353. $methodsTools.splitImgHost(listData.idCardImg1),
  354. ]"
  355. >
  356. </el-image>
  357. <div class="pos_bottom">身份证正面照片</div>
  358. </div>
  359. <div class="photoSty2" style="margin-right: 0px">
  360. <img
  361. style="width: 100%; height: 100%"
  362. v-if="!listData.idCardImg2"
  363. src="@/assets/404_images/wuyuxaog.png"
  364. alt=""
  365. />
  366. <el-image
  367. v-else
  368. style="width: 100%; height: 100%"
  369. :src="$methodsTools.splitImgHost(listData.idCardImg2)"
  370. :preview-src-list="[
  371. $methodsTools.splitImgHost(listData.idCardImg2),
  372. ]"
  373. >
  374. </el-image>
  375. <div class="pos_bottom">身份证背面照片</div>
  376. </div>
  377. </div>
  378. </el-col>
  379. <el-col :span="9">
  380. <el-form-item label="学员编码">
  381. <el-input
  382. disabled
  383. v-model="listData.studentCode"
  384. placeholder="请填写学员编码"
  385. ></el-input>
  386. </el-form-item>
  387. <el-form-item label="姓名">
  388. <el-input
  389. disabled
  390. v-model="listData.realname"
  391. placeholder="请填写姓名"
  392. ></el-input>
  393. </el-form-item>
  394. <el-form-item label="身份证号码">
  395. <el-input
  396. disabled
  397. v-model="listData.idCard"
  398. placeholder="请填写身份证号码"
  399. ></el-input>
  400. </el-form-item>
  401. <el-form-item label="性别">
  402. <el-radio-group v-model="listData.sex" disabled>
  403. <el-radio :label="1">男</el-radio>
  404. <el-radio :label="2">女</el-radio>
  405. </el-radio-group>
  406. </el-form-item>
  407. <el-form-item label="出生日期">
  408. <el-input
  409. disabled
  410. v-model="listData.userBirth"
  411. placeholder="请填写出生日期"
  412. ></el-input>
  413. </el-form-item>
  414. <el-form-item label="手机号码">
  415. <el-input
  416. disabled
  417. v-model="listData.telphone"
  418. placeholder="请填写手机号码"
  419. ></el-input>
  420. </el-form-item>
  421. <el-form-item label="微信">
  422. <el-input
  423. disabled
  424. v-model="listData.telphone"
  425. placeholder="请填写微信"
  426. ></el-input>
  427. </el-form-item>
  428. <el-form-item label="邮箱">
  429. <el-input
  430. disabled
  431. v-model="listData.email"
  432. placeholder="请填写邮箱"
  433. ></el-input>
  434. </el-form-item>
  435. <el-form-item label="学历">
  436. <el-input
  437. disabled
  438. v-model="listData.eduLevel"
  439. placeholder="请填写学历"
  440. ></el-input>
  441. </el-form-item>
  442. <el-form-item label="工作年限">
  443. <el-input
  444. disabled
  445. v-model="listData.workYear"
  446. placeholder="请填写工作年限"
  447. ></el-input>
  448. </el-form-item>
  449. <el-form-item label="在职状况">
  450. <el-radio-group v-model="listData.jobStatus" disabled>
  451. <el-radio :label="0">在职</el-radio>
  452. <el-radio :label="1">离职</el-radio>
  453. </el-radio-group>
  454. </el-form-item>
  455. <el-form-item label="所在公司">
  456. <el-input
  457. disabled
  458. v-model="listData.companyName"
  459. placeholder="请填写所在公司"
  460. ></el-input>
  461. </el-form-item>
  462. </el-col>
  463. <el-col :span="9">
  464. <el-form-item label="民族">
  465. <el-input
  466. disabled
  467. v-model="listData.nation"
  468. placeholder="请填写民族"
  469. ></el-input>
  470. </el-form-item>
  471. <el-form-item label="籍贯">
  472. <el-input
  473. disabled
  474. v-model="listData.nativePlace"
  475. placeholder="请填写籍贯"
  476. ></el-input>
  477. </el-form-item>
  478. <el-form-item label="政治面貌">
  479. <el-input
  480. disabled
  481. v-model="listData.politic"
  482. placeholder="请填写政治面貌"
  483. ></el-input>
  484. </el-form-item>
  485. <el-form-item label="婚姻状况">
  486. <el-input
  487. disabled
  488. v-model="listData.marry"
  489. placeholder="请填写婚姻状况"
  490. ></el-input>
  491. </el-form-item>
  492. <el-form-item label="户口性质">
  493. <el-radio-group v-model="listData.census" disabled>
  494. <el-radio :label="1">农村</el-radio>
  495. <el-radio :label="2">城镇</el-radio>
  496. </el-radio-group>
  497. </el-form-item>
  498. <el-form-item label="户口所在地">
  499. <el-input
  500. disabled
  501. :value="
  502. listData.houseProvince +
  503. listData.houseCity +
  504. listData.houseDistrict +
  505. listData.houseAddress
  506. "
  507. placeholder="请填写户口所在地"
  508. ></el-input>
  509. </el-form-item>
  510. <el-form-item label="联系地址">
  511. <el-input
  512. disabled
  513. v-model="listData.contactAddress"
  514. placeholder="请填写联系地址"
  515. ></el-input>
  516. </el-form-item>
  517. <el-form-item label="收件地址">
  518. <el-input
  519. disabled
  520. v-model="listData.consigneeAddress"
  521. placeholder="请填写收件地址"
  522. ></el-input>
  523. </el-form-item>
  524. <el-form-item label="备注">
  525. <el-input
  526. disabled
  527. type="textarea"
  528. :rows="5"
  529. v-model="listData.remark"
  530. ></el-input>
  531. </el-form-item>
  532. </el-col>
  533. </el-form>
  534. </el-row>
  535. </div>
  536. <span slot="footer" class="dialog-footer">
  537. <el-button @click="dialogVisibleStudent = false">取 消</el-button>
  538. </span>
  539. </el-dialog>
  540. </div>
  541. </template>
  542. <script>
  543. import tableList from "@/components/tableList";
  544. import pagination from "@/components/pagination";
  545. export default {
  546. components: { tableList, pagination },
  547. data() {
  548. return {
  549. options: [
  550. {
  551. label: "全部",
  552. value: "",
  553. },
  554. {
  555. label: "剩余学习机会>0,商品下最后一次所在班级",
  556. value: 2,
  557. },
  558. {
  559. label: "剩余学习机会>0,非商品下最后一次所在班级",
  560. value: 1,
  561. },
  562. {
  563. label: "剩余学习机会=0",
  564. value: 0,
  565. },
  566. ],
  567. statusShow: [], //1无官方接口按钮 2只有官方推送 3都有
  568. size: "medium",
  569. active: 1,
  570. loading: false, //当前表单加载是否加载动画
  571. navText: {
  572. title: "班级人数:",
  573. index: 0,
  574. ch: "位",
  575. num: false,
  576. choice: true,
  577. border: true,
  578. addHide: true,
  579. gftsStatus: false,
  580. gfUserStatus: false,
  581. backFatherBtn: {
  582. status: false,
  583. title: "未定义",
  584. },
  585. },
  586. formData: {
  587. studyCountMore: "",
  588. gradeId: this.$route.query.id,
  589. status: "0,1",
  590. pageSize: 10,
  591. pageNum: 1,
  592. },
  593. totalClass: 0,
  594. formDataClass: {
  595. pastDue: 1,
  596. atFull: 1,
  597. goodsId: this.$route.query.goodsId,
  598. status: 1,
  599. pageSize: 10,
  600. pageNum: 1,
  601. },
  602. // 表单
  603. tableSet: [
  604. {
  605. label: "学员编码",
  606. prop: "studentCode",
  607. hidden: true,
  608. },
  609. {
  610. label: "学员姓名",
  611. prop: "realName",
  612. hidden: true,
  613. },
  614. {
  615. label: "学员身份证",
  616. prop: "idCard",
  617. hidden: true,
  618. },
  619. {
  620. label: "绑定手机号码",
  621. prop: "telPhone",
  622. hidden: true,
  623. },
  624. {
  625. label: "资料变更状态",
  626. prop: "userStatus",
  627. hidden: true,
  628. scope: "changeCLS",
  629. },
  630. {
  631. label: "学时",
  632. prop: "classHours",
  633. hidden: true,
  634. },
  635. {
  636. label: "视频学习进度(节)",
  637. prop1: "stuAllNum",
  638. prop2: "secAllNum",
  639. hidden: true,
  640. scope: "computer",
  641. },
  642. {
  643. label: "做题进度(章卷)",
  644. prop1: "recordNum",
  645. prop2: "examNum",
  646. hidden: true,
  647. scope: "computer",
  648. },
  649. {
  650. label: "学时审批状态",
  651. prop: "periodStatus",
  652. hidden: true,
  653. scope: "statusPeriods",
  654. },
  655. {
  656. label: "学习有效期",
  657. prop1: "studyStartTime",
  658. prop2: "studyEndTime",
  659. hidden: true,
  660. Diszing: false,
  661. scope: "TimeLists",
  662. },
  663. {
  664. label: "班级有效期",
  665. prop1: "classStartTime",
  666. prop2: "classEndTime",
  667. hidden: true,
  668. Diszing: false,
  669. scope: "TimeLists",
  670. },
  671. {
  672. label: "结业状态",
  673. prop: "finishStatus",
  674. hidden: true,
  675. scope: "finishStatus",
  676. },
  677. {
  678. label: "剩余学习机会",
  679. prop: "studyCount",
  680. hidden: true,
  681. },
  682. {
  683. label: "复购-学时冲突",
  684. prop: "rebuy",
  685. hidden: true,
  686. scope: "rebuy",
  687. },
  688. ],
  689. listData: {},
  690. finishStatusOS: "",
  691. tableData: [], //表单数据
  692. total: 0, //一共多少条
  693. gfNum: 0, //官方信息推送
  694. zhNum: 0, //账号状态标记
  695. dialogVisible: false,
  696. dialogVisibleTable: false,
  697. dialogVisibleStudent: false,
  698. allCheckList: [], //多选数组
  699. stice: 0,
  700. obtainGoods: {}, //选择班级头部商品数据
  701. tableDataClass: [],
  702. tableListClass: [
  703. {
  704. label: "班级编码",
  705. prop: "gradeCode",
  706. },
  707. {
  708. label: "班级号",
  709. prop: "classStatus",
  710. prop1: "officialName",
  711. scope: "openStatus",
  712. },
  713. {
  714. label: "班级名称",
  715. prop: "className",
  716. },
  717. {
  718. label: "班级人数",
  719. prop1: "studentNum",
  720. prop2: "studentUpper",
  721. scope: "classNums",
  722. },
  723. {
  724. label: "班级状态",
  725. prop: "status",
  726. scope: "status",
  727. },
  728. {
  729. label: "班级有效期",
  730. prop1: "classStartTime",
  731. prop2: "classEndTime",
  732. scope: "timeTwo",
  733. },
  734. ],
  735. templateRadio: "",
  736. };
  737. },
  738. async mounted() {
  739. await this.getStatus();
  740. this.search();
  741. },
  742. activated() {
  743. this.getStatus();
  744. this.search();
  745. },
  746. methods: {
  747. uploadGF() {
  748. if (!this.$refs.tableList.allCheckData.length) {
  749. this.$message.warning("请勾选需要官方信息推送的学员");
  750. return;
  751. }
  752. let stu = this.$refs.tableList.allCheckData.some((item) => {
  753. return item.periodStatus === -1;
  754. });
  755. if (stu) {
  756. this.$message.warning("所勾选学员的学时审批状态不允许为不可审核状态");
  757. return;
  758. }
  759. let arr = this.$refs.tableList.allCheckData.map((item) => {
  760. return {
  761. userId: item.userId,
  762. gradeId: this.$route.query.id,
  763. };
  764. });
  765. this.$api.editGradeUsereditpushInfo(arr).then((res) => {
  766. if (res.code === 200) {
  767. if (!res.msg) {
  768. this.$message.success("推送成功");
  769. } else {
  770. this.$message.error(res.msg);
  771. }
  772. this.search();
  773. this.$refs.tableList.clearMoreActive();
  774. }
  775. });
  776. },
  777. getInfos(e) {
  778. console.log(e);
  779. },
  780. getStatus() {
  781. return new Promise((resolve, reject) => {
  782. this.$api
  783. .inquireGradegradelistselectButton({
  784. gradeId: parseInt(this.$route.query.id),
  785. })
  786. .then((res) => {
  787. this.statusShow = res.data;
  788. if (res.data.indexOf(1) !== -1) {
  789. this.navText.gftsStatus = true;
  790. } else {
  791. this.navText.gftsStatus = false;
  792. }
  793. if (res.data.indexOf(3) !== -1) {
  794. this.navText.gfUserStatus = true;
  795. } else {
  796. this.navText.gfUserStatus = false;
  797. }
  798. resolve();
  799. });
  800. });
  801. },
  802. //单选触发
  803. getTemplateRow(index, row) {
  804. this.templateRadio = row.gradeId;
  805. },
  806. getRowKeys(row) {
  807. return row.gradeId;
  808. },
  809. submitTable() {
  810. var lets = [];
  811. this.$refs.tableList.allCheckData.forEach((item) => {
  812. lets.push({
  813. oldGradeId: this.$route.query.id,
  814. goodsId: item.goodsId,
  815. gradeId: this.templateRadio,
  816. orderGoodsId: item.orderGoodsId,
  817. userId: item.userId,
  818. });
  819. });
  820. this.$api.gradegradechangeGrade({ userList: lets }).then((res) => {
  821. this.$message.success("选班成功");
  822. this.search();
  823. this.dialogVisibleTable = false;
  824. });
  825. },
  826. submit() {
  827. if (!this.allCheckList.length) {
  828. this.dialogVisible = false;
  829. return;
  830. }
  831. let ars = [];
  832. this.allCheckList.map((item) => {
  833. ars.push(item.id);
  834. });
  835. let data = {
  836. id: ars,
  837. };
  838. if (this.stice === 1) {
  839. if (this.finishStatusOS !== 0 && this.finishStatusOS !== 1) {
  840. this.$message.warning("请选择是否");
  841. return;
  842. }
  843. data.finishStatus = this.finishStatusOS;
  844. }
  845. if (this.stice === 3) {
  846. data.status = 0;
  847. }
  848. if (this.stice === 4) {
  849. data.learnStatus = 1;
  850. }
  851. this.$api.editGradeUserGradegrade(data).then((res) => {
  852. this.dialogVisible = false;
  853. this.$message.success("成功");
  854. this.search();
  855. });
  856. },
  857. //1结业 2选班 3移除 4账号状态标记
  858. moreActive(int) {
  859. if (!this.$refs.tableList.allCheckData.length) {
  860. this.$message.warning("请勾选需要操作的学员");
  861. return;
  862. }
  863. if (int === 1 || int === 3 || int === 4) {
  864. this.stice = int;
  865. this.allCheckList = JSON.parse(
  866. JSON.stringify(this.$refs.tableList.allCheckData)
  867. );
  868. this.finishStatusOS = "";
  869. this.dialogVisible = true;
  870. }
  871. if (int === 2) {
  872. var newTime = Date.parse(new Date()) / 1000;
  873. var itemsq = JSON.parse(
  874. JSON.stringify(this.$refs.tableList.allCheckData)
  875. );
  876. var ast = itemsq.every((items) => {
  877. return items.periodStatus !== 1 && items.classEndTime
  878. ? items.classEndTime < newTime
  879. : false;
  880. });
  881. if (!ast) {
  882. this.$message.warning(
  883. "选择的学员中存在学时审批状态已通过或班级有效期未过期"
  884. );
  885. return;
  886. }
  887. this.$api.obtainGoods(this.$route.query.goodsId).then((res) => {
  888. this.obtainGoods = res.data;
  889. this.$api.inquireGradegradeList(this.formDataClass).then((res) => {
  890. if (!res.rows.length) {
  891. this.$message.warning(
  892. "暂无匹配班级,请先确保“有【班级有效期未过期】【未满学员】的有效班级”,再选班!"
  893. );
  894. return;
  895. }
  896. this.totalClass = res.total;
  897. this.tableDataClass = res.rows;
  898. this.templateRadio = parseInt(this.$route.query.id);
  899. this.dialogVisibleTable = true;
  900. });
  901. });
  902. }
  903. },
  904. getNewClass() {
  905. this.$api.inquireGradegradeList(this.formDataClass).then((res) => {
  906. this.tableDataClass = res.rows;
  907. this.totalClass = res.total;
  908. });
  909. },
  910. clearStudent(index) {
  911. this.allCheckList.splice(index, 1);
  912. },
  913. editInfo(v) {
  914. // this.addClick(v, 2);
  915. },
  916. addClick(v, int) {
  917. // int = 2详情 3学员管理
  918. if (v === undefined) {
  919. // 添加班级
  920. // this.$router.push({
  921. // path: "addClass",
  922. // });
  923. } else {
  924. if (int === 2) {
  925. //学员详情
  926. this.$api
  927. .inquiregradestudentlistStudent({ userId: v.userId })
  928. .then((res) => {
  929. this.listData = res.rows[0];
  930. this.dialogVisibleStudent = true;
  931. });
  932. }
  933. if (int === 3) {
  934. // 学员管理
  935. // this.$router.push({
  936. // path: "studentMenu",
  937. // query: {
  938. // id: v.gradeId,
  939. // },
  940. // });
  941. }
  942. }
  943. },
  944. del(v) {
  945. this.stice = 3;
  946. this.allCheckList = [v];
  947. this.dialogVisible = true;
  948. // let data = {
  949. // id: [v.id],
  950. // status: 0,
  951. // };
  952. // this.$api.editGradeUserGradegrade(data).then((res) => {
  953. // this.$message.success("移除成功");
  954. // this.search();
  955. // });
  956. },
  957. changeActive(int) {
  958. if (int == this.active) {
  959. return;
  960. } else {
  961. if (int === 2) {
  962. const jump = () => {
  963. this.$router.push({
  964. path: "classHours",
  965. query: {
  966. id: this.$route.query.id,
  967. goodsId: this.$route.query.goodsId,
  968. },
  969. });
  970. };
  971. const statusPage = this.$store.state.tagsView.visitedViews.some(
  972. (item) => {
  973. return item.name == "ClassHours";
  974. }
  975. );
  976. if (statusPage) {
  977. this.$store
  978. .dispatch("tagsView/delCachedView", {
  979. name: "ClassHours",
  980. })
  981. .then((res) => {
  982. jump();
  983. });
  984. } else {
  985. jump();
  986. }
  987. // this.active = int;
  988. }
  989. }
  990. },
  991. search(int) {
  992. this.loading = true;
  993. if (int === 1) {
  994. this.formData.pageNum = 1;
  995. }
  996. if (int === 2) {
  997. this.formData = {
  998. gradeId: this.$route.query.id,
  999. status: "0,1",
  1000. pageSize: 10,
  1001. pageNum: 1,
  1002. };
  1003. }
  1004. if (int === 3) {
  1005. this.$refs.tableList.allCheckData = [];
  1006. this.formData.pageSize = 10;
  1007. this.formData.pageNum = 1;
  1008. }
  1009. this.$api
  1010. .inquireGradegradelistGrade(this.formData)
  1011. .then((res) => {
  1012. this.tableData = res.rows;
  1013. this.total = res.total;
  1014. this.navText.index = res.total;
  1015. if (this.navText.gftsStatus) {
  1016. this.$api
  1017. .inquireGradegradeofficialInfoCount({
  1018. gradeId: this.$route.query.id,
  1019. })
  1020. .then((res) => {
  1021. this.gfNum = res.data.officialInfoCount;
  1022. this.zhNum = res.data.learnStatus;
  1023. });
  1024. }
  1025. })
  1026. .finally(() => {
  1027. this.loading = false;
  1028. });
  1029. },
  1030. handleSizeChange(v) {
  1031. this.formData.pageSize = v;
  1032. this.formData.pageNum = 1;
  1033. this.search();
  1034. },
  1035. handleCurrentChange(v) {
  1036. this.formData.pageNum = v;
  1037. this.search();
  1038. },
  1039. handleSizeChangeClass(v) {
  1040. this.formDataClass.pageSize = v;
  1041. this.formDataClass.pageNum = 1;
  1042. this.getNewClass();
  1043. },
  1044. handleCurrentChangeClass(v) {
  1045. this.formDataClass.pageNum = v;
  1046. this.getNewClass();
  1047. },
  1048. },
  1049. };
  1050. </script>
  1051. <style lang="less" scoped>
  1052. .dis__s {
  1053. margin-bottom: 14px;
  1054. display: flex;
  1055. align-items: center;
  1056. justify-content: space-between;
  1057. }
  1058. .btnLists {
  1059. float: left;
  1060. border: 1px solid #333;
  1061. padding: 0px 10px;
  1062. margin-right: 10px;
  1063. margin-bottom: 10px;
  1064. border-radius: 4px;
  1065. height: 30px;
  1066. line-height: 30px;
  1067. .btnIcon {
  1068. cursor: pointer;
  1069. transition: all 0.2s;
  1070. &:hover {
  1071. color: blue;
  1072. }
  1073. }
  1074. }
  1075. /deep/.el-button {
  1076. border-radius: 8px;
  1077. }
  1078. /deep/.el-dialog {
  1079. border-radius: 8px;
  1080. .el-dialog__header {
  1081. padding: 0;
  1082. .hearders {
  1083. height: 40px;
  1084. display: flex;
  1085. align-items: center;
  1086. justify-content: space-between;
  1087. padding: 0px 18px 0px 20px;
  1088. border-bottom: 1px solid #e2e2e2;
  1089. .leftTitle {
  1090. font-size: 14px;
  1091. font-weight: bold;
  1092. color: #2f4378;
  1093. }
  1094. .rightBoxs {
  1095. display: flex;
  1096. align-items: center;
  1097. img {
  1098. width: 14px;
  1099. height: 14px;
  1100. margin-left: 13px;
  1101. cursor: pointer;
  1102. }
  1103. }
  1104. }
  1105. }
  1106. .el-dialog__footer {
  1107. padding: 0;
  1108. .dialog-footer {
  1109. padding: 0px 40px;
  1110. height: 70px;
  1111. border-top: 1px solid #e2e2e2;
  1112. display: flex;
  1113. align-items: center;
  1114. justify-content: flex-end;
  1115. }
  1116. }
  1117. }
  1118. .imgBox {
  1119. width: 100%;
  1120. // height: 210px;
  1121. border: 1px solid #e2e2e2;
  1122. border-radius: 8px;
  1123. padding: 8px 8px 3px;
  1124. display: flex;
  1125. flex-direction: column;
  1126. align-items: center;
  1127. .imgLabel {
  1128. flex: 1;
  1129. width: 100%;
  1130. border: 1px dotted #e2e2e2;
  1131. color: #999;
  1132. font-size: 14px;
  1133. cursor: pointer;
  1134. border-radius: 8px;
  1135. .msPhoto {
  1136. display: flex;
  1137. justify-content: center;
  1138. align-items: center;
  1139. max-width: 100%;
  1140. max-height: 270px;
  1141. img {
  1142. max-width: 100%;
  1143. max-height: 270px;
  1144. }
  1145. }
  1146. .imgbbx {
  1147. display: flex;
  1148. flex-direction: column;
  1149. align-items: center;
  1150. justify-content: center;
  1151. width: 100%;
  1152. height: 100%;
  1153. i {
  1154. font-weight: bold;
  1155. margin: 14px 0;
  1156. font-size: 24px;
  1157. }
  1158. }
  1159. }
  1160. p {
  1161. margin: 5px 0px;
  1162. }
  1163. }
  1164. /deep/.radioTables > .el-radio__label {
  1165. display: none;
  1166. }
  1167. .dis_fs {
  1168. display: flex;
  1169. flex-direction: column;
  1170. align-items: center;
  1171. }
  1172. .photoSty1 {
  1173. flex-shrink: 0;
  1174. width: 150px;
  1175. height: 160px;
  1176. background-color: #fff;
  1177. position: relative;
  1178. margin-bottom: 30px;
  1179. }
  1180. .photoSty2 {
  1181. position: relative;
  1182. flex-shrink: 0;
  1183. width: 230px;
  1184. height: 160px;
  1185. background-color: #fff;
  1186. margin-bottom: 30px;
  1187. }
  1188. .pos_bottom {
  1189. position: absolute;
  1190. height: 20px;
  1191. bottom: 0px;
  1192. left: 0px;
  1193. right: 0px;
  1194. background-color: rgba(0, 0, 0, 0.8);
  1195. text-align: center;
  1196. line-height: 20px;
  1197. font-size: 14px;
  1198. color: #fff;
  1199. }
  1200. </style>