list.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <div class="filter-control">
  5. <span>收款ID:</span>
  6. <el-input v-model="listQuery.receiptId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
  7. </div>
  8. <div class="filter-control">
  9. <span>订单ID:</span>
  10. <el-input v-model="listQuery.orderId" style="width:130px;" placeholder="订单ID" clearable @keyup.enter.native="getList" @clear="getList" />
  11. </div>
  12. <div class="filter-control">
  13. <span>订单编号:</span>
  14. <el-input v-model="listQuery.orderNo" style="width:200px;" placeholder="订单编号" clearable @keyup.enter.native="getList" @clear="getList" />
  15. </div>
  16. <div class="filter-control">
  17. <span>机构名称:</span>
  18. <el-input v-model="listQuery.userName" style="width:200px;" placeholder="客户名称" clearable @keyup.enter.native="getList" @clear="getList" />
  19. </div>
  20. <div class="filter-control">
  21. <span>收款方:</span>
  22. <el-input v-model="listQuery.customer" style="width:200px;" placeholder="收款方" clearable @keyup.enter.native="getList" @clear="getList" />
  23. </div>
  24. <div class="filter-control">
  25. <span>收款方式:</span>
  26. <el-select v-model="listQuery.payWay" style="width:120px;" clearable @change="getList">
  27. <el-option value="" label="所有" />
  28. <el-option label="线上" :value="1" />
  29. <el-option label="线下" :value="2" />
  30. </el-select>
  31. </div>
  32. <div class="filter-control">
  33. <span>收款状态:</span>
  34. <el-select v-model="listQuery.receiptStatus" style="width:120px;" clearable @change="getList">
  35. <el-option value="" label="所有" />
  36. <el-option label="待审核" :value="2" />
  37. <el-option label="审核通过" :value="3" />
  38. <el-option label="审核不通过" :value="4" />
  39. <el-option label="收款撤销" :value="5" />
  40. </el-select>
  41. </div>
  42. <div class="filter-control">
  43. <span>收款账号:</span>
  44. <el-select v-model="listQuery.payType" style="width:150px;" clearable @change="getList">
  45. <el-option value="" label="所有" />
  46. <el-option v-for="item in receiptTypeList" :key="item.id" :label="item.name" :value="item.id" />
  47. </el-select>
  48. </div>
  49. <div class="filter-control">
  50. <span>收款进度:</span>
  51. <el-select v-model="listQuery.receiptProgress" style="width:120px;" clearable @change="getList">
  52. <el-option value="" label="所有" />
  53. <el-option label="待收款" :value="1" />
  54. <el-option label="部分收款" :value="2" />
  55. <el-option label="已收款" :value="3" />
  56. </el-select>
  57. </div>
  58. <div class="filter-control">
  59. <span>关联数量:</span>
  60. <el-select v-model="listQuery.associationNum" style="width:150px;" clearable @change="getList">
  61. <el-option value="" label="所有" />
  62. <el-option label="关联一个订单" value="1" />
  63. <el-option label="关联多个订单" value="2" />
  64. </el-select>
  65. </div>
  66. <div class="filter-control">
  67. <span>下单时间:</span>
  68. <el-date-picker
  69. v-model="time"
  70. type="daterange"
  71. unlink-panels
  72. range-separator="至"
  73. start-placeholder="开始日期"
  74. end-placeholder="结束日期"
  75. :picker-options="pickerOptions"
  76. @change="getList"
  77. />
  78. </div>
  79. <div class="filter-control">
  80. <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
  81. <!-- <el-button type="primary" icon="el-icon-search" @click="getList">导出筛查结果</el-button> -->
  82. </div>
  83. </div>
  84. <el-table
  85. v-loading="listLoading"
  86. :data="list"
  87. element-loading-text="Loading"
  88. border
  89. fit
  90. highlight-current-row
  91. :header-cell-style="{background:'#eef1f6',color:'#606266'}"
  92. >
  93. <el-table-column label="收款ID" align="center" prop="receiptId" width="100" />
  94. <el-table-column label="收款时间" align="center" prop="receiptTime" width="200" />
  95. <el-table-column label="金额(元)" align="center" prop="receiptAmount" width="150">
  96. <template slot-scope="{ row }">
  97. <span>{{ row.receiptAmount | amountfilters }}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="收款方式" align="center" prop="payWay">
  101. <template slot-scope="{ row }">
  102. {{ row.payWay | payWayFilters }}
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="收款账号" align="center" prop="payType">
  106. <template slot-scope="{ row }">
  107. <span>{{ payTypeFilters(row.payType) }}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="状态" align="center" prop="receiptStatus">
  111. <template slot-scope="{ row }">
  112. <span
  113. :class="{
  114. 'el-span-warning': row.receiptStatus == 2,
  115. 'el-span-success': row.receiptStatus == 3,
  116. 'el-span-danger': row.receiptStatus == 4,
  117. 'el-span-danger': row.receiptStatus == 5,
  118. }"
  119. >
  120. {{ row.receiptStatus | receiptStatusFilters }}
  121. </span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="机构名称" align="center" prop="userName">
  125. <template slot-scope="{ row }">
  126. {{ row.userName ? row.userName : '---' }}
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="关联订单号" align="center" prop="shopOrderNos" />
  130. <el-table-column label="操作" align="center">
  131. <template slot-scope="{row}">
  132. <el-button type="primary" size="mini" @click="handleToDetails(row.receiptId)">查看详情</el-button>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <!-- 页码 -->
  137. <pagination
  138. :total="total"
  139. :page-sizes="[20]"
  140. :page-size="20"
  141. :page.sync="listQuery.pageNum"
  142. :limit.sync="listQuery.pageSize"
  143. @pagination="getList"
  144. />
  145. </div>
  146. </template>
  147. <script>
  148. import { getReceiptList, getReceiptTypeList } from '@/api/finance'
  149. import pickerOptions from '@/utils/time-picker.js'
  150. export default {
  151. filters: {
  152. payWayFilters(value) {
  153. // 收款方式
  154. const map = {
  155. 1: '线上',
  156. 2: '线下'
  157. }
  158. return map[value]
  159. },
  160. receiptStatusFilters(value) {
  161. // 收款状态
  162. const map = {
  163. 2: '待审核',
  164. 3: '审核通过',
  165. 4: '审核未通过',
  166. 5: '收款撤销'
  167. }
  168. return map[value]
  169. }
  170. },
  171. data() {
  172. return {
  173. time: '',
  174. list: null,
  175. pickerOptions,
  176. listLoading: true,
  177. searchTimeVal: '',
  178. total: 0,
  179. listQuery: {
  180. organizeId: this.$store.getters.organizeId,
  181. pageNum: 1,
  182. pageSize: 20,
  183. receiptId: '', // 收款ID
  184. orderId: '', // 订单ID
  185. orderNo: '', // 订单编号
  186. userName: '', // 机构名称
  187. payWay: '', // 收款方式
  188. payType: '', // 收款账号
  189. receiptProgress: '', // 收款进度
  190. associationNum: '', // 关联数量
  191. startTime: '', // 下单开始时间
  192. endTime: '' // 下单结束时间
  193. },
  194. receiptTypeList: []
  195. }
  196. },
  197. created() {
  198. this.getList()
  199. this.getReceiptTypeList()
  200. },
  201. methods: {
  202. // 获取收款列表
  203. async getList() {
  204. this.listLoading = true
  205. if (this.time && this.time.length > 0) {
  206. this.listQuery.startPayTime = this.time[0]
  207. this.listQuery.endPayTime = this.time[1]
  208. } else {
  209. this.listQuery.startPayTime = ''
  210. this.listQuery.endPayTime = ''
  211. }
  212. try {
  213. const res = await getReceiptList(this.listQuery)
  214. this.list = res.data.list
  215. this.total = res.data.total
  216. this.listLoading = false
  217. } catch (error) {
  218. console.log('error', error)
  219. this.listLoading = false
  220. }
  221. },
  222. // 获取收款账号列表
  223. async getReceiptTypeList() {
  224. const res = await getReceiptTypeList()
  225. this.receiptTypeList = res.data
  226. },
  227. payTypeFilters(value) {
  228. // 收款账号
  229. let valueText = ''
  230. this.receiptTypeList.forEach(type => {
  231. if (value === type.id) { valueText = type.name } else { valueText = '---' }
  232. })
  233. console.log('valueText', valueText)
  234. return valueText
  235. },
  236. handleToDetails(receiptId) {
  237. this.$router.push({ path: '/finance/details', query: { receiptId: receiptId }})
  238. },
  239. onSubmit() {
  240. console.log('search')
  241. }
  242. }
  243. }
  244. </script>
  245. <style scoped>
  246. .el-span-warning{
  247. color: #E6A23C;
  248. }
  249. .el-span-success{
  250. color: #67C23A;
  251. }
  252. .el-span-danger{
  253. color: #F56C6C;
  254. }
  255. </style>