Commit 6ece1e98 by liimin

2

1 parent 70c749bd
...@@ -637,7 +637,6 @@ export default { ...@@ -637,7 +637,6 @@ export default {
async handleOrder() { async handleOrder() {
this.disabled = true this.disabled = true
this.gptRequest = true this.gptRequest = true
//await this.handleResetOrder() //await this.handleResetOrder()
// const tagsAll = this.tableParams.reduce((tags, next) => { // const tagsAll = this.tableParams.reduce((tags, next) => {
// tags += next.labelUnitList.map(({ labelName }) => labelName).join(',') // tags += next.labelUnitList.map(({ labelName }) => labelName).join(',')
...@@ -676,28 +675,20 @@ export default { ...@@ -676,28 +675,20 @@ export default {
this.orderform.result = JSON.stringify(result) this.orderform.result = JSON.stringify(result)
const { code, success, message, data } = result const { code, success, message, data } = result
if (code == '000000' && success) { if (code == '000000' && success) {
// let arr = [] if (!data) {
// for (let k in data) { this.$message.error('生成查询异常,请重试!')
// let m = data[k] return
// if (m && m != null) { }
// if (Array.isArray(m)) {
// arr = arr.concat(m)
// } else {
// arr.push(m)
// }
// }
// }
const { subject, festival, ...others } = data const { subject, festival, ...others } = data
this.keys = { subject, festival } this.keys = { subject, festival }
//searchForm //searchForm
this.searchForm = { ...others, customerSex: data.customerSex == 0 || data.customerSex == null ? null : Number(data.customerSex) } this.searchForm = { ...others, customerSex: data.customerSex == 0 || data.customerSex == null ? null : Number(data.customerSex) }
console.log(this.searchForm)
// 设置 searchForm // 设置 searchForm
this.searchTable() this.searchTable()
// this.gptRequest = false // this.gptRequest = false
// list // list
} else { } else {
this.$message.error(message) this.$message.error(message || '生成查询异常,请重试!')
} }
}, },
...@@ -732,26 +723,25 @@ export default { ...@@ -732,26 +723,25 @@ export default {
} }
content += `${cutomerInfo.join(';')};请根据客户的特征,分别为每个客户生成一条50字左右关于${this.keys.subject || ''}的营销文案。字段命名为content;整条结果以数组输出,命名为customers。输出json格式.` 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) const { code, success, message, data } = result
// let _obj = result.data if (code == '000000' && success) {
// this.$refs.clientManage.data[index].test = _obj.content if (!result.data) {
// this.$refs.clientManage.data = this.$refs.clientManage.data this.$message.error('生成文案异常,请重试!')
list.map((k, i) => { return
k.test = result.data.customers[i].content }
return k // console.log(result)
}) // let _obj = result.data
this.$forceUpdate() // this.$refs.clientManage.data[index].test = _obj.content
// this.$refs.clientManage.data = this.$refs.clientManage.data
list.map((k, i) => {
k.test = result.data.customers[i].content
return k
})
this.$forceUpdate()
} else {
this.$message.error(message || '生成文案异常,请重试!')
}
}) })
// list.map(k => {
// 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 => {
// console.log(result)
// let _obj = result.data
// console.log(_obj.content, '_obj.content')
// k.test = _obj.content
// })
// return k
// })
} }
}, },
mounted() {} mounted() {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!