index.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205
  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. this.$api.obtainGoods(this.$route.query.goodsId).then((res) => {
  889. this.obtainGoods = res.data;
  890. this.$api.inquireGradegradeList(this.formDataClass).then((res) => {
  891. if (!res.rows.length) {
  892. this.$message.warning(
  893. "暂无匹配班级,请先确保“有【班级有效期未过期】【未满学员】的有效班级”,再选班!"
  894. );
  895. return;
  896. }
  897. this.totalClass = res.total;
  898. this.tableDataClass = res.rows;
  899. this.templateRadio = parseInt(this.$route.query.id);
  900. this.dialogVisibleTable = true;
  901. });
  902. });
  903. }
  904. },
  905. getNewClass() {
  906. this.$api.inquireGradegradeList(this.formDataClass).then((res) => {
  907. this.tableDataClass = res.rows;
  908. this.totalClass = res.total;
  909. });
  910. },
  911. clearStudent(index) {
  912. this.allCheckList.splice(index, 1);
  913. },
  914. editInfo(v) {
  915. // this.addClick(v, 2);
  916. },
  917. addClick(v, int) {
  918. // int = 2详情 3学员管理
  919. if (v === undefined) {
  920. // 添加班级
  921. // this.$router.push({
  922. // path: "addClass",
  923. // });
  924. } else {
  925. if (int === 2) {
  926. //学员详情
  927. this.$api
  928. .inquiregradestudentlistStudent({ userId: v.userId })
  929. .then((res) => {
  930. this.listData = res.rows[0];
  931. this.dialogVisibleStudent = true;
  932. });
  933. }
  934. if (int === 3) {
  935. // 学员管理
  936. // this.$router.push({
  937. // path: "studentMenu",
  938. // query: {
  939. // id: v.gradeId,
  940. // },
  941. // });
  942. }
  943. }
  944. },
  945. del(v) {
  946. this.stice = 3;
  947. this.allCheckList = [v];
  948. this.dialogVisible = true;
  949. // let data = {
  950. // id: [v.id],
  951. // status: 0,
  952. // };
  953. // this.$api.editGradeUserGradegrade(data).then((res) => {
  954. // this.$message.success("移除成功");
  955. // this.search();
  956. // });
  957. },
  958. changeActive(int) {
  959. if (int == this.active) {
  960. return;
  961. } else {
  962. if (int === 2) {
  963. const jump = () => {
  964. this.$router.push({
  965. path: "classHours",
  966. query: {
  967. id: this.$route.query.id,
  968. goodsId: this.$route.query.goodsId,
  969. },
  970. });
  971. };
  972. const statusPage = this.$store.state.tagsView.visitedViews.some(
  973. (item) => {
  974. return item.name == "ClassHours";
  975. }
  976. );
  977. if (statusPage) {
  978. this.$store
  979. .dispatch("tagsView/delCachedView", {
  980. name: "ClassHours",
  981. })
  982. .then((res) => {
  983. jump();
  984. });
  985. } else {
  986. jump();
  987. }
  988. // this.active = int;
  989. }
  990. }
  991. },
  992. search(int) {
  993. this.loading = true;
  994. if (int === 1) {
  995. this.formData.pageNum = 1;
  996. }
  997. if (int === 2) {
  998. this.formData = {
  999. gradeId: this.$route.query.id,
  1000. status: "0,1",
  1001. pageSize: 10,
  1002. pageNum: 1,
  1003. };
  1004. }
  1005. if (int === 3) {
  1006. this.$refs.tableList.clearMoreActive();
  1007. this.formData.pageSize = 10;
  1008. this.formData.pageNum = 1;
  1009. }
  1010. this.$api
  1011. .inquireGradegradelistGrade(this.formData)
  1012. .then((res) => {
  1013. this.tableData = res.rows;
  1014. this.total = res.total;
  1015. this.navText.index = res.total;
  1016. if (this.navText.gftsStatus) {
  1017. this.$api
  1018. .inquireGradegradeofficialInfoCount({
  1019. gradeId: this.$route.query.id,
  1020. })
  1021. .then((res) => {
  1022. this.gfNum = res.data.officialInfoCount;
  1023. this.zhNum = res.data.learnStatus;
  1024. });
  1025. }
  1026. })
  1027. .finally(() => {
  1028. this.loading = false;
  1029. });
  1030. },
  1031. handleSizeChange(v) {
  1032. this.formData.pageSize = v;
  1033. this.formData.pageNum = 1;
  1034. this.search();
  1035. },
  1036. handleCurrentChange(v) {
  1037. this.formData.pageNum = v;
  1038. this.search();
  1039. },
  1040. handleSizeChangeClass(v) {
  1041. this.formDataClass.pageSize = v;
  1042. this.formDataClass.pageNum = 1;
  1043. this.getNewClass();
  1044. },
  1045. handleCurrentChangeClass(v) {
  1046. this.formDataClass.pageNum = v;
  1047. this.getNewClass();
  1048. },
  1049. },
  1050. };
  1051. </script>
  1052. <style lang="less" scoped>
  1053. .dis__s {
  1054. margin-bottom: 14px;
  1055. display: flex;
  1056. align-items: center;
  1057. justify-content: space-between;
  1058. }
  1059. .btnLists {
  1060. float: left;
  1061. border: 1px solid #333;
  1062. padding: 0px 10px;
  1063. margin-right: 10px;
  1064. margin-bottom: 10px;
  1065. border-radius: 4px;
  1066. height: 30px;
  1067. line-height: 30px;
  1068. .btnIcon {
  1069. cursor: pointer;
  1070. transition: all 0.2s;
  1071. &:hover {
  1072. color: blue;
  1073. }
  1074. }
  1075. }
  1076. /deep/.el-button {
  1077. border-radius: 8px;
  1078. }
  1079. /deep/.el-dialog {
  1080. border-radius: 8px;
  1081. .el-dialog__header {
  1082. padding: 0;
  1083. .hearders {
  1084. height: 40px;
  1085. display: flex;
  1086. align-items: center;
  1087. justify-content: space-between;
  1088. padding: 0px 18px 0px 20px;
  1089. border-bottom: 1px solid #e2e2e2;
  1090. .leftTitle {
  1091. font-size: 14px;
  1092. font-weight: bold;
  1093. color: #2f4378;
  1094. }
  1095. .rightBoxs {
  1096. display: flex;
  1097. align-items: center;
  1098. img {
  1099. width: 14px;
  1100. height: 14px;
  1101. margin-left: 13px;
  1102. cursor: pointer;
  1103. }
  1104. }
  1105. }
  1106. }
  1107. .el-dialog__footer {
  1108. padding: 0;
  1109. .dialog-footer {
  1110. padding: 0px 40px;
  1111. height: 70px;
  1112. border-top: 1px solid #e2e2e2;
  1113. display: flex;
  1114. align-items: center;
  1115. justify-content: flex-end;
  1116. }
  1117. }
  1118. }
  1119. .imgBox {
  1120. width: 100%;
  1121. // height: 210px;
  1122. border: 1px solid #e2e2e2;
  1123. border-radius: 8px;
  1124. padding: 8px 8px 3px;
  1125. display: flex;
  1126. flex-direction: column;
  1127. align-items: center;
  1128. .imgLabel {
  1129. flex: 1;
  1130. width: 100%;
  1131. border: 1px dotted #e2e2e2;
  1132. color: #999;
  1133. font-size: 14px;
  1134. cursor: pointer;
  1135. border-radius: 8px;
  1136. .msPhoto {
  1137. display: flex;
  1138. justify-content: center;
  1139. align-items: center;
  1140. max-width: 100%;
  1141. max-height: 270px;
  1142. img {
  1143. max-width: 100%;
  1144. max-height: 270px;
  1145. }
  1146. }
  1147. .imgbbx {
  1148. display: flex;
  1149. flex-direction: column;
  1150. align-items: center;
  1151. justify-content: center;
  1152. width: 100%;
  1153. height: 100%;
  1154. i {
  1155. font-weight: bold;
  1156. margin: 14px 0;
  1157. font-size: 24px;
  1158. }
  1159. }
  1160. }
  1161. p {
  1162. margin: 5px 0px;
  1163. }
  1164. }
  1165. /deep/.radioTables > .el-radio__label {
  1166. display: none;
  1167. }
  1168. .dis_fs {
  1169. display: flex;
  1170. flex-direction: column;
  1171. align-items: center;
  1172. }
  1173. .photoSty1 {
  1174. flex-shrink: 0;
  1175. width: 150px;
  1176. height: 160px;
  1177. background-color: #fff;
  1178. position: relative;
  1179. margin-bottom: 30px;
  1180. }
  1181. .photoSty2 {
  1182. position: relative;
  1183. flex-shrink: 0;
  1184. width: 230px;
  1185. height: 160px;
  1186. background-color: #fff;
  1187. margin-bottom: 30px;
  1188. }
  1189. .pos_bottom {
  1190. position: absolute;
  1191. height: 20px;
  1192. bottom: 0px;
  1193. left: 0px;
  1194. right: 0px;
  1195. background-color: rgba(0, 0, 0, 0.8);
  1196. text-align: center;
  1197. line-height: 20px;
  1198. font-size: 14px;
  1199. color: #fff;
  1200. }
  1201. </style>