|
|
@@ -0,0 +1,150 @@
|
|
|
+import React, { useState } from 'react'
|
|
|
+import BasicTable from '@/components/Table'
|
|
|
+import { queryInvoiceReceivablesList } from '@/services/statistic'
|
|
|
+import consts from '@/consts'
|
|
|
+import dayjs from 'dayjs'
|
|
|
+import { Checkbox, DatePicker, Select, Space } from 'antd'
|
|
|
+import OptionSelect from '../../components/OptionSelect'
|
|
|
+import { disabledDate } from '@/utils/utils'
|
|
|
+
|
|
|
+export const collectedTypeEnum = {
|
|
|
+ UNSTART: 0, // 未启动
|
|
|
+ START: 1 // 启动
|
|
|
+}
|
|
|
+const { Option } = Select
|
|
|
+const { RangePicker } = DatePicker
|
|
|
+
|
|
|
+const InvoiceReceivables = () => {
|
|
|
+ const [state, setState] = useState({
|
|
|
+ params: {
|
|
|
+ optionType: 'singleStaff',
|
|
|
+ dataIds: [],
|
|
|
+ uncollected: collectedTypeEnum.UNSTART,
|
|
|
+ startMonth: [dayjs(new Date()), dayjs(new Date())]
|
|
|
+ },
|
|
|
+ list: []
|
|
|
+ })
|
|
|
+ const handleOptionChange = (type, ids) =>
|
|
|
+ setState({
|
|
|
+ ...state,
|
|
|
+ params: { ...state.params, optionType: type, dataIds: ids }
|
|
|
+ })
|
|
|
+ const handleCheckOnChange = checked => {
|
|
|
+ if (checked) {
|
|
|
+ setState({ ...state, params: { ...state.params, uncollected: collectedTypeEnum.START } })
|
|
|
+ } else {
|
|
|
+ setState({ ...state, params: { ...state.params, uncollected: collectedTypeEnum.UNSTART } })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ dataIndex: 'userName',
|
|
|
+ title: '申请人',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'invoiceSerial',
|
|
|
+ title: '开票流水号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'options',
|
|
|
+ title: '状态',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'invoiceCompany',
|
|
|
+ title: '开票单位',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'options',
|
|
|
+ title: '发票形式',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'options',
|
|
|
+ title: '发票类型',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'invoicePrice',
|
|
|
+ title: '开票金额',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'invoiceElement',
|
|
|
+ title: '开票内容',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'irid',
|
|
|
+ title: '发票号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'options',
|
|
|
+ title: '发票申请时间',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'receivablesSerial',
|
|
|
+ title: '收款流水号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'bindPrice',
|
|
|
+ title: '已收款金额',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'options',
|
|
|
+ title: '应收款金额',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'bindDate',
|
|
|
+ title: '入账时间',
|
|
|
+ align: 'center'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ return (
|
|
|
+ <div className="flex flex-col">
|
|
|
+ <BasicTable
|
|
|
+ rowkey="iid"
|
|
|
+ search={false}
|
|
|
+ columns={columns}
|
|
|
+ pagination={false}
|
|
|
+ bordered
|
|
|
+ params={state.params}
|
|
|
+ toolbar={{
|
|
|
+ title: <OptionSelect onChange={handleOptionChange} type="InvoiceReceivables" multiple={false} />,
|
|
|
+ actions: [
|
|
|
+ <Space key="iid">
|
|
|
+ <DatePicker.RangePicker
|
|
|
+ picker="month"
|
|
|
+ allowClear={false}
|
|
|
+ key="DatePicker"
|
|
|
+ disabledDate={current => disabledDate(current, 'month')}
|
|
|
+ value={state.params.startMonth}
|
|
|
+ onChange={val => setState({ ...state, params: { ...state.params, startMonth: val } })}
|
|
|
+ />
|
|
|
+ <Checkbox onChange={e => handleCheckOnChange(e.target.checked)}>截止申请时间未收款</Checkbox>
|
|
|
+ </Space>
|
|
|
+ ]
|
|
|
+ }}
|
|
|
+ request={async params => {
|
|
|
+ const { code = -1, data = [] } = await queryInvoiceReceivablesList({ ...params })
|
|
|
+ setState({ ...state, data })
|
|
|
+ return {
|
|
|
+ data,
|
|
|
+ success: code === consts.RET_CODE.SUCCESS
|
|
|
+ // total: list?.length || 0
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+export default InvoiceReceivables
|