list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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. <a-input id="financialCollectionList-payerName" v-model.trim="queryParam.payerName" allowClear placeholder="请输入付款方"/>
  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-payerAccountInfo" placeholder="请输入付款账户" v-model="queryParam.payerAccountInfo"></a-input>
  41. </a-form-item>
  42. </a-col>
  43. <template v-if="advanced">
  44. <a-col :md="6" :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="3" :sm="24">
  56. <a-form-item label="户名/汇入银行">
  57. <a-select placeholder="请选择户名" allowClear v-model="queryParam.bankAccount" style="width: 100%" @change="handleChange">
  58. <a-select-option v-for="item in bankList" :value="item.bankAccount">
  59. {{ item.bankAccount }}
  60. </a-select-option>
  61. </a-select>
  62. </a-form-item></a-col>
  63. <a-col :md="3" :sm="24">
  64. <a-form-item>
  65. <a-select placeholder="请选择汇入银行" allowClear v-model="queryParam.bankName" style="width: 100%">
  66. <a-select-option v-for="item in bankNameList" :value="item">
  67. {{ item }}
  68. </a-select-option>
  69. </a-select>
  70. </a-form-item>
  71. </a-col>
  72. <a-col :md="6" :sm="24">
  73. <a-form-item label="开票状态">
  74. <a-select v-model="queryParam.invoiceDateType" style="width: 100%" placeholder="请选择开票状态">
  75. <a-select-option value="1">
  76. 已开票
  77. </a-select-option>
  78. <a-select-option value="0">
  79. 未开票
  80. </a-select-option>
  81. </a-select>
  82. </a-form-item>
  83. </a-col>
  84. <a-col :md="6" :sm="24">
  85. <a-form-item label="收款日期">
  86. <rangeDate ref="receiptDate" :value="receiptDate" @change="receiptDateChange" />
  87. </a-form-item>
  88. </a-col>
  89. <a-col :md="6" :sm="24">
  90. <a-form-item label="所属区域">
  91. <subarea id="collectionDetail-subarea" v-model="queryParam.subareaSn"></subarea>
  92. </a-form-item>
  93. </a-col>
  94. <a-col :md="4" :sm="24">
  95. <a-form-item label="所属省份">
  96. <Area id="collectionDetail-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
  97. </a-form-item>
  98. </a-col>
  99. </template>
  100. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  101. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="collectionDetail-refresh">查询</a-button>
  102. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="collectionDetail-reset">重置</a-button>
  103. <a-button
  104. style="margin-left: 10px"
  105. type="primary"
  106. class="button-warning"
  107. @click="handleExport"
  108. :disabled="disabled"
  109. :loading="exportLoading"
  110. v-if="$hasPermissions('M_FC_Details_Export')"
  111. id="sendOut-export">导出</a-button>
  112. <a @click="advanced=!advanced" style="margin-left: 5px">
  113. {{ advanced ? '收起' : '展开' }}
  114. <a-icon :type="advanced ? 'up' : 'down'"/>
  115. </a>
  116. </a-col>
  117. </a-row>
  118. </a-form>
  119. <a-alert type="info" style="margin-bottom:10px">
  120. <div slot="message">
  121. 订单总金额:{{ countData&&countData.orderAmount||0 }}元;
  122. 收款总金额:{{ countData&&countData.receiptAmount||0 }}元;
  123. 使用授信总金额:{{ countData&&countData.useCreditAmount||0 }}元;
  124. 授信还款总金额:{{ countData&&countData.payCreditAmount||0 }}元;
  125. 余款抵扣总金额:{{ countData&&countData.balanceAmount||0 }}元;
  126. 跨月打款总金额:{{ countData&&countData.nextMonthAmount||0 }}元;
  127. </div>
  128. </a-alert>
  129. </div>
  130. <!-- 列表 -->
  131. <s-table
  132. class="sTable fixPagination"
  133. ref="table"
  134. :style="{ height: tableHeight+84.5+'px' }"
  135. size="small"
  136. :rowKey="(record) => record.id"
  137. :columns="columns"
  138. :data="loadData"
  139. :scroll="{ y: tableHeight }"
  140. bordered>
  141. <!-- 开票日期 -->
  142. <template slot="draftDate" slot-scope="text, record">
  143. <div @click="handleInvoice(record)">
  144. <span v-if="record.invoiceDate" class="link-bule">{{ record.invoiceDate }}</span>
  145. <span class="link-bule" v-else>--</span>
  146. </div>
  147. </template>
  148. <!-- 收款打印状态 -->
  149. <template slot="printStatus" slot-scope="text, record">
  150. <span v-if="record.printStatus=='NO_PRINT' || record.printStatus=='PRINT'">{{ record.printStatusDictValue }}</span>
  151. <span @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStatusDictValue }}</span>
  152. </template>
  153. <!-- 备注 -->
  154. <template slot="note" slot-scope="text, record">
  155. <div @click="handleNote(record)">
  156. <span class="link-bule">{{ record.remarks || '--' }}</span>
  157. </div>
  158. </template>
  159. </s-table>
  160. </a-spin>
  161. <!-- 开票日期弹窗 -->
  162. <invoiceModal v-drag :show="invoiceIsShow" :info="invoiceInfo" @cancel="cancel"></invoiceModal>
  163. <!-- 备注弹窗 -->
  164. <noteModal ref="remarksModal" v-drag :show="noteIsShow" @cancel="cancel"></noteModal>
  165. <!-- 收款打印状态 -->
  166. <printModal v-drag :show="printIsShow" :info="printInfo" @cancel="cancel"></printModal>
  167. </a-card>
  168. </template>
  169. <script>
  170. import { commonMixin } from '@/utils/mixin'
  171. import { STable, VSelect } from '@/components'
  172. import getDate from '@/libs/getDate.js'
  173. import rangeDate from '@/views/common/rangeDate.vue'
  174. import subarea from '@/views/common/subarea.js'
  175. import Area from '@/views/common/area.js'
  176. import { hdExportExcel } from '@/libs/exportExcel'
  177. import employee from '../../expenseManagement/expenseReimbursement/employee.js'
  178. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  179. import invoiceModal from './invoiceModal.vue'
  180. import noteModal from './noteModal.vue'
  181. import printModal from './printModal.vue'
  182. import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportDetailCount } from '@/api/financeBook.js'
  183. export default {
  184. name: 'CollectionDetailStaticList',
  185. mixins: [commonMixin],
  186. components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area, invoiceModal, noteModal, printModal },
  187. data () {
  188. return {
  189. spinning: false,
  190. exportLoading: false,
  191. tableHeight: 0,
  192. queryParam: { // 查询条件
  193. bookNo: '',
  194. auditBeginDate: getDate.getCurrMonthDays().starttime,
  195. auditEndDate: getDate.getCurrMonthDays().endtime,
  196. receiptBeginDate: '',
  197. receiptEndDate: '',
  198. applyPersonSn: undefined,
  199. payerName: undefined,
  200. kdMidCustomerFnumber: '',
  201. payerAccountInfo: '',
  202. fullPaymentFlag: undefined,
  203. bankAccount: undefined,
  204. bankName: undefined,
  205. subareaSn: undefined,
  206. provinceSn: undefined,
  207. invoiceDateType: undefined
  208. },
  209. invoiceIsShow: false,
  210. noteIsShow: false,
  211. printIsShow: false,
  212. disabled: false, // 查询、重置按钮是否可操作
  213. receiptDate: [], // 收款时间
  214. auditDate: [
  215. getDate.getCurrMonthDays().starttime,
  216. getDate.getCurrMonthDays().endtime
  217. ], // 审核时间
  218. advanced: false,
  219. // 加载数据方法 必须为 Promise 对象
  220. loadData: parameter => {
  221. this.disabled = true
  222. this.spinning = true
  223. const params = Object.assign(parameter, this.queryParam)
  224. return financeBookDetailQueryPage(params).then(res => {
  225. let data
  226. if (res.status == 200) {
  227. data = res.data
  228. const no = (data.pageNo - 1) * data.pageSize
  229. for (var i = 0; i < data.list.length; i++) {
  230. data.list[i].no = no + i + 1
  231. }
  232. this.total = data.count || 0
  233. this.disabled = false
  234. }
  235. this.spinning = false
  236. this.getCount(params)
  237. return data
  238. })
  239. },
  240. total: 0, // 合计
  241. countData: null,
  242. bankList: [
  243. {
  244. bankAccount: '张丽友',
  245. bankName: ['建设银行', '微信收款']
  246. },
  247. {
  248. bankAccount: '张丽添',
  249. bankName: ['农业银行']
  250. },
  251. {
  252. bankAccount: '东莞箭冠',
  253. bankName: ['东莞银行']
  254. },
  255. {
  256. bankAccount: '江西箭冠',
  257. bankName: ['九江银行']
  258. }
  259. ],
  260. bankNameList: [],
  261. invoiceInfo: null,
  262. printInfo: null
  263. }
  264. },
  265. // 根据权限显示列表字段
  266. computed: {
  267. columns () {
  268. const arr = [
  269. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  270. { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  271. { title: '收款单号', dataIndex: 'bookNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  272. { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' }, ellipsis: true },
  273. { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  274. { title: '收款日期', dataIndex: 'receiptDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  275. { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  276. { title: '付款方', dataIndex: 'payerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  277. { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  278. { title: '付款账户(营业执照)', dataIndex: 'payerAccountInfo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  279. { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  280. { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  281. { title: '使用授信', dataIndex: 'useCreditAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  282. { title: '授信还款', dataIndex: 'payCreditAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  283. { title: '余款抵扣', dataIndex: 'balanceAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  284. { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  285. { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  286. { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  287. { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  288. { title: '说明', dataIndex: 'explainInfo', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
  289. { title: '开票日期', scopedSlots: { customRender: 'draftDate' }, align: 'center', width: '8%' },
  290. { title: '收款打印状态', scopedSlots: { customRender: 'printStatus' }, align: 'center', width: '8%' },
  291. { title: '备注', scopedSlots: { customRender: 'note' }, align: 'center', width: '8%' }
  292. ]
  293. return arr
  294. }
  295. },
  296. methods: {
  297. // 关闭弹窗刷新表格
  298. cancel () {
  299. this.invoiceIsShow = false
  300. this.noteIsShow = false
  301. this.printIsShow = false
  302. this.$refs.table.refresh(true)
  303. },
  304. getCount (params) {
  305. financeBookReportDetailCount(params).then(res => {
  306. this.countData = res.data
  307. })
  308. },
  309. handleChange (v) {
  310. if (v) {
  311. const row = this.bankList.find(item => item.bankAccount == v)
  312. this.bankNameList = row.bankName
  313. this.queryParam.bankName = undefined
  314. } else {
  315. this.queryParam.bankAccount = undefined
  316. this.queryParam.bankName = undefined
  317. }
  318. },
  319. // 创建时间 change
  320. receiptDateChange (date) {
  321. this.queryParam.receiptBeginDate = date[0] ? date[0] : ''
  322. this.queryParam.receiptEndDate = date[1] ? date[1] : ''
  323. },
  324. // 审核时间 change
  325. dateAuditChange (date) {
  326. this.queryParam.auditBeginDate = date[0] ? date[0] : ''
  327. this.queryParam.auditEndDate = date[1] ? date[1] : ''
  328. },
  329. // 重置
  330. resetSearchForm () {
  331. this.receiptDate = []
  332. this.queryParam.receiptBeginDate = ''
  333. this.queryParam.receiptEndDate = ''
  334. this.$refs.receiptDate.resetDate(this.receiptDate)
  335. this.auditDate = [
  336. getDate.getCurrMonthDays().starttime,
  337. getDate.getCurrMonthDays().endtime
  338. ]
  339. this.$refs.rangeAuditDate.resetDate(this.auditDate)
  340. this.queryParam.auditBeginDate = getDate.getCurrMonthDays().starttime
  341. this.queryParam.auditEndDate = getDate.getCurrMonthDays().endtime
  342. this.queryParam.bookNo = ''
  343. this.queryParam.dispatchBillNo = ''
  344. this.queryParam.applyPersonSn = undefined
  345. this.queryParam.kdMidCustomerFnumber = ''
  346. this.queryParam.payerName = undefined
  347. this.queryParam.payerAccountInfo = ''
  348. this.queryParam.fullPaymentFlag = undefined
  349. this.queryParam.bankName = undefined
  350. this.queryParam.bankAccount = undefined
  351. this.queryParam.subareaSn = undefined
  352. this.queryParam.provinceSn = undefined
  353. this.queryParam.invoiceDateType = undefined
  354. this.$refs.table.refresh(true)
  355. },
  356. // 导出
  357. handleExport () {
  358. const _this = this
  359. _this.exportLoading = true
  360. _this.spinning = true
  361. hdExportExcel(financeBookDetailExport, _this.queryParam, '财务收款明细统计', function () {
  362. _this.exportLoading = false
  363. _this.spinning = false
  364. })
  365. },
  366. pageInit () {
  367. const _this = this
  368. this.$nextTick(() => { // 页面渲染完成后的回调
  369. _this.setTableH()
  370. })
  371. },
  372. setTableH () {
  373. const tableSearchH = this.$refs.tableSearch.offsetHeight
  374. this.tableHeight = window.innerHeight - tableSearchH - 205
  375. },
  376. handleInvoice (con) {
  377. const obj = {
  378. no: con.bookNo,
  379. payerName: con.payerName,
  380. bookDetailSn: con.bookDetailSn
  381. }
  382. this.invoiceInfo = obj
  383. this.$nextTick(() => {
  384. this.invoiceIsShow = true
  385. })
  386. },
  387. // 修改备注
  388. handleNote (info) {
  389. const obj = {
  390. no: info.bookNo,
  391. payerName: info.payerName,
  392. id: info.id,
  393. remarks: info.remarks ? info.remarks : ''
  394. }
  395. this.noteIsShow = true
  396. const _this = this
  397. _this.$nextTick(() => {
  398. _this.$refs.remarksModal.setData(JSON.stringify(obj))
  399. })
  400. },
  401. handlePrint (item) {
  402. const obj = {
  403. no: item.bookNo,
  404. payerName: item.payerName,
  405. id: item.id,
  406. printStatus: item.printStatus
  407. }
  408. this.printInfo = obj
  409. this.$nextTick(() => {
  410. this.printIsShow = true
  411. })
  412. }
  413. },
  414. watch: {
  415. advanced (newValue, oldValue) {
  416. const _this = this
  417. this.$nextTick(() => { // 页面渲染完成后的回调
  418. _this.setTableH()
  419. })
  420. },
  421. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  422. this.setTableH()
  423. }
  424. },
  425. mounted () {
  426. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  427. this.pageInit()
  428. this.resetSearchForm()
  429. }
  430. },
  431. activated () {
  432. // 如果是新页签打开,则重置当前页面
  433. if (this.$store.state.app.isNewTab) {
  434. this.pageInit()
  435. this.resetSearchForm()
  436. }
  437. // 仅刷新列表,不重置页面
  438. if (this.$store.state.app.updateList) {
  439. this.pageInit()
  440. this.$refs.table.refresh()
  441. }
  442. },
  443. beforeRouteEnter (to, from, next) {
  444. next(vm => {})
  445. }
  446. }
  447. </script>
  448. <style lang="less">
  449. .collectionDetail-wrap{
  450. .active{
  451. color: #ed1c24;
  452. cursor: pointer;
  453. }
  454. .common{
  455. color: rgba(0, 0, 0);
  456. }
  457. }
  458. </style>