standbook_list.vue 20 KB

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