account_list-detail.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <div>
  3. <div class="sty">
  4. <el-page-header @back="goBack" content="对账历史记录"> </el-page-header>
  5. </div>
  6. <el-divider></el-divider>
  7. <!-- 筛选条件 -->
  8. <div>
  9. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="small" label-position="left">
  10. <el-row :gutter="20">
  11. <el-col :xs="24" :sm="12" :lg="6">
  12. <el-form-item label="经销商名称" prop="customerId">
  13. <el-select v-model="searchForm.customerId" class="selectStyle" placeholder="请选择" filterable @change="changeFn">
  14. <el-option v-for="(v, i) in customerList" :key="i" :label="v.name" :value="v.id">
  15. </el-option>
  16. </el-select>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="钱包" prop="customerWalletId">
  21. <el-select v-model="searchForm.customerWalletId" class="selectStyle" placeholder="请选择">
  22. <el-option v-for="(v, i) in walletList" :key="i" :label="v.customerWalletName" :value="v.customerWalletId">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="单据号" prop="billNo">
  29. <el-input v-model="searchForm.billNo" placeholder="请输入"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="开始时间" prop="startTime">
  34. <el-date-picker class="selectStyle" v-model="searchForm.startTime" placeholder="选择日期" type="datetime" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss">
  35. </el-date-picker>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item label="结束时间" prop="endTime">
  40. <el-date-picker class="selectStyle" v-model="searchForm.endTime" placeholder="选择日期" type="datetime" default-time="23:59:59" value-format="yyyy-MM-dd HH:mm:ss">
  41. </el-date-picker>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :xs="24" :sm="24" :lg="18">
  45. <el-form-item label="" class="fr">
  46. <el-button size="small" @click="clearFn">清空</el-button>
  47. <el-button size="small" type="primary" @click="searchFn">搜索</el-button>
  48. </el-form-item>
  49. </el-col>
  50. </el-row>
  51. </el-form>
  52. </div>
  53. <!-- 按钮 -->
  54. <div class="btn-group clearfix">
  55. <div class="fr">
  56. <el-button type="primary" size="small">导出</el-button>
  57. </div>
  58. </div>
  59. <!-- 列表 -->
  60. <div class="mymain-container">
  61. <div class="table">
  62. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe show-summary :summary-method="getSummaries">
  63. <el-table-column align="left" label="序号" type="index" width="80" show-overflow-tooltip></el-table-column>
  64. <el-table-column align="left" label="月份" prop="month" min-width="100" show-overflow-tooltip></el-table-column>
  65. <el-table-column align="left" label="对账状态" prop="isReconciliation" min-width="100" show-overflow-tooltip>
  66. <template slot-scope="scope">
  67. <el-tag size="mini" type="success" v-if="scope.row.isReconciliation == true">已对账</el-tag>
  68. </template>
  69. </el-table-column>
  70. <el-table-column align="left" label="客户编码" prop="customerCode" min-width="100" show-overflow-tooltip>
  71. <template slot-scope="scope">
  72. <CopyButton :copyText="scope.row.customerCode" />
  73. <span>{{scope.row.customerCode}}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column align="left" label="客户名称" prop="customerName" min-width="260" show-overflow-tooltip>
  77. <template slot-scope="scope">
  78. <CopyButton :copyText="scope.row.customerName" />
  79. <span>{{scope.row.customerName}}</span>
  80. </template>
  81. </el-table-column>
  82. <!-- <el-table-column
  83. align="left"
  84. label="部门"
  85. prop=""
  86. min-width="160"
  87. show-overflow-tooltip
  88. ></el-table-column> -->
  89. <el-table-column align="left" label="现金钱包类型" prop="walletName" min-width="160" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="left" label="单据类型" prop="billType" min-width="160" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="left" label="单据号" prop="billNo" min-width="160" show-overflow-tooltip>
  92. <template slot-scope="scope">
  93. <CopyButton :copyText="scope.row.billNo" />
  94. <span>{{scope.row.billNo}}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="left" label="单据日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  99. <el-table-column align="right" label="收付款金额" prop="amount" min-width="130" show-overflow-tooltip>
  100. <template slot-scope="scope">
  101. {{(scope.row.amountType == 'OUT'? -scope.row.amount:scope.row.amount) | numToFixed }}
  102. </template>
  103. </el-table-column>
  104. <!-- <el-table-column
  105. align="center"
  106. label="发货金额"
  107. prop=""
  108. min-width="160"
  109. show-overflow-tooltip
  110. ></el-table-column> -->
  111. </el-table>
  112. </div>
  113. <!-- 分页 -->
  114. <div class="fr">
  115. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
  116. </el-pagination>
  117. </div>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import {
  123. getFinanceStandingBookList,
  124. getCustomerList,
  125. getWalletCustomerList,
  126. } from "@/api/finance/account_list";
  127. import { numToFixed } from "@/filters";
  128. export default {
  129. data() {
  130. return {
  131. currentPage: 1, // 当前页码
  132. pageSize: 10, // 每页数量
  133. listTotal: 0, // 列表总数
  134. dataList: [], // 列表数据
  135. searchForm: {
  136. customerId: "",
  137. customerWalletId: "",
  138. billNo: "",
  139. startTime: "",
  140. endTime: "",
  141. }, //搜索表单
  142. listLoading: false, // 列表加载loading
  143. customerList: [],
  144. walletList: [],
  145. };
  146. },
  147. created() {
  148. this.getDataList();
  149. this.getCustomerDataList({
  150. pageSize: -1,
  151. pageNum: 1,
  152. });
  153. },
  154. methods: {
  155. //合计
  156. getSummaries(param) {
  157. const { columns, data } = param;
  158. const sums = [];
  159. columns.forEach((column, index) => {
  160. if (index === 0) {
  161. sums[index] = "合计";
  162. }
  163. if (index === 10) {
  164. let arr = [];
  165. data.forEach((v) => {
  166. if (v.amountType == "OUT") {
  167. arr.push(-v.amount);
  168. } else {
  169. arr.push(v.amount);
  170. }
  171. });
  172. let a = arr.reduce((prev, curr) => {
  173. const value = Number(curr);
  174. if (!isNaN(value)) {
  175. return prev + curr;
  176. } else {
  177. return prev;
  178. }
  179. }, 0);
  180. sums[index] = numToFixed(a);
  181. }
  182. });
  183. return sums;
  184. },
  185. //清空
  186. clearFn() {
  187. this.$refs.searchForm.resetFields();
  188. },
  189. //搜索
  190. searchFn() {
  191. this.currentPage = 1;
  192. this.getDataList();
  193. },
  194. //改变经销商
  195. async changeFn(v) {
  196. this.searchForm.customerWalletId = "";
  197. let res = await getWalletCustomerList({ customerId: v });
  198. this.walletList = res.data;
  199. },
  200. //获取经销商数据
  201. async getCustomerDataList(data) {
  202. const res = await getCustomerList(data);
  203. this.customerList = res.data.records;
  204. },
  205. // 更改每页数量
  206. handleSizeChange(val) {
  207. this.pageSize = val;
  208. this.currentPage = 1;
  209. this.getDataList();
  210. },
  211. // 更改当前页
  212. handleCurrentChange(val) {
  213. this.currentPage = val;
  214. this.getDataList();
  215. },
  216. //获取列表
  217. async getDataList() {
  218. let params = {
  219. pageSize: this.pageSize,
  220. pageNum: this.currentPage,
  221. isReconciliation: true,
  222. customerId: this.searchForm.customerId,
  223. customerWalletId: this.searchForm.customerWalletId,
  224. billNo: this.searchForm.billNo,
  225. startTime: this.searchForm.startTime,
  226. endTime: this.searchForm.endTime,
  227. };
  228. let res = await getFinanceStandingBookList(params);
  229. res.data.records.forEach((item) => {
  230. item.sums1 = [];
  231. item.sums2 = ["amount"];
  232. });
  233. this.dataList = res.data.records;
  234. this.listTotal = res.data.total;
  235. },
  236. goBack() {
  237. this.$parent.showReconciliation = true;
  238. },
  239. },
  240. };
  241. </script>
  242. <style lang="scss" scoped>
  243. .selectStyle {
  244. width: 100%;
  245. }
  246. </style>