diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/package.json b/packages/plugins/@gemel/plugin-inquiry-record-detail/package.json index c3a01465c..8a9dcd805 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/package.json +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/package.json @@ -1,11 +1,11 @@ { "name": "@gemel/plugin-inquiry-record-detail", - "version": "1.4.0-alpha", + "version": "1.4.11-alpha", "main": "dist/server/index.js", "displayName": "Inquiry Record Details", "displayName.zh-CN": "询料记录详情", "description": "View the details of the inquiry record. And custom interaction processing", - "description.zh-CN": "查看询料记录详情。并进行自定义交互处理。", + "description.zh-CN": "查看询料记录详情,并进行一键回复。", "dependencies": {}, "peerDependencies": { "@nocobase/client": "1.x", diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/css/chatMessage.css b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/css/chatMessage.css index 7482ed24f..63f9af091 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/css/chatMessage.css +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/css/chatMessage.css @@ -21,12 +21,12 @@ border-radius: 8px; word-break: break-all; line-height: 1.5; - background-color: #f0f0f0; + background-color: #e6f7ff; } .messageContentSender { margin: 0 12px 0 0; - background-color: #e6f7ff; + background-color: #f0f0f0; } .avatar { diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/svg/chatMessages.svg b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/svg/chatMessages.svg deleted file mode 100644 index 55d2e9939..000000000 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/svg/chatMessages.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/svg/chatMessages.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/svg/chatMessages.tsx new file mode 100644 index 000000000..f40d9f9bd --- /dev/null +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/assets/svg/chatMessages.tsx @@ -0,0 +1,27 @@ +/** + * This file is part of the NocoBase (R) project. + * Copyright (c) 2020-2024 NocoBase Co., Ltd. + * Authors: NocoBase Team. + * + * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. + * For more information, please refer to: https://www.nocobase.com/agreement. + */ + +import React from 'react'; + +const ChatMessagesIcon = () => { + return ( + + + + + ); +}; + +export default ChatMessagesIcon; diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/ChatMessage.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/ChatMessage.tsx index f2db0bacd..38b188733 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/ChatMessage.tsx +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/ChatMessage.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Avatar } from 'antd'; -import styles from '../assets/css/chatMessage.css'; +import '../assets/css/chatMessage.css'; import classNames from 'classnames'; interface ChatMessage { @@ -30,22 +30,22 @@ const ChatMessages: React.FC<{ messages: ChatMessage[] }> = ({ messages }) => { }; return ( -
+
{messages.map((message, index) => { - const isHuman = message.speakerRole === 'human'; + const isAi = message.speakerRole === 'ai'; return ( -
+
- {isHuman ? 'AI' : 'U'} + {isAi ? 'AI' : 'U'} -
+
{formatContent(message.content)}
diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordDetail.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordDetail.tsx index c09173a7d..c8b964299 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordDetail.tsx +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordDetail.tsx @@ -14,6 +14,7 @@ import { InquiryRecordProvider, useInquiryRecord } from '../context/InquiryRecor import { Spin, Divider } from 'antd'; import InquiryRecordView from './InquiryRecordView'; import MaterialInquiryView from './MaterialInquiryView'; +import ReplyCustomer from './ReplyCustomer'; export interface InquiryRecordDetailProps { InquiryRecordId?: number | string; @@ -33,19 +34,17 @@ export const InquiryRecordDetail: FC = observer( { displayName: FieldComponentName }, ); -// 创建一个子组件来使用共享的数据 const InquiryRecordContent: FC = () => { const { loading } = useInquiryRecord(); - - if (loading) { - return ; - } + if (loading) return ; return ( -
+ <> 物料询价记录 -
+ 回复客户 + + ); }; diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordView.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordView.tsx index 633a81b7c..5d17a4d6a 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordView.tsx +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/InquiryRecordView.tsx @@ -8,7 +8,7 @@ */ import React, { FC } from 'react'; -import { Descriptions, Tag } from 'antd'; +import { Descriptions, Tag, Collapse, Space } from 'antd'; import { useInquiryRecord } from '../context/InquiryRecordContext'; import { inquiryRecordMap } from '../utils'; import dayjs from 'dayjs'; @@ -18,26 +18,53 @@ const InquiryRecordView: FC = () => { return ( <> - - - {inquiryRecordData?.origin_inquiry_text} - + + + + {inquiryRecordData?.origin_inquiry_text} + - - {inquiryRecordData?.createdAt && dayjs(inquiryRecordData.createdAt).format('YYYY-MM-DD HH:mm:ss')} - + + {inquiryRecordData?.createdAt && dayjs(inquiryRecordData.createdAt).format('YYYY-MM-DD HH:mm:ss')} + - - - {inquiryRecordMap(inquiryRecordData?.inquiry_status).label} - - - + + + {inquiryRecordMap(inquiryRecordData?.inquiry_status)?.label} + + + + {inquiryRecordData?.imName} + + {inquiryRecordData?.imPlatform} + + + {inquiryRecordData?.imIsGroup} + + {inquiryRecordData?.imBotUserId} + {inquiryRecordData?.imUserId} + {inquiryRecordData?.imAvatarUrl} + {inquiryRecordData?.imRemark} + + ), + }, + ]} + style={{ color: 'red' }} + /> + ); }; diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/MaterialInquiryView.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/MaterialInquiryView.tsx index 2a969595a..5b4999b57 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/MaterialInquiryView.tsx +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/MaterialInquiryView.tsx @@ -10,19 +10,41 @@ import React, { FC } from 'react'; import { useInquiryRecord } from '../context/InquiryRecordContext'; import SupplierInquiryRecordTable from './SupplierInquiryRecordTable'; -import { Tabs } from 'antd'; +import { Tabs, Tag, Space, Typography } from 'antd'; +import { inquiryRecordMaterialMap } from '../utils/inquiryRecordSatatus'; const MaterialInquiryView: FC = () => { const { inquiryMaterialsData } = useInquiryRecord(); - console.log('inquiryMaterialsData', inquiryMaterialsData); - if (!inquiryMaterialsData) return null; return (
- {inquiryMaterialsData.map((material, index) => ( + {inquiryMaterialsData.map((material: any) => ( + + + 状态: + + {inquiryRecordMaterialMap(material.inquiry_material_status)?.label} + + + {material.gather_error && ( + + 采集失败原因: + {material.gather_error} + + )} + + 需求数量: + {material.quantity} + + + 需求品牌: + {material.manufacturer} + + + { if (inquiryMaterialsData && !initialized.current) { inquiryMaterialsData.forEach((material) => { material.supplier_inquiry_records?.forEach((record) => { - if (record.has_adopt == '1') { - setSelectedRecord(String(material.material_code), record); - } + if (record.has_adopt == '1') setSelectedRecord(String(material.material_code), record); }); }); initialized.current = true; @@ -47,6 +45,8 @@ const ReplyCustomer: FC = () => { }; const handleReply = () => { + if (replyContent.trim() === '') return messageApi.error('回复内容不能为空'); + Modal.confirm({ title: '确认回复', content: '确定要发送这条回复吗?', diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/SupplierInquiryRecordTable.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/SupplierInquiryRecordTable.tsx index 581b18a80..6410d3f48 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/SupplierInquiryRecordTable.tsx +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/component/SupplierInquiryRecordTable.tsx @@ -9,12 +9,11 @@ import React, { FC } from 'react'; import { useInquiryRecord } from '../context/InquiryRecordContext'; -import { Table, Tag, Divider, Popover } from 'antd'; +import { Table, Tag, Popover } from 'antd'; import { supplierInquiryRecordStatusMap } from '../utils'; import type { TableProps } from 'antd'; -import ReplyCustomer from './ReplyCustomer'; import ChatMessages from './ChatMessage'; -import chatMessagesIcon from '../assets/svg/chatMessages.svg'; +import ChatMessagesIcon from '../assets/svg/chatMessages'; const SupplierInquiryRecordTable: FC<{ dataSource: any[]; tabKey: string }> = ({ dataSource, tabKey }) => { const { loading, selectedRecords, setSelectedRecord } = useInquiryRecord(); @@ -31,15 +30,17 @@ const SupplierInquiryRecordTable: FC<{ dataSource: any[]; tabKey: string }> = ({ const columns: any = [ { title: '供应商', + align: 'center', render: (_, record) => { return {record.supplier.company_name}; }, }, { title: '询问状态', + align: 'center', render: (_, record) => { const tag = supplierInquiryRecordStatusMap(record.inquiry_status); - return {tag.label}; + return {tag?.label}; }, }, { @@ -49,6 +50,13 @@ const SupplierInquiryRecordTable: FC<{ dataSource: any[]; tabKey: string }> = ({ return {record.price}; }, }, + { + title: '是否含税', + align: 'center', + render: (_, record) => { + return {record.has_tax_included === 'true' ? '含税' : '未税'}; + }, + }, { title: '库存状况', align: 'center', @@ -56,14 +64,22 @@ const SupplierInquiryRecordTable: FC<{ dataSource: any[]; tabKey: string }> = ({ return {record.store_status}; }, }, + { + title: '备注', + align: 'center', + render: (_, record) => { + return {record.remark}; + }, + }, { title: '聊天记录', align: 'center', render: (_, record) => { return ( } trigger="hover" placement="left"> - {/* 查看聊天记录 */} - 查看聊天记录 + + + ); }, @@ -83,8 +99,6 @@ const SupplierInquiryRecordTable: FC<{ dataSource: any[]; tabKey: string }> = ({ loading={loading} scroll={{ y: 275 }} /> - 回复客户 -
); }; diff --git a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/context/InquiryRecordContext.tsx b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/context/InquiryRecordContext.tsx index a90a69e26..a971619b7 100644 --- a/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/context/InquiryRecordContext.tsx +++ b/packages/plugins/@gemel/plugin-inquiry-record-detail/src/client/context/InquiryRecordContext.tsx @@ -82,45 +82,108 @@ export const InquiryRecordProvider: FC<{ }, ); + const data1 = { + createdAt: '2024-12-03T06:31:53.545Z', + updatedAt: '2024-12-03T06:35:02.757Z', + inquiry_date: '2024-12-03 14:31:52', + origin_inquiry_text: + 'SGM2203-3.3YK3G/TR SGMICRO 100只*0.3含税 \\n LD1117S33CTR ST/意法 1000个 \\n BAV74LT1G 4000 onsemi(安森美)', + id: 56, + inquiry_status: '4', + company_id: 4, + gather_error: null, + createdById: 1, + updatedById: 5, + reply_text: null, + imName: 'pre_groupName', + imPlatform: 'qq', + imBotUserId: 'pre_botUserId', + imIsGroup: '群', + imUserId: 'pre_groupId', + imAvatarUrl: 'pre_avatarUrl', + imRemark: 'pre_senderRemark', + company: { + createdAt: '2024-11-20T08:03:36.843Z', + updatedAt: '2024-11-20T08:11:50.185Z', + name: '电奇测试集团', + admin_user_id: 5, + id: 4, + createdById: 1, + updatedById: 1, + brain_api_key: null, + }, + }; + const data2 = [ { - createdAt: '2024-11-26T10:49:33.651Z', - updatedAt: '2024-11-26T11:40:37.129Z', - id: 45, + createdAt: '2024-12-03T06:31:53.564Z', + updatedAt: '2024-12-03T06:49:30.145Z', + id: 64, material_code: 'SGM2203-3.3YK3G/TR', - inquiry_material_status: '2', + inquiry_material_status: '4', createdById: 1, updatedById: 1, - inquiry_record_id: 46, + inquiry_record_id: 56, gather_error: null, + unit: null, + manufacturer: 'SGMICRO', + quantity: 100, suppliers: [ { - createdAt: '2024-11-20T11:50:57.390Z', - updatedAt: '2024-11-27T02:16:17.759Z', - id: 93, - qq_account: ['800875998'], + createdAt: '2024-12-03T06:35:09.988Z', + updatedAt: '2024-12-03T06:35:09.988Z', + id: 158, + qq_account: ['2881996960', '2881996965'], member_years: '13', - phones: ['0755-82724810 圣禾堂'], - mobiles: '19925288932', + phones: [ + '0755-82868046-722 小雪', + '0755-82868046-733 珊珊', + '0755-82868046-766 小燕', + '0755-82868045-788 丹琼', + ], + mobiles: '13424325001', faxes: '', - location: '深圳市  龙岗区', - addresses: '深圳市龙岗区坂田街道新天下工业城百瑞达大厦A座3楼', - company_tag: ['iccp'], - company_name: '圣禾堂(深圳)电子科技有限公司', - company_ids: ['1', '2', '4'], - createdById: null, - updatedById: 7, + location: '深圳市  世纪汇广场', + addresses: '深圳市福田区华强北世纪汇广场(交通银行大厦)2701C', + company_tag: ['sscp'], + company_name: '深圳市费迪南科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:40:37.588Z', - updatedAt: '2024-11-26T11:40:37.588Z', - inquiry_material_id: 45, - supplier_name: '圣禾堂(深圳)电子科技有限公司', + createdAt: '2024-12-03T06:35:10.008Z', + updatedAt: '2024-12-03T06:35:10.008Z', + inquiry_material_id: 64, + supplier_name: '深圳市费迪南科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:35:10.019Z', + updatedAt: '2024-12-03T06:35:10.019Z', + id: 159, + qq_account: ['2853323137'], + member_years: '7', + phones: ['0755-83953235 杨先生'], + mobiles: '13828717163', + faxes: '', + location: '深圳市', + addresses: '深圳市福田区华强北路1002号赛格广场22楼2202AB', + company_tag: ['icon_hcjg', 'sscp'], + company_name: '深圳华创仕达电子有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:35:10.039Z', + updatedAt: '2024-12-03T06:35:10.039Z', + inquiry_material_id: 64, + supplier_name: '深圳华创仕达电子有限公司', }, }, { - createdAt: '2024-11-26T11:40:37.267Z', - updatedAt: '2024-11-27T02:20:16.094Z', - id: 106, + createdAt: '2024-12-03T06:35:10.022Z', + updatedAt: '2024-12-03T06:35:10.022Z', + id: 160, qq_account: ['2881542792', '2881542749'], member_years: '4', phones: ['0755-83997694 郭先生', '0755-83997584 陈先生'], @@ -130,323 +193,414 @@ export const InquiryRecordProvider: FC<{ addresses: '深圳市福田区华强北路现代之窗A座2088室', company_tag: ['sscp'], company_name: '深圳市小张科技有限公司', - company_ids: ['1', '4'], + company_ids: ['4'], createdById: 5, - updatedById: 7, + updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:40:37.314Z', - updatedAt: '2024-11-26T11:40:37.314Z', - inquiry_material_id: 45, + createdAt: '2024-12-03T06:35:10.042Z', + updatedAt: '2024-12-03T06:35:10.042Z', + inquiry_material_id: 64, supplier_name: '深圳市小张科技有限公司', }, }, { - createdAt: '2024-11-26T11:40:37.288Z', - updatedAt: '2024-11-27T02:20:16.092Z', - id: 107, - qq_account: ['2355537532', '2881996961'], - member_years: '13', - phones: [ - '0755-82868046-722 小雪', - '0755-82868046-733 珊珊', - '0755-82868046-766 小燕', - '0755-82868045-788 丹琼', - ], - mobiles: '13424325001', + createdAt: '2024-12-03T06:35:10.036Z', + updatedAt: '2024-12-03T06:35:10.036Z', + id: 161, + qq_account: ['2881304825'], + member_years: '15', + phones: ['0755-83294944 陈小姐', '13723705052 苏小姐'], + mobiles: '13723705052', + faxes: '0755-83294948', + location: '深圳市  新亚洲电子商城一期', + addresses: '深圳市福田区中航路新亚洲电子商城一期4楼4B005室', + company_tag: ['sscp'], + company_name: '深圳市佳兴创达科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:35:10.053Z', + updatedAt: '2024-12-03T06:35:10.053Z', + inquiry_material_id: 64, + supplier_name: '深圳市佳兴创达科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:35:10.038Z', + updatedAt: '2024-12-03T06:35:10.038Z', + id: 162, + qq_account: ['3004240616'], + member_years: '1', + phones: ['0755-82788369 林小姐'], + mobiles: '13923770977', faxes: '', - location: '深圳市  世纪汇广场', - addresses: '深圳市福田区华强北世纪汇广场(交通银行大厦)2701C', + location: '深圳市', + addresses: '深圳市福田区华强北街道华航社区深南中路3006号佳和华强大厦3层3C251', company_tag: ['sscp'], - company_name: '深圳市费迪南科技有限公司', - company_ids: ['1', '4'], + company_name: '盛林微(深圳)电子有限公司', + company_ids: ['4'], createdById: 5, - updatedById: 7, + updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:40:37.355Z', - updatedAt: '2024-11-26T11:40:37.355Z', - inquiry_material_id: 45, - supplier_name: '深圳市费迪南科技有限公司', + createdAt: '2024-12-03T06:35:10.056Z', + updatedAt: '2024-12-03T06:35:10.056Z', + inquiry_material_id: 64, + supplier_name: '盛林微(深圳)电子有限公司', }, }, ], supplier_inquiry_records: [ { - createdAt: '2024-11-29T01:47:37.092Z', - updatedAt: '2024-11-29T07:28:44.465Z', - supplier_id: 93, - quiry_material_id: 45, - price: 20.8, - id: 13, + createdAt: '2024-12-03T06:47:20.299Z', + updatedAt: '2024-12-03T06:47:20.321Z', + supplier_id: 158, + quiry_material_id: 64, + price: 9.8, + id: 19, store_status: '满足', chat_messages: [ - { speakerRole: 'human', content: '哈喽' }, - { speakerRole: 'ai', content: '您好呀!有什么可以帮助您的吗?嘻嘻~' }, { - speakerRole: 'human', - content: '我需要 0603 10k 5% 的物料,请报价。 湘江的钽电容,10U/25V.B型请报价 1210 1% 3.3R 1/2W', + speakerRole: 'ai', + content: 'SGM2203-3.3YK3G/TR SGMICRO 100只*0.3含税', }, { - speakerRole: 'ai', - content: - '好的,我来为您查询一下库存和价格。\n\n1. 0603 10k 5% 电阻:\n- 库存:5000个\n- 价格:0.05美元/个\n\n2. 湘江的钽电容,10U/25V.B型:\n- 库存:2000个\n- 价格:0.2美元/个\n\n3. 1210 1% 3.3R 1/2W 电阻:\n- 库存:3000个\n- 价格:0.08美元/个\n\n请问您需要订购以上物料吗?', + speakerRole: 'human', + content: '9.8 有现货', }, ], inquiry_status: '2', createdById: 1, updatedById: 1, has_adopt: '0', + has_tax_included: 'false', + remark: null, supplier: { - createdAt: '2024-11-20T11:50:57.390Z', - updatedAt: '2024-11-27T02:16:17.759Z', - id: 93, - qq_account: ['800875998'], + createdAt: '2024-12-03T06:35:09.988Z', + updatedAt: '2024-12-03T06:35:09.988Z', + id: 158, + qq_account: ['2881996960', '2881996965'], member_years: '13', - phones: ['0755-82724810 圣禾堂'], - mobiles: '19925288932', + phones: [ + '0755-82868046-722 小雪', + '0755-82868046-733 珊珊', + '0755-82868046-766 小燕', + '0755-82868045-788 丹琼', + ], + mobiles: '13424325001', faxes: '', - location: '深圳市  龙岗区', - addresses: '深圳市龙岗区坂田街道新天下工业城百瑞达大厦A座3楼', - company_tag: ['iccp'], - company_name: '圣禾堂(深圳)电子科技有限公司', - company_ids: ['1', '2', '4'], - createdById: null, - updatedById: 7, + location: '深圳市  世纪汇广场', + addresses: '深圳市福田区华强北世纪汇广场(交通银行大厦)2701C', + company_tag: ['sscp'], + company_name: '深圳市费迪南科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, }, }, { - createdAt: '2024-11-29T01:47:37.118Z', - updatedAt: '2024-11-29T07:28:58.686Z', - supplier_id: 106, - quiry_material_id: 45, - price: null, - id: 14, - store_status: null, + createdAt: '2024-12-03T06:47:20.330Z', + updatedAt: '2024-12-03T06:47:20.347Z', + supplier_id: 159, + quiry_material_id: 64, + price: 11.4, + id: 20, + store_status: '满足', chat_messages: [ - { speakerRole: 'human', content: '哈喽' }, - { speakerRole: 'ai', content: '您好呀!有什么可以帮助您的吗?嘻嘻~' }, + { + speakerRole: 'ai', + content: 'SGM2203-3.3YK3G/TR SGMICRO 100只*0.3含税', + }, + { + speakerRole: 'human', + content: '11.4 24+', + }, ], - inquiry_status: '1', + inquiry_status: '2', createdById: 1, updatedById: 1, has_adopt: '0', + has_tax_included: 'true', + remark: null, supplier: { - createdAt: '2024-11-26T11:40:37.267Z', - updatedAt: '2024-11-27T02:20:16.094Z', - id: 106, - qq_account: ['2881542792', '2881542749'], - member_years: '4', - phones: ['0755-83997694 郭先生', '0755-83997584 陈先生'], - mobiles: '15712166684', - faxes: '0755-83997584', + createdAt: '2024-12-03T06:35:10.019Z', + updatedAt: '2024-12-03T06:35:10.019Z', + id: 159, + qq_account: ['2853323137'], + member_years: '7', + phones: ['0755-83953235 杨先生'], + mobiles: '13828717163', + faxes: '', location: '深圳市', - addresses: '深圳市福田区华强北路现代之窗A座2088室', - company_tag: ['sscp'], - company_name: '深圳市小张科技有限公司', - company_ids: ['1', '4'], + addresses: '深圳市福田区华强北路1002号赛格广场22楼2202AB', + company_tag: ['icon_hcjg', 'sscp'], + company_name: '深圳华创仕达电子有限公司', + company_ids: ['4'], createdById: 5, - updatedById: 7, + updatedById: 5, }, }, { - createdAt: '2024-11-29T01:47:37.143Z', - updatedAt: '2024-11-29T07:29:01.923Z', - supplier_id: 107, - quiry_material_id: 45, + createdAt: '2024-12-03T06:47:20.355Z', + updatedAt: '2024-12-03T06:47:20.373Z', + supplier_id: 162, + quiry_material_id: 64, price: null, - id: 15, + id: 21, store_status: null, - chat_messages: null, - inquiry_status: '0', + chat_messages: [ + { + speakerRole: 'ai', + content: 'SGM2203-3.3YK3G/TR SGMICRO 100只*0.3含税', + }, + ], + inquiry_status: '1', createdById: 1, updatedById: 1, has_adopt: '0', + has_tax_included: 'false', + remark: null, supplier: { - createdAt: '2024-11-26T11:40:37.288Z', - updatedAt: '2024-11-27T02:20:16.092Z', - id: 107, - qq_account: ['2355537532', '2881996961'], - member_years: '13', - phones: [ - '0755-82868046-722 小雪', - '0755-82868046-733 珊珊', - '0755-82868046-766 小燕', - '0755-82868045-788 丹琼', - ], - mobiles: '13424325001', + createdAt: '2024-12-03T06:35:10.038Z', + updatedAt: '2024-12-03T06:35:10.038Z', + id: 162, + qq_account: ['3004240616'], + member_years: '1', + phones: ['0755-82788369 林小姐'], + mobiles: '13923770977', faxes: '', - location: '深圳市  世纪汇广场', - addresses: '深圳市福田区华强北世纪汇广场(交通银行大厦)2701C', + location: '深圳市', + addresses: '深圳市福田区华强北街道华航社区深南中路3006号佳和华强大厦3层3C251', company_tag: ['sscp'], - company_name: '深圳市费迪南科技有限公司', - company_ids: ['1', '4'], + company_name: '盛林微(深圳)电子有限公司', + company_ids: ['4'], createdById: 5, - updatedById: 7, + updatedById: 5, }, }, ], }, { - createdAt: '2024-11-26T10:49:33.660Z', - updatedAt: '2024-11-26T11:42:01.126Z', - id: 46, - material_code: 'MM74HC4050N', + createdAt: '2024-12-03T06:31:53.574Z', + updatedAt: '2024-12-03T06:35:56.767Z', + id: 65, + material_code: 'LD1117S33CTR', inquiry_material_status: '2', createdById: 1, updatedById: 1, - inquiry_record_id: 46, + inquiry_record_id: 56, gather_error: null, + unit: null, + manufacturer: 'ST', + quantity: 1000, suppliers: [ { - createdAt: '2024-11-26T11:42:01.257Z', - updatedAt: '2024-11-26T11:42:01.257Z', - id: 108, - qq_account: ['3750349850'], - member_years: '1', - phones: [], - mobiles: '17825672023', - faxes: '', - location: '汕头市', - addresses: '汕头市潮阳区贵屿镇湄洲村东区三路6号', - company_tag: [], - company_name: '汕头市嘉源捷电子元器件商行', + createdAt: '2024-12-03T06:34:50.289Z', + updatedAt: '2024-12-03T06:34:50.289Z', + id: 154, + qq_account: ['800803666', '85814245'], + member_years: '14', + phones: ['0755-82807525 杨小姐'], + mobiles: '19866050955', + faxes: '0755-83953773', + location: '深圳市  现代之窗', + addresses: '深圳市福田区华强北路1058号现代之窗A座1188', + company_tag: ['iccp', 'icon_hckc'], + company_name: '深圳市四方联达科技有限公司', company_ids: ['4'], createdById: 5, updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:42:01.321Z', - updatedAt: '2024-11-26T11:42:01.321Z', - inquiry_material_id: 46, - supplier_name: '汕头市嘉源捷电子元器件商行', + createdAt: '2024-12-03T06:35:57.014Z', + updatedAt: '2024-12-03T06:35:57.014Z', + inquiry_material_id: 65, + supplier_name: '深圳市四方联达科技有限公司', }, }, { - createdAt: '2024-11-26T11:42:01.279Z', - updatedAt: '2024-11-27T02:20:44.875Z', - id: 109, - qq_account: ['83434317'], - member_years: '14', - phones: ['0755-83291041 '], - mobiles: '13714096955', + createdAt: '2024-12-03T06:34:50.292Z', + updatedAt: '2024-12-03T06:34:50.292Z', + id: 155, + qq_account: ['800102799'], + member_years: '10', + phones: ['0755-23894978 杨先生', '0755-23894678 ', '0755-83225919 ', '18319881765 林先生'], + mobiles: '13714690201', + faxes: '0755-82734333', + location: '深圳市', + addresses: '深圳市福田区中航路鼎诚国际大厦2706', + company_tag: ['iccp'], + company_name: '深圳市安玛科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:35:57.005Z', + updatedAt: '2024-12-03T06:35:57.005Z', + inquiry_material_id: 65, + supplier_name: '深圳市安玛科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:35:56.927Z', + updatedAt: '2024-12-03T06:35:56.927Z', + id: 163, + qq_account: ['800033588'], + member_years: '21', + phones: ['0755-83685222 连先生', '0755-82709166 张小姐', '0755-82709099 欧阳小姐'], + mobiles: '13823696501', faxes: '', - location: '深圳市  华强电子世界', - addresses: '深圳市华强电子世界华强三店(佳和大厦)2C047室', - company_tag: [], - company_name: '深圳市新易天电子', - company_ids: ['1', '4'], + location: '深圳市  新亚洲电子城二期', + addresses: '深圳市福田区华强北路国利大厦B座5楼 | 福田区新亚洲电子商城二期N1C368A房间', + company_tag: ['iccp'], + company_name: '深圳市英特翎电子有限公司', + company_ids: ['4'], createdById: 5, - updatedById: 7, + updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:42:01.353Z', - updatedAt: '2024-11-26T11:42:01.353Z', - inquiry_material_id: 46, - supplier_name: '深圳市新易天电子', + createdAt: '2024-12-03T06:35:56.947Z', + updatedAt: '2024-12-03T06:35:56.947Z', + inquiry_material_id: 65, + supplier_name: '深圳市英特翎电子有限公司', }, }, { - createdAt: '2024-11-26T11:42:01.293Z', - updatedAt: '2024-11-26T11:42:01.293Z', - id: 110, - qq_account: ['2885406049'], - member_years: '15', - phones: ['0755-83041867 罗小姐', '0755-82565052 null'], - mobiles: '13316913687', - faxes: '0755-83041867', - location: '深圳市  华强北路华强广场', - addresses: '深圳市福田区新华强六楼Q6E1090房间', - company_tag: [], - company_name: '深圳市通达盈科电子经营部', + createdAt: '2024-12-03T06:35:56.931Z', + updatedAt: '2024-12-03T06:35:56.931Z', + id: 164, + qq_account: ['2355759926', '2355759916'], + member_years: '16', + phones: ['0755-82811666 张小姐'], + mobiles: '18825554538', + faxes: '0755-83677488', + location: '深圳市', + addresses: '深圳市福田区深南中路3031号汉国中心大厦41楼4102-4106', + company_tag: ['iccp'], + company_name: '深圳市中盛大恒科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:35:56.951Z', + updatedAt: '2024-12-03T06:35:56.951Z', + inquiry_material_id: 65, + supplier_name: '深圳市中盛大恒科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:35:56.944Z', + updatedAt: '2024-12-03T06:35:56.944Z', + id: 165, + qq_account: ['2851656532', '800009605'], + member_years: '18', + phones: ['0755-82814185 钟先生', '0755-82814195 钟小姐', '0755-83993709 李先生'], + mobiles: '13332979803', + faxes: '0755-83993709', + location: '深圳市  华强广场', + addresses: '深圳市福田区华强北路1019号华强广场A座8D', + company_tag: ['iccp'], + company_name: '深圳市腾飞展业科技有限公司', company_ids: ['4'], createdById: 5, updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:42:01.368Z', - updatedAt: '2024-11-26T11:42:01.368Z', - inquiry_material_id: 46, - supplier_name: '深圳市通达盈科电子经营部', + createdAt: '2024-12-03T06:35:56.961Z', + updatedAt: '2024-12-03T06:35:56.961Z', + inquiry_material_id: 65, + supplier_name: '深圳市腾飞展业科技有限公司', }, }, ], supplier_inquiry_records: [ { - createdAt: '2024-11-29T01:52:29.830Z', - updatedAt: '2024-11-29T08:24:43.257Z', - supplier_id: 108, - quiry_material_id: 46, - price: 8.8, - id: 16, + createdAt: '2024-12-03T06:48:28.493Z', + updatedAt: '2024-12-03T06:48:50.951Z', + supplier_id: 164, + quiry_material_id: 65, + price: 4.3, + id: 22, store_status: '不满足', chat_messages: [ - { speakerRole: 'human', content: '哈喽' }, - { speakerRole: 'ai', content: '您好呀!有什么可以帮助您的吗?嘻嘻~' }, + { + speakerRole: 'ai', + content: 'LD1117S33CTR ST/意法 1000个', + }, + { + speakerRole: 'human', + content: '4.3 这个暂时没有现货哦', + }, ], inquiry_status: '2', createdById: 1, updatedById: 1, has_adopt: '0', + has_tax_included: 'false', + remark: null, supplier: { - createdAt: '2024-11-26T11:42:01.257Z', - updatedAt: '2024-11-26T11:42:01.257Z', - id: 108, - qq_account: ['3750349850'], - member_years: '1', - phones: [], - mobiles: '17825672023', - faxes: '', - location: '汕头市', - addresses: '汕头市潮阳区贵屿镇湄洲村东区三路6号', - company_tag: [], - company_name: '汕头市嘉源捷电子元器件商行', + createdAt: '2024-12-03T06:35:56.931Z', + updatedAt: '2024-12-03T06:35:56.931Z', + id: 164, + qq_account: ['2355759926', '2355759916'], + member_years: '16', + phones: ['0755-82811666 张小姐'], + mobiles: '18825554538', + faxes: '0755-83677488', + location: '深圳市', + addresses: '深圳市福田区深南中路3031号汉国中心大厦41楼4102-4106', + company_tag: ['iccp'], + company_name: '深圳市中盛大恒科技有限公司', company_ids: ['4'], createdById: 5, updatedById: 5, }, }, { - createdAt: '2024-11-29T08:24:43.265Z', - updatedAt: '2024-11-29T08:24:43.281Z', - supplier_id: 109, - quiry_material_id: 46, - price: 9.2, - id: 18, - store_status: '满足', - chat_messages: [ - { speakerRole: 'human', content: '哈喽' }, - { speakerRole: 'ai', content: '您好呀!有什么可以帮助您的吗?嘻嘻~' }, - ], - inquiry_status: '2', + createdAt: '2024-12-03T06:48:50.959Z', + updatedAt: '2024-12-03T06:48:50.977Z', + supplier_id: 163, + quiry_material_id: 65, + price: null, + id: 23, + store_status: null, + chat_messages: null, + inquiry_status: '0', createdById: 1, updatedById: 1, has_adopt: '0', + has_tax_included: 'false', + remark: null, supplier: { - createdAt: '2024-11-26T11:42:01.279Z', - updatedAt: '2024-11-27T02:20:44.875Z', - id: 109, - qq_account: ['83434317'], - member_years: '14', - phones: ['0755-83291041 '], - mobiles: '13714096955', + createdAt: '2024-12-03T06:35:56.927Z', + updatedAt: '2024-12-03T06:35:56.927Z', + id: 163, + qq_account: ['800033588'], + member_years: '21', + phones: ['0755-83685222 连先生', '0755-82709166 张小姐', '0755-82709099 欧阳小姐'], + mobiles: '13823696501', faxes: '', - location: '深圳市  华强电子世界', - addresses: '深圳市华强电子世界华强三店(佳和大厦)2C047室', - company_tag: [], - company_name: '深圳市新易天电子', - company_ids: ['1', '4'], + location: '深圳市  新亚洲电子城二期', + addresses: '深圳市福田区华强北路国利大厦B座5楼 | 福田区新亚洲电子商城二期N1C368A房间', + company_tag: ['iccp'], + company_name: '深圳市英特翎电子有限公司', + company_ids: ['4'], createdById: 5, - updatedById: 7, + updatedById: 5, }, }, ], }, { - createdAt: '2024-11-26T10:49:33.651Z', - updatedAt: '2024-11-26T11:40:37.129Z', - id: 48, + createdAt: '2024-12-03T06:31:53.584Z', + updatedAt: '2024-12-03T06:36:27.066Z', + id: 66, material_code: 'BAV74LT1G', inquiry_material_status: '2', createdById: 1, updatedById: 1, - inquiry_record_id: 48, + inquiry_record_id: 56, gather_error: null, + unit: null, + manufacturer: 'ON Semiconductor', + quantity: 4000, suppliers: [ { createdAt: '2024-11-20T11:50:57.390Z', @@ -463,51 +617,144 @@ export const InquiryRecordProvider: FC<{ company_name: '圣禾堂(深圳)电子科技有限公司', company_ids: ['1', '2', '4'], createdById: null, - updatedById: 7, + updatedById: 5, inquiry_materials_suppliers: { - createdAt: '2024-11-26T11:40:37.588Z', - updatedAt: '2024-11-26T11:40:37.588Z', - inquiry_material_id: 45, + createdAt: '2024-12-03T06:36:27.423Z', + updatedAt: '2024-12-03T06:36:27.423Z', + inquiry_material_id: 66, supplier_name: '圣禾堂(深圳)电子科技有限公司', }, }, + { + createdAt: '2024-11-20T11:51:27.092Z', + updatedAt: '2024-12-03T06:36:27.398Z', + id: 94, + qq_account: ['800858235'], + member_years: '19', + phones: ['0755-82730390 彭先生'], + mobiles: '13699220731', + faxes: '0755-82730390', + location: '深圳市  华强广场', + addresses: '深圳市福田区华强北华强广场一楼外围H1F009(麦当劳往步行街方向50米处)', + company_tag: ['iccp'], + company_name: '深圳明嘉瑞科技有限公司', + company_ids: ['1', '2', '4'], + createdById: null, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:36:27.416Z', + updatedAt: '2024-12-03T06:36:27.416Z', + inquiry_material_id: 66, + supplier_name: '深圳明嘉瑞科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:34:50.322Z', + updatedAt: '2024-12-03T06:34:50.322Z', + id: 157, + qq_account: ['3003532706'], + member_years: '9', + phones: ['0755-83524748 谢小姐'], + mobiles: '13410213481', + faxes: '', + location: '深圳市', + addresses: '深圳市福田区深南中路3006号佳和大厦A座一楼1C063-1C066房间', + company_tag: ['iccp'], + company_name: '深圳市凯新达科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:36:27.416Z', + updatedAt: '2024-12-03T06:36:27.416Z', + inquiry_material_id: 66, + supplier_name: '深圳市凯新达科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:36:27.387Z', + updatedAt: '2024-12-03T06:36:27.387Z', + id: 166, + qq_account: ['2851927397', '2851840398'], + member_years: '21', + phones: ['0755-88607789 吴小姐', '0755-83290199 周小姐', '0755-83031108 林先生'], + mobiles: '15920083008', + faxes: '0755-83031108', + location: '深圳市', + addresses: '深圳市福田区深南中路世纪汇(交通银行大厦)29层2901A', + company_tag: ['iccp', 'icon_hckc'], + company_name: '深圳市讯捷微科技有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:36:27.406Z', + updatedAt: '2024-12-03T06:36:27.406Z', + inquiry_material_id: 66, + supplier_name: '深圳市讯捷微科技有限公司', + }, + }, + { + createdAt: '2024-12-03T06:36:27.393Z', + updatedAt: '2024-12-03T06:36:27.393Z', + id: 167, + qq_account: ['800180928', '2355795741'], + member_years: '6', + phones: ['0755-82811525 周小姐', '19128451749 蒋斯勤', '18128820175 龙帆', '18128821167 罗贤方'], + mobiles: '18128821167', + faxes: '', + location: '深圳市', + addresses: '深圳市龙岗区布吉街道长龙社区铁西路9号壹都汇大厦1栋2001', + company_tag: ['iccp', 'icon_hckc'], + company_name: '深圳南电森美电子有限公司', + company_ids: ['4'], + createdById: 5, + updatedById: 5, + inquiry_materials_suppliers: { + createdAt: '2024-12-03T06:36:27.410Z', + updatedAt: '2024-12-03T06:36:27.410Z', + inquiry_material_id: 66, + supplier_name: '深圳南电森美电子有限公司', + }, + }, ], supplier_inquiry_records: [ { - createdAt: '2024-11-29T01:47:37.092Z', - updatedAt: '2024-11-29T07:28:44.465Z', - supplier_id: 93, - quiry_material_id: 48, - price: 20.8, - id: 19, - store_status: '满足', + createdAt: '2024-12-03T06:49:23.704Z', + updatedAt: '2024-12-03T06:49:23.720Z', + supplier_id: 94, + quiry_material_id: 66, + price: null, + id: 24, + store_status: null, chat_messages: [ - { speakerRole: 'ai', content: 'BAV74LT1G' }, { - speakerRole: 'human', - content: 'BAV74LT1G 20.1 24++', + speakerRole: 'ai', + content: ' BAV74LT1G 4000 onsemi(安森美)', }, ], - inquiry_status: '2', + inquiry_status: '1', createdById: 1, updatedById: 1, has_adopt: '0', + has_tax_included: 'false', + remark: null, supplier: { - createdAt: '2024-11-20T11:50:57.390Z', - updatedAt: '2024-11-27T02:16:17.759Z', - id: 93, - qq_account: ['800875998'], - member_years: '13', - phones: ['0755-82724810 圣禾堂'], - mobiles: '19925288932', - faxes: '', - location: '深圳市  龙岗区', - addresses: '深圳市龙岗区坂田街道新天下工业城百瑞达大厦A座3楼', + createdAt: '2024-11-20T11:51:27.092Z', + updatedAt: '2024-12-03T06:36:27.398Z', + id: 94, + qq_account: ['800858235'], + member_years: '19', + phones: ['0755-82730390 彭先生'], + mobiles: '13699220731', + faxes: '0755-82730390', + location: '深圳市  华强广场', + addresses: '深圳市福田区华强北华强广场一楼外围H1F009(麦当劳往步行街方向50米处)', company_tag: ['iccp'], - company_name: '圣禾堂(深圳)电子科技有限公司', + company_name: '深圳明嘉瑞科技有限公司', company_ids: ['1', '2', '4'], createdById: null, - updatedById: 7, + updatedById: 5, }, }, ], @@ -518,7 +765,7 @@ export const InquiryRecordProvider: FC<{ { const map = { - '0': { label: '待采集', color: 'orange' }, - '1': { label: '采集失败', color: 'blue' }, - '2': { label: '待询价', color: 'green' }, - '3': { label: '待回复', color: 'red' }, - '4': { label: '已回复', color: 'default' }, + '0': { label: '待采集', color: 'lime' }, + '1': { label: '待询价', color: 'magenta' }, + '2': { label: '询价中', color: 'blue' }, + '3': { label: '待回复', color: 'gold' }, + '4': { label: '已回复', color: 'purple' }, + }; + return map[status]; +}; + +export const inquiryRecordMaterialMap = (status: string) => { + const map = { + '0': { label: '待采集', color: 'lime' }, + '1': { label: '采集失败', color: 'red' }, + '2': { label: '待询价', color: 'magenta' }, + '3': { label: '询价中', color: 'blue' }, + '4': { label: '已回复', color: 'purple' }, }; return map[status]; };