index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <template>
  2. <div id="cancelAppointMent">
  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="dialogDJ"
  85. width="560px"
  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="dialogDJ = false"
  96. />
  97. </div>
  98. </div>
  99. <div>
  100. <ul>
  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. <p style="margin: 0px">取消后将无法恢复,请慎重考虑!</p>
  113. </div>
  114. <span slot="footer" class="dialog-footer">
  115. <el-button @click="dialogDJ = false">取消</el-button>
  116. <el-button type="primary" @click="submitChecksDJ">确定</el-button>
  117. </span>
  118. </el-dialog>
  119. </div>
  120. </template>
  121. <script>
  122. import * as baseUrls from "@/utils/request.js";
  123. import searchBoxNew from "@/components/searchBoxNew";
  124. import tableList from "@/components/tableList";
  125. import pagination from "@/components/pagination";
  126. export default {
  127. name: "CancelAppointMent",
  128. components: { searchBoxNew, tableList, pagination },
  129. data() {
  130. return {
  131. dialogPLS: false,
  132. size: "small",
  133. plan: "",
  134. loading: false, //当前表单加载是否加载动画
  135. navText: {
  136. openCheckMore: true,
  137. tableHide: true,
  138. border: true,
  139. title: "取消预约",
  140. index: 0,
  141. ch: "条",
  142. num: false,
  143. choice: true,
  144. changeWidth: "240px",
  145. addHide: true,
  146. backFatherBtn: {
  147. status: false,
  148. title: "未定义",
  149. },
  150. },
  151. //搜索
  152. formList: [
  153. {
  154. prop: "applyId",
  155. placeholder: "考试标题",
  156. scope: "examLists",
  157. },
  158. {
  159. prop: "applySiteAddress",
  160. placeholder: "考试地点",
  161. scope: "applySiteAddressX",
  162. getType: 1,
  163. diff: "ksdd",
  164. },
  165. {
  166. prop: "searchKey",
  167. placeholder: "请输入学员姓名/学员身份证",
  168. },
  169. {
  170. prop: "idCards",
  171. placeholder: "请输入学员身份证",
  172. scope: "textarea",
  173. },
  174. ],
  175. formData: {
  176. applyId: "",
  177. pageSize: 10,
  178. pageNum: 1,
  179. idCards: "",
  180. canCancel: 1,
  181. },
  182. // 表单
  183. tableSet: [
  184. {
  185. label: "预约状态",
  186. prop: "subscribeStatus",
  187. hidden: true,
  188. scope: "isOptions",
  189. options: [
  190. {
  191. label: "正常",
  192. value: 1,
  193. },
  194. {
  195. label: "取消",
  196. value: 2,
  197. },
  198. ],
  199. },
  200. {
  201. label: "前培标记",
  202. prop: "beforeStatus",
  203. hidden: true,
  204. scope: "isOptions",
  205. options: [
  206. {
  207. label: "已开通",
  208. value: 1,
  209. },
  210. ],
  211. },
  212. {
  213. label: "考试登记",
  214. prop: "examStatus",
  215. hidden: true,
  216. scope: "isOptionsDZYQ",
  217. options: [
  218. {
  219. label: "待登记",
  220. value: 0,
  221. },
  222. {
  223. label: "正常",
  224. value: 1,
  225. },
  226. {
  227. label: "缺考",
  228. value: 2,
  229. },
  230. {
  231. label: "作弊",
  232. value: 3,
  233. },
  234. {
  235. label: "替考",
  236. value: 4,
  237. },
  238. ],
  239. },
  240. {
  241. label: "考试成绩和结果",
  242. prop1: "performance",
  243. prop2: "result",
  244. hidden: true,
  245. scope: "resultType",
  246. },
  247. {
  248. label: "证书编号",
  249. prop: "certificateCode",
  250. hidden: true,
  251. },
  252. {
  253. label: "考试标题",
  254. prop: "applyName",
  255. hidden: true,
  256. },
  257. {
  258. label: "前培标题",
  259. prop: "beforeName",
  260. hidden: true,
  261. },
  262. {
  263. label: "学员姓名",
  264. prop: "realname",
  265. hidden: true,
  266. },
  267. {
  268. label: "学员身份证",
  269. prop: "idCard",
  270. hidden: true,
  271. },
  272. {
  273. label: "所购商品",
  274. prop1: "goodsCode",
  275. prop2: "goodsName",
  276. prop3: "standPrice",
  277. hidden: true,
  278. scope: "goodsInfos",
  279. },
  280. {
  281. label: "学员报考类型",
  282. prop: "studentType",
  283. hidden: true,
  284. scope: "isOptions",
  285. options: [
  286. {
  287. label: "非补考学员",
  288. value: 1,
  289. },
  290. {
  291. label: "补考学员",
  292. value: 2,
  293. },
  294. ],
  295. },
  296. {
  297. label: "所报专业",
  298. prop: "categoryName",
  299. hidden: true,
  300. },
  301. {
  302. label: "预约场次(考试地点和时间)",
  303. prop1: "applySiteAddress",
  304. prop2: "applySiteExamTime",
  305. prop3: "applySiteStartTime",
  306. prop4: "applySiteEndTime",
  307. hidden: true,
  308. scope: "changAdress",
  309. },
  310. {
  311. label: "考试次数消耗",
  312. prop: "examExpend",
  313. hidden: true,
  314. },
  315. {
  316. label: "预约场次(考培地点和时间)",
  317. prop1: "applySiteAddressTrain",
  318. prop2: "applySiteExamTrainTime",
  319. prop3: "applySiteStartTrainTime",
  320. prop4: "applySiteEndTrainTime",
  321. hidden: true,
  322. scope: "changAdress",
  323. },
  324. {
  325. label: "前培次数消耗",
  326. prop: "beforeExpend",
  327. hidden: true,
  328. },
  329. {
  330. label: "创建时间",
  331. prop: "createTime",
  332. hidden: true,
  333. scope: "aTimeList",
  334. },
  335. ],
  336. tableData: [], //表单数据
  337. total: 0, //一共多少条
  338. idcordList: "",
  339. copyAppid: "",
  340. dialogDJ: false,
  341. listData: {},
  342. peopleList: [],
  343. };
  344. },
  345. async mounted() {
  346. await this.getFirstOptions();
  347. this.search();
  348. },
  349. activated() {
  350. this.search();
  351. },
  352. methods: {
  353. /**
  354. * 下载模板
  355. */
  356. getDowm() {
  357. let url = baseUrls.BASE_IMG_URL + "/oss/images/file/20220214.xls";
  358. let link = document.createElement("a");
  359. let fileName = "导入模板" + ".xlsx";
  360. document.body.appendChild(link);
  361. link.href = url;
  362. link.dowmload = fileName;
  363. link.click();
  364. link.remove();
  365. },
  366. /**
  367. * 导入
  368. */
  369. importMobleadd(e) {
  370. var self = this;
  371. var file = e.target.files[0];
  372. let formData = new FormData();
  373. formData.append("file", file);
  374. this.$api
  375. .editsystemimportIdsData(formData)
  376. .then((res) => {
  377. if (!res.data.length) {
  378. this.$message.warning("未检测到上传学员数据,请检查上传文件");
  379. return;
  380. }
  381. let idList = res.data.map((item) => {
  382. return item.idCard.toString();
  383. });
  384. if (this.idcordList) {
  385. var arr = this.idcordList.split("\n");
  386. var arrs = arr.concat(idList);
  387. var newArr = arrs.filter(function (value, index, self) {
  388. return self.indexOf(value) === index;
  389. });
  390. this.idcordList = newArr.join("\n");
  391. } else {
  392. var newArr = idList.filter(function (value, index, self) {
  393. return self.indexOf(value) === index;
  394. });
  395. this.idcordList = newArr.join("\n");
  396. }
  397. this.$message.success("上传成功");
  398. })
  399. .finally(() => {
  400. e.target.value = "";
  401. });
  402. },
  403. getFirstOptions() {
  404. return new Promise((resolve, reject) => {
  405. this.$api
  406. .inquiresystemapplyList({ status: "0,1,2", pageSize: 1, pageNum: 1 })
  407. .then((res) => {
  408. if (res.rows.length) {
  409. this.copyAppid = res.rows[0].applyId;
  410. this.formData.applyId = res.rows[0].applyId;
  411. }
  412. resolve();
  413. });
  414. });
  415. },
  416. submitChecksPals() {
  417. this.formData.idCards = this.idcordList;
  418. this.dialogPLS = false;
  419. },
  420. advanced(datas) {
  421. this.dialogPLS = true;
  422. this.idcordList = this.formData.idCards;
  423. },
  424. moreActive() {
  425. if (!this.$refs.tableList.allCheckData.length) {
  426. this.$message.warning("请勾选需要取消预约的列表");
  427. return;
  428. }
  429. this.peopleList = JSON.parse(
  430. JSON.stringify(this.$refs.tableList.allCheckData)
  431. );
  432. this.listData = {};
  433. this.dialogDJ = true;
  434. },
  435. submitChecksDJ() {
  436. var data = JSON.parse(JSON.stringify(this.listData));
  437. var arrays = [];
  438. this.peopleList.forEach((item) => {
  439. arrays.push(item.subscribeId);
  440. });
  441. data.subscribeId = arrays;
  442. data.subscribeStatus = 2;
  443. this.$api.editsystemsubscribe(data).then((res) => {
  444. this.$message.success("已批量取消预约");
  445. this.dialogDJ = false;
  446. this.search();
  447. this.$refs.tableList.allCheckData = [];
  448. this.$refs.tableList.$refs.pagerset.clearSelection();
  449. });
  450. },
  451. search(int) {
  452. this.loading = true;
  453. if (int === 1) {
  454. this.formData.pageNum = 1;
  455. }
  456. if (int === 2) {
  457. this.formData = {
  458. pageSize: 10,
  459. pageNum: 1,
  460. idCards: "",
  461. applyId: this.formData.applyId,
  462. canCancel: 1,
  463. // applyId: this.copyAppid,
  464. };
  465. }
  466. var data = JSON.parse(JSON.stringify(this.formData));
  467. if (this.formData.idCards) {
  468. data.idCards = this.formData.idCards.split("\n");
  469. }
  470. if (this.formData.searchKey && this.formData.idCards) {
  471. data.searchType = 1;
  472. } else {
  473. data.searchType = 0;
  474. }
  475. this.$api
  476. .inquiresystemsubscribelist(data)
  477. .then((res) => {
  478. this.tableData = res.rows;
  479. this.total = res.total;
  480. this.navText.index = res.total;
  481. })
  482. .finally(() => {
  483. this.loading = false;
  484. });
  485. },
  486. init() {
  487. this.$refs.tableList.allCheckData = [];
  488. this.$refs.tableList.$refs.pagerset.clearSelection();
  489. this.search(2);
  490. },
  491. handleSizeChange(v) {
  492. this.formData.pageSize = v;
  493. this.formData.pageNum = 1;
  494. this.search();
  495. },
  496. handleCurrentChange(v) {
  497. this.formData.pageNum = v;
  498. this.search();
  499. },
  500. },
  501. };
  502. </script>
  503. <style lang="less" scoped>
  504. /deep/.el-button {
  505. border-radius: 8px;
  506. }
  507. /deep/.el-dialog {
  508. border-radius: 8px;
  509. .el-dialog__header {
  510. padding: 0;
  511. .hearders {
  512. height: 40px;
  513. display: flex;
  514. align-items: center;
  515. justify-content: space-between;
  516. padding: 0px 18px 0px 20px;
  517. border-bottom: 1px solid #e2e2e2;
  518. .leftTitle {
  519. font-size: 14px;
  520. font-weight: bold;
  521. color: #2f4378;
  522. }
  523. .rightBoxs {
  524. display: flex;
  525. align-items: center;
  526. img {
  527. width: 14px;
  528. height: 14px;
  529. margin-left: 13px;
  530. cursor: pointer;
  531. }
  532. }
  533. }
  534. }
  535. .el-dialog__footer {
  536. padding: 0;
  537. .dialog-footer {
  538. padding: 0px 40px;
  539. height: 70px;
  540. border-top: 1px solid #e2e2e2;
  541. display: flex;
  542. align-items: center;
  543. justify-content: flex-end;
  544. }
  545. }
  546. }
  547. .imgBox {
  548. width: 100%;
  549. // height: 210px;
  550. border: 1px solid #e2e2e2;
  551. border-radius: 8px;
  552. padding: 8px 8px 3px;
  553. display: flex;
  554. flex-direction: column;
  555. align-items: center;
  556. .imgLabel {
  557. flex: 1;
  558. width: 100%;
  559. border: 1px dotted #e2e2e2;
  560. color: #999;
  561. font-size: 14px;
  562. cursor: pointer;
  563. border-radius: 8px;
  564. .msPhoto {
  565. display: flex;
  566. justify-content: center;
  567. align-items: center;
  568. max-width: 100%;
  569. max-height: 270px;
  570. img {
  571. max-width: 100%;
  572. max-height: 270px;
  573. }
  574. }
  575. .imgbbx {
  576. display: flex;
  577. flex-direction: column;
  578. align-items: center;
  579. justify-content: center;
  580. width: 100%;
  581. height: 100%;
  582. i {
  583. font-weight: bold;
  584. margin: 14px 0;
  585. font-size: 24px;
  586. }
  587. }
  588. }
  589. p {
  590. margin: 5px 0px;
  591. }
  592. }
  593. .liBVS {
  594. margin-right: 20px;
  595. margin-bottom: 12px;
  596. padding: 0px 6px;
  597. border: 1px solid #999;
  598. border-radius: 4px;
  599. height: 30px;
  600. line-height: 30px;
  601. display: inline-block;
  602. float: left;
  603. }
  604. .clsw {
  605. margin-left: 4px;
  606. cursor: pointer;
  607. color: #f56c6c;
  608. }
  609. .swq {
  610. text-align: center;
  611. border-bottom: 1px solid #eee;
  612. }
  613. .dowmStys {
  614. color: blue;
  615. cursor: pointer;
  616. }
  617. </style>