Commit fb5f1f73 by 前端

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

2 parents b2acedda 8d2e1017
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
<div class="constructionBonus-wrap"> <div class="constructionBonus-wrap">
<el-form ref="editFormRef2" size="small" :rules="editRule" :model="employeePerformanceConfig" label-width="160px" :inline="true"> <el-form ref="editFormRef2" size="small" :rules="editRule" :model="employeePerformanceConfig" label-width="160px" :inline="true">
<el-form-item label="升级订单施工奖励/元:" prop="upgradeConstructionBonus"> <el-form-item label="升级订单施工奖励/元:" prop="upgradeConstructionBonus">
<el-input v-model="employeePerformanceConfig.upgradeConstructionBonus" placeholder="请输入"></el-input> <el-input v-model="employeePerformanceConfig.upgradeConstructionBonus" @blur="handleCalcuPrice('employeePerformanceConfig', 'upgradeConstructionBonus')" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="战败订单施工奖励/元:" prop="notUpgradeConstructionBonus"> <el-form-item label="战败订单施工奖励/元:" prop="notUpgradeConstructionBonus">
<el-input v-model="employeePerformanceConfig.notUpgradeConstructionBonus" placeholder="请输入"></el-input> <el-input v-model="employeePerformanceConfig.notUpgradeConstructionBonus" placeholder="请输入" @blur="handleCalcuPrice('employeePerformanceConfig', 'notUpgradeConstructionBonus')" ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -88,14 +88,14 @@ ...@@ -88,14 +88,14 @@
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button> <el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter> </GLFooter>
<!-- 门店弹窗 --> <!-- 门店弹窗 -->
<relate-store-dialog v-if="relateStoreVisible" ref="editFormMerchantRef" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"> <relate-store-dialog v-if="relateStoreVisible" ref="editFormMerchantRef" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="relateStoreVisible=false">
<el-row slot> <el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px"> <el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
<el-form-item label="门店名称:" prop="merchantName"> <el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForm.merchantIdKeyword" placeholder="请输入门店名称" clearable></el-input> <el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商户号:" prop="merchantName"> <el-form-item label="商户号:" prop="merchantIdKeyword">
<el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入商户号" clearable></el-input> <el-input :size="size" v-model.trim="storeSearchForm.merchantIdKeyword" placeholder="请输入商户号" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button> <el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
...@@ -410,13 +410,13 @@ export default { ...@@ -410,13 +410,13 @@ export default {
}, },
'editForm.staffPhone': { 'editForm.staffPhone': {
handler(val) { handler(val) {
this.editForm.staffPhone = val.replace(/\D+/g,'') this.editForm.staffPhone = val.replace(/\D+/g, '')
} }
}, },
'editForm.merchantNo': { 'editForm.merchantNo': {
handler(val) { handler(val) {
this.storeSearchForm.yqMerchantId = val this.storeSearchForm.yqMerchantId = val
this.editForm.merchantName = this.baseData.merchantList.length>0&&this.baseData.merchantList.filter(item => item.yqMerchantId == val)[0].yqMerchantName this.editForm.merchantName = this.baseData.merchantList.length > 0 && this.baseData.merchantList.filter(item => item.yqMerchantId == val)[0].yqMerchantName
} }
}, },
'editForm.visualType': { 'editForm.visualType': {
...@@ -427,7 +427,7 @@ export default { ...@@ -427,7 +427,7 @@ export default {
}, },
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = JSON.parse(this.$route.query.obj)
this.routeInfo.editType != 'add' ? this.getInfo() : '' this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
if (this.routeInfo.editType == 'edit') { if (this.routeInfo.editType == 'edit') {
...@@ -570,6 +570,7 @@ export default { ...@@ -570,6 +570,7 @@ export default {
}, },
handleCalcuPrice(formName, data) { handleCalcuPrice(formName, data) {
this[formName][data] = this[formName][data] ? new BigNumber(this[formName][data]).dp(2).toNumber() : '' this[formName][data] = this[formName][data] ? new BigNumber(this[formName][data]).dp(2).toNumber() : ''
if(!this[formName][data]) this[formName][data]=''
}, },
handleCalculate(item, key, index) { handleCalculate(item, key, index) {
let formData = this.employeePerformanceConfig[item + 'List'] let formData = this.employeePerformanceConfig[item + 'List']
...@@ -580,7 +581,9 @@ export default { ...@@ -580,7 +581,9 @@ export default {
formData[index][key] = formData[index][key] > max ? max : formData[index][key] formData[index][key] = formData[index][key] > max ? max : formData[index][key]
formData[index][key] = formData[index][key] ? new BigNumber(formData[index][key]).dp(2).toNumber() : '' formData[index][key] = formData[index][key] ? new BigNumber(formData[index][key]).dp(2).toNumber() : ''
//下一行区间开启值自动在上一行的区间结束值的基础上+0.01 //下一行区间开启值自动在上一行的区间结束值的基础上+0.01
if (formData[index + 1] && key == 'endValue' && formData[index][key]) formData[index + 1].startValue = new BigNumber(formData[index][key]).plus(0.01).toNumber() if (formData[index + 1] && key == 'endValue' && formData[index][key]) formData[index + 1].startValue = new BigNumber(formData[index][key]).plus(0.01).toNumber()
if(! formData[index][key]) formData[index][key]=''
}, },
handleDelete(item, index) { handleDelete(item, index) {
let bonusType = item == 'commissionBonus' ? 0 : item == 'highCustomerUnitBonus' ? 1 : 2 let bonusType = item == 'commissionBonus' ? 0 : item == 'highCustomerUnitBonus' ? 1 : 2
...@@ -603,7 +606,7 @@ export default { ...@@ -603,7 +606,7 @@ export default {
this.$apis.customer.getServiceCenterList(params).then(res => { this.$apis.customer.getServiceCenterList(params).then(res => {
this.baseData.merchantList = res this.baseData.merchantList = res
// 若当前服务商下仅有1个服务中心时默认自动选中该服务中心 // 若当前服务商下仅有1个服务中心时默认自动选中该服务中心
if(res.length == 1&&this.routeInfo.editType == 'add') this.editForm.merchantNo = res[0].yqMerchantId if (res.length == 1 && this.routeInfo.editType == 'add') this.editForm.merchantNo = res[0].yqMerchantId
this.$utils.getOptionsList(this, 'editFormData', false) this.$utils.getOptionsList(this, 'editFormData', false)
}) })
}, },
...@@ -668,11 +671,10 @@ export default { ...@@ -668,11 +671,10 @@ export default {
let params = {} let params = {}
let form1 = this.$refs.editFormRef.$refs[this.editChildRef].validate() let form1 = this.$refs.editFormRef.$refs[this.editChildRef].validate()
let form2 = this.$refs.editFormRef1.$refs[this.editChildRef].validate() let form2 = this.$refs.editFormRef1.$refs[this.editChildRef].validate()
console.log( this.$refs.editFormRef2) let form3 = this.$refs.editFormRef2 && this.$refs.editFormRef2[0].validate()
let form3 = this.$refs.editFormRef2&&this.$refs.editFormRef2[0].validate() Promise.all([form1, form2, form3])
Promise.all([form1, form2,form3])
.then(res => { .then(res => {
if (res.length>=2) { if (res.length >= 2) {
params = { params = {
...this.editForm ...this.editForm
} }
...@@ -715,7 +717,7 @@ export default { ...@@ -715,7 +717,7 @@ export default {
} }
}) })
.catch(error => { .catch(error => {
// this.$message.error('请检查员工信息是否填写正确') // this.$message.error('请检查员工信息是否填写正确')
}) })
}, },
cancelJump() { cancelJump() {
...@@ -758,10 +760,9 @@ export default { ...@@ -758,10 +760,9 @@ export default {
this.$refs.editFormMerchantRef.handleCurrentChange(1) this.$refs.editFormMerchantRef.handleCurrentChange(1)
}, },
handleSearchReset() { handleSearchReset() {
this.storeSearchForm = { this.storeSearchForm.merchantName= '',
merchantName: '', this.storeSearchForm.merchantIdKeyword= '',
merchantId: ''
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.editFormMerchantRef.handleCurrentChange(1) this.$refs.editFormMerchantRef.handleCurrentChange(1)
}) })
...@@ -792,6 +793,14 @@ export default { ...@@ -792,6 +793,14 @@ export default {
margin-left: 154px; margin-left: 154px;
margin-top: -22px; margin-top: -22px;
} }
/deep/ td.el-table__cell {
height: 64px;
}
/deep/ .el-form-item__error {
padding-top: 2px;
z-index: 9999999;
position: static;
}
} }
.mt16 { .mt16 {
......
<template> <template>
<GLDialog :title="title" mode="mid" :visible.sync="isVisible" okText="确定" :before-close="handleClose" <GLDialog :title="title" mode="mid" :visible.sync="isVisible" okText="确定" :before-close="handleClose" @onOk="handleConfirm" @onCancel="handleClose">
@onOk="handleConfirm" @onCancel="handleClose"> <div class="explain-title">示例规则定义</div>
<div class="explain-title">示例规则定义</div> <p class="business-info" v-if="diffExplain == 'constructionBonus'">升级订单施工奖励:70.00元;战败订单施工奖励:50.00元</p>
<p class="business-info" v-if="diffExplain == 'constructionBonus'">升级订单施工奖励:70.00元;战败订单施工奖励:50.00元</p> <GLTable v-else :tableData="tableData" :tableParams="tableParams" :hasPage="false"></GLTable>
<GLTable v-else :tableData="tableData" :tableParams="tableParams" :hasPage="false"></GLTable> <div class="explain-title mt20">示例业务场景</div>
<div class="explain-title mt20">示例业务场景</div> <div class="business-info" v-html="infoHtml"></div>
<div class="business-info" v-html="infoHtml"></div> </GLDialog>
</GLDialog>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
tableParams: { tableParams: {
tableColumns: [ tableColumns: [
{ {
label: '区间开始值', label: '区间开始值',
prop: 'startValue' prop: 'startValue'
}, },
{ {
label: '区间结束值', label: '区间结束值',
prop: 'endValue' prop: 'endValue'
}, },
{ {
label: '奖励金额/元', label: '奖励金额/元',
prop: 'calculateValue' prop: 'calculateValue'
} }
] ]
}, },
tableData: [] tableData: []
} }
},
props: {
isExplain: {
type: Boolean,
default: false
}, },
props: { diffExplain: {
isExplain: { type: String,
type: Boolean, default: ''
default: false }
}, },
diffExplain: { computed: {
type: String, title() {
default: '' const titleObj = {
} commissionBonus: '提成奖励示例说明',
highCustomerUnitBonus: '高客单奖励示例说明',
successRateBonus: '成交率奖励示例说明',
constructionBonus: '施工奖励示例说明'
}
return titleObj[this.diffExplain]
}, },
computed: { infoHtml() {
title() { const infoObj = {
const titleObj = { commissionBonus: `<div class='mb10'>员工A在某个月中完成升级订单5个,对应的订单产值1000.00元、1500.00元、2000.00元、2500.00元、3000.00元,</div>
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'>则月度的平均客单价=升级订单总产值/升级订单数量=2000.00元,对应规则的提成比例=10.00%,按每个升级订单的产值*10%计算每单提成;</div>
<div class='mb10'>则员工A在该月份获得的总提成奖励=100.00+150.00+200.00+250.00+300.00=1000.00元。</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> 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'>按高客单奖励规则,产值在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>`, <div class='mb10'>则员工A在该月份获得的高客单奖励=0.00+0.00+0.00+100.00+100.00=200元。</div>`,
successRateBonus: `<div class='mb10'>员工A在某个月中完成升级订单9个,战败订单1个</div> successRateBonus: `<div class='mb10'>员工A在某个月中完成升级订单9个,战败订单1个</div>
<div class='mb10'>则月度的成交率=升级订单数/(升级订单数+战败订单数)=90.00%,对应规则的奖励金额=1000.00元;</div> <div class='mb10'>则月度的成交率=升级订单数/(升级订单数+战败订单数)=90.00%,对应规则的奖励金额=1000.00元;</div>
<div class='mb10'>则员工A在该月份获得的成交率奖励=1000.00元。</div>`, <div class='mb10'>则员工A在该月份获得的成交率奖励=1000.00元。</div>`,
constructionBonus: `<div class='mb10'>员工A在某个月中施工了升级订单5个,施工了战败订单5个;</div> constructionBonus: `<div class='mb10'>员工A在某个月中施工了升级订单5个,施工了战败订单5个;</div>
<div class='mb10'>则员工A在该月份获得的总提成奖励=(70.00*5)+(50.00*5)=600.00元。</div>` <div class='mb10'>则员工A在该月份获得的总提成奖励=(70.00*5)+(50.00*5)=600.00元。</div>`
} }
return infoObj[this.diffExplain] return infoObj[this.diffExplain]
},
isVisible() {
return this.isExplain
}
}, },
watch: { isVisible() {
diffExplain(newVal) { return this.isExplain
if (newVal == 'successRateBonus') { }
this.tableData = [ },
{ startValue: '', endValue: '80%', calculateValue: 0.00 }, watch: {
{ startValue: '80.01%', endValue: '90%', calculateValue: 1000.00 }, diffExplain(newVal) {
{ startValue: '90.01%', endValue: '', calculateValue: 2000.00 } console.log(newVal)
] if (newVal == 'successRateBonus') {
} else { this.tableData = [
this.tableData = [ { startValue: '', endValue: '80%', calculateValue: 0.0 },
{ startValue: 0.0, endValue: 2000.0, calculateValue: '10%' }, { startValue: '80.01%', endValue: '90%', calculateValue: 1000.0 },
{ startValue: 2000.01, endValue: '', calculateValue: '20%' } { startValue: '90.01%', endValue: '', calculateValue: 2000.0 }
] ]
} } else if (newVal == 'commissionBonus') {
if (newVal == 'commissionBonus') { this.tableData = [
this.tableParams.tableColumns[2].label = '提成比例' { startValue: 0.0, endValue: 2000.0, calculateValue: '10%' },
} else { { startValue: 2000.01, endValue: '', calculateValue: '20%' }
this.tableParams.tableColumns[2].label = '奖励金额/元' ]
} } else {
} this.tableData = [
{ startValue: 0.0, endValue: 2000.0, calculateValue: 0.0 },
{ startValue: 2000.01, endValue: '', calculateValue: 2000.01 }
]
}
if (newVal == 'commissionBonus') {
this.tableParams.tableColumns[2].label = '提成比例'
} else {
this.tableParams.tableColumns[2].label = '奖励金额/元'
}
}
},
methods: {
handleConfirm() {
this.$emit('handleClose')
}, },
methods: { handleClose() {
handleConfirm() { this.$emit('handleClose')
this.$emit('handleClose')
},
handleClose() {
this.$emit('handleClose')
}
} }
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.explain-title { .explain-title {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
margin-bottom: 10px; margin-bottom: 10px;
} }
.business-info { .business-info {
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
line-height: 18px; line-height: 18px;
} }
.mb10 { .mb10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
.mt20 { .mt20 {
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -231,20 +231,13 @@ export default { ...@@ -231,20 +231,13 @@ export default {
handleEditStaff(editType, row) { handleEditStaff(editType, row) {
var params = { var params = {
editType: editType, editType: editType,
$title: encodeURI(editType == 'add' ? '新增员工' : '编辑员工')
} }
editType != 'add' && (params.merchantInfo = row) editType != 'add' && (params.merchantInfo = row)
this.$router.push({ this.$router.push({
path: '/staffManage/edit', path: '/staffManage/edit',
query: params
})
},
handleDetail(row) {
this.$router.push({
path: '/customerManage/customerDetail',
query: { query: {
$title: encodeURI('查看销售顾问'), $title: encodeURI(editType == 'add' ? '新增员工' : '编辑员工'),
detailInfo: row obj: JSON.stringify(params)
} }
}) })
} }
......
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
}, },
mounted() { mounted() {
this.selectedData = this.storeSelected this.selectedData = this.storeSelected?this.storeSelected:[]
this.selectedData.forEach(item => { this.selectedData&&this.selectedData.forEach(item => {
item.merchantId = item.merchantId ? item.merchantId + '' : item.merchantId item.merchantId = item.merchantId ? item.merchantId + '' : item.merchantId
}) })
this.getSelectingList() this.getSelectingList()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!