index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. v-show="showSearch"
  7. label-width="100px"
  8. size="mini"
  9. >
  10. <el-row>
  11. <el-col :xs="12" :sm="6">
  12. <el-form-item label="提单号" prop="fMblno">
  13. <el-input
  14. v-model="queryParams.fMblno"
  15. placeholder="请输入提单号"
  16. clearable
  17. />
  18. </el-form-item>
  19. </el-col>
  20. <el-col :xs="12" :sm="6">
  21. <el-form-item label="客户名称" prop="fCorpid">
  22. <el-select
  23. v-model="queryParams.fCorpid"
  24. clearable
  25. filterable
  26. placeholder="请输入关键词"
  27. style="width: 100%"
  28. >
  29. <el-option
  30. v-for="(item, index) in fMblnoOptions"
  31. :key="index.fId"
  32. :label="item.fName"
  33. :value="item.fId"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="12" :sm="6">
  39. <el-form-item label="业务日期" prop="fBsdateList">
  40. <el-date-picker
  41. type="daterange"
  42. value-format="yyyy-MM-dd HH:mm:ss"
  43. :default-time="['00:00:00', '23:59:59']"
  44. clearable
  45. unlink-panels
  46. style="width: 100%"
  47. range-separator="至"
  48. start-placeholder="开始日期"
  49. end-placeholder="结束日期"
  50. v-model="queryParams.fBsdateList"
  51. ></el-date-picker>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :xs="12" :sm="6">
  55. <el-form-item label="审核日期" prop="fReviewDateList">
  56. <el-date-picker
  57. type="daterange"
  58. value-format="yyyy-MM-dd HH:mm:ss"
  59. :default-time="['00:00:00', '23:59:59']"
  60. clearable
  61. unlink-panels
  62. style="width: 100%"
  63. range-separator="至"
  64. start-placeholder="开始日期"
  65. end-placeholder="结束日期"
  66. v-model="queryParams.fReviewDateList"
  67. ></el-date-picker>
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. <el-collapse-transition>
  72. <div v-show="show">
  73. <el-row>
  74. <el-col :xs="12" :sm="6">
  75. <el-form-item label="收/付" prop="fDc">
  76. <el-select
  77. v-model="queryParams.fDc"
  78. clearable
  79. filterable
  80. placeholder="请选择"
  81. style="width: 100%"
  82. >
  83. <el-option
  84. label="收"
  85. value="D"
  86. ></el-option>
  87. <el-option
  88. label="付"
  89. value="C"
  90. ></el-option>
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :xs="12" :sm="6">
  95. <el-form-item label="费用状态" prop="fBillstatus">
  96. <el-select
  97. v-model="queryParams.fBillstatus"
  98. clearable
  99. filterable
  100. placeholder="请选择费用状态"
  101. style="width: 100%"
  102. >
  103. <el-option
  104. label="录入"
  105. value="1"
  106. ></el-option>
  107. <el-option
  108. label="暂存"
  109. value="2"
  110. ></el-option>
  111. <el-option
  112. label="审批驳回"
  113. value="3"
  114. ></el-option>
  115. <el-option
  116. label="提交审核"
  117. value="4"
  118. ></el-option>
  119. <el-option
  120. label="审核中"
  121. value="5"
  122. ></el-option>
  123. <el-option
  124. label="审核通过"
  125. value="6"
  126. ></el-option>
  127. </el-select>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :xs="12" :sm="6">
  131. <el-form-item label="费用名称">
  132. <el-select
  133. v-model="queryParams.fFeeids"
  134. clearable
  135. filterable
  136. multiple
  137. collapse-tags
  138. placeholder="请选择费用名称"
  139. style="width: 100%"
  140. >
  141. <el-option
  142. v-for="(dict, index) in fNameOptions"
  143. :key="dict.fId"
  144. :label="dict.fName"
  145. :value="dict.fId"
  146. ></el-option>
  147. </el-select>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :xs="12" :sm="6">
  151. <el-form-item label="结算方式">
  152. <el-select
  153. v-model="queryParams.fStltypeid"
  154. clearable
  155. filterable
  156. placeholder="请选择结算方式"
  157. style="width: 100%"
  158. >
  159. <el-option
  160. v-for="(item, index) in fStltypeOptions"
  161. :key="index.dictValue"
  162. :label="item.dictLabel"
  163. :value="item.dictValue"
  164. ></el-option>
  165. </el-select>
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. <el-row>
  170. <el-col :xs="12" :sm="6">
  171. <el-form-item label="结算状态">
  172. <el-select
  173. v-model="queryParams.fStalmountStatus"
  174. filterable
  175. clearable
  176. placeholder="请选择结算状态"
  177. style="width: 100%"
  178. @clear="queryParams.fStalmountStatus = null"
  179. >
  180. <el-option label="已结算" :value="1"/>
  181. <el-option label="未结算" :value="2"/>
  182. </el-select>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :xs="12" :sm="6">
  186. <el-form-item label="业务编号" prop="fSrcBillno">
  187. <el-input
  188. v-model="queryParams.fSrcBillno"
  189. placeholder="请输入业务编号"
  190. clearable
  191. />
  192. </el-form-item>
  193. </el-col>
  194. <el-col :xs="12" :sm="6">
  195. <el-form-item label="对账状态">
  196. <el-select
  197. v-model="queryParams.feesStatus"
  198. filterable
  199. clearable
  200. placeholder="请选择对账状态"
  201. style="width: 100%"
  202. @clear="queryParams.feesStatus = null"
  203. >
  204. <el-option label="已对账" :value="1"/>
  205. <el-option label="未对账" :value="2"/>
  206. </el-select>
  207. </el-form-item>
  208. </el-col>
  209. <el-col :xs="12" :sm="6">
  210. <el-form-item label="发票状态">
  211. <el-select
  212. v-model="queryParams.fInvnosStatus"
  213. filterable
  214. clearable
  215. placeholder="请选择发票状态"
  216. style="width: 100%"
  217. @clear="queryParams.fInvnosStatus = null"
  218. >
  219. <el-option label="已开票" :value="1"/>
  220. <el-option label="未开票" :value="2"/>
  221. </el-select>
  222. </el-form-item>
  223. </el-col>
  224. <el-col :span="6">
  225. <el-form-item label="发货方">
  226. <el-select
  227. v-model="queryParams.fShipper"
  228. clearable
  229. filterable
  230. placeholder="请输入关键词"
  231. style="width: 100%"
  232. allow-create
  233. default-first-option
  234. >
  235. <el-option
  236. v-for="(item, index) in fMblnoOptions"
  237. :key="index.fId"
  238. :label="item.fCname"
  239. :value="item.fCname"
  240. ></el-option>
  241. </el-select>
  242. </el-form-item>
  243. </el-col>
  244. <el-col :sm="6">
  245. <el-form-item label="出口单号" prop="fEmblno">
  246. <el-input
  247. v-model="queryParams.fEmblno"
  248. placeholder="请输出口单号"
  249. clearable
  250. />
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. </div>
  255. </el-collapse-transition>
  256. </el-form>
  257. <el-row :gutter="10" style="padding-bottom: 10px">
  258. <el-col :span="1.5">
  259. <el-button
  260. type="warning"
  261. icon="el-icon-download"
  262. size="mini"
  263. @click="handleExport"
  264. >导出</el-button>
  265. <el-button
  266. type="primary"
  267. icon="el-icon-download"
  268. size="mini"
  269. @click="handleSubItemExport"
  270. >导出分项</el-button>
  271. </el-col>
  272. <div class="tabSetting">
  273. <div style="margin-right: 20px">
  274. <el-button
  275. type="cyan"
  276. icon="el-icon-search"
  277. size="mini"
  278. @click="handleQuery"
  279. >搜索</el-button
  280. >
  281. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  282. >重置</el-button
  283. >
  284. <el-button
  285. v-show="show"
  286. @click="show = !show"
  287. icon="el-icon-arrow-up"
  288. size="mini"
  289. >展开</el-button
  290. >
  291. <el-button
  292. v-show="!show"
  293. @click="show = !show"
  294. icon="el-icon-arrow-down"
  295. size="mini"
  296. >展开</el-button
  297. >
  298. </div>
  299. <right-toolbar
  300. :showSearch.sync="showSearch"
  301. @queryTable="getList"
  302. ></right-toolbar>
  303. <div style="margin: 0 12px">
  304. <el-button
  305. icon="el-icon-setting"
  306. size="mini"
  307. circle
  308. @click="showSetting = !showSetting"
  309. ></el-button>
  310. </div>
  311. </div>
  312. </el-row>
  313. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  314. <div>配置排序列数据(拖动调整顺序)</div>
  315. <div style="margin-left: 17px">
  316. <el-checkbox
  317. v-model="allCheck"
  318. label="全选"
  319. @change="allChecked"
  320. ></el-checkbox>
  321. </div>
  322. <div style="padding: 4px; display: flex; justify-content: center">
  323. <draggable
  324. v-model="setRowList"
  325. group="site"
  326. animation="300"
  327. @start="onStart"
  328. @end="onEnd"
  329. handle=".indraggable"
  330. >
  331. <transition-group>
  332. <div
  333. v-for="item in setRowList"
  334. :key="item.surface"
  335. class="listStyle"
  336. >
  337. <div style="width: 500px" class="indraggable">
  338. <div class="progress" :style="{ width: item.width + 'px' }">
  339. <el-checkbox
  340. :label="item.name"
  341. v-model="item.checked"
  342. :true-label="0"
  343. :false-label="1"
  344. >{{ item.name }}
  345. </el-checkbox>
  346. </div>
  347. </div>
  348. <el-input-number
  349. v-model.number="item.width"
  350. controls-position="right"
  351. :min="1"
  352. :max="500"
  353. size="mini"
  354. ></el-input-number>
  355. </div>
  356. </transition-group>
  357. </draggable>
  358. </div>
  359. <span slot="footer" class="dialog-footer">
  360. <el-button @click="showSetting = false">取 消</el-button>
  361. <el-button @click="delRow" type="danger">重 置</el-button>
  362. <el-button type="primary" @click="save()">确 定</el-button>
  363. </span>
  364. </el-dialog>
  365. <el-table
  366. v-loading="loading"
  367. :data="dataList"
  368. style="width: 100%"
  369. ref="table"
  370. :height="tableHeight"
  371. stripe
  372. show-summary
  373. :summary-method="getSum"
  374. >
  375. <el-table-column
  376. type="index"
  377. width="50">
  378. </el-table-column>
  379. <el-table-column
  380. v-for="(item, index) in getRowList"
  381. :key="index"
  382. :label="item.name"
  383. :width="item.width"
  384. :prop="item.label"
  385. align="center"
  386. :show-overflow-tooltip="true"
  387. sortable
  388. :fixed="item.fixed"
  389. >
  390. <template slot-scope="scope">
  391. <span v-if="item.label == 'fDc'">
  392. {{ scope.row.fDc == 'D'? '收': '付' }}
  393. </span>
  394. <span v-else-if="item.label == 'fFeeunitid'">
  395. {{ scope.row.fFeeunitid | fFeeUnitFormat(fFeetUnitOptions) }}
  396. </span>
  397. <span v-else-if="item.label == 'fBilltype'">
  398. {{ scope.row.fBilltype | billTypeFormat(billTypeList) }}
  399. </span>
  400. <span v-else-if="item.label == 'fStltypeid'">
  401. {{ scope.row.fStltypeid | fStltypeFormat(fStltypeOptions) }}
  402. </span>
  403. <span v-else>{{ scope.row[item.label] }}</span>
  404. </template>
  405. </el-table-column>
  406. </el-table>
  407. <pagination
  408. v-show="total > 0"
  409. :total="total"
  410. :page.sync="queryParams.pageNum"
  411. :limit.sync="queryParams.pageSize"
  412. @pagination="getList"
  413. />
  414. </div>
  415. </template>
  416. <script>
  417. import Cookies from "js-cookie";
  418. import draggable from "vuedraggable";
  419. import { addSet, resetModule, select } from '@/api/system/set';
  420. import {listCorps} from "@/api/basicdata/corps";
  421. import { getList, exportList, exportSubItemList } from '@/api/finance/query'
  422. import {listFees} from "@/api/basicdata/fees";
  423. export default {
  424. name: "index",
  425. components: {
  426. draggable,
  427. },
  428. data() {
  429. return {
  430. // 表格高度
  431. tableHeight: 0,
  432. // 总条数
  433. total: 0,
  434. // 查询参数
  435. queryParams: {
  436. pageNum: 1,
  437. pageSize: 10,
  438. fDc: "D",
  439. },
  440. showSearch: true,
  441. // 搜索展开/隐藏
  442. show: false,
  443. // 自定义列弹窗显示
  444. showSetting: false,
  445. //自定义列宽
  446. allCheck: false,
  447. setRowList: [],
  448. getRowList: [],
  449. drag: false,
  450. tableDate: [
  451. {
  452. surface: "1",
  453. label: "corpName",
  454. name: "客户名称",
  455. checked: 0,
  456. width: 140,
  457. },
  458. {
  459. surface: "2",
  460. label: "fMblno",
  461. name: "提单号",
  462. checked: 0,
  463. width: 180,
  464. },
  465. {
  466. surface: "3",
  467. label: "fSrcBillno",
  468. name: "业务编号",
  469. checked: 0,
  470. width: 180,
  471. },{
  472. surface: "4",
  473. label: "fBsdate",
  474. name: "业务日期",
  475. checked: 0,
  476. width: 100,
  477. },{
  478. surface: "5",
  479. label: "fReviewDate",
  480. name: "审核日期",
  481. checked: 0,
  482. width: 100,
  483. },
  484. {
  485. surface: "6",
  486. label: "feeName",
  487. name: "费用名称",
  488. checked: 0,
  489. width: 100,
  490. },
  491. {
  492. surface: "7",
  493. label: "fBillstatusName",
  494. name: "费用状态",
  495. checked: 0,
  496. width: 100,
  497. },
  498. {
  499. surface: "8",
  500. label: "fChargedate",
  501. name: "费用起始日期",
  502. checked: 0,
  503. width: 130,
  504. },
  505. {
  506. surface: "9",
  507. label: "fBillingDeadline",
  508. name: "费用截止日期",
  509. checked: 0,
  510. width: 130,
  511. },
  512. {
  513. surface: "10",
  514. label: "fOriginalbilldate",
  515. name: "原始入库日期",
  516. checked: 0,
  517. width: 130,
  518. },
  519. {
  520. surface: "10",
  521. label: "fDc",
  522. name: "收/付",
  523. checked: 0,
  524. width: 100,
  525. },
  526. {
  527. surface: "11",
  528. label: "fAmount",
  529. name: "金额",
  530. checked: 0,
  531. width: 100,
  532. },
  533. {
  534. surface: "12",
  535. label: "fStlamount",
  536. name: "结算金额",
  537. checked: 0,
  538. width: 100,
  539. },
  540. {
  541. surface: "13",
  542. label: "fStlamountDate",
  543. name: "结算日期",
  544. checked: 0,
  545. width: 100,
  546. },
  547. {
  548. surface: "14",
  549. label: "fInvamount",
  550. name: "开票金额",
  551. checked: 0,
  552. width: 100,
  553. },
  554. {
  555. surface: "15",
  556. label: "fInvnos",
  557. name: "发票号",
  558. checked: 0,
  559. width: 100,
  560. },
  561. {
  562. surface: "16",
  563. label: "fAccamount",
  564. name: "对账金额",
  565. checked: 0,
  566. width: 100,
  567. },
  568. {
  569. surface: "17",
  570. label: "fAccamountDate",
  571. name: "对账日期",
  572. checked: 0,
  573. width: 100,
  574. },
  575. {
  576. surface: "18",
  577. label: "fStatementNo",
  578. name: "对账单号",
  579. checked: 0,
  580. width: 100,
  581. },
  582. {
  583. surface: "19",
  584. label: "fFeeunitid",
  585. name: "计价单位",
  586. checked: 0,
  587. width: 100,
  588. },
  589. {
  590. surface: "20",
  591. label: "fQty",
  592. name: "数量",
  593. checked: 0,
  594. width: 100,
  595. },
  596. {
  597. surface: "21",
  598. label: "fUnitprice",
  599. name: "单价",
  600. checked: 0,
  601. width: 100,
  602. },
  603. {
  604. surface: "22",
  605. label: "fBilltype",
  606. name: "业务类型",
  607. checked: 0,
  608. width: 100,
  609. },
  610. {
  611. surface: "23",
  612. label: "fStltypeid",
  613. name: "结算方式",
  614. checked: 0,
  615. width: 100,
  616. },
  617. {
  618. surface: "24",
  619. label: "fProductName",
  620. name: "货物名称",
  621. checked: 0,
  622. width: 100,
  623. },
  624. {
  625. surface: "25",
  626. label: "fShipper",
  627. name: "发货方(货主)",
  628. checked: 0,
  629. width: 130,
  630. },
  631. {
  632. surface: "26",
  633. label: "fEmblno",
  634. name: "出口单号",
  635. checked: 0,
  636. width: 130,
  637. },
  638. {
  639. surface: "27",
  640. label: "remark",
  641. name: "备注",
  642. checked: 0,
  643. width: 100,
  644. },
  645. ],
  646. // 计价单位
  647. fFeetUnitOptions: [],
  648. fMblnoOptions: [],
  649. loading: false,
  650. dataList: [],
  651. billTypeList: [],
  652. fNameOptions:[],
  653. fStltypeOptions: [],
  654. fCorpOptions: [],
  655. }
  656. },
  657. created() {
  658. this.setRowList = this.tableDate;
  659. this.getRowList = this.tableDate;
  660. this.getRow()
  661. this.getList()
  662. listCorps({type: 1}).then((response) => {
  663. this.fMblnoOptions = response.rows;
  664. });
  665. listFees().then((response) => {
  666. this.fNameOptions = response.rows;
  667. });
  668. this.getDicts("data_unitfees").then((response) => {
  669. this.fFeetUnitOptions = response.data;
  670. });
  671. this.getDicts("data_billtype_type").then((response) => {
  672. this.billTypeList = response.data;
  673. });
  674. this.getDicts("data_stltype_type").then((response) => {
  675. this.fStltypeOptions = response.data;
  676. });
  677. },
  678. mounted() {
  679. this.$nextTick(() => {
  680. let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
  681. this.tableHeight = windowHeight - 280;
  682. // 监听浏览器高度变化,改变表格高度
  683. window.onresize = () => {
  684. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  685. }
  686. })
  687. },
  688. updated() {
  689. this.$nextTick(() => {
  690. this.$refs.table.doLayout();
  691. })
  692. },
  693. filters: {
  694. fFeeUnitFormat(row, fFeetUnitOptions) {
  695. let name;
  696. fFeetUnitOptions.map((e) => {
  697. if (row == e.dictValue) {
  698. name = e.dictLabel;
  699. }
  700. });
  701. return name;
  702. },
  703. billTypeFormat(row, billTypeList) {
  704. let type;
  705. billTypeList.map((e) => {
  706. if (row == e.dictValue) {
  707. type = e.dictLabel;
  708. }
  709. });
  710. return type;
  711. },
  712. fStltypeFormat(row, fStltypeOptions) {
  713. let name;
  714. fStltypeOptions.map(e => {
  715. if (row == e.dictValue) {
  716. name = e.dictLabel
  717. }
  718. });
  719. return name;
  720. },
  721. },
  722. methods: {
  723. getList() {
  724. this.loading = true
  725. getList(this.queryParams).then(res => {
  726. this.dataList = res.rows
  727. this.total = res.total
  728. this.loading = false;
  729. })
  730. },
  731. /** 搜索按钮操作 */
  732. handleQuery() {
  733. this.queryParams.pageNum = 1;
  734. this.queryParams.pageSize = 10;
  735. this.getList();
  736. },
  737. /** 重置按钮操作 */
  738. resetQuery() {
  739. this.queryParams = {
  740. pageNum: 1,
  741. pageSize: 10,
  742. fDc: "D",
  743. }
  744. this.resetForm("queryForm");
  745. this.handleQuery();
  746. },
  747. // 导出
  748. handleExport() {
  749. this.$confirm("是否确认导出所有账单明细数据项?", "警告", {
  750. confirmButtonText: "确定",
  751. cancelButtonText: "取消",
  752. type: "warning",
  753. }).then(() => {
  754. return exportList(this.queryParams)
  755. }).then(res => {
  756. this.download(res.msg)
  757. })
  758. },
  759. // 分项导出
  760. handleSubItemExport(){
  761. this.$confirm("是否确认导出分项所有账单明细数据项?","警告",{
  762. confirmButtonText: "确定",
  763. cancelButtonText: "取消",
  764. type: "warning",
  765. }).then(()=> {
  766. return exportSubItemList(this.queryParams)
  767. }).then(res => {
  768. this.download(res.msg)
  769. })
  770. },
  771. // 表格合计
  772. getSum(param) {
  773. const { columns, data } = param;
  774. const sums = [];
  775. var values = [];
  776. columns.forEach((column, index) => {
  777. if (index === 0) {
  778. sums[index] = "合计";
  779. return;
  780. }
  781. if (column.property === "fAmount") {
  782. values = data.map((item) => Number(item["fAmount"]));
  783. }
  784. if (column.property === "fStlamount") {
  785. values = data.map((item) => Number(item["fStlamount"]));
  786. }
  787. if (column.property === "fInvamount") {
  788. values = data.map((item) => Number(item["fInvamount"]));
  789. }
  790. if (column.property === "fAccamount") {
  791. values = data.map((item) => Number(item.fAccamount));
  792. }
  793. if (column.property === "fQty") {
  794. values = data.map((item) => Number(item.fQty));
  795. }
  796. if (
  797. column.property === "fAmount" ||
  798. column.property === "fStlamount" ||
  799. column.property === "fInvamount" ||
  800. column.property === "fAccamount" ||
  801. column.property === "fQty"
  802. ) {
  803. sums[index] = values.reduce((prev, curr) => {
  804. const value = Number(curr);
  805. if (!isNaN(value)) {
  806. return prev + curr;
  807. } else {
  808. return prev;
  809. }
  810. }, 0);
  811. if (column.property === "fAmount") {
  812. sums[index] = (sums[index]).toFixed(2);
  813. }
  814. if (column.property === "fStlamount") {
  815. sums[index] = (sums[index]).toFixed(2);
  816. }
  817. if (column.property === "fInvamount") {
  818. sums[index] = (sums[index]).toFixed(2);
  819. }
  820. if (column.property === "fAccamount") {
  821. sums[index] = (sums[index]).toFixed(2);
  822. }
  823. if (column.property === "fQty") {
  824. sums[index] = sums[index];
  825. }
  826. }
  827. });
  828. return sums;
  829. },
  830. //列设置全选
  831. allChecked() {
  832. if (this.allCheck == true) {
  833. this.setRowList.map((e) => {
  834. return (e.checked = 0);
  835. });
  836. } else {
  837. this.setRowList.map((e) => {
  838. return (e.checked = 1);
  839. });
  840. }
  841. },
  842. //开始拖拽事件
  843. onStart() {
  844. this.drag = true;
  845. },
  846. //拖拽结束事件
  847. onEnd() {
  848. this.drag = false;
  849. },
  850. //重置列表
  851. delRow() {
  852. this.data = {
  853. tableName: "财务查询",
  854. userId: Cookies.get("userName"),
  855. };
  856. resetModule(this.data).then((res) => {
  857. if (res.code == 200) {
  858. this.showSetting = false;
  859. this.setRowList = this.tableDate;
  860. console.log(this.setRowList)
  861. this.getRowList = this.tableDate;
  862. }
  863. });
  864. },
  865. //保存列设置
  866. save() {
  867. this.showSetting = false;
  868. this.data = {
  869. tableName: "财务查询",
  870. userId: Cookies.get("userName"),
  871. sysTableSetList: this.setRowList,
  872. };
  873. addSet(this.data).then((res) => {
  874. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  875. });
  876. },
  877. //查询列数据
  878. getRow() {
  879. let that = this;
  880. this.data = {
  881. tableName: "财务查询",
  882. userId: Cookies.get("userName"),
  883. };
  884. select(this.data).then((res) => {
  885. if (res.data.length != 0) {
  886. this.getRowList = res.data.filter((e) => e.checked == 0);
  887. this.setRowList = res.data;
  888. this.setRowList = this.setRowList.reduce((res, item) => {
  889. res.push({
  890. surface: item.surface,
  891. label: item.label,
  892. name: item.name,
  893. checked: item.checked,
  894. width: item.width,
  895. fixed: item.fixed,
  896. });
  897. return res;
  898. }, []);
  899. }
  900. });
  901. },
  902. },
  903. }
  904. </script>
  905. <style scoped>
  906. </style>