Commit fdf6fc5a4a16195b24abbd774d5fe5340fde7a7b
1 parent
c6f9c477
货拉拉账户配置联调
Showing
4 changed files
with
44 additions
and
29 deletions
src/pages/pms/transfer/HuolalaSetting/api.ts
@@ -96,7 +96,6 @@ export interface saveParams{ | @@ -96,7 +96,6 @@ export interface saveParams{ | ||
96 | interface queryList { | 96 | interface queryList { |
97 | current?:number | 97 | current?:number |
98 | pageSize?:number | 98 | pageSize?:number |
99 | - sysId?:number | ||
100 | } | 99 | } |
101 | // 查询财务账户信息列表 | 100 | // 查询财务账户信息列表 |
102 | export function getList(params: Params):http.PromisePageResp<ListVO> { | 101 | export function getList(params: Params):http.PromisePageResp<ListVO> { |
@@ -104,7 +103,7 @@ export function getList(params: Params):http.PromisePageResp<ListVO> { | @@ -104,7 +103,7 @@ export function getList(params: Params):http.PromisePageResp<ListVO> { | ||
104 | } | 103 | } |
105 | // 新增/编辑API | 104 | // 新增/编辑API |
106 | export function saveApi(params: saveParams) { | 105 | export function saveApi(params: saveParams) { |
107 | - return request.post(`${PMS_HOST}/erp/finance/account/exit`, {...params}); | 106 | + return request.post(`${PMS_HOST}/erp/finance/account/save`, {...params}); |
108 | } | 107 | } |
109 | // 推待办角色列表 | 108 | // 推待办角色列表 |
110 | export function roleListApi(params: queryList): http.PromisePageResp<Role.Info> { | 109 | export function roleListApi(params: queryList): http.PromisePageResp<Role.Info> { |
@@ -112,5 +111,5 @@ export function roleListApi(params: queryList): http.PromisePageResp<Role.Info> | @@ -112,5 +111,5 @@ export function roleListApi(params: queryList): http.PromisePageResp<Role.Info> | ||
112 | } | 111 | } |
113 | // 删除API | 112 | // 删除API |
114 | export function deleteApi(params: {id: number}) { | 113 | export function deleteApi(params: {id: number}) { |
115 | - return request.post(`${PMS_HOST}/erp/finance/account/delete`, {...params}); | 114 | + return request.post(`${PMS_HOST}/erp/finance/account/delete`, {...params}, {contentType: 'form-urlencoded'}); |
116 | } | 115 | } |
117 | \ No newline at end of file | 116 | \ No newline at end of file |
src/pages/pms/transfer/HuolalaSetting/components/AddModal.tsx
@@ -12,15 +12,16 @@ const Item = Form.Item; | @@ -12,15 +12,16 @@ const Item = Form.Item; | ||
12 | interface Props{ | 12 | interface Props{ |
13 | visible?:boolean, | 13 | visible?:boolean, |
14 | onCancel: Function, | 14 | onCancel: Function, |
15 | - item?:ListVO | 15 | + item?:ListVO, |
16 | + onRefreshing: Function | ||
16 | } | 17 | } |
17 | 18 | ||
18 | export default function Index(props:Props) { | 19 | export default function Index(props:Props) { |
19 | - const { list: suppliers } = usePagination<item>(getPageListApi, { supplierType: 40, pageSize: 500 }); | 20 | + const { list: suppliers } = usePagination<item>(getPageListApi, { pageSize: 500 }); |
20 | const { data: shops } = useInitail<PmsStoragePartShop.Option[], {}>(getShopApi, [], {}); | 21 | const { data: shops } = useInitail<PmsStoragePartShop.Option[], {}>(getShopApi, [], {}); |
21 | - const { list } = usePagination<Role.Info>(roleListApi, { pageSize: 500, sysId: 229 }); | 22 | + const { list } = usePagination<Role.Info>(roleListApi, { pageSize: 500 }); |
22 | const [loading, setLoading] = useState(false); | 23 | const [loading, setLoading] = useState(false); |
23 | - const { visible, onCancel, item } = props; | 24 | + const { visible, onCancel, item, onRefreshing } = props; |
24 | const [form] = Form.useForm(); | 25 | const [form] = Form.useForm(); |
25 | 26 | ||
26 | useEffect(() => { | 27 | useEffect(() => { |
@@ -54,6 +55,7 @@ export default function Index(props:Props) { | @@ -54,6 +55,7 @@ export default function Index(props:Props) { | ||
54 | saveApi(params).then(res => { | 55 | saveApi(params).then(res => { |
55 | message.success("保存成功"); | 56 | message.success("保存成功"); |
56 | setLoading(false); | 57 | setLoading(false); |
58 | + onRefreshing(); | ||
57 | onCancel(); | 59 | onCancel(); |
58 | }).catch(e => { | 60 | }).catch(e => { |
59 | message.error(e.message); | 61 | message.error(e.message); |
@@ -65,7 +67,7 @@ export default function Index(props:Props) { | @@ -65,7 +67,7 @@ export default function Index(props:Props) { | ||
65 | return ( | 67 | return ( |
66 | <Modal | 68 | <Modal |
67 | title={item?.id ? "编辑货拉拉账户配置" : "新增货拉拉账户配置"} | 69 | title={item?.id ? "编辑货拉拉账户配置" : "新增货拉拉账户配置"} |
68 | - visible={visible} | 70 | + open={visible} |
69 | maskClosable={false} | 71 | maskClosable={false} |
70 | onCancel={() => onCancel()} | 72 | onCancel={() => onCancel()} |
71 | footer={[ | 73 | footer={[ |
@@ -98,7 +100,7 @@ export default function Index(props:Props) { | @@ -98,7 +100,7 @@ export default function Index(props:Props) { | ||
98 | <Item label="推待办角色" name="roleCode" rules={[{ required: true, message: "请选择推办角色" }]}> | 100 | <Item label="推待办角色" name="roleCode" rules={[{ required: true, message: "请选择推办角色" }]}> |
99 | <PmsSelect | 101 | <PmsSelect |
100 | placeholder="选择待办角色" | 102 | placeholder="选择待办角色" |
101 | - options={list.map(item => ({value: item.roleCode, label: item.roleName}))} | 103 | + options={list.filter(i => i.roleType != 1).map(item => ({value: item.roleCode, label: item.roleName}))} |
102 | /> | 104 | /> |
103 | </Item> | 105 | </Item> |
104 | <Item label="发单账号" name="account" rules={[{ required: true, message: "请填写发单账号" }]}> | 106 | <Item label="发单账号" name="account" rules={[{ required: true, message: "请填写发单账号" }]}> |
src/pages/pms/transfer/HuolalaSetting/components/ChargeModal.tsx
1 | -import React from 'react'; | ||
2 | -import { Form, Button, InputNumber, Modal } from 'antd'; | 1 | +import React, { useEffect } from 'react'; |
2 | +import { Form, Button, InputNumber, Modal, Input } from 'antd'; | ||
3 | import PmsSelect from '@/pages/pms/comonents/PmsSelect'; | 3 | import PmsSelect from '@/pages/pms/comonents/PmsSelect'; |
4 | +import ImageUpload from '@/pages/pms/comonents/ImageUpload'; | ||
5 | +import {ListVO} from '../api'; | ||
4 | 6 | ||
5 | const Item = Form.Item; | 7 | const Item = Form.Item; |
6 | 8 | ||
7 | interface Props { | 9 | interface Props { |
8 | visible?: boolean, | 10 | visible?: boolean, |
9 | onCancel: Function, | 11 | onCancel: Function, |
10 | - item?: any | 12 | + item?: ListVO |
11 | } | 13 | } |
12 | export default function Index(props: Props) { | 14 | export default function Index(props: Props) { |
13 | const { visible, onCancel, item } = props; | 15 | const { visible, onCancel, item } = props; |
14 | const [form] = Form.useForm(); | 16 | const [form] = Form.useForm(); |
15 | 17 | ||
18 | + useEffect(() => { | ||
19 | + if (visible && item?.id) { | ||
20 | + form.setFieldsValue({ | ||
21 | + supplierName: item.supplierName, | ||
22 | + amount: item.amount, | ||
23 | + shopName: item.shopName | ||
24 | + }); | ||
25 | + } | ||
26 | + if (!visible) { | ||
27 | + form.resetFields(); | ||
28 | + } | ||
29 | + }, [visible]); | ||
30 | + | ||
16 | const onSave = () => { | 31 | const onSave = () => { |
17 | - const params = {id: item.id}; | 32 | + const params = {id: item?.id}; |
18 | console.log(params); | 33 | console.log(params); |
19 | }; | 34 | }; |
20 | 35 | ||
21 | return ( | 36 | return ( |
22 | <Modal | 37 | <Modal |
23 | title="预付款充值申请" | 38 | title="预付款充值申请" |
24 | - visible={visible} | 39 | + open={visible} |
25 | maskClosable={false} | 40 | maskClosable={false} |
26 | onCancel={() => onCancel()} | 41 | onCancel={() => onCancel()} |
27 | footer={[ | 42 | footer={[ |
@@ -34,13 +49,13 @@ export default function Index(props: Props) { | @@ -34,13 +49,13 @@ export default function Index(props: Props) { | ||
34 | labelCol={{ span: 7 }} | 49 | labelCol={{ span: 7 }} |
35 | wrapperCol={{ span: 12 }} | 50 | wrapperCol={{ span: 12 }} |
36 | > | 51 | > |
37 | - <Item label="往来单位" name="supplierName" rules={[{ required: true, message: "请选择往来单位" }]}> | ||
38 | - <PmsSelect /> | 52 | + <Item label="往来单位" name="supplierName"> |
53 | + <Input disabled /> | ||
39 | </Item> | 54 | </Item> |
40 | - <Item label="往来单位类型" name="shopName" rules={[{ required: true, message: "请选择签约门店" }]}> | ||
41 | - <PmsSelect /> | 55 | + <Item label="往来单位类型" name="shopName"> |
56 | + <Input disabled /> | ||
42 | </Item> | 57 | </Item> |
43 | - <Item label="账户余额" name="amount" rules={[{ required: true, message: "请填写金额" }]}> | 58 | + <Item label="账户余额" name="amount"> |
44 | <InputNumber style={{ width: '100%' }} addonAfter="元" disabled /> | 59 | <InputNumber style={{ width: '100%' }} addonAfter="元" disabled /> |
45 | </Item> | 60 | </Item> |
46 | <Item label="充值金额" name="awaitAmount" rules={[{ required: true, message: "请填写金额" }]}> | 61 | <Item label="充值金额" name="awaitAmount" rules={[{ required: true, message: "请填写金额" }]}> |
@@ -50,16 +65,16 @@ export default function Index(props: Props) { | @@ -50,16 +65,16 @@ export default function Index(props: Props) { | ||
50 | <InputNumber style={{ width: '100%' }} addonAfter="元" disabled /> | 65 | <InputNumber style={{ width: '100%' }} addonAfter="元" disabled /> |
51 | </Item> | 66 | </Item> |
52 | <Item label="结算门店" name="shopName" rules={[{ required: true, message: "请选择推办角色" }]}> | 67 | <Item label="结算门店" name="shopName" rules={[{ required: true, message: "请选择推办角色" }]}> |
53 | - <PmsSelect /> | 68 | + <Input disabled /> |
54 | </Item> | 69 | </Item> |
55 | - <Item label="发票金额要求比例" name="role" rules={[{ required: true, message: "请选择推办角色" }]}> | ||
56 | - <PmsSelect /> | 70 | + <Item label="发票金额要求比例" name="role"> |
71 | + <Input disabled /> | ||
57 | </Item> | 72 | </Item> |
58 | - <Item label="结算方式" name="role" rules={[{ required: true, message: "请选择推办角色" }]}> | 73 | + <Item label="结算方式" name="role" rules={[{ required: true, message: "请选择结算方式" }]}> |
59 | <PmsSelect /> | 74 | <PmsSelect /> |
60 | </Item> | 75 | </Item> |
61 | <Item label="附件" name="files"> | 76 | <Item label="附件" name="files"> |
62 | - <PmsSelect /> | 77 | + <ImageUpload max={5} /> |
63 | </Item> | 78 | </Item> |
64 | </Form> | 79 | </Form> |
65 | </Modal> | 80 | </Modal> |
src/pages/pms/transfer/HuolalaSetting/index.tsx
@@ -11,13 +11,12 @@ export default function Index() { | @@ -11,13 +11,12 @@ export default function Index() { | ||
11 | const {list, loading, paginationConfig, setParams} = usePagination<ListVO>(getList, [], {}); | 11 | const {list, loading, paginationConfig, setParams} = usePagination<ListVO>(getList, [], {}); |
12 | const [current, setCurrent] = useState<{ visible: boolean, item: ListVO }>({visible: false, item: {}}); | 12 | const [current, setCurrent] = useState<{ visible: boolean, item: ListVO }>({visible: false, item: {}}); |
13 | const [chargeInfo, setChargeInfo] = useState<{ visible: boolean, item: ListVO }>({visible: false, item: {}}); | 13 | const [chargeInfo, setChargeInfo] = useState<{ visible: boolean, item: ListVO }>({visible: false, item: {}}); |
14 | - const data = [{id: 1, supplierName: "货拉拉", shopName: "不过承诺书可能单纯迪士尼才", amount: 3000, minAmount: 1500, roleName: "计划制定员", account: "15725173,16638183"}]; | ||
15 | return ( | 14 | return ( |
16 | <PageHeaderWrapper title="货拉拉账户配置"> | 15 | <PageHeaderWrapper title="货拉拉账户配置"> |
17 | <Card | 16 | <Card |
18 | extra={<Button type="primary" onClick={() => setCurrent({visible: true, item: {}})}>新增</Button>} | 17 | extra={<Button type="primary" onClick={() => setCurrent({visible: true, item: {}})}>新增</Button>} |
19 | > | 18 | > |
20 | - <Table dataSource={data} rowKey="id" loading={loading} pagination={paginationConfig}> | 19 | + <Table dataSource={list} rowKey="id" loading={loading} pagination={paginationConfig}> |
21 | <Column title="往来单位" dataIndex="supplierName" /> | 20 | <Column title="往来单位" dataIndex="supplierName" /> |
22 | <Column title="签约门店" dataIndex="shopName" /> | 21 | <Column title="签约门店" dataIndex="shopName" /> |
23 | <Column title="当前余额(元)" dataIndex="amount" /> | 22 | <Column title="当前余额(元)" dataIndex="amount" /> |
@@ -28,8 +27,8 @@ export default function Index() { | @@ -28,8 +27,8 @@ export default function Index() { | ||
28 | title="操作" | 27 | title="操作" |
29 | render={r => ( | 28 | render={r => ( |
30 | <div style={{display: 'flex', flexWrap: 'wrap', alignItems: 'center'}}> | 29 | <div style={{display: 'flex', flexWrap: 'wrap', alignItems: 'center'}}> |
31 | - <a onClick={() => setChargeInfo({visible: true, item: r})}>预付款充值申请</a> | ||
32 | - <Divider type="vertical" /> | 30 | + {/* <a onClick={() => setChargeInfo({visible: true, item: r})}>预付款充值申请</a> |
31 | + <Divider type="vertical" /> */} | ||
33 | <a onClick={() => setCurrent({visible: true, item: r})}>编辑</a> | 32 | <a onClick={() => setCurrent({visible: true, item: r})}>编辑</a> |
34 | <Divider type="vertical" /> | 33 | <Divider type="vertical" /> |
35 | <Popconfirm | 34 | <Popconfirm |
@@ -47,7 +46,7 @@ export default function Index() { | @@ -47,7 +46,7 @@ export default function Index() { | ||
47 | )} | 46 | )} |
48 | /> | 47 | /> |
49 | </Table> | 48 | </Table> |
50 | - <AddModal visible={current.visible} item={current.item} onCancel={() => setCurrent({ visible: false, item: {} })} /> | 49 | + <AddModal visible={current.visible} item={current.item} onCancel={() => setCurrent({ visible: false, item: {} })} onRefreshing={() => setParams({}, true)} /> |
51 | <ChargeModal visible={chargeInfo.visible} item={chargeInfo.item} onCancel={() => setChargeInfo({ visible: false, item: {} })} /> | 50 | <ChargeModal visible={chargeInfo.visible} item={chargeInfo.item} onCancel={() => setChargeInfo({ visible: false, item: {} })} /> |
52 | </Card> | 51 | </Card> |
53 | </PageHeaderWrapper> | 52 | </PageHeaderWrapper> |