finstlbillsitems2.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. <template>
  2. <div>
  3. <avue-crud
  4. :option="option"
  5. :data="pageData"
  6. id="out-table"
  7. ref="crud"
  8. @selection-change="handleSelectionChange"
  9. :header-cell-style="tableHeaderCellStyle"
  10. :row-class-name="rowClassName"
  11. :cell-style="cellStyle"
  12. :page.sync="page"
  13. @size-change="sizeChange"
  14. @current-change="currentChange"
  15. @resetColumn="resetColumn('crud', 'option', 'optionBack', 479)"
  16. @saveColumn="saveColumn('crud', 'option', 'optionBack', 479)"
  17. >
  18. <template slot="menuLeft">
  19. <slot name="menuLeft"></slot>
  20. </template>
  21. <tempalte slot="currentStlAmountRMB" slot-scope="{ row }">
  22. <el-input-number
  23. v-if="brfalse"
  24. v-model="row.currentStlAmountRMB"
  25. @change="armbChange(row)"
  26. :controls="false"
  27. placeholder="请输入 本次签收CNY"
  28. size="mini"
  29. style="width: 100%;"
  30. :disabled="row.currentStlCurCode != 'CNY' || row.isSignfor == 1"
  31. ></el-input-number>
  32. <span v-else>{{ row.currentStlAmountRMB }}</span>
  33. </tempalte>
  34. <tempalte slot="currentStlAmountUSD" slot-scope="{ row }">
  35. <el-input-number
  36. v-if="brfalse"
  37. v-model="row.currentStlAmountUSD"
  38. @change="ausdChange(row)"
  39. :controls="false"
  40. placeholder="请输入 本次签收USD"
  41. size="mini"
  42. style="width: 100%;"
  43. :disabled="row.currentStlCurCode != 'USD' || row.isSignfor == 1"
  44. ></el-input-number>
  45. <span v-else>{{ row.currentStlAmountUSD }}</span>
  46. </tempalte>
  47. <template slot="stlAmountDr" slot-scope="{ row }">
  48. <span v-if="row.dc == 'D'">{{ row.stlAmountDr }}</span>
  49. <span v-if="row.dc == 'C'">{{ row.stlAmountCr }}</span>
  50. </template>
  51. <template slot="stlAmountDrUSD" slot-scope="{ row }">
  52. <span v-if="row.dc == 'D'">{{ row.stlAmountDrUSD }}</span>
  53. <span v-if="row.dc == 'C'">{{ row.stlAmountCrUSD }}</span>
  54. </template>
  55. <template slot="reconciliationAmount" slot-scope="{ row }">
  56. <el-popover trigger="click">
  57. <avue-crud :data="rlaData" :option="rlaOption"></avue-crud>
  58. <span style="color: #409EFF;cursor: pointer" slot="reference" @click="viewRLA(row)">{{ row.reconciliationAmount }}</span>
  59. </el-popover>
  60. </template>
  61. <template slot="reconciliationAmountUsd" slot-scope="{ row }">
  62. <el-popover trigger="click">
  63. <avue-crud :data="rlaData" :option="rlaOption"></avue-crud>
  64. <span style="color: #409EFF;cursor: pointer" slot="reference" @click="viewRLA(row)">{{ row.reconciliationAmountUsd }}</span>
  65. </el-popover>
  66. </template>
  67. <template slot="remarkss" slot-scope="{ row }">
  68. <el-input style="width: 100%;" v-model="row.remarkss" v-if="brfalse" size="mini" autocomplete="off" clearable placeholder="请输入 备注">
  69. </el-input>
  70. <span v-else>{{ row.remarkss }}</span>
  71. </template>
  72. </avue-crud>
  73. </div>
  74. </template>
  75. <script>
  76. import { getWorkDicts } from "@/api/system/dictbiz";
  77. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  78. import costDetails from "../assembly/costDetails.vue";
  79. import { getRateList } from "@/api/iosBasicData/rateManagement";
  80. import { feecenterSelectByAccNoList, getListAll } from "@/api/iosBasicData/finstlbills";
  81. export default {
  82. components: { SearchQuery, costDetails },
  83. props: {
  84. tableData: {
  85. type: Array,
  86. default: []
  87. },
  88. brfalse: {
  89. type: Boolean,
  90. default: true
  91. },
  92. handleSelectionData: {
  93. type: Array,
  94. default: []
  95. },
  96. form: {
  97. type: Object,
  98. default: {}
  99. },
  100. editSave: {
  101. type: Boolean,
  102. default: false
  103. }
  104. },
  105. data() {
  106. return {
  107. rlaData: [],
  108. rlaOption: {
  109. header: false,
  110. menu: false,
  111. align: "center",
  112. column: [
  113. {
  114. label: "来源单号",
  115. prop: "srcNo",
  116. width: "200",
  117. overHidden: true
  118. },
  119. {
  120. label: "来源类型",
  121. prop: "srcType",
  122. width: "80",
  123. overHidden: true
  124. },
  125. {
  126. label: "签收金额",
  127. prop: "signedAmount",
  128. width: "100",
  129. overHidden: true
  130. },
  131. {
  132. label: "签收人",
  133. prop: "consigneeName",
  134. width: "100",
  135. overHidden: true
  136. },
  137. {
  138. label: "签收时间",
  139. prop: "signingTime",
  140. width: "120",
  141. overHidden: true
  142. }
  143. ]
  144. },
  145. ifInvoiceData: [], // 是否数据
  146. invoicelosDara: [], // 发票
  147. curCodeData: [], // 币种
  148. option: {},
  149. optionBack: {
  150. height: "auto",
  151. calcHeight: 30,
  152. menuWidth: 60,
  153. tip: false,
  154. menu: false,
  155. border: true,
  156. addBtn: false,
  157. viewBtn: false,
  158. editBtn: false,
  159. delBtn: false,
  160. refreshBtn: false,
  161. index: true,
  162. selection: true,
  163. align: "center",
  164. column: [
  165. {
  166. label: "签收",
  167. prop: "isSignfor",
  168. width: 60,
  169. overHidden: true,
  170. type: "select",
  171. dicData: [
  172. {
  173. label: "否",
  174. value: 0
  175. },
  176. {
  177. label: "是",
  178. value: 1
  179. }
  180. ]
  181. },
  182. {
  183. label: "对账",
  184. prop: "isChecked",
  185. width: 60,
  186. overHidden: true,
  187. type: "select",
  188. dicData: [
  189. {
  190. label: "否",
  191. value: 0
  192. },
  193. {
  194. label: "是",
  195. value: 1
  196. }
  197. ]
  198. },
  199. {
  200. label: "账单编号",
  201. prop: "accBillNo",
  202. width: 120,
  203. overHidden: true
  204. },
  205. {
  206. label: "原业务编号",
  207. prop: "billNo",
  208. width: 120,
  209. overHidden: true
  210. },
  211. {
  212. label: "发票号",
  213. prop: "invoiceNo",
  214. width: 80,
  215. overHidden: true
  216. },
  217. {
  218. label: "结算单位",
  219. prop: "corpCnName",
  220. width: 120,
  221. overHidden: true
  222. },
  223. {
  224. label: "MB/L NO",
  225. prop: "mblno",
  226. width: 100,
  227. overHidden: true
  228. },
  229. {
  230. label: "本次CNY",
  231. prop: "currentStlAmountRMB",
  232. width: 100,
  233. overHidden: true
  234. },
  235. {
  236. label: "本次USD",
  237. prop: "currentStlAmountUSD",
  238. width: 100,
  239. overHidden: true
  240. },
  241. {
  242. label: "已签收CNY",
  243. prop: "reconciliationAmount",
  244. width: 100,
  245. overHidden: true
  246. },
  247. {
  248. label: "已签收USD",
  249. prop: "reconciliationAmountUsd",
  250. width: 100,
  251. overHidden: true
  252. },
  253. {
  254. label: "币种",
  255. prop: "currentStlCurCode",
  256. width: 60,
  257. overHidden: true
  258. },
  259. {
  260. label: "汇率",
  261. prop: "currentStlExrate",
  262. width: 80,
  263. overHidden: true
  264. },
  265. {
  266. label: "发票状态",
  267. prop: "isInvoice",
  268. width: 80,
  269. type: "select",
  270. dicData: [
  271. {
  272. label: "待开发票",
  273. value: 1
  274. },
  275. {
  276. label: "确认开票",
  277. value: 2
  278. },
  279. {
  280. label: "不开发票",
  281. value: 3
  282. }
  283. ],
  284. overHidden: true
  285. },
  286. {
  287. label: "ETD",
  288. prop: "etd",
  289. width: 100,
  290. overHidden: true
  291. },
  292. {
  293. label: "签收人",
  294. prop: "signforName",
  295. width: 80,
  296. overHidden: true
  297. },
  298. {
  299. label: "签收日期",
  300. prop: "signforDate",
  301. width: 100,
  302. overHidden: true
  303. },
  304. {
  305. label: "操作人",
  306. prop: "operatorName",
  307. width: 80,
  308. overHidden: true
  309. },
  310. {
  311. label: "BOOKINGNO",
  312. prop: "bookingNo",
  313. width: 100,
  314. overHidden: true
  315. },
  316. {
  317. label: "HB/L NO",
  318. prop: "hblno",
  319. width: 100,
  320. overHidden: true
  321. },
  322. {
  323. label: "船名",
  324. prop: "vesselCnName",
  325. width: 80,
  326. overHidden: true
  327. },
  328. {
  329. label: "航次",
  330. prop: "voyageNo",
  331. width: 80,
  332. overHidden: true
  333. },
  334. {
  335. label: "发票CNY",
  336. prop: "currentInvoiceAmountRMB",
  337. width: 80,
  338. overHidden: true
  339. },
  340. {
  341. label: "发票USD",
  342. prop: "currentInvoiceAmountUSD",
  343. width: 80,
  344. overHidden: true
  345. },
  346. {
  347. label: "箱量",
  348. prop: "quantityCntrTypesDescr",
  349. width: 80,
  350. overHidden: true
  351. },
  352. {
  353. label: "收付",
  354. prop: "dc",
  355. width: 60,
  356. type: "select",
  357. dicData: [
  358. {
  359. label: "收",
  360. value: "D"
  361. },
  362. {
  363. label: "付",
  364. value: "C"
  365. }
  366. ],
  367. overHidden: true
  368. },
  369. {
  370. label: "账单CNY",
  371. prop: "unsettledAmountRMB",
  372. width: 100,
  373. overHidden: true
  374. },
  375. {
  376. label: "账单USD",
  377. prop: "unsettledAmountUSD",
  378. width: 100,
  379. overHidden: true
  380. },
  381. // {
  382. // label: "费用名称",
  383. // prop: "feeCnName",
  384. // width: 80,
  385. // overHidden: true
  386. // },
  387. {
  388. label: "业务员",
  389. prop: "srcCnName",
  390. width: 80,
  391. overHidden: true
  392. },
  393. {
  394. label: "备注",
  395. prop: "remarkss",
  396. width: 120,
  397. overHidden: true
  398. }
  399. ]
  400. },
  401. page: {
  402. currentPage: 1,
  403. total: 0,
  404. pageSize: 20,
  405. pageSizes: [20, 50, 100, 200, 500]
  406. },
  407. pageData: []
  408. };
  409. },
  410. async created() {
  411. this.option = await this.getColumnData(this.getColumnName(479), this.optionBack);
  412. this.isSignforWorkDicts();
  413. this.invoicelosWorkDictsfun();
  414. },
  415. methods: {
  416. viewRLA(row) {
  417. this.rlaData = [];
  418. getListAll({ billId: row.accBillId }).then(res => {
  419. this.rlaData = res.data.data;
  420. });
  421. },
  422. sizeChange(val) {
  423. this.page.currentPage = 1;
  424. this.page.pageSize = val;
  425. this.getList2();
  426. },
  427. currentChange(val) {
  428. this.page.currentPage = val;
  429. this.getList2();
  430. },
  431. getList2() {
  432. this.page.total = this.tableData.length;
  433. const start = (this.page.currentPage - 1) * this.page.pageSize;
  434. const end = start + this.page.pageSize;
  435. this.pageData = this.tableData.slice(start, end);
  436. },
  437. armbChange(row) {
  438. if (Number(row.amount - row.reconciliationAmount) > 0) {
  439. if (Number(row.currentStlAmountRMB) < 0) {
  440. return this.$message.error("本次金额不能输入负数");
  441. }
  442. if (Number(row.currentStlAmountRMB) > Number(row.amount - row.reconciliationAmount)) {
  443. return this.$message.error("本次金额不能超过未签收金额:" + Number(row.amount - row.reconciliationAmount));
  444. }
  445. }
  446. if (Number(row.amount - row.reconciliationAmount) < 0) {
  447. if (row.currentStlAmountRMB >= 0) {
  448. return this.$message.error("本次金额不能输入非负数");
  449. }
  450. if (Number(row.currentStlAmountRMB) < Number(row.amount - row.reconciliationAmount)) {
  451. return this.$message.error("本次金额不能超过未签收金额:" + Number(row.amount - row.reconciliationAmount));
  452. }
  453. }
  454. },
  455. ausdChange(row) {
  456. if (Number(row.amount - row.reconciliationAmount) > 0) {
  457. if (Number(row.currentStlAmountUSD) < 0) {
  458. return this.$message.error("本次金额不能输入负数");
  459. }
  460. if (Number(row.currentStlAmountUSD) > Number(row.amount - row.reconciliationAmount)) {
  461. return this.$message.error("本次金额不能超过未签收金额:" + Number(row.amount - row.reconciliationAmount));
  462. }
  463. }
  464. if (Number(row.amount - row.reconciliationAmount) < 0) {
  465. if (row.currentStlAmountUSD >= 0) {
  466. return this.$message.error("本次金额不能输入非负数");
  467. }
  468. if (Number(row.currentStlAmountUSD) < Number(row.amount - row.reconciliationAmount)) {
  469. return this.$message.error("本次金额不能超过未签收金额:" + Number(row.amount - row.reconciliationAmount));
  470. }
  471. }
  472. },
  473. // 币别选择监听
  474. corpChange(value, row) {
  475. for (let item of this.curCodeData) {
  476. if (item.code == value) {
  477. this.$set(row, "currentStlCurCode", value);
  478. if (value == "CNY") {
  479. delete row.currentStlAmountUSD;
  480. this.$set(row, "currentStlAmountRMB", row.unsettledAmount);
  481. } else {
  482. delete row.currentStlAmountRMB;
  483. this.$set(row, "currentStlAmountUSD", row.unsettledAmount);
  484. }
  485. }
  486. }
  487. },
  488. // 展开行或者关闭
  489. expandChange(row, expandedRows) {
  490. let accBillId = "";
  491. if (this.form.id) {
  492. accBillId = row.accBillId;
  493. } else {
  494. accBillId = row.id;
  495. }
  496. feecenterSelectByAccNoList({ accBillId }).then(res => {
  497. row.costDate = res.data.data.map(item => {
  498. if (item.curCode == "CNY") {
  499. this.$set(item, "rmbAmount", item.amount);
  500. this.$set(item, "usdAmount", "");
  501. this.$set(item, "rmbAmountNet", item.amountNet);
  502. this.$set(item, "usdAmountNet", "");
  503. } else {
  504. this.$set(item, "usdAmount", item.amount);
  505. this.$set(item, "rmbAmount", "");
  506. this.$set(item, "usdAmountNet", item.amountNet);
  507. this.$set(item, "rmbAmountNet", "");
  508. }
  509. return item;
  510. });
  511. });
  512. },
  513. // 接口请求
  514. // 是否接口
  515. isSignforWorkDicts() {
  516. getWorkDicts("ifInvoice").then(res => {
  517. this.ifInvoiceData = res.data.data;
  518. });
  519. },
  520. // 发票
  521. invoicelosWorkDictsfun() {
  522. getWorkDicts("reconciliation_invoice_los").then(res => {
  523. this.invoicelosDara = res.data.data;
  524. });
  525. },
  526. // 获取币别数据
  527. getRateListfun(cnName) {
  528. getRateList({ current: 1, size: 10, cnName }).then(res => {
  529. this.curCodeData = res.data.data.records;
  530. });
  531. },
  532. // 表头样式
  533. tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
  534. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff";
  535. },
  536. // Element UI 表格点击选中行/取消选中 快捷多选 以及快捷连续多选,高亮选中行 ——-------------------------------------——
  537. // 多选选择的数据
  538. handleSelectionChange(arr) {
  539. // // 全选
  540. // if (arr.length == this.tableData.length) {
  541. // for (let item of arr) {
  542. // this.$set(item,'tableSelect',1)
  543. // }
  544. // }
  545. // // 清除全选
  546. // if (arr.length == 0) {
  547. // for (let item of this.tableData) {
  548. // this.$set(item,'tableSelect',0)
  549. // }
  550. // }
  551. this.$emit("handleSelectionChange", arr);
  552. },
  553. // // 多选
  554. // toggleSelection(rows){
  555. // if (rows) {
  556. // rows.forEach(row => {
  557. // this.$refs.tableRef.toggleRowSelection(row);
  558. // });
  559. // } else {
  560. // this.$refs.tableRef.clearSelection();
  561. // }
  562. // },
  563. // 监听点击表格事件
  564. rowClick(row, column, event) {
  565. let refsElTable = this.$refs.tableRef; // 获取表格对象
  566. if (this.CtrlDown) {
  567. refsElTable.toggleRowSelection(row); // ctrl多选 如果点击两次同样会取消选中
  568. return;
  569. }
  570. if (this.shiftOrAltDown && this.handleSelectionData.length > 0) {
  571. // 通过rowIndex判断已选择的行中最上面和最下面的是哪行,再对比按住shift/alt点击的当前行得到新的最上面和最下面的行,把这两行中间的行进行循环选中。
  572. let topAndBottom = this.getTopAndBottom(row, this.bottomSelectionRow, this.topSelectionRow);
  573. refsElTable.clearSelection(); //先清空 不然会导致在这两行中间之外的行状态不变
  574. for (let index = topAndBottom.top; index <= topAndBottom.bottom; index++) {
  575. //选中两行之间的所有行
  576. refsElTable.toggleRowSelection(this.tableData[index], true);
  577. }
  578. } else {
  579. let findRow = this.handleSelectionData.find(c => c.rowIndex == row.rowIndex); //找出当前选中行
  580. //如果只有一行且点击的也是这一行则取消选择 否则清空再选中当前点击行
  581. if (findRow && this.handleSelectionData.length === 1) {
  582. refsElTable.toggleRowSelection(row, false);
  583. return;
  584. }
  585. // refsElTable.clearSelection(); // 清空之前选择的数据(如果放开,选择之前会变成单选)
  586. refsElTable.toggleRowSelection(row); // 调用选中行方法
  587. }
  588. },
  589. // 行的 style 的回调方法
  590. rowStyle({ row, rowIndex }) {
  591. // 直接在一个对象上定义一个新属性,或者修改一个对象的现有属性,并返回此对象
  592. // object: 要添加或者修改属性的目标对象;prop: 要定义或修改属性的名称;descript: 是一个对象,里面是我们上述的对象属性的特性;
  593. Object.defineProperty(row, "rowIndex", {
  594. //给每一行添加不可枚举属性rowIndex来标识当前行
  595. value: rowIndex, // 设置age的值,不设置的话默认为undefined
  596. writable: true, // 表示属性的值true可以修改,false不可以被修改
  597. enumerable: false // 设置为false表示不能通过 for-in 循环返回
  598. // configurable: false, // configurable 设置为 false,意味着这个属性不能从对象上删除
  599. });
  600. },
  601. keyDown(event) {
  602. let key = event.keyCode;
  603. if (key == 17) this.CtrlDown = true;
  604. if (key == 16 || key == 18) this.shiftOrAltDown = true;
  605. },
  606. keyUp(event) {
  607. let key = event.keyCode;
  608. if (key == 17) this.CtrlDown = false;
  609. if (key == 16 || key == 18) this.shiftOrAltDown = false;
  610. },
  611. // 文章说明 https://www.jianshu.com/p/48f2c522d2a2
  612. getTopAndBottom(row, bottom, top) {
  613. let n = row.rowIndex,
  614. mx = bottom.rowIndex,
  615. mi = top.rowIndex;
  616. if (n > mx) {
  617. return {
  618. top: mi,
  619. bottom: n
  620. };
  621. } else if (n < mx && n > mi) {
  622. return {
  623. top: mi,
  624. bottom: n
  625. };
  626. } else if (n < mi) {
  627. return {
  628. top: n,
  629. bottom: mx
  630. };
  631. } else if (n == mi || n == mx) {
  632. return {
  633. top: mi,
  634. bottom: mx
  635. };
  636. }
  637. },
  638. // 给选中行加上current-row这个class类,所以要使用row-class-name这个属性(其实给每一行添加rowIndex也可以用这个属性),
  639. // 判断方式也是通过判断rowIndex对比
  640. rowClassName({ row, rowIndex }) {
  641. let rowName = "",
  642. findRow = this.handleSelectionData.find(c => {
  643. return c.rowIndex === row.rowIndex;
  644. });
  645. if (findRow) {
  646. rowName = "current-row "; // elementUI 默认高亮行的class类 不用再样式了^-^,也可通过css覆盖改变背景颜色
  647. }
  648. return rowName; //也可以再加上其他类名 如果有需求的话
  649. },
  650. // 收付展示不一样的颜色
  651. cellStyle({ row, rowIndex, columnIndex }) {
  652. let rowStyle = "";
  653. if (row.dc == "D") {
  654. rowStyle = "color:#F56C6C;";
  655. } else if (row.dc == "C") {
  656. rowStyle = "color:#67C23A;";
  657. }
  658. return rowStyle + "padding:0px;fontSize:12px";
  659. },
  660. //自定义列保存
  661. async saveColumn(ref, option, optionBack, code) {
  662. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  663. if (inSave) {
  664. this.$message.success("保存成功");
  665. //关闭窗口
  666. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  667. }
  668. },
  669. //自定义列重置
  670. async resetColumn(ref, option, optionBack, code) {
  671. this[option] = this[optionBack];
  672. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  673. if (inSave) {
  674. this.$message.success("重置成功");
  675. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  676. }
  677. }
  678. },
  679. mounted() {
  680. // 按住ctrl实现多选 设置监听keydown事件,以及keyup事件,
  681. addEventListener("keydown", this.keyDown, false);
  682. addEventListener("keyup", this.keyUp, false);
  683. },
  684. beforeDestroy() {
  685. //解绑
  686. removeEventListener("keydown", this.keyDown);
  687. removeEventListener("keyup", this.keyUp);
  688. },
  689. watch: {
  690. tableData: {
  691. // 执行方法
  692. handler(oldValue, newValue) {
  693. this.page.currentPage = 1;
  694. this.pageData = [];
  695. this.getList2();
  696. },
  697. deep: true, // 深度监听
  698. immediate: true // 第一次改变就执行
  699. }
  700. },
  701. computed: {
  702. //实时得到最上行和最下行
  703. bottomSelectionRow() {
  704. if (this.handleSelectionData.length == 0) return null;
  705. return this.handleSelectionData.reduce((start, end) => {
  706. return start.rowIndex > end.rowIndex ? start : end;
  707. });
  708. },
  709. topSelectionRow() {
  710. if (this.handleSelectionData.length == 0) return null;
  711. return this.handleSelectionData.reduce((start, end) => {
  712. return start.rowIndex < end.rowIndex ? start : end;
  713. });
  714. }
  715. }
  716. };
  717. </script>
  718. <style scoped>
  719. .textHide {
  720. width: 100%;
  721. overflow: hidden;
  722. white-space: nowrap;
  723. text-overflow: ellipsis;
  724. }
  725. ::v-deep .current-row {
  726. background: #ecf3ff;
  727. }
  728. </style>