Commit df518391 by 前端

Merge branch 'v4.27.0' of http://192.168.3.233:8090/saas/scrm-micro-shop into v4.27.0

2 parents 70cb478e 88ef0263
import { http } from '@/main'
// 分页查询客户信息
const getList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.page'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取服务中心下拉筛选 所有服务商数据
const getServiceCenterList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.businessAssistant.serviceCenter.listByServiceMerchantId'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 根据园区店商户号获取4s列表(包含超管权限)
const getSimpleMerchantListByPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShopPageIncludeAdmin`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询员工详情
const getMerchantInfo = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.performanceConfig.detail'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 新增客户
const createMerchantStaff = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.save'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 编辑客户
const updateMerchantStaff = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = 'dj.api.smartcarlife.merchant.staff.update'
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getList, getServiceCenterList, getSimpleMerchantListByPage, getMerchantInfo, createMerchantStaff, updateMerchantStaff }
<template>
<GLDialog :title="title" mode="mid" :visible.sync="isVisible" okText="确定" :before-close="handleClose"
@onOk="handleConfirm" @onCancel="handleClose">
<div class="explain-title">示例规则定义</div>
<p class="business-info" v-if="diffExplain == 'constructionBonus'">升级订单施工奖励:70.00元;战败订单施工奖励:50.00元</p>
<GLTable v-else :tableData="tableData" :tableParams="tableParams" :hasPage="false"></GLTable>
<div class="explain-title mt20">示例业务场景</div>
<div class="business-info" v-html="infoHtml"></div>
</GLDialog>
</template>
<script>
export default {
data() {
return {
tableParams: {
tableColumns: [
{
label: '区间开始值',
prop: 'startValue'
},
{
label: '区间结束值',
prop: 'endValue'
},
{
label: '奖励金额/元',
prop: 'calculateValue'
}
]
},
tableData: []
}
},
props: {
isExplain: {
type: Boolean,
default: false
},
diffExplain: {
type: String,
default: ''
}
},
computed: {
title() {
const titleObj = {
commissionBonus: '提成奖励示例说明',
highCustomerUnitBonus: '高客单奖励示例说明',
successRateBonus: '成交率奖励示例说明',
constructionBonus: '施工奖励示例说明'
}
return titleObj[this.diffExplain]
},
infoHtml() {
const infoObj = {
commissionBonus: `<div class='mb10'>员工A在某个月中完成升级订单5个,对应的订单产值1000.00元、1500.00元、2000.00元、2500.00元、3000.00元,</div>
<div class='mb10'>则月度的平均客单价=升级订单总产值/升级订单数量=2000.00元,对应规则的提成比例=10.00%,按每个升级订单的产值*10%计算每单提成;</div>
<div class='mb10'>则员工A在该月份获得的总提成奖励=100.00+150.00+200.00+250.00+300.00=1000.00元。</div>`,
highCustomerUnitBonus: `<div class='mb10'>员工A在某个月中完成升级订单5个,对应的订单产值1000.00元、1500.00元、2000.00元、2500.00元、3000.00元,</div>
<div class='mb10'>按高客单奖励规则,产值在0.00-2000.00元的订单每单奖励0.00元(不奖励),产值在2000.00元以上的订单每单奖励100.00元;</div>
<div class='mb10'>则员工A在该月份获得的高客单奖励=0.00+0.00+0.00+100.00+100.00=200元。</div>`,
successRateBonus: `<div class='mb10'>员工A在某个月中完成升级订单9个,战败订单1个</div>
<div class='mb10'>则月度的成交率=升级订单数/(升级订单数+战败订单数)=90.00%,对应规则的奖励金额=1000.00元;</div>
<div class='mb10'>则员工A在该月份获得的成交率奖励=1000.00元。</div>`,
constructionBonus: `<div class='mb10'>员工A在某个月中施工了升级订单5个,施工了战败订单5个;</div>
<div class='mb10'>则员工A在该月份获得的总提成奖励=(70.00*5)+(50.00*5)=600.00元。</div>`
}
return infoObj[this.diffExplain]
},
isVisible() {
return this.isExplain
}
},
watch: {
diffExplain(newVal) {
if (newVal == 'successRateBonus') {
this.tableData = [
{ startValue: '', endValue: '80%', calculateValue: 0.00 },
{ startValue: '80.01%', endValue: '90%', calculateValue: 1000.00 },
{ startValue: '90.01%', endValue: '', calculateValue: 2000.00 }
]
} else {
this.tableData = [
{ startValue: 0.0, endValue: 2000.0, calculateValue: '10%' },
{ startValue: 2000.01, endValue: '', calculateValue: '20%' }
]
}
if (newVal == 'commissionBonus') {
this.tableParams.tableColumns[2].label = '提成比例'
} else {
this.tableParams.tableColumns[2].label = '奖励金额/元'
}
}
},
methods: {
handleConfirm() {
this.$emit('handleClose')
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss">
.explain-title {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-bottom: 10px;
}
.business-info {
font-size: 14px;
color: #333333;
line-height: 18px;
}
.mb10 {
margin-bottom: 10px;
}
.mt20 {
margin-top: 20px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="shop">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>员工管理列表</h2>
<div>
<el-button size="small" @click="handleEditStaff('add')" type="primary" plain>新增员工</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="pointRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="tb-ellipsis" slot="staffNameKeyword" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.staffNameKeyword">
<span slot="reference">
{{ scope.scope.staffNameKeyword }}
</span>
</el-popover>
</div>
<div class="tb-ellipsis" slot="merchantName" slot-scope="scope">
<el-popover placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.merchantName">
<span slot="reference">
{{ scope.scope.merchantName }}
</span>
</el-popover>
</div>
<div slot="visibleMerchantList" slot-scope="scope">
<el-tooltip v-if="scope.scope.visibleMerchantList && scope.scope.visibleMerchantList.length > 0" placement="top" effect="light">
<div slot="content">
<div class="text-3 font-12 weight-6" style="line-height: 24px">使用门店</div>
<div class="merchant-wrap">
<div class="text-6 font-12" style="line-height: 24px" v-for="item in scope.scope.visibleMerchantList" :key="item">{{ item.merchantName }}</div>
</div>
</div>
<div class="use-store">
<img src="@/assets/store.png" />
x {{ scope.scope.visibleMerchantList.length }}
</div>
</el-tooltip>
<span v-else>--</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- <ApplyStoreDialog v-if="isApplyVisible" :isVisible="isApplyVisible" @handleClose="handleApply"></ApplyStoreDialog> -->
<!-- <InviteDialog v-if="isInviteVisible" :isVisible="isInviteVisible" :inviteInfo="inviteInfo" @handleClose="handleInviteClose"></InviteDialog> -->
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
// import ApplyStoreDialog from './components/ApplyStoreDialog.vue'
// import InviteDialog from './components/InviteDialog.vue'
export default {
data() {
return {
size: 'small',
url: url,
userInfo: {},
merchantNoList: [],
searchForm: {
staffPhoneKeyword: '',
staffNameKeyword: '',
staffType: '',
yqMerchantId: ''
},
tableSearchForm: {},
showFormData: [
{
label: '员工姓名',
name: 'staffNameKeyword',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '员工手机号',
name: 'staffPhoneKeyword',
type: 'input',
isClear: true,
maxlength: 50
},
{
label: '员工类型',
name: 'staffType',
type: 'select',
optionList: [],
optionId: 'value',
optionLabel: 'text',
optionsName: 'staffTypeList'
},
{
label: '所属服务中心',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'yqMerchantId',
optionLabel: 'yqMerchantName',
optionsName: 'merchantList'
}
],
tableButtonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.handleEditStaff('edit', row)
}
}
],
// 表格
getListApi: this.$apis.staff.getList,
tableParams: {
listName: 'list',
tableOption: {
width: '80px'
},
tableColumns: [
{
label: '员工姓名',
prop: 'staffName',
minWidth: 100
},
{
label: '员工类型',
prop: 'staffBusinessType',
formatter: cellValue => {
const data = this.baseData.staffTypeList.filter(item => item.value == cellValue.staffBusinessType)
return data.length > 0 ? data[0].text : '--'
},
minWidth: 120
},
{
label: '员工手机号',
prop: 'staffPhone',
minWidth: 120
},
{
label: '所属服务中心',
prop: 'merchantName',
addHtml: 'merchantName',
minWidth: 120
},
{
label: '负责门店',
prop: '',
addHtml: 'visibleMerchantList',
minWidth: 100
},
{
label: '创建时间',
prop: 'createdDate',
minWidth: 150,
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY/MM/DD HH:mm:ss') : '--'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
isApplyVisible: false,
isInviteVisible: false,
inviteInfo: {},
// 基本数据
baseData: {
merchantList: [],
staffTypeList: [
{ text: '驻店', value: 0 },
{ text: '技师', value: 1 }
]
}
}
},
mounted() {},
methods: {
getServiceCenterList() {
const params = {
partnerMerchantId: this.$globalState.session.merchantId
}
return new Promise(resolve => {
this.$apis.customer.getServiceCenterList(params).then(res => {
this.baseData.merchantList = res
resolve(res)
this.$utils.getOptionsList(this, 'showFormData')
})
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
async beforeSearchFn() {
this.merchantNoList = []
let data = await this.getServiceCenterList()
data.forEach(item => {
this.merchantNoList.push(item.yqMerchantId)
})
return new Promise(resolve => {
this.tableSearchForm = JSON.parse(JSON.stringify(this.getParams()))
this.tableSearchForm.merchantNoList = this.tableSearchForm.yqMerchantId ? [this.tableSearchForm.yqMerchantId] : this.merchantNoList
delete this.tableSearchForm.yqMerchantId
resolve()
})
},
handleSearch() {
this.$refs.pointRef.refreshTable()
},
handleReset() {
this.searchForm = {}
this.handleSearch()
},
handleApply() {
this.isApplyVisible = !this.isApplyVisible
},
handleInviteClose() {
this.isInviteVisible = !this.isInviteVisible
},
handleInvite(row) {
this.inviteInfo = row
this.handleInviteClose()
},
handleEditStaff(editType, row) {
var params = {
editType: editType,
$title: encodeURI(editType == 'add' ? '新增员工' : '编辑员工')
}
editType != 'add' && (params.merchantInfo = row)
this.$router.push({
path: '/staffManage/edit',
query: params
})
},
handleDetail(row) {
this.$router.push({
path: '/customerManage/customerDetail',
query: {
$title: encodeURI('查看销售顾问'),
detailInfo: row
}
})
}
}
}
</script>
<style scoped lang="scss">
.import-btn {
position: relative;
width: 116px;
height: 32px;
text-align: center;
background: #5850ff;
border-radius: 4px;
color: #ffffff;
font-size: 14px;
margin-right: 8px;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.use-store {
display: flex;
font-size: 14px;
color: #5850ff;
align-items: center;
img {
width: 14px;
height: 12.98px;
margin-right: 8px;
}
}
.table-btns {
width: 80px;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 关联门店弹窗 -->
<template>
<GLDialog bigTitle="选择门店" mode="big" :visible.sync="relateStoreVisible" okText="关联" :before-close="handleRelateStoreClose" @onOk="handleRelateStoreConfirm" @onCancel="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="16">
<div class="title">门店列表</div>
<el-table ref="seletingTable" class="table hightline" :data="selectingData" height="460px" @select="handleChange" @select-all="handleAll">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" width="300" label="门店名称" align="center"></el-table-column>
<el-table-column prop="merchantId" label="商户号" width="300" align="center"></el-table-column>
</el-table>
<el-pagination v-if="hasPage" small background @current-change="handleCurrentChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-col>
<el-col :span="8">
<div class="title mar_l10">已选门店</div>
<div class="selected_box">
<div class="box_top">
<span>已选</span>
<el-button type="text" @click="handelClearStore">清空</el-button>
</div>
<div class="box_content">
<div class="select_item" v-for="(subItem, subIndex) in selectedData" :key="subIndex">
<div class="text_value">{{ subItem.merchantName }}({{subItem.merchantId}})</div>
<div class="select_clear" @click="handleDelete(subItem)"><i class="el-icon-error"></i></div>
</div>
</div>
</div>
</el-col>
</el-row>
</GLDialog>
</template>
<script>
export default {
name: 'relateStoreDialog',
data() {
return {
selectedData: [],
selectingData: [],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
hasPage: {
type: Boolean,
default: true
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => { }
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
mounted() {
this.selectedData = this.storeSelected
this.selectedData.forEach(item => {
item.merchantId = item.merchantId ? item.merchantId + '' : item.merchantId
})
this.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId + '')
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantId + '')) {
this.$refs.seletingTable.toggleRowSelection(item, true)
} else {
this.$refs.seletingTable.toggleRowSelection(item, false)
}
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
currentPage: this.pageNum,
pageSize: this.hasPage ? this.pageSize : 99999,
scene: 1,
partnerMerchantId: this.$globalState?.session?.merchantId
}).then(res => {
this.selectingData = res.list || []
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => +item.merchantId === +row.merchantId)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId))
},
handleAll(selection) {
this.selectingData?.forEach(item => {
let isExit = this.selectedData.findIndex(subItem => +subItem.merchantId === +item.merchantId)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => +item.merchantId !== +row.merchantId)
this.recoverySelection()
},
handelClearStore() {
this.selectedData = []
this.recoverySelection()
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true,
customClass: 'message-Z-zinde'
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style lang="scss" scoped>
.relateStore{
.title{
font-size: 16px;
margin-bottom: 10px;
}
.mar_l10{
margin-left: 10px;
}
.selected_box{
margin-left: 10px;
border: 1px solid #E5E5E5;
height: 460px;
.box_top{
font-size: 16px;
padding: 11px 26px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #E5E5E5;
}
.box_content{
padding: 12px 8px;
overflow-y: scroll;
height: calc(100% - 40px);
box-sizing: border-box;
.select_item{
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 8px;
cursor: pointer;
.text_value{
width: calc(100% - 50px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.select_clear{
width: 12px;
height: 12px;
i{
color: #A6A6A6;
}
}
}
.select_item:hover{
background: #F2F1FF;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!