|
|
@@ -0,0 +1,625 @@
|
|
|
+// 模拟对话数据与工具函数
|
|
|
+// 可与 AIDialog/index.vue 配合使用,作为初始数据或回退模拟
|
|
|
+
|
|
|
+// 预设问题(可根据业务扩展)
|
|
|
+export const presets = [
|
|
|
+ '查询近30天销售线索',
|
|
|
+ '查询近30天未跟进项目',
|
|
|
+ '查询近30天未跟进客户',
|
|
|
+ '查询签到记录',
|
|
|
+ '查询今日任务',
|
|
|
+ '查询项目跟进记录',
|
|
|
+ '查询报备项目',
|
|
|
+]
|
|
|
+
|
|
|
+// 示例消息列表(用于初始化展示)
|
|
|
+export const sampleMessages = [
|
|
|
+]
|
|
|
+
|
|
|
+// FAQ/快捷问法(可在界面展示成标签或菜单)
|
|
|
+export const quickFaq = [
|
|
|
+ {
|
|
|
+ q: '如何筛选未发货订单?',
|
|
|
+ a: '在查询条件中,将“发货状态”设置为“未发货”,并按时间区间筛选。',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ q: '表格字段含义说明',
|
|
|
+ a: '例如“accountno”为账户编号,“amount”为金额,支持统一格式化展示。',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ q: '导出报表建议',
|
|
|
+ a: '建议先设置好筛选条件,然后导出当前视图的数据,以保证数据一致性。',
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+// 模拟 AI 回复(前端本地逻辑,接口失败时可作为回退)
|
|
|
+export function simulateAIReply(text) {
|
|
|
+ const templates = [
|
|
|
+ (t) => `这是基于你的问题的思路:\n1) 明确目标\n2) 列出关键点\n3) 给出执行步骤\n\n问题:${t}`,
|
|
|
+ (t) => `我已理解你的问题:“${t}”。建议:\n- 分析数据来源\n- 明确条件与边界\n- 输出结构化结果`,
|
|
|
+ (t) => `为你生成的初步答案:\n${t}\n—— 如需更详细,请补充更多上下文。`,
|
|
|
+ ]
|
|
|
+ const idx = Math.floor(Math.random() * templates.length)
|
|
|
+ return templates[idx](text)
|
|
|
+}
|
|
|
+
|
|
|
+// 本地模拟请求(不替代实际 Api.requested,仅用于开发/演示)
|
|
|
+export function mockRequested(question) {
|
|
|
+ const q = String(question || '').toLowerCase()
|
|
|
+
|
|
|
+ // 构造“最近订单表格”示例数据
|
|
|
+ const buildRecentOrders = () => ({
|
|
|
+ content: '为你查询到最近的订单:',
|
|
|
+ table: {
|
|
|
+ columns: [
|
|
|
+ { title: '订单号', dataIndex: 'sonum', width: 180, ellipsis: true },
|
|
|
+ { title: 'ERP单号', dataIndex: 'erpbillno', width: 160, ellipsis: true },
|
|
|
+ { title: '订单类型', dataIndex: 'type', width: 120, ellipsis: true },
|
|
|
+ { title: '订单状态', dataIndex: 'status', width: 120, ellipsis: true },
|
|
|
+ { title: '领域', dataIndex: 'tradefield', width: 120, ellipsis: true },
|
|
|
+ { title: '企业名称', dataIndex: 'enterprisename', width: 200, ellipsis: true },
|
|
|
+ { title: '项目名称', dataIndex: 'projectname', width: 260, ellipsis: true },
|
|
|
+ { title: '数量', dataIndex: 'qty', width: 100, ellipsis: true },
|
|
|
+ { title: '总金额(元)', dataIndex: 'amount', width: 140, ellipsis: true },
|
|
|
+ { title: '备注', dataIndex: 'remarks', width: 260, ellipsis: true },
|
|
|
+ { title: '备货状态', dataIndex: 'goodsstatus', width: 120, ellipsis: true },
|
|
|
+ { title: '核销状态', dataIndex: 'writeoffstatus', width: 120, ellipsis: true },
|
|
|
+ { title: '开票状态', dataIndex: 'invoicestatus', width: 120, ellipsis: true },
|
|
|
+ { title: '业务员', dataIndex: 'salename', width: 120, ellipsis: true },
|
|
|
+ { title: '是否退货', dataIndex: 'isreturn', width: 120, ellipsis: true },
|
|
|
+ { title: '是否变更', dataIndex: 'ischange', width: 120, ellipsis: true },
|
|
|
+ { title: '审核时间', dataIndex: 'checkdate', width: 180, ellipsis: true },
|
|
|
+ ],
|
|
|
+ dataSource: [
|
|
|
+ {
|
|
|
+ key: 'SO-202409120030',
|
|
|
+ invoicestatus: '已开票',
|
|
|
+ ischange: '0',
|
|
|
+ sys_enterpriseid: 4370,
|
|
|
+ writeoffamount: 583588.20,
|
|
|
+ enterprisename: '四川青石建设有限公司',
|
|
|
+ brandname: '',
|
|
|
+ type: '项目订单',
|
|
|
+ isreturn: '0',
|
|
|
+ invoiceamount: 972647.00,
|
|
|
+ defaultamount: 972647.00,
|
|
|
+ returnamount: 0.00,
|
|
|
+ rowindex: 1,
|
|
|
+ erpbillno: 'ASO1-24090154',
|
|
|
+ sonum: 'SO-202409120030',
|
|
|
+ amount: 972647.00,
|
|
|
+ projectname: '涿州市城区地表水厂灾后恢复工程-气动及电动阀门',
|
|
|
+ salename: '柏为东',
|
|
|
+ sa_orderid: 65368,
|
|
|
+ goodsstatus: '未备货',
|
|
|
+ writeoffstatus: '部分核销',
|
|
|
+ qty: 29.0000,
|
|
|
+ submitdate: '2024-09-18 12:01:27',
|
|
|
+ remarks: ' 出货资料一式两份',
|
|
|
+ checkdate: '2024-09-18 15:23:00',
|
|
|
+ tradefield: '全领域',
|
|
|
+ status: '关闭'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "invoicestatus": "已开票",
|
|
|
+ "ischange": "0",
|
|
|
+ "sys_enterpriseid": 4370,
|
|
|
+ "writeoffamount": 127585.20,
|
|
|
+ "enterprisename": "四川青石建设有限公司",
|
|
|
+ "brandname": "",
|
|
|
+ "type": "项目订单",
|
|
|
+ "isreturn": "0",
|
|
|
+ "invoiceamount": 212642.00,
|
|
|
+ "defaultamount": 212642.00,
|
|
|
+ "returnamount": 0.00,
|
|
|
+ "rowindex": 2,
|
|
|
+ "erpbillno": "ASO1-23120149",
|
|
|
+ "sonum": "SO-202312120033",
|
|
|
+ "amount": 212642.00,
|
|
|
+ "projectname": "涿州市松店镇地表水厂增容工程—电动及气动阀门",
|
|
|
+ "salename": "刘伟",
|
|
|
+ "sa_orderid": 55377,
|
|
|
+ "goodsstatus": "未备货",
|
|
|
+ "writeoffstatus": "部分核销",
|
|
|
+ "qty": 4.0000,
|
|
|
+ "submitdate": "2023-12-18 14:13:37",
|
|
|
+ "remarks": "03-送水泵房(阀门);出货资料一式两份;",
|
|
|
+ "checkdate": "2023-12-18 15:50:02",
|
|
|
+ "tradefield": "全领域",
|
|
|
+ "status": "关闭"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "invoicestatus": "已开票",
|
|
|
+ "ischange": "0",
|
|
|
+ "sys_enterpriseid": 4370,
|
|
|
+ "writeoffamount": 286206.00,
|
|
|
+ "enterprisename": "四川青石建设有限公司",
|
|
|
+ "brandname": "",
|
|
|
+ "type": "项目订单",
|
|
|
+ "isreturn": "0",
|
|
|
+ "invoiceamount": 477010.00,
|
|
|
+ "defaultamount": 477010.00,
|
|
|
+ "returnamount": 0.00,
|
|
|
+ "rowindex": 3,
|
|
|
+ "erpbillno": "ASO1-23120148",
|
|
|
+ "sonum": "SO-202312120032",
|
|
|
+ "amount": 477010.00,
|
|
|
+ "projectname": "涿州市松店镇地表水厂增容工程—电动及气动阀门",
|
|
|
+ "salename": "刘伟",
|
|
|
+ "sa_orderid": 55376,
|
|
|
+ "goodsstatus": "未备货",
|
|
|
+ "writeoffstatus": "部分核销",
|
|
|
+ "qty": 54.0000,
|
|
|
+ "submitdate": "2023-12-18 14:13:29",
|
|
|
+ "remarks": "02-净水间2(阀门): 1、出货资料一式两份;2、第1-2项气动角型隔膜排泥阀产品及其配件,出货要求见附件; 3、气动蝶阀安装方式如附件;",
|
|
|
+ "checkdate": "2023-12-18 15:49:40",
|
|
|
+ "tradefield": "全领域",
|
|
|
+ "status": "关闭"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "invoicestatus": "已开票",
|
|
|
+ "ischange": "0",
|
|
|
+ "sys_enterpriseid": 4370,
|
|
|
+ "writeoffamount": 143103.00,
|
|
|
+ "enterprisename": "四川青石建设有限公司",
|
|
|
+ "brandname": "",
|
|
|
+ "type": "项目订单",
|
|
|
+ "isreturn": "0",
|
|
|
+ "invoiceamount": 238505.00,
|
|
|
+ "defaultamount": 238505.00,
|
|
|
+ "returnamount": 0.00,
|
|
|
+ "rowindex": 4,
|
|
|
+ "erpbillno": "ASO1-23120147",
|
|
|
+ "sonum": "SO-202312120031",
|
|
|
+ "amount": 238505.00,
|
|
|
+ "projectname": "涿州市松店镇地表水厂增容工程—电动及气动阀门",
|
|
|
+ "salename": "刘伟",
|
|
|
+ "sa_orderid": 55375,
|
|
|
+ "goodsstatus": "未备货",
|
|
|
+ "writeoffstatus": "部分核销",
|
|
|
+ "qty": 27.0000,
|
|
|
+ "submitdate": "2023-12-18 14:13:19",
|
|
|
+ "remarks": "01-净水间1(阀门):1、出货资料一式两份;2、第1-2项气动角型隔膜排泥阀产品及其配件,出货要求见附件; 3、气动蝶阀安装方式如附件;",
|
|
|
+ "checkdate": "2023-12-18 15:49:27",
|
|
|
+ "tradefield": "全领域",
|
|
|
+ "status": "关闭"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "invoicestatus": "已开票",
|
|
|
+ "ischange": "0",
|
|
|
+ "sys_enterpriseid": 4370,
|
|
|
+ "writeoffamount": 1204810.20,
|
|
|
+ "enterprisename": "四川青石建设有限公司",
|
|
|
+ "brandname": "",
|
|
|
+ "type": "项目订单",
|
|
|
+ "isreturn": "0",
|
|
|
+ "invoiceamount": 2008017.00,
|
|
|
+ "defaultamount": 2008017.00,
|
|
|
+ "returnamount": 0.00,
|
|
|
+ "rowindex": 5,
|
|
|
+ "erpbillno": "ASO1-23120146",
|
|
|
+ "sonum": "SO-202312120025",
|
|
|
+ "amount": 2008017.00,
|
|
|
+ "projectname": "涿州市城区地表水厂增容工程—电动、气动阀门",
|
|
|
+ "salename": "刘伟",
|
|
|
+ "sa_orderid": 55369,
|
|
|
+ "goodsstatus": "未备货",
|
|
|
+ "writeoffstatus": "部分核销",
|
|
|
+ "qty": 57.0000,
|
|
|
+ "submitdate": "2023-12-18 14:13:10",
|
|
|
+ "remarks": "1、出货资料一式两份;2、第1-3项电动蝶阀为立式安装(如附件),出厂时请将支脚安装于阀体上; 3、气动蝶阀安装方式如附件;",
|
|
|
+ "checkdate": "2023-12-18 15:49:09",
|
|
|
+ "tradefield": "全领域",
|
|
|
+ "status": "关闭"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "invoicestatus": "已开票",
|
|
|
+ "ischange": "0",
|
|
|
+ "sys_enterpriseid": 4370,
|
|
|
+ "writeoffamount": 271452.60,
|
|
|
+ "enterprisename": "四川青石建设有限公司",
|
|
|
+ "brandname": "",
|
|
|
+ "type": "项目订单",
|
|
|
+ "isreturn": "0",
|
|
|
+ "invoiceamount": 452421.00,
|
|
|
+ "defaultamount": 452421.00,
|
|
|
+ "returnamount": 0.00,
|
|
|
+ "rowindex": 6,
|
|
|
+ "erpbillno": "ASO1-23070057",
|
|
|
+ "sonum": "SO-202307100005",
|
|
|
+ "amount": 452421.00,
|
|
|
+ "projectname": "颍上自来水厂(二期)10标段 电气动阀门",
|
|
|
+ "salename": "刘伟",
|
|
|
+ "sa_orderid": 49819,
|
|
|
+ "goodsstatus": "未备货",
|
|
|
+ "writeoffstatus": "部分核销",
|
|
|
+ "qty": 5.0000,
|
|
|
+ "submitdate": "2023-07-10 10:02:53",
|
|
|
+ "remarks": "增加加长杆备注",
|
|
|
+ "checkdate": "2023-07-10 10:16:01",
|
|
|
+ "tradefield": "全领域",
|
|
|
+ "status": "关闭"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "invoicestatus": "已开票",
|
|
|
+ "ischange": "1",
|
|
|
+ "sys_enterpriseid": 4370,
|
|
|
+ "writeoffamount": 1098748.80,
|
|
|
+ "enterprisename": "四川青石建设有限公司",
|
|
|
+ "brandname": "",
|
|
|
+ "type": "项目订单",
|
|
|
+ "isreturn": "0",
|
|
|
+ "invoiceamount": 1831248.00,
|
|
|
+ "defaultamount": 1831248.00,
|
|
|
+ "returnamount": 0.00,
|
|
|
+ "rowindex": 7,
|
|
|
+ "erpbillno": "ASO1-23050220",
|
|
|
+ "sonum": "SO-202305230052",
|
|
|
+ "amount": 1831248.00,
|
|
|
+ "projectname": "颍上自来水厂(二期)10标段 电气动阀门",
|
|
|
+ "salename": "刘伟",
|
|
|
+ "sa_orderid": 48009,
|
|
|
+ "goodsstatus": "未备货",
|
|
|
+ "writeoffstatus": "部分核销",
|
|
|
+ "qty": 85.0000,
|
|
|
+ "submitdate": "2023-05-25 11:28:04",
|
|
|
+ "remarks": "",
|
|
|
+ "checkdate": "2023-05-26 10:43:12",
|
|
|
+ "tradefield": "全领域",
|
|
|
+ "status": "关闭"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ })
|
|
|
+ // 构造“最近线索表格”示例数据
|
|
|
+ const buildRecentClues = () => ({
|
|
|
+ content: '为你查询到最近的线索:',
|
|
|
+ button: ['详情'],
|
|
|
+ table: {
|
|
|
+ columns: [
|
|
|
+ { title: '城市', dataIndex: 'city',width: 150, ellipsis: false },
|
|
|
+ { title: '项目名称', dataIndex: 'projectName',width: 200, ellipsis: false },
|
|
|
+ { title: '投资估算(万元)', dataIndex: 'investmentEstimate',width: 150, ellipsis: false },
|
|
|
+ { title: '招标内容', dataIndex: 'tenderContent',width: 300, ellipsis: false },
|
|
|
+ { title: '发布时间', dataIndex: 'publishDate',width: 150, ellipsis: false },
|
|
|
+ { title: '来源', dataIndex: 'source',width: 150, ellipsis: false },
|
|
|
+ ],
|
|
|
+ dataSource: [
|
|
|
+ { key: '1', city: '北京市怀柔区', projectName: '怀柔地表水厂建设工程', investmentEstimate: 8000, tenderContent: '怀柔地表水厂建设工程的初步设计(含设计概算)、施工图设计、工程施工、设备采购', publishDate: '2025.10.25', source: '公共资源中心' },
|
|
|
+ { key: '2', city: '浙江省嘉兴市', projectName: '嘉兴联合污水处理厂二期改造工程施工02标', investmentEstimate: 17923.09, tenderContent: '1)联合污水厂厂内:主要涉及污水泵房、雨水泵房、初沉池、二沉池、细格栅及沉砂池、浓缩池、排海泵房、', publishDate: '2025.11.7', source: '公共资源中心' },
|
|
|
+ { key: '3', city: '贵州省贵阳市', projectName: '朱家河污水处理厂设备升级更新项目(一标段)设备采购及安装', investmentEstimate: 6000, tenderContent: '', publishDate: '2025.11.7', source: '公共资源中心' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ })
|
|
|
+ // 跟进对象
|
|
|
+ const buildFollowUpObject = () => ({
|
|
|
+ content: `<p style="line-height:25px;margin:0;">跟进对象?</p>`,
|
|
|
+ table: {
|
|
|
+ columns: [
|
|
|
+ { title: '姓名', dataIndex: 'name',width: 150, ellipsis: false },
|
|
|
+ { title: '联系方式', dataIndex: 'contact',width: 200, ellipsis: false },
|
|
|
+ { title: '微信', dataIndex: 'wechat',width: 150, ellipsis: false },
|
|
|
+ { title: '标签', dataIndex: 'tags',width: 300, ellipsis: false },
|
|
|
+ { title: '邮箱', dataIndex: 'email',width: 150, ellipsis: false },
|
|
|
+ { title: '部门', dataIndex: 'source',width: 150, ellipsis: false },
|
|
|
+ ],
|
|
|
+ dataSource: [
|
|
|
+ { key: '1', name: '陈金贵', contact: '13801921384', wechat: '--', tags: '支持者', email: '--', source: '销售部' },
|
|
|
+ { key: '2', name: '袁永详', contact: '13816957336', wechat: '--', tags: '关键决策人', email: '--', source: '总经办' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ })
|
|
|
+
|
|
|
+ // 回款订单(逾期收款明细)
|
|
|
+ const buildOverduePayments = () => ({
|
|
|
+ content: '为你查询到逾期收款明细:',
|
|
|
+ table: {
|
|
|
+ columns: [
|
|
|
+ { title: '逾期说明', dataIndex: 'overdueexplanation', width: 360, ellipsis: false },
|
|
|
+ { title: '业务员', dataIndex: 'name', width: 120, ellipsis: true },
|
|
|
+ { title: '部门', dataIndex: 'depname', width: 120, ellipsis: true },
|
|
|
+ { title: '订单号', dataIndex: 'sonum', width: 180, ellipsis: true },
|
|
|
+ { title: '项目名称', dataIndex: 'projectname', width: 240, ellipsis: true },
|
|
|
+ { title: '客户名称', dataIndex: 'enterprisename', width: 220, ellipsis: true },
|
|
|
+ { title: '行号', dataIndex: 'rowno', width: 80, ellipsis: true },
|
|
|
+ { title: '商品名称', dataIndex: 'itemname', width: 180, ellipsis: true },
|
|
|
+ { title: '商品编码', dataIndex: 'itemno', width: 160, ellipsis: true },
|
|
|
+ { title: '订单数量', dataIndex: 'qty', width: 100, ellipsis: true },
|
|
|
+ { title: '订单金额(元)', dataIndex: 'amount', width: 140, ellipsis: true },
|
|
|
+ { title: '逾期金额(元)', dataIndex: 'overdueamount', width: 160, ellipsis: true },
|
|
|
+ { title: '审核时间', dataIndex: 'checkdate', width: 180, ellipsis: true },
|
|
|
+
|
|
|
+ ],
|
|
|
+ dataSource: [
|
|
|
+ {
|
|
|
+ key: 'SO-202403190003-328412',
|
|
|
+ rowno: 20,
|
|
|
+ projectname: '庆元县人民医院迁建工程',
|
|
|
+ amount: 19550.00,
|
|
|
+ sonum: 'SO-202403190003',
|
|
|
+ itemname: 'BRVB喷管止回阀',
|
|
|
+ sys_enterpriseid: 2664,
|
|
|
+ itemno: '28131890009',
|
|
|
+ enterprisename: '杭州祺源实业有限公司',
|
|
|
+ overdueamount: 187.96,
|
|
|
+ spec: 'DN200/PN16',
|
|
|
+ sa_orderitemsid: 328412,
|
|
|
+ sa_orderid: 58106,
|
|
|
+ hrid: 480,
|
|
|
+ qty: 10.0,
|
|
|
+ name: '吴金星',
|
|
|
+ overdueexplanation: '已出货 533 天,依照合同收款条件,应于 2024-05-30 收款,现已逾期 532 天',
|
|
|
+ model: 'BRVB-0200C',
|
|
|
+ depname: '华东区',
|
|
|
+ rowindex: 1,
|
|
|
+ checkdate: '2024-03-19 14:14:36'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "rowno": 2,
|
|
|
+ "projectname": "庆元县人民医院迁建工程",
|
|
|
+ "amount": 3876.00,
|
|
|
+ "sonum": "SO-202403220027",
|
|
|
+ "itemname": "BAGV丝口型黄铜闸阀",
|
|
|
+ "sys_enterpriseid": 2664,
|
|
|
+ "itemno": "22111050009",
|
|
|
+ "enterprisename": "杭州祺源实业有限公司",
|
|
|
+ "overdueamount": 32.190000000000,
|
|
|
+ "spec": "DN32/PN16",
|
|
|
+ "sa_orderitemsid": 331888,
|
|
|
+ "sa_orderid": 58360,
|
|
|
+ "hrid": 480,
|
|
|
+ "qty": 57.0000,
|
|
|
+ "name": "吴金星",
|
|
|
+ "overdueexplanation": "已出货 533 天,依照合同收款条件,应于 2024-05-30 收款,现已逾期 532 天",
|
|
|
+ "model": "BAGV-0032C",
|
|
|
+ "depname": "华东区",
|
|
|
+ "rowindex": 2,
|
|
|
+ "checkdate": "2024-03-22 16:52:23"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "rowno": 4,
|
|
|
+ "projectname": "庆元县人民医院迁建工程",
|
|
|
+ "amount": 66538.00,
|
|
|
+ "sonum": "SO-202403220027",
|
|
|
+ "itemname": "BAGV丝口型黄铜闸阀",
|
|
|
+ "sys_enterpriseid": 2664,
|
|
|
+ "itemno": "22111030010",
|
|
|
+ "enterprisename": "杭州祺源实业有限公司",
|
|
|
+ "overdueamount": 28.850000000000,
|
|
|
+ "spec": "DN20/PN16",
|
|
|
+ "sa_orderitemsid": 331891,
|
|
|
+ "sa_orderid": 58360,
|
|
|
+ "hrid": 480,
|
|
|
+ "qty": 2060.0000,
|
|
|
+ "name": "吴金星",
|
|
|
+ "overdueexplanation": "已出货 533 天,依照合同收款条件,应于 2024-05-30 收款,现已逾期 532 天",
|
|
|
+ "model": "BAGV-0020C",
|
|
|
+ "depname": "华东区",
|
|
|
+ "rowindex": 3,
|
|
|
+ "checkdate": "2024-03-22 16:52:23"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "rowno": 1,
|
|
|
+ "projectname": "宁波市水务环境集团2024年调流调压阀采购项目",
|
|
|
+ "amount": 311820.00,
|
|
|
+ "sonum": "SO-202408130028",
|
|
|
+ "itemname": "RCEX活塞阀",
|
|
|
+ "sys_enterpriseid": 7655,
|
|
|
+ "itemno": "28141290096",
|
|
|
+ "enterprisename": "宁波市水务环境集团股份有限公司鄞州分公司",
|
|
|
+ "overdueamount": 311820.000000000000,
|
|
|
+ "spec": "DN800/PN10",
|
|
|
+ "sa_orderitemsid": 400665,
|
|
|
+ "sa_orderid": 64211,
|
|
|
+ "hrid": 480,
|
|
|
+ "qty": 1.0000,
|
|
|
+ "name": "吴金星",
|
|
|
+ "overdueexplanation": "已出货 380 天,依照合同收款条件,应于 2024-11-06 收款,现已逾期 372 天",
|
|
|
+ "model": "RCEX-0800B",
|
|
|
+ "depname": "华东区",
|
|
|
+ "rowindex": 4,
|
|
|
+ "checkdate": "2024-08-16 14:08:34"
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ })
|
|
|
+ // 关键词匹配规则
|
|
|
+ const matchers = [
|
|
|
+ {
|
|
|
+ test: /最近|近\d+天|近(一|二|三|四|五|六|七|八|九|十)天|线索表|线索表格|查询.*线索|线索.*查询/.test(q),
|
|
|
+ build: buildRecentClues,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ test: /最近|近\d+天|近(一|二|三|四|五|六|七|八|九|十)天|订单表|订单表格|查询.*订单|订单.*查询/.test(q),
|
|
|
+ build: buildRecentOrders,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ test: /订单统计|统计订单|订单.*状态.*统计/.test(q),
|
|
|
+ build: () => ({ content: '建议设定时间区间并按订单状态分组统计,以获取数量与金额的分布。' }),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ test: /导出报表|导出.*订单|订单.*导出/.test(q),
|
|
|
+ build: () => ({ content: '完成筛选后使用导出功能,可选择导出字段与顺序,导出结果与当前视图一致。' }),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ test: /字段说明|字段含义|表格字段/.test(q),
|
|
|
+ build: () => ({ content: '例如“accountno”为账户编号,“amount”为订单金额;字段会统一格式化以便阅读。' }),
|
|
|
+ },
|
|
|
+ // 逾期收款
|
|
|
+ {
|
|
|
+ test: /逾期|欠款|应收|回款|收款.*逾期/.test(q),
|
|
|
+ build: buildOverduePayments,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 查询长宁188项目
|
|
|
+ test: /查询.*长宁|188.*查询/.test(q),
|
|
|
+ build: () => ({
|
|
|
+ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">项目信息:</p>
|
|
|
+ <p style="line-height:25px;margin:0;">项目名称:长宁188项目</p>
|
|
|
+ <p style="line-height:25px;margin:0;">项目编号:HY-202511070001</p>
|
|
|
+ <p style="line-height:25px;margin:0;">报备进度:未报备</p>
|
|
|
+ <p style="line-height:25px;margin:0;">项目规模:2312万吨/天</p>
|
|
|
+ <div style="display: flex;flex-direction: row;gap: 8px;">
|
|
|
+ <div type="default" shape="round" class="cust-btn">报备</div>
|
|
|
+ <div type="default" shape="round" class="cust-btn">跟进</div>
|
|
|
+ <div type="default" shape="round" class="cust-btn">阶段</div></div>`})
|
|
|
+ },
|
|
|
+ // 报备
|
|
|
+ {
|
|
|
+ test: /^报备$/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">项目信息:</p>
|
|
|
+ <p style="line-height:25px;margin:0;">项目名称:长宁188项目</p>
|
|
|
+ <p style="line-height:25px;margin:0;">项目编号:HY-202511070001</p>
|
|
|
+ <p style="line-height:25px;margin:0;">报备进度:已报备</p>
|
|
|
+ <p style="line-height:25px;margin:0;">项目规模:2312万吨/天</p>
|
|
|
+ ` }),
|
|
|
+ },
|
|
|
+ // 跟进
|
|
|
+ {
|
|
|
+ test: /^跟进$/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">跟进类型?①现场交流;②网络交流;③电话拜访</p>
|
|
|
+ ` }),
|
|
|
+ },
|
|
|
+ // 现场交流
|
|
|
+ {
|
|
|
+ test: /^现场交流$/.test(q),
|
|
|
+ build:buildFollowUpObject,
|
|
|
+ },
|
|
|
+ // 袁永详
|
|
|
+ {
|
|
|
+ test: /^袁永详$/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">跟进目的?</p>
|
|
|
+ ` }),
|
|
|
+ },
|
|
|
+ // 项目推进
|
|
|
+ {
|
|
|
+ test: /^项目推进$/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">跟进过程?</p>
|
|
|
+ `}),
|
|
|
+ },
|
|
|
+ // 安装已中标,是一个公寓型酒店的给水泵房改造,项目符合合资档次。安装公司现在在比价阶段(KITZ/沃茨)
|
|
|
+ {
|
|
|
+ test: /安装.*KITZ|沃茨.*安装|给水泵房.*改造|公寓.*酒店.*安装|比价.*KITZ|比价.*沃茨/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">跟进结果?</p>
|
|
|
+ `}),
|
|
|
+ },
|
|
|
+ // 材质跟着管道走,大概率会选用不锈钢。配合安装先做选型报价。提供相关产品图册。
|
|
|
+ {
|
|
|
+ test: /比价.*KITZ|比价.*沃茨|材质.*管道|不锈钢.*选型|选型.*产品图册/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">下次跟进计划?</p>
|
|
|
+ `}),
|
|
|
+ },
|
|
|
+ // 跟进报价进展
|
|
|
+ {
|
|
|
+ test: /报价.*进展|进展.*报价|进展/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <div style="background:#fff;padding:10px;border-radius:8px;">
|
|
|
+ <p style="line-height:25px;margin:0;">您填写的跟进记录如下:</p>
|
|
|
+ <p style="line-height:25px;margin:0;">跟进类型:现场交流</p>
|
|
|
+ <p style="line-height:25px;margin:0;">跟进对象:袁永详</p>
|
|
|
+ <p style="line-height:25px;margin:0;">目的:项目情况</p>
|
|
|
+ <p style="line-height:25px;margin:0;">跟进过程:安装已中标,是一个公寓型酒店的给水泵房改造,项目符合合资档次。安装公司现在在比价阶段(KITZ/沃茨)。</p>
|
|
|
+ <p style="line-height:25px;margin:0;">结果:材质跟着管道走,大概率会选用不锈钢。配合安装先做选型报价。提供相关产品图册。</p>
|
|
|
+ <p style="line-height:25px;margin:0;">下次跟进计划:跟进报价进展。</p>
|
|
|
+ </div>
|
|
|
+ `}),
|
|
|
+ },
|
|
|
+ // 查订单
|
|
|
+ {
|
|
|
+ test: /^查订单$/.test(q),
|
|
|
+ build: () => ({ content: `
|
|
|
+ <p style="line-height:25px;margin:0;">请给出项目名称或客户名称</p>
|
|
|
+ `}),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ test: /^四川青石$/.test(q),
|
|
|
+ build: buildRecentOrders
|
|
|
+ },
|
|
|
+ // 查吴金星逾期回款订单
|
|
|
+ {
|
|
|
+ test: /吴金星.*逾期|回款.*回款/.test(q),
|
|
|
+ build: buildOverduePayments
|
|
|
+ },
|
|
|
+ ]
|
|
|
+
|
|
|
+ const matched = matchers.find(m => m.test)
|
|
|
+
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ resolve({
|
|
|
+ code: 1,
|
|
|
+ msg: 'ok',
|
|
|
+ data: {
|
|
|
+ answer: matched ? matched.build() : simulateAIReply(question),
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 简单时间格式化:HH:mm:ss
|
|
|
+export function formatTime(date = new Date()) {
|
|
|
+ const pad = (n) => (n < 10 ? '0' + n : '' + n)
|
|
|
+ return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`
|
|
|
+}
|
|
|
+
|
|
|
+// 演示场景:点击即可载入对应对话内容
|
|
|
+export const demoScenarios = [
|
|
|
+ {
|
|
|
+ name: '订单统计',
|
|
|
+ messages: [
|
|
|
+ { role: 'ai', content: '我可以帮你统计订单的状态与金额分布。', time: formatTime() },
|
|
|
+ { role: 'user', content: '统计一下最近30天的订单按状态数量。', time: formatTime() },
|
|
|
+ { role: 'ai', content: '好的,建议先设定时间区间为最近30天,并按“新建/提交/审核/关闭”等状态进行聚合统计。', time: formatTime() },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '报表导出',
|
|
|
+ messages: [
|
|
|
+ { role: 'user', content: '如何导出当前筛选结果的报表?', time: formatTime() },
|
|
|
+ { role: 'ai', content: '先完成筛选条件设置,再点击导出即可,导出会保持和当前视图一致。', time: formatTime() },
|
|
|
+ { role: 'ai', content: '如需Excel格式,可选择包含字段与顺序,避免超大数据导致打开缓慢。', time: formatTime() },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '字段说明',
|
|
|
+ messages: [
|
|
|
+ { role: 'user', content: '请解释一下表格中的关键字段含义。', time: formatTime() },
|
|
|
+ { role: 'ai', content: '例如“accountno”为账户编号,“amount”为订单金额;部分字段会按统一格式化展示以便阅读。', time: formatTime() },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '最近订单(表格)',
|
|
|
+ messages: [
|
|
|
+ { role: 'user', content: '请查询最近的订单,并输出表格。', time: formatTime() },
|
|
|
+ { role: 'ai', content: '为你查询到最近的订单:', time: formatTime() },
|
|
|
+ {
|
|
|
+ role: 'ai',
|
|
|
+ content: '如下表所示:',
|
|
|
+ time: formatTime(),
|
|
|
+ table: {
|
|
|
+ columns: [
|
|
|
+ { title: '订单号', dataIndex: 'orderNo' },
|
|
|
+ { title: '客户', dataIndex: 'customer' },
|
|
|
+ { title: '金额(元)', dataIndex: 'amount' },
|
|
|
+ { title: '状态', dataIndex: 'status' },
|
|
|
+ { title: '下单时间', dataIndex: 'date' },
|
|
|
+ ],
|
|
|
+ dataSource: [
|
|
|
+ { key: '1', orderNo: 'SO-20241101-001', customer: '张三', amount: 1299, status: '已发货', date: '2024-11-01 10:12' },
|
|
|
+ { key: '2', orderNo: 'SO-20241101-002', customer: '李四', amount: 288, status: '待发货', date: '2024-11-01 11:05' },
|
|
|
+ { key: '3', orderNo: 'SO-20241102-003', customer: '王五', amount: 5600, status: '已完成', date: '2024-11-02 09:48' },
|
|
|
+ { key: '4', orderNo: 'SO-20241102-004', customer: '赵六', amount: 75, status: '已取消', date: '2024-11-02 14:21' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+]
|