Commit 0567bf0b4703cadc7ed5895ca9c853e31fb61d97

Authored by boyang
2 parents 2043dafa 4226626f

Merge branch 'master' of http://39.108.227.113:8001/zhusen/canrd-erp-front

# Conflicts:
#	src/pages/Order/OrderWarning/indexhide.tsx
src/pages/Invoice/Invoice/index.tsx
... ... @@ -102,16 +102,20 @@ const InvoiceRecord = () => {
102 102 fixed: 'right',
103 103 width: 160,
104 104 render: (text, record, _, action) => {
105   - let btns = [
106   - <a
107   - key="editable"
108   - onClick={() => {
109   - action?.startEditable?.(record.id);
110   - }}
111   - >
112   - 编辑
113   - </a>,
114   - ];
  105 + let btns = [];
  106 +
  107 + if (record.paths?.includes('edit')) {
  108 + btns.push(
  109 + <a
  110 + key="editable"
  111 + onClick={() => {
  112 + action?.startEditable?.(record.id);
  113 + }}
  114 + >
  115 + 编辑
  116 + </a>,
  117 + );
  118 + }
115 119  
116 120 if (record.paths?.includes('writeOff') && !record.writeOffId) {
117 121 btns.push(
... ...
src/pages/Invoice/InvoiceRecord/components/InvoiceModal.tsx deleted 100644 → 0
1   -import Invoice from '@/pages/Invoice/InvoiceRecord/components/Invoice';
2   -import { postServiceInvoiceGetInvoiceRecord } from '@/services';
3   -import { ModalForm } from '@ant-design/pro-components';
4   -import { Form } from 'antd';
5   -import { useEffect, useState } from 'react';
6   -
7   -export default ({ recordId, getRecord, button }) => {
8   - const [data, setData] = useState<any>({});
9   - const getData = async () => {
10   - let ret = await postServiceInvoiceGetInvoiceRecord({
11   - query: {
12   - id: recordId,
13   - },
14   - });
15   - setData(ret.data);
16   - };
17   - useEffect(() => {
18   - if (recordId) {
19   - getData();
20   - }
21   - }, []);
22   - const [form] = Form.useForm();
23   - return (
24   - <ModalForm
25   - title="预览发票"
26   - trigger={button ? button : <a type="primary">预览</a>}
27   - onOpenChange={(open) => {
28   - if (open) {
29   - if (getRecord) {
30   - setData(getRecord());
31   - } else {
32   - getData();
33   - }
34   - }
35   - }}
36   - width={1200}
37   - form={form}
38   - autoFocusFirstInput
39   - submitter={false}
40   - modalProps={{
41   - destroyOnClose: true,
42   - }}
43   - >
44   - <hr />
45   - <Invoice data={data} />
46   - </ModalForm>
47   - );
48   -};
src/pages/Invoice/constant.tsx
... ... @@ -84,6 +84,7 @@ export const INVOICE_COLUMNS = [
84 84 dataIndex: 'orderTypeText',
85 85 readonly: true,
86 86 valueType: 'text',
  87 + hideInSearch: true,
87 88 width: 180,
88 89 },
89 90 {
... ... @@ -170,6 +171,13 @@ export const INVOICE_COLUMNS = [
170 171 dataIndex: 'invoicingTime',
171 172 valueType: 'date',
172 173 width: 150,
  174 + hideInSearch: true,
  175 + },
  176 + {
  177 + title: '开票日期',
  178 + dataIndex: 'invoicingTime',
  179 + valueType: 'date',
  180 + width: 150,
173 181 search: {
174 182 transform: (value) => {
175 183 if (value) {
... ...
src/pages/Invoice/waitProcessRecord/components/Invoice.tsx
... ... @@ -139,7 +139,9 @@ const ProjectContainer = styled.div`
139 139 border-top: 2px solid #b16363;
140 140 border-right: 2px solid #b16363;
141 141 border-left: 2px solid #b16363;
  142 + max-height: 500px; /* 设置最大高度,根据需要调整 */
142 143 overflow: auto;
  144 +
143 145 .single-project {
144 146 width: 100%;
145 147 height: 30px;
... ...
src/pages/Order/Order/components/InvoicingDrawerForm.tsx
1 1 // import { PlusOutlined } from '@ant-design/icons';
2   -import InvoiceModal from '@/pages/Invoice/InvoiceVerification/components/InvoiceModal';
  2 +import InvoiceModal from '@/pages/Invoice/waitProcessRecord/components/InvoiceModal';
3 3 import {
4 4 postServiceConstGetPayeeEnum,
5 5 postServiceConstInitInvoiceDetailNames,
... ...
src/pages/Order/Order/index.tsx
... ... @@ -4167,6 +4167,7 @@ const OrderPage = () =&gt; {
4167 4167 if (
4168 4168 roleCode === 'admin' ||
4169 4169 roleCode === 'salesManager' ||
  4170 + roles.includes('PROCURE') ||
4170 4171 roleCode === 'salesRepresentative'
4171 4172 ) {
4172 4173 radios.push(<Radio value={70}>只看作废</Radio>);
... ...
src/pages/Order/OrderWarning/components/InvoicingDrawerForm.tsx
1 1 // import { PlusOutlined } from '@ant-design/icons';
2   -import InvoiceModal from '@/pages/Invoice/InvoiceVerification/components/InvoiceModal';
  2 +import InvoiceModal from '@/pages/Invoice/waitProcessRecord/components/InvoiceModal';
3 3 import {
4 4 postServiceConstGetPayeeEnum,
5 5 postServiceConstInitInvoiceDetailNames,
... ...
src/pages/Order/constant.ts
... ... @@ -124,6 +124,9 @@ export const getNeedInvoicing = (subOrder: any) =&gt; {
124 124 if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) {
125 125 return '已开票';
126 126 }
  127 + if (subOrder.afterInvoicingStatus === 'COMPLETE_INVOICING') {
  128 + return '已开票';
  129 + }
127 130 if (subOrder.afterInvoicingStatus === 'REISSUE') {
128 131 return '重新开票';
129 132 }
... ...