Commit 82a5418a by liimin

1

1 parent 6943e963
...@@ -4,9 +4,10 @@ export const Constants = { ...@@ -4,9 +4,10 @@ export const Constants = {
'1': '删除好友, red-text' '1': '删除好友, red-text'
}, },
//性别选项 //性别选项
GENDER_OPTION: [{ GENDER_OPTION: [
{
label: '全部', label: '全部',
value: null value: 0
}, },
{ {
label: '男', label: '男',
...@@ -15,13 +16,14 @@ export const Constants = { ...@@ -15,13 +16,14 @@ export const Constants = {
{ {
label: '女', label: '女',
value: 2 value: 2
},
{
label: '未知',
value: 0
} }
// {
// label: '未知',
// value: 0
// }
], ],
SOURCE_OPTION: [{ SOURCE_OPTION: [
{
label: '全部', label: '全部',
value: 0 value: 0
}, },
...@@ -79,7 +81,8 @@ export const Constants = { ...@@ -79,7 +81,8 @@ export const Constants = {
} }
], ],
//标签类型 //标签类型
LABEL_OPTION: [{ LABEL_OPTION: [
{
label: '企业标签', label: '企业标签',
value: '企业标签' value: '企业标签'
}, },
...@@ -150,7 +153,8 @@ export const Constants = { ...@@ -150,7 +153,8 @@ export const Constants = {
1: '已激活', 1: '已激活',
2: '已过期' 2: '已过期'
}, },
DESCRIBEDATA: [{ DESCRIBEDATA: [
{
name: '潜在意向客户', name: '潜在意向客户',
info: '无购车且无其他交易行为的所有客户', info: '无购车且无其他交易行为的所有客户',
id: 4 id: 4
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</span> </span>
<!-- <span slot="customerSex" slot-scope="scope" >--> <!-- <span slot="customerSex" slot-scope="scope" >-->
<span slot="customerSex" slot-scope="scope"> <span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span> <span>{{ scope.scope.customerSex == 0 ? '全部' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span>
</span> </span>
<!-- 企微名称 --> <!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg"> <div slot="nickNameList" slot-scope="scope" class="expandImg">
...@@ -376,9 +376,13 @@ export default { ...@@ -376,9 +376,13 @@ export default {
flushTime: false, flushTime: false,
orderform: { order: '', result: '' }, orderform: { order: '', result: '' },
disabled: false, disabled: false,
placeholder: '帮我针对车牌号为粤B开头的车主发一条4s营销文案', placeholder: '帮我针对车牌号为粤B开头的车主发一条5.1节保养相关的营销文案',
drawer: false, drawer: false,
gptRequest: false gptRequest: false,
keys: {
subject: '',
festival: ''
}
} }
}, },
created() { created() {
...@@ -650,19 +654,21 @@ export default { ...@@ -650,19 +654,21 @@ export default {
//取值范围为:"'30岁以下','31-40岁','41-55岁'", //取值范围为:"'30岁以下','31-40岁','41-55岁'",
// 提取出购车月份,命名为buyMonth,例如5月,用数组输出; // 提取出购车月份,命名为buyMonth,例如5月,用数组输出;
// tags包括上面的购车年份,命名为buyYear,购车月份,命名为buyMonth,车型,命名为brand,是否保养,命名为maintain // tags包括上面的购车年份,命名为buyYear,购车月份,命名为buyMonth,车型,命名为brand,是否保养,命名为maintain
// 提取出是否已加企微,命名为isJoin,取值范围为:"'','1','0'",''表示全部,'1'表示是,'0'表示否;
if (this.orderform.order == '') { if (this.orderform.order == '') {
this.orderform.order = this.placeholder this.orderform.order = this.placeholder
} }
Object.assign(this.keys, { subject: '', festival: '' })
const order = this.orderform.order const order = this.orderform.order
// const content = '帮我查询从2023-3-29日至2023-04-05日期间西安飞广州或者深圳的机票,从上面一句话中提取出发日期,命名为date,出发地,命名为start,目的地,命名为end,输出json格式。' // const content = '帮我查询从2023-3-29日至2023-04-05日期间西安飞广州或者深圳的机票,从上面一句话中提取出发日期,命名为date,出发地,命名为start,目的地,命名为end,输出json格式。'
const content = `${order},忽略之前的上下文,今年是2023年,针对上面这段文字, const content = `${order},忽略之前的上下文,今年是2023年,针对上面这段文字,
提取出联系电话,命名为customerPhone; 提取出营销文案关键字,命名为subject;
提取出节日,命名为festival,如果是数字,转化成大写,例如:五一节;
提取出联系电话(手机号),命名为customerPhone,不用补全;
提取出车牌号,命名为carNumber,不用补全; 提取出车牌号,命名为carNumber,不用补全;
提取出客户名称,命名为customerName; 提取出客户名称,命名为customerName;
提取出车架号,命名为carVin; 提取出车架号,命名为carVin;
提取出性别,命名为customerSex,取值范围:"0,1,2",0表示未知,1表示男,2表示女; 提取出性别,命名为customerSex,取值范围:"0,1,2",0表示全部,1表示男,2表示女;
提取出是否已加企微,命名为isJoin,取值范围为:"'','1','0'",''表示全部,'1'表示是,'0'表示否;
所有提取字段取值精确匹配。
所有提取的字段未精确匹配到的不提取和输出。 所有提取的字段未精确匹配到的不提取和输出。
输出json格式` 输出json格式`
const result = await this.$apis.crowdManage.gpt(content) const result = await this.$apis.crowdManage.gpt(content)
...@@ -681,9 +687,10 @@ export default { ...@@ -681,9 +687,10 @@ export default {
// } // }
// } // }
// } // }
const { subject, festival, ...others } = data
this.keys = { subject, festival }
//searchForm //searchForm
this.searchForm = { ...data, customerSex: Number(data.customerSex) } this.searchForm = { ...others, customerSex: Number(data.customerSex) }
console.log(this.searchForm) console.log(this.searchForm)
// 设置 searchForm // 设置 searchForm
this.searchTable() this.searchTable()
...@@ -705,30 +712,35 @@ export default { ...@@ -705,30 +712,35 @@ export default {
if (!this.gptRequest) { if (!this.gptRequest) {
return false return false
} }
this.$refs.orderform.resetFields() this.$refs.orderform.resetFields()
this.gptRequest = false this.gptRequest = false
console.log('getGptList')
this.drawer = false this.drawer = false
let list = this.$refs.clientManage.data let list = this.$refs.clientManage.data
console.log(list)
list = list.map(element => { list = list.map(element => {
element.test = '正在生成中...' element.test = '正在生成中...'
return element return element
}) })
// let content = '我有一批客户,资料(id,customerName,customerSex,customerPhone,buyDate,carVin,carNumber) 分别是:'
let content = `忽略之前的上下文,我有${list.length}个客户资料分别是:`
let cutomerInfo = []
for (let index = 0; index < list.length; index++) { for (let index = 0; index < list.length; index++) {
let k = list[index] let { customerName, customerSex, customerPhone, buyDate, carVin, carNumber } = list[index]
const content = `忽略之前的上下文,对姓名为${k.customerName}客户,${k.customerName}是一个人,性别为${{ 1: '男', 2: '女' }[k.customerSex] || '先生/女士'},客户手机号为${k.customerPhone},${k.customerPhone}是客户的电话不是客服电话;生成一条最少100字的4s店新车营销文案,字段命名为content。只需content一个字段即可;输出json格式` // const content = `忽略之前的上下文,对姓名为${k.customerName}客户,${k.customerName}是一个人,性别为${{ 1: '男', 2: '女' }[k.customerSex] || '先生/女士'},客户手机号为${k.customerPhone},${k.customerPhone}是客户的电话不是客服电话;生成一条最少100字的4s店新车营销文案,字段命名为content。只需content一个字段即可;输出json格式`
// console.log(content, 'content') // console.log(content, 'content')
cutomerInfo.push(`客户${index + 1},姓名:${customerName},性别:${{ 1: '男', 2: '女' }[customerSex] || '先生/女士'},电话:${customerPhone},购车日期:${buyDate},车架号:${carVin},车牌号:${carNumber}`)
}
content += `${cutomerInfo.join(';')};请根据客户的特征,分别为每个客户生成一条50字左右关于${this.keys.subject || ''}的营销文案。字段命名为content;整条结果以数组输出,命名为customers。输出json格式.`
this.$apis.crowdManage.gpt(content).then(result => { this.$apis.crowdManage.gpt(content).then(result => {
// console.log(result) // console.log(result)
let _obj = result.data // let _obj = result.data
this.$refs.clientManage.data[index].test = _obj.content // this.$refs.clientManage.data[index].test = _obj.content
// this.$refs.clientManage.data = this.$refs.clientManage.data // this.$refs.clientManage.data = this.$refs.clientManage.data
list.map((k, i) => {
k.test = result.data.customers[i].content
return k
})
this.$forceUpdate() this.$forceUpdate()
}) })
}
// list.map(k => { // list.map(k => {
// const content = `忽略之前的上下文,对姓名为${k.customerName}客户,${k.customerName}是一个人,性别为${{ '1': '男', '2': '女' }[k.customerSex] || '先生/女士'},客户手机号为${k.customerPhone},${k.customerPhone}是客户的电话不是客服电话;生成一条最少100字的4s店新车营销文案,字段命名为content。只需content一个字段即可;输出json格式` // const content = `忽略之前的上下文,对姓名为${k.customerName}客户,${k.customerName}是一个人,性别为${{ '1': '男', '2': '女' }[k.customerSex] || '先生/女士'},客户手机号为${k.customerPhone},${k.customerPhone}是客户的电话不是客服电话;生成一条最少100字的4s店新车营销文案,字段命名为content。只需content一个字段即可;输出json格式`
// this.$apis.crowdManage.gpt(content).then(result => { // this.$apis.crowdManage.gpt(content).then(result => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!