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,16 +102,20 @@ const InvoiceRecord = () => {
102 fixed: 'right', 102 fixed: 'right',
103 width: 160, 103 width: 160,
104 render: (text, record, _, action) => { 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 if (record.paths?.includes('writeOff') && !record.writeOffId) { 120 if (record.paths?.includes('writeOff') && !record.writeOffId) {
117 btns.push( 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,6 +84,7 @@ export const INVOICE_COLUMNS = [
84 dataIndex: 'orderTypeText', 84 dataIndex: 'orderTypeText',
85 readonly: true, 85 readonly: true,
86 valueType: 'text', 86 valueType: 'text',
  87 + hideInSearch: true,
87 width: 180, 88 width: 180,
88 }, 89 },
89 { 90 {
@@ -170,6 +171,13 @@ export const INVOICE_COLUMNS = [ @@ -170,6 +171,13 @@ export const INVOICE_COLUMNS = [
170 dataIndex: 'invoicingTime', 171 dataIndex: 'invoicingTime',
171 valueType: 'date', 172 valueType: 'date',
172 width: 150, 173 width: 150,
  174 + hideInSearch: true,
  175 + },
  176 + {
  177 + title: '开票日期',
  178 + dataIndex: 'invoicingTime',
  179 + valueType: 'date',
  180 + width: 150,
173 search: { 181 search: {
174 transform: (value) => { 182 transform: (value) => {
175 if (value) { 183 if (value) {
src/pages/Invoice/waitProcessRecord/components/Invoice.tsx
@@ -139,7 +139,9 @@ const ProjectContainer = styled.div` @@ -139,7 +139,9 @@ const ProjectContainer = styled.div`
139 border-top: 2px solid #b16363; 139 border-top: 2px solid #b16363;
140 border-right: 2px solid #b16363; 140 border-right: 2px solid #b16363;
141 border-left: 2px solid #b16363; 141 border-left: 2px solid #b16363;
  142 + max-height: 500px; /* 设置最大高度,根据需要调整 */
142 overflow: auto; 143 overflow: auto;
  144 +
143 .single-project { 145 .single-project {
144 width: 100%; 146 width: 100%;
145 height: 30px; 147 height: 30px;
src/pages/Order/Order/components/InvoicingDrawerForm.tsx
1 // import { PlusOutlined } from '@ant-design/icons'; 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 import { 3 import {
4 postServiceConstGetPayeeEnum, 4 postServiceConstGetPayeeEnum,
5 postServiceConstInitInvoiceDetailNames, 5 postServiceConstInitInvoiceDetailNames,
src/pages/Order/Order/index.tsx
@@ -4167,6 +4167,7 @@ const OrderPage = () =&gt; { @@ -4167,6 +4167,7 @@ const OrderPage = () =&gt; {
4167 if ( 4167 if (
4168 roleCode === 'admin' || 4168 roleCode === 'admin' ||
4169 roleCode === 'salesManager' || 4169 roleCode === 'salesManager' ||
  4170 + roles.includes('PROCURE') ||
4170 roleCode === 'salesRepresentative' 4171 roleCode === 'salesRepresentative'
4171 ) { 4172 ) {
4172 radios.push(<Radio value={70}>只看作废</Radio>); 4173 radios.push(<Radio value={70}>只看作废</Radio>);
src/pages/Order/OrderWarning/components/InvoicingDrawerForm.tsx
1 // import { PlusOutlined } from '@ant-design/icons'; 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 import { 3 import {
4 postServiceConstGetPayeeEnum, 4 postServiceConstGetPayeeEnum,
5 postServiceConstInitInvoiceDetailNames, 5 postServiceConstInitInvoiceDetailNames,
src/pages/Order/constant.ts
@@ -124,6 +124,9 @@ export const getNeedInvoicing = (subOrder: any) =&gt; { @@ -124,6 +124,9 @@ export const getNeedInvoicing = (subOrder: any) =&gt; {
124 if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) { 124 if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) {
125 return '已开票'; 125 return '已开票';
126 } 126 }
  127 + if (subOrder.afterInvoicingStatus === 'COMPLETE_INVOICING') {
  128 + return '已开票';
  129 + }
127 if (subOrder.afterInvoicingStatus === 'REISSUE') { 130 if (subOrder.afterInvoicingStatus === 'REISSUE') {
128 return '重新开票'; 131 return '重新开票';
129 } 132 }