Commit a3a2c879d9d62a22bd9c70e5d14e7e09b90c4125
Merge branch 'order_lzh' into 'master'
Order lzh See merge request !192
Showing
12 changed files
with
280 additions
and
71 deletions
config/routers/order3.ts
@@ -206,8 +206,12 @@ export default [ | @@ -206,8 +206,12 @@ export default [ | ||
206 | path: "/order3/retailTaskConfiguration", | 206 | path: "/order3/retailTaskConfiguration", |
207 | component: "./order3/RetailTaskConfiguration", | 207 | component: "./order3/RetailTaskConfiguration", |
208 | }, | 208 | }, |
209 | - { // 附加值任务配置 | 209 | + { // 附加值任务配置 |
210 | path: "/order3/addValueTaskConfig", | 210 | path: "/order3/addValueTaskConfig", |
211 | component: "./order3/AddValueTaskConfig", | 211 | component: "./order3/AddValueTaskConfig", |
212 | }, | 212 | }, |
213 | + {//分期优惠券抵扣设置 | ||
214 | + path: "/order3/orderSetting/loanDiscountSetting", | ||
215 | + component: "./order3/OrderSetting/LoanDiscountSetting", | ||
216 | + }, | ||
213 | ]; | 217 | ]; |
214 | \ No newline at end of file | 218 | \ No newline at end of file |
src/pages/order3/Common/ApproveModal/index.tsx
0 → 100644
1 | +import React, { useState } from 'react'; | ||
2 | +import { Modal, Form, Input, Button } from 'antd'; | ||
3 | +import FeeweeUploadAttachment from '@/components/FeeweeUploadAttachment'; | ||
4 | +import { UploadOutlined } from '@ant-design/icons'; | ||
5 | + | ||
6 | +interface Props { | ||
7 | + open: boolean, | ||
8 | + setOpen: (bool: boolean) => void, | ||
9 | + callback?: Function | ||
10 | +} | ||
11 | + | ||
12 | +export default function Add({ open, setOpen, callback }: Props) { | ||
13 | + const [form] = Form.useForm(); | ||
14 | + const [confirmLoading, setConfirmLoading] = useState<boolean>(false); | ||
15 | + | ||
16 | + function handleCancel() { | ||
17 | + setOpen(false); | ||
18 | + form.resetFields(); | ||
19 | + } | ||
20 | + | ||
21 | + async function handleSave() { | ||
22 | + const params = await form.validateFields(); | ||
23 | + setConfirmLoading(true); | ||
24 | + callback && callback(params); | ||
25 | + setConfirmLoading(false); | ||
26 | + setOpen(false); | ||
27 | + } | ||
28 | + | ||
29 | + return ( | ||
30 | + <Modal | ||
31 | + open={open} | ||
32 | + title="提交审批" | ||
33 | + onCancel={() => setOpen(false)} | ||
34 | + maskClosable={false} | ||
35 | + footer={[ | ||
36 | + <Button key="cancel" onClick={handleCancel} loading={confirmLoading} style={{marginLeft: 10}}>取消</Button>, | ||
37 | + <Button key="submit" onClick={handleSave} type="primary" htmlType="submit" loading={confirmLoading}>确认</Button> | ||
38 | + ]} | ||
39 | + > | ||
40 | + <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 15 }}> | ||
41 | + <Form.Item label="备注" name="remark"> | ||
42 | + <Input.TextArea maxLength={512} autoSize={{minRows: 4}} showCount placeholder="请输入备注" /> | ||
43 | + </Form.Item> | ||
44 | + <Form.Item label="附件" name="attachmentList" valuePropName="fidList"> | ||
45 | + <FeeweeUploadAttachment maxCount={8} listType="text"> | ||
46 | + <Button icon={<UploadOutlined />}>上传附件</Button> | ||
47 | + </FeeweeUploadAttachment> | ||
48 | + </Form.Item> | ||
49 | + </Form> | ||
50 | + </Modal> | ||
51 | + ); | ||
52 | +} | ||
0 | \ No newline at end of file | 53 | \ No newline at end of file |
src/pages/order3/OrderSetting/LoanDiscountSetting/api.ts
0 → 100644
1 | +import { http } from '@/typing/http'; | ||
2 | +import request from '@/utils/request'; | ||
3 | +import { ORDER3 } from '@/utils/host'; | ||
4 | + | ||
5 | +interface Detail { | ||
6 | + financeServiceFee?: boolean // 服务费抵扣 | ||
7 | + mortgageRegisterFee?: boolean // 抵押上户费抵扣 | ||
8 | + removeMortgageFee?: boolean // 解除抵押费抵扣 | ||
9 | + gpsFee?: boolean // GPS费抵扣 | ||
10 | +} | ||
11 | +/** 查询分期优惠劵抵扣配置*/ | ||
12 | +export function getSettingApi(): http.PromiseResp<Detail> { | ||
13 | + return request.get(`${ORDER3}/erp/system/loan/coupon/deduct/config`); | ||
14 | +} | ||
15 | + | ||
16 | +/** 保存分期优惠劵抵扣配置*/ | ||
17 | +export function saveSettingApi(params?: Detail): http.PromiseResp<Detail> { | ||
18 | + return request.post(`${ORDER3}/erp/system/loan/coupon/deduct/config/save`, params); | ||
19 | +} | ||
0 | \ No newline at end of file | 20 | \ No newline at end of file |
src/pages/order3/OrderSetting/LoanDiscountSetting/index.tsx
0 → 100644
1 | +import React, { useState, useEffect } from 'react'; | ||
2 | +import { Card, Button, message, Checkbox } from 'antd'; | ||
3 | +import { PageHeaderWrapper } from '@ant-design/pro-layout'; | ||
4 | +import { getSettingApi, saveSettingApi } from './api'; | ||
5 | +import { debounce } from 'lodash'; | ||
6 | + | ||
7 | +export default function InsuranceSetting() { | ||
8 | + const option = [ | ||
9 | + {label: "服务费", value: 'financeServiceFee'}, | ||
10 | + {label: "抵押上户费", value: 'mortgageRegisterFee'}, | ||
11 | + {label: "解除抵押费", value: 'removeMortgageFee'}, | ||
12 | + {label: "GPS费", value: 'gpsFee'}]; | ||
13 | + const [checked, setChecked] = useState<string[]>([]); | ||
14 | + const [loading, setLoading] = useState<boolean>(false); | ||
15 | + const [disabled, setDisabled] = useState<boolean>(false); | ||
16 | + | ||
17 | + useEffect(() => { | ||
18 | + getData(); | ||
19 | + }, []); | ||
20 | + | ||
21 | + function getData() { | ||
22 | + setLoading(true); | ||
23 | + getSettingApi() | ||
24 | + .then(res => { | ||
25 | + const data = res.data; | ||
26 | + if (data) { | ||
27 | + let _check = []; | ||
28 | + for (let k in data) { | ||
29 | + if (data[k]) { | ||
30 | + _check.push(`${k}`); | ||
31 | + } | ||
32 | + } | ||
33 | + setChecked(_check); | ||
34 | + setLoading(false); | ||
35 | + } | ||
36 | + }) | ||
37 | + .catch(e => { | ||
38 | + message.error(e.message); | ||
39 | + setLoading(false); | ||
40 | + }); | ||
41 | + } | ||
42 | + | ||
43 | + function onChange(value?: any) { | ||
44 | + value && setChecked(value); | ||
45 | + } | ||
46 | + | ||
47 | + const onSubmit = () => { | ||
48 | + setDisabled(true); | ||
49 | + const params = { | ||
50 | + financeServiceFee: checked.includes('financeServiceFee'), | ||
51 | + mortgageRegisterFee: checked.includes('mortgageRegisterFee'), | ||
52 | + removeMortgageFee: checked.includes('removeMortgageFee'), | ||
53 | + gpsFee: checked.includes('gpsFee') | ||
54 | + }; | ||
55 | + saveSettingApi(params) | ||
56 | + .then(res => { | ||
57 | + message.success(res.result); | ||
58 | + getData(); | ||
59 | + setDisabled(false); | ||
60 | + }) | ||
61 | + .catch(e => { | ||
62 | + message.error(e.message); | ||
63 | + setDisabled(false); | ||
64 | + }); | ||
65 | + } | ||
66 | + return ( | ||
67 | + <PageHeaderWrapper loading={loading} title="分期优惠券可抵扣订单款项设置"> | ||
68 | + <Card> | ||
69 | + <div style={{marginBottom: 20}}> | ||
70 | + <Checkbox.Group defaultValue={checked} options={option} onChange={(value) => onChange(value)} /> | ||
71 | + </div> | ||
72 | + <div> | ||
73 | + <Button loading={disabled} onClick={debounce(onSubmit, 380)} type="primary">确定</Button> | ||
74 | + </div> | ||
75 | + </Card> | ||
76 | + </PageHeaderWrapper> | ||
77 | + ); | ||
78 | +} | ||
0 | \ No newline at end of file | 79 | \ No newline at end of file |
src/pages/order3/RetailManualAdjust/api.ts
@@ -37,6 +37,12 @@ interface ListParams { | @@ -37,6 +37,12 @@ interface ListParams { | ||
37 | autoAssign?: boolean | 37 | autoAssign?: boolean |
38 | } | 38 | } |
39 | 39 | ||
40 | +export interface SaveParams { | ||
41 | + id?: number // 任务id | ||
42 | + remark?: string // 备注 | ||
43 | + attachmentList?: string[] // 附件列表 | ||
44 | +} | ||
45 | + | ||
40 | /** 获取列表 */ | 46 | /** 获取列表 */ |
41 | export function getRetailManualList(params?: ListParams): http.PromiseResp<ListItem> { | 47 | export function getRetailManualList(params?: ListParams): http.PromiseResp<ListItem> { |
42 | return request.get(`${ORDER3}/erp/sales/task/detail`, { params }); | 48 | return request.get(`${ORDER3}/erp/sales/task/detail`, { params }); |
@@ -46,6 +52,6 @@ export function autoAlloctionApi(params: saveParams) { | @@ -46,6 +52,6 @@ export function autoAlloctionApi(params: saveParams) { | ||
46 | return request.post(`${ORDER3}/erp/sales/task/auto/assign`, { ...params }); | 52 | return request.post(`${ORDER3}/erp/sales/task/auto/assign`, { ...params }); |
47 | } | 53 | } |
48 | /*提交 */ | 54 | /*提交 */ |
49 | -export function save(id?: number) { | ||
50 | - return request.post(`${ORDER3}/erp/sales/task/submit`, { id }, { contentType: 'form-urlencoded' }); | 55 | +export function save(params?: SaveParams) { |
56 | + return request.post(`${ORDER3}/erp/sales/task/submit`, params); | ||
51 | } | 57 | } |
src/pages/order3/RetailManualAdjust/index.tsx
@@ -5,6 +5,7 @@ import { getRetailManualList, ListItem, autoAlloctionApi, ShopTaskList, save, sa | @@ -5,6 +5,7 @@ import { getRetailManualList, ListItem, autoAlloctionApi, ShopTaskList, save, sa | ||
5 | import EModal from './component/Modal'; | 5 | import EModal from './component/Modal'; |
6 | import moment from 'moment'; | 6 | import moment from 'moment'; |
7 | import currency from 'currency.js'; | 7 | import currency from 'currency.js'; |
8 | +import ApproveModal from '@/pages/order3/Common/ApproveModal'; | ||
8 | 9 | ||
9 | const { Column } = Table; | 10 | const { Column } = Table; |
10 | 11 | ||
@@ -26,6 +27,7 @@ export default function TacklingCarModels() { | @@ -26,6 +27,7 @@ export default function TacklingCarModels() { | ||
26 | const [list, setList] = useState<ListItem>({}); | 27 | const [list, setList] = useState<ListItem>({}); |
27 | const [orginDara, setOrginDara] = useState<ListItem>({}); | 28 | const [orginDara, setOrginDara] = useState<ListItem>({}); |
28 | const index = useRef(); | 29 | const index = useRef(); |
30 | + const [approveOpen, setApproveOpen] = useState<boolean>(false); | ||
29 | // let index; | 31 | // let index; |
30 | 32 | ||
31 | useEffect(() => { | 33 | useEffect(() => { |
@@ -98,11 +100,15 @@ export default function TacklingCarModels() { | @@ -98,11 +100,15 @@ export default function TacklingCarModels() { | ||
98 | autoAllocationSave(params); | 100 | autoAllocationSave(params); |
99 | } | 101 | } |
100 | 102 | ||
103 | + function handleOpenApprove() { | ||
104 | + setApproveOpen(true); | ||
105 | + } | ||
106 | + | ||
101 | //提交审批 | 107 | //提交审批 |
102 | - function saveClick() { | 108 | + function saveClick(params?: any) { |
103 | setLoading(true); | 109 | setLoading(true); |
104 | setSaveLoading(true); | 110 | setSaveLoading(true); |
105 | - save(list.id).then((res) => { | 111 | + save({...params, id: list.id}).then((res) => { |
106 | setSaveLoading(false); | 112 | setSaveLoading(false); |
107 | setLoading(false); | 113 | setLoading(false); |
108 | setList({ ...list, canModified: false }); | 114 | setList({ ...list, canModified: false }); |
@@ -198,7 +204,7 @@ export default function TacklingCarModels() { | @@ -198,7 +204,7 @@ export default function TacklingCarModels() { | ||
198 | <> | 204 | <> |
199 | {edit ? | 205 | {edit ? |
200 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : | 206 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : |
201 | - <Button style={{ width: 110 }} type="primary" onClick={saveClick} loading={saveLoading}>提交审批</Button>} | 207 | + <Button style={{ width: 110 }} type="primary" onClick={handleOpenApprove} loading={saveLoading}>提交审批</Button>} |
202 | {edit ? null : | 208 | {edit ? null : |
203 | <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} onClick={() => setEdit(true)} type="default">自动调整</Button>} | 209 | <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} onClick={() => setEdit(true)} type="default">自动调整</Button>} |
204 | {edit ? | 210 | {edit ? |
@@ -209,6 +215,7 @@ export default function TacklingCarModels() { | @@ -209,6 +215,7 @@ export default function TacklingCarModels() { | ||
209 | : null} | 215 | : null} |
210 | </Row> | 216 | </Row> |
211 | </Card> | 217 | </Card> |
218 | + <ApproveModal callback={saveClick} open={approveOpen} setOpen={setApproveOpen} /> | ||
212 | </PageHeaderWrapper> | 219 | </PageHeaderWrapper> |
213 | ); | 220 | ); |
214 | } | 221 | } |
215 | \ No newline at end of file | 222 | \ No newline at end of file |
src/pages/order3/RetailTask/api.ts
@@ -38,6 +38,12 @@ interface ListParams { | @@ -38,6 +38,12 @@ interface ListParams { | ||
38 | autoAssign?: boolean | 38 | autoAssign?: boolean |
39 | } | 39 | } |
40 | 40 | ||
41 | +export interface SaveParams { | ||
42 | + id?: number // 任务id | ||
43 | + remark?: string // 备注 | ||
44 | + attachmentList?: string[] // 附件列表 | ||
45 | +} | ||
46 | + | ||
41 | /** 获取列表 */ | 47 | /** 获取列表 */ |
42 | export function getRetailList(params?: ListParams): http.PromiseResp<ListItem> { | 48 | export function getRetailList(params?: ListParams): http.PromiseResp<ListItem> { |
43 | return request.get(`${ORDER3}/erp/sales/task/detail`, { params }); | 49 | return request.get(`${ORDER3}/erp/sales/task/detail`, { params }); |
@@ -47,6 +53,6 @@ export function saveHandelTack(params: saveParams) { | @@ -47,6 +53,6 @@ export function saveHandelTack(params: saveParams) { | ||
47 | return request.post(`${ORDER3}/erp/sales/task/manual/assign`, { ...params }); | 53 | return request.post(`${ORDER3}/erp/sales/task/manual/assign`, { ...params }); |
48 | } | 54 | } |
49 | /*提交 */ | 55 | /*提交 */ |
50 | -export function save(id?: number) { | ||
51 | - return request.post(`${ORDER3}/erp/sales/task/submit`, { id }, { contentType: 'form-urlencoded' }); | 56 | +export function save(params?: SaveParams) { |
57 | + return request.post(`${ORDER3}/erp/sales/task/submit`, params); | ||
52 | } | 58 | } |
53 | \ No newline at end of file | 59 | \ No newline at end of file |
src/pages/order3/RetailTask/index.tsx
@@ -5,6 +5,7 @@ import { getRetailList, ListItem, saveHandelTack, ShopTaskList, save, saveParams | @@ -5,6 +5,7 @@ import { getRetailList, ListItem, saveHandelTack, ShopTaskList, save, saveParams | ||
5 | import EModal from './component/Modal'; | 5 | import EModal from './component/Modal'; |
6 | import moment from 'moment'; | 6 | import moment from 'moment'; |
7 | import currency from 'currency.js'; | 7 | import currency from 'currency.js'; |
8 | +import ApproveModal from '@/pages/order3/Common/ApproveModal'; | ||
8 | 9 | ||
9 | const { Column } = Table; | 10 | const { Column } = Table; |
10 | 11 | ||
@@ -26,6 +27,7 @@ export default function TacklingCarModels() { | @@ -26,6 +27,7 @@ export default function TacklingCarModels() { | ||
26 | const [list, setList] = useState<ListItem>({}); | 27 | const [list, setList] = useState<ListItem>({}); |
27 | const [orginDara, setOrginDara] = useState<ListItem>({}); | 28 | const [orginDara, setOrginDara] = useState<ListItem>({}); |
28 | const index = useRef(0); | 29 | const index = useRef(0); |
30 | + const [approveOpen, setApproveOpen] = useState<boolean>(false); | ||
29 | 31 | ||
30 | useEffect(() => { | 32 | useEffect(() => { |
31 | getList(newDay); | 33 | getList(newDay); |
@@ -92,11 +94,15 @@ export default function TacklingCarModels() { | @@ -92,11 +94,15 @@ export default function TacklingCarModels() { | ||
92 | handleSave(params); | 94 | handleSave(params); |
93 | } | 95 | } |
94 | } | 96 | } |
97 | + | ||
98 | + function handleOpenApprove() { | ||
99 | + setApproveOpen(true); | ||
100 | + } | ||
95 | //提交审批 | 101 | //提交审批 |
96 | - function saveClick() { | 102 | + function saveClick(parmas: any) { |
97 | setLoading(true); | 103 | setLoading(true); |
98 | setSaveLoading(true); | 104 | setSaveLoading(true); |
99 | - save(list.id).then((res) => { | 105 | + save({...parmas, id: list.id}).then((res) => { |
100 | setSaveLoading(false); | 106 | setSaveLoading(false); |
101 | setLoading(false); | 107 | setLoading(false); |
102 | setList({ ...list, canModified: false }); | 108 | setList({ ...list, canModified: false }); |
@@ -194,7 +200,7 @@ export default function TacklingCarModels() { | @@ -194,7 +200,7 @@ export default function TacklingCarModels() { | ||
194 | <> | 200 | <> |
195 | {edit ? | 201 | {edit ? |
196 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : | 202 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : |
197 | - <Button style={{ width: 110 }} type="primary" onClick={saveClick} loading={saveLoading}>提交审批</Button>} | 203 | + <Button style={{ width: 110 }} type="primary" onClick={handleOpenApprove} loading={saveLoading}>提交审批</Button>} |
198 | <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} type="default" onClick={() => setEdit(!edit)}>手动编辑</Button> | 204 | <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} type="default" onClick={() => setEdit(!edit)}>手动编辑</Button> |
199 | {edit ? | 205 | {edit ? |
200 | <Button style={{ width: 110, marginLeft: 15 }} type="default" onClick={setReset} loading={confirmLoading}>取消</Button> : | 206 | <Button style={{ width: 110, marginLeft: 15 }} type="default" onClick={setReset} loading={confirmLoading}>取消</Button> : |
@@ -203,6 +209,7 @@ export default function TacklingCarModels() { | @@ -203,6 +209,7 @@ export default function TacklingCarModels() { | ||
203 | ) : null} | 209 | ) : null} |
204 | </Row> | 210 | </Row> |
205 | </Card> | 211 | </Card> |
212 | + <ApproveModal callback={saveClick} open={approveOpen} setOpen={setApproveOpen} /> | ||
206 | </PageHeaderWrapper> | 213 | </PageHeaderWrapper> |
207 | ); | 214 | ); |
208 | } | 215 | } |
209 | \ No newline at end of file | 216 | \ No newline at end of file |
src/pages/order3/TacklingCarModels/api.ts
@@ -3,25 +3,25 @@ import request from '@/utils/request'; | @@ -3,25 +3,25 @@ import request from '@/utils/request'; | ||
3 | import { ORDER3 } from '@/utils/host'; | 3 | import { ORDER3 } from '@/utils/host'; |
4 | 4 | ||
5 | export interface ListItem { | 5 | export interface ListItem { |
6 | - totalTaskCount?: number,//任务总数 | 6 | + totalTaskCount?: number, //任务总数 |
7 | shopTaskList?: ShopTaskList[], | 7 | shopTaskList?: ShopTaskList[], |
8 | - year?: number,//年份 | 8 | + year?: number, //年份 |
9 | id?:number, | 9 | id?:number, |
10 | - month?: number,//月份 | 10 | + month?: number, //月份 |
11 | canModified?: boolean//是否可调整 | 11 | canModified?: boolean//是否可调整 |
12 | } | 12 | } |
13 | 13 | ||
14 | export interface ShopTaskList { | 14 | export interface ShopTaskList { |
15 | - shopId?: number,//门店id | ||
16 | - shopName?: string,//门店名称 | ||
17 | - taskCount?: number,//任务数量 | 15 | + shopId?: number, //门店id |
16 | + shopName?: string, //门店名称 | ||
17 | + taskCount?: number, //任务数量 | ||
18 | staffTaskList?: StaffTaskList[]//员工任务列表 | 18 | staffTaskList?: StaffTaskList[]//员工任务列表 |
19 | } | 19 | } |
20 | 20 | ||
21 | interface StaffTaskList { | 21 | interface StaffTaskList { |
22 | - staffId?: number,//员工id | ||
23 | - staffName?: string,//员工名称 | ||
24 | - taskCount?: number,//任务数量 | 22 | + staffId?: number, //员工id |
23 | + staffName?: string, //员工名称 | ||
24 | + taskCount?: number, //任务数量 | ||
25 | regularMonth?: number//转正几个月 | 25 | regularMonth?: number//转正几个月 |
26 | } | 26 | } |
27 | export interface saveParams { | 27 | export interface saveParams { |
@@ -33,6 +33,12 @@ interface ListParams { | @@ -33,6 +33,12 @@ interface ListParams { | ||
33 | autoAssign?: boolean | 33 | autoAssign?: boolean |
34 | } | 34 | } |
35 | 35 | ||
36 | +export interface SaveParams { | ||
37 | + id?: number // 任务id | ||
38 | + remark?: string // 备注 | ||
39 | + attachmentList?: string[] // 附件列表 | ||
40 | +} | ||
41 | + | ||
36 | /** 获取列表 */ | 42 | /** 获取列表 */ |
37 | export function getTackList(params?: ListParams): http.PromiseResp<ListItem> { | 43 | export function getTackList(params?: ListParams): http.PromiseResp<ListItem> { |
38 | return request.get(`${ORDER3}/erp/tack/car/task/detail`, { params }); | 44 | return request.get(`${ORDER3}/erp/tack/car/task/detail`, { params }); |
@@ -46,7 +52,6 @@ export function autoAlloctionApi(params: saveParams) { | @@ -46,7 +52,6 @@ export function autoAlloctionApi(params: saveParams) { | ||
46 | return request.post(`${ORDER3}/erp/tack/car/task/auto/assign`, { ...params }); | 52 | return request.post(`${ORDER3}/erp/tack/car/task/auto/assign`, { ...params }); |
47 | } | 53 | } |
48 | /*提交 */ | 54 | /*提交 */ |
49 | -export function save(id?: number) { | ||
50 | - return request.post(`${ORDER3}/erp/tack/car/task/submit`, { id }, { contentType: 'form-urlencoded' }); | ||
51 | -} | ||
52 | - | 55 | +export function save(params?: SaveParams) { |
56 | + return request.post(`${ORDER3}/erp/tack/car/task/submit`, params); | ||
57 | +} | ||
53 | \ No newline at end of file | 58 | \ No newline at end of file |
src/pages/order3/TacklingCarModels/index.tsx
@@ -4,6 +4,7 @@ import { Card, Table, Button, Row, DatePicker, Col, InputNumber, message } from | @@ -4,6 +4,7 @@ import { Card, Table, Button, Row, DatePicker, Col, InputNumber, message } from | ||
4 | import { getTackList, ListItem, saveHandelTack, ShopTaskList, save, saveParams } from './api'; | 4 | import { getTackList, ListItem, saveHandelTack, ShopTaskList, save, saveParams } from './api'; |
5 | import EModal from './component/Modal'; | 5 | import EModal from './component/Modal'; |
6 | import moment from 'moment'; | 6 | import moment from 'moment'; |
7 | +import ApproveModal from '@/pages/order3/Common/ApproveModal'; | ||
7 | 8 | ||
8 | const { Column } = Table; | 9 | const { Column } = Table; |
9 | 10 | ||
@@ -25,6 +26,7 @@ export default function TacklingCarModels() { | @@ -25,6 +26,7 @@ export default function TacklingCarModels() { | ||
25 | const [list, setList] = useState<ListItem>({}); | 26 | const [list, setList] = useState<ListItem>({}); |
26 | const [orginDara, setOrginDara] = useState<ListItem>({}); | 27 | const [orginDara, setOrginDara] = useState<ListItem>({}); |
27 | let index; | 28 | let index; |
29 | + const [approveOpen, setApproveOpen] = useState<boolean>(false); | ||
28 | 30 | ||
29 | useEffect(() => { | 31 | useEffect(() => { |
30 | getList(newDay); | 32 | getList(newDay); |
@@ -74,10 +76,10 @@ export default function TacklingCarModels() { | @@ -74,10 +76,10 @@ export default function TacklingCarModels() { | ||
74 | handleSave(params); | 76 | handleSave(params); |
75 | } | 77 | } |
76 | //提交审批 | 78 | //提交审批 |
77 | - function saveClick() { | 79 | + function saveClick(params?: any) { |
78 | setLoading(true); | 80 | setLoading(true); |
79 | setSaveLoading(true); | 81 | setSaveLoading(true); |
80 | - save(list.id).then(() => { | 82 | + save({...params, id: list.id}).then(() => { |
81 | setSaveLoading(false); | 83 | setSaveLoading(false); |
82 | setLoading(false); | 84 | setLoading(false); |
83 | setList({ ...list, canModified: false }); | 85 | setList({ ...list, canModified: false }); |
@@ -88,6 +90,7 @@ export default function TacklingCarModels() { | @@ -88,6 +90,7 @@ export default function TacklingCarModels() { | ||
88 | setSaveLoading(false); | 90 | setSaveLoading(false); |
89 | }); | 91 | }); |
90 | } | 92 | } |
93 | + | ||
91 | //手动提交 | 94 | //手动提交 |
92 | function handleSave(params: saveParams) { | 95 | function handleSave(params: saveParams) { |
93 | setConfirmLoading(true); | 96 | setConfirmLoading(true); |
@@ -103,6 +106,10 @@ export default function TacklingCarModels() { | @@ -103,6 +106,10 @@ export default function TacklingCarModels() { | ||
103 | }); | 106 | }); |
104 | } | 107 | } |
105 | 108 | ||
109 | + function handleOpenApprove() { | ||
110 | + setApproveOpen(true); | ||
111 | + } | ||
112 | + | ||
106 | return ( | 113 | return ( |
107 | <PageHeaderWrapper title="攻坚车任务手动调整"> | 114 | <PageHeaderWrapper title="攻坚车任务手动调整"> |
108 | <Card> | 115 | <Card> |
@@ -121,54 +128,58 @@ export default function TacklingCarModels() { | @@ -121,54 +128,58 @@ export default function TacklingCarModels() { | ||
121 | }); | 128 | }); |
122 | return ( | 129 | return ( |
123 | <> | 130 | <> |
124 | - {total == 0 ? null : | ||
125 | - <Table.Summary.Row > | 131 | + {total == 0 ? null : ( |
132 | + <Table.Summary.Row> | ||
126 | <Table.Summary.Cell index={1}><span style={{ display: 'block', textAlign: 'center' }}>合计</span></Table.Summary.Cell> | 133 | <Table.Summary.Cell index={1}><span style={{ display: 'block', textAlign: 'center' }}>合计</span></Table.Summary.Cell> |
127 | <Table.Summary.Cell index={2}> | 134 | <Table.Summary.Cell index={2}> |
128 | <span style={{ display: 'block', textAlign: 'center' }}>{total}</span> | 135 | <span style={{ display: 'block', textAlign: 'center' }}>{total}</span> |
129 | </Table.Summary.Cell> | 136 | </Table.Summary.Cell> |
130 | - <Table.Summary.Cell index={3}></Table.Summary.Cell> | 137 | + <Table.Summary.Cell index={3} /> |
131 | </Table.Summary.Row> | 138 | </Table.Summary.Row> |
132 | - } | 139 | + )} |
133 | </> | 140 | </> |
134 | ); | 141 | ); |
135 | }} | 142 | }} |
136 | > | 143 | > |
137 | <Column title="门店" dataIndex="shopName" width={400} align="center" /> | 144 | <Column title="门店" dataIndex="shopName" width={400} align="center" /> |
138 | - <Column title="攻坚车型任务(台)" dataIndex="taskCount" align="center" | 145 | + <Column |
146 | + title="攻坚车型任务(台)" | ||
147 | + dataIndex="taskCount" | ||
148 | + align="center" | ||
139 | render={(value, record, index) => { | 149 | render={(value, record, index) => { |
140 | if (edit) { | 150 | if (edit) { |
141 | - return <InputNumber min={0} value={value} onChange={(e: any) => _onChange(e, index)} /> | 151 | + return <InputNumber min={0} value={value} onChange={(e: any) => _onChange(e, index)} />; |
142 | } else { | 152 | } else { |
143 | - return <span>{value}</span> | 153 | + return <span>{value}</span>; |
144 | } | 154 | } |
145 | }} | 155 | }} |
146 | /> | 156 | /> |
147 | - <Column title="操作" align="center" | ||
148 | - render={(value, record, index) => ( | 157 | + <Column |
158 | + title="操作" | ||
159 | + align="center" | ||
160 | + render={(value, record, _index) => ( | ||
149 | <> | 161 | <> |
150 | - <Button type="link" onClick={() => { setVisible(true); setCurrent(value), index = index }}>销售顾问任务</Button> | 162 | + <Button type="link" onClick={() => { setVisible(true); setCurrent(value); index = _index; }}>销售顾问任务</Button> |
151 | </> | 163 | </> |
152 | )} | 164 | )} |
153 | /> | 165 | /> |
154 | </Table> | 166 | </Table> |
155 | <EModal setVisible={setVisible} visible={visible} current={current} index={index} setList={setList} list={list} setCurrent={setCurrent} isHandledit={edit} /> | 167 | <EModal setVisible={setVisible} visible={visible} current={current} index={index} setList={setList} list={list} setCurrent={setCurrent} isHandledit={edit} /> |
156 | <Row justify="center" style={{ marginTop: 15 }}> | 168 | <Row justify="center" style={{ marginTop: 15 }}> |
157 | - {list.canModified ? | 169 | + {list.canModified ? ( |
158 | <> | 170 | <> |
159 | {edit ? | 171 | {edit ? |
160 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : | 172 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : |
161 | - <Button style={{ width: 110 }} type="primary" onClick={saveClick} loading={saveLoading}>提交审批</Button> | ||
162 | - } | 173 | + <Button style={{ width: 110 }} type="primary" onClick={handleOpenApprove} loading={saveLoading}>提交审批</Button>} |
163 | <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} type="default" onClick={() => setEdit(true)}>手动编辑</Button> | 174 | <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} type="default" onClick={() => setEdit(true)}>手动编辑</Button> |
164 | {edit ? | 175 | {edit ? |
165 | <Button style={{ width: 110, marginLeft: 15 }} type="default" onClick={setReset} loading={confirmLoading}>取消</Button> : | 176 | <Button style={{ width: 110, marginLeft: 15 }} type="default" onClick={setReset} loading={confirmLoading}>取消</Button> : |
166 | - null | ||
167 | - } | ||
168 | - </> : null | ||
169 | - } | 177 | + null} |
178 | + </> | ||
179 | + ) : null} | ||
170 | </Row> | 180 | </Row> |
171 | </Card> | 181 | </Card> |
172 | - </PageHeaderWrapper > | ||
173 | - ) | 182 | + <ApproveModal callback={saveClick} open={approveOpen} setOpen={setApproveOpen} /> |
183 | + </PageHeaderWrapper> | ||
184 | + ); | ||
174 | } | 185 | } |
175 | \ No newline at end of file | 186 | \ No newline at end of file |
src/pages/order3/TacklingManualAdjust/api.ts
@@ -33,6 +33,12 @@ interface ListParams { | @@ -33,6 +33,12 @@ interface ListParams { | ||
33 | autoAssign?: boolean | 33 | autoAssign?: boolean |
34 | } | 34 | } |
35 | 35 | ||
36 | +export interface SaveParams { | ||
37 | + id?: number // 任务id | ||
38 | + remark?: string // 备注 | ||
39 | + attachmentList?: string[] // 附件列表 | ||
40 | +} | ||
41 | + | ||
36 | /** 获取列表 */ | 42 | /** 获取列表 */ |
37 | export function getTackMaunuaList(params?: ListParams): http.PromiseResp<ListItem> { | 43 | export function getTackMaunuaList(params?: ListParams): http.PromiseResp<ListItem> { |
38 | return request.get(`${ORDER3}/erp/tack/car/task/detail`, { params }); | 44 | return request.get(`${ORDER3}/erp/tack/car/task/detail`, { params }); |
@@ -46,7 +52,6 @@ export function autoAlloctionApi(params: saveParams) { | @@ -46,7 +52,6 @@ export function autoAlloctionApi(params: saveParams) { | ||
46 | return request.post(`${ORDER3}/erp/tack/car/task/auto/assign`, { ...params }); | 52 | return request.post(`${ORDER3}/erp/tack/car/task/auto/assign`, { ...params }); |
47 | } | 53 | } |
48 | /*提交 */ | 54 | /*提交 */ |
49 | -export function save(id?: number) { | ||
50 | - return request.post(`${ORDER3}/erp/tack/car/task/submit`, { id }, { contentType: 'form-urlencoded' }); | 55 | +export function save(params?: SaveParams) { |
56 | + return request.post(`${ORDER3}/erp/tack/car/task/submit`, params); | ||
51 | } | 57 | } |
52 | - |
src/pages/order3/TacklingManualAdjust/index.tsx
@@ -4,6 +4,7 @@ import { Card, Table, Button, Row, DatePicker, Col, InputNumber, message } from | @@ -4,6 +4,7 @@ import { Card, Table, Button, Row, DatePicker, Col, InputNumber, message } from | ||
4 | import { getTackMaunuaList, ListItem, autoAlloctionApi, ShopTaskList, save, saveParams } from './api'; | 4 | import { getTackMaunuaList, ListItem, autoAlloctionApi, ShopTaskList, save, saveParams } from './api'; |
5 | import EModal from './component/Modal'; | 5 | import EModal from './component/Modal'; |
6 | import moment from 'moment'; | 6 | import moment from 'moment'; |
7 | +import ApproveModal from '@/pages/order3/Common/ApproveModal'; | ||
7 | 8 | ||
8 | const { Column } = Table; | 9 | const { Column } = Table; |
9 | 10 | ||
@@ -24,6 +25,7 @@ export default function TacklingCarModels() { | @@ -24,6 +25,7 @@ export default function TacklingCarModels() { | ||
24 | const [edit, setEdit] = useState<boolean>(false); | 25 | const [edit, setEdit] = useState<boolean>(false); |
25 | const [list, setList] = useState<ListItem>({}); | 26 | const [list, setList] = useState<ListItem>({}); |
26 | const [orginDara, setOrginDara] = useState<ListItem>({}); | 27 | const [orginDara, setOrginDara] = useState<ListItem>({}); |
28 | + const [approveOpen, setApproveOpen] = useState<boolean>(false); | ||
27 | let index; | 29 | let index; |
28 | 30 | ||
29 | useEffect(() => { | 31 | useEffect(() => { |
@@ -73,10 +75,10 @@ export default function TacklingCarModels() { | @@ -73,10 +75,10 @@ export default function TacklingCarModels() { | ||
73 | autoAllocationSave(params); | 75 | autoAllocationSave(params); |
74 | } | 76 | } |
75 | //提交审批 | 77 | //提交审批 |
76 | - function saveClick() { | 78 | + function saveClick(params?: any) { |
77 | setLoading(true); | 79 | setLoading(true); |
78 | setSaveLoading(true); | 80 | setSaveLoading(true); |
79 | - save(list.id).then(() => { | 81 | + save({...params, id: list.id}).then(() => { |
80 | setSaveLoading(false); | 82 | setSaveLoading(false); |
81 | setLoading(false); | 83 | setLoading(false); |
82 | setList({ ...list, canModified: false }); | 84 | setList({ ...list, canModified: false }); |
@@ -102,6 +104,10 @@ export default function TacklingCarModels() { | @@ -102,6 +104,10 @@ export default function TacklingCarModels() { | ||
102 | }); | 104 | }); |
103 | } | 105 | } |
104 | 106 | ||
107 | + function handleOpenApprove() { | ||
108 | + setApproveOpen(true); | ||
109 | + } | ||
110 | + | ||
105 | return ( | 111 | return ( |
106 | <PageHeaderWrapper title="攻坚车任务"> | 112 | <PageHeaderWrapper title="攻坚车任务"> |
107 | <Card> | 113 | <Card> |
@@ -120,56 +126,59 @@ export default function TacklingCarModels() { | @@ -120,56 +126,59 @@ export default function TacklingCarModels() { | ||
120 | }); | 126 | }); |
121 | return ( | 127 | return ( |
122 | <> | 128 | <> |
123 | - {total == 0 ? null : | ||
124 | - <Table.Summary.Row > | 129 | + {total == 0 ? null : ( |
130 | + <Table.Summary.Row> | ||
125 | <Table.Summary.Cell index={1}><span style={{ display: 'block', textAlign: 'center' }}>合计</span></Table.Summary.Cell> | 131 | <Table.Summary.Cell index={1}><span style={{ display: 'block', textAlign: 'center' }}>合计</span></Table.Summary.Cell> |
126 | <Table.Summary.Cell index={2}> | 132 | <Table.Summary.Cell index={2}> |
127 | <span style={{ display: 'block', textAlign: 'center' }}>{total}</span> | 133 | <span style={{ display: 'block', textAlign: 'center' }}>{total}</span> |
128 | </Table.Summary.Cell> | 134 | </Table.Summary.Cell> |
129 | - <Table.Summary.Cell index={3}></Table.Summary.Cell> | 135 | + <Table.Summary.Cell index={3} /> |
130 | </Table.Summary.Row> | 136 | </Table.Summary.Row> |
131 | - } | 137 | + )} |
132 | </> | 138 | </> |
133 | ); | 139 | ); |
134 | }} | 140 | }} |
135 | > | 141 | > |
136 | <Column title="门店" dataIndex="shopName" width={400} align="center" /> | 142 | <Column title="门店" dataIndex="shopName" width={400} align="center" /> |
137 | - <Column title="攻坚车型任务(台)" dataIndex="taskCount" align="center" | 143 | + <Column |
144 | + title="攻坚车型任务(台)" | ||
145 | + dataIndex="taskCount" | ||
146 | + align="center" | ||
138 | render={(value, record, index) => { | 147 | render={(value, record, index) => { |
139 | if (edit) { | 148 | if (edit) { |
140 | - return <InputNumber min={0} value={value} onChange={(e: any) => _onChange(e, index)} /> | 149 | + return <InputNumber min={0} value={value} onChange={(e: any) => _onChange(e, index)} />; |
141 | } else { | 150 | } else { |
142 | - return <span>{value}</span> | 151 | + return <span>{value}</span>; |
143 | } | 152 | } |
144 | }} | 153 | }} |
145 | /> | 154 | /> |
146 | - <Column title="操作" align="center" | ||
147 | - render={(value, record, index) => ( | 155 | + <Column |
156 | + title="操作" | ||
157 | + align="center" | ||
158 | + render={(value, record, _index) => ( | ||
148 | <> | 159 | <> |
149 | - <Button type="link" onClick={() => { setVisible(true); setCurrent(value), index = index }}>销售顾问任务</Button> | 160 | + <Button type="link" onClick={() => { setVisible(true); setCurrent(value); index = _index; }}>销售顾问任务</Button> |
150 | </> | 161 | </> |
151 | )} | 162 | )} |
152 | /> | 163 | /> |
153 | </Table> | 164 | </Table> |
154 | <EModal setVisible={setVisible} visible={visible} current={current} index={index} setList={setList} list={list} setCurrent={setCurrent} isHandledit={edit} /> | 165 | <EModal setVisible={setVisible} visible={visible} current={current} index={index} setList={setList} list={list} setCurrent={setCurrent} isHandledit={edit} /> |
155 | <Row justify="center" style={{ marginTop: 15 }}> | 166 | <Row justify="center" style={{ marginTop: 15 }}> |
156 | - {list.canModified ? | 167 | + {list.canModified ? ( |
157 | <> | 168 | <> |
158 | {edit ? | 169 | {edit ? |
159 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : | 170 | <Button style={{ width: 110 }} type="primary" onClick={handleClick} loading={confirmLoading}>确定</Button> : |
160 | - <Button style={{ width: 110 }} type="primary" onClick={saveClick} loading={saveLoading}>提交审批</Button> | ||
161 | - } | 171 | + <Button style={{ width: 110 }} type="primary" onClick={handleOpenApprove} loading={saveLoading}>提交审批</Button>} |
162 | {edit ? null : | 172 | {edit ? null : |
163 | - <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} onClick={() => setEdit(true)} type="default">自动调整</Button> | ||
164 | - } | 173 | + <Button style={{ width: 110, marginLeft: 15, backgroundColor: '#FFF' }} onClick={() => setEdit(true)} type="default">自动调整</Button>} |
165 | {edit ? | 174 | {edit ? |
166 | <Button style={{ width: 110, marginLeft: 15 }} type="default" onClick={setReset} loading={confirmLoading}>取消</Button> : | 175 | <Button style={{ width: 110, marginLeft: 15 }} type="default" onClick={setReset} loading={confirmLoading}>取消</Button> : |
167 | - null | ||
168 | - } | ||
169 | - </> : null | ||
170 | - } | 176 | + null} |
177 | + </> | ||
178 | + ) : null} | ||
171 | </Row> | 179 | </Row> |
172 | </Card> | 180 | </Card> |
173 | - </PageHeaderWrapper > | ||
174 | - ) | 181 | + <ApproveModal callback={saveClick} open={approveOpen} setOpen={setApproveOpen} /> |
182 | + </PageHeaderWrapper> | ||
183 | + ); | ||
175 | } | 184 | } |
176 | \ No newline at end of file | 185 | \ No newline at end of file |