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