list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <a-card size="small" :bordered="false" class="collectionDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  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. <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="收款单号">
  15. <a-input id="collectionDetail-bookNo" v-model.trim="queryParam.bookNo" allowClear placeholder="请输入收款单号"/>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="24">
  19. <a-form-item label="申请人">
  20. <employee style="width: 100%;" id="collectionDetail-Employee" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="24">
  24. <a-form-item label="收款日期">
  25. <rangeDate ref="receiptDate" :value="receiptDate" @change="receiptDateChange" />
  26. </a-form-item>
  27. </a-col>
  28. <a-col :md="6" :sm="24">
  29. <a-form-item label="付款方">
  30. <!-- <dealerSubareaScopeList id="collectionDetail-Employee" ref="settleClientName" @change="custChange" /> -->
  31. <a-input id="financialCollectionList-payerNames" v-model.trim="queryParam.payerNames" allowClear placeholder="请输入付款方"/>
  32. </a-form-item>
  33. </a-col>
  34. <a-col :md="6" :sm="24">
  35. <a-form-item label="财务编码">
  36. <a-input id="collectionDetail-kdMidCustomerFnumber" placeholder="请输入财务编码" v-model="queryParam.kdMidCustomerFnumber"></a-input>
  37. </a-form-item>
  38. </a-col>
  39. <a-col :md="6" :sm="24">
  40. <a-form-item label="付款账户">
  41. <a-input id="collectionDetail-licenseName" placeholder="请输入付款账户" v-model="queryParam.licenseName"></a-input>
  42. </a-form-item>
  43. </a-col>
  44. <template v-if="advanced">
  45. <a-col :md="4" :sm="24">
  46. <a-form-item label="足额打款">
  47. <v-select
  48. v-model="queryParam.fullPaymentFlag"
  49. ref="fullPaymentFlag"
  50. id="collectionDetail-fullPaymentFlag"
  51. code="FLAG"
  52. placeholder="请选择是否足额打款"
  53. allowClear></v-select>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :md="4" :sm="24">
  57. <a-form-item label="户名/汇入银行">
  58. <a-select placeholder="请选择汇入银行" v-model="queryParam.bankName" style="width: 100%">
  59. <a-select-option v-for="item in bankNameList" :value="item">
  60. {{ item }}
  61. </a-select-option>
  62. </a-select>
  63. </a-form-item>
  64. </a-col>
  65. <a-col :md="4" :sm="24">
  66. <a-form-item label="所属区域">
  67. <subarea id="collectionDetail-subarea" v-model="queryParam.subareaSn"></subarea>
  68. </a-form-item>
  69. </a-col>
  70. <a-col :md="4" :sm="24">
  71. <a-form-item label="所属省份">
  72. <Area id="collectionDetail-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
  73. </a-form-item>
  74. </a-col>
  75. </template>
  76. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  77. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="collectionDetail-refresh">查询</a-button>
  78. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="collectionDetail-reset">重置</a-button>
  79. <a-button
  80. style="margin-left: 10px"
  81. type="primary"
  82. class="button-warning"
  83. @click="handleExport"
  84. :disabled="disabled"
  85. :loading="exportLoading"
  86. v-if="$hasPermissions('M_FC_Details_Export')"
  87. id="sendOut-export">导出</a-button>
  88. <a @click="advanced=!advanced" style="margin-left: 5px">
  89. {{ advanced ? '收起' : '展开' }}
  90. <a-icon :type="advanced ? 'up' : 'down'"/>
  91. </a>
  92. </a-col>
  93. </a-row>
  94. </a-form>
  95. </div>
  96. <!-- 列表 -->
  97. <s-table
  98. class="sTable fixPagination"
  99. ref="table"
  100. :style="{ height: tableHeight+84.5+'px' }"
  101. size="small"
  102. :rowKey="(record) => record.id"
  103. :columns="columns"
  104. :data="loadData"
  105. :scroll="{ y: tableHeight }"
  106. bordered>
  107. </s-table>
  108. </a-spin>
  109. </a-card>
  110. </template>
  111. <script>
  112. import { commonMixin } from '@/utils/mixin'
  113. import { STable, VSelect } from '@/components'
  114. import getDate from '@/libs/getDate.js'
  115. import rangeDate from '@/views/common/rangeDate.vue'
  116. import subarea from '@/views/common/subarea.js'
  117. import Area from '@/views/common/area.js'
  118. import { hdExportExcel } from '@/libs/exportExcel'
  119. import employee from '../../expenseManagement/expenseReimbursement/employee.js'
  120. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  121. import { financeBookDetailQueryPage, financeBookDetailExport } from '@/api/financeBook.js'
  122. export default {
  123. name: 'CollectionDetailStaticList',
  124. mixins: [commonMixin],
  125. components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area },
  126. data () {
  127. return {
  128. spinning: false,
  129. exportLoading: false,
  130. tableHeight: 0,
  131. queryParam: { // 查询条件
  132. bookNo: '',
  133. auditBeginDate: getDate.getCurrMonthDays().starttime,
  134. auditEndDate: getDate.getCurrMonthDays().endtime,
  135. receiptBeginDate: '',
  136. receiptEndDate: '',
  137. applyPersonSn: undefined,
  138. dealerSn: undefined,
  139. kdMidCustomerFnumber: '',
  140. licenseName: '',
  141. fullPaymentFlag: undefined,
  142. bankName: undefined,
  143. subareaSn: undefined,
  144. provinceSn: undefined
  145. },
  146. disabled: false, // 查询、重置按钮是否可操作
  147. receiptDate: [], // 收款时间
  148. auditDate: [
  149. getDate.getCurrMonthDays().starttime,
  150. getDate.getCurrMonthDays().endtime
  151. ], // 审核时间
  152. advanced: false,
  153. // 加载数据方法 必须为 Promise 对象
  154. loadData: parameter => {
  155. this.disabled = true
  156. this.spinning = true
  157. return financeBookDetailQueryPage(Object.assign(parameter, this.queryParam)).then(res => {
  158. let data
  159. if (res.status == 200) {
  160. data = res.data
  161. const no = (data.pageNo - 1) * data.pageSize
  162. for (var i = 0; i < data.list.length; i++) {
  163. data.list[i].no = no + i + 1
  164. }
  165. this.total = data.count || 0
  166. this.disabled = false
  167. }
  168. this.spinning = false
  169. return data
  170. })
  171. },
  172. total: 0, // 合计
  173. bankNameList: ['东莞银行', '九江银行', '建设银行', '微信收款', '农业银行']
  174. }
  175. },
  176. // 根据权限显示列表字段
  177. computed: {
  178. columns () {
  179. const arr = [
  180. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  181. { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  182. { title: '收款单号', dataIndex: 'bookNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  183. { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' }, ellipsis: true },
  184. { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  185. { title: '收款日期', dataIndex: 'receiptDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  186. { title: '付款方类型', dataIndex: 'dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  187. { title: '付款方', dataIndex: 'dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  188. { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  189. { title: '付款账户(营业执照)', dataIndex: 'licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  190. { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  191. { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  192. { title: '使用授信', dataIndex: 'useCreditAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  193. { title: '授信还款', dataIndex: 'payCreditAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  194. { title: '余款抵扣', dataIndex: 'balanceAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  195. { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  196. { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  197. { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  198. { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  199. { title: '备注', dataIndex: 'remarks', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true }
  200. ]
  201. return arr
  202. }
  203. },
  204. methods: {
  205. custChange (val) {
  206. this.queryParam.dealerSn = val.key
  207. },
  208. // 创建时间 change
  209. receiptDateChange (date) {
  210. this.queryParam.receiptBeginDate = date[0] ? date[0] : ''
  211. this.queryParam.receiptEndDate = date[1] ? date[1] : ''
  212. },
  213. // 审核时间 change
  214. dateAuditChange (date) {
  215. this.queryParam.auditBeginDate = date[0] ? date[0] : ''
  216. this.queryParam.auditEndDate = date[1] ? date[1] : ''
  217. },
  218. // 重置
  219. resetSearchForm () {
  220. this.receiptDate = []
  221. this.queryParam.receiptBeginDate = ''
  222. this.queryParam.receiptEndDate = ''
  223. this.$refs.receiptDate.resetDate(this.receiptDate)
  224. this.auditDate = [
  225. getDate.getCurrMonthDays().starttime,
  226. getDate.getCurrMonthDays().endtime
  227. ]
  228. this.$refs.rangeAuditDate.resetDate(this.auditDate)
  229. this.queryParam.auditBeginDate = getDate.getCurrMonthDays().starttime
  230. this.queryParam.auditEndDate = getDate.getCurrMonthDays().endtime
  231. this.queryParam.bookNo = ''
  232. this.queryParam.dispatchBillNo = ''
  233. this.queryParam.applyPersonSn = undefined
  234. this.queryParam.kdMidCustomerFnumber = ''
  235. this.queryParam.dealerSn = undefined
  236. this.queryParam.licenseName = ''
  237. this.queryParam.fullPaymentFlag = undefined
  238. this.queryParam.bankName = undefined
  239. this.queryParam.subareaSn = undefined
  240. this.queryParam.provinceSn = undefined
  241. this.$refs.settleClientName.resetForm()
  242. this.$refs.table.refresh(true)
  243. },
  244. // 导出
  245. handleExport () {
  246. const _this = this
  247. _this.exportLoading = true
  248. _this.spinning = true
  249. hdExportExcel(financeBookDetailExport, _this.queryParam, '财务收款明细统计', function () {
  250. _this.exportLoading = false
  251. _this.spinning = false
  252. })
  253. },
  254. pageInit () {
  255. const _this = this
  256. this.$nextTick(() => { // 页面渲染完成后的回调
  257. _this.setTableH()
  258. })
  259. },
  260. setTableH () {
  261. const tableSearchH = this.$refs.tableSearch.offsetHeight
  262. this.tableHeight = window.innerHeight - tableSearchH - 195
  263. }
  264. },
  265. watch: {
  266. advanced (newValue, oldValue) {
  267. const _this = this
  268. this.$nextTick(() => { // 页面渲染完成后的回调
  269. _this.setTableH()
  270. })
  271. },
  272. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  273. this.setTableH()
  274. }
  275. },
  276. mounted () {
  277. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  278. this.pageInit()
  279. this.resetSearchForm()
  280. }
  281. },
  282. activated () {
  283. // 如果是新页签打开,则重置当前页面
  284. if (this.$store.state.app.isNewTab) {
  285. this.pageInit()
  286. this.resetSearchForm()
  287. }
  288. // 仅刷新列表,不重置页面
  289. if (this.$store.state.app.updateList) {
  290. this.pageInit()
  291. this.$refs.table.refresh()
  292. }
  293. },
  294. beforeRouteEnter (to, from, next) {
  295. next(vm => {})
  296. }
  297. }
  298. </script>
  299. <style lang="less">
  300. .collectionDetail-wrap{
  301. .active{
  302. color: #ed1c24;
  303. cursor: pointer;
  304. }
  305. .common{
  306. color: rgba(0, 0, 0);
  307. }
  308. }
  309. </style>