Commit dacbb1cc2abdcd8f7f4b0c211e8d7c3f64d6b359
1 parent
7ca1e086
feat: 收款单位调整
Showing
2 changed files
with
14 additions
and
9 deletions
src/pages/Invoice/components/AddInvoiceDrawerForm.tsx
1 | import { RESPONSE_CODE } from '@/constants/enum'; | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | +import { PAYEE_OPTIONS } from '@/pages/Order/constant'; | ||
2 | import { | 3 | import { |
3 | postServiceInvoiceAddInvoice, | 4 | postServiceInvoiceAddInvoice, |
4 | postServiceOrderQuerySalesCode, | 5 | postServiceOrderQuerySalesCode, |
5 | } from '@/services'; | 6 | } from '@/services'; |
7 | +import { enumToSelect } from '@/utils'; | ||
6 | import { PlusOutlined } from '@ant-design/icons'; | 8 | import { PlusOutlined } from '@ant-design/icons'; |
7 | import { | 9 | import { |
8 | DrawerForm, | 10 | DrawerForm, |
@@ -97,9 +99,9 @@ export default ({ onClose }) => { | @@ -97,9 +99,9 @@ export default ({ onClose }) => { | ||
97 | }); | 99 | }); |
98 | if (res.result === RESPONSE_CODE.SUCCESS) { | 100 | if (res.result === RESPONSE_CODE.SUCCESS) { |
99 | message.success(res.message); | 101 | message.success(res.message); |
100 | - return true; | ||
101 | } else { | 102 | } else { |
102 | message.error(res.message); | 103 | message.error(res.message); |
104 | + return false; | ||
103 | } | 105 | } |
104 | onClose(); | 106 | onClose(); |
105 | // 不返回不会关闭弹框 | 107 | // 不返回不会关闭弹框 |
@@ -129,12 +131,15 @@ export default ({ onClose }) => { | @@ -129,12 +131,15 @@ export default ({ onClose }) => { | ||
129 | placeholder="请输入购买方" | 131 | placeholder="请输入购买方" |
130 | rules={[{ required: true, message: '请输入购买方!' }]} | 132 | rules={[{ required: true, message: '请输入购买方!' }]} |
131 | /> | 133 | /> |
132 | - <ProFormText | 134 | + <ProFormSelect |
135 | + placeholder="收款单位" | ||
133 | name="payee" | 136 | name="payee" |
134 | - width="md" | ||
135 | - label="收款单位" | ||
136 | - placeholder="请输入收款单位" | ||
137 | - rules={[{ required: true, message: '请输入收款单位!' }]} | 137 | + width="lg" |
138 | + key="payee" | ||
139 | + showSearch | ||
140 | + label="开票收款单位" | ||
141 | + tooltip="财务开票将依据这个字段,选择对应的公司开票" | ||
142 | + options={enumToSelect(PAYEE_OPTIONS)} | ||
138 | /> | 143 | /> |
139 | <ProFormText | 144 | <ProFormText |
140 | name="contacts" | 145 | name="contacts" |
@@ -144,8 +149,8 @@ export default ({ onClose }) => { | @@ -144,8 +149,8 @@ export default ({ onClose }) => { | ||
144 | rules={[{ required: true, message: '请输入联系人!' }]} | 149 | rules={[{ required: true, message: '请输入联系人!' }]} |
145 | /> | 150 | /> |
146 | <ProFormSelect | 151 | <ProFormSelect |
147 | - name="salesCode" | ||
148 | - key="salesCode" | 152 | + name="sale" |
153 | + key="sale" | ||
149 | width="lg" | 154 | width="lg" |
150 | showSearch | 155 | showSearch |
151 | label="销售代表" | 156 | label="销售代表" |
src/pages/Invoice/index.tsx
@@ -341,11 +341,11 @@ const InvoicePage = () => { | @@ -341,11 +341,11 @@ const InvoicePage = () => { | ||
341 | scroll={{ x: 1400, y: 360 }} | 341 | scroll={{ x: 1400, y: 360 }} |
342 | toolBarRender={() => [ | 342 | toolBarRender={() => [ |
343 | <AddInvoiceDrawerForm | 343 | <AddInvoiceDrawerForm |
344 | - key="addInvoiceDrawerForm" | ||
345 | onClose={() => { | 344 | onClose={() => { |
346 | invoiceActionRef.current?.reload(); | 345 | invoiceActionRef.current?.reload(); |
347 | bankActionRef.current?.reload(); | 346 | bankActionRef.current?.reload(); |
348 | }} | 347 | }} |
348 | + key="add" | ||
349 | ></AddInvoiceDrawerForm>, | 349 | ></AddInvoiceDrawerForm>, |
350 | ]} | 350 | ]} |
351 | /> | 351 | /> |