behaviorAnalysis.js 3.54 KB
import api from '~/api/crew/index'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Component({
  properties: {
    detailInfo: {
      type: Object,
			value: {},
			observer: function(n) {
				this.getData()
			}
    },
  },
  data: {
		IMG_URL,
		merchantName: '深圳南山问界4S店深圳南山问界4S店深圳南山问界4S店',
		attendanceItems: [
			{ label: '打卡天数', key: 'checkInDays' },
			{ label: '迟到', key: 'late', valueClass: 'danger' },
			{ label: '早退', key: 'earlyLeave', valueClass: 'danger' },
			{ label: '旷工', key: 'absenteeism', valueClass: 'danger' }
		],
		dailyReportItems: [
			{ label: '已提交', key: 'submitted', subLabel: '日报完成率', subKey:'completionRate', subClass: 'success' },
			{ label: '未提交', key: 'notSubmitted' },
			{ label: '在岗', key: 'onDuty' },
			{ label: '调休', key: 'rest' }
		],
		receptionItems: [
			{ label: '实际交车数', key: 'actualDelivery' },
			{ label: '接待数量', key: 'receptionCount' },
			{ label: '未触客数', key: 'notTouched' }
		],
		weakTags: [
			{ label: '身份介绍:差', type: 'danger' },
			{ label: '场景塑造:差', type: 'danger' },
			{ label: '案例展示:差', type: 'danger' }
		],
		otherTags: [
			{ label: '逼单能力:一般', type: 'default' },
			{ label: '话题介入:一般', type: 'default' },
			{ label: '攻防能力:一般', type: 'default' },
			{ label: '服务意识:一般', type: 'default' },
			{ label: '专业知识:好', type: 'success' }
		],
		recordStatsRows: [
			[
				{ label: '录音', key: 'recordingCount' },
				{ label: '成交数', key: 'dealCount' },
				{ label: '战败数', key: 'defeatCount' },
				{ label: '成交率', key: 'dealRate' }
			],
			[
				{ label: '质检平均分', key: 'qualityScore' },
				{ label: '攻防平均分', key: 'attackDefenseScore' },
				{ label: '录音缺失率', key: 'recordingMissingRate' }
			]
		],
		dressWarningItems: [{ label: '预警次数', key: 'warningCount' }],
		behaviorInfo: {}
	},
  methods: {
		search(e) {
			this.setData({
				startStr: e.detail.startDay?.replace(/\//g, '-'),
				endStr: e.detail.endDay?.replace(/\//g, '-')
			}, () => {
				this.getData()
			})
		},
		getData() {
			let { detailInfo } = this.data
			// 假数据
			let data = {
				attendance: {
					checkInDays: 20,
					late: 1,
					earlyLeave: 5,
					absenteeism: 5
				},
				dailyReport: {
					submitted: 5,
					notSubmitted: 8,
					onDuty: 6,
					rest: 8,
					completionRate: 95
				},
				customerReception: {
					actualDelivery: 10,
					receptionCount: 2,
					notTouched: 8
				},
				recordingAnalysis: {
					behaviorTags: [],
					quantitativeIndicators: {
						recordingCount: 20,
						dealCount: 5,
						defeatCount: 3,
						dealRate: 15,
						qualityScore: 8,
						attackDefenseScore: 11,
						recordingMissingRate: 20
					}
				},
				dressCodeWarning: {
					warningCount: 8
				}
			}
			this.setData({
				behaviorInfo: data
			})
			let params = {
				employeeId: detailInfo.employeeId,
				scene: detailInfo.scene
			}
			api.getEmployeebehaviorData(params)
		},
		handleChangeMerchant() {
			this.triggerEvent('changeMerchant')
		},
		handleChangeMerchant(e) {
			let merchantId = 123
			this.setData({
				showSelectPopup: true,
				selectOptions: [{merchantId: 123, merchantName: '明明4s店1'}],
				selectValue: [merchantId]
			})
		},
		handlePopupConfirm(e) {
			let { values, items } = e.detail
			console.log(values)
		},
	
		hideSelectPopup() {
			this.setData({
				showSelectPopup: false
			})
		},
	},
})