standbook_list.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. <template>
  2. <div class="app-container">
  3. <span>台账</span>
  4. <el-divider></el-divider>
  5. <!-- <el-radio-group v-model="mainId" size="">
  6. <el-radio-button
  7. v-for="(v, i) in dictList"
  8. :key="i"
  9. :label="v.dictCode"
  10. >{{ v.dictValue }}</el-radio-button
  11. >
  12. </el-radio-group>
  13. <br /><br /> -->
  14. <el-radio-group v-model="bill" @change="checkFn" size="">
  15. <el-radio-button label="COMMONLY">货款台账</el-radio-button>
  16. <el-radio-button label="REBATE">返利台账</el-radio-button>
  17. </el-radio-group>
  18. <h1></h1>
  19. <!-- 筛选条件 -->
  20. <div>
  21. <el-form
  22. ref="searchForm"
  23. :model="searchForm"
  24. label-width="100px"
  25. size="small"
  26. label-position="left"
  27. >
  28. <el-row :gutter="20">
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="经销商名称" prop="customerId">
  31. <el-select
  32. class="selectStyle"
  33. v-model="searchForm.customerId"
  34. placeholder="请选择"
  35. filterable
  36. @change="changeFn"
  37. >
  38. <el-option
  39. v-for="(v, i) in customerList"
  40. :key="i"
  41. :label="v.name"
  42. :value="v.id"
  43. >
  44. </el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :xs="24" :sm="12" :lg="6">
  49. <el-form-item label="钱包" prop="customerWalletId">
  50. <el-select
  51. class="selectStyle"
  52. v-model="searchForm.customerWalletId"
  53. placeholder="请选择"
  54. filterable
  55. >
  56. <el-option
  57. v-for="(v, i) in walletList"
  58. :key="i"
  59. :label="v.customerWalletName"
  60. :value="v.customerWalletId"
  61. >
  62. </el-option>
  63. </el-select>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :xs="24" :sm="12" :lg="6">
  67. <el-form-item label="单据号" prop="billNo">
  68. <el-input
  69. v-model="searchForm.billNo"
  70. placeholder="请输入"
  71. ></el-input>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :xs="24" :sm="12" :lg="6">
  75. <el-form-item label="开始时间" prop="startTime">
  76. <el-date-picker
  77. class="selectStyle"
  78. v-model="searchForm.startTime"
  79. type="datetime"
  80. placeholder="选择日期时间"
  81. default-time="00:00:00"
  82. value-format="yyyy-MM-dd HH:mm:ss"
  83. >
  84. </el-date-picker>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :xs="24" :sm="12" :lg="6">
  88. <el-form-item label="结束时间" prop="endTime">
  89. <el-date-picker
  90. class="selectStyle"
  91. v-model="searchForm.endTime"
  92. type="datetime"
  93. placeholder="选择日期时间"
  94. default-time="23:59:59"
  95. value-format="yyyy-MM-dd HH:mm:ss"
  96. >
  97. </el-date-picker>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :xs="24" :sm="12" :lg="18">
  101. <el-form-item label="" class="fr">
  102. <el-button size="small" @click="resetFn">清空</el-button>
  103. <el-button size="small" type="primary" @click="searchFn"
  104. >搜索</el-button
  105. >
  106. </el-form-item>
  107. </el-col>
  108. </el-row>
  109. </el-form>
  110. </div>
  111. <div v-show="bill == 'COMMONLY'">
  112. <!-- 列表 -->
  113. <div class="mymain-container">
  114. <div class="table">
  115. <el-table
  116. v-loading="listLoading"
  117. :data="dataList"
  118. element-loading-text="Loading"
  119. border
  120. fit
  121. highlight-current-row
  122. stripe
  123. >
  124. <el-table-column
  125. label="序号"
  126. align="center"
  127. width="100"
  128. type="index"
  129. show-overflow-tooltip
  130. ></el-table-column>
  131. <el-table-column
  132. align="center"
  133. label="单据日期"
  134. prop="theTime"
  135. min-width="160"
  136. show-overflow-tooltip
  137. ></el-table-column>
  138. <el-table-column
  139. align="center"
  140. label="单据类型"
  141. prop="billType"
  142. min-width="160"
  143. show-overflow-tooltip
  144. ></el-table-column>
  145. <el-table-column
  146. align="center"
  147. label="单据号"
  148. prop="billNo"
  149. min-width="160"
  150. show-overflow-tooltip
  151. ></el-table-column>
  152. <el-table-column
  153. align="center"
  154. label="钱包"
  155. prop="walletName"
  156. min-width="160"
  157. show-overflow-tooltip
  158. ></el-table-column>
  159. <el-table-column
  160. align="center"
  161. label="摘要"
  162. prop="remark"
  163. min-width="160"
  164. show-overflow-tooltip
  165. ></el-table-column>
  166. <el-table-column
  167. align="center"
  168. label="预付货款"
  169. prop="flag"
  170. min-width="160"
  171. show-overflow-tooltip
  172. >
  173. <template slot-scope="scope">
  174. {{
  175. scope.row.flag == 1
  176. ? scope.row.amountType == "IN"
  177. ? scope.row.amount
  178. : scope.row.amountType == "OUT"
  179. ? -scope.row.amount
  180. : ""
  181. : "-"
  182. }}
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. align="center"
  187. label="订单占款"
  188. prop="flag"
  189. min-width="160"
  190. show-overflow-tooltip
  191. >
  192. <template slot-scope="scope">
  193. {{
  194. scope.row.flag == 2
  195. ? scope.row.amountType == "IN"
  196. ? scope.row.amount
  197. : scope.row.amountType == "OUT"
  198. ? -scope.row.amount
  199. : ""
  200. : "-"
  201. }}
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. align="center"
  206. label="支付货款"
  207. prop="flag"
  208. min-width="160"
  209. show-overflow-tooltip
  210. >
  211. <template slot-scope="scope">
  212. {{
  213. scope.row.flag == 3
  214. ? scope.row.amountType == "IN"
  215. ? scope.row.amount
  216. : scope.row.amountType == "OUT"
  217. ? -scope.row.amount
  218. : ""
  219. : "-"
  220. }}
  221. </template>
  222. </el-table-column>
  223. <el-table-column
  224. align="center"
  225. label="押金"
  226. prop="flag"
  227. min-width="160"
  228. show-overflow-tooltip
  229. >
  230. <template slot-scope="scope">
  231. {{
  232. scope.row.flag == 4
  233. ? scope.row.amountType == "IN"
  234. ? scope.row.amount
  235. : scope.row.amountType == "OUT"
  236. ? -scope.row.amount
  237. : ""
  238. : "-"
  239. }}
  240. </template>
  241. </el-table-column>
  242. <el-table-column
  243. align="center"
  244. label="工程保证金"
  245. prop="flag"
  246. min-width="160"
  247. show-overflow-tooltip
  248. >
  249. <template slot-scope="scope">
  250. {{
  251. scope.row.flag == 5
  252. ? scope.row.amountType == "IN"
  253. ? scope.row.amount
  254. : scope.row.amountType == "OUT"
  255. ? -scope.row.amount
  256. : ""
  257. : "-"
  258. }}
  259. </template>
  260. </el-table-column>
  261. <el-table-column
  262. align="center"
  263. label="其他暂扣款"
  264. prop="flag"
  265. min-width="160"
  266. show-overflow-tooltip
  267. >
  268. <template slot-scope="scope">
  269. {{
  270. scope.row.flag == 6
  271. ? scope.row.amountType == "IN"
  272. ? scope.row.amount
  273. : scope.row.amountType == "OUT"
  274. ? -scope.row.amount
  275. : ""
  276. : "-"
  277. }}
  278. </template>
  279. </el-table-column>
  280. <el-table-column
  281. align="center"
  282. label="账户余额"
  283. prop="balanceAmount"
  284. min-width="160"
  285. show-overflow-tooltip
  286. ></el-table-column>
  287. </el-table>
  288. </div>
  289. <!-- 分页 -->
  290. <div class="fr">
  291. <el-pagination
  292. @size-change="handleSizeChange"
  293. @current-change="handleCurrentChange"
  294. :current-page="currentPage"
  295. :page-sizes="[10, 20, 30, 50]"
  296. :page-size="10"
  297. layout="total, sizes, prev, pager, next, jumper"
  298. :total="listTotal"
  299. >
  300. </el-pagination>
  301. </div>
  302. </div>
  303. </div>
  304. <div v-show="bill == 'REBATE'">
  305. <!-- 列表 -->
  306. <div class="mymain-container">
  307. <div class="table">
  308. <el-table
  309. v-loading="listLoading"
  310. :data="dataList"
  311. element-loading-text="Loading"
  312. border
  313. fit
  314. highlight-current-row
  315. stripe
  316. >
  317. <el-table-column
  318. label="序号"
  319. align="center"
  320. width="100"
  321. type="index"
  322. show-overflow-tooltip
  323. ></el-table-column>
  324. <el-table-column
  325. align="center"
  326. label="客户编码"
  327. prop="customerCode"
  328. min-width="160"
  329. show-overflow-tooltip
  330. ></el-table-column>
  331. <el-table-column
  332. align="center"
  333. label="客户名称"
  334. prop="customerName"
  335. min-width="160"
  336. show-overflow-tooltip
  337. ></el-table-column>
  338. <el-table-column
  339. align="center"
  340. label="单据日期"
  341. prop="theTime"
  342. min-width="160"
  343. show-overflow-tooltip
  344. ></el-table-column>
  345. <el-table-column
  346. align="center"
  347. label="审核日期"
  348. prop="examineTime"
  349. min-width="160"
  350. show-overflow-tooltip
  351. ></el-table-column>
  352. <el-table-column
  353. align="center"
  354. label="单据类型"
  355. prop="billType"
  356. min-width="160"
  357. show-overflow-tooltip
  358. ></el-table-column>
  359. <el-table-column
  360. align="center"
  361. label="单据号"
  362. prop="billNo"
  363. min-width="160"
  364. show-overflow-tooltip
  365. ></el-table-column>
  366. <el-table-column
  367. align="center"
  368. label="返利类型"
  369. prop="walletName"
  370. min-width="160"
  371. show-overflow-tooltip
  372. ></el-table-column>
  373. <el-table-column
  374. align="center"
  375. label="摘要"
  376. prop="remark"
  377. min-width="160"
  378. show-overflow-tooltip
  379. ></el-table-column>
  380. <el-table-column
  381. align="center"
  382. label="收入"
  383. prop="amountType"
  384. min-width="160"
  385. show-overflow-tooltip
  386. >
  387. <template slot-scope="scope">
  388. {{ scope.row.amountType == "IN" ? scope.row.amount : "-" }}
  389. </template>
  390. </el-table-column>
  391. <el-table-column
  392. align="center"
  393. label="支出"
  394. prop="amountType"
  395. min-width="160"
  396. show-overflow-tooltip
  397. >
  398. <template slot-scope="scope">
  399. {{ scope.row.amountType == "OUT" ? scope.row.amount : "-" }}
  400. </template>
  401. </el-table-column>
  402. <el-table-column
  403. align="center"
  404. label="暂扣返利"
  405. prop="withholdAmount"
  406. min-width="160"
  407. show-overflow-tooltip
  408. >
  409. <!-- <template slot-scope="scope">
  410. {{
  411. scope.row.amountType == "OUT"
  412. ? scope.row.amount
  413. : -scope.row.amount
  414. }}
  415. </template> -->
  416. </el-table-column>
  417. <el-table-column
  418. align="center"
  419. label="结存"
  420. prop="balanceAmount"
  421. min-width="160"
  422. show-overflow-tooltip
  423. ></el-table-column>
  424. </el-table>
  425. </div>
  426. <!-- 分页 -->
  427. <div class="fr">
  428. <el-pagination
  429. @size-change="handleSizeChange"
  430. @current-change="handleCurrentChange"
  431. :current-page="currentPage"
  432. :page-sizes="[10, 20, 30, 50]"
  433. :page-size="10"
  434. layout="total, sizes, prev, pager, next, jumper"
  435. :total="listTotal"
  436. >
  437. </el-pagination>
  438. </div>
  439. </div>
  440. </div>
  441. </div>
  442. </template>
  443. <script>
  444. import { mapGetters } from "vuex";
  445. import { getWalletCustomerList } from "@/api/finance/change_apply";
  446. import {
  447. getStandbookList,
  448. getDictList,
  449. getCustomerList,
  450. } from "@/api/finance/standbook_list";
  451. export default {
  452. data() {
  453. return {
  454. customerList: [],
  455. currentPage: 1, // 当前页码
  456. pageSize: 10, // 每页数量
  457. listTotal: 0, // 列表总数
  458. // dataListRebate: [], // 列表数据
  459. // dataListLoan: [], // 列表数据
  460. dataList: [],
  461. walletList: [],
  462. // dictList: [],
  463. customerName: "",
  464. customerNumber: "",
  465. searchForm: {
  466. customerId: "",
  467. customerWalletId: "",
  468. billNo: "",
  469. startTime: "",
  470. endTime: "",
  471. }, //搜索表单
  472. listLoading: false, // 列表加载loading
  473. bill: "COMMONLY",
  474. };
  475. },
  476. computed: {
  477. ...mapGetters(["customerId"]),
  478. },
  479. created() {
  480. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  481. this.getDataList({
  482. pageSize: this.pageSize,
  483. pageNum: this.currentPage,
  484. type: this.bill,
  485. customerName: this.$route.query.customerName,
  486. customerNumber: this.$route.query.customerNumber,
  487. });
  488. } else {
  489. this.getDataList({
  490. pageSize: this.pageSize,
  491. pageNum: this.currentPage,
  492. type: this.bill,
  493. });
  494. }
  495. this.getCustomerDataList();
  496. // this.getWalletList();
  497. // this.getDataDict();
  498. },
  499. methods: {
  500. //合计
  501. getSummaries(param) {
  502. // console.log(this.$getSummaries, 333333333);
  503. console.log(param, "param");
  504. // const { columns, data } = param;
  505. // const sums = [];
  506. // columns.forEach((column, index) => {
  507. // if (index === 0) {
  508. // sums[index] = "总价";
  509. // return;
  510. // }
  511. // const values = data.map((item) => Number(item[column.property]));
  512. // if (!values.every((value) => isNaN(value))) {
  513. // sums[index] = values.reduce((prev, curr) => {
  514. // const value = Number(curr);
  515. // if (!isNaN(value)) {
  516. // return prev + curr;
  517. // } else {
  518. // return prev;
  519. // }
  520. // }, 0);
  521. // sums[index] += " 元";
  522. // } else {
  523. // sums[index] = "N/A";
  524. // }
  525. // });
  526. // return sums;
  527. },
  528. //改变经销商
  529. async changeFn(v) {
  530. this.searchForm.customerWalletId = "";
  531. let res = await getWalletCustomerList({ customerId: v, type: this.bill });
  532. this.walletList = res.data;
  533. },
  534. //获取经销商列表
  535. async getCustomerDataList() {
  536. let res = await getCustomerList({
  537. pageNum: 1,
  538. pageSize: -1,
  539. });
  540. this.customerList = res.data.records;
  541. },
  542. // 更改每页数量
  543. handleSizeChange(val) {
  544. this.pageSize = val;
  545. this.currentPage = 1;
  546. // this.getDataList({
  547. // type: this.bill,
  548. // pageNum: this.currentPage,
  549. // pageSize: this.pageSize,
  550. // });
  551. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  552. this.getDataList({
  553. pageSize: this.pageSize,
  554. pageNum: this.currentPage,
  555. type: this.bill,
  556. customerName: this.$route.query.customerName,
  557. customerNumber: this.$route.query.customerNumber,
  558. });
  559. } else {
  560. this.getDataList({
  561. ...this.searchForm,
  562. pageSize: this.pageSize,
  563. pageNum: this.currentPage,
  564. type: this.bill,
  565. customerName: this.customerName,
  566. customerNumber: this.customerNumber,
  567. });
  568. }
  569. },
  570. // 更改当前页
  571. handleCurrentChange(val) {
  572. this.currentPage = val;
  573. // this.getDataList({
  574. // type: this.bill,
  575. // pageNum: this.currentPage,
  576. // pageSize: this.pageSize,
  577. // });
  578. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  579. this.getDataList({
  580. pageSize: this.pageSize,
  581. pageNum: this.currentPage,
  582. type: this.bill,
  583. customerName: this.$route.query.customerName,
  584. customerNumber: this.$route.query.customerNumber,
  585. });
  586. } else {
  587. this.getDataList({
  588. ...this.searchForm,
  589. pageSize: this.pageSize,
  590. pageNum: this.currentPage,
  591. type: this.bill,
  592. customerName: this.customerName,
  593. customerNumber: this.customerNumber,
  594. });
  595. }
  596. },
  597. // //获取品类
  598. // async getDataDict() {
  599. // const res = await getDictList({ sysDictEnum: "PRODUCT_TYPE" });
  600. // console.log(res);
  601. // this.dictList = res.data;
  602. // },
  603. //重置
  604. async resetFn() {
  605. // this.searchForm.customerId = "";
  606. this.walletList = [];
  607. this.customerName = "";
  608. this.customerNumber = "";
  609. await this.$refs.searchForm.resetFields();
  610. },
  611. //查询
  612. searchFn() {
  613. // this.customerName = null;
  614. // this.customerNumber = null;
  615. let res = this.customerList.filter((v) => {
  616. return v.id == this.searchForm.customerId;
  617. });
  618. console.log(res);
  619. // return;
  620. if (res.length > 0) {
  621. this.customerName = res[0].name;
  622. this.customerNumber = res[0].number;
  623. }
  624. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  625. this.getDataList({
  626. ...this.searchForm,
  627. pageSize: this.pageSize,
  628. pageNum: this.currentPage,
  629. type: this.bill,
  630. customerName: this.$route.query.customerName,
  631. customerNumber: this.$route.query.customerNumber,
  632. });
  633. } else {
  634. this.getDataList({
  635. ...this.searchForm,
  636. customerName: this.customerName,
  637. customerNumber: this.customerNumber,
  638. pageSize: this.pageSize,
  639. pageNum: this.currentPage,
  640. type: this.bill,
  641. });
  642. }
  643. },
  644. // //钱包数据
  645. // async getWalletList() {
  646. // let res = await getWalletCustomerList({
  647. // customerId: this.customerId,
  648. // type: this.bill,
  649. // });
  650. // this.selectList = res.data;
  651. // },
  652. //切换列表
  653. checkFn(v) {
  654. // this.getDataList({
  655. // pageSize: 10,
  656. // pageNum: 1,
  657. // type: v,
  658. // });
  659. this.resetFn();
  660. this.pageSize = 10;
  661. this.currentPage = 1;
  662. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  663. this.getDataList({
  664. ...this.searchForm,
  665. pageSize: 10,
  666. pageNum: 1,
  667. type: v,
  668. customerName: this.$route.query.customerName,
  669. customerNumber: this.$route.query.customerNumber,
  670. });
  671. } else {
  672. this.getDataList({
  673. // ...this.searchForm,
  674. // customerName: this.customerName,
  675. // customerNumber: this.customerNumber,
  676. pageSize: this.pageSize,
  677. pageNum: this.currentPage,
  678. type: v,
  679. });
  680. }
  681. // this.getWalletList();
  682. },
  683. //
  684. async getDataList(data) {
  685. let res;
  686. if (this.bill == "COMMONLY") {
  687. res = await getStandbookList(data);
  688. } else {
  689. res = await getStandbookList(data);
  690. }
  691. this.dataList = res.data.records;
  692. this.listTotal = res.data.total;
  693. },
  694. },
  695. };
  696. </script>
  697. <style lang="scss" scoped>
  698. .moneyStyle {
  699. height: 130px;
  700. border-radius: 20px;
  701. padding: 20px 0 0 20px;
  702. color: #fff;
  703. span {
  704. display: block;
  705. font-size: 20px;
  706. }
  707. strong {
  708. margin-top: 16px;
  709. display: block;
  710. font-size: 36px;
  711. }
  712. }
  713. .selectStyle {
  714. width: 100%;
  715. }
  716. .color1 {
  717. background-color: #6c83d0;
  718. }
  719. .color2 {
  720. background-color: #dfc062;
  721. }
  722. .color3 {
  723. background-color: #dfc062;
  724. }
  725. .color4 {
  726. background-color: #6bcfd7;
  727. }
  728. </style>