list.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <a-card size="small" :bordered="false" class="financialPaymentList-wrap">
  3. <!-- 标签页 -->
  4. <a-tabs type="card" @change="handleTabChange" class="financialPaymentList-tabs">
  5. <a-tab-pane v-for="item in tabPaneData" :key="item.id" :tab="item.name"></a-tab-pane>
  6. </a-tabs>
  7. <!-- 搜索条件 -->
  8. <div class="table-page-search-wrapper">
  9. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  10. <a-row :gutter="15">
  11. <a-col :md="6" :sm="24">
  12. <a-form-item label="付款单号">
  13. <a-input id="financialPaymentList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入付款单号"/>
  14. </a-form-item>
  15. </a-col>
  16. <a-col :md="6" :sm="24">
  17. <a-form-item label="关联单号">
  18. <a-input id="financialPaymentList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入关联单号"/>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :md="6" :sm="24">
  22. <a-form-item label="商户名称">
  23. <a-input id="financialPaymentList-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入商户名称"/>
  24. </a-form-item>
  25. </a-col>
  26. <template v-if="advanced">
  27. <a-col :md="6" :sm="24">
  28. <a-form-item label="单据状态">
  29. <v-select
  30. v-model="queryParam.billStatus"
  31. ref="billStatus"
  32. id="financialPaymentList-billStatus"
  33. code="PAYMENT_TYPE"
  34. placeholder="请选择单据状态"
  35. allowClear></v-select>
  36. </a-form-item>
  37. </a-col>
  38. <a-col :md="6" :sm="24">
  39. <a-form-item label="审核时间">
  40. <a-range-picker v-model="queryParam.creatDate" id="financialPaymentList-creatDate"/>
  41. </a-form-item>
  42. </a-col>
  43. </template>
  44. <a-col :md="6" :sm="24">
  45. <span class="table-page-search-submitButtons">
  46. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialPaymentList-refresh">查询</a-button>
  47. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="financialPaymentList-reset">重置</a-button>
  48. <a @click="advanced=!advanced" style="margin-left: 8px">
  49. {{ advanced ? '收起' : '展开' }}
  50. <a-icon :type="advanced ? 'up' : 'down'"/>
  51. </a>
  52. </span>
  53. </a-col>
  54. </a-row>
  55. </a-form>
  56. </div>
  57. <!-- alert -->
  58. <a-alert type="info" showIcon style="margin-bottom:15px">
  59. <div slot="message">共 <strong>6</strong> 条记录,付款金额合计 <strong>¥14</strong> ,其中已付 <strong>¥14</strong> ,未付 <strong>¥14</strong> </div>
  60. </a-alert>
  61. <div style="margin-bottom: 15px">
  62. <a-button type="primary" id="financialPaymentList-export" :disabled="!hasSelected" :loading="loading" @click="handlePayment">
  63. 批量付款
  64. </a-button>
  65. <span style="margin-left: 8px">
  66. <template v-if="hasSelected">
  67. {{ `已选 ${selectedRowKeys.length} 项` }}
  68. </template>
  69. </span>
  70. </div>
  71. <!-- 列表 -->
  72. <s-table
  73. class="sTable"
  74. ref="table"
  75. size="default"
  76. :row-selection="rowSelection"
  77. :rowKey="(record) => record.id"
  78. :columns="columns"
  79. :data="loadData"
  80. :scroll="{ x: 1280 }"
  81. bordered>
  82. <!-- 结算单号 -->
  83. <template slot="purchaseNo" slot-scope="text, record">
  84. <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.purchaseNo }}</span>
  85. </template>
  86. <!-- 结算方式 -->
  87. <template slot="sss" slot-scope="text, record">
  88. <span>{{ record.state == 1 ? '现金' : '微信' }}</span>
  89. </template>
  90. <!-- 操作 -->
  91. <template slot="action" slot-scope="text, record">
  92. <a-button size="small" type="link" @click="handleVoucher(record)" id="financialPaymentList-voucher-btn">凭证</a-button>
  93. </template>
  94. </s-table>
  95. </a-card>
  96. </template>
  97. <script>
  98. import { STable, VSelect } from '@/components'
  99. // import { getRoleList, getServiceList } from '@/api/manage'
  100. export default {
  101. components: { STable, VSelect },
  102. data () {
  103. return {
  104. advanced: false, // 高级搜索 展开/关闭
  105. disabled: false, // 查询、重置按钮是否可操作
  106. // 查询参数
  107. queryParam: {},
  108. // 表头
  109. columns: [
  110. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  111. { title: '付款单号', dataIndex: 'nos', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  112. { title: '关联单号', dataIndex: 'name', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  113. { title: '商户名称', dataIndex: 'pssayType', align: 'center', customRender: function (text) { return text || '--' } },
  114. { title: '付款金额', dataIndex: 'paddyType', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  115. { title: '付款类型', scopedSlots: { customRender: 'purchaseNo' }, width: 100, align: 'center' },
  116. { title: '付款方式', dataIndex: 'totalP', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  117. { title: '付款时间', dataIndex: 'creatDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  118. { title: '审核时间', dataIndex: 'payType', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  119. { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
  120. ],
  121. selectedRowKeys: [], // Check here to configure the default column
  122. loading: false,
  123. // 加载数据方法 必须为 Promise 对象
  124. loadData: parameter => {
  125. this.disabled = true
  126. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  127. // const data = res.data
  128. // const no = (data.pageNo - 1) * data.pageSize
  129. // for (var i = 0; i < data.list.length; i++) {
  130. // data.list[i].no = no + i + 1
  131. // }
  132. // this.disabled = false
  133. // return data
  134. // })
  135. const _this = this
  136. return new Promise(function (resolve, reject) {
  137. const data = {
  138. pageNo: 1,
  139. pageSize: 10,
  140. list: [
  141. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  142. ],
  143. count: 10
  144. }
  145. const no = (data.pageNo - 1) * data.pageSize
  146. for (var i = 0; i < data.list.length; i++) {
  147. data.list[i].no = no + i + 1
  148. }
  149. _this.disabled = false
  150. resolve(data)
  151. })
  152. },
  153. tabPaneData: [
  154. { id: 1, name: '全部' },
  155. { id: 2, name: '采购入库' },
  156. { id: 3, name: '散件入库' },
  157. { id: 4, name: '销售退货' },
  158. { id: 5, name: '连锁调入' },
  159. { id: 6, name: '急件' },
  160. { id: 7, name: '费用' },
  161. { id: 8, name: '资产' },
  162. { id: 9, name: '盘点付款' }
  163. ]
  164. }
  165. },
  166. computed: {
  167. hasSelected () {
  168. return this.selectedRowKeys.length > 0
  169. },
  170. rowSelection () {
  171. return {
  172. selectedRowKeys: this.selectedRowKeys,
  173. onChange: (selectedRowKeys, selectedRows) => {
  174. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  175. console.log('selectedRowKeys changed: ', selectedRowKeys)
  176. this.selectedRowKeys = selectedRowKeys
  177. },
  178. getCheckboxProps: record => ({
  179. props: {
  180. disabled: record.name === 'Disabled User', // Column configuration not to be checked
  181. name: record.name
  182. }
  183. })
  184. }
  185. }
  186. },
  187. methods: {
  188. // 凭证
  189. handleVoucher (row) {
  190. },
  191. // tabs change
  192. handleTabChange (key) {
  193. console.log(key)
  194. },
  195. // 批量付款
  196. handlePayment () {
  197. this.loading = true
  198. // ajax request after empty completing
  199. setTimeout(() => {
  200. this.loading = false
  201. this.selectedRowKeys = []
  202. }, 1000)
  203. },
  204. // 重置
  205. resetSearchForm () {
  206. this.queryParam.orderBundleNo = ''
  207. this.queryParam.orderBundle.custMobile = ''
  208. this.queryParam.bundleName = ''
  209. this.queryParam.itemName = ''
  210. this.oldTime = undefined
  211. this.newTime = undefined
  212. this.$refs.table.refresh(true)
  213. }
  214. }
  215. }
  216. </script>
  217. <style lang="less">
  218. .financialPaymentList-wrap{
  219. .sTable{
  220. margin-top: 15px;
  221. }
  222. .financialPaymentList-tabs{
  223. margin-bottom: 15px;
  224. }
  225. }
  226. </style>