diff --git a/config/routers/order3.ts b/config/routers/order3.ts index 1513f6b..bfffcb0 100644 --- a/config/routers/order3.ts +++ b/config/routers/order3.ts @@ -206,8 +206,12 @@ export default [ path: "/order3/retailTaskConfiguration", component: "./order3/RetailTaskConfiguration", }, - { // 附加值任务配置 + { // 附加值任务配置 path: "/order3/addValueTaskConfig", component: "./order3/AddValueTaskConfig", }, + {//分期优惠券抵扣设置 + path: "/order3/orderSetting/loanDiscountSetting", + component: "./order3/OrderSetting/LoanDiscountSetting", + }, ]; \ No newline at end of file diff --git a/src/pages/order3/Common/ApproveModal/index.tsx b/src/pages/order3/Common/ApproveModal/index.tsx new file mode 100644 index 0000000..dbf9934 --- /dev/null +++ b/src/pages/order3/Common/ApproveModal/index.tsx @@ -0,0 +1,52 @@ +import React, { useState } from 'react'; +import { Modal, Form, Input, Button } from 'antd'; +import FeeweeUploadAttachment from '@/components/FeeweeUploadAttachment'; +import { UploadOutlined } from '@ant-design/icons'; + +interface Props { + open: boolean, + setOpen: (bool: boolean) => void, + callback?: Function +} + +export default function Add({ open, setOpen, callback }: Props) { + const [form] = Form.useForm(); + const [confirmLoading, setConfirmLoading] = useState(false); + + function handleCancel() { + setOpen(false); + form.resetFields(); + } + + async function handleSave() { + const params = await form.validateFields(); + setConfirmLoading(true); + callback && callback(params); + setConfirmLoading(false); + setOpen(false); + } + + return ( + setOpen(false)} + maskClosable={false} + footer={[ + , + + ]} + > +
+ + + + + + + + +
+
+ ); +} \ No newline at end of file diff --git a/src/pages/order3/OrderSetting/LoanDiscountSetting/api.ts b/src/pages/order3/OrderSetting/LoanDiscountSetting/api.ts new file mode 100644 index 0000000..cee9dea --- /dev/null +++ b/src/pages/order3/OrderSetting/LoanDiscountSetting/api.ts @@ -0,0 +1,19 @@ +import { http } from '@/typing/http'; +import request from '@/utils/request'; +import { ORDER3 } from '@/utils/host'; + +interface Detail { + financeServiceFee?: boolean // 服务费抵扣 + mortgageRegisterFee?: boolean // 抵押上户费抵扣 + removeMortgageFee?: boolean // 解除抵押费抵扣 + gpsFee?: boolean // GPS费抵扣 +} +/** 查询分期优惠劵抵扣配置*/ +export function getSettingApi(): http.PromiseResp { + return request.get(`${ORDER3}/erp/system/loan/coupon/deduct/config`); +} + +/** 保存分期优惠劵抵扣配置*/ +export function saveSettingApi(params?: Detail): http.PromiseResp { + return request.post(`${ORDER3}/erp/system/loan/coupon/deduct/config/save`, params); +} \ No newline at end of file diff --git a/src/pages/order3/OrderSetting/LoanDiscountSetting/index.tsx b/src/pages/order3/OrderSetting/LoanDiscountSetting/index.tsx new file mode 100644 index 0000000..39190fd --- /dev/null +++ b/src/pages/order3/OrderSetting/LoanDiscountSetting/index.tsx @@ -0,0 +1,78 @@ +import React, { useState, useEffect } from 'react'; +import { Card, Button, message, Checkbox } from 'antd'; +import { PageHeaderWrapper } from '@ant-design/pro-layout'; +import { getSettingApi, saveSettingApi } from './api'; +import { debounce } from 'lodash'; + +export default function InsuranceSetting() { + const option = [ + {label: "服务费", value: 'financeServiceFee'}, + {label: "抵押上户费", value: 'mortgageRegisterFee'}, + {label: "解除抵押费", value: 'removeMortgageFee'}, + {label: "GPS费", value: 'gpsFee'}]; + const [checked, setChecked] = useState([]); + const [loading, setLoading] = useState(false); + const [disabled, setDisabled] = useState(false); + + useEffect(() => { + getData(); + }, []); + + function getData() { + setLoading(true); + getSettingApi() + .then(res => { + const data = res.data; + if (data) { + let _check = []; + for (let k in data) { + if (data[k]) { + _check.push(`${k}`); + } + } + setChecked(_check); + setLoading(false); + } + }) + .catch(e => { + message.error(e.message); + setLoading(false); + }); + } + + function onChange(value?: any) { + value && setChecked(value); + } + + const onSubmit = () => { + setDisabled(true); + const params = { + financeServiceFee: checked.includes('financeServiceFee'), + mortgageRegisterFee: checked.includes('mortgageRegisterFee'), + removeMortgageFee: checked.includes('removeMortgageFee'), + gpsFee: checked.includes('gpsFee') + }; + saveSettingApi(params) + .then(res => { + message.success(res.result); + getData(); + setDisabled(false); + }) + .catch(e => { + message.error(e.message); + setDisabled(false); + }); + } + return ( + + +
+ onChange(value)} /> +
+
+ +
+
+
+ ); +} \ No newline at end of file diff --git a/src/pages/order3/RetailManualAdjust/api.ts b/src/pages/order3/RetailManualAdjust/api.ts index 0e9790f..0df887b 100644 --- a/src/pages/order3/RetailManualAdjust/api.ts +++ b/src/pages/order3/RetailManualAdjust/api.ts @@ -37,6 +37,12 @@ interface ListParams { autoAssign?: boolean } +export interface SaveParams { + id?: number // 任务id + remark?: string // 备注 + attachmentList?: string[] // 附件列表 +} + /** 获取列表 */ export function getRetailManualList(params?: ListParams): http.PromiseResp { return request.get(`${ORDER3}/erp/sales/task/detail`, { params }); @@ -46,6 +52,6 @@ export function autoAlloctionApi(params: saveParams) { return request.post(`${ORDER3}/erp/sales/task/auto/assign`, { ...params }); } /*提交 */ -export function save(id?: number) { - return request.post(`${ORDER3}/erp/sales/task/submit`, { id }, { contentType: 'form-urlencoded' }); +export function save(params?: SaveParams) { + return request.post(`${ORDER3}/erp/sales/task/submit`, params); } diff --git a/src/pages/order3/RetailManualAdjust/index.tsx b/src/pages/order3/RetailManualAdjust/index.tsx index d6393af..b31ed98 100644 --- a/src/pages/order3/RetailManualAdjust/index.tsx +++ b/src/pages/order3/RetailManualAdjust/index.tsx @@ -5,6 +5,7 @@ import { getRetailManualList, ListItem, autoAlloctionApi, ShopTaskList, save, sa import EModal from './component/Modal'; import moment from 'moment'; import currency from 'currency.js'; +import ApproveModal from '@/pages/order3/Common/ApproveModal'; const { Column } = Table; @@ -26,6 +27,7 @@ export default function TacklingCarModels() { const [list, setList] = useState({}); const [orginDara, setOrginDara] = useState({}); const index = useRef(); + const [approveOpen, setApproveOpen] = useState(false); // let index; useEffect(() => { @@ -98,11 +100,15 @@ export default function TacklingCarModels() { autoAllocationSave(params); } + function handleOpenApprove() { + setApproveOpen(true); + } + //提交审批 - function saveClick() { + function saveClick(params?: any) { setLoading(true); setSaveLoading(true); - save(list.id).then((res) => { + save({...params, id: list.id}).then((res) => { setSaveLoading(false); setLoading(false); setList({ ...list, canModified: false }); @@ -198,7 +204,7 @@ export default function TacklingCarModels() { <> {edit ? : - } + } {edit ? null : } {edit ? @@ -209,6 +215,7 @@ export default function TacklingCarModels() { : null} + ); } \ No newline at end of file diff --git a/src/pages/order3/RetailTask/api.ts b/src/pages/order3/RetailTask/api.ts index 043af70..358d03b 100644 --- a/src/pages/order3/RetailTask/api.ts +++ b/src/pages/order3/RetailTask/api.ts @@ -38,6 +38,12 @@ interface ListParams { autoAssign?: boolean } +export interface SaveParams { + id?: number // 任务id + remark?: string // 备注 + attachmentList?: string[] // 附件列表 +} + /** 获取列表 */ export function getRetailList(params?: ListParams): http.PromiseResp { return request.get(`${ORDER3}/erp/sales/task/detail`, { params }); @@ -47,6 +53,6 @@ export function saveHandelTack(params: saveParams) { return request.post(`${ORDER3}/erp/sales/task/manual/assign`, { ...params }); } /*提交 */ -export function save(id?: number) { - return request.post(`${ORDER3}/erp/sales/task/submit`, { id }, { contentType: 'form-urlencoded' }); +export function save(params?: SaveParams) { + return request.post(`${ORDER3}/erp/sales/task/submit`, params); } \ No newline at end of file diff --git a/src/pages/order3/RetailTask/index.tsx b/src/pages/order3/RetailTask/index.tsx index 02db2fd..561ece9 100644 --- a/src/pages/order3/RetailTask/index.tsx +++ b/src/pages/order3/RetailTask/index.tsx @@ -5,6 +5,7 @@ import { getRetailList, ListItem, saveHandelTack, ShopTaskList, save, saveParams import EModal from './component/Modal'; import moment from 'moment'; import currency from 'currency.js'; +import ApproveModal from '@/pages/order3/Common/ApproveModal'; const { Column } = Table; @@ -26,6 +27,7 @@ export default function TacklingCarModels() { const [list, setList] = useState({}); const [orginDara, setOrginDara] = useState({}); const index = useRef(0); + const [approveOpen, setApproveOpen] = useState(false); useEffect(() => { getList(newDay); @@ -92,11 +94,15 @@ export default function TacklingCarModels() { handleSave(params); } } + + function handleOpenApprove() { + setApproveOpen(true); + } //提交审批 - function saveClick() { + function saveClick(parmas: any) { setLoading(true); setSaveLoading(true); - save(list.id).then((res) => { + save({...parmas, id: list.id}).then((res) => { setSaveLoading(false); setLoading(false); setList({ ...list, canModified: false }); @@ -194,7 +200,7 @@ export default function TacklingCarModels() { <> {edit ? : - } + } {edit ? : @@ -203,6 +209,7 @@ export default function TacklingCarModels() { ) : null} + ); } \ No newline at end of file diff --git a/src/pages/order3/TacklingCarModels/api.ts b/src/pages/order3/TacklingCarModels/api.ts index 11c3dbd..909f626 100644 --- a/src/pages/order3/TacklingCarModels/api.ts +++ b/src/pages/order3/TacklingCarModels/api.ts @@ -3,25 +3,25 @@ import request from '@/utils/request'; import { ORDER3 } from '@/utils/host'; export interface ListItem { - totalTaskCount?: number,//任务总数 + totalTaskCount?: number, //任务总数 shopTaskList?: ShopTaskList[], - year?: number,//年份 + year?: number, //年份 id?:number, - month?: number,//月份 + month?: number, //月份 canModified?: boolean//是否可调整 } export interface ShopTaskList { - shopId?: number,//门店id - shopName?: string,//门店名称 - taskCount?: number,//任务数量 + shopId?: number, //门店id + shopName?: string, //门店名称 + taskCount?: number, //任务数量 staffTaskList?: StaffTaskList[]//员工任务列表 } interface StaffTaskList { - staffId?: number,//员工id - staffName?: string,//员工名称 - taskCount?: number,//任务数量 + staffId?: number, //员工id + staffName?: string, //员工名称 + taskCount?: number, //任务数量 regularMonth?: number//转正几个月 } export interface saveParams { @@ -33,6 +33,12 @@ interface ListParams { autoAssign?: boolean } +export interface SaveParams { + id?: number // 任务id + remark?: string // 备注 + attachmentList?: string[] // 附件列表 +} + /** 获取列表 */ export function getTackList(params?: ListParams): http.PromiseResp { return request.get(`${ORDER3}/erp/tack/car/task/detail`, { params }); @@ -46,7 +52,6 @@ export function autoAlloctionApi(params: saveParams) { return request.post(`${ORDER3}/erp/tack/car/task/auto/assign`, { ...params }); } /*提交 */ -export function save(id?: number) { - return request.post(`${ORDER3}/erp/tack/car/task/submit`, { id }, { contentType: 'form-urlencoded' }); -} - +export function save(params?: SaveParams) { + return request.post(`${ORDER3}/erp/tack/car/task/submit`, params); +} \ No newline at end of file diff --git a/src/pages/order3/TacklingCarModels/index.tsx b/src/pages/order3/TacklingCarModels/index.tsx index 2458b8d..86d7c9e 100644 --- a/src/pages/order3/TacklingCarModels/index.tsx +++ b/src/pages/order3/TacklingCarModels/index.tsx @@ -4,6 +4,7 @@ import { Card, Table, Button, Row, DatePicker, Col, InputNumber, message } from import { getTackList, ListItem, saveHandelTack, ShopTaskList, save, saveParams } from './api'; import EModal from './component/Modal'; import moment from 'moment'; +import ApproveModal from '@/pages/order3/Common/ApproveModal'; const { Column } = Table; @@ -25,6 +26,7 @@ export default function TacklingCarModels() { const [list, setList] = useState({}); const [orginDara, setOrginDara] = useState({}); let index; + const [approveOpen, setApproveOpen] = useState(false); useEffect(() => { getList(newDay); @@ -74,10 +76,10 @@ export default function TacklingCarModels() { handleSave(params); } //提交审批 - function saveClick() { + function saveClick(params?: any) { setLoading(true); setSaveLoading(true); - save(list.id).then(() => { + save({...params, id: list.id}).then(() => { setSaveLoading(false); setLoading(false); setList({ ...list, canModified: false }); @@ -88,6 +90,7 @@ export default function TacklingCarModels() { setSaveLoading(false); }); } + //手动提交 function handleSave(params: saveParams) { setConfirmLoading(true); @@ -103,6 +106,10 @@ export default function TacklingCarModels() { }); } + function handleOpenApprove() { + setApproveOpen(true); + } + return ( @@ -121,54 +128,58 @@ export default function TacklingCarModels() { }); return ( <> - {total == 0 ? null : - + {total == 0 ? null : ( + 合计 {total} - + - } + )} ); }} > - { if (edit) { - return _onChange(e, index)} /> + return _onChange(e, index)} />; } else { - return {value} + return {value}; } }} /> - ( + ( <> - + )} /> - {list.canModified ? + {list.canModified ? ( <> {edit ? : - - } + } {edit ? : - null - } - : null - } + null} + + ) : null} - - ) + + + ); } \ No newline at end of file diff --git a/src/pages/order3/TacklingManualAdjust/api.ts b/src/pages/order3/TacklingManualAdjust/api.ts index 267fa47..e97f283 100644 --- a/src/pages/order3/TacklingManualAdjust/api.ts +++ b/src/pages/order3/TacklingManualAdjust/api.ts @@ -33,6 +33,12 @@ interface ListParams { autoAssign?: boolean } +export interface SaveParams { + id?: number // 任务id + remark?: string // 备注 + attachmentList?: string[] // 附件列表 +} + /** 获取列表 */ export function getTackMaunuaList(params?: ListParams): http.PromiseResp { return request.get(`${ORDER3}/erp/tack/car/task/detail`, { params }); @@ -46,7 +52,6 @@ export function autoAlloctionApi(params: saveParams) { return request.post(`${ORDER3}/erp/tack/car/task/auto/assign`, { ...params }); } /*提交 */ -export function save(id?: number) { - return request.post(`${ORDER3}/erp/tack/car/task/submit`, { id }, { contentType: 'form-urlencoded' }); +export function save(params?: SaveParams) { + return request.post(`${ORDER3}/erp/tack/car/task/submit`, params); } - diff --git a/src/pages/order3/TacklingManualAdjust/index.tsx b/src/pages/order3/TacklingManualAdjust/index.tsx index 3b58f17..165d0d0 100644 --- a/src/pages/order3/TacklingManualAdjust/index.tsx +++ b/src/pages/order3/TacklingManualAdjust/index.tsx @@ -4,6 +4,7 @@ import { Card, Table, Button, Row, DatePicker, Col, InputNumber, message } from import { getTackMaunuaList, ListItem, autoAlloctionApi, ShopTaskList, save, saveParams } from './api'; import EModal from './component/Modal'; import moment from 'moment'; +import ApproveModal from '@/pages/order3/Common/ApproveModal'; const { Column } = Table; @@ -24,6 +25,7 @@ export default function TacklingCarModels() { const [edit, setEdit] = useState(false); const [list, setList] = useState({}); const [orginDara, setOrginDara] = useState({}); + const [approveOpen, setApproveOpen] = useState(false); let index; useEffect(() => { @@ -73,10 +75,10 @@ export default function TacklingCarModels() { autoAllocationSave(params); } //提交审批 - function saveClick() { + function saveClick(params?: any) { setLoading(true); setSaveLoading(true); - save(list.id).then(() => { + save({...params, id: list.id}).then(() => { setSaveLoading(false); setLoading(false); setList({ ...list, canModified: false }); @@ -102,6 +104,10 @@ export default function TacklingCarModels() { }); } + function handleOpenApprove() { + setApproveOpen(true); + } + return ( @@ -120,56 +126,59 @@ export default function TacklingCarModels() { }); return ( <> - {total == 0 ? null : - + {total == 0 ? null : ( + 合计 {total} - + - } + )} ); }} > - { if (edit) { - return _onChange(e, index)} /> + return _onChange(e, index)} />; } else { - return {value} + return {value}; } }} /> - ( + ( <> - + )} /> - {list.canModified ? + {list.canModified ? ( <> {edit ? : - - } + } {edit ? null : - - } + } {edit ? : - null - } - : null - } + null} + + ) : null} - - ) + + + ); } \ No newline at end of file