diff --git a/src/pages/order3/SaleTask/components/SaleTaskAutoAssign.tsx b/src/pages/order3/SaleTask/components/SaleTaskAutoAssign.tsx index 68253fa..ebdc0be 100644 --- a/src/pages/order3/SaleTask/components/SaleTaskAutoAssign.tsx +++ b/src/pages/order3/SaleTask/components/SaleTaskAutoAssign.tsx @@ -61,7 +61,7 @@ const defaultColumns: (ColumnTypes[number] & { editable: false, }, { - title: "攻坚车任务数(台)", + title: "攻坚车任务(台)", dataIndex: "tackCarTaskCount", editable: true, }, @@ -184,9 +184,19 @@ export default function SaleTaskAutoAssign(props: SaleTaskAutoAssignProps) { const autoAssignSaleTask = (isAssignToAdviser: boolean) => { Modal.confirm({ - title: isAssignToAdviser - ? "确认分配到门店和顾问吗?" - : "确认分配到门店吗?", + title: isAssignToAdviser ? ( + + 确认分配到 + 全部门店和顾问 + 吗? + + ) : ( + + 确认分配到 + 全部门店 + 吗? + + ), zIndex: 1002, onOk: async () => { const hide = message.loading("分配中,请稍候", 0); diff --git a/src/pages/order3/SaleTask/components/SaleTaskBatchSet.tsx b/src/pages/order3/SaleTask/components/SaleTaskBatchSet.tsx index fb9af0d..2d3164e 100644 --- a/src/pages/order3/SaleTask/components/SaleTaskBatchSet.tsx +++ b/src/pages/order3/SaleTask/components/SaleTaskBatchSet.tsx @@ -33,6 +33,10 @@ export default function SaleTaskBatchSet(props: SaleTaskBatchSetProps) { const batchSetSaleTask = async (isAssignToAdviser: boolean) => { await form.validateFields(); const values = form.getFieldsValue(); + if (Object.values(values).every((item) => !item)) { + message.warn("请设置任务后再进行分配"); + return; + } const newValues = {}; Array.from(Object.keys(values)).forEach((valueKey: any) => { if (values[valueKey]) { diff --git a/src/pages/order3/SaleTask/components/index.less b/src/pages/order3/SaleTask/components/index.less index 4db6480..b30679b 100644 --- a/src/pages/order3/SaleTask/components/index.less +++ b/src/pages/order3/SaleTask/components/index.less @@ -5,3 +5,7 @@ border: 1px solid transparent; cursor: pointer; } +.tip { + color: #ff4d4f; + font-weight: bold; +} diff --git a/src/pages/order3/SaleTask/index.tsx b/src/pages/order3/SaleTask/index.tsx index 26198d5..157d824 100644 --- a/src/pages/order3/SaleTask/index.tsx +++ b/src/pages/order3/SaleTask/index.tsx @@ -233,11 +233,11 @@ function SaleTaskList() { const columns: ColumnsType = [ { title: "门店", + width: 150, dataIndex: "shopName", }, { title: "零售任务(台)", - width: 100, children: [ { title: "合计", @@ -254,54 +254,53 @@ function SaleTaskList() { dataIndex: "fuelVehicleTaskCount", key: "fuelVehicleTaskCount", }, - { - title: "毛利任务(元)", - children: [ - { - title: "单车", - dataIndex: "vehicleGrossProfitTask", - key: "vehicleGrossProfitTask", - }, - { - title: "合计", - dataIndex: "grossProfitTaskTotal", - key: "grossProfitTaskTotal", - render: (text: string, record: API.ShopTaskItem) => { - return ( - record.taskCount * record.vehicleGrossProfitTask - ).toFixed(2); - }, - }, - ], - }, ], }, { - title: "其中(台)", + title: "毛利任务(元)", children: [ { - title: "线索到店零售", - dataIndex: "clueDealTaskCount", - key: "clueDealTaskCount", - }, - { - title: "首客试驾成交", - dataIndex: "testDriveTaskCount", - key: "testDriveTaskCount", - }, - { - title: "攻坚车", - dataIndex: "tackCarTaskCount", - key: "tackCarTaskCount", + title: "合计", + dataIndex: "grossProfitTaskTotal", + key: "grossProfitTaskTotal", + render: (text: string, record: API.ShopTaskItem) => { + return (record.taskCount * record.vehicleGrossProfitTask).toFixed( + 2 + ); + }, }, { - title: "车系", - dataIndex: "seriesTaskCount", - key: "seriesTaskCount", + title: "单车", + dataIndex: "vehicleGrossProfitTask", + key: "vehicleGrossProfitTask", }, ], }, { + title: "线索到店成交(台)", + width: 100, + dataIndex: "clueDealTaskCount", + key: "clueDealTaskCount", + }, + { + title: "首客试驾成交(台)", + width: 100, + dataIndex: "testDriveTaskCount", + key: "testDriveTaskCount", + }, + { + title: "攻坚车任务(台)", + width: 100, + dataIndex: "tackCarTaskCount", + key: "tackCarTaskCount", + }, + { + title: "车系任务(台)", + width: 100, + dataIndex: "seriesTaskCount", + key: "seriesTaskCount", + }, + { title: "销顾任务", render: (text: string, record: API.ShopTaskItem) => { return ( diff --git a/src/pages/order3/SaleTask/subpages/TaskEdit/components/AdviserTask.tsx b/src/pages/order3/SaleTask/subpages/TaskEdit/components/AdviserTask.tsx index a3354e0..6e9afc7 100644 --- a/src/pages/order3/SaleTask/subpages/TaskEdit/components/AdviserTask.tsx +++ b/src/pages/order3/SaleTask/subpages/TaskEdit/components/AdviserTask.tsx @@ -5,8 +5,7 @@ import * as API from "../../../api"; import AdviserTaskEdit from "./AdviserTaskEdit"; import { history, useRequest } from "umi"; import { cloneDeep } from "lodash"; - -const { Column } = Table; +import { ColumnsType } from "antd/es/table"; interface AdviserTaskEditForm { submit: (callback: (data: any) => void) => void; @@ -72,6 +71,94 @@ export default function AdviserTask({ form }: AdviserTaskProps) { }); }; + const columns: ColumnsType = [ + { + title: "销售顾问", + width: 100, + dataIndex: "staffName", + }, + { + title: "零售任务(台)", + children: [ + { + title: "合计", + dataIndex: "taskCount", + key: "taskCount", + }, + { + title: "新能源车", + dataIndex: "newEnergyTaskCount", + key: "newEnergyTaskCount", + }, + { + title: "传统燃油车", + dataIndex: "fuelVehicleTaskCount", + key: "fuelVehicleTaskCount", + }, + ], + }, + { + title: "毛利任务(元)", + children: [ + { + title: "合计", + dataIndex: "grossProfitTaskTotal", + key: "grossProfitTaskTotal", + render: (text: string, record: API.StaffTaskItem) => { + return (record.taskCount * record.vehicleGrossProfitTask).toFixed( + 2 + ); + }, + }, + { + title: "单车", + dataIndex: "vehicleGrossProfitTask", + key: "vehicleGrossProfitTask", + }, + ], + }, + { + title: "线索到店成交(台)", + width: 100, + dataIndex: "clueDealTaskCount", + key: "clueDealTaskCount", + }, + { + title: "首客试驾成交(台)", + width: 100, + dataIndex: "testDriveTaskCount", + key: "testDriveTaskCount", + }, + { + title: "攻坚车任务(台)", + width: 100, + dataIndex: "tackCarTaskCount", + key: "tackCarTaskCount", + }, + { + title: "车系任务(台)", + width: 100, + dataIndex: "seriesTaskCount", + key: "seriesTaskCount", + }, + { + title: "操作", + render: (text: string, record: API.StaffTaskItem) => { + if (isReadOnly) return "-"; + return ( + { + setEditAdviser(cloneDeep(record)); // 注意对象引用 + setVisible(true); + }} + > + 编辑 + + ); + }, + }, + ]; + return ( <> - - - - - - - - - - {!isReadOnly && ( - { - return ( - { - setEditAdviser(cloneDeep(record)); // 注意对象引用 - setVisible(true); - }} - > - 编辑 - - ); - }} - /> - )} -
+ /> {!isReadOnly && (