CRM_26-03-31#story#8372,服务商KPI看板设置埋点及支持数据导出需求--中心组

This commit is contained in:
2026-03-26 11:49:44 +08:00
parent e288d1e180
commit c05bdb361b
3 changed files with 48 additions and 1 deletions

View File

@@ -177,3 +177,23 @@ export function getNewVersion(key){
params: key
})
}
export function getLog(data){
// 添加log
return request({
url: '/ureport/pageView/save',
method:'POST',
contentType:'application/json',
data
})
}
//获取最新版本
export function getUserBO(){
return request({
url: '/base/user/getUserBO',
method:'POST',
})
}

View File

@@ -1,10 +1,13 @@
import { getLog } from "@/api/order"
export const myMixins = {
data() {
return {
}
},
methods: {
async setLogHandler(data) {
await getLog(data)
},
showFun() {
if( localStorage.getItem('infoVerify') == 8 || localStorage.getItem('infoVerify') == 12 ) {
return false

View File

@@ -263,6 +263,7 @@ import {
getDriverName,getDriverStatisticsKpi,
getRecentSupplierKpi,
} from "@/api/kpi.js"
import { getUserBO } from "@/api/order"
// querySupplierDriverStatisticsScore
import {myMixins} from "@/utils/myMixins"
import CircleChar from "@/views/kpi/components/circleChar.vue";
@@ -330,6 +331,10 @@ export default {
showScoreChart:true,
continueMonthKpi:[],
isBtn:false,//是否有信息变更申请按钮权限
source: 'App',
currentSupplierId: '',
userId: '',
enterTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}
},
created() {
@@ -338,13 +343,32 @@ export default {
this.isZd = urlParams?.get('isZd') || ''
this.supplierId = urlParams?.get('supplierId') || ''
this.isBtn= Number(urlParams?.get('isBtn'))
this.source = urlParams?.get('source') || 'App'
},
async mounted() {
await this.checkMobile();
await this.initDate();
await this.selectSupplierNameHandle();
await this.getUserInfo();
this.enterTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
},
async beforeDestroy() {
await this.setLogHandler({
supplierId: this.currentSupplierId, // 服务商 id
userId: this.userId, // userId
source: '服务商KPI',
event: this.source, // 区分 App 还是 system
openTime: this.enterTime, // log 时间,其中 阅读时长是由 enter 和 leave 的时间计算而来
leaveTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
});
},
methods: {
async getUserInfo() {
let res = await getUserBO();
this.userId = res.data.id;
this.currentSupplierId = res.data.supplierId
console.log('getUserBO', res)
},
applicateHandle() {
if (window.parent) {
const hasListener = window.parent.dispatchEvent(new Event('checkCloseDialog'));