loan_list.vue 9.0 KB

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