index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <template>
  2. <div id="formerAccount">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. :advanced="true"
  10. @Advanced="advanced"
  11. advancedName="高级输入"
  12. />
  13. <table-list
  14. :tableSets="tableSet"
  15. :tableData="tableData"
  16. :navText="navText"
  17. :loading="loading"
  18. ref="tableList"
  19. rowKey="subscribeId"
  20. >
  21. <template slot="customize">
  22. <el-button :size="size" type="warning" @click="moreActive"
  23. >前培账号标记</el-button
  24. >
  25. </template>
  26. </table-list>
  27. <pagination
  28. :total="total"
  29. :pageSize="formData.pageSize"
  30. :currentPage="formData.pageNum"
  31. @handleSizeChange="handleSizeChange"
  32. @handleCurrentChange="handleCurrentChange"
  33. />
  34. <el-dialog
  35. :visible.sync="dialogPLS"
  36. width="660px"
  37. :show-close="false"
  38. :close-on-click-modal="false"
  39. >
  40. <div slot="title" class="hearders">
  41. <div class="leftTitle">高级输入</div>
  42. <div class="rightBoxs">
  43. <img
  44. src="@/assets/images/Close@2x.png"
  45. alt=""
  46. @click="dialogPLS = false"
  47. />
  48. </div>
  49. </div>
  50. <el-row :gutter="20">
  51. <el-col :span="12"
  52. ><h4>请输入学员的身份证号码,换行隔开,每行一个</h4>
  53. <el-input
  54. type="textarea"
  55. :rows="10"
  56. placeholder="请输入身份证"
  57. v-model="idcordList"
  58. >
  59. </el-input>
  60. </el-col>
  61. <el-col :span="12">
  62. <h4>快捷导入</h4>
  63. <el-link type="primary" @click="getDowm">下载模板</el-link>
  64. <label
  65. for="mobles"
  66. class="el-button el-button--primary"
  67. style="margin-left: 14px; padding: 10px 20px"
  68. >上传学员名单</label
  69. ><input
  70. style="display: none"
  71. type="file"
  72. id="mobles"
  73. ref="input1"
  74. @change="importMobleadd"
  75. />
  76. </el-col>
  77. </el-row>
  78. <span slot="footer" class="dialog-footer">
  79. <el-button @click="dialogPLS = false">取消</el-button>
  80. <el-button type="primary" @click="submitChecksPals">确定</el-button>
  81. </span>
  82. </el-dialog>
  83. <el-dialog
  84. :visible.sync="dialogQP"
  85. width="460px"
  86. :show-close="false"
  87. :close-on-click-modal="false"
  88. >
  89. <div slot="title" class="hearders">
  90. <div class="leftTitle">前培账号已开通标记</div>
  91. <div class="rightBoxs">
  92. <img
  93. src="@/assets/images/Close@2x.png"
  94. alt=""
  95. @click="dialogQP = false"
  96. />
  97. </div>
  98. </div>
  99. <div>
  100. <ul style="margin: 0px">
  101. <li class="liBVS" v-for="(item, index) in peopleList" :key="index">
  102. {{ item.realname }}
  103. <i
  104. v-if="peopleList.length > 1"
  105. class="el-icon-error clsw"
  106. @click="peopleList.splice(index, 1)"
  107. ></i>
  108. </li>
  109. <div style="clear: both"></div>
  110. </ul>
  111. <p style="margin: 0px">所选学员的前培账号标记为【已开通】吗?</p>
  112. <div style="text-align: center; margin-top: 12px">
  113. <el-radio-group v-model="beforeStatus">
  114. <el-radio :label="1">是</el-radio>
  115. <el-radio :label="2">否</el-radio>
  116. </el-radio-group>
  117. </div>
  118. </div>
  119. <span slot="footer" class="dialog-footer">
  120. <el-button @click="dialogQP = false">取消</el-button>
  121. <el-button type="primary" @click="submitChecksQP">确定</el-button>
  122. </span>
  123. </el-dialog>
  124. </div>
  125. </template>
  126. <script>
  127. import * as baseUrls from "@/utils/request.js";
  128. import searchBoxNew from "@/components/searchBoxNew";
  129. import tableList from "@/components/tableList";
  130. import pagination from "@/components/pagination";
  131. export default {
  132. name: "FormerAccount",
  133. components: { searchBoxNew, tableList, pagination },
  134. data() {
  135. return {
  136. dialogPLS: false,
  137. size: "small",
  138. beforeStatus: "",
  139. loading: false, //当前表单加载是否加载动画
  140. navText: {
  141. openCheckMore: true,
  142. tableHide: true,
  143. border: true,
  144. title: "前培账号标记",
  145. index: 0,
  146. ch: "条",
  147. num: false,
  148. choice: true,
  149. changeWidth: "240px",
  150. addHide: true,
  151. backFatherBtn: {
  152. status: false,
  153. title: "未定义",
  154. },
  155. },
  156. //搜索
  157. formList: [
  158. // {
  159. // prop: "beforeId",
  160. // placeholder: "前培计划",
  161. // scope: "beforeLists",
  162. // },
  163. {
  164. prop: "applyId",
  165. placeholder: "考试计划",
  166. scope: "examLists",
  167. },
  168. {
  169. prop: "beforeStatus",
  170. placeholder: "开通状态",
  171. scope: "select",
  172. options: [
  173. {
  174. label: "已开通",
  175. value: 1,
  176. },
  177. {
  178. label: "未开通",
  179. value: 0,
  180. },
  181. ],
  182. },
  183. {
  184. prop: "searchKey",
  185. placeholder: "请输入学员姓名/学员身份证",
  186. },
  187. {
  188. prop: "idCards",
  189. placeholder: "请输入学员身份证",
  190. scope: "textarea",
  191. },
  192. ],
  193. formData: {
  194. beforeId: "",
  195. applyId: "",
  196. pageSize: 10,
  197. pageNum: 1,
  198. idCards: "",
  199. beforeStatus: "",
  200. canBefore: 1,
  201. },
  202. // 表单
  203. tableSet: [
  204. {
  205. label: "考试机会",
  206. prop1: "examNumber",
  207. prop2: "expendNumber",
  208. hidden: true,
  209. scope: "chance",
  210. },
  211. {
  212. label: "前培机会",
  213. prop1: "doNumber",
  214. prop2: "expendBefore",
  215. hidden: true,
  216. scope: "chance",
  217. },
  218. {
  219. label: "预约状态",
  220. prop: "subscribeStatus",
  221. hidden: true,
  222. scope: "isOptions",
  223. options: [
  224. {
  225. label: "正常",
  226. value: 1,
  227. },
  228. {
  229. label: "取消",
  230. value: 2,
  231. },
  232. ],
  233. },
  234. {
  235. label: "前培标记",
  236. prop: "beforeStatus",
  237. hidden: true,
  238. scope: "isOptions",
  239. options: [
  240. {
  241. label: "已开通",
  242. value: 1,
  243. },
  244. ],
  245. },
  246. {
  247. label: "考试登记",
  248. prop: "examStatus",
  249. hidden: true,
  250. scope: "isOptionsDZYQ",
  251. options: [
  252. {
  253. label: "待登记",
  254. value: 0,
  255. },
  256. {
  257. label: "正常",
  258. value: 1,
  259. },
  260. {
  261. label: "缺考",
  262. value: 2,
  263. },
  264. {
  265. label: "作弊",
  266. value: 3,
  267. },
  268. {
  269. label: "替考",
  270. value: 4,
  271. },
  272. ],
  273. },
  274. {
  275. label: "考试成绩和结果",
  276. prop1: "performance",
  277. prop2: "result",
  278. hidden: true,
  279. scope: "resultType",
  280. },
  281. {
  282. label: "证书编号",
  283. prop: "certificateCode",
  284. hidden: true,
  285. },
  286. {
  287. label: "考试标题",
  288. prop: "applyName",
  289. hidden: true,
  290. },
  291. {
  292. label: "前培标题",
  293. prop: "beforeName",
  294. hidden: true,
  295. },
  296. {
  297. label: "学员姓名",
  298. prop: "realname",
  299. hidden: true,
  300. },
  301. {
  302. label: "学员身份证",
  303. prop: "idCard",
  304. hidden: true,
  305. },
  306. {
  307. label: "所购商品",
  308. prop1: "goodsCode",
  309. prop2: "goodsName",
  310. prop3: "standPrice",
  311. hidden: true,
  312. scope: "goodsInfos",
  313. },
  314. {
  315. label: "学员报考类型",
  316. prop: "studentType",
  317. hidden: true,
  318. scope: "isOptions",
  319. options: [
  320. {
  321. label: "新考学员",
  322. value: 1,
  323. },
  324. {
  325. label: "补考学员",
  326. value: 2,
  327. },
  328. ],
  329. },
  330. {
  331. label: "所报专业",
  332. prop: "categoryName",
  333. hidden: true,
  334. },
  335. {
  336. label: "预约场次(考试地点和时间)",
  337. prop1: "applySiteAddress",
  338. prop2: "applySiteExamTime",
  339. prop3: "applySiteStartTime",
  340. prop4: "applySiteEndTime",
  341. prop5: "examineeCode",
  342. prop6: "seatNumber",
  343. prop7: "syncStatus",
  344. hidden: true,
  345. scope: "changAdress",
  346. },
  347. {
  348. label: "考试次数消耗",
  349. prop: "examExpend",
  350. hidden: true,
  351. },
  352. {
  353. label: "预约场次(考培地点和时间)",
  354. prop1: "applySiteAddressTrain",
  355. prop2: "applySiteExamTrainTime",
  356. prop3: "applySiteStartTrainTime",
  357. prop4: "applySiteEndTrainTime",
  358. hidden: true,
  359. scope: "changAdressKP",
  360. },
  361. {
  362. label: "前培次数消耗",
  363. prop: "beforeExpend",
  364. hidden: true,
  365. },
  366. {
  367. label: "创建时间",
  368. prop: "createTime",
  369. hidden: true,
  370. scope: "aTimeList",
  371. },
  372. ],
  373. tableData: [], //表单数据
  374. total: 0, //一共多少条
  375. idcordList: "",
  376. copyAppid: "",
  377. dialogQP: false,
  378. listData: {},
  379. peopleList: [],
  380. };
  381. },
  382. mounted() {
  383. // await this.getFirstOptions();
  384. this.search();
  385. },
  386. activated() {
  387. this.search();
  388. },
  389. methods: {
  390. /**
  391. * 下载模板
  392. */
  393. getDowm() {
  394. let url = baseUrls.BASE_IMG_URL + "/oss/images/file/20220214.xls" +
  395. `?time=${this.$methodsTools.getNewTime()}`;;
  396. let link = document.createElement("a");
  397. let fileName = "导入模板" + ".xlsx";
  398. document.body.appendChild(link);
  399. link.href = url;
  400. link.dowmload = fileName;
  401. link.click();
  402. link.remove();
  403. },
  404. /**
  405. * 导入
  406. */
  407. importMobleadd(e) {
  408. var self = this;
  409. var file = e.target.files[0];
  410. let formData = new FormData();
  411. formData.append("file", file);
  412. this.$api
  413. .editsystemimportIdsData(formData)
  414. .then((res) => {
  415. if (!res.data.length) {
  416. this.$message.warning("未检测到上传学员数据,请检查上传文件");
  417. return;
  418. }
  419. let idList = res.data.map((item) => {
  420. return item.idCard.toString();
  421. });
  422. if (this.idcordList) {
  423. var arr = this.idcordList.split("\n");
  424. var arrs = arr.concat(idList);
  425. var newArr = arrs.filter(function (value, index, self) {
  426. return self.indexOf(value) === index;
  427. });
  428. this.idcordList = newArr.join("\n");
  429. } else {
  430. var newArr = idList.filter(function (value, index, self) {
  431. return self.indexOf(value) === index;
  432. });
  433. this.idcordList = newArr.join("\n");
  434. }
  435. this.$message.success("上传成功");
  436. })
  437. .finally(() => {
  438. e.target.value = "";
  439. });
  440. },
  441. getFirstOptions() {
  442. return new Promise((resolve, reject) => {
  443. this.$api
  444. .inquiresystembefore({ status: "0,1,2", pageSize: 1, pageNum: 1 })
  445. .then((res) => {
  446. if (res.rows.length) {
  447. this.copyAppid = res.rows[0].beforeId;
  448. this.formData.beforeId = res.rows[0].beforeId;
  449. }
  450. resolve();
  451. });
  452. });
  453. },
  454. submitChecksPals() {
  455. this.formData.idCards = this.idcordList;
  456. this.dialogPLS = false;
  457. },
  458. advanced(datas) {
  459. this.dialogPLS = true;
  460. this.idcordList = this.formData.idCards;
  461. },
  462. moreActive() {
  463. if (!this.$refs.tableList.allCheckData.length) {
  464. this.$message.warning("请勾选需要前培账号标记的列表");
  465. return;
  466. }
  467. this.peopleList = JSON.parse(
  468. JSON.stringify(this.$refs.tableList.allCheckData)
  469. );
  470. this.listData = {};
  471. this.beforeStatus = 1;
  472. this.dialogQP = true;
  473. },
  474. submitChecksQP() {
  475. var data = JSON.parse(JSON.stringify(this.listData));
  476. if (!this.beforeStatus) {
  477. this.$message.warning("请选择是或否");
  478. return;
  479. }
  480. var arrays = [];
  481. this.peopleList.forEach((item) => {
  482. arrays.push(item.subscribeId);
  483. });
  484. data.subscribeId = arrays;
  485. if (this.beforeStatus === 1) {
  486. data.beforeStatus = 1;
  487. data.beforeId = this.formData.beforeId;
  488. }
  489. if (this.beforeStatus === 2) {
  490. data.beforeStatus = 0;
  491. data.beforeId = this.formData.beforeId;
  492. }
  493. this.$api.editsystemsubscribe(data).then((res) => {
  494. this.$message.success("前培账号已开通标记修改成功");
  495. this.dialogQP = false;
  496. this.search();
  497. this.$refs.tableList.allCheckData = [];
  498. this.$refs.tableList.$refs.pagerset.clearSelection();
  499. });
  500. },
  501. search(int) {
  502. this.loading = true;
  503. if (int === 1) {
  504. this.formData.pageNum = 1;
  505. }
  506. if (int === 2) {
  507. this.formData = {
  508. pageSize: 10,
  509. pageNum: 1,
  510. idCards: "",
  511. canBefore: 1,
  512. beforeId: this.formData.beforeId,
  513. applyId: "",
  514. beforeStatus: "",
  515. };
  516. }
  517. var data = JSON.parse(JSON.stringify(this.formData));
  518. if (this.formData.idCards) {
  519. data.idCards = this.formData.idCards.split("\n");
  520. }
  521. if (this.formData.searchKey && this.formData.idCards) {
  522. data.searchType = 1;
  523. } else {
  524. data.searchType = 0;
  525. }
  526. this.$api
  527. .inquiresystemsubscribelist(data)
  528. .then((res) => {
  529. this.tableData = res.rows;
  530. this.total = res.total;
  531. this.navText.index = res.total;
  532. })
  533. .finally(() => {
  534. this.loading = false;
  535. });
  536. },
  537. init() {
  538. this.$refs.tableList.allCheckData = [];
  539. this.$refs.tableList.$refs.pagerset.clearSelection();
  540. this.search(2);
  541. },
  542. handleSizeChange(v) {
  543. this.formData.pageSize = v;
  544. this.formData.pageNum = 1;
  545. this.search();
  546. },
  547. handleCurrentChange(v) {
  548. this.formData.pageNum = v;
  549. this.search();
  550. },
  551. },
  552. };
  553. </script>
  554. <style lang="less" scoped>
  555. /deep/.el-button {
  556. border-radius: 8px;
  557. }
  558. /deep/.el-dialog {
  559. border-radius: 8px;
  560. .el-dialog__header {
  561. padding: 0;
  562. .hearders {
  563. height: 40px;
  564. display: flex;
  565. align-items: center;
  566. justify-content: space-between;
  567. padding: 0px 18px 0px 20px;
  568. border-bottom: 1px solid #e2e2e2;
  569. .leftTitle {
  570. font-size: 14px;
  571. font-weight: bold;
  572. color: #2f4378;
  573. }
  574. .rightBoxs {
  575. display: flex;
  576. align-items: center;
  577. img {
  578. width: 14px;
  579. height: 14px;
  580. margin-left: 13px;
  581. cursor: pointer;
  582. }
  583. }
  584. }
  585. }
  586. .el-dialog__footer {
  587. padding: 0;
  588. .dialog-footer {
  589. padding: 0px 40px;
  590. height: 70px;
  591. border-top: 1px solid #e2e2e2;
  592. display: flex;
  593. align-items: center;
  594. justify-content: flex-end;
  595. }
  596. }
  597. }
  598. .imgBox {
  599. width: 100%;
  600. // height: 210px;
  601. border: 1px solid #e2e2e2;
  602. border-radius: 8px;
  603. padding: 8px 8px 3px;
  604. display: flex;
  605. flex-direction: column;
  606. align-items: center;
  607. .imgLabel {
  608. flex: 1;
  609. width: 100%;
  610. border: 1px dotted #e2e2e2;
  611. color: #999;
  612. font-size: 14px;
  613. cursor: pointer;
  614. border-radius: 8px;
  615. .msPhoto {
  616. display: flex;
  617. justify-content: center;
  618. align-items: center;
  619. max-width: 100%;
  620. max-height: 270px;
  621. img {
  622. max-width: 100%;
  623. max-height: 270px;
  624. }
  625. }
  626. .imgbbx {
  627. display: flex;
  628. flex-direction: column;
  629. align-items: center;
  630. justify-content: center;
  631. width: 100%;
  632. height: 100%;
  633. i {
  634. font-weight: bold;
  635. margin: 14px 0;
  636. font-size: 24px;
  637. }
  638. }
  639. }
  640. p {
  641. margin: 5px 0px;
  642. }
  643. }
  644. .liBVS {
  645. margin-right: 20px;
  646. margin-bottom: 12px;
  647. padding: 0px 6px;
  648. border: 1px solid #999;
  649. border-radius: 4px;
  650. height: 30px;
  651. line-height: 30px;
  652. display: inline-block;
  653. float: left;
  654. }
  655. .clsw {
  656. margin-left: 4px;
  657. cursor: pointer;
  658. color: #f56c6c;
  659. }
  660. .swq {
  661. text-align: center;
  662. border-bottom: 1px solid #eee;
  663. }
  664. .dowmStys {
  665. color: blue;
  666. cursor: pointer;
  667. }
  668. </style>