index.vue 35 KB

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