Commit c0b3b468 by 前端

111

1 parent a1322830
...@@ -338,6 +338,10 @@ export default { ...@@ -338,6 +338,10 @@ export default {
line: 1 line: 1
}, },
{ {
label: '营销文案',
prop: 'test',
},
{
label: '购车时间', label: '购车时间',
prop: 'buyDate', prop: 'buyDate',
width: 250, width: 250,
...@@ -362,7 +366,8 @@ export default { ...@@ -362,7 +366,8 @@ export default {
orderform: { order: '', result: '' }, orderform: { order: '', result: '' },
disabled: false, disabled: false,
placeholder: '帮我针对车牌号为粤B开头的车主发一条5.1节日关怀', placeholder: '帮我针对车牌号为粤B开头的车主发一条5.1节日关怀',
drawer: false drawer: false,
gptRequest:false
} }
}, },
created() { created() {
...@@ -465,6 +470,7 @@ export default { ...@@ -465,6 +470,7 @@ export default {
}, },
setTableFinishFun() { setTableFinishFun() {
this.$refs.clientManage.data.length ? (this.$refs.clientManage.tableHeightValues = '') : this.$refs.clientManage.setTableHeightFun() this.$refs.clientManage.data.length ? (this.$refs.clientManage.tableHeightValues = '') : this.$refs.clientManage.setTableHeightFun()
this.getGptList()
}, },
getParams() { getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
...@@ -614,6 +620,7 @@ export default { ...@@ -614,6 +620,7 @@ export default {
async handleOrder() { async handleOrder() {
this.disabled = true this.disabled = 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(',')
...@@ -640,44 +647,65 @@ export default { ...@@ -640,44 +647,65 @@ export default {
提取出车牌号,命名为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'表示否; 提取出是否已加企微,命名为isJoin,取值范围为:"'','1','0'",''表示全部,'1'表示是,'0'表示否;
所有提取字段取值精确匹配。 所有提取字段取值精确匹配。
所有提取的字段未精确匹配到的不提取和输出。 所有提取的字段未精确匹配到的不提取和输出。
输出json格式` 输出json格式`
console.log(this.$apis.crowdManage)
const result = await this.$apis.crowdManage.gpt(content) const result = await this.$apis.crowdManage.gpt(content)
this.disabled = false
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 = [] // let arr = []
for (let k in data) { // for (let k in data) {
let m = data[k] // let m = data[k]
if (m && m != null) { // if (m && m != null) {
if (Array.isArray(m)) { // if (Array.isArray(m)) {
arr = arr.concat(m) // arr = arr.concat(m)
} else { // } else {
arr.push(m) // arr.push(m)
} // }
} // }
} // }
//searchForm //searchForm
this.searchForm = { ...data } this.searchForm = { ...data,customerSex:Number(data.customerSex) }
console.log(this.searchForm )
// 设置 searchForm // 设置 searchForm
this.searchTable() this.searchTable()
this.disabled = false
// list // list
} else { } else {
this.disabled = false
this.$message.error(message) this.$message.error(message)
} }
}, },
async handleResetOrder() { async handleResetOrder() {
this.orderform.result = '' this.orderform.result = ''
this.gptRequest = false
await this.resetTable() await this.resetTable()
},
// 获取节日祝福语
async getGptList(){
if(!this.gptRequest){
return false;
}
let list = this.$refs.clientManage.data;
list.map(k => {
const content = `忽略之前的上下文,针对${k.customerName},手机号${k.customerPhone}的客户,生成一条最少100字的营销文案,命名为test,输出json格式`;
this.$apis.crowdManage.gpt(content).then(result => {
console.log(result)
let _obj = result.data;
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!