index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  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: "beforeList",
  162. },
  163. {
  164. prop: "applyId",
  165. placeholder: "考试计划",
  166. scope: "examList",
  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. prop: "subscribeStatus",
  207. hidden: true,
  208. scope: "isOptions",
  209. options: [
  210. {
  211. label: "正常",
  212. value: 1,
  213. },
  214. {
  215. label: "取消",
  216. value: 2,
  217. },
  218. ],
  219. },
  220. {
  221. label: "前培标记",
  222. prop: "beforeStatus",
  223. hidden: true,
  224. scope: "isOptions",
  225. options: [
  226. {
  227. label: "已开通",
  228. value: 1,
  229. },
  230. ],
  231. },
  232. {
  233. label: "考试登记",
  234. prop: "examStatus",
  235. hidden: true,
  236. scope: "isOptionsDZYQ",
  237. options: [
  238. {
  239. label: "待登记",
  240. value: 0,
  241. },
  242. {
  243. label: "正常",
  244. value: 1,
  245. },
  246. {
  247. label: "缺考",
  248. value: 2,
  249. },
  250. {
  251. label: "作弊",
  252. value: 3,
  253. },
  254. {
  255. label: "替考",
  256. value: 4,
  257. },
  258. ],
  259. },
  260. {
  261. label: "考试成绩和结果",
  262. prop1: "performance",
  263. prop2: "result",
  264. hidden: true,
  265. scope: "resultType",
  266. },
  267. {
  268. label: "证书编号",
  269. prop: "certificateCode",
  270. hidden: true,
  271. },
  272. {
  273. label: "考试标题",
  274. prop: "applyName",
  275. hidden: true,
  276. },
  277. {
  278. label: "前培标题",
  279. prop: "beforeName",
  280. hidden: true,
  281. },
  282. {
  283. label: "学员姓名",
  284. prop: "realname",
  285. hidden: true,
  286. },
  287. {
  288. label: "学员身份证",
  289. prop: "idCard",
  290. hidden: true,
  291. },
  292. {
  293. label: "所购商品",
  294. prop1: "goodsCode",
  295. prop2: "goodsName",
  296. prop3: "standPrice",
  297. hidden: true,
  298. scope: "goodsInfos",
  299. },
  300. {
  301. label: "学员报考类型",
  302. prop: "studentType",
  303. hidden: true,
  304. scope: "isOptions",
  305. options: [
  306. {
  307. label: "非补考学员",
  308. value: 1,
  309. },
  310. {
  311. label: "补考学员",
  312. value: 2,
  313. },
  314. ],
  315. },
  316. {
  317. label: "所报专业",
  318. prop: "categoryName",
  319. hidden: true,
  320. },
  321. {
  322. label: "预约场次(考试地点和时间)",
  323. prop1: "applySiteAddress",
  324. prop2: "applySiteExamTime",
  325. prop3: "applySiteStartTime",
  326. prop4: "applySiteEndTime",
  327. hidden: true,
  328. scope: "changAdress",
  329. },
  330. {
  331. label: "考试次数消耗",
  332. prop: "examExpend",
  333. hidden: true,
  334. },
  335. {
  336. label: "预约场次(考培地点和时间)",
  337. prop1: "applySiteAddressTrain",
  338. prop2: "applySiteExamTrainTime",
  339. prop3: "applySiteStartTrainTime",
  340. prop4: "applySiteEndTrainTime",
  341. hidden: true,
  342. scope: "changAdress",
  343. },
  344. {
  345. label: "前培次数消耗",
  346. prop: "beforeExpend",
  347. hidden: true,
  348. },
  349. {
  350. label: "创建时间",
  351. prop: "createTime",
  352. hidden: true,
  353. scope: "aTimeList",
  354. },
  355. ],
  356. tableData: [], //表单数据
  357. total: 0, //一共多少条
  358. idcordList: "",
  359. copyAppid: "",
  360. dialogQP: false,
  361. listData: {},
  362. peopleList: [],
  363. };
  364. },
  365. async mounted() {
  366. await this.getFirstOptions();
  367. this.search();
  368. },
  369. activated() {
  370. this.search();
  371. },
  372. methods: {
  373. /**
  374. * 下载模板
  375. */
  376. getDowm() {
  377. let url = baseUrls.BASE_IMG_URL + "/oss/images/file/20220214.xls";
  378. let link = document.createElement("a");
  379. let fileName = "导入模板" + ".xlsx";
  380. document.body.appendChild(link);
  381. link.href = url;
  382. link.dowmload = fileName;
  383. link.click();
  384. link.remove();
  385. },
  386. /**
  387. * 导入
  388. */
  389. importMobleadd(e) {
  390. var self = this;
  391. var file = e.target.files[0];
  392. let formData = new FormData();
  393. formData.append("file", file);
  394. this.$api
  395. .editsystemimportIdsData(formData)
  396. .then((res) => {
  397. if (!res.data.length) {
  398. this.$message.warning("未检测到上传学员数据,请检查上传文件");
  399. return;
  400. }
  401. let idList = res.data.map((item) => {
  402. return item.idCard.toString();
  403. });
  404. if (this.idcordList) {
  405. var arr = this.idcordList.split("\n");
  406. var arrs = arr.concat(idList);
  407. var newArr = arrs.filter(function (value, index, self) {
  408. return self.indexOf(value) === index;
  409. });
  410. this.idcordList = newArr.join("\n");
  411. } else {
  412. var newArr = idList.filter(function (value, index, self) {
  413. return self.indexOf(value) === index;
  414. });
  415. this.idcordList = newArr.join("\n");
  416. }
  417. this.$message.success("上传成功");
  418. })
  419. .finally(() => {
  420. e.target.value = "";
  421. });
  422. },
  423. getFirstOptions() {
  424. return new Promise((resolve, reject) => {
  425. this.$api
  426. .inquiresystembefore({ status: 1, pageSize: 1, pageNum: 1 })
  427. .then((res) => {
  428. if (res.rows.length) {
  429. this.copyAppid = res.rows[0].beforeId;
  430. this.formData.beforeId = res.rows[0].beforeId;
  431. }
  432. resolve();
  433. });
  434. });
  435. },
  436. submitChecksPals() {
  437. this.formData.idCards = this.idcordList;
  438. this.dialogPLS = false;
  439. },
  440. advanced(datas) {
  441. this.dialogPLS = true;
  442. this.idcordList = this.formData.idCards;
  443. },
  444. moreActive() {
  445. if (!this.$refs.tableList.allCheckData.length) {
  446. this.$message.warning("请勾选需要前培账号标记的列表");
  447. return;
  448. }
  449. this.peopleList = JSON.parse(
  450. JSON.stringify(this.$refs.tableList.allCheckData)
  451. );
  452. this.listData = {};
  453. this.beforeStatus = 1;
  454. this.dialogQP = true;
  455. },
  456. submitChecksQP() {
  457. var data = JSON.parse(JSON.stringify(this.listData));
  458. if (!this.beforeStatus) {
  459. this.$message.warning("请选择是或否");
  460. return;
  461. }
  462. var arrays = [];
  463. this.peopleList.forEach((item) => {
  464. arrays.push(item.subscribeId);
  465. });
  466. data.subscribeId = arrays;
  467. if (this.beforeStatus === 1) {
  468. data.beforeStatus = 1;
  469. data.beforeId = this.formData.beforeId;
  470. }
  471. if (this.beforeStatus === 2) {
  472. data.beforeStatus = 0;
  473. data.beforeId = this.formData.beforeId;
  474. }
  475. this.$api.editsystemsubscribe(data).then((res) => {
  476. this.$message.success("前培账号已开通标记修改成功");
  477. this.dialogQP = false;
  478. this.search();
  479. this.$refs.tableList.allCheckData = [];
  480. this.$refs.tableList.$refs.pagerset.clearSelection();
  481. });
  482. },
  483. search(int) {
  484. this.loading = true;
  485. if (int === 1) {
  486. this.formData.pageNum = 1;
  487. }
  488. if (int === 2) {
  489. this.formData = {
  490. pageSize: 10,
  491. pageNum: 1,
  492. idCards: "",
  493. canBefore: 1,
  494. beforeId: this.copyAppid,
  495. applyId:"",
  496. beforeStatus: "",
  497. };
  498. }
  499. var data = JSON.parse(JSON.stringify(this.formData));
  500. if (this.formData.idCards) {
  501. data.idCards = this.formData.idCards.split("\n");
  502. data.searchType = 1
  503. }else{
  504. data.searchType = 0
  505. }
  506. this.$api
  507. .inquiresystemsubscribelist(data)
  508. .then((res) => {
  509. this.tableData = res.rows;
  510. this.total = res.total;
  511. this.navText.index = res.total;
  512. })
  513. .finally(() => {
  514. this.loading = false;
  515. });
  516. },
  517. init() {
  518. this.$refs.tableList.allCheckData = [];
  519. this.$refs.tableList.$refs.pagerset.clearSelection();
  520. this.search(2);
  521. },
  522. handleSizeChange(v) {
  523. this.formData.pageSize = v;
  524. this.formData.pageNum = 1;
  525. this.search();
  526. },
  527. handleCurrentChange(v) {
  528. this.formData.pageNum = v;
  529. this.search();
  530. },
  531. },
  532. };
  533. </script>
  534. <style lang="less" scoped>
  535. /deep/.el-button {
  536. border-radius: 8px;
  537. }
  538. /deep/.el-dialog {
  539. border-radius: 8px;
  540. .el-dialog__header {
  541. padding: 0;
  542. .hearders {
  543. height: 40px;
  544. display: flex;
  545. align-items: center;
  546. justify-content: space-between;
  547. padding: 0px 18px 0px 20px;
  548. border-bottom: 1px solid #e2e2e2;
  549. .leftTitle {
  550. font-size: 14px;
  551. font-weight: bold;
  552. color: #2f4378;
  553. }
  554. .rightBoxs {
  555. display: flex;
  556. align-items: center;
  557. img {
  558. width: 14px;
  559. height: 14px;
  560. margin-left: 13px;
  561. cursor: pointer;
  562. }
  563. }
  564. }
  565. }
  566. .el-dialog__footer {
  567. padding: 0;
  568. .dialog-footer {
  569. padding: 0px 40px;
  570. height: 70px;
  571. border-top: 1px solid #e2e2e2;
  572. display: flex;
  573. align-items: center;
  574. justify-content: flex-end;
  575. }
  576. }
  577. }
  578. .imgBox {
  579. width: 100%;
  580. // height: 210px;
  581. border: 1px solid #e2e2e2;
  582. border-radius: 8px;
  583. padding: 8px 8px 3px;
  584. display: flex;
  585. flex-direction: column;
  586. align-items: center;
  587. .imgLabel {
  588. flex: 1;
  589. width: 100%;
  590. border: 1px dotted #e2e2e2;
  591. color: #999;
  592. font-size: 14px;
  593. cursor: pointer;
  594. border-radius: 8px;
  595. .msPhoto {
  596. display: flex;
  597. justify-content: center;
  598. align-items: center;
  599. max-width: 100%;
  600. max-height: 270px;
  601. img {
  602. max-width: 100%;
  603. max-height: 270px;
  604. }
  605. }
  606. .imgbbx {
  607. display: flex;
  608. flex-direction: column;
  609. align-items: center;
  610. justify-content: center;
  611. width: 100%;
  612. height: 100%;
  613. i {
  614. font-weight: bold;
  615. margin: 14px 0;
  616. font-size: 24px;
  617. }
  618. }
  619. }
  620. p {
  621. margin: 5px 0px;
  622. }
  623. }
  624. .liBVS {
  625. margin-right: 20px;
  626. margin-bottom: 12px;
  627. padding: 0px 6px;
  628. border: 1px solid #999;
  629. border-radius: 4px;
  630. height: 30px;
  631. line-height: 30px;
  632. display: inline-block;
  633. float: left;
  634. }
  635. .clsw {
  636. margin-left: 4px;
  637. cursor: pointer;
  638. color: #f56c6c;
  639. }
  640. .swq {
  641. text-align: center;
  642. border-bottom: 1px solid #eee;
  643. }
  644. .dowmStys {
  645. color: blue;
  646. cursor: pointer;
  647. }
  648. </style>