account_list.vue 9.6 KB

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