index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197
  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 arr = this.$refs.tableList.allCheckData.map((item) => {
  753. return {
  754. userId: item.userId,
  755. gradeId: this.$route.query.id,
  756. };
  757. });
  758. this.$api.editGradeUsereditpushInfo(arr).then((res) => {
  759. if (res.code === 200) {
  760. if (!res.msg) {
  761. this.$message.success("推送成功");
  762. } else {
  763. this.$message.error(res.msg);
  764. }
  765. this.search();
  766. this.$refs.tableList.clearMoreActive();
  767. }
  768. });
  769. },
  770. getInfos(e) {
  771. console.log(e);
  772. },
  773. getStatus() {
  774. return new Promise((resolve, reject) => {
  775. this.$api
  776. .inquireGradegradelistselectButton({
  777. gradeId: parseInt(this.$route.query.id),
  778. })
  779. .then((res) => {
  780. this.statusShow = res.data;
  781. if (res.data.indexOf(1) !== -1) {
  782. this.navText.gftsStatus = true;
  783. } else {
  784. this.navText.gftsStatus = false;
  785. }
  786. if (res.data.indexOf(3) !== -1) {
  787. this.navText.gfUserStatus = true;
  788. } else {
  789. this.navText.gfUserStatus = false;
  790. }
  791. resolve();
  792. });
  793. });
  794. },
  795. //单选触发
  796. getTemplateRow(index, row) {
  797. this.templateRadio = row.gradeId;
  798. },
  799. getRowKeys(row) {
  800. return row.gradeId;
  801. },
  802. submitTable() {
  803. var lets = [];
  804. this.$refs.tableList.allCheckData.forEach((item) => {
  805. lets.push({
  806. oldGradeId: this.$route.query.id,
  807. goodsId: item.goodsId,
  808. gradeId: this.templateRadio,
  809. orderGoodsId: item.orderGoodsId,
  810. userId: item.userId,
  811. });
  812. });
  813. this.$api.gradegradechangeGrade({ userList: lets }).then((res) => {
  814. this.$message.success("选班成功");
  815. this.search();
  816. this.dialogVisibleTable = false;
  817. });
  818. },
  819. submit() {
  820. if (!this.allCheckList.length) {
  821. this.dialogVisible = false;
  822. return;
  823. }
  824. let ars = [];
  825. this.allCheckList.map((item) => {
  826. ars.push(item.id);
  827. });
  828. let data = {
  829. id: ars,
  830. };
  831. if (this.stice === 1) {
  832. if (this.finishStatusOS !== 0 && this.finishStatusOS !== 1) {
  833. this.$message.warning("请选择是否");
  834. return;
  835. }
  836. data.finishStatus = this.finishStatusOS;
  837. }
  838. if (this.stice === 3) {
  839. data.status = 0;
  840. }
  841. if (this.stice === 4) {
  842. data.learnStatus = 1;
  843. }
  844. this.$api.editGradeUserGradegrade(data).then((res) => {
  845. this.dialogVisible = false;
  846. this.$message.success("成功");
  847. this.search();
  848. });
  849. },
  850. //1结业 2选班 3移除 4账号状态标记
  851. moreActive(int) {
  852. if (!this.$refs.tableList.allCheckData.length) {
  853. this.$message.warning("请勾选需要操作的学员");
  854. return;
  855. }
  856. if (int === 1 || int === 3 || int === 4) {
  857. this.stice = int;
  858. this.allCheckList = JSON.parse(
  859. JSON.stringify(this.$refs.tableList.allCheckData)
  860. );
  861. this.finishStatusOS = "";
  862. this.dialogVisible = true;
  863. }
  864. if (int === 2) {
  865. var newTime = Date.parse(new Date()) / 1000;
  866. var itemsq = JSON.parse(
  867. JSON.stringify(this.$refs.tableList.allCheckData)
  868. );
  869. var ast = itemsq.every((items) => {
  870. return items.periodStatus !== 1 && items.classEndTime
  871. ? items.classEndTime < newTime
  872. : false;
  873. });
  874. if (!ast) {
  875. this.$message.warning(
  876. "选择的学员中存在学时审批状态已通过或班级有效期未过期"
  877. );
  878. return;
  879. }
  880. this.$api.obtainGoods(this.$route.query.goodsId).then((res) => {
  881. this.obtainGoods = res.data;
  882. this.$api.inquireGradegradeList(this.formDataClass).then((res) => {
  883. if (!res.rows.length) {
  884. this.$message.warning(
  885. "暂无匹配班级,请先确保“有【班级有效期未过期】【未满学员】的有效班级”,再选班!"
  886. );
  887. return;
  888. }
  889. this.totalClass = res.total;
  890. this.tableDataClass = res.rows;
  891. this.templateRadio = parseInt(this.$route.query.id);
  892. this.dialogVisibleTable = true;
  893. });
  894. });
  895. }
  896. },
  897. getNewClass() {
  898. this.$api.inquireGradegradeList(this.formDataClass).then((res) => {
  899. this.tableDataClass = res.rows;
  900. this.totalClass = res.total;
  901. });
  902. },
  903. clearStudent(index) {
  904. this.allCheckList.splice(index, 1);
  905. },
  906. editInfo(v) {
  907. // this.addClick(v, 2);
  908. },
  909. addClick(v, int) {
  910. // int = 2详情 3学员管理
  911. if (v === undefined) {
  912. // 添加班级
  913. // this.$router.push({
  914. // path: "addClass",
  915. // });
  916. } else {
  917. if (int === 2) {
  918. //学员详情
  919. this.$api
  920. .inquiregradestudentlistStudent({ userId: v.userId })
  921. .then((res) => {
  922. this.listData = res.rows[0];
  923. this.dialogVisibleStudent = true;
  924. });
  925. }
  926. if (int === 3) {
  927. // 学员管理
  928. // this.$router.push({
  929. // path: "studentMenu",
  930. // query: {
  931. // id: v.gradeId,
  932. // },
  933. // });
  934. }
  935. }
  936. },
  937. del(v) {
  938. this.stice = 3;
  939. this.allCheckList = [v];
  940. this.dialogVisible = true;
  941. // let data = {
  942. // id: [v.id],
  943. // status: 0,
  944. // };
  945. // this.$api.editGradeUserGradegrade(data).then((res) => {
  946. // this.$message.success("移除成功");
  947. // this.search();
  948. // });
  949. },
  950. changeActive(int) {
  951. if (int == this.active) {
  952. return;
  953. } else {
  954. if (int === 2) {
  955. const jump = () => {
  956. this.$router.push({
  957. path: "classHours",
  958. query: {
  959. id: this.$route.query.id,
  960. goodsId: this.$route.query.goodsId,
  961. },
  962. });
  963. };
  964. const statusPage = this.$store.state.tagsView.visitedViews.some(
  965. (item) => {
  966. return item.name == "ClassHours";
  967. }
  968. );
  969. if (statusPage) {
  970. this.$store
  971. .dispatch("tagsView/delCachedView", {
  972. name: "ClassHours",
  973. })
  974. .then((res) => {
  975. jump();
  976. });
  977. } else {
  978. jump();
  979. }
  980. // this.active = int;
  981. }
  982. }
  983. },
  984. search(int) {
  985. this.loading = true;
  986. if (int === 1) {
  987. this.formData.pageNum = 1;
  988. }
  989. if (int === 2) {
  990. this.formData = {
  991. gradeId: this.$route.query.id,
  992. status: "0,1",
  993. pageSize: 10,
  994. pageNum: 1,
  995. };
  996. }
  997. if (int === 3) {
  998. this.$refs.tableList.allCheckData = [];
  999. this.formData.pageSize = 10;
  1000. this.formData.pageNum = 1;
  1001. }
  1002. this.$api
  1003. .inquireGradegradelistGrade(this.formData)
  1004. .then((res) => {
  1005. this.tableData = res.rows;
  1006. this.total = res.total;
  1007. this.navText.index = res.total;
  1008. if (this.navText.gftsStatus) {
  1009. this.$api
  1010. .inquireGradegradeofficialInfoCount({
  1011. gradeId: this.$route.query.id,
  1012. })
  1013. .then((res) => {
  1014. this.gfNum = res.data.officialInfoCount;
  1015. this.zhNum = res.data.learnStatus;
  1016. });
  1017. }
  1018. })
  1019. .finally(() => {
  1020. this.loading = false;
  1021. });
  1022. },
  1023. handleSizeChange(v) {
  1024. this.formData.pageSize = v;
  1025. this.formData.pageNum = 1;
  1026. this.search();
  1027. },
  1028. handleCurrentChange(v) {
  1029. this.formData.pageNum = v;
  1030. this.search();
  1031. },
  1032. handleSizeChangeClass(v) {
  1033. this.formDataClass.pageSize = v;
  1034. this.formDataClass.pageNum = 1;
  1035. this.getNewClass();
  1036. },
  1037. handleCurrentChangeClass(v) {
  1038. this.formDataClass.pageNum = v;
  1039. this.getNewClass();
  1040. },
  1041. },
  1042. };
  1043. </script>
  1044. <style lang="less" scoped>
  1045. .dis__s {
  1046. margin-bottom: 14px;
  1047. display: flex;
  1048. align-items: center;
  1049. justify-content: space-between;
  1050. }
  1051. .btnLists {
  1052. float: left;
  1053. border: 1px solid #333;
  1054. padding: 0px 10px;
  1055. margin-right: 10px;
  1056. margin-bottom: 10px;
  1057. border-radius: 4px;
  1058. height: 30px;
  1059. line-height: 30px;
  1060. .btnIcon {
  1061. cursor: pointer;
  1062. transition: all 0.2s;
  1063. &:hover {
  1064. color: blue;
  1065. }
  1066. }
  1067. }
  1068. /deep/.el-button {
  1069. border-radius: 8px;
  1070. }
  1071. /deep/.el-dialog {
  1072. border-radius: 8px;
  1073. .el-dialog__header {
  1074. padding: 0;
  1075. .hearders {
  1076. height: 40px;
  1077. display: flex;
  1078. align-items: center;
  1079. justify-content: space-between;
  1080. padding: 0px 18px 0px 20px;
  1081. border-bottom: 1px solid #e2e2e2;
  1082. .leftTitle {
  1083. font-size: 14px;
  1084. font-weight: bold;
  1085. color: #2f4378;
  1086. }
  1087. .rightBoxs {
  1088. display: flex;
  1089. align-items: center;
  1090. img {
  1091. width: 14px;
  1092. height: 14px;
  1093. margin-left: 13px;
  1094. cursor: pointer;
  1095. }
  1096. }
  1097. }
  1098. }
  1099. .el-dialog__footer {
  1100. padding: 0;
  1101. .dialog-footer {
  1102. padding: 0px 40px;
  1103. height: 70px;
  1104. border-top: 1px solid #e2e2e2;
  1105. display: flex;
  1106. align-items: center;
  1107. justify-content: flex-end;
  1108. }
  1109. }
  1110. }
  1111. .imgBox {
  1112. width: 100%;
  1113. // height: 210px;
  1114. border: 1px solid #e2e2e2;
  1115. border-radius: 8px;
  1116. padding: 8px 8px 3px;
  1117. display: flex;
  1118. flex-direction: column;
  1119. align-items: center;
  1120. .imgLabel {
  1121. flex: 1;
  1122. width: 100%;
  1123. border: 1px dotted #e2e2e2;
  1124. color: #999;
  1125. font-size: 14px;
  1126. cursor: pointer;
  1127. border-radius: 8px;
  1128. .msPhoto {
  1129. display: flex;
  1130. justify-content: center;
  1131. align-items: center;
  1132. max-width: 100%;
  1133. max-height: 270px;
  1134. img {
  1135. max-width: 100%;
  1136. max-height: 270px;
  1137. }
  1138. }
  1139. .imgbbx {
  1140. display: flex;
  1141. flex-direction: column;
  1142. align-items: center;
  1143. justify-content: center;
  1144. width: 100%;
  1145. height: 100%;
  1146. i {
  1147. font-weight: bold;
  1148. margin: 14px 0;
  1149. font-size: 24px;
  1150. }
  1151. }
  1152. }
  1153. p {
  1154. margin: 5px 0px;
  1155. }
  1156. }
  1157. /deep/.radioTables > .el-radio__label {
  1158. display: none;
  1159. }
  1160. .dis_fs {
  1161. display: flex;
  1162. flex-direction: column;
  1163. align-items: center;
  1164. }
  1165. .photoSty1 {
  1166. flex-shrink: 0;
  1167. width: 150px;
  1168. height: 160px;
  1169. background-color: #fff;
  1170. position: relative;
  1171. margin-bottom: 30px;
  1172. }
  1173. .photoSty2 {
  1174. position: relative;
  1175. flex-shrink: 0;
  1176. width: 230px;
  1177. height: 160px;
  1178. background-color: #fff;
  1179. margin-bottom: 30px;
  1180. }
  1181. .pos_bottom {
  1182. position: absolute;
  1183. height: 20px;
  1184. bottom: 0px;
  1185. left: 0px;
  1186. right: 0px;
  1187. background-color: rgba(0, 0, 0, 0.8);
  1188. text-align: center;
  1189. line-height: 20px;
  1190. font-size: 14px;
  1191. color: #fff;
  1192. }
  1193. </style>