list.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  7. <a-row :gutter="15">
  8. <a-col :md="6" :sm="24">
  9. <a-form-item label="经销商名称/别名">
  10. <a-input id="accountStatementBill-dealerName" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入经销商名称/别名"/>
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="区域">
  15. <subarea id="accountStatementBill-subarea" ref="subarea" @change="subareaChange"></subarea>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="24">
  19. <a-form-item label="商户级别">
  20. <v-select code="DEALER_LEVEL" id="accountStatementBill-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="24">
  24. <a-form-item label="商户类型">
  25. <dealerType id="accountStatementBill-dealerType" changeOnSelect v-model="dealerType" @change="getDealerType" allowClear></dealertype>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :md="6" :sm="24">
  29. <a-form-item label="客服">
  30. <customerService ref="customerName" id="matchSendOutOrderList-bizUserSn" v-model="queryParam.bizUserSn"></customerService>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :md="6" :sm="24">
  34. <a-form-item label="财务编码">
  35. <a-input id="accountStatementBill-bookNo" v-model.trim="queryParam.kdMidCustomerFnumber" allowClear placeholder="请输入财务编码"/>
  36. </a-form-item>
  37. </a-col>
  38. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  39. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="accountStatementBill-refresh">查询</a-button>
  40. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="accountStatementBill-reset">重置</a-button>
  41. <a-button
  42. style="margin-left: 10px"
  43. type="primary"
  44. id="conFrontModal-export"
  45. class="button-warning"
  46. @click="handleExport"
  47. :disabled="disabled"
  48. :loading="exportLoading"
  49. >导出</a-button>
  50. </a-col>
  51. </a-row>
  52. </a-form>
  53. </div>
  54. </a-card>
  55. <a-card size="small" :bordered="false" class="accountStatementBill-wrap">
  56. <a-spin :spinning="spinning" tip="Loading...">
  57. <!-- 列表 -->
  58. <s-table
  59. class="sTable fixPagination"
  60. ref="table"
  61. :style="{ height: tableHeight+80+'px' }"
  62. size="small"
  63. :rowKey="(record) => record.id"
  64. :columns="columns"
  65. :data="loadData"
  66. :scroll="{ y: tableHeight }"
  67. :pageSize="30"
  68. :defaultLoadData="false"
  69. bordered>
  70. <template slot="orderTotalAmount" slot-scope="text, record">
  71. <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="handleDetail(record)">{{ record.orderTotalAmount }}</span>
  72. <span v-else>{{ record.orderTotalAmount }}</span>
  73. </template>
  74. </s-table>
  75. </a-spin>
  76. </a-card>
  77. </div>
  78. </template>
  79. <script>
  80. import { commonMixin } from '@/utils/mixin'
  81. import { STable, VSelect } from '@/components'
  82. import { financeBookQueryPage } from '@/api/financeBook.js'
  83. import subarea from '@/views/common/subarea.js'
  84. import dealerType from '@/views/common/dealerType.js'
  85. import customerService from '@/views/common/customerService.vue'
  86. export default {
  87. name: 'AccountStatementBillList',
  88. mixins: [commonMixin],
  89. components: { STable, VSelect, subarea, dealerType, customerService },
  90. data () {
  91. return {
  92. spinning: false,
  93. exportLoading: false,
  94. tableHeight: 0,
  95. dealerType: [], // 商户类型
  96. queryParam: { // 查询条件
  97. nameLike: '', // 经销商名称/别名
  98. dealerType1: undefined, // 商户类型
  99. dealerType2: undefined, // 商户类型
  100. dealerLevel: null, // 商户级别
  101. subareaSn: undefined, // 区域
  102. subareaAreaSn: undefined, // 分区
  103. bizUserSn: undefined, // 客服
  104. kdMidCustomerFnumber: '' // 财务编码
  105. },
  106. disabled: false, // 查询、重置按钮是否可操作
  107. advanced: true,
  108. // 加载数据方法 必须为 Promise 对象
  109. loadData: parameter => {
  110. this.disabled = true
  111. this.spinning = true
  112. const params = Object.assign(parameter, this.queryParam)
  113. return financeBookQueryPage(params).then(res => {
  114. let data
  115. if (res.status == 200) {
  116. data = res.data
  117. const no = (data.pageNo - 1) * data.pageSize
  118. for (var i = 0; i < data.list.length; i++) {
  119. data.list[i].no = no + i + 1
  120. }
  121. this.total = data.count || 0
  122. this.disabled = false
  123. }
  124. this.spinning = false
  125. return data
  126. })
  127. },
  128. total: 0 // 合计
  129. }
  130. },
  131. // 根据权限显示列表字段
  132. computed: {
  133. columns () {
  134. const arr = [
  135. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  136. { title: '财务编码', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  137. { title: '经销商名称', dataIndex: 'payerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  138. { title: '经销商别名', dataIndex: 'payerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  139. { title: '余额', scopedSlots: { customRender: 'orderTotalAmount' }, width: '8%', align: 'center' },
  140. { title: '客服', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  141. { title: '区域', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  142. { title: '分区', dataIndex: 'updateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  143. { title: '商户级别', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  144. { title: '商户类型', dataIndex: 'statusDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
  145. ]
  146. return arr
  147. }
  148. },
  149. methods: {
  150. // 区域分区
  151. subareaChange (val) {
  152. this.queryParam.subareaSn = val[0] ? val[0] : undefined
  153. this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
  154. },
  155. // 商户类型 change
  156. getDealerType (v, o) {
  157. this.queryParam.dealerType1 = v[0]
  158. this.queryParam.dealerType2 = v[1]
  159. },
  160. // 重置
  161. resetSearchForm () {
  162. this.queryParam.beginDate = ''
  163. this.queryParam.endDate = ''
  164. this.queryParam.nameLike = ''
  165. this.queryParam.dealerType1 = undefined
  166. this.queryParam.dealerType2 = undefined
  167. this.queryParam.dealerLevel = undefined
  168. this.queryParam.subareaAreaSn = undefined
  169. this.queryParam.subareaSn = undefined
  170. this.$refs.table.refresh(true)
  171. },
  172. // 详情
  173. handleDetail (row) {
  174. this.$router.push({ name: 'accountStatementBillDetail', params: { sn: row.bookSn } })
  175. },
  176. pageInit () {
  177. const _this = this
  178. this.$nextTick(() => { // 页面渲染完成后的回调
  179. _this.setTableH()
  180. })
  181. },
  182. setTableH () {
  183. const tableSearchH = this.$refs.tableSearch.offsetHeight
  184. this.tableHeight = window.innerHeight - tableSearchH - 250
  185. }
  186. },
  187. watch: {
  188. advanced (newValue, oldValue) {
  189. const _this = this
  190. this.$nextTick(() => { // 页面渲染完成后的回调
  191. _this.setTableH()
  192. })
  193. },
  194. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  195. this.setTableH()
  196. }
  197. },
  198. mounted () {
  199. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  200. this.pageInit()
  201. this.resetSearchForm()
  202. }
  203. },
  204. activated () {
  205. // 如果是新页签打开,则重置当前页面
  206. if (this.$store.state.app.isNewTab) {
  207. this.pageInit()
  208. this.resetSearchForm()
  209. }
  210. // 仅刷新列表,不重置页面
  211. if (this.$store.state.app.updateList) {
  212. this.pageInit()
  213. this.$refs.table.refresh()
  214. }
  215. },
  216. beforeRouteEnter (to, from, next) {
  217. next(vm => {})
  218. }
  219. }
  220. </script>
  221. <style lang="less">
  222. .accountStatementBill-wrap{
  223. .active{
  224. color: #ed1c24;
  225. cursor: pointer;
  226. }
  227. .common{
  228. color: rgba(0, 0, 0);
  229. }
  230. }
  231. </style>