standbook_list.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  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="24" :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. import { number } from "echarts";
  452. export default {
  453. data() {
  454. return {
  455. customerList: [],
  456. currentPage: 1, // 当前页码
  457. pageSize: 10, // 每页数量
  458. listTotal: 0, // 列表总数
  459. // dataListRebate: [], // 列表数据
  460. // dataListLoan: [], // 列表数据
  461. dataList: [],
  462. walletList: [],
  463. // dictList: [],
  464. customerName: null,
  465. customerNumber: null,
  466. searchForm: {
  467. customerId: "",
  468. customerWalletId: "",
  469. billNo: "",
  470. startTime: "",
  471. endTime: "",
  472. }, //搜索表单
  473. listLoading: false, // 列表加载loading
  474. bill: "COMMONLY",
  475. };
  476. },
  477. computed: {
  478. ...mapGetters(["customerId"]),
  479. },
  480. created() {
  481. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  482. this.getDataList({
  483. pageSize: this.pageSize,
  484. pageNum: this.currentPage,
  485. type: this.bill,
  486. customerName: this.$route.query.customerName,
  487. customerNumber: this.$route.query.customerNumber,
  488. });
  489. } else {
  490. this.getDataList({
  491. pageSize: this.pageSize,
  492. pageNum: this.currentPage,
  493. type: this.bill,
  494. });
  495. }
  496. this.getCustomerDataList();
  497. // this.getWalletList();
  498. // this.getDataDict();
  499. },
  500. methods: {
  501. //改变经销商
  502. async changeFn(v) {
  503. this.searchForm.customerWalletId = "";
  504. let res = await getWalletCustomerList({ customerId: v });
  505. this.walletList = res.data;
  506. },
  507. //获取经销商列表
  508. async getCustomerDataList() {
  509. let res = await getCustomerList({
  510. pageNum: 1,
  511. pageSize: -1,
  512. });
  513. this.customerList = res.data.records;
  514. },
  515. // 更改每页数量
  516. handleSizeChange(val) {
  517. this.pageSize = val;
  518. this.currentPage = 1;
  519. // this.getDataList({
  520. // type: this.bill,
  521. // pageNum: this.currentPage,
  522. // pageSize: this.pageSize,
  523. // });
  524. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  525. this.getDataList({
  526. pageSize: this.pageSize,
  527. pageNum: this.currentPage,
  528. type: this.bill,
  529. customerName: this.$route.query.customerName,
  530. customerNumber: this.$route.query.customerNumber,
  531. });
  532. } else {
  533. this.getDataList({
  534. ...this.searchForm,
  535. pageSize: this.pageSize,
  536. pageNum: this.currentPage,
  537. type: this.bill,
  538. customerName: this.customerName,
  539. customerNumber: this.customerNumber,
  540. });
  541. }
  542. },
  543. // 更改当前页
  544. handleCurrentChange(val) {
  545. this.currentPage = val;
  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. // async getDataDict() {
  572. // const res = await getDictList({ sysDictEnum: "PRODUCT_TYPE" });
  573. // console.log(res);
  574. // this.dictList = res.data;
  575. // },
  576. //重置
  577. resetFn() {
  578. // this.searchForm.customerId = "";
  579. this.walletList = [];
  580. this.$refs.searchForm.resetFields();
  581. },
  582. //查询
  583. searchFn() {
  584. // this.customerName = null;
  585. // this.customerNumber = null;
  586. let res = this.customerList.filter((v) => {
  587. return v.id == this.searchForm.customerId;
  588. });
  589. console.log(res);
  590. // return;
  591. if (res.length > 0) {
  592. this.customerName = res[0].name;
  593. this.customerNumber = res[0].number;
  594. }
  595. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  596. this.getDataList({
  597. ...this.searchForm,
  598. pageSize: this.pageSize,
  599. pageNum: this.currentPage,
  600. type: this.bill,
  601. customerName: this.$route.query.customerName,
  602. customerNumber: this.$route.query.customerNumber,
  603. });
  604. } else {
  605. this.getDataList({
  606. ...this.searchForm,
  607. customerName: this.customerName,
  608. customerNumber: this.customerNumber,
  609. pageSize: this.pageSize,
  610. pageNum: this.currentPage,
  611. type: this.bill,
  612. });
  613. }
  614. },
  615. // //钱包数据
  616. // async getWalletList() {
  617. // let res = await getWalletCustomerList({
  618. // customerId: this.customerId,
  619. // type: this.bill,
  620. // });
  621. // this.selectList = res.data;
  622. // },
  623. //切换列表
  624. checkFn(v) {
  625. // this.getDataList({
  626. // pageSize: 10,
  627. // pageNum: 1,
  628. // type: v,
  629. // });
  630. this.pageSize = 10;
  631. this.currentPage = 1;
  632. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  633. this.getDataList({
  634. ...this.searchForm,
  635. pageSize: 10,
  636. pageNum: 1,
  637. type: v,
  638. customerName: this.$route.query.customerName,
  639. customerNumber: this.$route.query.customerNumber,
  640. });
  641. } else {
  642. this.getDataList({
  643. ...this.searchForm,
  644. customerName: this.customerName,
  645. customerNumber: this.customerNumber,
  646. pageSize: this.pageSize,
  647. pageNum: this.currentPage,
  648. type: v,
  649. });
  650. }
  651. // this.getWalletList();
  652. },
  653. //
  654. async getDataList(data) {
  655. let res;
  656. if (this.bill == "COMMONLY") {
  657. res = await getStandbookList(data);
  658. } else {
  659. res = await getStandbookList(data);
  660. }
  661. this.dataList = res.data.records;
  662. this.listTotal = res.data.total;
  663. },
  664. },
  665. };
  666. </script>
  667. <style lang="scss" scoped>
  668. .moneyStyle {
  669. height: 130px;
  670. border-radius: 20px;
  671. padding: 20px 0 0 20px;
  672. color: #fff;
  673. span {
  674. display: block;
  675. font-size: 20px;
  676. }
  677. strong {
  678. margin-top: 16px;
  679. display: block;
  680. font-size: 36px;
  681. }
  682. }
  683. .selectStyle {
  684. width: 100%;
  685. }
  686. .color1 {
  687. background-color: #6c83d0;
  688. }
  689. .color2 {
  690. background-color: #dfc062;
  691. }
  692. .color3 {
  693. background-color: #dfc062;
  694. }
  695. .color4 {
  696. background-color: #6bcfd7;
  697. }
  698. </style>