Commit e3ae544f by zhangxw

工资绩效重做 门店/员工目标配置需求开发

1 parent 22e2686e
......@@ -9,13 +9,12 @@ export function getYqMerchantListBySceneApi(data) {
// 获取员工列表
export function getListApi(data) {
data.method = `${path}staff.performance.page`
// data.method = 'dj.api.life.pos.trm.list'
return request(data,'post')
}
// 获取启用商学院员工数量
// 获取启用工资绩效员工数量
export function getEnableStaffNumApi(data) {
data.method = `${path}businessSchoolEnable.number`
data.method = `${path}performanceEnable.number`
return request(data, 'post')
}
......@@ -25,9 +24,9 @@ export function importStaffApi(data) {
return request(data, "post", ["file"])
}
// 禁用启用商学院
// 禁用启用工资绩效
export function enableOrDisableApi(data) {
data.method = `${path}businessSchoolEnable.update`
data.method = `${path}performanceEnable.update`
return request(data,'post')
}
......@@ -73,8 +72,14 @@ export function getNoRelateStaffListApi(data) {
return request(data, 'post')
}
// 根据园区店商户号获取不同场景下的4S店
// 根据场景值和园区店查询服务商下的所有4s店
export function getMerchantStoreByServiceApi(data) {
data.method = "dj.api.scenemerchantref.listShopMerchantByYqMerchantId"
return request(data, "post")
}
// 根据场景值获取园区店下所有4s店
export function getMerchantStoreApi(data) {
data.method = "dj.api.scenemerchantref.query4SRefByYqShop"
return request(data, "post")
}
}
\ No newline at end of file
import request from "./request"
const path = 'dj.api.smartcarlife.'
// 获取店面目标列表
export function getStoreTargetListApi(data) {
data.method = 'dj.smartcarlife.api.yqPartnerMerchant.ref.page'
data.method = `${path}merchantTargetConfig.page`
return request(data, 'post')
}
// 获取员工任务列表
// 获取员工目标任务列表
export function getStaffTaskListApi(data) {
data.method = 'dj.smartcarlife.api.yqPartnerMerchant.ref.page'
data.method = `${path}staffTargetCheck.page`
return request(data, 'post')
}
// 获取员工任务详情
export function getStaffTaskDetailApi(data) {
data.method = 'dj.smartcarlife.api.yqPartnerMerchant.ref.page'
data.method = `${path}staffTargetCheck.getTargetCheck`
return request(data, 'post')
}
\ No newline at end of file
......@@ -820,7 +820,7 @@ export const routerName = {
label: "启用工资绩效",
handle: "handleEnableOrDisable",
ruleObj: {
attr: "businessSchoolEnableFlag",
attr: "performanceFlag",
rule: {
N: "启用工资绩效",
Y: "禁用工资绩效"
......
......@@ -70,7 +70,7 @@ export default {
title() {
const titleObj = {
performanceConfig: '工资绩效示例说明',
montorAdditionalBonus: '导师附加提成示例说明'
tutorBonusConfigs: '导师附加提成示例说明'
}
return titleObj[this.diffExplain]
},
......@@ -78,7 +78,7 @@ export default {
const infoObj = {
performanceConfig: `<div class='mb10'>员工A在某个月中单店完成产值20000元,按高产值奖励规则,奖励值落点区间在0-80000,则提成比例为产值4%;根据该员工的当月成交率为45%,均可单价为2000计算,则整体提成系数为0.8*0.8=0.64</div>
<div class='mb10'>汇总计算员工A在该月份获得的提成为=20000*5%*0.8*0.8=640元。</div>`,
montorAdditionalBonus: `<div class='mb10'>1、员工a入职时间为8月18日,对应0-3个月内的导师提成比例为20%,假如第一个月内员工a产生订单产值40000元,根据业绩配置该员工提成为4000元,则其关联导师的导师提成激励为4000*20%=800元,计入次月导师的月份最终工资</div>
tutorBonusConfigs: `<div class='mb10'>1、员工a入职时间为8月18日,对应0-3个月内的导师提成比例为20%,假如第一个月内员工a产生订单产值40000元,根据业绩配置该员工提成为4000元,则其关联导师的导师提成激励为4000*20%=800元,计入次月导师的月份最终工资</div>
<div class='mb10'>2、员工a到11月18日为满三个月,12月份初计算导师提成时,按11.1-11.18的学员提成20%和11.19-11.30的学员提成10%计算为该导师的11月总导师激励提成</div>
<div class='mb10'>3、删除解绑学员时不影响订单提成规则,如8月18日关联导师,8月20日解绑学员时,导师在9月初将计算8.18-8.20该学员的订单提成比例,并入导师提成激励计算到9月初发放的最终工资中。</div>
<div class='mb10'>4、按导师学员的绑定关系计算,区间月份含当月,0即为第一个月份,0-3代表前三个月,4-6代表第四到第六个月整,以此类推</div>`
......
......@@ -6,7 +6,7 @@
<el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index">
</el-tab-pane>
</el-tabs> -->
<components :is="tabName" :sceneType="activeName"></components>
<components :is="tabName"></components>
</div>
</div>
</template>
......
......@@ -20,9 +20,9 @@
</div>
<div slot="mentorCommission">
<el-tabs type="card" :before-leave="beforeLeave" v-model="configInfo.defaultMerchant" edit @tab-remove="removeTab">
<el-tab-pane v-for="(subItem, subIndex) in configInfo.merchantArr" :key="subItem.merchantId" :closable="configInfo.merchantArr.length > 0" :name="subItem.merchantId">
<span slot="label"><i v-if="subItem.validateErrFlag" class="el-icon-warning car-error-txt"></i>{{ subItem.merchantName }}</span>
<el-form class="commission-box" :ref="`mentor_commission${subItem.merchantId}`" :model="subItem" :rules="formRules">
<el-tab-pane v-for="(subItem, subIndex) in configInfo.merchantArr" :key="subItem.shopMerchantId" :closable="configInfo.merchantArr.length > 0" :name="subItem.shopMerchantId">
<span slot="label"><i v-if="subItem.validateErrFlag" class="el-icon-warning car-error-txt"></i>{{ subItem.shopMerchantName }}</span>
<el-form class="commission-box" :ref="`mentor_commission${subItem.shopMerchantId}`" :model="subItem" :rules="formRules">
<div class="title_text">
<span class="tips-block"
slot="label">
......@@ -34,9 +34,9 @@
<span class="tips-icon" />
</el-tooltip>
</span>
<span class="explain" @click="handleExplain('montorAdditionalBonus')">示例说明</span>
<span class="explain" @click="handleExplain('tutorBonusConfigs')">示例说明</span>
</div>
<d2-table ref="orderRef" class="award-wrap" :tableData="subItem['montorAdditionalBonusList']"
<d2-table ref="orderRef" class="award-wrap" :tableData="subItem['tutorBonusConfigs']"
:tableParams="montorTableParams" :hasPage="false">
<template slot="startMonth" slot-scope="scope">
<span v-if="scope.scope.isStartEdit">{{ scope.scope.startMonth }}</span>
......@@ -46,25 +46,25 @@
</template>
<template slot="endMonth" slot-scope="scope">
<span v-if="scope.scope.isEndEdit">--</span>
<el-form-item v-else style="margin-bottom: 0px;margin-right: 0;" :prop="`montorAdditionalBonusList.${scope.index}.endMonth`"
<el-form-item v-else style="margin-bottom: 0px;margin-right: 0;" :prop="`tutorBonusConfigs.${scope.index}.endMonth`"
:rules="checkEndValue(scope.scope)">
<el-input class="input-w-136" :disabled="pageDisabled" v-model="scope.scope.endMonth" placeholder="请输入"
@blur="handleCalculate('montorAdditionalBonus', 'endMonth', scope.index, subIndex)"></el-input>
@blur="handleCalculate('tutorBonusConfigs', 'endMonth', scope.index, subIndex)"></el-input>
</el-form-item>
</template>
<template slot="calculateValue" slot-scope="scope">
<el-form-item style="margin-bottom: 0px;margin-right: 0;" :prop="`montorAdditionalBonusList.${scope.index}.calculateValue`"
<el-form-item style="margin-bottom: 0px;margin-right: 0;" :prop="`tutorBonusConfigs.${scope.index}.calculateValue`"
:rules="formRules.calculateValue">
<el-input class="input-w-136" :disabled="pageDisabled" v-model="scope.scope.calculateValue" placeholder="请输入"
@blur="handleCalculate('montorAdditionalBonus', 'calculateValue', scope.index, subIndex)"></el-input>
@blur="handleCalculate('tutorBonusConfigs', 'calculateValue', scope.index, subIndex)"></el-input>
</el-form-item>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button :disabled="pageDisabled" @click="handleDelete(`montorAdditionalBonusList`, scope.index, subIndex)" type="text" size="small">删除</el-button>
<el-button :disabled="pageDisabled" @click="handleDelete(`tutorBonusConfigs`, scope.index, subIndex)" type="text" size="small">删除</el-button>
</div>
</d2-table>
<div class="add-txt">
<el-button icon="el-icon-plus" :disabled="pageDisabled" @click="addLine('montorAdditionalBonus', subIndex)">新增一行</el-button>
<el-button icon="el-icon-plus" :disabled="pageDisabled" @click="addLine('tutorBonusConfigs', subIndex)">新增一行</el-button>
</div>
</el-form>
</el-tab-pane>
......@@ -327,12 +327,12 @@ export default {
this.disabledMerchantArr = []
val?.forEach(v => {
// 已选的门店
this.disabledMerchantArr.push(v.merchantId)
this.disabledMerchantArr.push(v.shopMerchantId)
})
},
deep: true
},
'configInfo.performanceConfigFlag': {
'configInfo.performanceFlag': {
handler(val) {
this.pageDisabled = !val
},
......@@ -345,7 +345,7 @@ export default {
methods: {
// 切换场景默认选中的门店tab
updateData(val) {
this.configInfo = val
this.configInfo.defaultMerchant = val
this.$forceUpdate()
},
// 控制form表单显示隐藏
......@@ -395,13 +395,13 @@ export default {
removeTab(targetName) {
let merchantArr = this.configInfo?.merchantArr
let defaultMerchant = this.configInfo?.defaultMerchant
if (targetName == defaultMerchant) this.$set(this.configInfo, 'defaultMerchant', merchantArr[0]?.merchantId)
let index = merchantArr?.findIndex(val => val.merchantId == targetName)
if (targetName == defaultMerchant) this.$set(this.configInfo, 'defaultMerchant', merchantArr[0]?.shopMerchantId)
let index = merchantArr?.findIndex(val => val.shopMerchantId == targetName)
merchantArr.splice(index, 1)
},
// 删除关联的初级驻店销售
handleRelateDelete(index) {
let list = this.configInfo.studentStaffs
let list = this.titleForm.studentStaffs
this.$confirm('删除学员后,后续订单不再计入导师提成,是否确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -426,8 +426,6 @@ export default {
let idx = this.mentorStaffList.findIndex(k => k.staffUuid == e)
list[index].phoneNumber = this.mentorStaffList[idx]?.phoneNumber
list[index].staffName = this.mentorStaffList[idx]?.staffName
// 假数据
if (index == 1) list[index].associationDate = '2024-01-01'
this.$nextTick(() => {
this.$refs['title-dialog-form'].clearValidate(`studentStaffs.${index}.staffUuid`)
})
......@@ -459,8 +457,8 @@ export default {
if (valid) {
let tabListData = this.configInfo?.merchantArr
tabListData.push({
merchantId: `${this.storeForm?.merchantId}`,
merchantName: this.storeForm?.merchantName
shopMerchantId: `${this.storeForm?.merchantId}`,
shopMerchantName: this.storeForm?.merchantName
})
this.configInfo.defaultMerchant = `${this.storeForm?.merchantId}`
this.handleStoreClose()
......@@ -469,8 +467,8 @@ export default {
},
// 导师附加提成新增一行
addLine(item, index) {
!this.configInfo['merchantArr'][index][item + 'List'] ? (this.configInfo['merchantArr'][index][item + 'List'] = []) : ''
let formData = this.configInfo['merchantArr'][index][item + 'List']
!this.configInfo['merchantArr'][index][item] ? (this.configInfo['merchantArr'][index][item] = []) : ''
let formData = this.configInfo['merchantArr'][index][item]
let line = formData?.length + 1
formData.push({
startMonth: line >= 2 ? '' : 0,
......@@ -492,13 +490,12 @@ export default {
},
// 职级晋升/降级 清除数据
clearData() {
let configInfo = this.configInfo
configInfo.studentStaffs = []
configInfo.montorAdditionalBonusList = []
this.configInfo.studentStaffs = []
this.configInfo.merchantArr = []
},
// 区间值/提成比例 失去焦点
handleCalculate(item, key, index, idx) {
let formData = this.configInfo['merchantArr'][idx][item + 'List']
let formData = this.configInfo['merchantArr'][idx][item]
let max = 98
if (key == 'calculateValue') {
max = 100
......@@ -538,7 +535,7 @@ export default {
let valideResult = [] // 精品升级配置
for (var j = 0; j < configInfo.merchantArr?.length; j++) {
let subVal = configInfo.merchantArr[j]
const node = this.$refs[`mentor_commission${subVal.merchantId}`][0]
const node = this.$refs[`mentor_commission${subVal?.shopMerchantId}`]?.[0]
node?.validate(valid => {
if (valid) {
subVal.validateErrFlag = false
......
......@@ -74,8 +74,8 @@ export default {
explainDialog
},
props: {
perConfigInfo: Object,
pageDisabled: Boolean
perConfigInfo: Object, // 配置信息
pageDisabled: Boolean // 是否可编辑
},
data() {
var checkPrice = (rule, value, callback) => {
......
......@@ -67,27 +67,20 @@ export default {
label: '订单产值/元',
prop: 'orderMoney'
}, {
label: '均客单奖励',
label: '产值比例',
prop: 'averagePriceBonus'
}, {
label: '高客单奖励',
label: '成交率系数',
prop: 'customerUnitBonus'
}, {
label: '高产值奖励',
label: '均客单系数',
prop: 'outputBonus'
}, {
label: '成交率奖励',
prop: 'upgradeRateBonus'
}, {
label: '导师激励提成',
prop: 'mentorBonus'
}, {
label: '订单总提成',
prop: '',
formatter: (cellValue) => {
// 当前员工id=mentorStaffUuid 取导师奖励提成 否则就是 均客单奖励+高客单奖励+高产值奖励+成交率奖励
return cellValue?.mentorStaffUuid == this.detailInfoData?.staffUuid ? (cellValue?.mentorBonus || 0) : cellValue?.averagePriceBonus + cellValue?.customerUnitBonus + cellValue?.outputBonus + cellValue?.upgradeRateBonus
}
prop: 'orderBonus'
}]
},
searchForm: {}
......@@ -101,9 +94,6 @@ export default {
},
detailInfoData: {
type: Object
},
sceneType: {
type: String
}
},
......@@ -111,8 +101,7 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = {
mentorOrStudentStaffUuid: this.detailInfoData?.staffUuid,
sceneType: this.sceneType
mentorOrStudentStaffUuid: this.detailInfoData?.staffUuid
}
resolve()
})
......
......@@ -54,7 +54,7 @@
<!-- 禁/启用工资绩效 -->
<auth-button :data="scope.scope" :show-btn-ids="['9062105']" />
<!-- 业绩详情 -->
<span style="margin-right: 10px;">
<span>
<auth-button :data="scope.scope" :show-btn-ids="['9062106']" />
</span>
</div>
......@@ -127,7 +127,7 @@
</slot>
</d2-dialog>
<!-- 业绩详情 -->
<performance-detail-dialog v-if="perDetailVisible" :detail-info-data="detailInfoData" :sceneType="sceneType" :per-detail-visible="perDetailVisible" @handleConfirm="handleDetail"></performance-detail-dialog>
<performance-detail-dialog v-if="perDetailVisible" :detail-info-data="detailInfoData" :per-detail-visible="perDetailVisible" @handleConfirm="handleDetail"></performance-detail-dialog>
</d2-container>
</template>
......@@ -136,16 +136,12 @@ import { mapActions, mapState } from 'vuex'
import { getYqMerchantListBySceneApi, getListApi, getEnableStaffNumApi, enableOrDisableApi, importStaffApi } from '@api/businessSchool'
import PerformanceDetailDialog from './performanceDetailDialog.vue'
import { Util } from '@/common/util'
import _ from 'lodash'
export default {
name: 'StaffList',
components: {
PerformanceDetailDialog
},
props: {
sceneType: {
type: String
}
},
data() {
return {
beforeRangePickerOptions: {
......@@ -231,9 +227,8 @@ export default {
prop: 'scene',
width: '100',
formatter: (cellValue) => {
// return cellValue?.sceneType.map(v => {
// })
let sceneTypeLabel = { 0: '2.1', 1: '1.1' }
return cellValue?.sceneTypeList?.map(v => sceneTypeLabel[v])?.join('/') || '-'
}
}, {
label: '园区店',
......@@ -250,8 +245,7 @@ export default {
prop: 'title',
width: '160',
formatter: (cellValue) => {
let rankArr = ['初级驻店零售', '中级导师', '高级导师']
return cellValue?.title ? rankArr[cellValue?.title] : '初级驻店零售'
return cellValue?.titleList?.join('/')
}
}, {
label: '学员',
......@@ -306,8 +300,13 @@ export default {
},
mounted() {
// 获取会员权益场景 关联园区店
getYqMerchantListBySceneApi({ scene: this.sceneType }).then(res => {
this.yqMerchantList = res
getYqMerchantListBySceneApi({ scene: 0 }).then(res => {
let arr = res || []
// 获取精品升级场景 关联园区店
getYqMerchantListBySceneApi({ scene: 1 }).then(result => {
let arr2 = result || []
this.yqMerchantList = _.uniqBy(arr.concat(arr2), 'merchantId')
})
})
this.getBaseData()
},
......@@ -415,7 +414,8 @@ export default {
this.searchForm = {
staffName: '',
merchantName: '',
merchantId: ''
merchantId: '',
sceneType: ''
}
this.$refs.staffManageTable.refreshTable(true, true)
},
......@@ -428,8 +428,7 @@ export default {
this.$refs['exportFileRuleForm'].validate(valid => {
if (valid) {
var params = {
dataMonthStr: this.exportFileForm?.exportMonth ? Util.dateFormate(this.exportFileForm?.exportMonth, 'YYYY-MM') : '',
sceneType: this.sceneType
dataMonthStr: this.exportFileForm?.exportMonth ? Util.dateFormate(this.exportFileForm?.exportMonth, 'YYYY-MM') : ''
}
this.exportFileForm?.exportYqMerchantId?.forEach((val, index) => {
let merchantId = `yqMerchantIds[${index}]`
......@@ -457,10 +456,13 @@ export default {
let yqMerchantObj = { merchantName: row?.merchantName, merchantId: row.merchantNo }
let partnerMerchantArr = row?.partnerMerchantNameList.map((item, index) => item + row?.partnerMerchantIdList[index]) || []
let queryObj = {
staffUuid: row.staffUuid,
sceneType: this.sceneType,
yqMerchantObj: JSON.stringify(yqMerchantObj),
partnerMerchantArr: JSON.stringify(partnerMerchantArr)
staffUuid: row.staffUuid, // 员工Id
sceneTypeList: JSON.stringify(row.sceneTypeList), // 员工已关联场景
yqMerchantObj: JSON.stringify(yqMerchantObj), // 园区店信息
partnerMerchantArr: JSON.stringify(partnerMerchantArr), // 服务商信息
phoneNumber: row.staffPhone, // 员工手机号
staffName: row.staffName, // 员工姓名
performanceFlag: row.performanceFlag // 员工工资绩效开关
}
this.$router.push({
path: '/performanceConfig',
......@@ -475,9 +477,11 @@ export default {
let queryObj = {
staffUuid: row.staffUuid,
yqMerchantObj: JSON.stringify(yqMerchantObj),
sceneType: this.sceneType,
sceneTypeList: JSON.stringify(row?.sceneTypeList),
partnerMerchantArr: JSON.stringify(partnerMerchantArr),
businessSchoolEnableFlag: row.businessSchoolEnableFlag
phoneNumber: row.staffPhone, // 员工手机号
staffName: row.staffName, // 员工姓名
performanceFlag: row.performanceFlag
}
this.$router.push({
path: '/mentorConfig',
......@@ -491,7 +495,7 @@ export default {
},
// 禁/启用绩效配置
handleEnableOrDisable(row) {
if (row.businessSchoolEnableFlag == 'Y') {
if (row.performanceFlag == 'Y') {
this.$confirm('禁用该员工后关闭驻店工资绩效,请确认', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -506,7 +510,7 @@ export default {
// 禁用启用接口
enableOrDisableEvent(flag, staffUuid) {
// flag N禁用 Y启用
enableOrDisableApi({ staffUuid, businessSchoolEnableFlag: flag }).then(res => {
enableOrDisableApi({ staffUuid, performanceFlag: flag }).then(res => {
this.notice.okTips()
this.$refs.staffManageTable.refreshTable()
})
......
......@@ -14,7 +14,55 @@
:form-obj="viewInfo"
:form-data="viewFormData">
<div slot="inStoreTarget">
<d2-table @arraySpanMethod="arraySpanMethod" :tableData="viewInfo.tableData" :table-params="tableParams" :hasPage="false"></d2-table>
<d2-table :array-span-method="arraySpanMethod" :tableData="viewInfo.tableData" :table-params="tableParams" :hasPage="false">
<!-- 车主类型 -->
<template slot="selectCarType" slot-scope="scope">
<div v-if="scope.scope.selectCarType == 0">无</div>
<div v-if="scope.scope.selectCarType == 1">车辆价格:{{ scope.scope.minCarPrice }}-{{ scope.scope.maxCarPrice }}万</div>
<div v-if="scope.scope.selectCarType == 2">车辆类型:
<span v-for="(subItem, subIndex) in scope.scope.carList" :key="subIndex">{{ `${subItem.carBrand}-${subItem.carChildsBrandName}-${subItem.carSeriesName}` }}</span>
</div>
</template>
<!-- 主推产品套餐 -->
<template slot="selectPackageType" slot-scope="scope">
<div v-if="scope.scope.selectPackageType == 0">无</div>
<div v-if="scope.scope.selectPackageType == 1 || scope.scope.selectPackageType == 2">
<div v-for="(subItem, subIndex) in scope.scope.packageList" :key="subIndex">{{ subItem.upgradeGoodsName }}</div>
</div>
</template>
<!-- 目标转化率 -->
<template slot="conversionRate" slot-scope="scope">
<div v-if="scope.scope.selectPackageType == 0">无</div>
<div v-if="scope.scope.selectPackageType == 1">{{ scope.scope.conversionRate }}</div>
<div v-if="scope.scope.selectPackageType == 2">
<div v-for="(subItem, subIndex) in scope.scope.packageList" :key="subIndex">{{ subItem.conversionRate }}</div>
</div>
</template>
<!-- 目标转化率提成 -->
<template slot="conversionRatePercentage" slot-scope="scope">
<div v-if="scope.scope.selectPackageType == 0">无</div>
<div v-if="scope.scope.selectPackageType == 1">{{ scope.scope.conversionRatePercentage }}</div>
<div v-if="scope.scope.selectPackageType == 2">
<div v-for="(subItem, subIndex) in scope.scope.packageList" :key="subIndex">{{ subItem.conversionRatePercentage }}</div>
</div>
</template>
<!-- 客单价 -->
<template slot="customerUnitPrice" slot-scope="scope">
<div v-if="scope.scope.selectPackageType == 0">无</div>
<div v-if="scope.scope.selectPackageType == 1">{{ scope.scope.customerUnitPrice }}</div>
<div v-if="scope.scope.selectPackageType == 2">
<div v-for="(subItem, subIndex) in scope.scope.packageList" :key="subIndex">{{ subItem.customerUnitPrice }}</div>
</div>
</template>
<!-- 客单价提成 -->
<template slot="customerUnitPricePercentage" slot-scope="scope">
<div v-if="scope.scope.selectPackageType == 0">无</div>
<div v-if="scope.scope.selectPackageType == 1">{{ scope.scope.customerUnitPricePercentage }}</div>
<div v-if="scope.scope.selectPackageType == 2">
<div v-for="(subItem, subIndex) in scope.scope.packageList" :key="subIndex">{{ subItem.customerUnitPricePercentage }}</div>
</div>
</template>
</d2-table>
</div>
</glsx-combi-form>
<div class="page_footer">
......@@ -35,23 +83,28 @@ export default {
viewFormData: [{
label: '门店名称',
isHide: false,
showTxt: true
name: 'merchantName',
type: 'showTxt'
}, {
label: '业务场景',
isHide: false,
showTxt: true
name: 'sceneTypeTxt',
type: 'showTxt'
}, {
label: '驻店员工',
isHide: false,
showTxt: true
name: 'staffName',
type: 'showTxt'
}, {
label: '联系方式',
isHide: false,
showTxt: true
name: 'phoneNumber',
type: 'showTxt'
}, {
label: '考核周期',
isHide: false,
showTxt: true
name: 'checkMonthPeriod',
type: 'showTxt'
}, {
label: '驻店目标',
isHide: false,
......@@ -60,34 +113,51 @@ export default {
tableParams: {
tableColumns: [{
label: '月度',
prop: 'startValue'
prop: 'checkMonth',
formatter: (cellValue) => {
return {1: '首月', 2: '次月', 3: '第三月'}[cellValue?.checkMonth]
}
}, {
label: '周期',
prop: 'startValue'
prop: 'checkPeriod',
formatter: (cellValue) => {
return {1: '上半月', 2: '下半月'}[cellValue?.checkPeriod]
}
}, {
label: '车主类型',
prop: 'startValue'
prop: 'selectCarType',
addHtml: 'selectCarType'
}, {
label: '主推产品套餐',
prop: 'startValue'
prop: 'studentNumber',
addHtml: 'selectPackageType'
}, {
label: '目标转化率',
prop: 'startValue'
prop: 'conversionRate',
addHtml: 'conversionRate'
}, {
label: '提成系数',
prop: 'startValue'
prop: 'conversionRatePercentage',
addHtml: 'conversionRatePercentage'
}, {
label: '目标客单价',
prop: 'startValue'
prop: 'customerUnitPrice',
addHtml: 'customerUnitPrice'
}, {
label: '提成系数',
prop: 'startValue'
prop: 'customerUnitPricePercentage',
addHtml: 'customerUnitPricePercentage'
}],
tableData: []
},
viewInfo: {
tableData: []
}
},
spanArr1: [],
spanIndex1: 0,
spanArr2: [],
spanIndex2: 0,
spanArr3: [],
spanIndex3: 0
}
},
mounted() {
......@@ -101,13 +171,104 @@ export default {
close: 'd2admin/page/close'
}),
getDetailInfo(routerQuery) {
getStaffTaskDetailApi({}).then(res => {
getStaffTaskDetailApi({ id: routerQuery?.id }).then(res => {
res = {
merchantName: res?.targetCofig?.merchantName,
sceneTypeTxt: ['会员权益/升级', '精品升级'][res?.targetCofig?.sceneType] || '-',
staffName: res.staffName,
phoneNumber: res.phoneNumber,
checkMonthPeriod: `${{ 1: '首月', 2: '次月', 3: '第三月' }[res?.checkMonth]}-${{ 1: '上半月', 2: '下半月' }[res?.checkPeriod]}`,
tableData: res?.taskList || []
}
this.viewInfo = res || {}
this.merge(res?.tableData)
}).catch(() => {})
},
// 合并表格
arraySpanMethod() {
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
const len = this.viewInfo?.tableData?.length
const t = 10
if (columnIndex === 0) {
// 第一列 序号
const _row_1 = this.spanArr1[rowIndex]
const _col_1 = _row_1 > 0 ? 1 : 0
return {
rowspan: _row_1,
colspan: _col_1
}
} else if (columnIndex === 1) {
// 第二列 月度
const _row_2 = this.spanArr2[rowIndex]
const _col_2 = _row_2 > 0 ? 1 : 0
return {
rowspan: _row_2,
colspan: _col_2
}
// 第三列 周期
} else if (columnIndex === 2) {
const _row_3 = this.spanArr3[rowIndex]
const _col_3 = _row_3 > 0 ? 1 : 0
return {
rowspan: _row_3,
colspan: _col_3
}
}
else if (columnIndex === t) {
const _row_6 = len
const _col_6 = 1
return {
rowspan: _row_6,
colspan: _col_6
}
} else if (rowIndex === len) {
return {
rowspan: 1,
colspan: 1
}
}
},
// 初始化合并行数组
mergeInit() {
this.spanArr1 = [] // 合并序号
this.spanIndex1 = 0 // 合并序号索引
this.spanArr2 = [] // 合并月度
this.spanIndex2 = 0 // 合并月度索引
this.spanArr3 = [] // 合并周期
this.spanIndex3 = 0 // 合并周期索引
},
// 合并表格
merge(data) {
this.mergeInit()
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
// 第一行必须存在,以第一行为基准
this.spanArr1.push(1) // 合并序号
this.spanIndex1 = 0
this.spanArr2.push(1) // 合并月度
this.spanIndex2 = 0
this.spanArr3.push(1) // 合并周期
this.spanIndex3 = 0
} else {
// 根据月度和考核周期进行合并
if (data[i].checkMonth == data[i - 1].checkMonth && data[i].checkPeriod == data[i -1].checkPeriod) {
this.spanArr1[this.spanIndex1] += 1
this.spanArr1.push(0)
this.spanArr2[this.spanIndex2] += 1
this.spanArr2.push(0)
this.spanArr3[this.spanIndex3] += 1
this.spanArr3.push(0)
} else {
this.spanArr1.push(1)
this.spanIndex1 = i
this.spanArr2.push(1)
this.spanIndex2 = i
this.spanArr3.push(1)
this.spanIndex3 = i
}
}
}
}
},
// 返回
handleClose() {
......
......@@ -28,27 +28,19 @@
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
:array-span-method="arraySpanMethod"
@setTableFinishFun="setTableFinishFun">
<template slot="sceneType" slot-scope="scope">
<div v-if="scope.scope.sceneType == 1">精品升级</div>
<div v-if="scope.scope.sceneType == 0">会员权益/升级</div>
<div v-else>-</div>
</template>
<template slot="yqMerchantName" slot-scope="scope">
<div v-for="item in scope.scope.yqMerchantList" :key="item.merchantId">{{ item.merchantName }}</div>
<!-- <div v-if="!scope.scope.yqMerchantList.length">-</div> -->
</template>
<template slot="yqMerchantId" slot-scope="scope">
<div v-for="item in scope.scope.yqMerchantList" :key="item.merchantId">{{ item.merchantId }}</div>
<!-- <div v-if="!scope.scope.yqMerchantList.length">-</div> -->
</template>
<template slot="partnerMerchantName" slot-scope="scope">
<div v-for="item in scope.scope.partnerMerchantList" :key="item.merchantId">{{ item.merchantName }}</div>
<!-- <div v-if="!scope.scope.partnerMerchantList.length">-</div> -->
<div v-for="item in scope.scope.serviceList" :key="item.merchantId">{{ item.merchantName }}</div>
<div v-if="!scope.scope.serviceList.length">-</div>
</template>
<template slot="partnerMerchantId" slot-scope="scope">
<div v-for="item in scope.scope.partnerMerchantList" :key="item.merchantId">{{ item.merchantId }}</div>
<!-- <div v-if="!scope.scope.partnerMerchantList.length">-</div> -->
<div v-for="item in scope.scope.serviceList" :key="item.merchantId">{{ item.merchantId }}</div>
<div v-if="!scope.scope.serviceList.length">-</div>
</template>
<div slot="auth-button"
slot-scope="scope">
......@@ -76,15 +68,17 @@ export default {
// 搜索框
showFormData: [{
label: '商户名称',
name: 'merchantName',
name: 'allMerchantName',
type: 'input',
placeholder: '请输入园区店/导流方/服务商名称',
isClear: true,
keyFn: this.keyDownGetList
}, {
label: '商户号',
name: 'merchantId',
name: 'allMerchantId',
type: 'input',
inputType: 'number',
placeholder: '请输入园区店/导流方/服务商商户号',
isClear: true,
keyFn: this.keyDownGetList
}, {
......@@ -97,12 +91,12 @@ export default {
optionsName: 'sceneTypeList'
}, {
label: '配置状态',
name: 'status',
name: 'configStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'statusList'
optionsName: 'configStatusList'
}],
getListApi: getStoreTargetListApi,
// 表格参数
......@@ -133,18 +127,16 @@ export default {
addHtml: 'sceneType'
}, {
label: '关联园区店',
prop: 'yqMerchantName',
addHtml: 'yqMerchantName'
prop: 'yqMerchantName'
}, {
label: '关联园区店号',
prop: 'yqMerchantId',
addHtml: 'yqMerchantId'
prop: 'yqMerchantId'
}, {
label: '关联服务商',
prop: 'partnerMerchantName',
addHtml: 'partnerMerchantName'
}, {
label: '关联服务商号',
label: '关联服务商商户号',
prop: 'partnerMerchantId',
addHtml: 'partnerMerchantId'
}, {
......@@ -152,17 +144,16 @@ export default {
prop: 'status',
width: '80',
className: (cellValue) => {
cellValue.performanceFlag = cellValue?.performanceFlag ? cellValue?.performanceFlag : 'N'
return {
'Y': 'greenSpot',
'N': 'yellowSpot'
}[cellValue.performanceFlag]
}[cellValue.configStatus]
},
formatter: (cellValue) => {
return {
'Y': '已配置',
'N': '待配置'
}[cellValue.performanceFlag]
}[cellValue.configStatus]
}
}, {
label: '创建时间',
......@@ -180,16 +171,16 @@ export default {
}
}, {
label: '操作人',
prop: 'updateUser',
prop: 'updatedBy',
width: '80',
}]
},
// 查询条件
searchForm: {
merchantName: '',
merchantId: '',
allMerchantName: '',
allMerchantId: '',
sceneType: '',
status: ''
configStatus: ''
},
baseData: {
sceneTypeList: [{
......@@ -199,14 +190,20 @@ export default {
confId: 0,
confValue: '会员权益/升级'
}],
statusList: [{
confId: 1,
configStatusList: [{
confId: 'N',
confValue: '待配置'
}, {
confId: 2,
confId: 'Y',
confValue: '已配置'
}]
}
},
spanArr1: [],
spanIndex1: 0,
spanArr2: [],
spanIndex2: 0,
spanArr3: [],
spanIndex3: 0
}
},
mounted() {
......@@ -235,6 +232,92 @@ export default {
},
// 表格数据处理
setTableFinishFun(data) {
this.merge(data)
},
// 合并表格
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
const len = this.viewInfo?.tableData?.length
const t = 14
if (columnIndex === 0) {
// 第一列 序号
const _row_1 = this.spanArr1[rowIndex]
const _col_1 = _row_1 > 0 ? 1 : 0
return {
rowspan: _row_1,
colspan: _col_1
}
} else if (columnIndex === 1) {
// 第二列 流量方
const _row_2 = this.spanArr2[rowIndex]
const _col_2 = _row_2 > 0 ? 1 : 0
return {
rowspan: _row_2,
colspan: _col_2
}
// 第三列 流量方商户号
} else if (columnIndex === 2) {
const _row_3 = this.spanArr3[rowIndex]
const _col_3 = _row_3 > 0 ? 1 : 0
return {
rowspan: _row_3,
colspan: _col_3
}
}
else if (columnIndex === t) {
const _row_6 = len
const _col_6 = 1
return {
rowspan: _row_6,
colspan: _col_6
}
} else if (rowIndex === len) {
return {
rowspan: 1,
colspan: 1
}
}
},
// 初始化合并行数组
mergeInit() {
this.spanArr1 = [] // 合并序号
this.spanIndex1 = 0 // 合并序号索引
this.spanArr2 = [] // 合并流量方
this.spanIndex2 = 0 // 合并流量方索引
this.spanArr3 = [] // 合并流量方商户号
this.spanIndex3 = 0 // 合并流量方商户号索引
},
// 合并表格
merge(data) {
this.mergeInit()
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (i === 0) {
// 第一行必须存在,以第一行为基准
this.spanArr1.push(1) // 合并序号
this.spanIndex1 = 0
this.spanArr2.push(1) // 合并流量方
this.spanIndex2 = 0
this.spanArr3.push(1) // 合并流量方商户号
this.spanIndex3 = 0
} else {
if (data[i].merchantId == data[i - 1].merchantId) {
this.spanArr1[this.spanIndex1] += 1
this.spanArr1.push(0)
this.spanArr2[this.spanIndex2] += 1
this.spanArr2.push(0)
this.spanArr3[this.spanIndex3] += 1
this.spanArr3.push(0)
} else {
this.spanArr1.push(1)
this.spanIndex1 = i
this.spanArr2.push(1)
this.spanIndex2 = i
this.spanArr3.push(1)
this.spanIndex3 = i
}
}
}
}
},
// 查看详情
handleStoreView(row) {
......@@ -265,10 +348,10 @@ export default {
// 重置
handleReset() {
this.searchForm = {
merchantName: '',
merchantId: '',
allMerchantName: '',
allMerchantId: '',
sceneType: '',
status: ''
configStatus: ''
}
this.$refs.storeTargetTable.refreshTable(true, true)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!