Compare commits
No commits in common. "dd88eb73103ecbf913cd199c6346581f00e10683" and "a0de05d120a10d53d869691df8cb3a964086842e" have entirely different histories.
dd88eb7310
...
a0de05d120
|
|
@ -1,5 +1,3 @@
|
||||||
import styles from '../../../style/order-list.css';
|
|
||||||
|
|
||||||
import InternationalPhoneInput from '@/components/InternationalPhoneInput';
|
import InternationalPhoneInput from '@/components/InternationalPhoneInput';
|
||||||
import { HistoryOrder } from '@/pages/Statistics/Order';
|
import { HistoryOrder } from '@/pages/Statistics/Order';
|
||||||
import { ORDER_STATUS_ENUM } from '@/constants';
|
import { ORDER_STATUS_ENUM } from '@/constants';
|
||||||
|
|
@ -86,7 +84,6 @@ const ListPage: React.FC = () => {
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const [activeKey, setActiveKey] = useState<string>('all');
|
const [activeKey, setActiveKey] = useState<string>('all');
|
||||||
const [count, setCount] = useState<any[]>([]);
|
const [count, setCount] = useState<any[]>([]);
|
||||||
const [activeLine, setActiveLine] = useState<number>(-1);
|
|
||||||
const tabs: TabsProps['items'] = useMemo(() => {
|
const tabs: TabsProps['items'] = useMemo(() => {
|
||||||
const total = count.reduce((acc, cur) => acc + Number(cur.count), 0);
|
const total = count.reduce((acc, cur) => acc + Number(cur.count), 0);
|
||||||
const tabs = [
|
const tabs = [
|
||||||
|
|
@ -268,7 +265,7 @@ const ListPage: React.FC = () => {
|
||||||
record.orderStatus,
|
record.orderStatus,
|
||||||
) ? (
|
) ? (
|
||||||
<>
|
<>
|
||||||
<Shipping id={record.id as number} tableRef={actionRef} setActiveLine={setActiveLine}/>
|
<Shipping id={record.id as number} tableRef={actionRef} />
|
||||||
<Divider type="vertical" />
|
<Divider type="vertical" />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -279,7 +276,6 @@ const ListPage: React.FC = () => {
|
||||||
record={record}
|
record={record}
|
||||||
tableRef={actionRef}
|
tableRef={actionRef}
|
||||||
orderId={record.id as number}
|
orderId={record.id as number}
|
||||||
setActiveLine={setActiveLine}
|
|
||||||
/>
|
/>
|
||||||
<Divider type="vertical" />
|
<Divider type="vertical" />
|
||||||
<Dropdown
|
<Dropdown
|
||||||
|
|
@ -397,9 +393,6 @@ const ListPage: React.FC = () => {
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 'max-content' }}
|
||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
rowClassName={(record) => {
|
|
||||||
return record.id === activeLine ? styles['selected-line-order-protable']: '';
|
|
||||||
}}
|
|
||||||
toolBarRender={() => [
|
toolBarRender={() => [
|
||||||
<CreateOrder tableRef={actionRef} />,
|
<CreateOrder tableRef={actionRef} />,
|
||||||
<SyncForm tableRef={actionRef} />,
|
<SyncForm tableRef={actionRef} />,
|
||||||
|
|
@ -487,8 +480,7 @@ const Detail: React.FC<{
|
||||||
tableRef: React.MutableRefObject<ActionType | undefined>;
|
tableRef: React.MutableRefObject<ActionType | undefined>;
|
||||||
orderId: number;
|
orderId: number;
|
||||||
record: API.Order;
|
record: API.Order;
|
||||||
setActiveLine: Function
|
}> = ({ tableRef, orderId, record }) => {
|
||||||
}> = ({ tableRef, orderId, record, setActiveLine }) => {
|
|
||||||
const [visiable, setVisiable] = useState(false);
|
const [visiable, setVisiable] = useState(false);
|
||||||
const { message } = App.useApp();
|
const { message } = App.useApp();
|
||||||
const ref = useRef<ActionType>();
|
const ref = useRef<ActionType>();
|
||||||
|
|
@ -518,10 +510,7 @@ const Detail: React.FC<{
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button key="detail" type="primary" onClick={() => {
|
<Button key="detail" type="primary" onClick={() => setVisiable(true)}>
|
||||||
setVisiable(true);
|
|
||||||
setActiveLine(record.id);
|
|
||||||
}}>
|
|
||||||
<FileDoneOutlined />
|
<FileDoneOutlined />
|
||||||
详情
|
详情
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -1060,8 +1049,7 @@ const Shipping: React.FC<{
|
||||||
tableRef?: React.MutableRefObject<ActionType | undefined>;
|
tableRef?: React.MutableRefObject<ActionType | undefined>;
|
||||||
descRef?: React.MutableRefObject<ActionType | undefined>;
|
descRef?: React.MutableRefObject<ActionType | undefined>;
|
||||||
reShipping?: boolean;
|
reShipping?: boolean;
|
||||||
setActiveLine: Function;
|
}> = ({ id, tableRef, descRef, reShipping = false }) => {
|
||||||
}> = ({ id, tableRef, descRef, reShipping = false, setActiveLine }) => {
|
|
||||||
const [options, setOptions] = useState<any[]>([]);
|
const [options, setOptions] = useState<any[]>([]);
|
||||||
const formRef = useRef<ProFormInstance>();
|
const formRef = useRef<ProFormInstance>();
|
||||||
|
|
||||||
|
|
@ -1083,11 +1071,7 @@ const Shipping: React.FC<{
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
trigger={
|
trigger={
|
||||||
<Button type="primary"
|
<Button type="primary">
|
||||||
onClick={() => {
|
|
||||||
setActiveLine(id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CodeSandboxOutlined />
|
<CodeSandboxOutlined />
|
||||||
创建运单
|
创建运单
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -1859,6 +1843,7 @@ const SalesChange: React.FC<{
|
||||||
detailRef?: React.MutableRefObject<ActionType | undefined>;
|
detailRef?: React.MutableRefObject<ActionType | undefined>;
|
||||||
reShipping?: boolean;
|
reShipping?: boolean;
|
||||||
}> = ({ id, detailRef }) => {
|
}> = ({ id, detailRef }) => {
|
||||||
|
const [options, setOptions] = useState<any[]>([]);
|
||||||
const formRef = useRef<ProFormInstance>();
|
const formRef = useRef<ProFormInstance>();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1923,8 +1908,9 @@ const SalesChange: React.FC<{
|
||||||
>
|
>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
params={{ }}
|
params={{ options }}
|
||||||
request={async ({ keyWords }) => {
|
request={async ({ keyWords, options }) => {
|
||||||
|
if (!keyWords || keyWords.length < 2) return options;
|
||||||
try {
|
try {
|
||||||
const { data } = await productcontrollerSearchproducts({
|
const { data } = await productcontrollerSearchproducts({
|
||||||
name: keyWords,
|
name: keyWords,
|
||||||
|
|
@ -1935,10 +1921,10 @@ const SalesChange: React.FC<{
|
||||||
label: `${item.name} - ${item.nameCn}`,
|
label: `${item.name} - ${item.nameCn}`,
|
||||||
value: item?.sku,
|
value: item?.sku,
|
||||||
};
|
};
|
||||||
})
|
}) || options
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return [];
|
return options;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
name="sku"
|
name="sku"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue