diff --git a/.umirc.ts b/.umirc.ts index 6728616..3cc3f6a 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -58,6 +58,20 @@ export default defineConfig({ icon: 'BookOutlined', access: 'canReadAdminAndFinance', }, + /*{ + name: '发票管理', + path: '/Invoice', + icon: 'BookOutlined', + access: 'canReadAdminAndFinance', + routes:[ + { + name: '权限管理', + path: 'authrity', + icon: 'BookOutlined', + component: './Invoice/InvoiceRecord' }, + ] + },*/ + { name: '预存管理', path: '/prepaidManage', @@ -91,7 +105,7 @@ export default defineConfig({ path: '/client', component: './Client', icon: 'BookOutlined', - access: 'canReadAdmin', + access: 'canReadAdminAndSales', }, { name: '打印', diff --git a/src/pages/Client/Components/ClientStatistic.tsx b/src/pages/Client/Components/ClientStatistic.tsx new file mode 100644 index 0000000..42eaa88 --- /dev/null +++ b/src/pages/Client/Components/ClientStatistic.tsx @@ -0,0 +1,30 @@ +import { postAdminClientGetStatisticalData } from '@/services'; +import { StatisticCard } from '@ant-design/pro-components'; +import { useEffect, useState } from 'react'; + +export default () => { + const [clientStatistic, setClientStatistic] = useState([]); + useEffect(() => { + const pullStatistic = async () => { + let statisticalData = await postAdminClientGetStatisticalData(); + console.log('stati' + JSON.stringify(statisticalData.data)); + setClientStatistic(statisticalData.data); + }; + pullStatistic(); + }, []); + return ( + <StatisticCard.Group> + {clientStatistic.map((stat, index) => ( + <StatisticCard + key={index} + statistic={{ + title: stat.title, + tip: stat.tip || '', // 如果tip不存在,则使用空字符串 + value: stat.value, + status: stat.status || 'default', // 如果status不存在,则使用'default' + }} + /> + ))} + </StatisticCard.Group> + ); +}; diff --git a/src/pages/Client/index.tsx b/src/pages/Client/index.tsx index ede7343..11dff4e 100644 --- a/src/pages/Client/index.tsx +++ b/src/pages/Client/index.tsx @@ -1,8 +1,10 @@ import ClientDrawer from '@/pages/Client/Components/ClientDrawer'; import ClientImportModal from '@/pages/Client/Components/ClientImportModal'; +import ClientStatistic from '@/pages/Client/Components/ClientStatistic'; import CommunicationHistoryModal from '@/pages/Client/Components/CommunicationHistoryModal'; import { postAdminClientQueryClientPage, + postServiceConstClientGroupFilters, postServiceConstClientLevels, postServiceConstTradeStatus, } from '@/services'; @@ -10,42 +12,48 @@ import { orderExport } from '@/services/order'; import { enumToSelect } from '@/utils'; import type { ActionType } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components'; -import { Button, message } from 'antd'; -import { useRef } from 'react'; +import { Button, Radio, Space, message } from 'antd'; +import { useEffect, useRef, useState } from 'react'; const columns = [ { dataIndex: 'index', valueType: 'indexBorder', + ellipsis: true, width: 48, }, { title: '客户名称', dataIndex: 'name', width: 100, + ellipsis: true, hideInSearch: true, }, { title: '单位名称', width: 150, + ellipsis: true, dataIndex: 'companyName', hideInSearch: true, }, { title: '单位地址', width: 250, + ellipsis: true, dataIndex: 'companyAddressText', hideInSearch: true, }, { title: '联系电话', width: 150, + ellipsis: true, dataIndex: 'phoneNumber', hideInSearch: true, }, { title: '客户来源', width: 150, + ellipsis: true, dataIndex: 'source', hideInSearch: true, }, @@ -53,17 +61,20 @@ const columns = [ title: '推荐人', dataIndex: 'referrers', width: 150, + ellipsis: true, hideInSearch: true, }, { title: '客户需求', dataIndex: 'requirements', width: 150, + ellipsis: true, hideInSearch: true, }, { title: '是否已报方案', width: 150, + ellipsis: true, dataIndex: 'hasSchemeText', hideInSearch: true, }, @@ -71,6 +82,7 @@ const columns = [ title: '报价时间', key: 'since', width: 150, + ellipsis: true, dataIndex: 'quoteDatetime', valueType: 'dateTime', hideInSearch: true, @@ -78,12 +90,14 @@ const columns = [ { title: '跟进状态', width: 150, + ellipsis: true, dataIndex: 'tradeStatusText', hideInSearch: true, }, { title: '客户等级', width: 150, + ellipsis: true, dataIndex: 'levelText', hideInSearch: true, }, @@ -91,6 +105,7 @@ const columns = [ title: '创建时间', key: 'since', width: 150, + ellipsis: true, dataIndex: 'createTime', valueType: 'dateTime', hideInSearch: true, @@ -99,6 +114,7 @@ const columns = [ title: '最新跟进时间', key: 'since', width: 150, + ellipsis: true, dataIndex: 'latestCommunicationTime', valueType: 'dateTime', hideInSearch: true, @@ -207,101 +223,128 @@ const columns = [ export default () => { const [messageApi, contextHolder] = message.useMessage(); + const [groupFilter, setGroupFilter] = useState('All'); + const [groupFilterOptions, setGroupFilterDataOptions] = useState([]); const actionRef = useRef<ActionType>(); + useEffect(() => { + const pullGroupFilterDataOptions = async () => { + const res = await postServiceConstClientGroupFilters(); + console.log('setGroupFilterDataOptions' + JSON.stringify(res.data)); + setGroupFilterDataOptions(enumToSelect(res.data)); + }; + pullGroupFilterDataOptions(); + }, []); + useEffect(() => { + actionRef.current?.reload(); + }, [groupFilter]); return ( <> - <ProTable - columns={columns} - actionRef={actionRef} - cardBordered - request={async (params) => { - const res = await postAdminClientQueryClientPage({ - data: { - ...params, + <Space direction="vertical" size="middle" style={{ display: 'flex' }}> + <ClientStatistic></ClientStatistic> + <ProTable + columns={columns} + actionRef={actionRef} + cardBordered + request={async (params) => { + const res = await postAdminClientQueryClientPage({ + data: { + ...params, + groupFilter: groupFilter, + }, + }); + const data = res.data; + return data; + }} + search={{ + defaultCollapsed: false, + optionRender: (searchConfig, formProps, dom) => [ + ...dom.reverse(), + <Button + key="out" + onClick={() => { + const values = searchConfig?.form?.getFieldsValue(); + messageApi.open({ + type: 'loading', + content: '导出中...', + duration: 0, + }); + orderExport( + '/api/admin/client/exportClients', + '客户信息.xlsx', + 'POST', + values, + () => { + messageApi.destroy(); + }, + ); + }} + > + 导出 + </Button>, + ], + }} + scroll={{ + x: 1400, + }} + editable={{ + type: 'multiple', + }} + columnsState={{ + persistenceKey: 'pro-table-singe-demos', + persistenceType: 'localStorage', + defaultValue: { + option: { fixed: 'right', disable: true }, + }, + onChange(value) { + console.log('value: ', value); }, - }); - const data = res.data; - return data; - }} - search={{ - defaultCollapsed: false, - optionRender: (searchConfig, formProps, dom) => [ - ...dom.reverse(), - <Button - key="out" - onClick={() => { - const values = searchConfig?.form?.getFieldsValue(); - messageApi.open({ - type: 'loading', - content: '导出中...', - duration: 0, - }); - orderExport( - '/api/admin/client/exportClients', - '客户信息.xlsx', - 'POST', - values, - () => { - messageApi.destroy(); - }, - ); + }} + rowKey="id" + options={{ + setting: { + listsHeight: 400, + }, + }} + form={{ + // 由于配置了 transform,提交的参与与定义的不同这里需要转化一下 + syncToUrl: (values, type) => { + if (type === 'get') { + return { + ...values, + created_at: [values.startTime, values.endTime], + }; + } + return values; + }, + }} + pagination={{ + pageSize: 5, + onChange: (page) => console.log(page), + }} + dateFormatter="string" + headerTitle="高级表格" + toolBarRender={() => [ + <div key={'groupFilter'}> + <Radio.Group + options={groupFilterOptions} + onChange={(e) => { + setGroupFilter(e.target.value); + }} + value={groupFilter} + optionType="button" + /> + </div>, + <ClientDrawer + optType={'add'} + key="button" + onFinish={() => { + actionRef.current.reload(); }} - > - 导出 - </Button>, - ], - }} - scroll={{ - x: 1400, - }} - editable={{ - type: 'multiple', - }} - columnsState={{ - persistenceKey: 'pro-table-singe-demos', - persistenceType: 'localStorage', - defaultValue: { - option: { fixed: 'right', disable: true }, - }, - onChange(value) { - console.log('value: ', value); - }, - }} - rowKey="id" - options={{ - setting: { - listsHeight: 400, - }, - }} - form={{ - // 由于配置了 transform,提交的参与与定义的不同这里需要转化一下 - syncToUrl: (values, type) => { - if (type === 'get') { - return { - ...values, - created_at: [values.startTime, values.endTime], - }; - } - return values; - }, - }} - pagination={{ - pageSize: 5, - onChange: (page) => console.log(page), - }} - dateFormatter="string" - headerTitle="高级表格" - toolBarRender={() => [ - <ClientDrawer - optType={'add'} - key="button" - onFinish={() => { - actionRef.current.reload(); - }} - ></ClientDrawer>, - <ClientImportModal key="import" />, - ]} - /> + ></ClientDrawer>, + <ClientImportModal key="import" />, + ]} + /> + </Space> {contextHolder} </> ); diff --git a/src/pages/Invoice/InvoiceRecord/index.less b/src/pages/Invoice/InvoiceRecord/index.less new file mode 100644 index 0000000..d937407 --- /dev/null +++ b/src/pages/Invoice/InvoiceRecord/index.less @@ -0,0 +1,20 @@ +.invoice-index td { + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', + 'WenQuanYi Micro Hei', sans-serif; + font-size: 14px; +} + +.invoice-detail td { + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', + 'WenQuanYi Micro Hei', sans-serif; + font-size: 14px; +} + +.bank-statement-choose td { + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', + 'WenQuanYi Micro Hei', sans-serif; + font-size: 14px; +} diff --git a/src/pages/Invoice/InvoiceRecord/index.tsx b/src/pages/Invoice/InvoiceRecord/index.tsx new file mode 100644 index 0000000..a6992ab --- /dev/null +++ b/src/pages/Invoice/InvoiceRecord/index.tsx @@ -0,0 +1,1176 @@ +import ButtonConfirm from '@/components/ButtomConfirm'; +import EllipsisDiv from '@/components/Div/EllipsisDiv'; +import { RESPONSE_CODE } from '@/constants/enum'; +import AddInvoiceDrawerForm from '@/pages/Invoice/components/AddInvoiceDrawerForm'; +import BankImportModal from '@/pages/Invoice/components/BankImportModal'; +import InvoiceModal from '@/pages/Invoice/components/InvoiceModal'; +import InvoiceRecordDetailModal from '@/pages/Invoice/components/InvoiceRecordDetailModal'; +import InvoiceVerificationModal from '@/pages/Invoice/components/InvoiceVerificationModal'; +import InvoicingModal from '@/pages/Invoice/components/InvoicingModal'; +import ManualInvoicingModal from '@/pages/Invoice/components/ManualInvoicingModal'; +import { + BANK_STATEMENT_COLUMNS, + INVOICE_COLUMNS, + INVOICE_STATUS, +} from '@/pages/Invoice/constant'; +import { INVOCING_STATUS, PAYEE_OPTIONS } from '@/pages/Order/constant'; +import { + postServiceBankStatementDeleteBankStatement, + postServiceBankStatementEditBankStatement, + postServiceBankStatementQueryBankStatement, + postServiceConstAfterInvoicingInvoiceRecordStatus, + postServiceConstBeforeInvoicingInvoiceRecordStatus, + postServiceConstInvoiceType, + postServiceConstInvoicingType, + postServiceInvoiceDeleteInvoice, + postServiceInvoiceInvoicing, + postServiceInvoiceQueryInvoice, + postServiceInvoiceQueryInvoiceRecordList, + postServiceOrderQuerySalesCode, +} from '@/services'; +import { excelExport } from '@/services/exportRequest'; +import { + enumToProTableEnumValue, + enumToSelect, + enumValueToLabel, + formatDateTime, +} from '@/utils'; +import { formatDate } from '@/utils/time'; +import { PlusOutlined } from '@ant-design/icons'; +import { ActionType, ModalForm, ProTable } from '@ant-design/pro-components'; +import { Button, Space, Table, Tabs, message } from 'antd'; +import { useEffect, useRef, useState } from 'react'; + +const InvoiceRecord = () => { + const invoiceActionRef = useRef<ActionType>(); + const bankActionRef = useRef<ActionType>(); + const waitDealrecordActionRef = useRef<ActionType>(); + const processedRecordRef = useRef<ActionType>(); + const [invoiceTypeValueEnum, setInvoiceTypeValueEnum] = useState({}); + const [invoicingTypeValueEnum, setInvoicingTypeValueEnum] = useState({}); + const [salesCodeValueEnum, setSalesCodeValueEnum] = useState({}); + const [bankImportModalVisible, setBankImportModalVisible] = useState(false); + const [invoiceVerificationVisible, setInvoiceVerificationVisible] = + useState(false); + const [invoiceId, setInvoiceId] = useState(undefined); + const [invoiceRecordDetailVisible, setInvoiceRecordDetailVisible] = + useState(false); + const [invoiceRecord, setInvoiceRecord] = useState({}); + const [messageApi, contextHolder] = message.useMessage(); + + useEffect(() => { + async function extracted() { + let invoiceTypeRet = await postServiceConstInvoiceType(); + setInvoiceTypeValueEnum(invoiceTypeRet.data); + } + + extracted().catch(console.error); + }, []); + + useEffect(() => { + async function extracted() { + let invoicingTypeRet = await postServiceConstInvoicingType(); + setInvoicingTypeValueEnum(invoicingTypeRet.data); + } + + extracted().catch(console.error); + }, []); + + useEffect(() => { + async function extracted() { + const res = await postServiceOrderQuerySalesCode(); + let map = {}; + res.data?.forEach((item) => { + map[item.userName] = { + text: item.userName, + status: item.userName, + }; + }); + setSalesCodeValueEnum(map); + } + + extracted().catch(console.error); + }, []); + + const reloadInvoiceTable = () => { + invoiceActionRef.current?.reload(); + }; + + const reloadBankStatementTable = () => { + bankActionRef.current?.reload(); + }; + const reloadRecordTable = () => { + waitDealrecordActionRef.current?.reload(); + processedRecordRef.current?.reload(); + }; + + const getTableCellText = (target: any) => { + if (!target) { + return ''; + } + + if (target.props) { + return target.props.text; + } + + return target; + }; + + const waitDealRecordColumns = [ + { + dataIndex: 'index', + valueType: 'indexBorder', + hideInSearch: true, + ellipsis: true, + width: 48, + }, + { + title: '开票编号', + valueType: 'text', + dataIndex: 'id', + copyable: true, + hideInSearch: true, + ellipsis: true, + width: 100, + }, + { + title: '发票状态', + valueType: 'Text', + dataIndex: 'statusText', + ellipsis: true, + hideInSearch: true, + }, + { + title: '申请开票时间', + dataIndex: 'createTime', + valueType: 'dateTime', + hideInSearch: true, + ellipsis: true, + }, + { + title: '销售代表', + valueType: 'text', + hideInSearch: true, + ellipsis: true, + dataIndex: 'createByName', + }, + { + title: '购方名称', + valueType: 'text', + dataIndex: 'partyAName', + hideInSearch: true, + ellipsis: true, + }, + { + title: '购方税号', + valueType: 'text', + hideInSearch: true, + dataIndex: 'partyATaxid', + ellipsis: true, + }, + { + title: '收款单位', + valueType: 'text', + hideInSearch: true, + dataIndex: 'partyBName', + ellipsis: true, + }, + { + title: '开票金额', + valueType: 'money', + dataIndex: 'price', + hideInSearch: true, + ellipsis: true, + }, + { + title: '开具类型', + valueType: 'Text', + dataIndex: 'invoicingTypeText', + hideInSearch: true, + ellipsis: true, + }, + { + title: '发票类型', + valueType: 'Text', + dataIndex: 'typeText', + hideInSearch: true, + ellipsis: true, + }, + { + title: '是否加急', + valueType: 'Text', + dataIndex: 'isUrgentText', + hideInSearch: true, + ellipsis: true, + }, + { + title: '申请备注', + valueType: 'text', + dataIndex: 'applyInvoicingNotes', + hideInSearch: true, + ellipsis: true, + }, + { + title: '购方名称', + valueType: 'Text', + dataIndex: 'partyANameLike', + hideInTable: true, + }, + { + title: '收款单位', + valueType: 'select', + dataIndex: 'partyB', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: enumToProTableEnumValue(PAYEE_OPTIONS), + }, + { + title: '主订单号', + valueType: 'Text', + dataIndex: 'mainOrderId', + hideInTable: true, + }, + { + title: '子订单号', + valueType: 'Text', + dataIndex: 'subOrderId', + hideInTable: true, + }, + { + title: '销售代表', + valueType: 'select', + dataIndex: 'salesCode', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: salesCodeValueEnum, + }, + { + title: '发票类型', + valueType: 'select', + dataIndex: 'type', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: enumToProTableEnumValue(invoiceTypeValueEnum), + }, + { + title: '开具类型', + valueType: 'select', + dataIndex: 'invoicingType', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: enumToProTableEnumValue(invoicingTypeValueEnum), + }, + { + title: '开票状态', + valueType: 'select', + dataIndex: 'status', + filters: true, + onFilter: true, + hideInTable: true, + request: async () => { + const res = await postServiceConstBeforeInvoicingInvoiceRecordStatus(); + return enumToSelect(res.data); + }, + }, + { + title: '是否加急', + valueType: 'select', + dataIndex: 'isUrgent', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: { + true: { + text: '是', + status: true, + }, + false: { + text: '否', + status: false, + }, + }, + }, + { + title: '申请开票时间', + dataIndex: 'createTime', + valueType: 'dateTimeRange', + width: 200, + hideInTable: true, + search: { + transform: (value) => { + if (value) { + return { + createTimeGe: value[0], + createTimeLe: value[1], + }; + } + }, + }, + }, + { + title: '操作', + valueType: 'option', + key: 'option', + render: (text, record) => { + return [ + /*<InvoiceRecordDetailModal + key="detail" + id={record.id} + subOrderIds={record.subOrderIds} + onClose={()=>{ + waitDealrecordActionRef.current?.reload(); + } + } + />*/ + <> + {record.paths.includes('DETAIL') && ( + <a + key="detail" + onClick={() => { + setInvoiceRecordDetailVisible(true); + setInvoiceRecord(record); + }} + > + 详情 + </a> + )} + </>, + <> + {record.paths.includes('PREVIEW') && ( + <InvoiceModal key="invoiceModal" recordId={record.id} /> + )} + </>, + <> + {record.paths.includes('INVOICING') && ( + <ManualInvoicingModal + key={'ManualInvoicingModal'} + record={record} + ></ManualInvoicingModal> + )} + </>, + ]; + }, + }, + ]; + + const processedRecordColumns = [ + { + dataIndex: 'index', + valueType: 'indexBorder', + }, + { + title: '开票编号', + valueType: 'text', + dataIndex: 'id', + copyable: true, + ellipsis: true, + }, + { + title: '发票号码', + valueType: 'text', + dataIndex: 'invoiceNumber', + copyable: true, + ellipsis: true, + }, + { + title: '开票日期', + dataIndex: 'invoicingDate', + valueType: 'date', + hideInSearch: true, + ellipsis: true, + }, + { + title: '发票类型', + valueType: 'Text', + dataIndex: 'typeText', + hideInSearch: true, + ellipsis: true, + }, + { + title: '发票状态', + valueType: 'Text', + dataIndex: 'statusText', + hideInSearch: true, + ellipsis: true, + }, + { + title: '购方名称', + valueType: 'text', + dataIndex: 'partyAName', + hideInSearch: true, + ellipsis: true, + }, + { + title: '购方税号', + valueType: 'text', + dataIndex: 'partyATaxid', + ellipsis: true, + }, + { + title: '收款单位', + valueType: 'text', + dataIndex: 'partyBName', + hideInSearch: true, + ellipsis: true, + }, + { + title: '联系人', + valueType: 'text', + dataIndex: 'contacts', + hideInSearch: true, + ellipsis: true, + }, + { + title: '申请人', + valueType: 'text', + dataIndex: 'createByName', + hideInSearch: true, + ellipsis: true, + }, + { + title: '开票金额(元)', + valueType: 'money', + dataIndex: 'price', + hideInSearch: true, + ellipsis: true, + }, + { + title: '备注', + valueType: 'text', + dataIndex: 'contacts', + hideInSearch: true, + ellipsis: true, + }, + { + title: '失败原因', + valueType: 'text', + dataIndex: 'failureReason', + hideInSearch: true, + ellipsis: true, + }, + + { + title: '购方名称', + valueType: 'text', + dataIndex: 'partyANameLike', + hideInTable: true, + }, + { + title: '发票类型', + valueType: 'select', + dataIndex: 'type', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: enumToProTableEnumValue(invoiceTypeValueEnum), + }, + + { + title: '开票状态', + valueType: 'select', + dataIndex: 'status', + filters: true, + onFilter: true, + hideInTable: true, + request: async () => { + const res = await postServiceConstAfterInvoicingInvoiceRecordStatus(); + return enumToSelect(res.data); + }, + }, + { + title: '销售代表', + valueType: 'select', + dataIndex: 'salesCode', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: salesCodeValueEnum, + }, + { + title: '联系人', + valueType: 'text', + dataIndex: 'contactsLike', + hideInTable: true, + }, + { + title: '开票日期', + dataIndex: 'invoicingDate', + valueType: 'dateRange', + hideInTable: true, + search: { + transform: (value) => { + if (value) { + return { + invoicingDateGe: value[0], + invoicingDateLe: value[1], + }; + } + }, + }, + }, + { + title: '收款单位', + valueType: 'select', + dataIndex: 'partyB', + filters: true, + onFilter: true, + hideInTable: true, + valueEnum: enumToProTableEnumValue(PAYEE_OPTIONS), + }, + { + title: '操作', + valueType: 'option', + key: 'option', + render: (text, record) => [ + <> + {record.status === 'SUCCESS' && record.paths.includes('DETAIL') && ( + <a + key="detail" + onClick={() => { + setInvoiceRecordDetailVisible(true); + setInvoiceRecord(record); + }} + > + 详情 + </a> + )} + </>, + <> + {record.status === 'SUCCESS' && + record.paths.includes('DOWNLOAD_INVOICE') && ( + <a href={record.invoiceAddress} download> + 下载发票 + </a> + )} + </>, + <> + {record.status === 'FAIL' && record.paths.includes('RETRY') && ( + <ModalForm + title="提示" + trigger={ + <Button type="link" danger> + 重试 + </Button> + } + autoFocusFirstInput + modalProps={{ + destroyOnClose: true, + }} + submitTimeout={2000} + onFinish={async () => { + const res = await postServiceInvoiceInvoicing({ + data: { + invoiceRecordIds: [record.id], + }, + }); + if (res) { + message.success(res.message); + processedRecordRef?.current?.reload(); + } + return true; + }} + > + 确定重试订单信息吗? + </ModalForm> + )} + </>, + <> + {record.paths.includes('INVOICING') && ( + <ManualInvoicingModal + key={'ManualInvoicingModal'} + record={record} + ></ManualInvoicingModal> + )} + </>, + ], + }, + ]; + /** + * 加载发票列表表格的各个列格式 + */ + const invoicecColumnsInit = () => { + let columns = INVOICE_COLUMNS.map((item) => { + let newItem = { ...item }; + let dataIndex = item.dataIndex; + let dataType = item.valueType; + + newItem.render = (text, record) => { + let textValue = record[dataIndex]; + + if (dataType === 'dateRange' || dataType === 'date') { + textValue = formatDate(textValue); + } + + if (dataType === 'dateTime') { + textValue = formatDateTime(textValue); + } + + if (dataType === 'money') { + textValue = '¥' + textValue; + } + + switch (dataIndex) { + case 'invoiceStatus': + return ( + <EllipsisDiv + text={enumValueToLabel( + getTableCellText(textValue), + INVOCING_STATUS, + )} + /> + ); + + case 'status': + return ( + <EllipsisDiv + text={enumValueToLabel( + getTableCellText(textValue), + INVOICE_STATUS, + )} + /> + ); + + case 'payee': + return ( + <EllipsisDiv + text={enumValueToLabel( + getTableCellText(textValue), + PAYEE_OPTIONS, + )} + /> + ); + + default: + return <EllipsisDiv text={getTableCellText(textValue)} />; + } + }; + + return newItem; + }); + + columns.push({ + title: '操作', + valueType: 'option', + key: 'option', + fixed: 'right', + width: 120, + render: (text, record) => { + let btns = []; + if (record.path?.includes('writeOff')) { + btns.push( + <a + key="editable" + onClick={() => { + setInvoiceVerificationVisible(true); + setInvoiceId(record.invoiceId); + }} + > + 核销 + </a>, + ); + } + + if (record.path?.includes('queryInvoiceDetails')) { + btns.push( + <Button + className="p-0" + key="view" + type="link" + onClick={() => { + setInvoiceVerificationVisible(true); + setInvoiceId(record.invoiceId); + }} + > + 查看 + </Button>, + ); + } + + if (record.path?.includes('deleteInvoice')) { + btns.push( + <ButtonConfirm + key="delete" + className="p-0" + title={ + '确认删除发票号码为[ ' + record.invoiceNumber + ' ]的发票吗?' + } + text="删除" + onConfirm={async () => { + let res = await postServiceInvoiceDeleteInvoice({ + data: { invoiceId: record.invoiceId }, + }); + if (res) { + message.success(res.message); + reloadInvoiceTable(); + } + }} + />, + ); + } + return btns; + }, + }); + + return columns; + }; + + const bankStatemetColumnsInit = () => { + let columns = BANK_STATEMENT_COLUMNS.map((item) => { + let newItem = { ...item }; + let dataIndex = item.dataIndex; + let dataType = item.valueType; + + newItem.render = (text, record) => { + let textValue = record[dataIndex]; + + if (dataType === 'date') { + textValue = formatDate(textValue); + } + + if (dataType === 'dateTime') { + textValue = formatDateTime(textValue); + } + + if (dataType === 'money') { + if (textValue === null || textValue === undefined) { + textValue = ''; + } else { + textValue = '¥' + textValue; + } + } + + switch (dataIndex) { + case 'invoiceStatus': + return ( + <EllipsisDiv + text={enumValueToLabel( + getTableCellText(textValue), + INVOCING_STATUS, + )} + /> + ); + + case 'status': + return ( + <EllipsisDiv + text={enumValueToLabel( + getTableCellText(textValue), + INVOICE_STATUS, + )} + /> + ); + + case 'payee': + return ( + <EllipsisDiv + text={enumValueToLabel( + getTableCellText(textValue), + PAYEE_OPTIONS, + )} + /> + ); + + default: + return <EllipsisDiv text={getTableCellText(textValue)} />; + } + }; + + return newItem; + }); + + columns.push({ + title: '操作', + valueType: 'option', + key: 'option', + fixed: 'right', + width: 120, + render: (text, record, _, action) => { + let btns = []; + if (record.path?.includes('editBankStatement')) { + btns.push( + <a + key="editable" + onClick={() => { + action?.startEditable?.(record.id); + }} + > + 编辑 + </a>, + ); + } + + if (record.path?.includes('deleteBankStatement')) { + btns.push( + <ButtonConfirm + key="delete" + className="p-0" + title={'是否删除该银行流水记录?'} + text="删除" + onConfirm={async () => { + let res = await postServiceBankStatementDeleteBankStatement({ + data: { id: record.id }, + }); + if (res.result === RESPONSE_CODE.SUCCESS) { + message.success(res.message); + reloadBankStatementTable(); + } + }} + />, + ); + } + return btns; + }, + }); + + return columns; + }; + + const tabsItems = [ + { + key: 1, + label: '待处理', + children: ( + <ProTable + columns={waitDealRecordColumns} + actionRef={waitDealrecordActionRef} + cardBordered + pagination={{ + showSizeChanger: true, // 显示可以选择每页显示条数的下拉菜单 + pageSizeOptions: ['10', '20', '50', '100'], // 设置可以选择的每页显示条数选项 + }} + rowSelection={{ + selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT], + alwaysShowAlert: true, + }} + tableAlertOptionRender={({ selectedRowKeys, selectedRows }) => { + console.log(selectedRows); + console.log(selectedRowKeys); + return ( + <Space size={16}> + <InvoicingModal + reloadRecordTable={reloadRecordTable} + key="button" + selectedRowKeys={selectedRowKeys} + /> + </Space> + ); + }} + request={async (params) => { + let res = await postServiceInvoiceQueryInvoiceRecordList({ + data: { + ...params, + statusIn: [ + 'WAITING_FOR_INVOICING', + 'AUDITING', + 'AUDITING_NOT_PASSED', + 'CANCELED', + ], + needBuildDetails: true, + needBuildSubOrders: true, + }, + }); + return { + data: res?.data?.data, + total: res?.data?.total || 0, + }; + }} + columnsState={{ + persistenceKey: 'pro-table-singe-demos', + persistenceType: 'localStorage', + defaultValue: { + option: { fixed: 'right', disable: true }, + }, + onChange(value) { + console.log('value: ', value); + }, + }} + rowKey="id" + search={{ + labelWidth: 'auto', + }} + options={{ + setting: { + listsHeight: 400, + }, + }} + form={{}} + dateFormatter="string" + headerTitle="待开票列表" + scroll={{ x: 1400, y: 360 }} + /> + ), + }, + { + key: 2, + label: '开票记录', + children: ( + <ProTable + columns={processedRecordColumns} + actionRef={processedRecordRef} + cardBordered + pagination={{ + showSizeChanger: true, // 显示可以选择每页显示条数的下拉菜单 + pageSizeOptions: ['10', '20', '50', '100'], // 设置可以选择的每页显示条数选项 + }} + editable={{ + type: 'multiple', + onSave: async (rowKey, data) => { + await postServiceBankStatementEditBankStatement({ data: data }); + }, + actionRender: (row, config, defaultDom) => [ + defaultDom.save, + defaultDom.cancel, + ], + }} + search={{ + labelWidth: 'auto', + defaultCollapsed: false, + optionRender: (searchConfig, formProps, dom) => [ + ...dom, + <Button + key="out" + onClick={() => { + const values = searchConfig?.form?.getFieldsValue(); + console.log(values); + messageApi.open({ + type: 'loading', + content: '正在导出文件...', + }); + excelExport( + '/api/service/invoice/exportInvoiceRecords', + { + ...values, + statusIn: ['INVOICING', 'SUCCESS', 'FAIL'], + }, + () => { + messageApi.destroy(); + }, + ); + }} + > + 导出 + </Button>, + ], + }} + request={async (params) => { + let res = await postServiceInvoiceQueryInvoiceRecordList({ + data: { + ...params, + statusIn: ['INVOICING', 'SUCCESS', 'FAIL'], + }, + }); + return { + data: res?.data?.data, + total: res?.data?.total || 0, + }; + }} + columnsState={{ + persistenceKey: 'pro-table-singe-demos', + persistenceType: 'localStorage', + defaultValue: { + option: { fixed: 'right', disable: true }, + }, + onChange(value) { + console.log('value: ', value); + }, + }} + rowKey="id" + options={{ + setting: { + listsHeight: 400, + }, + }} + form={{}} + dateFormatter="string" + headerTitle="待开票列表" + scroll={{ x: 1400, y: 360 }} + toolBarRender={() => []} + /> + ), + }, + { + key: 3, + label: '发票管理', + children: ( + <ProTable + columns={invoicecColumnsInit()} + actionRef={invoiceActionRef} + cardBordered + pagination={{ + pageSize: 10, + }} + request={async (params) => { + const res = await postServiceInvoiceQueryInvoice({ + data: { ...params }, + }); + if (res) { + return { + data: res?.data?.data || [], + total: res?.data?.total || 0, + }; + } + }} + columnsState={{ + persistenceKey: 'pro-table-singe-demos', + persistenceType: 'localStorage', + defaultValue: { + option: { fixed: 'right', disable: true }, + }, + onChange(value) { + console.log('value: ', value); + }, + }} + rowKey="id" + search={{ + labelWidth: 'auto', + }} + options={{ + setting: { + listsHeight: 400, + }, + }} + form={{}} + dateFormatter="string" + headerTitle="发票列表" + scroll={{ x: 1400, y: 360 }} + toolBarRender={() => [ + <AddInvoiceDrawerForm + onClose={() => { + invoiceActionRef.current?.reload(); + bankActionRef.current?.reload(); + }} + key="add" + ></AddInvoiceDrawerForm>, + ]} + /> + ), + }, + { + key: 4, + label: '银行流水', + children: ( + <ProTable + columns={bankStatemetColumnsInit()} + actionRef={bankActionRef} + cardBordered + pagination={{ + pageSize: 10, + }} + editable={{ + type: 'multiple', + onSave: async (rowKey, data) => { + await postServiceBankStatementEditBankStatement({ data: data }); + }, + actionRender: (row, config, defaultDom) => [ + defaultDom.save, + defaultDom.cancel, + ], + }} + request={async (params) => { + const res = await postServiceBankStatementQueryBankStatement({ + data: { ...params }, + }); + if (res) { + return { + data: res?.data?.data || [], + total: res?.data?.total || 0, + }; + } + }} + columnsState={{ + persistenceKey: 'pro-table-singe-demos', + persistenceType: 'localStorage', + defaultValue: { + option: { fixed: 'right', disable: true }, + }, + onChange(value) { + console.log('value: ', value); + }, + }} + rowKey="id" + search={{ + labelWidth: 'auto', + }} + options={{ + setting: { + listsHeight: 400, + }, + }} + form={{}} + dateFormatter="string" + headerTitle="银行流水列表" + scroll={{ x: 1400, y: 360 }} + toolBarRender={() => [ + <Button + key="button" + icon={<PlusOutlined />} + onClick={() => { + setBankImportModalVisible(true); + }} + type="primary" + > + 导入 + </Button>, + ]} + /> + ), + }, + ]; + return ( + <div className="invoice-index"> + <Tabs + defaultActiveKey="1" + items={tabsItems} + onChange={(value) => { + if (value === 1) { + invoiceActionRef.current?.reload(); + } else { + bankActionRef.current?.reload(); + } + }} + /> + + {bankImportModalVisible ? ( + <BankImportModal + setVisible={setBankImportModalVisible} + onClose={() => { + setBankImportModalVisible(false); + invoiceActionRef.current?.reload(); + bankActionRef.current?.reload(); + }} + ></BankImportModal> + ) : ( + '' + )} + + {invoiceVerificationVisible ? ( + <InvoiceVerificationModal + setVisible={setInvoiceVerificationVisible} + invoiceId={invoiceId} + onClose={() => { + invoiceActionRef.current?.reload(); + bankActionRef.current?.reload(); + }} + ></InvoiceVerificationModal> + ) : ( + '' + )} + {invoiceRecordDetailVisible ? ( + <InvoiceRecordDetailModal + key="detail" + id={invoiceRecord.id} + setVisible={setInvoiceRecordDetailVisible} + /> + ) : ( + '' + )} + {contextHolder} + </div> + ); +}; + +export default InvoiceRecord; diff --git a/src/pages/Invoice/components/Invoice.tsx b/src/pages/Invoice/components/Invoice.tsx index 156fdfb..bd24277 100644 --- a/src/pages/Invoice/components/Invoice.tsx +++ b/src/pages/Invoice/components/Invoice.tsx @@ -155,10 +155,7 @@ export default ({ data }) => { </Col> <Col className="title col_18 no-border"> 电子发票( - {data.type === 'SPECIAL_TICKET' - ? '增值税专用发票' - : '增值税普通发票'} - ) + {data.type === 'SPECIAL_TICKET' ? '增值税专用发票' : '普通发票'}) </Col> <UnderLine className="UnderLine"> <div></div> @@ -198,13 +195,13 @@ export default ({ data }) => { <Col className=""> <div className="text-center">单位</div> </Col> - <Col className=""> + <Col className="col_2"> <div className="text-center">数量</div> </Col> <Col className="col_2"> <div className="text-center">单价</div> </Col> - <Col className="col_3"> + <Col className="col_2"> <div className="text-center">金额</div> </Col> <Col className=""> @@ -242,22 +239,22 @@ export default ({ data }) => { > <div className="text-center">{specification}</div> </Col> - <Col className="col_4 transparent-border" key={'unit'}> + <Col className=" transparent-border" key={'unit'}> <div className="text-center">{unit}</div> </Col> - <Col className="col_4 transparent-border" key={'quantity'}> + <Col className="col_2 transparent-border" key={'quantity'}> <div className="text-center">{quantity}</div> </Col> <Col className="col_2 transparent-border" key={'price'}> <div className="text-center">{price}</div> </Col> <Col - className="col_3 transparent-border" + className="col_2 transparent-border" key={'totalPrice'} > <div className="text-center">{totalPrice}</div> </Col> - <Col className="col_9 transparent-border" key={'taxRate'}> + <Col className=" transparent-border" key={'taxRate'}> <div className="text-center">{taxRate}</div> </Col> <Col className="col_2 transparent-border" key={'taxPrice'}> diff --git a/src/pages/Invoice/components/InvoiceModal.tsx b/src/pages/Invoice/components/InvoiceModal.tsx index 6f5881d..23822bc 100644 --- a/src/pages/Invoice/components/InvoiceModal.tsx +++ b/src/pages/Invoice/components/InvoiceModal.tsx @@ -36,6 +36,7 @@ export default ({ recordId, getRecord, button }) => { width={1200} form={form} autoFocusFirstInput + submitter={false} modalProps={{ destroyOnClose: true, }} diff --git a/src/pages/Invoice/components/InvoiceRecordDetailModal.tsx b/src/pages/Invoice/components/InvoiceRecordDetailModal.tsx index c7c4827..08c290d 100644 --- a/src/pages/Invoice/components/InvoiceRecordDetailModal.tsx +++ b/src/pages/Invoice/components/InvoiceRecordDetailModal.tsx @@ -12,7 +12,6 @@ import { ModalForm, ProCard, ProForm, - ProFormFieldSet, ProFormInstance, ProFormList, ProFormSelect, @@ -83,16 +82,15 @@ export default ({ id, setVisible }) => { const data = ret.data; const orderIdMap = data.orderIdMap; const orderIdList = []; - //遍历orderIdMap属性。 - for (const key in orderIdMap) { - if (key in Object.getOwnPropertyNames(orderIdMap)) { - const orderId = { - mainId: key, - subIds: orderIdMap[key], - }; - orderIdList.push(orderId); - } - } + + // 使用Object.entries()遍历属性 + Object.entries(orderIdMap).forEach(([key, value]) => { + const orderId = { + mainId: key, + subIds: value, + }; + orderIdList.push(orderId); + }); return { ...data, orderIdList: orderIdList, @@ -248,53 +246,45 @@ export default ({ id, setVisible }) => { { required: true, message: 'Please select your country!' }, ]} /> - <ProFormFieldSet - name="list" + <ProFormList label="订单号" - transform={(value: any) => ({ - list: value, - startTime: value[0], - endTime: value[1], - })} + name="orderIdList" + creatorButtonProps={false} + itemRender={({}, { record }) => { + console.log('record' + JSON.stringify(record)); + return ( + <Space> + <Button + key={record.mainId} + className="pl-1 pr-0" + type="link" + target="_blank" + href={'/order?id=' + record.mainId} + > + {record.mainId} + </Button> + ( + {record.subIds.map((item) => { + return ( + <Button + key={item} + className="pl-1 pr-0" + type="link" + target="_blank" + href={'/order?subOrderId=' + item} + > + {item} + </Button> + ); + })} + ) + <Divider type="vertical" /> + </Space> + ); + }} > - <ProFormList - name="orderIdList" - creatorButtonProps={false} - itemRender={({}, { record }) => { - return ( - <Space> - <Button - key={record.mainId} - className="pl-1 pr-0" - type="link" - target="_blank" - href={'/order?id=' + record.mainId} - > - {record.mainId} - </Button> - ( - {record.subIds.map((item) => { - return ( - <Button - key={item} - className="pl-1 pr-0" - type="link" - target="_blank" - href={'/order?subOrderId=' + item} - > - {item} - </Button> - ); - })} - ) - <Divider type="vertical" /> - </Space> - ); - }} - > - <ProFormText allowClear={false} width="xs" name={['name']} /> - </ProFormList> - </ProFormFieldSet> + <ProFormText allowClear={false} width="xs" name={['name']} /> + </ProFormList> </ProForm.Group> </ProCard> <hr /> diff --git a/src/pages/Invoice/components/InvoicingModal.tsx b/src/pages/Invoice/components/InvoicingModal.tsx index c0efc63..0f9b320 100644 --- a/src/pages/Invoice/components/InvoicingModal.tsx +++ b/src/pages/Invoice/components/InvoicingModal.tsx @@ -1,9 +1,6 @@ import { RESPONSE_CODE } from '@/constants/enum'; -import { - postServiceInvoiceGetInvoicingAccount, - postServiceInvoiceInvoicing, -} from '@/services'; -import { ModalForm, ProFormSelect } from '@ant-design/pro-components'; +import { postServiceInvoiceInvoicing } from '@/services'; +import { ModalForm } from '@ant-design/pro-components'; import { Button, Form, message } from 'antd'; export default ({ selectedRowKeys, reloadRecordTable }) => { @@ -41,7 +38,7 @@ export default ({ selectedRowKeys, reloadRecordTable }) => { return true; }} > - <ProFormSelect + {/*<ProFormSelect name="invoicingAccount" label="开票账号" request={async () => { @@ -55,7 +52,7 @@ export default ({ selectedRowKeys, reloadRecordTable }) => { }} placeholder="请选择开票账号" rules={[{ required: true, message: '请选择开票账号!' }]} - /> + />*/} </ModalForm> ); }; diff --git a/src/pages/Invoice/components/ManualInvoicingModal.tsx b/src/pages/Invoice/components/ManualInvoicingModal.tsx index e5e0c44..72be3aa 100644 --- a/src/pages/Invoice/components/ManualInvoicingModal.tsx +++ b/src/pages/Invoice/components/ManualInvoicingModal.tsx @@ -6,11 +6,7 @@ import { } from '@/services'; import { ModalForm, - ProCard, ProFormDatePicker, - ProFormDigit, - ProFormList, - ProFormMoney, ProFormText, } from '@ant-design/pro-components'; import { Col, Form, Row, message } from 'antd'; @@ -52,12 +48,12 @@ export default ({ record }) => { } }} > - <ProFormText + {/*<ProFormText rules={[{ required: true, message: '此项为必填项' }]} width={'md'} name="invoicingPerson" label="开票人" - /> + />*/} <ProFormText rules={[{ required: true, message: '此项为必填项' }]} width={'md'} @@ -102,7 +98,7 @@ export default ({ record }) => { ></UploadC> </Col> </Row> - <ProFormList + {/*<ProFormList name="invoiceDetailDtoList" label="明细" creatorButtonProps={false} @@ -128,7 +124,7 @@ export default ({ record }) => { /> <ProFormDigit label="税率" name="taxRate" min={0} max={100} /> <ProFormMoney label="税额" name="taxPrice" locale="zh-CN" min={0} /> - </ProFormList> + </ProFormList>*/} </ModalForm> ); }; diff --git a/src/pages/Invoice/index.tsx b/src/pages/Invoice/index.tsx index 32f6ca2..4380752 100644 --- a/src/pages/Invoice/index.tsx +++ b/src/pages/Invoice/index.tsx @@ -298,7 +298,7 @@ const InvoicePage = () => { { title: '申请开票时间', dataIndex: 'createTime', - valueType: 'dateRange', + valueType: 'dateTimeRange', width: 200, hideInTable: true, search: { @@ -319,24 +319,32 @@ const InvoicePage = () => { render: (text, record) => { return [ /*<InvoiceRecordDetailModal - key="detail" - id={record.id} - subOrderIds={record.subOrderIds} - onClose={()=>{ - waitDealrecordActionRef.current?.reload(); - } - } - />*/ - <a - key="detail" - onClick={() => { - setInvoiceRecordDetailVisible(true); - setInvoiceRecord(record); - }} - > - 详情 - </a>, - <InvoiceModal key="invoiceModal" recordId={record.id} />, + key="detail" + id={record.id} + subOrderIds={record.subOrderIds} + onClose={()=>{ + waitDealrecordActionRef.current?.reload(); + } + } + />*/ + <> + {record.paths.includes('DETAIL') && ( + <a + key="detail" + onClick={() => { + setInvoiceRecordDetailVisible(true); + setInvoiceRecord(record); + }} + > + 详情 + </a> + )} + </>, + <> + {record.paths.includes('PREVIEW') && ( + <InvoiceModal key="invoiceModal" recordId={record.id} /> + )} + </>, <> {record.paths.includes('INVOICING') && ( <ManualInvoicingModal @@ -371,8 +379,8 @@ const InvoicePage = () => { }, { title: '开票日期', - dataIndex: 'invoicingTime', - valueType: 'dateTime', + dataIndex: 'invoicingDate', + valueType: 'date', hideInSearch: true, ellipsis: true, }, @@ -491,15 +499,15 @@ const InvoicePage = () => { }, { title: '开票日期', - dataIndex: 'invoicingTime', + dataIndex: 'invoicingDate', valueType: 'dateRange', hideInTable: true, search: { transform: (value) => { if (value) { return { - invoicingTimeGe: value[0], - invoicingTimeLe: value[1], + invoicingDateGe: value[0], + invoicingDateLe: value[1], }; } }, @@ -519,28 +527,29 @@ const InvoicePage = () => { valueType: 'option', key: 'option', render: (text, record) => [ - <a - key="detail" - onClick={() => { - setInvoiceRecordDetailVisible(true); - setInvoiceRecord(record); - }} - > - 详情 - </a>, <> - {record.status === 'SUCCESS' && ( - <> - {record.status === 'SUCCESS' && ( - <a href={record.invoiceAddress} download> - 下载发票 - </a> - )} - </> + {record.status === 'SUCCESS' && record.paths.includes('DETAIL') && ( + <a + key="detail" + onClick={() => { + setInvoiceRecordDetailVisible(true); + setInvoiceRecord(record); + }} + > + 详情 + </a> )} </>, <> - {record.status === 'FAIL' && ( + {record.status === 'SUCCESS' && + record.paths.includes('DOWNLOAD_INVOICE') && ( + <a href={record.invoiceAddress} download> + 下载发票 + </a> + )} + </>, + <> + {record.status === 'FAIL' && record.paths.includes('RETRY') && ( <ModalForm title="提示" trigger={ @@ -831,7 +840,8 @@ const InvoicePage = () => { actionRef={waitDealrecordActionRef} cardBordered pagination={{ - pageSize: 10, + showSizeChanger: true, // 显示可以选择每页显示条数的下拉菜单 + pageSizeOptions: ['10', '20', '50', '100'], // 设置可以选择的每页显示条数选项 }} rowSelection={{ selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT], @@ -904,7 +914,8 @@ const InvoicePage = () => { actionRef={processedRecordRef} cardBordered pagination={{ - pageSize: 10, + showSizeChanger: true, // 显示可以选择每页显示条数的下拉菜单 + pageSizeOptions: ['10', '20', '50', '100'], // 设置可以选择的每页显示条数选项 }} editable={{ type: 'multiple', diff --git a/src/pages/Order/components/InvoicingDrawerForm.tsx b/src/pages/Order/components/InvoicingDrawerForm.tsx index 2f4cce4..6b6f8ea 100644 --- a/src/pages/Order/components/InvoicingDrawerForm.tsx +++ b/src/pages/Order/components/InvoicingDrawerForm.tsx @@ -2,6 +2,7 @@ import InvoiceModal from '@/pages/Invoice/components/InvoiceModal'; import { postServiceConstGetPayeeEnum, + postServiceConstInitInvoiceDetailNames, postServiceConstInvoiceType, postServiceConstInvoicingType, postServiceConstListInvoiceDetailNames, @@ -15,33 +16,91 @@ import { ProCard, ProFormDigit, ProFormGroup, + ProFormInstance, ProFormList, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, } from '@ant-design/pro-components'; -import { Button, Divider, Form } from 'antd'; -import { useEffect } from 'react'; +import { Button, Divider, Form, Space, Tooltip, message } from 'antd'; +import { useEffect, useRef, useState } from 'react'; export default ({ dataList, setVisible, onClose }) => { // let subOrderIds = dataList?.map((item) => { // return item.id; - // }); + // }) const [form] = Form.useForm(); + const [projectOptions] = useState(); + const [dataListCopy] = useState(dataList); + const formRef = useRef<ProFormInstance>(); + useEffect(() => { + const initOptions = async () => { + const res = await postServiceConstInitInvoiceDetailNames({ + data: dataListCopy.map((item) => { + return item.productName; + }), + }); + const options = res.data; + const datas = dataListCopy.map((item) => { + return { + ...item, + projectName: options[item.productName], + }; + }); + const initialValue = datas.map((item) => { + return { + productName: item.productName, + projectName: item.projectName, + subOrderId: item.id, + specification: item.parameters, + unit: item.unit, + quantity: item.quantity, + price: item.productPrice, + totalPrice: item.subOrderPayment, + }; + }); + form.setFieldValue('invoiceDetails', initialValue); + }; + initOptions(); + }, []); + + useEffect(() => {}, [projectOptions]); + + function copyToClipboard(text: string) { + // 创建一个临时的textarea元素 + const textarea = document.createElement('textarea'); + textarea.value = text; + + // 将textarea元素添加到DOM中 + document.body.appendChild(textarea); + + // 选中textarea中的文本 + textarea.select(); + + try { + // 尝试执行复制命令 + document.execCommand('copy'); + return true; + } catch (err) { + return false; + } finally { + // 移除临时的textarea元素 + document.body.removeChild(textarea); + } + } + useEffect(() => {}, []); return ( <DrawerForm open - title="合并开票" + title="申请开票" resize={{ - onResize() { - console.log('resize!'); - }, maxWidth: window.innerWidth * 0.8, minWidth: 500, }} form={form} + formRef={formRef} autoFocusFirstInput drawerProps={{ destroyOnClose: true, @@ -53,12 +112,11 @@ export default ({ dataList, setVisible, onClose }) => { key={'invoicePreview'} button={<Button type="primary"> 发票预览 </Button>} getRecord={() => { - const totalPrice = dataList.reduce( - (accumulator, currentValue) => { - return accumulator + currentValue.subOrderPayment; - }, - 0, - ); + const totalPrice = form + .getFieldValue('invoiceDetails') + .reduce((accumulator, currentValue) => { + return accumulator + currentValue.totalPrice; + }, 0); return { ...form.getFieldsValue(), totalPrice: totalPrice, @@ -75,7 +133,7 @@ export default ({ dataList, setVisible, onClose }) => { postServiceInvoiceApplyInvoice({ data: { ...values, - subOrderIds: dataList.map((item) => { + subOrderIds: dataListCopy.map((item) => { return item.id; }), }, @@ -90,7 +148,7 @@ export default ({ dataList, setVisible, onClose }) => { name="subOrderIdObjs" readonly={true} label="开票订单" - initialValue={dataList.map((item) => { + initialValue={dataListCopy.map((item) => { return { value: item.id, }; @@ -181,7 +239,7 @@ export default ({ dataList, setVisible, onClose }) => { name="price" locale="zh-CN" rules={[{ required: true, message: '请填写开票金额!' }]} - initialValue={dataList.reduce((accumulator, currentValue) => { + initialValue={dataListCopy.reduce((accumulator, currentValue) => { return accumulator + currentValue.subOrderPayment; }, 0)} /> @@ -257,23 +315,24 @@ export default ({ dataList, setVisible, onClose }) => { <ProFormList name="invoiceDetails" label="开票明细" - initialValue={dataList.map((item) => { - console.log('item:' + JSON.stringify(item)); - return { - subOrderId: item.id, - /*projectName: item.productName,*/ - specification: item.parameters, - unit: item.unit, - quantity: item.quantity, - price: item.productPrice, - totalPrice: item.subOrderPayment, - }; - })} + /*initialValue={dataListCopy.map((item) => { + console.log("item"+JSON.stringify(item)); + return { + productName: item.productName, + projectName: item.projectName, + subOrderId: item.id, + /!*projectName: item.productName,*!/ + specification: item.parameters, + unit: item.unit, + quantity: item.quantity, + price: item.productPrice, + totalPrice: item.subOrderPayment, + }; + })}*/ rules={[ { required: true, validator: async (_, value) => { - console.log(value); if (value && value.length > 0) { return; } @@ -282,7 +341,6 @@ export default ({ dataList, setVisible, onClose }) => { }, ]} itemRender={(doms, listMeta) => { - console.log(listMeta); return ( <ProCard bordered @@ -292,12 +350,23 @@ export default ({ dataList, setVisible, onClose }) => { marginBlockEnd: 8, }} > - <ProFormText - key={'subOrderId' + listMeta.index} - name="subOrderId" - label="子订单id" - hidden - /> + <Tooltip title="点击复制商品名称"> + <Space + className="hover:cursor-pointer" + style={{ + margin: 16, + marginTop: 4, + marginLeft: 0, + fontSize: 15, + }} + onClick={() => { + copyToClipboard(listMeta.record.productName); + message.info('商品名称复制成功!'); + }} + > + 商品名称:{listMeta.record.productName} + </Space> + </Tooltip> <ProFormSelect key={'projectName' + listMeta.index} width="md" @@ -343,12 +412,14 @@ export default ({ dataList, setVisible, onClose }) => { option.productAndServiceCatagoryAbbreviation + '*' + option.name; - currentData.specification = option.specification; - currentData.unit = option.unit; + console.log( + 'copyList' + JSON.stringify(listMeta.record.projectName), + ); form.setFieldValue('invoiceDetails', copyList); }} debounceTime={1000} label="项目名称" + initialValue={listMeta.record.projectName} placeholder="请输入名称" /> <ProFormText @@ -377,8 +448,6 @@ export default ({ dataList, setVisible, onClose }) => { len += 1; // 半角字符 } } - console.log(value); - console.log(len); if (len <= 40) { return Promise.resolve(); } @@ -400,18 +469,46 @@ export default ({ dataList, setVisible, onClose }) => { key={'quantity' + listMeta.index} label="数量" name="quantity" - min={0} + rules={[ + { + validator: (_, value) => { + if (value === undefined || value > 0) { + return Promise.resolve(); + } + return Promise.reject(new Error('数量必须大于0')); + }, + }, + ]} /> <ProFormDigit key={'price' + listMeta.index} label="单价" name="price" - min={0} + rules={[ + { + validator: (_, value) => { + if (value === undefined || value > 0) { + return Promise.resolve(); + } + return Promise.reject(new Error('单价必须大于0')); + }, + }, + ]} /> <ProFormMoney key={'totalPrice' + listMeta.index} label="金额" name="totalPrice" + rules={[ + { + validator: (_, value) => { + if (value === undefined || value > 0) { + return Promise.resolve(); + } + return Promise.reject(new Error('金额必须大于0')); + }, + }, + ]} locale="zh-CN" /> </ProCard> diff --git a/src/pages/Order/index.tsx b/src/pages/Order/index.tsx index 4a93cde..3b2dcf3 100644 --- a/src/pages/Order/index.tsx +++ b/src/pages/Order/index.tsx @@ -1283,7 +1283,7 @@ const OrderPage = () => { </div> </Flex> <Flex className="w-[18%]" wrap="wrap" gap="small"> - {optRecord.subPath?.includes('postAudit') ? ( + {optRecord.paths?.includes('postAudit') ? ( <Button className="p-0" type="link" @@ -1299,7 +1299,7 @@ const OrderPage = () => { '' )} {/* 加急审核 */} - {optRecord.subPath?.includes('URGENT_INVOICE_AUDITING') ? ( + {optRecord.paths?.includes('URGENT_INVOICE_AUDITING') ? ( <Button className="p-0" type="link" @@ -1316,7 +1316,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('URGENT_INVOICE_AUDITING_old') ? ( + {optRecord.paths?.includes('URGENT_INVOICE_AUDITING_old') ? ( <Button className="p-0" type="link" @@ -1333,7 +1333,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('salesConfirm') && ( + {optRecord.paths?.includes('salesConfirm') && ( <ButtonConfirm className="p-0" title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。" @@ -1352,7 +1352,7 @@ const OrderPage = () => { }} /> )} - {optRecord.subPath?.includes('uploadPaymentReceiptBill') ? ( + {optRecord.paths?.includes('uploadPaymentReceiptBill') ? ( <Button className="p-0" type="link" @@ -1366,7 +1366,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('reissue_old') ? ( + {optRecord.paths?.includes('reissue_old') ? ( /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'|| optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/ <Button @@ -1382,7 +1382,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('reissue') ? ( + {optRecord.paths?.includes('reissue') ? ( /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'|| optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/ <Button @@ -1400,7 +1400,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('confirmReissue_old') ? ( + {optRecord.paths?.includes('confirmReissue_old') ? ( <Button className="p-0" type="link" @@ -1416,7 +1416,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('confirmReissue') ? ( + {optRecord.paths?.includes('confirmReissue') ? ( <Button className="p-0" type="link" @@ -1433,7 +1433,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('leaderAudit') ? ( + {optRecord.paths?.includes('leaderAudit') ? ( <Button className="p-0" type="link" @@ -1450,7 +1450,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('creditAudit') ? ( + {optRecord.paths?.includes('creditAudit') ? ( <Button className="p-0" type="link" @@ -1467,7 +1467,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('auditPaymentReceipt') ? ( + {optRecord.paths?.includes('auditPaymentReceipt') ? ( <Button className="p-0" type="link" @@ -1483,7 +1483,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('modifiedAuditRequest') ? ( + {optRecord.paths?.includes('modifiedAuditRequest') ? ( <Button className="p-0" type="link" @@ -1499,7 +1499,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('applyModify') ? ( + {optRecord.paths?.includes('applyModify') ? ( <Button className="p-0" type="link" @@ -1515,7 +1515,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('modifiedLeaderAuditRequest') ? ( + {optRecord.paths?.includes('modifiedLeaderAuditRequest') ? ( <Button className="p-0" type="link" @@ -1531,7 +1531,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('shippingWarehouseChangeRequest') ? ( + {optRecord.paths?.includes('shippingWarehouseChangeRequest') ? ( <Button className="p-0" type="link" @@ -1547,7 +1547,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('saleCancelInvoicing_old') ? ( + {optRecord.paths?.includes('saleCancelInvoicing_old') ? ( <ButtonConfirm className="p-0" title="确认取消申请开票?" @@ -1568,7 +1568,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('saleCancelInvoicing') ? ( + {optRecord.paths?.includes('saleCancelInvoicing') ? ( <ButtonConfirm className="p-0" title="确认取消申请开票?" @@ -1589,7 +1589,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('noNeedInvoicingEdit') ? ( + {optRecord.paths?.includes('noNeedInvoicingEdit') ? ( <Button className="p-0" type="link" @@ -1604,7 +1604,7 @@ const OrderPage = () => { ) : ( '' )} - {optRecord.subPath?.includes('sendProduct') ? ( + {optRecord.paths?.includes('sendProduct') ? ( <Button className="p-0" type="link" @@ -1621,7 +1621,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('supplierSendOrder') ? ( + {optRecord.paths?.includes('supplierSendOrder') ? ( <Button className="p-0" type="link" @@ -1639,7 +1639,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('procureSend') ? ( + {optRecord.paths?.includes('procureSend') ? ( <Button className="p-0" type="link" @@ -1656,7 +1656,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('editProductionTime') ? ( + {optRecord.paths?.includes('editProductionTime') ? ( <Button className="p-0" type="link" @@ -1671,7 +1671,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('queryAnnex') && + {optRecord.paths?.includes('queryAnnex') && optRecord.listAnnex?.length > 0 ? ( <Button className="p-0" @@ -1688,7 +1688,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('modifySendInformation') ? ( + {optRecord.paths?.includes('modifySendInformation') ? ( <Button className="p-0" type="link" @@ -1704,7 +1704,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('printOrder') ? ( + {optRecord.paths?.includes('printOrder') ? ( <Button className="p-0" type="link" @@ -1720,7 +1720,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('supplierPrint') ? ( + {optRecord.paths?.includes('supplierPrint') ? ( <Button className="p-0" type="link" @@ -1736,7 +1736,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('procurePrint') ? ( + {optRecord.paths?.includes('procurePrint') ? ( <ButtonConfirm className="p-0" title="确认打印?" @@ -1770,7 +1770,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('editOrder') && false ? ( + {optRecord.paths?.includes('editOrder') && false ? ( <Button className="p-0" type="link" @@ -1786,7 +1786,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('invoicing') ? ( + {optRecord.paths?.includes('invoicing') ? ( <Button className="p-0" type="link" @@ -1803,7 +1803,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('applyInvoicing') ? ( + {optRecord.paths?.includes('applyInvoicing') ? ( <Button className="p-0" type="link" @@ -1820,7 +1820,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('applyInvoicing_old') ? ( + {optRecord.paths?.includes('applyInvoicing_old') ? ( <Button className="p-0" type="link" @@ -1837,7 +1837,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('checkOrder') ? ( + {optRecord.paths?.includes('checkOrder') ? ( <Button className="p-0" type="link" @@ -1854,7 +1854,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('afterSalesCheck') ? ( + {optRecord.paths?.includes('afterSalesCheck') ? ( <Button className="p-0" type="link" @@ -1870,7 +1870,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('financeCheckOrder') ? ( + {optRecord.paths?.includes('financeCheckOrder') ? ( <Button className="p-0" type="link" @@ -1886,7 +1886,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('procureCheckOrder') ? ( + {optRecord.paths?.includes('procureCheckOrder') ? ( <Button className="p-0" type="link" @@ -1902,7 +1902,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('procureConvertProcure') ? ( + {optRecord.paths?.includes('procureConvertProcure') ? ( <Button className="p-0" type="link" @@ -1918,7 +1918,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('rePrintOrder') ? ( + {optRecord.paths?.includes('rePrintOrder') ? ( <Button className="p-0" type="link" @@ -1934,7 +1934,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('confirmReceipt') ? ( + {optRecord.paths?.includes('confirmReceipt') ? ( <Button className="p-0" type="link" @@ -1949,7 +1949,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('applyAfterSales') ? ( + {optRecord.paths?.includes('applyAfterSales') ? ( <Button className="p-0" type="link" @@ -1965,7 +1965,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('procureOrder') ? ( + {optRecord.paths?.includes('procureOrder') ? ( <ButtonConfirm className="p-0" title="是否已下单?" @@ -1985,7 +1985,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('cancelSend') ? ( + {optRecord.paths?.includes('cancelSend') ? ( <ButtonConfirm className="p-0" title="是否取消发货" @@ -2005,7 +2005,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('noNeedSend') ? ( + {optRecord.paths?.includes('noNeedSend') ? ( <ButtonConfirm className="p-0" title="此订单是否无需发货?" @@ -2025,7 +2025,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('viewImages') ? ( + {optRecord.paths?.includes('viewImages') ? ( <Button className="p-0" type="link" @@ -2041,7 +2041,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('confirmDeliver') ? ( + {optRecord.paths?.includes('confirmDeliver') ? ( <Button className="p-0" type="link" @@ -2057,7 +2057,7 @@ const OrderPage = () => { '' )} - {optRecord.subPath?.includes('orderCancel') ? ( + {optRecord.paths?.includes('orderCancel') ? ( <ButtonConfirm className="p-0" title="确认作废?" @@ -2677,7 +2677,7 @@ const OrderPage = () => { <Flex justify="flex-end"> <Space.Compact direction="vertical" align="end"> <Space wrap> - {record.mainPath?.includes('postAudit') ? ( + {record.paths?.includes('postAudit') ? ( <Button className="p-0" type="link" @@ -2693,7 +2693,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('URGENT_INVOICE_AUDITING') ? ( + {record.paths?.includes('URGENT_INVOICE_AUDITING') ? ( <Button className="p-0" type="link" @@ -2708,7 +2708,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('URGENT_INVOICE_AUDITING_old') ? ( + {record.paths?.includes('URGENT_INVOICE_AUDITING_old') ? ( <Button className="p-0" type="link" @@ -2725,7 +2725,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('salesConfirm') && ( + {record.paths?.includes('salesConfirm') && ( <ButtonConfirm className="p-0" title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。" @@ -2756,7 +2756,7 @@ const OrderPage = () => { }} /> )} - {record.mainPath?.includes('uploadPaymentReceiptBill') ? ( + {record.paths?.includes('uploadPaymentReceiptBill') ? ( <Button className="p-0" type="link" @@ -2771,7 +2771,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('modifiedAuditRequest') ? ( + {record.paths?.includes('modifiedAuditRequest') ? ( <Button className="p-0" type="link" @@ -2787,7 +2787,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('auditPaymentReceipt') ? ( + {record.paths?.includes('auditPaymentReceipt') ? ( <Button className="p-0" type="link" @@ -2803,7 +2803,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('modifiedLeaderAuditRequest') ? ( + {record.paths?.includes('modifiedLeaderAuditRequest') ? ( <Button className="p-0" type="link" @@ -2835,7 +2835,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('reissue_old') ? ( + {record.paths?.includes('reissue_old') ? ( /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'|| optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/ <Button @@ -2853,7 +2853,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('confirmReissue_old') ? ( + {record.paths?.includes('confirmReissue_old') ? ( <Button className="p-0" type="link" @@ -2870,7 +2870,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('reissue') ? ( + {record.paths?.includes('reissue') ? ( /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'|| optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/ <Button @@ -2887,7 +2887,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('confirmReissue') ? ( + {record.paths?.includes('confirmReissue') ? ( <Button className="p-0" type="link" @@ -2904,7 +2904,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('procureOrder') ? ( + {record.paths?.includes('procureOrder') ? ( <ButtonConfirm className="p-0" title="是否下单?" @@ -2936,7 +2936,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('cancelSend') ? ( + {record.paths?.includes('cancelSend') ? ( <ButtonConfirm className="p-0" title="是否取消发货?" @@ -2968,7 +2968,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('applyModify') ? ( + {record.paths?.includes('applyModify') ? ( <Button className="p-0" type="link" @@ -2984,7 +2984,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('leaderAudit') ? ( + {record.paths?.includes('leaderAudit') ? ( <Button className="p-0" type="link" @@ -3016,7 +3016,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('changeOrderAudit') ? ( + {record.paths?.includes('changeOrderAudit') ? ( <Button className="p-0" type="link" @@ -3050,7 +3050,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('creditAudit') ? ( + {record.paths?.includes('creditAudit') ? ( <Button className="p-0" type="link" @@ -3082,7 +3082,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('editProductionTime') ? ( + {record.paths?.includes('editProductionTime') ? ( <Button className="p-0" type="link" @@ -3097,7 +3097,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('procureConvertProcure') ? ( + {record.paths?.includes('procureConvertProcure') ? ( <Button className="p-0" type="link" @@ -3111,7 +3111,7 @@ const OrderPage = () => { for (let i = 0; i < selectedSubOrders.length; i++) { if ( - !selectedSubOrders[i].subPath.includes( + !selectedSubOrders[i].paths.includes( 'procureConvertProcure', ) ) { @@ -3129,7 +3129,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('sendProduct') ? ( + {record.paths?.includes('sendProduct') ? ( <Button className="p-0" type="link" @@ -3150,7 +3150,7 @@ const OrderPage = () => { )} {/* 供应商发货 */} - {record.mainPath?.includes('supplierSendOrder') ? ( + {record.paths?.includes('supplierSendOrder') ? ( <Button className="p-0" type="link" @@ -3170,7 +3170,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('procureSend') ? ( + {record.paths?.includes('procureSend') ? ( <Button className="p-0" type="link" @@ -3190,7 +3190,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('printOrder') ? ( + {record.paths?.includes('printOrder') ? ( <Button className="p-0" type="link" @@ -3203,8 +3203,8 @@ const OrderPage = () => { } for (let subOrderRecord of selectedSubOrders) { - let subPath = subOrderRecord.subPath; - if (!checkePrintable(subPath)) { + let paths = subOrderRecord.paths; + if (!checkePrintable(paths)) { return message.error('请选择可以打印的子订单'); } } @@ -3219,7 +3219,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('supplierPrint') ? ( + {record.paths?.includes('supplierPrint') ? ( <Button className="p-0" type="link" @@ -3239,7 +3239,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('rePrintOrder') ? ( + {record.paths?.includes('rePrintOrder') ? ( <Button className="p-0" type="link" @@ -3257,7 +3257,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('confirmReceipt') ? ( + {record.paths?.includes('confirmReceipt') ? ( <Button className="p-0" type="link" @@ -3271,7 +3271,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('modifySendInformation') ? ( + {record.paths?.includes('modifySendInformation') ? ( <Button className="p-0" type="link" @@ -3301,7 +3301,7 @@ const OrderPage = () => { ) : ( '' )} - {record.mainPath?.includes('invoicing') ? ( + {record.paths?.includes('invoicing') ? ( <Button type="link" className="p-0" @@ -3317,7 +3317,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('applyInvoicing_old') ? ( + {record.paths?.includes('applyInvoicing_old') ? ( <Button type="link" className="p-0" @@ -3354,7 +3354,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('applyInvoicing') ? ( + {record.paths?.includes('applyInvoicing') ? ( <Button type="link" className="p-0" @@ -3391,7 +3391,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('updateOrder') ? ( + {record.paths?.includes('updateOrder') ? ( <Button className="p-0" type="link" @@ -3456,7 +3456,7 @@ const OrderPage = () => { '' )} - {record?.subOrderInformationLists[0].subPath?.includes( + {record?.subOrderInformationLists[0].paths?.includes( 'noNeedInvoicingEdit', ) ? ( <Button @@ -3474,7 +3474,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('checkOrder') ? ( + {record.paths?.includes('checkOrder') ? ( <Button className="p-0" type="link" @@ -3511,7 +3511,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('afterSalesCheck') ? ( + {record.paths?.includes('afterSalesCheck') ? ( <Button className="p-0" type="link" @@ -3544,7 +3544,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('noNeedSend') ? ( + {record.paths?.includes('noNeedSend') ? ( <ButtonConfirm className="p-0" title="此订单是否无需发货?" @@ -3594,7 +3594,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('saleCancelInvoicing_old') ? ( + {record.paths?.includes('saleCancelInvoicing_old') ? ( <ButtonConfirm className="p-0" title="确认取消申请开票?" @@ -3637,7 +3637,7 @@ const OrderPage = () => { '' )} {/* 财务审核:主订单暂无 */} - {record.mainPath?.includes('financeCheckOrder') ? ( + {record.paths?.includes('financeCheckOrder') ? ( <Button className="p-0" type="link" @@ -3675,7 +3675,7 @@ const OrderPage = () => { )} {/* 采购审核 */} - {record.mainPath?.includes('procureCheckOrder') ? ( + {record.paths?.includes('procureCheckOrder') ? ( <Button className="p-0" type="link" @@ -3708,7 +3708,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('applyAfterSales') ? ( + {record.paths?.includes('applyAfterSales') ? ( <Button className="p-0" type="link" @@ -3743,7 +3743,7 @@ const OrderPage = () => { '' )} - {/* {record.mainPath?.includes('afterSalesCompletion') ? ( + {/* {record.paths?.includes('afterSalesCompletion') ? ( <ButtonConfirm className="p-0" title="售后是否已完成?" @@ -3787,7 +3787,7 @@ const OrderPage = () => { '' )} */} - {record.mainPath?.includes('salOrderSave') ? ( + {record.paths?.includes('salOrderSave') ? ( <ButtonConfirm className="p-0" title="是否推送至金蝶ERP?" @@ -3809,7 +3809,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('salBillOutbound') ? ( + {record.paths?.includes('salBillOutbound') ? ( <ButtonConfirm className="p-0" title="是否下推金蝶ERP出库单?" @@ -3831,7 +3831,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('orderCancel') ? ( + {record.paths?.includes('orderCancel') ? ( <ButtonConfirm className="p-0" title="确认作废?" @@ -3854,7 +3854,7 @@ const OrderPage = () => { '' )} - {record.mainPath?.includes('procurePrint') ? ( + {record.paths?.includes('procurePrint') ? ( <ButtonConfirm className="p-0" title="确认打印?" @@ -4205,6 +4205,7 @@ const OrderPage = () => { { label: '加急开票审核(旧)', key: '2', + disabled: true, onClick: async () => { setIsMainOrder(true); setCheckVisible(true); @@ -4313,7 +4314,7 @@ const OrderPage = () => { setIsMainOrder(true); setApplyForInvoicingVisible(true); }} - disabled={selectedSubOrderKeys?.length === 0} + disabled={true} /*{selectedSubOrderKeys?.length === 0}*/ > {roleCode === 'admin' ? '合并(销售)' : '合并开票'} </Button>, diff --git a/src/pages/Order/type.d.ts b/src/pages/Order/type.d.ts index 1930f33..4abf104 100644 --- a/src/pages/Order/type.d.ts +++ b/src/pages/Order/type.d.ts @@ -19,7 +19,7 @@ export interface OrderListItemType { goodsWeight: any; receivingCompany: any; modified: any; - mainPath: any; + paths: any; totalPayment: ReactNode; notes: ReactNode; invoiceIdentificationNumber: ReactNode; diff --git a/src/pages/User/ZoNing/components/constant.tsx b/src/pages/User/ZoNing/components/constant.tsx deleted file mode 100644 index a4b543f..0000000 --- a/src/pages/User/ZoNing/components/constant.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import { List } from 'lodash'; - -export type zoningItem = { - id?: number; //id - zoning: string; //区域名称 - orderProvinceVoList: List<provinceItem>; //所包含的省份列表 - orderUserVoList: List<userItem>; //所包含的销售列表 -}; - -export type zoningShowItem = { - id?: number; //id - zoning: string; //区域名称 - orderProvinceShowList: string; //所包含的省份列表 - orderUserShowList: string; //所包含的销售列表 - orderUserNumberShowList: number[]; //销售对应的uId -}; - -export type provinceItem = { - pId?: number; - province: string; -}; - -export type userItem = { - uId: number; - userName?: string; -}; - -export const provinceEnum = { - 全选: '全选', - 北京市: '北京市', - 天津市: '天津市', - 河北省: '河北省', - 山西省: '山西省', - 内蒙古自治区: '内蒙古自治区', - 辽宁省: '辽宁省', - 吉林省: '吉林省', - 黑龙江省: '黑龙江省', - 上海市: '上海市', - 江苏省: '江苏省', - 浙江省: '浙江省', - 安徽省: '安徽省', - 福建省: '福建省', - 江西省: '江西省', - 山东省: '山东省', - 河南省: '河南省', - 湖北省: '湖北省', - 湖南省: '湖南省', - 广东省: '广东省', - 广西壮族自治区: '广西壮族自治区', - 海南省: '海南省', - 重庆市: '重庆市', - 四川省: '四川省', - 贵州省: '贵州省', - 云南省: '云南省', - 西藏自治区: '西藏自治区', - 陕西省: '陕西省', - 甘肃省: '甘肃省', - 青海省: '青海省', - 宁夏回族自治区: '宁夏回族自治区', - 新疆维吾尔自治区: '新疆维吾尔自治区', - 台湾省: '台湾省', - 香港特别行政区: '香港特别行政区', - 澳门特别行政区: '澳门特别行政区', -}; diff --git a/src/pages/User/ZoNing/components/modal.tsx b/src/pages/User/ZoNing/components/modal.tsx deleted file mode 100644 index 37971d2..0000000 --- a/src/pages/User/ZoNing/components/modal.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import { - getOrderErpOrderZoNingSelectUserAll, - postOrderErpOrderZoNingSaveOrUpdate, -} from '@/services'; -import { PlusOutlined } from '@ant-design/icons'; -import { - ModalForm, - ProForm, - ProFormSelect, - ProFormText, -} from '@ant-design/pro-components'; -import { Button, Form, message } from 'antd'; -import { provinceEnum, zoningItem } from './constant'; -const waitTime = (time: number = 100) => { - return new Promise((resolve) => { - setTimeout(() => { - resolve(true); - }, time); - }); -}; - -export default ({ toReload, option, needEditBody }) => { - const [form] = Form.useForm<zoningItem>(); - - return ( - <ModalForm<{ - zoning: string; - province: string[]; - user: number[]; - }> - title={option} - trigger={ - <Button type="primary" key={option.id}> - {option !== '编辑' && <PlusOutlined />} - {option} - </Button> - } - form={form} - autoFocusFirstInput - initialValues={{ - zoning: needEditBody.zoning ? needEditBody.zoning : '', - province: needEditBody.orderProvinceShowList - ? needEditBody.orderProvinceShowList.split('、') - : [], - user: needEditBody.orderUserNumberShowList - ? needEditBody.orderUserNumberShowList - : [], - }} - modalProps={{ - destroyOnClose: true, - }} - submitTimeout={500} - onFinish={async (values) => { - console.log(values); - const orderProvinceList = values.province.map((item) => { - return { province: item }; - }); - const orderUserList = values.user.map((item) => { - return { uId: item }; - }); - const fetchData: zoningItem = { - zoning: values.zoning, - orderProvinceVoList: orderProvinceList, - orderUserVoList: orderUserList, - }; - let res = await postOrderErpOrderZoNingSaveOrUpdate({ - data: fetchData, - }); - if (res) { - console.log(res); - await waitTime(500); - console.log(values); - message.success('提交成功'); - toReload(); - return true; - } - return false; - }} - > - <ProForm.Group> - <ProFormText - width="lg" - name="zoning" - label="区域名称" - placeholder="请输入" - rules={[{ required: true, message: '此项为必填项' }]} - /> - </ProForm.Group> - <ProForm.Group> - <ProFormSelect - name="user" - width="lg" - label="负责销售" - request={async () => { - const userList = await getOrderErpOrderZoNingSelectUserAll(); - if (userList) { - let userSelList = []; - userList.data.forEach((item: { uId: any; userName: any }) => - userSelList.push({ - value: item.uId, - label: item.userName, - }), - ); - userSelList.unshift({ - value: 0, - label: '全选', - }); - return userSelList; - } - return []; - }} - fieldProps={{ - mode: 'multiple', - }} - placeholder="请选择" - rules={[ - { - required: true, - message: '请选择!', - type: 'array', - }, - ]} - /> - </ProForm.Group> - <ProForm.Group> - <ProFormSelect - name="province" - width="lg" - label="管辖地区" - valueEnum={provinceEnum} - fieldProps={{ - mode: 'multiple', - }} - placeholder="请选择" - rules={[ - { - required: true, - message: '请选择!', - type: 'array', - }, - ]} - /> - </ProForm.Group> - </ModalForm> - ); -}; diff --git a/src/pages/User/ZoNing/components/table.tsx b/src/pages/User/ZoNing/components/table.tsx deleted file mode 100644 index 4f3f42d..0000000 --- a/src/pages/User/ZoNing/components/table.tsx +++ /dev/null @@ -1,187 +0,0 @@ -import { - deleteOrderErpOrderZoNingDelete, - getOrderErpOrderZoNingSelectAll, -} from '@/services'; -import type { ProColumns } from '@ant-design/pro-components'; -import { EditableProTable } from '@ant-design/pro-components'; -import { Button, Popconfirm, PopconfirmProps, message } from 'antd'; -import React, { useRef, useState } from 'react'; -import '../index.less'; -import { zoningItem, zoningShowItem } from './constant'; -import Modal from './modal'; - -const waitTime = (time: number = 100) => { - return new Promise((resolve) => { - setTimeout(() => { - resolve(true); - }, time); - }); -}; - -function changeToShow(array: zoningItem[]) { - console.log(JSON.parse(localStorage.getItem('userInfo')).username); - const showArray: zoningShowItem[] = array.map((item) => { - let orderProvinceShowList = ''; - let orderUserShowList = ''; - let orderUserNumberShowList: number[] = []; - item.orderProvinceVoList.forEach((element, index) => { - orderProvinceShowList += element.province; - if (index < item.orderProvinceVoList.length - 1) { - orderProvinceShowList += '、'; - } - }); - - item.orderUserVoList.forEach((event, index) => { - orderUserShowList += event.userName; - orderUserNumberShowList.push(event.uId); - if (index < item.orderUserVoList.length - 1) { - orderUserShowList += '、'; - } - }); - - if (orderUserShowList === '') { - orderUserShowList = '全选'; - orderUserNumberShowList.push(0); - } - - return { - id: item.id, - zoning: item.zoning, - orderProvinceShowList, - orderUserShowList, - orderUserNumberShowList, - }; - }); - return showArray; -} - -export default () => { - const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]); - const [dataSource, setDataSource] = useState<readonly zoningItem[]>([]); - const [position] = useState<'top' | 'bottom' | 'hidden'>('hidden'); - - interface ActionType { - reload: (resetPageIndex?: boolean) => void; - reloadAndRest: () => void; - reset: () => void; - clearSelected?: () => void; - startEditable: (rowKey: Key) => boolean; - cancelEditable: (rowKey: Key) => boolean; - } - - const ref = useRef<ActionType>({ - reload: () => {}, - reloadAndRest: () => {}, - reset: () => {}, - startEditable: () => {}, - cancelEditable: () => {}, - }); - - function reload() { - ref.current.reload(); - } - - const confirm: PopconfirmProps['onConfirm'] = async (id) => { - await deleteOrderErpOrderZoNingDelete({ - data: id, - }); - reload(); - message.success('删除成功'); - }; - - const cancel: PopconfirmProps['onCancel'] = () => { - message.error('取消删除'); - }; - - const columns: ProColumns<zoningItem>[] = [ - { - title: '区域名称', - dataIndex: 'zoning', - width: 200, - }, - { - title: '管辖省份', - dataIndex: 'orderProvinceShowList', - readonly: true, - width: 600, - }, - { - title: '负责销售', - key: 'state', - dataIndex: 'orderUserShowList', - valueType: 'select', - width: 200, - }, - { - title: '操作', - valueType: 'option', - width: 200, - render: (text, record) => [ - <> - <Modal - toReload={reload} - option={'编辑'} - needEditBody={record} - key={record.id} - /> - <Popconfirm - title="删除此项" - description="你确定你要删除此项吗?" - onConfirm={() => { - confirm(record.id); - }} - onCancel={cancel} - okText="确定" - cancelText="取消" - > - <Button>删除</Button> - </Popconfirm> - </>, - ], - }, - ]; - - return ( - <EditableProTable<zoningItem> - rowKey="id" - className="table-index" - deletePopconfirmMessage - actionRef={ref} - headerTitle={ - <Modal toReload={reload} option={'新增区域'} needEditBody={{}}></Modal> - } - maxLength={5} - scroll={{ - x: 960, - }} - recordCreatorProps={ - position !== 'hidden' - ? { - position: position as 'top', - record: () => ({ id: (Math.random() * 1000000).toFixed(0) }), - } - : false - } - loading={false} - columns={columns} - request={async () => { - const res = await getOrderErpOrderZoNingSelectAll(); - if (res) { - const initDataSource = changeToShow(res.data); - return { data: initDataSource || [] }; - } - }} - value={dataSource} - onChange={setDataSource} - editable={{ - type: 'multiple', - editableKeys, - onSave: async (rowKey, data, row) => { - console.log(rowKey, data, row); - await waitTime(2000); - }, - onChange: setEditableRowKeys, - }} - /> - ); -}; diff --git a/src/pages/User/ZoNing/index.tsx b/src/pages/User/ZoNing/index.tsx deleted file mode 100644 index a38095e..0000000 --- a/src/pages/User/ZoNing/index.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import Table from './components/table'; -const instalment_contect: React.FC = () => ( - <> - <Table></Table> - </> -); - -export default instalment_contect; diff --git a/src/services/definition.ts b/src/services/definition.ts index 482d759..45dd4db 100644 --- a/src/services/definition.ts +++ b/src/services/definition.ts @@ -221,8 +221,9 @@ export interface AdminDeptVO { pid?: number; } -export interface AdminInvoicingAccountDto { +export interface AdminInvoicingAccountDTO { account?: string; + accountText?: string; createByName?: string; /** @format date-time */ createTime?: string; @@ -230,6 +231,7 @@ export interface AdminInvoicingAccountDto { id?: number; logicDelete?: boolean; password?: string; + paths?: Array<string>; updateByName?: string; /** @format date-time */ updateTime?: string; @@ -698,7 +700,7 @@ export interface ApiQueryOrderStatusCountsRequest { uid?: number; } -export interface ApplyInvoiceDto { +export interface ApplyInvoiceDTO { /** * @description * 备注 @@ -749,6 +751,9 @@ export interface ApplyInvoiceDto { * 发票号码 */ invoiceNumber?: string; + invoicingAccount?: string; + /** @format date */ + invoicingDate?: string; /** * @description * 开票人 @@ -770,8 +775,6 @@ export interface ApplyInvoiceDto { * 开具类型 */ invoicingTypeText?: string; - /** @format date */ - invoicingdate?: string; /** * @description * 是否加急 @@ -1437,7 +1440,7 @@ export interface InvoiceDto { subOrderIds?: Array<number>; } -export interface InvoiceRecordDto { +export interface InvoiceRecordDTO { applyInvoicingNotes?: string; /** * @description @@ -1484,6 +1487,9 @@ export interface InvoiceRecordDto { * 发票号码 */ invoiceNumber?: string; + invoicingAccount?: string; + /** @format date */ + invoicingDate?: string; /** * @description * 开票人 @@ -1505,8 +1511,6 @@ export interface InvoiceRecordDto { * 开具类型 */ invoicingTypeText?: string; - /** @format date */ - invoicingdate?: string; /** * @description * 是否加急 @@ -1695,6 +1699,18 @@ export interface InvoiceRecordQueryRequest { /** * @description * 开票时间 + * @format date + */ + invoicingDateGe?: string; + /** + * @description + * 开票时间 + * @format date + */ + invoicingDateLe?: string; + /** + * @description + * 开票时间 * @format date-time */ invoicingTimeGe?: string; @@ -2589,6 +2605,7 @@ export interface QueryClientDto { companyAddressLike?: string; companyIds?: Array<number>; companyNameLike?: string; + createByUserIdIn?: Array<number>; /** @format date-time */ createTimeGe?: string; /** @format date-time */ @@ -2597,6 +2614,7 @@ export interface QueryClientDto { current?: number; /** @format int32 */ end?: number; + groupFilter?: string; hasScheme?: boolean; level?: string; namelike?: string; @@ -2728,6 +2746,18 @@ export interface QueryInvoiceRecordDto { /** * @description * 开票时间 + * @format date + */ + invoicingDateGe?: string; + /** + * @description + * 开票时间 + * @format date + */ + invoicingDateLe?: string; + /** + * @description + * 开票时间 * @format date-time */ invoicingTimeGe?: string; @@ -2908,75 +2938,53 @@ export interface ReissueInvoiceDto { purchaser?: string; } -export interface ResearchGroupAccountAddRequest { - /** - * @description - * 关联的账号id - * @format int64 - */ - accountId?: number; - /** - * @description - * 关联的账号名称 - */ - accountName?: string; +export interface ResearchGroupAddRequest { + accounts?: Array<ResearchGroupAccounts>; /** * @description - * 关联的账号手机号 + * 单位名称 */ - accountPhone?: string; + companyName?: string; + createByName?: string; + /** @format date-time */ + createTime?: string; /** * @description - * 课题组id - * @format int64 + * 课题组名称 */ - groupId?: number; -} - -export interface ResearchGroupAccountEditRequest { + groupName?: string; /** * @description - * 关联的账号id + * 主键id * @format int64 */ - accountId?: number; - /** - * @description - * 关联的账号名称 - */ - accountName?: string; - /** - * @description - * 关联的账号手机号 - */ - accountPhone?: string; + id?: number; /** * @description - * 课题组id - * @format int64 + * 负责人 */ - groupId?: number; + leaderName?: string; + logicDelete?: boolean; + members?: Array<ResearchGroupMembers>; + paths?: Array<string>; /** * @description - * 主键id - * @format int64 + * 状态 */ - id?: number; -} - -export interface ResearchGroupAddRequest { - accounts?: Array<ResearchGroupAccountAddRequest>; + status?: string; /** * @description - * 课题组名称 + * 冗余字段,当前状态备注 */ - group?: string; + statusNotes?: string; /** * @description - * 课题组负责人 + * 状态文本 */ - leader?: string; - members?: Array<ResearchGroupMemberAddRequest>; + statusText?: string; + updateByName?: string; + /** @format date-time */ + updateTime?: string; } export interface ResearchGroupDeleteRequest { @@ -2997,16 +3005,20 @@ export interface ResearchGroupDetailRequest { } export interface ResearchGroupEditRequest { + accounts?: Array<ResearchGroupAccounts>; /** * @description - * 课题组预存账号 + * 单位名称 */ - accounts?: Array<ResearchGroupAccountEditRequest>; + companyName?: string; + createByName?: string; + /** @format date-time */ + createTime?: string; /** * @description * 课题组名称 */ - group?: string; + groupName?: string; /** * @description * 主键id @@ -3015,14 +3027,30 @@ export interface ResearchGroupEditRequest { id?: number; /** * @description - * 课题组负责人 + * 负责人 */ - leader?: string; + leaderName?: string; + logicDelete?: boolean; + members?: Array<ResearchGroupMembers>; + paths?: Array<string>; /** * @description - * 课题组成员集合 + * 状态 */ - members?: Array<ResearchGroupMemberEditRequest>; + status?: string; + /** + * @description + * 冗余字段,当前状态备注 + */ + statusNotes?: string; + /** + * @description + * 状态文本 + */ + statusText?: string; + updateByName?: string; + /** @format date-time */ + updateTime?: string; } export interface ResearchGroupListRequest { @@ -3031,6 +3059,11 @@ export interface ResearchGroupListRequest { * 预存账号手机号 */ accountPhone?: string; + /** + * @description + * 公司名称 + */ + companyNameLike?: string; /** @format int32 */ current?: number; /** @format int32 */ @@ -3042,6 +3075,11 @@ export interface ResearchGroupListRequest { groupName?: string; /** * @description + * id + */ + idIn?: Array<number>; + /** + * @description * 课题组负责人 */ leaderName?: string; @@ -3059,30 +3097,34 @@ export interface ResearchGroupListRequest { pageSize?: number; /** @format int32 */ start?: number; + /** + * @description + * 状态 + */ + status?: string; /** @format int32 */ total?: number; } -export interface ResearchGroupMemberAddRequest { +export interface ResearchGroupMemberRequestAddRequest { /** * @description - * 课题组ID - * @format int64 + * 审核备注 */ - groupId?: number; + auditNotes?: string; /** * @description - * 成员名称 + * 审核状态:CREATED-未审核 AUDIT_FAIL-审核不通过 AUDIT_PASS-审核通过 */ - memberName?: string; + auditStatus?: string; /** * @description - * 成员手机号 + * 审核状态:CREATED-未审核 AUDIT_FAIL-审核不通过 AUDIT_PASS-审核通过 */ - memberPhone?: string; -} - -export interface ResearchGroupMemberEditRequest { + auditStatusText?: string; + createByName?: string; + /** @format date-time */ + createTime?: string; /** * @description * 课题组ID @@ -3091,10 +3133,16 @@ export interface ResearchGroupMemberEditRequest { groupId?: number; /** * @description + * 课题组名称 + */ + groupName?: string; + /** + * @description * 主键id * @format int64 */ id?: number; + logicDelete?: boolean; /** * @description * 成员名称 @@ -3105,26 +3153,26 @@ export interface ResearchGroupMemberEditRequest { * 成员手机号 */ memberPhone?: string; -} - -export interface ResearchGroupMemberRequestAddRequest { + members?: Array<ResearchGroupMembers>; + paths?: Array<string>; /** * @description - * 课题组ID - * @format int64 + * 权限 */ - groupId?: number; + permissions?: Array<string>; /** * @description - * 课题组名称 + * 申请备注 */ - groupName?: string; - members?: Array<ResearchGroupMemberAddRequest>; + requestNotes?: string; /** * @description - * 申请备注 + * 申请类型:APPEND-新增 REMOVE-删除 MODIFY-修改 */ - requestNotes?: string; + requestType?: string; + updateByName?: string; + /** @format date-time */ + updateTime?: string; } export interface ResearchGroupMemberRequestDeleteRequest { @@ -3147,6 +3195,24 @@ export interface ResearchGroupMemberRequestDetailRequest { export interface ResearchGroupMemberRequestEditRequest { /** * @description + * 审核备注 + */ + auditNotes?: string; + /** + * @description + * 审核状态:CREATED-未审核 AUDIT_FAIL-审核不通过 AUDIT_PASS-审核通过 + */ + auditStatus?: string; + /** + * @description + * 审核状态:CREATED-未审核 AUDIT_FAIL-审核不通过 AUDIT_PASS-审核通过 + */ + auditStatusText?: string; + createByName?: string; + /** @format date-time */ + createTime?: string; + /** + * @description * 课题组ID * @format int64 */ @@ -3162,6 +3228,7 @@ export interface ResearchGroupMemberRequestEditRequest { * @format int64 */ id?: number; + logicDelete?: boolean; /** * @description * 成员名称 @@ -3172,11 +3239,25 @@ export interface ResearchGroupMemberRequestEditRequest { * 成员手机号 */ memberPhone?: string; + paths?: Array<string>; + /** + * @description + * 权限 + */ + permissions?: Array<string>; /** * @description * 申请备注 */ requestNotes?: string; + /** + * @description + * 申请类型:APPEND-新增 REMOVE-删除 MODIFY-修改 + */ + requestType?: string; + updateByName?: string; + /** @format date-time */ + updateTime?: string; } export interface ResearchGroupMemberRequestsRequest { @@ -3385,6 +3466,7 @@ export interface SubOrder { /** @format date-time */ updateTime?: string; urgentInvoiceAuditNotes?: string; + useOldInvoicingProcess?: boolean; /** @format int32 */ version?: number; } @@ -3815,6 +3897,76 @@ export interface InvoiceDetail { unit?: string; } +export interface ResearchGroupAccounts { + /** + * @description + * 关联的账号id + * @format int64 + */ + accountId?: number; + /** + * @description + * 关联的账号名称 + */ + accountName?: string; + /** + * @description + * 关联的账号手机号 + */ + accountPhone?: string; + createByName?: string; + /** @format date-time */ + createTime?: string; + /** + * @description + * 课题组id + * @format int64 + */ + groupId?: number; + /** + * @description + * 主键id + * @format int64 + */ + id?: number; + logicDelete?: boolean; + updateByName?: string; + /** @format date-time */ + updateTime?: string; +} + +export interface ResearchGroupMembers { + createByName?: string; + /** @format date-time */ + createTime?: string; + /** + * @description + * 课题组ID + * @format int64 + */ + groupId?: number; + /** + * @description + * 主键id + * @format int64 + */ + id?: number; + logicDelete?: boolean; + /** + * @description + * 成员名称 + */ + memberName?: string; + /** + * @description + * 成员手机号 + */ + memberPhone?: string; + updateByName?: string; + /** @format date-time */ + updateTime?: string; +} + export interface SalesRechargePrepaymentAuditRequest { /** * @description diff --git a/src/services/request.ts b/src/services/request.ts index 498a6e3..ad3a256 100644 --- a/src/services/request.ts +++ b/src/services/request.ts @@ -9,7 +9,7 @@ import type { AdminClientDto, AdminDeptQueryVO, AdminDeptVO, - AdminInvoicingAccountDto, + AdminInvoicingAccountDTO, AdminJobQueryVO, AdminJobVO, AdminMenuQueryVO, @@ -31,7 +31,7 @@ import type { ApiOrderEvaluatedRequest, ApiQueryOrderDetailRequest, ApiQueryOrderStatusCountsRequest, - ApplyInvoiceDto, + ApplyInvoiceDTO, AuditDto, AuditVO, CancelInvoiceAndBankStatementDto, @@ -54,7 +54,7 @@ import type { Dto, InventoryMaterialStockReq, InvoiceDto, - InvoiceRecordDto, + InvoiceRecordDTO, InvoiceRecordQueryRequest, MainOrderqueryRequest, MaterialListReply, @@ -63,7 +63,6 @@ import type { MaterialUnitListRes, MeasureUnitListRes, MessageQueryDTO, - ModelAndView, OrderAddVO, OrderAuditLogQueryVO, OrderBaseInfoQueryVO, @@ -474,6 +473,60 @@ export const postAdminClientExportClients = /* #__PURE__ */ (() => { return request; })(); +/** @description response type for postAdminClientGetStatisticalData */ +export interface PostAdminClientGetStatisticalDataResponse { + /** + * @description + * OK + */ + 200: ServerResult; + /** + * @description + * Created + */ + 201: any; + /** + * @description + * Unauthorized + */ + 401: any; + /** + * @description + * Forbidden + */ + 403: any; + /** + * @description + * Not Found + */ + 404: any; +} + +export type PostAdminClientGetStatisticalDataResponseSuccess = + PostAdminClientGetStatisticalDataResponse[200]; +/** + * @description + * 修改跟进信息 + * @tags 客户管理 + * @produces * + * @consumes application/json + */ +export const postAdminClientGetStatisticalData = /* #__PURE__ */ (() => { + const method = 'post'; + const url = '/admin/client/getStatisticalData'; + function request(): Promise<PostAdminClientGetStatisticalDataResponseSuccess> { + return requester(request.url, { + method: request.method, + }) as unknown as Promise<PostAdminClientGetStatisticalDataResponseSuccess>; + } + + /** http method */ + request.method = method; + /** request url */ + request.url = url; + return request; +})(); + /** @description request parameter type for postAdminClientImportClient */ export interface PostAdminClientImportClientOption { /** @@ -3172,7 +3225,9 @@ export interface GetErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * Unauthorized @@ -3193,9 +3248,9 @@ export interface GetErrorResponse { export type GetErrorResponseSuccess = GetErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * */ export const getError = /* #__PURE__ */ (() => { const method = 'get'; @@ -3219,7 +3274,9 @@ export interface PutErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * Created @@ -3245,9 +3302,9 @@ export interface PutErrorResponse { export type PutErrorResponseSuccess = PutErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * * @consumes application/json */ export const putError = /* #__PURE__ */ (() => { @@ -3272,7 +3329,9 @@ export interface PostErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * Created @@ -3298,9 +3357,9 @@ export interface PostErrorResponse { export type PostErrorResponseSuccess = PostErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * * @consumes application/json */ export const postError = /* #__PURE__ */ (() => { @@ -3325,7 +3384,9 @@ export interface DeleteErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * No Content @@ -3346,9 +3407,9 @@ export interface DeleteErrorResponse { export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * */ export const deleteError = /* #__PURE__ */ (() => { const method = 'delete'; @@ -3372,7 +3433,9 @@ export interface OptionsErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * No Content @@ -3393,9 +3456,9 @@ export interface OptionsErrorResponse { export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * * @consumes application/json */ export const optionsError = /* #__PURE__ */ (() => { @@ -3420,7 +3483,9 @@ export interface HeadErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * No Content @@ -3441,9 +3506,9 @@ export interface HeadErrorResponse { export type HeadErrorResponseSuccess = HeadErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * * @consumes application/json */ export const headError = /* #__PURE__ */ (() => { @@ -3468,7 +3533,9 @@ export interface PatchErrorResponse { * @description * OK */ - 200: ModelAndView; + 200: { + [propertyName: string]: any; + }; /** * @description * No Content @@ -3489,9 +3556,9 @@ export interface PatchErrorResponse { export type PatchErrorResponseSuccess = PatchErrorResponse[200]; /** * @description - * errorHtml + * error * @tags basic-error-controller - * @produces text/html + * @produces * * @consumes application/json */ export const patchError = /* #__PURE__ */ (() => { @@ -10517,7 +10584,7 @@ export type PostResearchGroupMemberRequestsAddResponseSuccess = /** * @description * 新增申请信息 - * @tags research-group-member-requests-controller + * @tags research-group-request-controller * @produces * * @consumes application/json */ @@ -10588,7 +10655,7 @@ export type PostResearchGroupMemberRequestsDeleteResponseSuccess = /** * @description * 删除申请信息 - * @tags research-group-member-requests-controller + * @tags research-group-request-controller * @produces * * @consumes application/json */ @@ -10659,7 +10726,7 @@ export type PostResearchGroupMemberRequestsDetailResponseSuccess = /** * @description * 查询申请信息 - * @tags research-group-member-requests-controller + * @tags research-group-request-controller * @produces * * @consumes application/json */ @@ -10730,7 +10797,7 @@ export type PostResearchGroupMemberRequestsEditResponseSuccess = /** * @description * 编辑申请信息 - * @tags research-group-member-requests-controller + * @tags research-group-request-controller * @produces * * @consumes application/json */ @@ -10801,7 +10868,7 @@ export type PostResearchGroupMemberRequestsListResponseSuccess = /** * @description * 申请列表 - * @tags research-group-member-requests-controller + * @tags research-group-request-controller * @produces * * @consumes application/json */ @@ -11865,6 +11932,60 @@ export const postServiceConstCanApplyAfterInvoicingStatus = return request; })(); +/** @description response type for postServiceConstClientGroupFilters */ +export interface PostServiceConstClientGroupFiltersResponse { + /** + * @description + * OK + */ + 200: ServerResult; + /** + * @description + * Created + */ + 201: any; + /** + * @description + * Unauthorized + */ + 401: any; + /** + * @description + * Forbidden + */ + 403: any; + /** + * @description + * Not Found + */ + 404: any; +} + +export type PostServiceConstClientGroupFiltersResponseSuccess = + PostServiceConstClientGroupFiltersResponse[200]; +/** + * @description + * 获取客户分组 + * @tags front-const-controller + * @produces * + * @consumes application/json + */ +export const postServiceConstClientGroupFilters = /* #__PURE__ */ (() => { + const method = 'post'; + const url = '/service/const/clientGroupFilters'; + function request(): Promise<PostServiceConstClientGroupFiltersResponseSuccess> { + return requester(request.url, { + method: request.method, + }) as unknown as Promise<PostServiceConstClientGroupFiltersResponseSuccess>; + } + + /** http method */ + request.method = method; + /** request url */ + request.url = url; + return request; +})(); + /** @description response type for postServiceConstClientLevels */ export interface PostServiceConstClientLevelsResponse { /** @@ -11973,6 +12094,77 @@ export const postServiceConstGetPayeeEnum = /* #__PURE__ */ (() => { return request; })(); +/** @description request parameter type for postServiceConstInitInvoiceDetailNames */ +export interface PostServiceConstInitInvoiceDetailNamesOption { + /** + * @description + * productNames + */ + body: { + /** + @description + productNames */ + productNames: Array<string>; + }; +} + +/** @description response type for postServiceConstInitInvoiceDetailNames */ +export interface PostServiceConstInitInvoiceDetailNamesResponse { + /** + * @description + * OK + */ + 200: ServerResult; + /** + * @description + * Created + */ + 201: any; + /** + * @description + * Unauthorized + */ + 401: any; + /** + * @description + * Forbidden + */ + 403: any; + /** + * @description + * Not Found + */ + 404: any; +} + +export type PostServiceConstInitInvoiceDetailNamesResponseSuccess = + PostServiceConstInitInvoiceDetailNamesResponse[200]; +/** + * @description + * 根据公司名获取收款方 + * @tags front-const-controller + * @produces * + * @consumes application/json + */ +export const postServiceConstInitInvoiceDetailNames = /* #__PURE__ */ (() => { + const method = 'post'; + const url = '/service/const/initInvoiceDetailNames'; + function request( + option: PostServiceConstInitInvoiceDetailNamesOption, + ): Promise<PostServiceConstInitInvoiceDetailNamesResponseSuccess> { + return requester(request.url, { + method: request.method, + ...option, + }) as unknown as Promise<PostServiceConstInitInvoiceDetailNamesResponseSuccess>; + } + + /** http method */ + request.method = method; + /** request url */ + request.url = url; + return request; +})(); + /** @description response type for postServiceConstInvoiceType */ export interface PostServiceConstInvoiceTypeResponse { /** @@ -12152,6 +12344,60 @@ export const postServiceConstListInvoiceDetailNames = /* #__PURE__ */ (() => { return request; })(); +/** @description response type for postServiceConstListResearchGroupsStatus */ +export interface PostServiceConstListResearchGroupsStatusResponse { + /** + * @description + * OK + */ + 200: ServerResult; + /** + * @description + * Created + */ + 201: any; + /** + * @description + * Unauthorized + */ + 401: any; + /** + * @description + * Forbidden + */ + 403: any; + /** + * @description + * Not Found + */ + 404: any; +} + +export type PostServiceConstListResearchGroupsStatusResponseSuccess = + PostServiceConstListResearchGroupsStatusResponse[200]; +/** + * @description + * 获取课题组状态 + * @tags front-const-controller + * @produces * + * @consumes application/json + */ +export const postServiceConstListResearchGroupsStatus = /* #__PURE__ */ (() => { + const method = 'post'; + const url = '/service/const/listResearchGroupsStatus'; + function request(): Promise<PostServiceConstListResearchGroupsStatusResponseSuccess> { + return requester(request.url, { + method: request.method, + }) as unknown as Promise<PostServiceConstListResearchGroupsStatusResponseSuccess>; + } + + /** http method */ + request.method = method; + /** request url */ + request.url = url; + return request; +})(); + /** @description response type for postServiceConstNotCanModifyInvoiceRecordStatus */ export interface PostServiceConstNotCanModifyInvoiceRecordStatusResponse { /** @@ -12416,7 +12662,7 @@ export interface PostServiceInvoiceAddInvoicingAccountOption { /** @description dto */ - dto: AdminInvoicingAccountDto; + dto: AdminInvoicingAccountDTO; }; } @@ -12487,7 +12733,7 @@ export interface PostServiceInvoiceApplyInvoiceOption { /** @description dto */ - dto: ApplyInvoiceDto; + dto: ApplyInvoiceDTO; }; } @@ -13534,7 +13780,7 @@ export interface PostServiceInvoiceModifyRecordOption { /** @description dto */ - dto: InvoiceRecordDto; + dto: InvoiceRecordDTO; }; }