Commit e372ee0b by 前端

联调

1 parent 731c8ac7
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
placeholder="所属业务场景" placeholder="所属业务场景"
> >
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="1.0 新车权益升级" value="0"></el-option> <el-option label="1.0车损升级" value="0"></el-option>
<el-option label="1.1 新车精品升级" value="1"></el-option> <el-option label="1.1精品升级" value="1"></el-option>
<el-option label="1.2 新车膨胀金活动" value="2"></el-option> <el-option label="1.2膨胀金活动" value="2"></el-option>
<el-option label="1.3 售后直播众筹活动" value="3"></el-option> <el-option label="1.3众筹活动" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属商户:"> <el-form-item label="所属商户:">
...@@ -135,8 +135,8 @@ export default { ...@@ -135,8 +135,8 @@ export default {
profitSearchForm: { profitSearchForm: {
businessScene: '', businessScene: '',
channel: '', channel: '',
isWithdrawal:'', isWithdrawal: '',
exchangeStatus:'' exchangeStatus: '',
}, },
} }
}, },
...@@ -152,7 +152,7 @@ export default { ...@@ -152,7 +152,7 @@ export default {
this.defalutStartTime, this.defalutStartTime,
this.defalutEndTime, this.defalutEndTime,
]) ])
this.$emit('sendResetTable','reset') this.$emit('sendResetTable', 'reset')
this.$nextTick(() => { this.$nextTick(() => {
this.handleSearch() this.handleSearch()
}) })
......
<template> <template>
<div style='margin: 16px'> <div style="margin: 16px">
<ProfitSearch ref='profitSearch' @sendSearchForm='getSearchForm' @sendResetTable='reset' /> <ProfitSearch
<el-button type='primary' size='small' @click='handleOutput' ref="profitSearch"
@sendSearchForm="getSearchForm"
@sendResetTable="reset"
/>
<el-button type="primary" size="small" @click="handleOutput"
>导出 >导出
</el-button </el-button>
> <el-button size="small" type="primary" @click="handleWriteOff()"
<el-button
size='small'
type='primary'
@click='handleWriteOff()'
>批量核销 >批量核销
</el-button </el-button>
> <div class="cumulativeAward">累计发放奖励:{{ totalScore }}</div>
<div class='cumulativeAward'>累计发放奖励:{{ totalScore }}</div>
<d2-table <d2-table
class='my-row-height' class="my-row-height"
ref='profitTable' ref="profitTable"
:hasNum='true' :hasNum="true"
@sendAlldata='getTotalScore' @sendAlldata="getTotalScore"
:tableParams='profitTableParams' :tableParams="profitTableParams"
:searchForm='profitSearchForm' :searchForm="profitSearchForm"
:getListApi='getListApi' :getListApi="getListApi"
:pageConf='pageConf' :pageConf="pageConf"
:pageSize='[20,50,100,200,500]' :pageSize="[20, 50, 100, 200, 500]"
> >
<div slot='isWithdrawal' slot-scope='scope'> <div slot="isWithdrawal" slot-scope="scope">
{{ scope.scope.isWithdrawal == '1' ? '是' : scope.scope.isWithdrawal == '2' ? '否' : '' }} {{
scope.scope.isWithdrawal == '1'
? '是'
: scope.scope.isWithdrawal == '2'
? '否'
: ''
}}
</div> </div>
<div slot='exchangeStatus' slot-scope='scope'> <div slot="exchangeStatus" slot-scope="scope">
{{ scope.scope.exchangeStatus == '1' ? '已核销' : scope.scope.exchangeStatus == '2' ? '未核销' : '' }} {{
scope.scope.exchangeStatus == '1'
? '已核销'
: scope.scope.exchangeStatus == '2'
? '未核销'
: ''
}}
</div> </div>
<div slot='businessScene' slot-scope='scope'> <div slot="businessScene" slot-scope="scope">
<span v-if="scope.scope.businessScene == '0'">1.0 新车权益升级</span> <span v-if="scope.scope.businessScene == '0'">1.0车损升级</span>
<span v-if="scope.scope.businessScene == '1'">1.1 新车精品升级</span> <span v-if="scope.scope.businessScene == '1'">1.1精品升级</span>
<span v-if="scope.scope.businessScene == '2'">1.2 新车膨胀金活动</span> <span v-if="scope.scope.businessScene == '2'">1.2膨胀金活动</span>
<span v-if="scope.scope.businessScene == '3'" <span v-if="scope.scope.businessScene == '3'">1.3众筹活动</span>
>1.3 售后直播众筹活动</span
>
</div> </div>
<div slot='channel' slot-scope='scope'> <div slot="channel" slot-scope="scope">
<span v-if="scope.scope.channel == '1'">广联</span> <span v-if="scope.scope.channel == '1'">广联</span>
<span v-if="scope.scope.channel == '2'">门店</span> <span v-if="scope.scope.channel == '2'">门店</span>
<span v-if="scope.scope.channel == '3'">服务商</span> <span v-if="scope.scope.channel == '3'">服务商</span>
</div> </div>
</d2-table> </d2-table>
<el-dialog title='提示' :visible.sync='dialogVisible' width='30%'> <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
<div class='verificationPoints'>核销积分确认,核销后积分不可恢复</div> <div class="verificationPoints">核销积分确认,核销后积分不可恢复</div>
<div> <div>
<p>涉及门店:{{ writeOffData.numberOfStores }}家</p> <p>涉及门店:{{ writeOffData.numberOfStores }}家</p>
<p>涉及员工数:{{ writeOffData.employeeCount }}人</p> <p>涉及员工数:{{ writeOffData.employeeCount }}人</p>
<p>核销积分总分:{{ writeOffData.totalPoints }}</p> <p>核销积分总分:{{ writeOffData.totalPoints }}</p>
</div> </div>
<span slot='footer' class='dialog-footer'> <span slot="footer" class="dialog-footer">
<el-button @click='dialogVisible = false'>取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type='primary' @click='handleDebounce' <el-button type="primary" @click="handleDebounce">确 定</el-button>
>确 定</el-button
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -70,7 +77,7 @@ import { profitApi } from '@/api/profitManagement' ...@@ -70,7 +77,7 @@ import { profitApi } from '@/api/profitManagement'
export default { export default {
name: 'WithdrawalSearch', name: 'WithdrawalSearch',
components: { components: {
ProfitSearch ProfitSearch,
}, },
data() { data() {
return { return {
...@@ -78,7 +85,7 @@ export default { ...@@ -78,7 +85,7 @@ export default {
writeOffData: { writeOffData: {
numberOfStores: '', numberOfStores: '',
employeeCount: '', employeeCount: '',
totalPoints: '' totalPoints: '',
}, },
verificationWriteOff: true, verificationWriteOff: true,
profitSearchForm: {}, profitSearchForm: {},
...@@ -89,7 +96,7 @@ export default { ...@@ -89,7 +96,7 @@ export default {
pageConf: { pageConf: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageNum: 'pageNum', pageNum: 'pageNum',
totalCount: 'data.count' totalCount: 'data.count',
}, },
getListApi: profitApi.searchProfitList, getListApi: profitApi.searchProfitList,
profitTableParams: { profitTableParams: {
...@@ -99,63 +106,63 @@ export default { ...@@ -99,63 +106,63 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '员工名称', label: '员工名称',
prop: 'staffName' prop: 'staffName',
}, },
{ {
label: '员工手机号', label: '员工手机号',
prop: 'staffPhone' prop: 'staffPhone',
}, },
{ {
label: '奖励积分值', label: '奖励积分值',
prop: 'rewardScore' prop: 'rewardScore',
}, },
{ {
label: '关联任务', label: '关联任务',
prop: 'missionName' prop: 'missionName',
}, },
{ {
label: '发放渠道', label: '发放渠道',
prop: 'channel', prop: 'channel',
addHtml: 'channel' addHtml: 'channel',
}, },
{ {
label: '所属活动/产品', label: '所属活动/产品',
prop: 'activityName' prop: 'activityName',
}, },
{ {
label: '所属商户', label: '所属商户',
prop: 'merchantName' prop: 'merchantName',
}, },
{ {
label: '所属业务场景', label: '所属业务场景',
prop: 'businessScene', prop: 'businessScene',
addHtml: 'businessScene' addHtml: 'businessScene',
}, },
{ {
label: '奖励时间', label: '奖励时间',
prop: 'rewardTime' prop: 'rewardTime',
}, },
{ {
label: '支持积分提现', label: '支持积分提现',
prop: 'isWithdrawal', prop: 'isWithdrawal',
addHtml: 'isWithdrawal' addHtml: 'isWithdrawal',
}, },
{ {
label: '核销状态', label: '核销状态',
prop: 'exchangeStatus', prop: 'exchangeStatus',
addHtml: 'exchangeStatus' addHtml: 'exchangeStatus',
}, },
{ {
label: '核销时间', label: '核销时间',
prop: 'exchangeTime' prop: 'exchangeTime',
}, },
{ {
label: '核销人', label: '核销人',
prop: 'exchangeStaff' prop: 'exchangeStaff',
} },
] ],
}, },
timeout:null timeout: null,
} }
}, },
methods: { methods: {
...@@ -164,12 +171,16 @@ export default { ...@@ -164,12 +171,16 @@ export default {
if (this.choiceData && this.choiceData.length == '0') { if (this.choiceData && this.choiceData.length == '0') {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请勾选需要核销的积分记录!' message: '请勾选需要核销的积分记录!',
}) })
return return
} }
this.verificationWriteOff = this.choiceData.every(item => { this.verificationWriteOff = this.choiceData.every((item) => {
if (!item.isWithdrawal || item.isWithdrawal == '1' || item.exchangeStatus == '1') { if (
!item.isWithdrawal ||
item.isWithdrawal == '1' ||
item.exchangeStatus == '1'
) {
return false return false
} else { } else {
return true return true
...@@ -178,7 +189,8 @@ export default { ...@@ -178,7 +189,8 @@ export default {
if (!this.verificationWriteOff) { if (!this.verificationWriteOff) {
return this.$message({ return this.$message({
type: 'error', type: 'error',
message: '所选中的积分记录包含「是否积分提现=是」或「核销状态=已核销」,请剔除后再进行操作!' message:
'所选中的积分记录包含「是否积分提现=是」或「核销状态=已核销」,请剔除后再进行操作!',
}) })
} }
this.processSelectedData() this.processSelectedData()
...@@ -190,10 +202,14 @@ export default { ...@@ -190,10 +202,14 @@ export default {
let totalPoints = 0 let totalPoints = 0
this.choiceDataBack = JSON.parse(JSON.stringify(this.choiceData)) this.choiceDataBack = JSON.parse(JSON.stringify(this.choiceData))
this.processArray = this.choiceData.reduce((curr, next) => { this.processArray = this.choiceData.reduce((curr, next) => {
obj[next.staffPhone] ? '' : obj[next.staffPhone] = curr.push(next) obj[next.staffPhone] ? '' : (obj[next.staffPhone] = curr.push(next))
numberOfStoresArr.includes(next.merchantName) ? '' : numberOfStoresArr.push((next.merchantName)) numberOfStoresArr.includes(next.merchantName)
? ''
: numberOfStoresArr.push(next.merchantName)
console.log(totalPoints) console.log(totalPoints)
next.rewardScore ? totalPoints += next.rewardScore : totalPoints += 0 next.rewardScore
? (totalPoints += next.rewardScore)
: (totalPoints += 0)
return curr return curr
}, []) }, [])
this.$set(this.writeOffData, 'numberOfStores', numberOfStoresArr.length) this.$set(this.writeOffData, 'numberOfStores', numberOfStoresArr.length)
...@@ -201,18 +217,35 @@ export default { ...@@ -201,18 +217,35 @@ export default {
this.$set(this.writeOffData, 'employeeCount', this.processArray.length) this.$set(this.writeOffData, 'employeeCount', this.processArray.length)
}, },
getSeletedData() { getSeletedData() {
this.choiceData = this.$refs.profitTable.mutiSelectArr.list && this.choiceData =
this.$refs.profitTable.mutiSelectArr.list.map(item => { this.$refs.profitTable.mutiSelectArr.list &&
let { exchangeStatus, staffPhone, merchantName, isWithdrawal, rewardScore, id } = item this.$refs.profitTable.mutiSelectArr.list.map((item) => {
return { exchangeStatus, staffPhone, merchantName, isWithdrawal, rewardScore, id } let {
exchangeStatus,
staffPhone,
merchantName,
isWithdrawal,
rewardScore,
id,
} = item
return {
exchangeStatus,
staffPhone,
merchantName,
isWithdrawal,
rewardScore,
id,
}
}) })
}, },
handleDebounce:debounce( handleDebounce: debounce(async function () {
async function(){
let arr = [] let arr = []
this.choiceDataBack && this.choiceDataBack.forEach(item => arr.push(item.id)) this.choiceDataBack &&
this.choiceDataBack.forEach((item) => arr.push(item.id))
const params = { idList: arr } const params = { idList: arr }
await profitApi.verificationPoints({ ...params }).then(res => { await profitApi
.verificationPoints({ ...params })
.then((res) => {
if (res.code == '0') { if (res.code == '0') {
this.$message.success('积分核销成功') this.$message.success('积分核销成功')
this.dialogVisible = false this.dialogVisible = false
...@@ -220,19 +253,18 @@ export default { ...@@ -220,19 +253,18 @@ export default {
} else { } else {
this.$message.error('积分核销失败') this.$message.error('积分核销失败')
} }
}).catch(err => { })
.catch((err) => {
this.$message.error(err) this.$message.error(err)
}) })
this.dialogVisible = false this.dialogVisible = false
}, }, 1000),
1000
),
// 导出 // 导出
handleOutput() { handleOutput() {
let params = JSON.parse(JSON.stringify(this.profitSearchForm)) let params = JSON.parse(JSON.stringify(this.profitSearchForm))
let pageConfig = { let pageConfig = {
pageSize: 9999, pageSize: 9999,
pageNum: 1 pageNum: 1,
} }
profitApi.exportProfitList({ ...params, ...pageConfig }).then((res) => { profitApi.exportProfitList({ ...params, ...pageConfig }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
...@@ -240,7 +272,7 @@ export default { ...@@ -240,7 +272,7 @@ export default {
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '导出失败!' message: '导出失败!',
}) })
} }
}) })
...@@ -274,8 +306,8 @@ export default { ...@@ -274,8 +306,8 @@ export default {
getTotalScore(val) { getTotalScore(val) {
let { totalScore } = val let { totalScore } = val
this.totalScore = totalScore this.totalScore = totalScore
} },
} },
} }
</script> </script>
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
size="small" size="small"
:disabled="isEditor" :disabled="isEditor"
> >
<el-option label="1.3 售后直播众筹活动" :value="3"></el-option> <el-option label="1.2膨胀金活动" :value="2"></el-option>
<el-option label="1.3众筹活动" :value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商户:" prop="merchantId"> <el-form-item label="商户:" prop="merchantId">
...@@ -60,10 +61,10 @@ ...@@ -60,10 +61,10 @@
placeholder="请选择任务指定人群" placeholder="请选择任务指定人群"
size="small" size="small"
> >
<el-option label="1.0 新车权益升级" value="0"></el-option> <el-option label="1.0车损升级" value="0"></el-option>
<el-option label="1.1 新车精品升级" value="1"></el-option> <el-option label="1.1精品升级" value="1"></el-option>
<el-option label="1.2 次新车膨胀金活动" value="2"></el-option> <el-option label="1.2膨胀金活动" value="2"></el-option>
<el-option label="1.3 售后直播众筹活动" value="3"></el-option> <el-option label="1.3众筹活动" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发放渠道:" prop="channel"> <el-form-item label="发放渠道:" prop="channel">
......
...@@ -77,14 +77,10 @@ ...@@ -77,14 +77,10 @@
:pageConf="pageConf" :pageConf="pageConf"
> >
<div slot="businessScene" slot-scope="scope"> <div slot="businessScene" slot-scope="scope">
<span v-if="scope.scope.businessScene == 0">1.0 新车权益升级</span> <span v-if="scope.scope.businessScene == 0">1.0车损升级</span>
<span v-if="scope.scope.businessScene == 1">1.1 新车精品升级</span> <span v-if="scope.scope.businessScene == 1">1.1精品升级</span>
<span v-if="scope.scope.businessScene == 2" <span v-if="scope.scope.businessScene == 2">1.2膨胀金活动</span>
>1.2 次新车膨胀金活动</span <span v-if="scope.scope.businessScene == 3">1.3众筹活动</span>
>
<span v-if="scope.scope.businessScene == 3"
>1.3 售后直播众筹活动</span
>
</div> </div>
<div slot="activityStatus" slot-scope="scope"> <div slot="activityStatus" slot-scope="scope">
<span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH" <span v-if="scope.scope.activityStatus == statusNum.UNPUBLISH"
...@@ -150,19 +146,19 @@ const sceneOption = [ ...@@ -150,19 +146,19 @@ const sceneOption = [
value: '', value: '',
}, },
{ {
label: '1.0 新车权益升级', label: '1.0车损升级',
value: '0', value: '0',
}, },
{ {
label: '1.1 新车精品升级', label: '1.1精品升级',
value: '1', value: '1',
}, },
{ {
label: '1.2 次新车膨胀金活动', label: '1.2膨胀金活动',
value: '2', value: '2',
}, },
{ {
label: '1.3 售后直播众筹活动', label: '1.3众筹活动',
value: '3', value: '3',
}, },
] ]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!