Commit 9011df99 by 杨明

fixed

1 parent 04d490c8
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-17 10:56:24 * @Date: 2023-05-17 10:56:24
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-20 16:55:45 * @LastEditTime: 2023-05-22 10:44:27
* @FilePath: \scrm-micro-home\src\api\modules\activity.js * @FilePath: \scrm-micro-home\src\api\modules\activity.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import { http, http_merchant } from '@/main' import { http, http_merchant,http_gpt } from '@/main'
const url = 'rop-scrm-marketing/router' const url = 'rop-scrm-marketing/router'
const findActivityInfo = params => { const findActivityInfo = params => {
params.method = 'marketing.api.supermarket.findActivityInfo' params.method = 'marketing.api.supermarket.findActivityInfo'
...@@ -91,8 +91,8 @@ const findMerchantDetailByMerchantNo = params => { ...@@ -91,8 +91,8 @@ const findMerchantDetailByMerchantNo = params => {
}) })
} }
const getChatGPTList = params => { const getChatGPTList = params => {
return http({ return http_gpt({
url: 'http://192.168.3.226:18080/openai/title', url: 'openai/title',
method: 'POST', method: 'POST',
data: params, data: params,
sign: false, sign: false,
......
...@@ -22,4 +22,4 @@ export { bootstrap, mount, unmount } from '@/setup' ...@@ -22,4 +22,4 @@ export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
export const http_merchant = params => Vue.prototype.$http_merchant(params) export const http_merchant = params => Vue.prototype.$http_merchant(params)
export const http_gpt = params => Vue.prototype.$http_gpt(params)
...@@ -2,43 +2,35 @@ ...@@ -2,43 +2,35 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20 * @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-20 17:13:46 * @LastEditTime: 2023-05-22 10:47:05
* @FilePath: \scrm-micro-home\src\mixins\gpt.js * @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import { mapState } from 'vuex' import { mapState, mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
gptList: null,
t1: 0, // 主标题下标 t1: 0, // 主标题下标
t2: 0 // 副标题下标 t2: 0 // 副标题下标
} }
}, },
computed: { computed: {
...mapState('marketing', ['keywords']) ...mapState('marketing', ['keywords', 'GPTList'])
}, },
watch: { watch: {
keywords() { keywords() {
this.t1 = 0; this.t1 = 0
this.t2 = 0 this.t2 = 0
} }
}, },
methods: { methods: {
async getGPTitle(type) { getGPTitle(type) {
if (!this.gptList) {
const json = await fetch('http://192.168.3.226:8080/openai/title?req.userPrompt=' + this.keywords, {
method: 'POST'
})
const gptList = await json.json()
this.gptList = JSON.parse(gptList.data.message)
}
if (type == 1) { if (type == 1) {
this.editForm.marketingTitle = this.gptList.mainTitles[this.t1].title this.editForm.marketingTitle = this.GPTList.mainTitles[this.t1].title
this.t1++ this.t1++
} }
if (type == 2) { if (type == 2) {
this.editForm.marketingSubtitle = this.gptList.subTitles[this.t2].title this.editForm.marketingSubtitle = this.GPTList.subTitles[this.t2].title
this.t2++ this.t2++
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-07-22 18:15:13 * @Date: 2022-07-22 18:15:13
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-20 17:20:39 * @LastEditTime: 2023-05-22 10:43:25
* @FilePath: \scrm-micro-home\src\setup\qiankun.js * @FilePath: \scrm-micro-home\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -28,13 +28,14 @@ let routes = [] ...@@ -28,13 +28,14 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, request_common, request_merchant, sign_common, scene } = await fetchConfig() const { response, request, sign, secret, request_common, request_merchant, request_gpt, sign_common, scene } = await fetchConfig()
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_gpt = new common.Http({ response, request: request_gpt, sign, secret, alert: ElementUI.Message.error })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$scene = scene Vue.prototype.$scene = scene
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33 * @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-20 17:16:30 * @LastEditTime: 2023-05-22 10:49:33
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js * @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
calendarDataAll: [], calendarDataAll: [],
schemeList: [], schemeList: [],
keywords: '', keywords: '',
GPTList: {}, GPTList: null,
merchantInfo: {} merchantInfo: {}
}, },
mutations: { mutations: {
...@@ -64,7 +64,6 @@ export default { ...@@ -64,7 +64,6 @@ export default {
['SET_GPT_LIST'](state, payload) { ['SET_GPT_LIST'](state, payload) {
state.GPTList = payload state.GPTList = payload
} }
}, },
actions: { actions: {
setCustomDetail({ commit }, data) { setCustomDetail({ commit }, data) {
...@@ -82,13 +81,16 @@ export default { ...@@ -82,13 +81,16 @@ export default {
setActivityProject({ commit }, data) { setActivityProject({ commit }, data) {
commit('SET_ACTIVITY_PEOJECT', data) commit('SET_ACTIVITY_PEOJECT', data)
}, },
setKeyWords({ commit }, data) { setKeyWords({ commit, state }, data) {
if (state.keywords == data) return
commit('SET_KET_WORDs', data) commit('SET_KET_WORDs', data)
apis.activity.getChatGPTList({'req.userPrompt':data}).then(res => { apis.activity.getChatGPTList({ 'req.userPrompt': data }).then(res => {
commit('SET_GPT_LIST', data) const gptList = JSON.parse(res.message)
if (gptList.mainTitles) {
commit('SET_GPT_LIST', gptList)
}
}) })
}, },
//营销日历列表 //营销日历列表
getCalendarListData(conText, payload) { getCalendarListData(conText, payload) {
apis.activity.getCalendarList(payload).then(res => { apis.activity.getCalendarList(payload).then(res => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-16 10:20:01 * @Date: 2023-05-16 10:20:01
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-19 14:29:17 * @LastEditTime: 2023-05-22 11:10:48
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
} }
}, },
methods: { methods: {
...mapActions('marketing', ['setActivityInfo','setKeyWords']), ...mapActions('marketing', ['setActivityInfo', 'setKeyWords']),
selectText(html) { selectText(html) {
this.contentHtml = html this.contentHtml = html
this.phrasesShow = false this.phrasesShow = false
...@@ -112,13 +112,14 @@ export default { ...@@ -112,13 +112,14 @@ export default {
type: 'question', type: 'question',
content content
}) })
const calendarData = this.calendarDataAll.find(item => content.includes(item.title)) //根据关键字查找模板
const calendarData = this.calendarDataAll.find(item => content.includes(item.keywords))
if (calendarData) { if (calendarData) {
this.chatItem.push({ this.chatItem.push({
type: 'answer', type: 'answer',
content: '我们为您生成以下方案,请查看“营销模型解析”' content: '我们为您生成以下方案,请查看“营销模型解析”'
}) })
this.setKeyWords('续保') this.setKeyWords(calendarData.keywords)
this.setActivityInfo({ this.setActivityInfo({
id: calendarData.id, id: calendarData.id,
type: 'calendar' type: 'calendar'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 10:23:52 * @Date: 2023-05-16 10:23:52
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-20 14:56:16 * @LastEditTime: 2023-05-22 11:36:12
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\GPTAnalysis.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\GPTAnalysis.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
<glsx-combi-form class="edit-form-container" :isBlock="true" ref="editFormRef" formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" :isBlock="true" ref="editFormRef" formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="marketingTitle" class="input-slot"> <div slot="marketingTitle" class="input-slot">
<el-input placeholder="请输入营销主题" v-model="editForm.marketingTitle" style="width:400px" maxlength="12" show-word-limit></el-input> <el-input placeholder="请输入营销主题" v-model="editForm.marketingTitle" style="width:400px" maxlength="12" show-word-limit></el-input>
<label @click="getGPTitle(1)" v-if="keywords">ChatGPT重新生成</label> <label @click="getGPTitle(1)" v-if="GPTList">ChatGPT重新生成</label>
<label v-else class="disabled-label">ChatGPT重新生成</label> <label v-else class="disabled-label">ChatGPT重新生成</label>
</div> </div>
<div slot="marketingSubtitle" class="input-slot"> <div slot="marketingSubtitle" class="input-slot">
<el-input placeholder="请输入副主题" v-model="editForm.marketingSubtitle" style="width:400px" maxlength="20" show-word-limit></el-input> <el-input placeholder="请输入副主题" v-model="editForm.marketingSubtitle" style="width:400px" maxlength="20" show-word-limit></el-input>
<label @click="getGPTitle(2)" v-if="keywords">ChatGPT重新生成</label> <label @click="getGPTitle(2)" v-if="GPTList">ChatGPT重新生成</label>
<label v-else class="disabled-label">ChatGPT重新生成</label> <label v-else class="disabled-label">ChatGPT重新生成</label>
</div> </div>
<template slot="activityTimeHtml"> <template slot="activityTimeHtml">
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<el-button @click="handleCancel" size="medium">取消</el-button> <el-button @click="handleCancel" size="medium">取消</el-button>
<el-button type="primary" @click="handleConfirm" size="medium">保存方案</el-button> <el-button type="primary" @click="handleConfirm" size="medium">保存方案</el-button>
</GLFooter> </GLFooter>
<select-emp-dialog v-if="isSelectEmpVisible" :isSelectEmpVisible="isSelectEmpVisible" @handleEmpClose="handleEmpClose" @handleEmpConfirm="handleEmpConfirm"></select-emp-dialog> <select-emp-dialog v-if="isSelectEmpVisible" :isSelectEmpVisible="isSelectEmpVisible" @handleEmpConfirm="handleEmpConfirm"></select-emp-dialog>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog> <select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
<select-goods-dialog v-if="isSelectGoodsVisible" :isSelectGoodsVisible="isSelectGoodsVisible" :selectedGoodsLists="selectedGoodsList" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></select-goods-dialog> <select-goods-dialog v-if="isSelectGoodsVisible" :isSelectGoodsVisible="isSelectGoodsVisible" :selectedGoodsLists="selectedGoodsList" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></select-goods-dialog>
<select-equity-dialog v-if="isSelectEquityVisible" :isSelectEquityVisible="isSelectEquityVisible" :selectedEquityLists="selectedEquityList" @handleEquityConfirm="handleEquityConfirm" @handleEquityClose="handleEquityClose"></select-equity-dialog> <select-equity-dialog v-if="isSelectEquityVisible" :isSelectEquityVisible="isSelectEquityVisible" :selectedEquityLists="selectedEquityList" @handleEquityConfirm="handleEquityConfirm" @handleEquityClose="handleEquityClose"></select-equity-dialog>
...@@ -405,7 +405,7 @@ export default { ...@@ -405,7 +405,7 @@ export default {
}, },
componentsName: 'analysis', componentsName: 'analysis',
computed: { computed: {
...mapState('marketing', ['activityInfo', 'keywords', 'merchantInfo']), ...mapState('marketing', ['activityInfo', 'GPTList', 'merchantInfo']),
mergeStr() { mergeStr() {
const { backgroundImage, detailImage, merchantLog } = this.editForm const { backgroundImage, detailImage, merchantLog } = this.editForm
if (!backgroundImage || !detailImage || !merchantLog) return if (!backgroundImage || !detailImage || !merchantLog) return
...@@ -570,7 +570,7 @@ export default { ...@@ -570,7 +570,7 @@ export default {
this.isSelectEmpVisible = !this.isSelectEmpVisible this.isSelectEmpVisible = !this.isSelectEmpVisible
}, },
handleEmpConfirm(selectedData) { handleEmpConfirm(selectedData) {
this.editForm.followStaff = selectedData[0].staffId this.editForm.followStaff = selectedData.staffId
this.handleEmpClose() this.handleEmpClose()
this.addOrUpdate() this.addOrUpdate()
}, },
......
<template> <template>
<GLDialog mode="big" :appendToBody="true" bigTitle="选择营销跟进专员" :hasFooter="hasFooter" :before-close="handleEmpClose" @onOk="handleEmpConfirm" @onCancel="handleEmpClose" :visible.sync="isSelectEmpVisible"> <GLDialog mode="small" :appendToBody="true" title="选择营销跟进专员" cancelText="跳过" :hasFooter="hasFooter" :before-close="handleEmpClose" @onOk="handleEmpConfirm" @onCancel="handleEmpClose" :visible.sync="isSelectEmpVisible">
<div class="config-item"> <div class="config-item">
<div class="market-title"> <div class="market-title">
<label>*</label> <label>*</label>
...@@ -49,10 +49,14 @@ export default { ...@@ -49,10 +49,14 @@ export default {
}) })
}, },
handleEmpConfirm() { handleEmpConfirm() {
this.$emit('handleEmpConfirm', this.staffInfo) if (this.staffInfo && this.staffInfo.length) {
this.$emit('handleEmpConfirm', this.staffInfo[0])
} else {
this.$message.error('请选择跟进专员')
}
}, },
handleEmpClose() { handleEmpClose() {
this.$emit('handleEmpClose') this.$emit('handleEmpConfirm', {})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!