standbook_list.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909
  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. :disabled="isDisabled"
  33. class="selectStyle"
  34. v-model="searchForm.customerId"
  35. placeholder="请选择"
  36. filterable
  37. @change="changeFn"
  38. >
  39. <el-option
  40. v-for="(v, i) in customerList"
  41. :key="i"
  42. :label="v.name"
  43. :value="v.id"
  44. >
  45. </el-option>
  46. </el-select>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :xs="24" :sm="12" :lg="6">
  50. <el-form-item label="钱包" prop="customerWalletId">
  51. <el-select
  52. class="selectStyle"
  53. v-model="searchForm.customerWalletId"
  54. placeholder="请选择"
  55. filterable
  56. >
  57. <el-option
  58. v-for="(v, i) in walletList"
  59. :key="i"
  60. :label="v.customerWalletName"
  61. :value="v.customerWalletId"
  62. >
  63. </el-option>
  64. </el-select>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="单据号" prop="billNo">
  69. <el-input
  70. v-model="searchForm.billNo"
  71. placeholder="请输入"
  72. ></el-input>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :xs="24" :sm="12" :lg="6">
  76. <el-form-item label="开始时间" prop="startTime">
  77. <el-date-picker
  78. class="selectStyle"
  79. v-model="searchForm.startTime"
  80. type="datetime"
  81. placeholder="选择日期时间"
  82. default-time="00:00:00"
  83. value-format="yyyy-MM-dd HH:mm:ss"
  84. >
  85. </el-date-picker>
  86. </el-form-item>
  87. </el-col>
  88. <el-col :xs="24" :sm="12" :lg="6">
  89. <el-form-item label="结束时间" prop="endTime">
  90. <el-date-picker
  91. class="selectStyle"
  92. v-model="searchForm.endTime"
  93. type="datetime"
  94. placeholder="选择日期时间"
  95. default-time="23:59:59"
  96. value-format="yyyy-MM-dd HH:mm:ss"
  97. >
  98. </el-date-picker>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :xs="24" :sm="12" :lg="18">
  102. <el-form-item label="" class="fr">
  103. <el-button size="small" @click="resetFn">清空</el-button>
  104. <el-button size="small" type="primary" @click="searchFn"
  105. >搜索</el-button
  106. >
  107. </el-form-item>
  108. </el-col>
  109. </el-row>
  110. </el-form>
  111. </div>
  112. <!-- 按钮 -->
  113. <div class="btn-group clearfix">
  114. <div class="fr">
  115. <ExportButton
  116. :exUrl="'/finance/standing/book/export'"
  117. :exParams="exParams"
  118. />
  119. </div>
  120. </div>
  121. <div v-show="bill == 'COMMONLY'">
  122. <!-- 列表 -->
  123. <div class="mymain-container">
  124. <div class="table">
  125. <el-table
  126. v-loading="listLoading"
  127. :data="dataList"
  128. element-loading-text="Loading"
  129. border
  130. fit
  131. highlight-current-row
  132. stripe
  133. >
  134. <el-table-column
  135. label="序号"
  136. align="center"
  137. width="100"
  138. type="index"
  139. show-overflow-tooltip
  140. ></el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="单据日期"
  144. prop="theTime"
  145. min-width="160"
  146. show-overflow-tooltip
  147. ></el-table-column>
  148. <el-table-column
  149. align="center"
  150. label="单据类型"
  151. prop="billType"
  152. min-width="160"
  153. show-overflow-tooltip
  154. ></el-table-column>
  155. <el-table-column
  156. align="center"
  157. label="单据号"
  158. prop="billNo"
  159. min-width="160"
  160. show-overflow-tooltip
  161. ></el-table-column>
  162. <el-table-column
  163. align="center"
  164. label="钱包"
  165. prop="walletName"
  166. min-width="160"
  167. show-overflow-tooltip
  168. ></el-table-column>
  169. <el-table-column
  170. align="center"
  171. label="摘要"
  172. prop="remark"
  173. min-width="160"
  174. show-overflow-tooltip
  175. ></el-table-column>
  176. <el-table-column
  177. align="center"
  178. label="预付货款"
  179. prop="flag"
  180. min-width="160"
  181. show-overflow-tooltip
  182. >
  183. <template slot-scope="scope">
  184. {{
  185. scope.row.flag == 1
  186. ? scope.row.amountType == "IN"
  187. ? scope.row.amount
  188. : scope.row.amountType == "OUT"
  189. ? -scope.row.amount
  190. : ""
  191. : "-"
  192. }}
  193. </template>
  194. </el-table-column>
  195. <el-table-column
  196. align="center"
  197. label="订单占款"
  198. prop="flag"
  199. min-width="160"
  200. show-overflow-tooltip
  201. >
  202. <template slot-scope="scope">
  203. {{
  204. scope.row.flag == 2
  205. ? scope.row.amountType == "IN"
  206. ? scope.row.amount
  207. : scope.row.amountType == "OUT"
  208. ? -scope.row.amount
  209. : ""
  210. : "-"
  211. }}
  212. </template>
  213. </el-table-column>
  214. <el-table-column
  215. align="center"
  216. label="支付货款"
  217. prop="flag"
  218. min-width="160"
  219. show-overflow-tooltip
  220. >
  221. <template slot-scope="scope">
  222. {{
  223. scope.row.flag == 3
  224. ? scope.row.amountType == "IN"
  225. ? scope.row.amount
  226. : scope.row.amountType == "OUT"
  227. ? -scope.row.amount
  228. : ""
  229. : "-"
  230. }}
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. align="center"
  235. label="押金"
  236. prop="flag"
  237. min-width="160"
  238. show-overflow-tooltip
  239. >
  240. <template slot-scope="scope">
  241. {{
  242. scope.row.flag == 4
  243. ? scope.row.amountType == "IN"
  244. ? scope.row.amount
  245. : scope.row.amountType == "OUT"
  246. ? -scope.row.amount
  247. : ""
  248. : "-"
  249. }}
  250. </template>
  251. </el-table-column>
  252. <el-table-column
  253. align="center"
  254. label="工程保证金"
  255. prop="flag"
  256. min-width="160"
  257. show-overflow-tooltip
  258. >
  259. <template slot-scope="scope">
  260. {{
  261. scope.row.flag == 5
  262. ? scope.row.amountType == "IN"
  263. ? scope.row.amount
  264. : scope.row.amountType == "OUT"
  265. ? -scope.row.amount
  266. : ""
  267. : "-"
  268. }}
  269. </template>
  270. </el-table-column>
  271. <el-table-column
  272. align="center"
  273. label="其他暂扣款"
  274. prop="flag"
  275. min-width="160"
  276. show-overflow-tooltip
  277. >
  278. <template slot-scope="scope">
  279. {{
  280. scope.row.flag == 6
  281. ? scope.row.amountType == "IN"
  282. ? scope.row.amount
  283. : scope.row.amountType == "OUT"
  284. ? -scope.row.amount
  285. : ""
  286. : "-"
  287. }}
  288. </template>
  289. </el-table-column>
  290. <el-table-column
  291. align="center"
  292. label="账户余额"
  293. prop="balanceAmount"
  294. min-width="160"
  295. show-overflow-tooltip
  296. ></el-table-column>
  297. </el-table>
  298. </div>
  299. <!-- 分页 -->
  300. <div class="fr">
  301. <el-pagination
  302. @size-change="handleSizeChange"
  303. @current-change="handleCurrentChange"
  304. :current-page="currentPage"
  305. :page-sizes="[10, 20, 30, 50]"
  306. :page-size="10"
  307. layout="total, sizes, prev, pager, next, jumper"
  308. :total="listTotal"
  309. >
  310. </el-pagination>
  311. </div>
  312. </div>
  313. </div>
  314. <div v-show="bill == 'REBATE'">
  315. <!-- 列表 -->
  316. <div class="mymain-container">
  317. <div class="table">
  318. <el-table
  319. v-loading="listLoading"
  320. :data="dataList"
  321. element-loading-text="Loading"
  322. border
  323. fit
  324. highlight-current-row
  325. stripe
  326. >
  327. <el-table-column
  328. label="序号"
  329. align="center"
  330. width="100"
  331. type="index"
  332. show-overflow-tooltip
  333. ></el-table-column>
  334. <el-table-column
  335. align="center"
  336. label="客户编码"
  337. prop="customerCode"
  338. min-width="160"
  339. show-overflow-tooltip
  340. ></el-table-column>
  341. <el-table-column
  342. align="center"
  343. label="客户名称"
  344. prop="customerName"
  345. min-width="160"
  346. show-overflow-tooltip
  347. ></el-table-column>
  348. <el-table-column
  349. align="center"
  350. label="单据日期"
  351. prop="theTime"
  352. min-width="160"
  353. show-overflow-tooltip
  354. ></el-table-column>
  355. <el-table-column
  356. align="center"
  357. label="审核日期"
  358. prop="examineTime"
  359. min-width="160"
  360. show-overflow-tooltip
  361. ></el-table-column>
  362. <el-table-column
  363. align="center"
  364. label="单据类型"
  365. prop="billType"
  366. min-width="160"
  367. show-overflow-tooltip
  368. >
  369. <template slot-scope="scope">
  370. {{ scope.row.billType == 3 ? "付款单" : scope.row.billType }}
  371. </template>
  372. </el-table-column>
  373. <el-table-column
  374. align="center"
  375. label="单据号"
  376. prop="billNo"
  377. min-width="160"
  378. show-overflow-tooltip
  379. ></el-table-column>
  380. <el-table-column
  381. align="center"
  382. label="返利类型"
  383. prop="walletName"
  384. min-width="160"
  385. show-overflow-tooltip
  386. ></el-table-column>
  387. <el-table-column
  388. align="center"
  389. label="摘要"
  390. prop="remark"
  391. min-width="160"
  392. show-overflow-tooltip
  393. ></el-table-column>
  394. <el-table-column
  395. align="center"
  396. label="收入"
  397. prop="amountType"
  398. min-width="160"
  399. show-overflow-tooltip
  400. >
  401. <template slot-scope="scope">
  402. {{ scope.row.amountType == "IN" ? scope.row.amount : "-" }}
  403. </template>
  404. </el-table-column>
  405. <el-table-column
  406. align="center"
  407. label="支出"
  408. prop="amountType"
  409. min-width="160"
  410. show-overflow-tooltip
  411. >
  412. <template slot-scope="scope">
  413. {{ scope.row.amountType == "OUT" ? scope.row.amount : "-" }}
  414. </template>
  415. </el-table-column>
  416. <el-table-column
  417. align="center"
  418. label="暂扣返利"
  419. prop="withholdAmount"
  420. min-width="160"
  421. show-overflow-tooltip
  422. >
  423. <!-- <template slot-scope="scope">
  424. {{
  425. scope.row.amountType == "OUT"
  426. ? scope.row.amount
  427. : -scope.row.amount
  428. }}
  429. </template> -->
  430. </el-table-column>
  431. <el-table-column
  432. align="center"
  433. label="结存"
  434. prop="balanceAmount"
  435. min-width="160"
  436. show-overflow-tooltip
  437. ></el-table-column>
  438. </el-table>
  439. </div>
  440. <!-- 分页 -->
  441. <div class="fr">
  442. <el-pagination
  443. @size-change="handleSizeChange"
  444. @current-change="handleCurrentChange"
  445. :current-page="currentPage"
  446. :page-sizes="[10, 20, 30, 50]"
  447. :page-size="10"
  448. layout="total, sizes, prev, pager, next, jumper"
  449. :total="listTotal"
  450. >
  451. </el-pagination>
  452. </div>
  453. </div>
  454. </div>
  455. </div>
  456. </template>
  457. <script>
  458. // import { mapGetters } from "vuex";
  459. import { getWalletCustomerList } from "@/api/finance/change_apply";
  460. import {
  461. getStandbookList,
  462. getDictList,
  463. getCustomerList,
  464. } from "@/api/finance/standbook_list";
  465. export default {
  466. data() {
  467. return {
  468. customerList: [],
  469. currentPage: 1, // 当前页码
  470. pageSize: 10, // 每页数量
  471. listTotal: 0, // 列表总数
  472. // dataListRebate: [], // 列表数据
  473. // dataListLoan: [], // 列表数据
  474. dataList: [],
  475. walletList: [],
  476. // dictList: [],
  477. customerName: "",
  478. customerNumber: "",
  479. searchForm: {
  480. customerId: "",
  481. customerWalletId: "",
  482. billNo: "",
  483. startTime: "",
  484. endTime: "",
  485. }, //搜索表单
  486. listLoading: false, // 列表加载loading
  487. bill: "COMMONLY",
  488. isCustomer: JSON.parse(localStorage.getItem("supply_user")).isCustomer,
  489. isDisabled: false,
  490. };
  491. },
  492. computed: {
  493. exParams() {
  494. // return {
  495. // type: this.bill,
  496. // };
  497. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  498. return {
  499. ...this.searchForm,
  500. pageSize: this.pageSize,
  501. pageNum: this.currentPage,
  502. type: this.bill,
  503. customerName: this.$route.query.customerName,
  504. customerNumber: this.$route.query.customerNumber,
  505. };
  506. } else if (this.isCustomer) {
  507. return {
  508. ...this.searchForm,
  509. pageSize: this.pageSize,
  510. pageNum: this.currentPage,
  511. type: this.bill,
  512. customerName: this.$store.state.user.customerName,
  513. customerNumber: this.$store.state.user.customerNumber,
  514. };
  515. } else {
  516. return {
  517. ...this.searchForm,
  518. pageSize: this.pageSize,
  519. pageNum: this.currentPage,
  520. type: this.bill,
  521. customerName: this.customerName,
  522. customerNumber: this.customerNumber,
  523. };
  524. }
  525. },
  526. },
  527. beforeRouteEnter(to, from, next) {
  528. // console.log(to, from, next, 898);
  529. next((vm) => {
  530. // 这个时候组件还没有创建,所以要通过vm来访问
  531. console.log(vm);
  532. if (
  533. from.path == "/finance/details/balance_sum" &&
  534. to.path == "/finance/details/standbook_list"
  535. ) {
  536. //只有是从A进到B页面才执行
  537. // 将要执行的逻辑
  538. vm.isDisabled = true;
  539. vm.searchForm.customerId = vm.$route.query.customerName;
  540. vm.changeFn(vm.$route.query.customerId);
  541. vm.getDataList({
  542. pageSize: vm.pageSize,
  543. pageNum: vm.currentPage,
  544. type: vm.bill,
  545. customerName: vm.$route.query.customerName,
  546. customerNumber: vm.$route.query.customerNumber,
  547. });
  548. } else if (vm.isCustomer) {
  549. vm.isDisabled = true;
  550. vm.searchForm.customerId = vm.$store.state.user.customerName;
  551. vm.changeFn(vm.$store.state.user.customerId);
  552. vm.getDataList({
  553. pageSize: vm.pageSize,
  554. pageNum: vm.currentPage,
  555. type: vm.bill,
  556. customerName: vm.$store.state.user.customerName,
  557. customerNumber: vm.$store.state.user.customerNumber,
  558. });
  559. } else {
  560. vm.searchForm.customerId = "";
  561. vm.isDisabled = false;
  562. vm.getDataList({
  563. pageSize: vm.pageSize,
  564. pageNum: vm.currentPage,
  565. type: vm.bill,
  566. });
  567. vm.getCustomerDataList();
  568. }
  569. });
  570. },
  571. created() {
  572. // console.log(
  573. // this.customerId,
  574. // this.$store.state.user.customerName,
  575. // this.$store.state.user.customerNumber,
  576. // 777777
  577. // );
  578. // if (this.$route.query.customerName && this.$route.query.customerNumber) {
  579. // this.isDisabled = true;
  580. // this.searchForm.customerId = this.$route.query.customerName;
  581. // this.changeFn(this.$route.query.customerId);
  582. // this.getDataList({
  583. // pageSize: this.pageSize,
  584. // pageNum: this.currentPage,
  585. // type: this.bill,
  586. // customerName: this.$route.query.customerName,
  587. // customerNumber: this.$route.query.customerNumber,
  588. // });
  589. // } else
  590. // if (this.isCustomer) {
  591. // this.isDisabled = true;
  592. // this.searchForm.customerId = this.$store.state.user.customerName;
  593. // this.changeFn(this.$store.state.user.customerId);
  594. // this.getDataList({
  595. // pageSize: this.pageSize,
  596. // pageNum: this.currentPage,
  597. // type: this.bill,
  598. // customerName: this.$store.state.user.customerName,
  599. // customerNumber: this.$store.state.user.customerNumber,
  600. // });
  601. // } else {
  602. // this.getDataList({
  603. // pageSize: this.pageSize,
  604. // pageNum: this.currentPage,
  605. // type: this.bill,
  606. // });
  607. // this.getCustomerDataList();
  608. // }
  609. // this.getCustomerDataList();
  610. // this.getWalletList();
  611. // this.getDataDict();
  612. },
  613. methods: {
  614. // //合计
  615. // getSummaries(param) {
  616. // console.log(this.$getSummaries, 333333333);
  617. // console.log(param, "param");
  618. // // const { columns, data } = param;
  619. // // const sums = [];
  620. // // columns.forEach((column, index) => {
  621. // // if (index === 0) {
  622. // // sums[index] = "总价";
  623. // // return;
  624. // // }
  625. // // const values = data.map((item) => Number(item[column.property]));
  626. // // if (!values.every((value) => isNaN(value))) {
  627. // // sums[index] = values.reduce((prev, curr) => {
  628. // // const value = Number(curr);
  629. // // if (!isNaN(value)) {
  630. // // return prev + curr;
  631. // // } else {
  632. // // return prev;
  633. // // }
  634. // // }, 0);
  635. // // sums[index] += " 元";
  636. // // } else {
  637. // // sums[index] = "N/A";
  638. // // }
  639. // // });
  640. // // return sums;
  641. // },
  642. //改变经销商
  643. async changeFn(v) {
  644. this.searchForm.customerWalletId = "";
  645. let res = await getWalletCustomerList({
  646. customerId: v,
  647. type: this.bill,
  648. hasRecord: true,
  649. });
  650. this.walletList = res.data;
  651. },
  652. //获取经销商列表
  653. async getCustomerDataList() {
  654. let res = await getCustomerList({
  655. pageNum: 1,
  656. pageSize: -1,
  657. });
  658. this.customerList = res.data.records;
  659. },
  660. // 更改每页数量
  661. handleSizeChange(val) {
  662. this.pageSize = val;
  663. this.currentPage = 1;
  664. // this.getDataList({
  665. // type: this.bill,
  666. // pageNum: this.currentPage,
  667. // pageSize: this.pageSize,
  668. // });
  669. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  670. this.getDataList({
  671. ...this.searchForm,
  672. pageSize: this.pageSize,
  673. pageNum: this.currentPage,
  674. type: this.bill,
  675. customerName: this.$route.query.customerName,
  676. customerNumber: this.$route.query.customerNumber,
  677. });
  678. } else if (this.isCustomer) {
  679. this.getDataList({
  680. ...this.searchForm,
  681. pageSize: this.pageSize,
  682. pageNum: this.currentPage,
  683. type: this.bill,
  684. customerName: this.$store.state.user.customerName,
  685. customerNumber: this.$store.state.user.customerNumber,
  686. });
  687. } else {
  688. this.getDataList({
  689. ...this.searchForm,
  690. pageSize: this.pageSize,
  691. pageNum: this.currentPage,
  692. type: this.bill,
  693. customerName: this.customerName,
  694. customerNumber: this.customerNumber,
  695. });
  696. }
  697. },
  698. // 更改当前页
  699. handleCurrentChange(val) {
  700. this.currentPage = val;
  701. // this.getDataList({
  702. // type: this.bill,
  703. // pageNum: this.currentPage,
  704. // pageSize: this.pageSize,
  705. // });
  706. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  707. this.getDataList({
  708. ...this.searchForm,
  709. pageSize: this.pageSize,
  710. pageNum: this.currentPage,
  711. type: this.bill,
  712. customerName: this.$route.query.customerName,
  713. customerNumber: this.$route.query.customerNumber,
  714. });
  715. } else if (this.isCustomer) {
  716. this.getDataList({
  717. ...this.searchForm,
  718. pageSize: this.pageSize,
  719. pageNum: this.currentPage,
  720. type: this.bill,
  721. customerName: this.$store.state.user.customerName,
  722. customerNumber: this.$store.state.user.customerNumber,
  723. });
  724. } else {
  725. this.getDataList({
  726. ...this.searchForm,
  727. pageSize: this.pageSize,
  728. pageNum: this.currentPage,
  729. type: this.bill,
  730. customerName: this.customerName,
  731. customerNumber: this.customerNumber,
  732. });
  733. }
  734. },
  735. // //获取品类
  736. // async getDataDict() {
  737. // const res = await getDictList({ sysDictEnum: "PRODUCT_TYPE" });
  738. // console.log(res);
  739. // this.dictList = res.data;
  740. // },
  741. //重置
  742. async resetFn() {
  743. // this.searchForm.customerId = "";
  744. // this.walletList = [];
  745. // this.customerName = "";
  746. // this.customerNumber = "";
  747. if (this.isCustomer || this.$route.query.customerId) {
  748. await this.$refs.searchForm.resetFields();
  749. } else {
  750. this.walletList = [];
  751. this.customerName = "";
  752. this.customerNumber = "";
  753. await this.$refs.searchForm.resetFields();
  754. }
  755. },
  756. //查询
  757. searchFn() {
  758. // this.customerName = null;
  759. // this.customerNumber = null;
  760. let res = this.customerList.filter((v) => {
  761. return v.id == this.searchForm.customerId;
  762. });
  763. console.log(res);
  764. // return;
  765. if (res.length > 0) {
  766. this.customerName = res[0].name;
  767. this.customerNumber = res[0].number;
  768. }
  769. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  770. this.getDataList({
  771. ...this.searchForm,
  772. pageSize: this.pageSize,
  773. pageNum: this.currentPage,
  774. type: this.bill,
  775. customerName: this.$route.query.customerName,
  776. customerNumber: this.$route.query.customerNumber,
  777. });
  778. } else if (this.isCustomer) {
  779. this.getDataList({
  780. ...this.searchForm,
  781. pageSize: this.pageSize,
  782. pageNum: this.currentPage,
  783. type: this.bill,
  784. customerName: this.$store.state.user.customerName,
  785. customerNumber: this.$store.state.user.customerNumber,
  786. });
  787. } else {
  788. this.getDataList({
  789. ...this.searchForm,
  790. customerName: this.customerName,
  791. customerNumber: this.customerNumber,
  792. pageSize: this.pageSize,
  793. pageNum: this.currentPage,
  794. type: this.bill,
  795. });
  796. }
  797. },
  798. // //钱包数据
  799. // async getWalletList() {
  800. // let res = await getWalletCustomerList({
  801. // customerId: this.customerId,
  802. // type: this.bill,
  803. // });
  804. // this.selectList = res.data;
  805. // },
  806. //切换列表
  807. checkFn(v) {
  808. // this.getDataList({
  809. // pageSize: 10,
  810. // pageNum: 1,
  811. // type: v,
  812. // });
  813. this.resetFn();
  814. this.pageSize = 10;
  815. this.currentPage = 1;
  816. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  817. this.changeFn(this.$route.query.customerId);
  818. this.getDataList({
  819. ...this.searchForm,
  820. pageSize: this.pageSize,
  821. pageNum: this.currentPage,
  822. type: v,
  823. customerName: this.$route.query.customerName,
  824. customerNumber: this.$route.query.customerNumber,
  825. });
  826. } else if (this.isCustomer) {
  827. this.changeFn(this.$store.state.user.customerId);
  828. this.getDataList({
  829. ...this.searchForm,
  830. pageSize: this.pageSize,
  831. pageNum: this.currentPage,
  832. type: this.bill,
  833. customerName: this.$store.state.user.customerName,
  834. customerNumber: this.$store.state.user.customerNumber,
  835. });
  836. } else {
  837. this.getDataList({
  838. // ...this.searchForm,
  839. // customerName: this.customerName,
  840. // customerNumber: this.customerNumber,
  841. pageSize: this.pageSize,
  842. pageNum: this.currentPage,
  843. type: v,
  844. });
  845. }
  846. // this.getWalletList();
  847. },
  848. //
  849. async getDataList(data) {
  850. let res;
  851. if (this.bill == "COMMONLY") {
  852. res = await getStandbookList(data);
  853. } else {
  854. res = await getStandbookList(data);
  855. }
  856. this.dataList = res.data.records;
  857. this.listTotal = res.data.total;
  858. },
  859. },
  860. };
  861. </script>
  862. <style lang="scss" scoped>
  863. .moneyStyle {
  864. height: 130px;
  865. border-radius: 20px;
  866. padding: 20px 0 0 20px;
  867. color: #fff;
  868. span {
  869. display: block;
  870. font-size: 20px;
  871. }
  872. strong {
  873. margin-top: 16px;
  874. display: block;
  875. font-size: 36px;
  876. }
  877. }
  878. .selectStyle {
  879. width: 100%;
  880. }
  881. .color1 {
  882. background-color: #6c83d0;
  883. }
  884. .color2 {
  885. background-color: #dfc062;
  886. }
  887. .color3 {
  888. background-color: #dfc062;
  889. }
  890. .color4 {
  891. background-color: #6bcfd7;
  892. }
  893. </style>