index.vue 35 KB

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