index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970
  1. <template>
  2. <div id="chapterVolumeManagementAdd">
  3. <el-form
  4. label-position="right"
  5. label-width="120px"
  6. :model="listData"
  7. :rules="rules"
  8. ref="listData"
  9. >
  10. <div class="boxWidth">
  11. <el-form-item label="适用业务层级" :required="true">
  12. <el-select
  13. v-model="eduType"
  14. placeholder="请选择教育类型"
  15. @change="changeEduType"
  16. >
  17. <el-option
  18. v-for="(item, index) in eduTypeOptions"
  19. :key="index"
  20. :label="item.educationName"
  21. :value="item.id"
  22. >
  23. </el-option>
  24. </el-select>
  25. <el-select
  26. v-model="courType"
  27. placeholder="请选择业务层次"
  28. @change="changecourseType"
  29. >
  30. <el-option
  31. v-for="(item, index) in newCourTypeOptions"
  32. :key="index"
  33. :label="item.projectName + '-' + item.businessName"
  34. :value="item.id"
  35. >
  36. </el-option>
  37. </el-select>
  38. <el-popover
  39. ref="popovers"
  40. placement="bottom"
  41. trigger="click"
  42. @show="showHandle"
  43. @hide="hideHandle"
  44. :disabled="courType ? false : true"
  45. >
  46. <el-radio-group v-model="sujectApis" class="dis_flexbox">
  47. <el-radio
  48. v-for="(item, index) in newSujectOption"
  49. :label="item.newId"
  50. :key="index"
  51. >{{ item.subjectName }}</el-radio
  52. >
  53. </el-radio-group>
  54. <div style="display: block; text-align: center; margin-top: 10px">
  55. <el-button size="mini" type="primary" @click="submitSujectArray"
  56. >关闭</el-button
  57. >
  58. </div>
  59. <el-button
  60. slot="reference"
  61. style="margin-left: 12px"
  62. @click="getMessage"
  63. >请选择科目</el-button
  64. >
  65. </el-popover>
  66. </el-form-item>
  67. <el-form-item label="">
  68. <!-- <span v-if="Object.keys(newSujectApis).length == 0"
  69. >未选项目类型</span
  70. > -->
  71. <div
  72. v-if="Object.keys(newSujectApis).length !== 0"
  73. style="display: flex"
  74. >
  75. <div class="listBoxStys">
  76. {{
  77. newSujectApis.educationName +
  78. " - " +
  79. newSujectApis.projectName +
  80. " - " +
  81. newSujectApis.businessName +
  82. " - " +
  83. newSujectApis.subjectName
  84. }}
  85. <i class="el-icon-error closeIcons" @click="closeType"></i>
  86. </div>
  87. </div>
  88. <el-popover
  89. placement="bottom-start"
  90. trigger="hover"
  91. :close-delay="50"
  92. >
  93. <ul style="margin: 0; max-width: 600px">
  94. <li
  95. class="copyDataLi"
  96. :class="changeSty(itemT)"
  97. v-for="(itemT, indexT) in localData"
  98. :key="indexT"
  99. @click="unTime(itemT)"
  100. >
  101. {{
  102. `${itemT.educationName}-${itemT.projectName}-${itemT.businessName}-${itemT.subjectName}`
  103. }}
  104. </li>
  105. </ul>
  106. <el-button
  107. v-show="localData.length"
  108. type="danger"
  109. slot="reference"
  110. size="mini"
  111. style="margin-right: 10px"
  112. >最近选择</el-button
  113. >
  114. </el-popover>
  115. </el-form-item>
  116. <el-form-item label="标题前缀" prop="prefixName">
  117. <el-input v-model="listData.prefixName"></el-input>
  118. </el-form-item>
  119. <el-form-item label="章卷名称" prop="name">
  120. <el-input v-model="listData.name"></el-input>
  121. </el-form-item>
  122. <el-form-item label="是否发布" prop="publishStatus">
  123. <el-radio-group v-model="listData.publishStatus">
  124. <el-radio :label="1">是</el-radio>
  125. <el-radio :label="0">否</el-radio>
  126. </el-radio-group>
  127. </el-form-item>
  128. </div>
  129. <el-form-item label="管理试卷">
  130. <div class="dis_plays">
  131. <div>
  132. <el-button size="small" @click="openBoxs">调用已有数据</el-button>
  133. <el-button size="small" @click="addChapter"
  134. >自定义添加试卷</el-button
  135. >
  136. </div>
  137. <div style="color: #f56c6c">
  138. <span style="margin-right: 10px"
  139. >试卷总数:{{ tableData.length }}</span
  140. >
  141. <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
  142. </div>
  143. </div>
  144. <el-table
  145. :data="tableData"
  146. border
  147. :header-cell-style="{
  148. 'background-color': '#eee',
  149. padding: '8px',
  150. color: '#333',
  151. }"
  152. :default-sort="{ prop: 'sort', order: 'ascending' }"
  153. >
  154. <el-table-column
  155. v-for="(item, index) in tableSet"
  156. :width="item.width"
  157. :key="index"
  158. :label="item.label"
  159. align="center"
  160. :show-overflow-tooltip="true"
  161. header-align="center"
  162. :sortable="item.prop === 'sort'"
  163. sort-by="sort"
  164. :prop="item.prop"
  165. >
  166. <template slot-scope="scope">
  167. <span v-if="item.scope === 'types'">{{
  168. scope.row[item.prop] === 1
  169. ? "录播"
  170. : scope.row[item.prop] === 2
  171. ? "直播"
  172. : scope.row[item.prop] === 3
  173. ? "回放"
  174. : "未知"
  175. }}</span>
  176. <span v-else-if="item.scope === 'Status'">
  177. {{
  178. scope.row[item.prop] === 1
  179. ? "发布"
  180. : scope.row[item.prop] === 0
  181. ? "未发布"
  182. : "未知"
  183. }}
  184. </span>
  185. <div v-else-if="item.scope === 'inputs'">
  186. <el-input-number
  187. style="width: 50px"
  188. size="small"
  189. :controls="false"
  190. v-model="scope.row[item.prop]"
  191. controls-position="right"
  192. :min="0"
  193. ></el-input-number>
  194. </div>
  195. <span v-else>{{ scope.row[item.prop] }}</span></template
  196. >
  197. </el-table-column>
  198. <el-table-column
  199. label="操作"
  200. align="center"
  201. fixed="right"
  202. width="180px"
  203. >
  204. <template slot-scope="scope">
  205. <el-button type="text" @click="jumpChapter(scope.row)"
  206. >试卷内容</el-button
  207. >
  208. <el-button type="text" @click="delList(scope.row, scope.$index)"
  209. >删除</el-button
  210. >
  211. </template>
  212. </el-table-column>
  213. </el-table>
  214. </el-form-item>
  215. <el-form-item>
  216. <el-button @click="backPage">取消</el-button>
  217. <el-button
  218. type="primary"
  219. @click="submitIns('listData')"
  220. :loading="disabledBtn"
  221. >确定</el-button
  222. >
  223. </el-form-item>
  224. </el-form>
  225. <el-dialog
  226. @closed="closedFunc"
  227. :visible.sync="dialogVisible"
  228. width="800px"
  229. :show-close="false"
  230. :close-on-click-modal="false"
  231. >
  232. <div slot="title" class="hearders">
  233. <div class="leftTitle">添加试卷</div>
  234. <div class="rightBoxs">
  235. <img
  236. src="@/assets/images/Close@2x.png"
  237. alt=""
  238. @click="dialogVisible = false"
  239. />
  240. </div>
  241. </div>
  242. <search-box-new
  243. ref="searchBox"
  244. :formData="formData"
  245. :formList="formList"
  246. @search="getInfos"
  247. @init="init"
  248. />
  249. <el-table
  250. ref="multipleTable"
  251. :data="boxtableData"
  252. border
  253. @select-all="selectAll"
  254. @select="select"
  255. :row-key="getRowKeys"
  256. :header-cell-style="{
  257. 'background-color': '#eee',
  258. padding: '8px',
  259. color: '#333',
  260. }"
  261. >
  262. <el-table-column
  263. align="center"
  264. type="selection"
  265. width="55"
  266. header-align="center"
  267. :selectable="checkboxT"
  268. :reserve-selection="true"
  269. >
  270. </el-table-column>
  271. <template v-for="(item, index) in tableSet">
  272. <el-table-column
  273. v-if="item.scope !== 'inputs'"
  274. :width="item.width"
  275. :key="index"
  276. :label="item.label"
  277. align="center"
  278. :show-overflow-tooltip="true"
  279. header-align="center"
  280. >
  281. <template slot-scope="scope">
  282. <span v-if="item.scope === 'types'">{{
  283. scope.row[item.prop] === 1
  284. ? "录播"
  285. : scope.row[item.prop] === 2
  286. ? "直播"
  287. : scope.row[item.prop] === 3
  288. ? "回放"
  289. : "未知"
  290. }}</span>
  291. <span v-else-if="item.scope === 'Status'">
  292. {{
  293. scope.row[item.prop] === 1
  294. ? "发布"
  295. : scope.row[item.prop] === 0
  296. ? "未发布"
  297. : "未知"
  298. }}
  299. </span>
  300. <span v-else>{{ scope.row[item.prop] }}</span></template
  301. >
  302. </el-table-column></template
  303. >
  304. </el-table>
  305. <pagination
  306. :total="total"
  307. :pageSize="formData.pageSize"
  308. :currentPage="formData.pageNum"
  309. @handleSizeChange="handleSizeChange"
  310. @handleCurrentChange="handleCurrentChange"
  311. />
  312. <span slot="footer" class="dialog-footer">
  313. <el-button @click="dialogVisible = false">取 消</el-button>
  314. <el-button
  315. type="primary"
  316. :disabled="activeLists.length === 0"
  317. @click="submitForm"
  318. >确 定</el-button
  319. >
  320. </span>
  321. </el-dialog>
  322. <addChapterjs ref="addChapterjs" @backData="backData" />
  323. </div>
  324. </template>
  325. <script>
  326. import searchBoxNew from "@/components/searchBoxNew";
  327. import pagination from "@/components/pagination";
  328. import tableList from "@/components/tableList";
  329. import addChapterjs from "../addChapterjs.vue";
  330. export default {
  331. name: "ChapterVolumeManagementAdd",
  332. components: { searchBoxNew, tableList, pagination, addChapterjs },
  333. data() {
  334. return {
  335. disabledBtn: false,
  336. listData: {
  337. publishStatus: 1,
  338. }, // 弹窗数据
  339. eduTypeOptions: [], //教育类型数据
  340. projectTypeOptions: [], //项目类型数据
  341. courTypeOptions: [], //业务层次数据
  342. newCourTypeOptions: [], //当前业务层次数据
  343. sujectOption: [], //科目数据
  344. newSujectOption: [], //当前科目数据数据
  345. eduType: "", //当前选中教育类型
  346. courType: "", //当前选中业务层次
  347. newSujectApis: {},
  348. sujectApis: "", //当前存在的科目 例如'19-2'
  349. //表单验证
  350. rules: {
  351. name: [{ required: true, message: "请输入章卷名称", trigger: "blur" }],
  352. publishStatus: [
  353. { required: true, message: "请选择是否发布", trigger: "change" },
  354. ],
  355. },
  356. numberAll: 0, //试卷总数
  357. minTimeAll: 0, //总时长
  358. tableSet: [
  359. { label: "排序", prop: "sort", scope: "inputs", width: "100" },
  360. { label: "试卷编码", prop: "code", width: "140" },
  361. { label: "标题前缀", prop: "prefixName", width: "170" },
  362. { label: "试卷标题", prop: "examName" },
  363. { label: "题数量", prop: "questionNum", width: "120" },
  364. {
  365. label: "发布状态",
  366. prop: "publishStatus",
  367. scope: "Status",
  368. width: "120",
  369. },
  370. ],
  371. tableData: [],
  372. dialogVisible: false,
  373. boxtableData: [],
  374. total: 0, //一共多少条
  375. formData: {
  376. publishStatus: 1,
  377. status: 1,
  378. pageSize: 10,
  379. pageNum: 1,
  380. },
  381. //搜索
  382. formList: [
  383. // {
  384. // prop: "educationTypeId",
  385. // placeholder: "教育类型",
  386. // scope: "educationType",
  387. // },
  388. // {
  389. // prop: "businessId",
  390. // placeholder: "业务层次",
  391. // scope: "businessLevel",
  392. // edu: "educationTypeId",
  393. // },
  394. {
  395. prop: "key",
  396. placeholder: "试卷标题/试卷编码/标题前缀",
  397. },
  398. ],
  399. disCheckList: [], //已选转禁用复选列表
  400. activeLists: [],
  401. localData: [],
  402. };
  403. },
  404. watch: {
  405. sujectApis: {
  406. immediate: true,
  407. handler(newName, oldName) {
  408. this.changeTypes();
  409. },
  410. },
  411. newSujectApis() {
  412. this.tableData = [];
  413. },
  414. },
  415. mounted() {
  416. this.localData = this.$methodsTools.getBusinessList();
  417. this.getDict();
  418. // this.search();
  419. },
  420. activated() {
  421. if (this.$store.getters.testPaperPage) {
  422. this.$api
  423. .obtainbankexam(this.$store.getters.testPaperPage.id)
  424. .then((res) => {
  425. const FIND = this.tableData.findIndex((item) => {
  426. return item.examId == this.$store.getters.testPaperPage.id;
  427. });
  428. if (FIND !== -1) {
  429. res.data.sort = this.tableData[FIND].sort;
  430. this.tableData.splice(FIND, 1, res.data);
  431. }
  432. this.$store.dispatch("changetestPaperPage", null);
  433. });
  434. }
  435. },
  436. methods: {
  437. jumpChapter(v) {
  438. const jump = () => {
  439. this.$store.dispatch("changetestPaperPage", {
  440. name: "chapterVolumeManagementAdd",
  441. id: v.examId,
  442. });
  443. this.$router.push({
  444. path: "editPaper",
  445. query: {
  446. id: v.examId,
  447. code: v.code,
  448. name: 1,
  449. },
  450. });
  451. };
  452. const statusPage = this.$store.state.tagsView.visitedViews.some(
  453. (item) => {
  454. return item.name == "EditPaper";
  455. }
  456. );
  457. if (statusPage) {
  458. this.$store
  459. .dispatch("tagsView/delCachedView", {
  460. name: "EditPaper",
  461. })
  462. .then((res) => {
  463. jump();
  464. });
  465. } else {
  466. jump();
  467. }
  468. },
  469. /**
  470. * 打开添加章组件
  471. */
  472. addChapter() {
  473. if (!this.newSujectApis.subjectId) {
  474. this.$message.warning("请先选择科目");
  475. return;
  476. }
  477. this.$refs.addChapterjs.openBoxs([this.newSujectApis]);
  478. },
  479. /**
  480. * 添加章-返回数据
  481. */
  482. backData(v) {
  483. this.$api.inquirebankexamList({ examIds: v }).then((res) => {
  484. this.activeLists = res.rows;
  485. this.submitForm();
  486. });
  487. },
  488. unTime(val) {
  489. let a = `${val.businessId}-${val.subjectId}`;
  490. if (this.sujectApis == a) {
  491. this.sujectApis = "";
  492. } else {
  493. this.sujectApis = a;
  494. }
  495. },
  496. changeSty(val) {
  497. var arr = "";
  498. let arr1 = this.sujectApis.split("-").map(Number);
  499. if (val.businessId == arr1[0] && val.subjectId == arr1[1]) {
  500. arr = "activeStyIcons";
  501. }
  502. return arr;
  503. },
  504. getMessage() {
  505. if (!this.courType) {
  506. this.$message.warning("请先选择业务层级");
  507. }
  508. },
  509. openBoxs() {
  510. if (!this.newSujectApis.subjectId) {
  511. this.$message.warning("请先选择科目");
  512. return;
  513. }
  514. var data = JSON.parse(JSON.stringify(this.formData));
  515. data.businessId = this.newSujectApis.businessId;
  516. data.subjectId = this.newSujectApis.subjectId;
  517. var self = this;
  518. this.$api.inquirebankexamList(data).then((res) => {
  519. var aList = [];
  520. this.tableData.map((item) => {
  521. aList.push(item.examId);
  522. });
  523. this.disCheckList = aList;
  524. this.boxtableData = res.rows;
  525. this.total = res.total;
  526. this.dialogVisible = true;
  527. this.$nextTick(function () {
  528. self.$refs.multipleTable.clearSelection();
  529. });
  530. });
  531. },
  532. getInfosList() {
  533. this.$api
  534. .inquireCoursechaptersectionlist(this.$route.query.id)
  535. .then((result) => {
  536. // this.numberAll = result.total;
  537. // this.minTimeAll = result.timeTotal;
  538. this.tableData = result.rows;
  539. });
  540. },
  541. getInfos(int) {
  542. if (int === 1) {
  543. this.formData.pageNum = 1;
  544. }
  545. if (int === 2) {
  546. this.formData = {
  547. publishStatus: 1,
  548. status: 1,
  549. pageSize: 10,
  550. pageNum: 1,
  551. };
  552. }
  553. var data = JSON.parse(JSON.stringify(this.formData));
  554. data.businessId = this.newSujectApis.businessId;
  555. data.subjectId = this.newSujectApis.subjectId;
  556. this.$api.inquirebankexamList(data).then((res) => {
  557. this.boxtableData = res.rows;
  558. this.total = res.total;
  559. });
  560. },
  561. init() {
  562. this.getInfos(2);
  563. },
  564. // search() {
  565. // this.$api.obtainbankexam(this.$route.query.id).then((res) => {
  566. // res.data.year = res.data.year + "";
  567. // this.listData = res.data;
  568. // });
  569. // this.$api
  570. // .inquirebankexamListbusiness({ type: 2, majorId: this.$route.query.id })
  571. // .then((res) => {
  572. // this.newSujectApis = res.rows[0];
  573. // this.sujectApis =
  574. // res.rows[0].businessId + "-" + res.rows[0].subjectId;
  575. // this.getInfosList();
  576. // });
  577. // },
  578. changeTypes() {
  579. var self = this;
  580. if (!this.sujectApis) {
  581. self.newSujectApis = {};
  582. return;
  583. }
  584. this.courTypeOptions.map((items) => {
  585. if (items.id === this.sujectApis.split("-").map(Number)[0]) {
  586. var obj = {
  587. type: 3,
  588. educationTypeId: items.educationId,
  589. educationName: items.educationName,
  590. projectId: items.projectId,
  591. projectName: items.projectName,
  592. businessId: items.id,
  593. businessName: items.businessName,
  594. };
  595. self.sujectOption.map((i) => {
  596. if (
  597. i.id === self.sujectApis.split("-").map(Number)[1] &&
  598. i.courseArrays.indexOf(items.projectId) !== -1
  599. ) {
  600. obj.subjectName = i.subjectName;
  601. obj.subjectId = i.id;
  602. }
  603. });
  604. self.newSujectApis = obj;
  605. }
  606. });
  607. },
  608. submitSujectArray() {
  609. this.$refs.popovers.doClose();
  610. },
  611. showHandle() {
  612. this.sujectApis = "";
  613. this.newSujectOption.map((item) => {
  614. item.newId = this.courType + "-" + item.id;
  615. if (item.newId === this.sujectApis) {
  616. console.log("成功");
  617. }
  618. });
  619. this.sujectApis =
  620. this.newSujectApis.businessId + "-" + this.newSujectApis.subjectId;
  621. },
  622. hideHandle() {},
  623. getDict() {
  624. this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
  625. this.eduTypeOptions = res.rows;
  626. });
  627. this.$api.inquireCourseProjectType({ status: 1 }).then((res) => {
  628. this.projectTypeOptions = res.rows;
  629. });
  630. this.$api.inquirebusinessList({ status: 1 }).then((res) => {
  631. this.courTypeOptions = res.rows;
  632. this.newCourTypeOptions = res.rows;
  633. });
  634. this.$api.inquireCourseSubject({ status: 1 }).then((res) => {
  635. res.rows.map((item, index) => {
  636. var array = [];
  637. item.courseProjectTypes.map((items, indexs) => {
  638. array.push(items.id);
  639. });
  640. item.courseArrays = array;
  641. });
  642. this.sujectOption = res.rows;
  643. });
  644. },
  645. changeEduType() {
  646. if (!(this.courType === undefined || this.courType === "")) {
  647. this.courType = "";
  648. }
  649. var arrays = [];
  650. this.courTypeOptions.map((item) => {
  651. if (item.educationId === this.eduType) {
  652. arrays.push(item);
  653. }
  654. });
  655. this.newCourTypeOptions = arrays;
  656. },
  657. changecourseType() {
  658. this.newCourTypeOptions.map((item, index) => {
  659. if (item.id === this.courType) {
  660. this.eduType = item.educationId;
  661. var array = [];
  662. this.sujectOption.map((items, indexs) => {
  663. if (items.courseArrays.indexOf(item.projectId) !== -1) {
  664. array.push(items);
  665. }
  666. });
  667. this.newSujectOption = array;
  668. }
  669. });
  670. var arrays = [];
  671. this.courTypeOptions.map((item) => {
  672. if (item.educationId === this.eduType) {
  673. arrays.push(item);
  674. }
  675. });
  676. this.newCourTypeOptions = arrays;
  677. this.$refs.popovers.doClose();
  678. this.tableData = [];
  679. },
  680. submitIns(formName) {
  681. this.$refs[formName].validate((valid) => {
  682. if (valid) {
  683. if (JSON.stringify(this.newSujectApis) === "{}") {
  684. this.$message.error("请选择适用业务层级");
  685. return;
  686. }
  687. for (let i = 0; i < this.tableData.length; i++) {
  688. if (!this.tableData[i].sort && this.tableData[i].sort !== 0) {
  689. this.$message.warning(`管理试卷第${i + 1}条请输入排序`);
  690. return;
  691. }
  692. }
  693. let arr = this.tableData.map((items) => {
  694. return items.sort;
  695. });
  696. if (new Set(arr).size != arr.length) {
  697. this.$message.warning("排序不允许有重复值");
  698. return;
  699. }
  700. this.rulesTableSumbit();
  701. } else {
  702. return false;
  703. }
  704. });
  705. },
  706. async rulesTableSumbit() {
  707. this.disabledBtn = true;
  708. var examList = [];
  709. this.tableData.map((item) => {
  710. examList.push({ examId: item.examId, sort: Number(item.sort) });
  711. });
  712. var data1 = {
  713. // examId: this.listData.examId,
  714. name: this.listData.name,
  715. examList: examList,
  716. publishStatus: this.listData.publishStatus,
  717. prefixName: this.listData.prefixName,
  718. businessList: [this.newSujectApis],
  719. year: this.listData.year,
  720. status: 1,
  721. };
  722. this.$api
  723. .addbankchapter(data1)
  724. .then((res) => {
  725. this.$methodsTools.cacheBusinessList([this.newSujectApis]);
  726. this.$message.success("新增成功");
  727. setTimeout(() => {
  728. this.$store
  729. .dispatch("tagsView/exitView", this.$route)
  730. .then((res) => {
  731. this.$router.push({
  732. path: "chapterVolumeManagement",
  733. });
  734. });
  735. }, 500);
  736. })
  737. .catch(() => {
  738. this.disabledBtn = false;
  739. });
  740. },
  741. backPage() {
  742. this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
  743. this.$router.push({
  744. path: "chapterVolumeManagement",
  745. });
  746. });
  747. },
  748. closeType() {
  749. this.sujectApis = "";
  750. },
  751. handleSizeChange(v) {
  752. this.formData.pageSize = v;
  753. this.formData.pageNum = 1;
  754. this.getInfos();
  755. },
  756. handleCurrentChange(v) {
  757. this.formData.pageNum = v;
  758. this.getInfos();
  759. },
  760. selectAll(value) {
  761. this.activeLists = value;
  762. },
  763. select(value) {
  764. this.activeLists = value;
  765. },
  766. checkboxT(row, index) {
  767. if (this.disCheckList.indexOf(row.examId) !== -1) {
  768. return false;
  769. } else {
  770. return true;
  771. }
  772. },
  773. getRowKeys(row) {
  774. return row.examId;
  775. },
  776. submitForm() {
  777. if (this.activeLists.length === 0) {
  778. this.dialogVisible = false;
  779. return;
  780. }
  781. if (this.tableData.length) {
  782. let maxIndex = 0;
  783. this.tableData.forEach((item) => {
  784. if (item.sort > maxIndex) {
  785. maxIndex = item.sort;
  786. }
  787. });
  788. this.activeLists.forEach((item, index) => {
  789. item.sort = maxIndex + index + 1;
  790. });
  791. } else {
  792. this.activeLists.forEach((item, index) => {
  793. item.sort = index + 1;
  794. });
  795. }
  796. this.tableData = this.tableData.concat(this.activeLists);
  797. this.dialogVisible = false;
  798. this.$message.success("添加成功");
  799. },
  800. delList(item, index) {
  801. this.tableData.splice(index, 1);
  802. this.$message.success("删除成功");
  803. },
  804. closedFunc() {
  805. this.activeLists = [];
  806. },
  807. },
  808. };
  809. </script>
  810. <style lang="less" scoped>
  811. .dis_flexbox {
  812. display: flex;
  813. flex-direction: column;
  814. }
  815. .boxWidth {
  816. width: 700px;
  817. }
  818. .numInputs {
  819. width: 150px;
  820. }
  821. .checkboxSty {
  822. max-height: 210px;
  823. overflow: auto;
  824. display: flex;
  825. flex-direction: column;
  826. }
  827. .listBoxStys {
  828. flex-shrink: 0;
  829. padding: 0px 10px;
  830. border-radius: 8px;
  831. border: 1px solid #eee;
  832. margin-right: 10px;
  833. margin-bottom: 6px;
  834. }
  835. .closeIcons {
  836. color: red;
  837. cursor: pointer;
  838. margin-left: 6px;
  839. }
  840. .ach {
  841. display: flex;
  842. align-items: center;
  843. overflow: hidden;
  844. }
  845. .clh {
  846. display: flex;
  847. align-items: center;
  848. flex-wrap: wrap;
  849. }
  850. .imgBoxins {
  851. width: 375px;
  852. height: 220px;
  853. text-align: center;
  854. img {
  855. height: 100%;
  856. }
  857. }
  858. .iconStsz {
  859. font-size: 40px;
  860. color: #67c23a;
  861. cursor: pointer;
  862. }
  863. .BusBoxs {
  864. min-height: 100px;
  865. border: 1px solid #a4a4a4;
  866. margin-bottom: 10px;
  867. border-radius: 8px;
  868. max-height: 280px;
  869. padding: 10px;
  870. overflow-y: auto;
  871. .fot_Le {
  872. border-radius: 12px;
  873. border: 1px solid yellowgreen;
  874. padding: 0px 10px;
  875. height: 30px;
  876. line-height: 30px;
  877. text-align: center;
  878. float: left;
  879. margin-right: 6px;
  880. margin-bottom: 6px;
  881. .icon_clear {
  882. margin-left: 2px;
  883. font-size: 15px;
  884. color: #f56c6c;
  885. cursor: pointer;
  886. }
  887. }
  888. }
  889. .marg_play {
  890. display: flex;
  891. margin-bottom: 15px;
  892. .spans {
  893. text-align: right;
  894. width: 80px;
  895. }
  896. }
  897. /deep/.el-button {
  898. border-radius: 8px;
  899. }
  900. /deep/.el-dialog {
  901. border-radius: 8px;
  902. .el-dialog__header {
  903. padding: 0;
  904. .hearders {
  905. height: 40px;
  906. display: flex;
  907. align-items: center;
  908. justify-content: space-between;
  909. padding: 0px 18px 0px 20px;
  910. border-bottom: 1px solid #e2e2e2;
  911. .leftTitle {
  912. font-size: 14px;
  913. font-weight: bold;
  914. color: #2f4378;
  915. }
  916. .rightBoxs {
  917. display: flex;
  918. align-items: center;
  919. img {
  920. width: 14px;
  921. height: 14px;
  922. margin-left: 13px;
  923. cursor: pointer;
  924. }
  925. }
  926. }
  927. }
  928. .el-dialog__footer {
  929. padding: 0;
  930. .dialog-footer {
  931. padding: 0px 40px;
  932. height: 70px;
  933. border-top: 1px solid #e2e2e2;
  934. display: flex;
  935. align-items: center;
  936. justify-content: center;
  937. }
  938. }
  939. }
  940. .centerStys {
  941. display: flex;
  942. align-items: center;
  943. justify-content: center;
  944. margin-top: 18px;
  945. }
  946. .dis_fos {
  947. align-items: flex-end;
  948. display: flex;
  949. justify-content: space-between;
  950. }
  951. .margin_bs {
  952. margin-bottom: 6px;
  953. }
  954. .dis_plays {
  955. display: flex;
  956. align-items: center;
  957. justify-content: space-between;
  958. margin-bottom: 10px;
  959. }
  960. .comInputsty {
  961. width: 50px;
  962. height: 24px;
  963. text-align: center;
  964. border: none;
  965. }
  966. </style>