From 6cb20092786fdc0e734de6432da252ffdbc67779 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 20 Feb 2024 15:20:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=92=8C=E7=8A=B6=E6=80=81=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/OrderStore.js | 8 +++++++- .../Components/CustomerProfile.jsx | 20 +++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/stores/OrderStore.js b/src/stores/OrderStore.js index fd8c83f..f5ee79a 100644 --- a/src/stores/OrderStore.js +++ b/src/stores/OrderStore.js @@ -21,7 +21,13 @@ const useOrderStore = create((set, get) => ({ lastQuotation: json.result[0].quotes.length > 0 ? json.result[0].quotes[0] : {}, })) } - } + }, + + setOrderPropValue: async (colisn, propName, value) => { + const json = await fetchJSON(`${API_HOST}/setorderstatus`, { colisn, stype: propName, svalue: value }) + console.info(json) + }, + })) export default useOrderStore \ No newline at end of file diff --git a/src/views/Conversations/Components/CustomerProfile.jsx b/src/views/Conversations/Components/CustomerProfile.jsx index 69ac45c..f5cf7d6 100644 --- a/src/views/Conversations/Components/CustomerProfile.jsx +++ b/src/views/Conversations/Components/CustomerProfile.jsx @@ -9,14 +9,14 @@ import QuotesHistory from './QuotesHistory' import useOrderStore from '@/stores/OrderStore' const CustomerProfile = (() => { - let { state } = useLocation() const { order_sn: order_sn } = useParams() - const { orderDetail, customerDetail, lastQuotation, fetchOrderDetail } = useOrderStore() - const { loginUser: currentUser } = useAuthContext() + const { orderDetail, customerDetail, lastQuotation, + fetchOrderDetail, setOrderPropValue + } = useOrderStore() useEffect(() => { fetchOrderDetail(order_sn) - }, []) + }, [order_sn]) return (
@@ -29,7 +29,11 @@ const CustomerProfile = (() => { width: '100%' }} variant='borderless' - defaultValue={orderDetail.tags} + onSelect={(value) => { + console.info(value) + setOrderPropValue(order_sn, 'orderlabel', value) + }} + value={orderDetail.tags} options={[ { value: 0, label: '未设置' }, { value: 240003, label: '重点' }, @@ -42,7 +46,11 @@ const CustomerProfile = (() => { width: '100%' }} variant='borderless' - defaultValue={orderDetail.states} + onSelect={(value) => { + console.info(value) + setOrderPropValue(order_sn,'orderstatus', value) + }} + value={orderDetail.states} options={[ { value: 1, label: '新订单' }, { value: 2, label: '报价中' }, From 7256ceb5d234c40eb22d1fef4079a76e30c6278d Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Wed, 21 Feb 2024 09:21:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=BE=E9=97=AE=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/OrderStore.js | 7 ++++--- src/views/AuthApp.jsx | 6 +++++- src/views/ChatHistory.jsx | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/stores/OrderStore.js b/src/stores/OrderStore.js index f5ee79a..a8963a0 100644 --- a/src/stores/OrderStore.js +++ b/src/stores/OrderStore.js @@ -15,10 +15,11 @@ const useOrderStore = create((set, get) => ({ fetchOrderDetail: async (colisn) => { const json = await fetchJSON(`${API_HOST}/getorderinfo`, { colisn }) if (json.errcode === 0 && json.result.length > 0) { + const orderResult = json.result[0] set(() => ({ - orderDetail: json.result[0], - customerDetail: json.result[0].contact[0], - lastQuotation: json.result[0].quotes.length > 0 ? json.result[0].quotes[0] : {}, + orderDetail: orderResult, + customerDetail: orderResult.contact.length > 0 ? orderResult.contact[0] : {}, + lastQuotation: orderResult.quotes.length > 0 ? orderResult.quotes[0] : {}, })) } }, diff --git a/src/views/AuthApp.jsx b/src/views/AuthApp.jsx index 6c91331..1bffdea 100644 --- a/src/views/AuthApp.jsx +++ b/src/views/AuthApp.jsx @@ -103,7 +103,11 @@ function AuthApp() { trigger={['click']} > e.preventDefault()} style={{ color: colorPrimary }}> - {loginUser.username.substring(1)}{loginUser.username} + {loginUser.username.substring(1)}{loginUser.username} diff --git a/src/views/ChatHistory.jsx b/src/views/ChatHistory.jsx index 250616d..96dd59d 100644 --- a/src/views/ChatHistory.jsx +++ b/src/views/ChatHistory.jsx @@ -67,6 +67,29 @@ const SearchForm = memo(function ({ onSubmit }) { ]} /> + + From 6979a1eabf8b9229835f2411dc0630d0d3e6435c Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Wed, 21 Feb 2024 10:43:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=88=86=E7=BB=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/CustomerProfile.jsx | 2 +- src/views/OrderFollow.jsx | 76 ++++++++++++++----- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/src/views/Conversations/Components/CustomerProfile.jsx b/src/views/Conversations/Components/CustomerProfile.jsx index f5cf7d6..957a0c3 100644 --- a/src/views/Conversations/Components/CustomerProfile.jsx +++ b/src/views/Conversations/Components/CustomerProfile.jsx @@ -35,7 +35,7 @@ const CustomerProfile = (() => { }} value={orderDetail.tags} options={[ - { value: 0, label: '未设置' }, + { value: 0, label: '未设置', disabled: true, }, { value: 240003, label: '重点' }, { value: 240002, label: '次重点' }, { value: 240001, label: '一般' } diff --git a/src/views/OrderFollow.jsx b/src/views/OrderFollow.jsx index b56b710..a4ae66e 100644 --- a/src/views/OrderFollow.jsx +++ b/src/views/OrderFollow.jsx @@ -267,30 +267,64 @@ function OrderList({ formValues }) { showTotal: (total) => { return `总数:${total}` } } - return ( - - }, - { - key: '2', - label: 'CH 订单:25', - children: - }, + function groupByParam(array, param) { + return array.reduce((result, item) => { + (result[item[param]] = result[item[param]] || []).push(item); + return result; + }, {}); + } + + const deptMap = new Map([ + ['1', 'CH直销组'], + ['2','CH大客户组'], + ['7','市场推广'], + ['8','德语市场'], + ['9','日语市场'], + ['10', '商旅市场'], + ['11', '法语市场'], + ['12', '西语市场'], + ['13', '英文在线组'], + ['14', '商务Biztravel'], + ['15', 'CH产品'], + ['16', 'APP移动项目组'], + ['17', 'ChinaTravel组'], + ['18', 'CT市场'], + ['20', '俄语市场'], + ['21', '意语市场'], + ['22', '爱游网'], + ['23', '三峡站'], + ['24', '桂林站'], + ['25', '上海站'], + ['26', '北京站'], + ['27', '西藏站'], + ['28', 'AH亚洲项目组'], + ['29', 'DMC地接组'], + ['30', 'Trippest项目组'], + ['31', '花梨鹰'], + ['32', 'Daytours板块'], + ['33', 'GH项目组'], + ['34', 'trippest网站'], + ['35', 'newsletter营销'], + ]) + + const groupOrderData = groupByParam(orderData, 'OPI_DEI_SN') + const deptKeys = Object.keys(groupOrderData) + const collapseItems = [] + + deptKeys.forEach(deptNo => { + const deptOrderList = groupOrderData[deptNo] + collapseItems.push( { - key: '3', - label: 'GH 订单:25', - children:
- }]} - />) + } + ) + }) + + return () } function OrderFollow() {