From 597483b97014bdf92f2a470b211a87aed9facde5 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Thu, 5 Dec 2024 15:53:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=82=AE=E4=BB=B6=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/OrderStore.js | 12 +++++++++++- src/views/orders/Follow.jsx | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/stores/OrderStore.js b/src/stores/OrderStore.js index 8151d08..d3ba617 100644 --- a/src/stores/OrderStore.js +++ b/src/stores/OrderStore.js @@ -128,6 +128,17 @@ export const useOrderStore = create(devtools((set, get) => ({ }, + importEmailMessage: ({ orderId, orderNumber }) => { + return fetchJSON(`${API_HOST}/generate_email_msg`, { coli_sn: orderId, coli_id: orderNumber }) + .then(json => { + if (json.errcode === 0) { + console.info(json) + } else { + throw new Error(json?.errmsg + ': ' + json.errcode) + } + }) + }, + fetchOtherEmail: (coli_sn) => { return fetchJSON(`${EMAIL_HOST}/email_supplier`, { coli_sn }) .then(json => { @@ -139,7 +150,6 @@ export const useOrderStore = create(devtools((set, get) => ({ throw new Error(json?.errmsg + ': ' + json.errcode) } }) - }, setOrderPropValue: async (colisn, propName, value) => { diff --git a/src/views/orders/Follow.jsx b/src/views/orders/Follow.jsx index 2513331..010d765 100644 --- a/src/views/orders/Follow.jsx +++ b/src/views/orders/Follow.jsx @@ -7,7 +7,7 @@ import { WhatsAppOutlined } from '@ant-design/icons' import { App, Badge, Empty, - Flex, + Flex,Button, Radio, Space, Switch, Table, Tabs, Divider, Tag, Tooltip @@ -39,6 +39,7 @@ function OrderGroupTable({ formValues }) { {text} {tagIcon} + ) } @@ -128,6 +129,7 @@ function OrderGroupTable({ formValues }) { const [loading, setLoading] = useState(false) const orderList = useOrderStore((state) => state.orderList) const fetchOrderList = useOrderStore((state) => state.fetchOrderList) + const importEmailMessage = useOrderStore((state) => state.importEmailMessage) const loginUser = useAuthStore((state) => state.loginUser) useEffect(() => {