Commit 1a0e794e7f86e12d75e33b62a1b6c6aecf3e5bb9

Authored by 曾国涛
2 parents ab8e1402 a5ac14c9

Merge branch 'master' into warning

.umirc.ts
@@ -92,14 +92,14 @@ export default defineConfig({ @@ -92,14 +92,14 @@ export default defineConfig({
92 name: '发票核销', 92 name: '发票核销',
93 path: 'invoice', 93 path: 'invoice',
94 icon: 'BookOutlined', 94 icon: 'BookOutlined',
95 - access: 'canReadAdminAndFinance', 95 + access: 'canReadAdminAndFinanceAndSales',
96 component: './Invoice/Invoice', 96 component: './Invoice/Invoice',
97 }, 97 },
98 { 98 {
99 name: '银行流水', 99 name: '银行流水',
100 path: 'invoiceVerification', 100 path: 'invoiceVerification',
101 icon: 'BookOutlined', 101 icon: 'BookOutlined',
102 - access: 'canReadAdminAndFinance', 102 + access: 'canReadAdminAndFinanceAndSales',
103 component: './Invoice/InvoiceVerification', 103 component: './Invoice/InvoiceVerification',
104 }, 104 },
105 { 105 {
src/pages/Invoice/Invoice/components/InvoiceVerificationModal.tsx
@@ -14,7 +14,6 @@ import { @@ -14,7 +14,6 @@ import {
14 import { useEffect, useRef, useState } from 'react'; 14 import { useEffect, useRef, useState } from 'react';
15 import '../index.less'; 15 import '../index.less';
16 import BankChooseModal from './BankChooseModal'; 16 import BankChooseModal from './BankChooseModal';
17 -  
18 export default ({ invoiceId, setVisible, onClose }) => { 17 export default ({ invoiceId, setVisible, onClose }) => {
19 const [form] = Form.useForm<{ id: string }>(); 18 const [form] = Form.useForm<{ id: string }>();
20 const [bankChooseModalVisible, setBankChooseModalVisible] = useState(false); 19 const [bankChooseModalVisible, setBankChooseModalVisible] = useState(false);
@@ -41,7 +40,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; { @@ -41,7 +40,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; {
41 className="pl-1 pr-0" 40 className="pl-1 pr-0"
42 type="link" 41 type="link"
43 target="_blank" 42 target="_blank"
44 - href={'/order?id=' + item} 43 + href={'/order/order?id=' + item}
45 > 44 >
46 {item} 45 {item}
47 </Button> 46 </Button>
src/pages/Invoice/Invoice/components/invoiceWriteOffModal.tsx
@@ -275,7 +275,7 @@ export default ({ getData, triggerButton, readOnly }) =&gt; { @@ -275,7 +275,7 @@ export default ({ getData, triggerButton, readOnly }) =&gt; {
275 className="pl-1 pr-0" 275 className="pl-1 pr-0"
276 type="link" 276 type="link"
277 target="_blank" 277 target="_blank"
278 - href={'/order?id=' + mainId} 278 + href={'/order/order?id=' + mainId}
279 > 279 >
280 {mainId} 280 {mainId}
281 </Button> 281 </Button>
src/pages/Invoice/Invoice/index.tsx
@@ -24,6 +24,7 @@ const InvoiceRecord = () =&gt; { @@ -24,6 +24,7 @@ const InvoiceRecord = () =&gt; {
24 const [invoiceVerificationVisible, setInvoiceVerificationVisible] = 24 const [invoiceVerificationVisible, setInvoiceVerificationVisible] =
25 useState(false); 25 useState(false);
26 const [invoiceId, setInvoiceId] = useState(undefined); 26 const [invoiceId, setInvoiceId] = useState(undefined);
  27 + const [perms, setPerms] = useState([]);
27 const [messageApi, contextHolder] = message.useMessage(); 28 const [messageApi, contextHolder] = message.useMessage();
28 const reloadInvoiceTable = () => { 29 const reloadInvoiceTable = () => {
29 invoiceActionRef.current?.reload(); 30 invoiceActionRef.current?.reload();
@@ -101,7 +102,7 @@ const InvoiceRecord = () =&gt; { @@ -101,7 +102,7 @@ const InvoiceRecord = () =&gt; {
101 width: 160, 102 width: 160,
102 render: (text, record) => { 103 render: (text, record) => {
103 let btns = []; 104 let btns = [];
104 - if (!record.writeOffId) { 105 + if (record.paths?.includes('writeOff') && !record.writeOffId) {
105 btns.push( 106 btns.push(
106 <InvoiceWriteOffModal 107 <InvoiceWriteOffModal
107 getData={() => { 108 getData={() => {
@@ -120,7 +121,7 @@ const InvoiceRecord = () =&gt; { @@ -120,7 +121,7 @@ const InvoiceRecord = () =&gt; {
120 ); 121 );
121 } 122 }
122 123
123 - if (record.writeOffId) { 124 + if (record.paths?.includes('writeOff') && record.writeOffId) {
124 btns.push( 125 btns.push(
125 <InvoiceWriteOffModal 126 <InvoiceWriteOffModal
126 getData={async () => { 127 getData={async () => {
@@ -192,13 +193,14 @@ const InvoiceRecord = () =&gt; { @@ -192,13 +193,14 @@ const InvoiceRecord = () =&gt; {
192 actionRef={invoiceActionRef} 193 actionRef={invoiceActionRef}
193 cardBordered 194 cardBordered
194 pagination={{ 195 pagination={{
195 - pageSize: 10, 196 + pageSizeOptions: ['10', '20', '50', '100'],
196 }} 197 }}
197 request={async (params) => { 198 request={async (params) => {
198 const res = await postServiceInvoiceQueryInvoice({ 199 const res = await postServiceInvoiceQueryInvoice({
199 data: { ...params }, 200 data: { ...params },
200 }); 201 });
201 if (res) { 202 if (res) {
  203 + setPerms(res?.data?.specialPath);
202 return { 204 return {
203 data: res?.data?.data || [], 205 data: res?.data?.data || [],
204 total: res?.data?.total || 0, 206 total: res?.data?.total || 0,
@@ -254,18 +256,26 @@ const InvoiceRecord = () =&gt; { @@ -254,18 +256,26 @@ const InvoiceRecord = () =&gt; {
254 headerTitle="发票列表" 256 headerTitle="发票列表"
255 scroll={{ x: 1400, y: 360 }} 257 scroll={{ x: 1400, y: 360 }}
256 toolBarRender={() => [ 258 toolBarRender={() => [
257 - <AddInvoiceDrawerForm  
258 - onClose={() => {  
259 - invoiceActionRef.current?.reload();  
260 - }}  
261 - key="add"  
262 - ></AddInvoiceDrawerForm>,  
263 - <InvoiceWriteOffModal  
264 - readOnly={false}  
265 - getData={() => ({})}  
266 - key="writeOff"  
267 - triggerButton={<Button type="primary">核销</Button>}  
268 - />, 259 + <>
  260 + {perms?.includes('add') && (
  261 + <AddInvoiceDrawerForm
  262 + onClose={() => {
  263 + invoiceActionRef.current?.reload();
  264 + }}
  265 + key="add"
  266 + ></AddInvoiceDrawerForm>
  267 + )}
  268 + </>,
  269 + <>
  270 + {perms?.includes('writeOff') && (
  271 + <InvoiceWriteOffModal
  272 + readOnly={false}
  273 + getData={() => ({})}
  274 + key="writeOff"
  275 + triggerButton={<Button type="primary">核销</Button>}
  276 + />
  277 + )}
  278 + </>,
269 ]} 279 ]}
270 /> 280 />
271 281
src/pages/Invoice/InvoiceRecord/components/InvoiceRecordDetailModal.tsx
@@ -254,13 +254,13 @@ export default ({ id, setVisible, reloadTable }) =&gt; { @@ -254,13 +254,13 @@ export default ({ id, setVisible, reloadTable }) =&gt; {
254 itemRender={({}, { record }) => { 254 itemRender={({}, { record }) => {
255 console.log('record' + JSON.stringify(record)); 255 console.log('record' + JSON.stringify(record));
256 return ( 256 return (
257 - <Space> 257 + <Space size={[8, 16]} wrap>
258 <Button 258 <Button
259 key={record.mainId} 259 key={record.mainId}
260 className="pl-1 pr-0" 260 className="pl-1 pr-0"
261 type="link" 261 type="link"
262 target="_blank" 262 target="_blank"
263 - href={'/order?id=' + record.mainId} 263 + href={'/order/order?id=' + record.mainId}
264 > 264 >
265 {record.mainId} 265 {record.mainId}
266 </Button> 266 </Button>
@@ -272,7 +272,7 @@ export default ({ id, setVisible, reloadTable }) =&gt; { @@ -272,7 +272,7 @@ export default ({ id, setVisible, reloadTable }) =&gt; {
272 className="pl-1 pr-0" 272 className="pl-1 pr-0"
273 type="link" 273 type="link"
274 target="_blank" 274 target="_blank"
275 - href={'/order?subOrderId=' + item} 275 + href={'/order/order?subOrderId=' + item}
276 > 276 >
277 {item} 277 {item}
278 </Button> 278 </Button>
src/pages/Invoice/InvoiceRecord/components/InvoiceVerificationModal.tsx
@@ -57,7 +57,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; { @@ -57,7 +57,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; {
57 className="pl-1 pr-0" 57 className="pl-1 pr-0"
58 type="link" 58 type="link"
59 target="_blank" 59 target="_blank"
60 - href={'/order?id=' + item} 60 + href={'/order/order?id=' + item}
61 > 61 >
62 {item} 62 {item}
63 </Button> 63 </Button>
src/pages/Invoice/InvoiceVerification/components/InvoiceRecordDetailModal.tsx
@@ -259,7 +259,7 @@ export default ({ id, setVisible }) =&gt; { @@ -259,7 +259,7 @@ export default ({ id, setVisible }) =&gt; {
259 className="pl-1 pr-0" 259 className="pl-1 pr-0"
260 type="link" 260 type="link"
261 target="_blank" 261 target="_blank"
262 - href={'/order?id=' + record.mainId} 262 + href={'/order/order?id=' + record.mainId}
263 > 263 >
264 {record.mainId} 264 {record.mainId}
265 </Button> 265 </Button>
@@ -271,7 +271,7 @@ export default ({ id, setVisible }) =&gt; { @@ -271,7 +271,7 @@ export default ({ id, setVisible }) =&gt; {
271 className="pl-1 pr-0" 271 className="pl-1 pr-0"
272 type="link" 272 type="link"
273 target="_blank" 273 target="_blank"
274 - href={'/order?subOrderId=' + item} 274 + href={'/order/order?subOrderId=' + item}
275 > 275 >
276 {item} 276 {item}
277 </Button> 277 </Button>
src/pages/Invoice/InvoiceVerification/components/InvoiceVerificationModal.tsx
@@ -44,7 +44,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; { @@ -44,7 +44,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; {
44 className="pl-1 pr-0" 44 className="pl-1 pr-0"
45 type="link" 45 type="link"
46 target="_blank" 46 target="_blank"
47 - href={'/order?id=' + item} 47 + href={'/order/order?id=' + item}
48 > 48 >
49 {item} 49 {item}
50 </Button> 50 </Button>
src/pages/Invoice/InvoiceVerification/index.tsx
@@ -30,6 +30,7 @@ const InvoiceRecord = () =&gt; { @@ -30,6 +30,7 @@ const InvoiceRecord = () =&gt; {
30 const [bankImportModalVisible, setBankImportModalVisible] = useState(false); 30 const [bankImportModalVisible, setBankImportModalVisible] = useState(false);
31 const [invoiceVerificationVisible, setInvoiceVerificationVisible] = 31 const [invoiceVerificationVisible, setInvoiceVerificationVisible] =
32 useState(false); 32 useState(false);
  33 + const [perms, setPerms] = useState([]);
33 const [messageApi, contextHolder] = message.useMessage(); 34 const [messageApi, contextHolder] = message.useMessage();
34 const [invoiceId] = useState(undefined); 35 const [invoiceId] = useState(undefined);
35 const [invoiceRecordDetailVisible, setInvoiceRecordDetailVisible] = 36 const [invoiceRecordDetailVisible, setInvoiceRecordDetailVisible] =
@@ -137,7 +138,7 @@ const InvoiceRecord = () =&gt; { @@ -137,7 +138,7 @@ const InvoiceRecord = () =&gt; {
137 ); 138 );
138 } 139 }
139 140
140 - if (record.writeOffId !== null) { 141 + if (record.paths?.includes('writeOff') && record.writeOffId !== null) {
141 btns.push( 142 btns.push(
142 <InvoiceWriteOffModal 143 <InvoiceWriteOffModal
143 getData={async () => { 144 getData={async () => {
@@ -192,7 +193,7 @@ const InvoiceRecord = () =&gt; { @@ -192,7 +193,7 @@ const InvoiceRecord = () =&gt; {
192 actionRef={bankActionRef} 193 actionRef={bankActionRef}
193 cardBordered 194 cardBordered
194 pagination={{ 195 pagination={{
195 - pageSize: 10, 196 + pageSizeOptions: ['10', '20', '50', '100'],
196 }} 197 }}
197 editable={{ 198 editable={{
198 type: 'multiple', 199 type: 'multiple',
@@ -209,6 +210,7 @@ const InvoiceRecord = () =&gt; { @@ -209,6 +210,7 @@ const InvoiceRecord = () =&gt; {
209 data: { ...params }, 210 data: { ...params },
210 }); 211 });
211 if (res) { 212 if (res) {
  213 + setPerms(res?.data?.specialPath);
212 return { 214 return {
213 data: res?.data?.data || [], 215 data: res?.data?.data || [],
214 total: res?.data?.total || 0, 216 total: res?.data?.total || 0,
@@ -264,16 +266,20 @@ const InvoiceRecord = () =&gt; { @@ -264,16 +266,20 @@ const InvoiceRecord = () =&gt; {
264 headerTitle="银行流水列表" 266 headerTitle="银行流水列表"
265 scroll={{ x: 1400, y: 360 }} 267 scroll={{ x: 1400, y: 360 }}
266 toolBarRender={() => [ 268 toolBarRender={() => [
267 - <Button  
268 - key="button"  
269 - icon={<PlusOutlined />}  
270 - onClick={() => {  
271 - setBankImportModalVisible(true);  
272 - }}  
273 - type="primary"  
274 - >  
275 - 导入  
276 - </Button>, 269 + <>
  270 + {perms?.includes('import') && (
  271 + <Button
  272 + key="button"
  273 + icon={<PlusOutlined />}
  274 + onClick={() => {
  275 + setBankImportModalVisible(true);
  276 + }}
  277 + type="primary"
  278 + >
  279 + 导入
  280 + </Button>
  281 + )}
  282 + </>,
277 ]} 283 ]}
278 /> 284 />
279 285
src/pages/Invoice/constant.tsx
@@ -86,11 +86,18 @@ export const INVOICE_COLUMNS = [ @@ -86,11 +86,18 @@ export const INVOICE_COLUMNS = [
86 { 86 {
87 title: '绑定流水号', 87 title: '绑定流水号',
88 dataIndex: 'serialNumbersTextByOrder', 88 dataIndex: 'serialNumbersTextByOrder',
89 - 89 + hideInSearch: true,
90 valueType: 'text', 90 valueType: 'text',
91 width: 180, 91 width: 180,
92 }, 92 },
93 { 93 {
  94 + title: '金额',
  95 + dataIndex: 'money',
  96 + hideInTable: true,
  97 + valueType: 'money',
  98 + width: 180,
  99 + },
  100 + {
94 title: '是否预付款', 101 title: '是否预付款',
95 dataIndex: 'orderIsPrePay', 102 dataIndex: 'orderIsPrePay',
96 valueType: 'select', 103 valueType: 'select',
@@ -294,6 +301,13 @@ export const BANK_STATEMENT_COLUMNS = [ @@ -294,6 +301,13 @@ export const BANK_STATEMENT_COLUMNS = [
294 hideInSearch: true, 301 hideInSearch: true,
295 }, 302 },
296 { 303 {
  304 + dataIndex: 'amount',
  305 + title: '金额',
  306 + valueType: 'money',
  307 + width: 100,
  308 + hideInTable: true,
  309 + },
  310 + {
297 dataIndex: 'remark', 311 dataIndex: 'remark',
298 title: '备注', 312 title: '备注',
299 valueType: 'text', 313 valueType: 'text',
src/pages/Invoice/waitProcessRecord/components/InvoiceVerificationModal.tsx
@@ -57,7 +57,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; { @@ -57,7 +57,7 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; {
57 className="pl-1 pr-0" 57 className="pl-1 pr-0"
58 type="link" 58 type="link"
59 target="_blank" 59 target="_blank"
60 - href={'/order?id=' + item} 60 + href={'/order/order?id=' + item}
61 > 61 >
62 {item} 62 {item}
63 </Button> 63 </Button>
src/pages/Order/Order/components/InvoiceSubOrderInfoTable.tsx
@@ -27,7 +27,7 @@ const columns: ProColumns[] = [ @@ -27,7 +27,7 @@ const columns: ProColumns[] = [
27 className="pl-1 pr-0" 27 className="pl-1 pr-0"
28 type="link" 28 type="link"
29 target="_blank" 29 target="_blank"
30 - href={'/order?id=' + subOrderId} 30 + href={'/order/order?id=' + subOrderId}
31 > 31 >
32 {subOrderId} 32 {subOrderId}
33 </Button> 33 </Button>
src/pages/Order/Order/components/InvoicingDrawerForm.tsx
@@ -60,7 +60,7 @@ export default ({ dataList, setVisible, mainOrder, onClose }) =&gt; { @@ -60,7 +60,7 @@ export default ({ dataList, setVisible, mainOrder, onClose }) =&gt; {
60 unit: item.unit, 60 unit: item.unit,
61 quantity: item.quantity, 61 quantity: item.quantity,
62 price: item.productPrice, 62 price: item.productPrice,
63 - totalPrice: item.subOrderPayment, 63 + totalPrice: item.quantity * item.productPrice,
64 }; 64 };
65 }); 65 });
66 form.setFieldValue('invoiceDetails', initialValue); 66 form.setFieldValue('invoiceDetails', initialValue);
src/pages/Order/Order/components/MessageListDrawer.tsx
@@ -58,7 +58,7 @@ export default ({ setVisible }) =&gt; { @@ -58,7 +58,7 @@ export default ({ setVisible }) =&gt; {
58 * 跳转到订单列表 58 * 跳转到订单列表
59 */ 59 */
60 function toOrderList(mainOrderIds: any) { 60 function toOrderList(mainOrderIds: any) {
61 - window.open('/order?id=' + mainOrderIds.join(","), '_blank'); 61 + window.open('/order/order?id=' + mainOrderIds.join(','), '_blank');
62 } 62 }
63 63
64 /** 64 /**
src/pages/Order/Order/index.tsx
@@ -4541,10 +4541,12 @@ const OrderPage = () =&gt; { @@ -4541,10 +4541,12 @@ const OrderPage = () =&gt; {
4541 4541
4542 return toolBtns; 4542 return toolBtns;
4543 } 4543 }
  4544 +
4544 const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); 4545 const [invoiceWarningNum, setInvoiceWarningNum] = useState(0);
4545 const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); 4546 const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0);
4546 const [open, setOpen] = useState(false); 4547 const [open, setOpen] = useState(false);
4547 const { openCount, setOpenCount } = useModel('count'); 4548 const { openCount, setOpenCount } = useModel('count');
  4549 +
4548 async function getInvoiceWarningNum() { 4550 async function getInvoiceWarningNum() {
4549 const res = await postServiceOrderWarningOrderStatistics(); 4551 const res = await postServiceOrderWarningOrderStatistics();
4550 if ( 4552 if (
@@ -4559,6 +4561,7 @@ const OrderPage = () =&gt; { @@ -4559,6 +4561,7 @@ const OrderPage = () =&gt; {
4559 setInvoiceWarningNum(res.data.waitConfirmInvoice); 4561 setInvoiceWarningNum(res.data.waitConfirmInvoice);
4560 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt); 4562 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
4561 } 4563 }
  4564 +
4562 useEffect(() => { 4565 useEffect(() => {
4563 //预警订单数 4566 //预警订单数
4564 getInvoiceWarningNum(); 4567 getInvoiceWarningNum();
src/pages/Order/OrderWarning/components/InvoiceSubOrderInfoTable.tsx
@@ -27,7 +27,7 @@ const columns: ProColumns[] = [ @@ -27,7 +27,7 @@ const columns: ProColumns[] = [
27 className="pl-1 pr-0" 27 className="pl-1 pr-0"
28 type="link" 28 type="link"
29 target="_blank" 29 target="_blank"
30 - href={'/order?id=' + subOrderId} 30 + href={'/order/order?id=' + subOrderId}
31 > 31 >
32 {subOrderId} 32 {subOrderId}
33 </Button> 33 </Button>
src/pages/Order/OrderWarning/components/MessageListDrawer.tsx
@@ -58,7 +58,7 @@ export default ({ setVisible }) =&gt; { @@ -58,7 +58,7 @@ export default ({ setVisible }) =&gt; {
58 * 跳转到订单列表 58 * 跳转到订单列表
59 */ 59 */
60 function toOrderList(mainOrderIds: any) { 60 function toOrderList(mainOrderIds: any) {
61 - window.open('/order?id=' + mainOrderIds.join(","), '_blank'); 61 + window.open('/order/order?id=' + mainOrderIds.join(','), '_blank');
62 } 62 }
63 63
64 /** 64 /**
src/pages/Order/OrderWarning/index.tsx
@@ -4160,6 +4160,7 @@ const OrderPage = () =&gt; { @@ -4160,6 +4160,7 @@ const OrderPage = () =&gt; {
4160 } 4160 }
4161 params.salesCode = userInfo.username; 4161 params.salesCode = userInfo.username;
4162 params.condition = filterCondifion; 4162 params.condition = filterCondifion;
  4163 + params.paymentMethod = 'UNPAID';
4163 params.sorted = sorted; 4164 params.sorted = sorted;
4164 // params.isDeleteQueryOrder = filterCondifion === 70; 4165 // params.isDeleteQueryOrder = filterCondifion === 70;
4165 params.isDeleteQueryOrder = false; 4166 params.isDeleteQueryOrder = false;