list.vue 13 KB

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