Commit e53f411f by 前端

Merge branch 'v3.2.0' into kuangyq_dev_v3.2.0

2 parents 9a0b4040 94d44c70
......@@ -5,7 +5,7 @@
"author": "chenwq <cwqnn2015@163.com>",
"private": true,
"scripts": {
"serve": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
......
......@@ -8,6 +8,10 @@ const profitApi = {
exportProfitList(data = {}) {
data.method = `${path}exportList`
return request(data)
},
verificationPoints(data = {}) {
data.method = `${path}exchange`
return request(data)
}
}
export { profitApi }
......@@ -94,7 +94,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page[this.pageConf.pageNum]"
:page-sizes="[10,20,30,40]"
:page-sizes="pageSize"
:page-size="page[this.pageConf.pageSize]"
:total="getListApi ? total : tableTotal"
:layout="layout"
......@@ -125,6 +125,10 @@ export default {
type: Object,
default: () => {}
},
pageSize: {
type:Array,
default:()=>[10,20,30,40]
},
// 表格数据-外部传入
tableData: {
type: Array,
......@@ -220,7 +224,7 @@ export default {
},
mounted() {
this.page = {}
this.page[this.pageConf.pageSize] = 10
this.page[this.pageConf.pageSize] = this.pageSize[0]
this.page[this.pageConf.pageNum] = 1
const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener('click', this.refreshEmit)
......
......@@ -7,21 +7,21 @@
label-width="120px"
class="demo-form-inline"
>
<el-form-item label="员工名称">
<el-form-item label="员工名称:">
<el-input
clearable
v-model="profitSearchForm.staffName"
placeholder="请输入员工名称"
></el-input>
</el-form-item>
<el-form-item label="员工手机号">
<el-form-item label="员工手机号:">
<el-input
clearable
v-model="profitSearchForm.staffPhone"
placeholder="请输入员工手机号"
></el-input>
</el-form-item>
<el-form-item label="所属业务场景">
<el-form-item label="所属业务场景:">
<el-select
v-model="profitSearchForm.businessScene"
placeholder="所属业务场景"
......@@ -65,7 +65,38 @@
placeholder="请输入关联任务"
></el-input>
</el-form-item>
<el-form-item label="奖励时间">
<el-form-item label="发放渠道:">
<el-select
v-model="profitSearchForm.channel"
placeholder="请选择发放渠道"
>
<el-option label="全部" value=""></el-option>
<el-option label="广联" value="1"></el-option>
<el-option label="门店" value="2"></el-option>
<el-option label="服务商" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支持积分提现:">
<el-select
v-model="profitSearchForm.isWithdrawal"
placeholder="请选择是否支持积分提现"
>
<el-option label="全部" value=""></el-option>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="核销状态:">
<el-select
v-model="profitSearchForm.exchangeStatus"
placeholder="请选择核销状态"
>
<el-option label="全部" value=""></el-option>
<el-option label="已核销" value="1"></el-option>
<el-option label="未核销" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="奖励时间:">
<el-date-picker
value-format="yyyy-MM-dd"
v-model="profitSearchForm.rewardTime"
......@@ -76,6 +107,17 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="核销时间:">
<el-date-picker
value-format="yyyy-MM-dd"
v-model="profitSearchForm.exchangeTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询 </el-button>
<el-button @click="reset">重置</el-button>
......@@ -93,6 +135,8 @@ export default {
profitSearchForm: {
businessScene: '',
channel: '',
isWithdrawal:'',
exchangeStatus:''
},
}
},
......@@ -108,6 +152,7 @@ export default {
this.defalutStartTime,
this.defalutEndTime,
])
this.$emit('sendResetTable','reset')
this.$nextTick(() => {
this.handleSearch()
})
......
<template>
<div style="margin: 16px">
<ProfitSearch @sendSearchForm="getSearchForm" />
<el-button type="primary" size="small" @click="handleOutput"
>导出</el-button
<div style='margin: 16px'>
<ProfitSearch ref='profitSearch' @sendSearchForm='getSearchForm' @sendResetTable='reset' />
<el-button type='primary' size='small' @click='handleOutput'
>导出
</el-button
>
<div class="cumulativeAward">累计发放奖励:{{ totalScore }}</div>
<el-button
size='small'
type='primary'
@click='handleWriteOff()'
>批量核销
</el-button
>
<div class='cumulativeAward'>累计发放奖励:{{ totalScore }}</div>
<d2-table
class="my-row-height"
ref="profitTable"
:hasNum="true"
@sendAlldata="getTotalScore"
:tableParams="profitTableParams"
:searchForm="profitSearchForm"
:getListApi="getListApi"
:pageConf="pageConf"
class='my-row-height'
ref='profitTable'
:hasNum='true'
@sendAlldata='getTotalScore'
:tableParams='profitTableParams'
:searchForm='profitSearchForm'
:getListApi='getListApi'
:pageConf='pageConf'
:pageSize='[20,50,100,200,500]'
>
<div slot="businessScene" slot-scope="scope">
<div slot='isWithdrawal' slot-scope='scope'>
{{ scope.scope.isWithdrawal == '1' ? '是' : scope.scope.isWithdrawal == '2' ? '否' : '' }}
</div>
<div slot='exchangeStatus' slot-scope='scope'>
{{ scope.scope.exchangeStatus == '1' ? '已核销' : scope.scope.exchangeStatus == '2' ? '未核销' : '' }}
</div>
<div slot='businessScene' slot-scope='scope'>
<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 == '2'">1.2 新车膨胀金活动</span>
<span v-if="scope.scope.businessScene == '3'"
>1.3 售后直播众筹活动</span
>1.3 售后直播众筹活动</span
>
</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 == '2'">门店</span>
<span v-if="scope.scope.channel == '3'">服务商</span>
</div>
</d2-table>
<el-dialog title='提示' :visible.sync='dialogVisible' width='30%'>
<div class='verificationPoints'>核销积分确认,核销后积分不可恢复</div>
<div>
<p>涉及门店:{{ writeOffData.numberOfStores }}家</p>
<p>涉及员工数:{{ writeOffData.employeeCount }}人</p>
<p>核销积分总分:{{ writeOffData.totalPoints }}</p>
</div>
<span slot='footer' class='dialog-footer'>
<el-button @click='dialogVisible = false'>取 消</el-button>
<el-button type='primary' @click='comfirmDialog'
>确 定</el-button
>
</span>
</el-dialog>
</div>
</template>
......@@ -36,74 +65,170 @@
import ProfitSearch from '@/views/profitManagement/profitList/cpns/ProfitSearch'
import { profitApi } from '@/api/profitManagement'
import { withdrawalApi } from '@/api/withdrawalManagement'
export default {
name: 'WithdrawalSearch',
components: {
ProfitSearch,
ProfitSearch
},
data() {
return {
processArray: [],
writeOffData: {
numberOfStores: '',
employeeCount: '',
totalPoints: ''
},
verificationWriteOff: true,
profitSearchForm: {},
dialogVisible: false,
totalScore: '',
choiceData: [],
choiceDataBack:[],
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count',
totalCount: 'data.count'
},
getListApi: profitApi.searchProfitList,
profitTableParams: {
mutiSelectUniqueKey: 'id',
mutiSelectName: 'list',
listName: 'data.data',
tableColumns: [
{
label: '员工名称',
prop: 'staffName',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone',
prop: 'staffPhone'
},
{
label: '奖励积分值',
prop: 'rewardScore',
prop: 'rewardScore'
},
{
label: '关联任务',
prop: 'missionName',
prop: 'missionName'
},
{
label: '发放渠道',
prop: 'channel',
addHtml: 'channel',
addHtml: 'channel'
},
{
label: '所属活动/产品',
prop: 'activityName',
prop: 'activityName'
},
{
label: '所属商户',
prop: 'merchantName',
prop: 'merchantName'
},
{
label: '所属业务场景',
prop: 'businessScene',
addHtml: 'businessScene',
addHtml: 'businessScene'
},
{
label: '奖励时间',
prop: 'rewardTime',
prop: 'rewardTime'
},
],
},
{
label: '支持积分提现',
prop: 'isWithdrawal',
addHtml: 'isWithdrawal'
},
{
label: '核销状态',
prop: 'exchangeStatus',
addHtml: 'exchangeStatus'
},
{
label: '核销时间',
prop: 'exchangeTime'
},
{
label: '核销人',
prop: 'exchangeStaff'
}
]
}
}
},
methods: {
handleWriteOff() {
this.getSeletedData()
if (this.choiceData && this.choiceData.length == '0') {
this.$message({
type: 'error',
message: '请勾选需要核销的积分记录!'
})
return
}
this.verificationWriteOff = this.choiceData.every(item => {
if (!item.isWithdrawal || item.isWithdrawal == '1' || item.exchangeStatus == '1') {
return false
} else {
return true
}
})
if (!this.verificationWriteOff) {
return this.$message({
type: 'error',
message: '所选中的积分记录包含「是否积分提现=是」或「核销状态=已核销」,请剔除后再进行操作!'
})
}
this.processSelectedData()
this.dialogVisible = true
},
processSelectedData() {
let obj = {}
let numberOfStoresArr = []
let totalPoints = 0
this.choiceDataBack = JSON.parse(JSON.stringify(this.choiceData))
this.processArray = this.choiceData.reduce((curr, next) => {
obj[next.staffPhone] ? '' : obj[next.staffPhone] = curr.push(next)
numberOfStoresArr.includes(next.merchantName) ? '' : numberOfStoresArr.push((next.merchantName))
console.log(totalPoints)
next.rewardScore ? totalPoints += next.rewardScore : totalPoints += 0
return curr
}, [])
this.$set(this.writeOffData, 'numberOfStores', numberOfStoresArr.length)
this.$set(this.writeOffData, 'totalPoints', totalPoints.toFixed(2))
this.$set(this.writeOffData, 'employeeCount', this.processArray.length)
},
getSeletedData() {
this.choiceData = this.$refs.profitTable.mutiSelectArr.list &&
this.$refs.profitTable.mutiSelectArr.list.map(item => {
let { exchangeStatus, staffPhone, merchantName, isWithdrawal, rewardScore, id } = item
return { exchangeStatus, staffPhone, merchantName, isWithdrawal, rewardScore, id }
})
},
async comfirmDialog() {
let arr = []
this.choiceDataBack && this.choiceDataBack.forEach(item => arr.push(item.id))
const params = { idList: arr }
await profitApi.verificationPoints({ ...params }).then(res => {
if (res.code == '0') {
this.$message.success('积分核销成功')
this.dialogVisible = false
this.$refs.profitSearch.reset()
} else {
this.$message.error('积分核销失败')
}
}).catch(err => {
this.$message.error('积分核销失败')
})
this.dialogVisible = false
},
// 导出
handleOutput() {
let params = JSON.parse(JSON.stringify(this.profitSearchForm))
let pageConfig = {
pageSize: 9999,
pageNum: 1,
pageNum: 1
}
profitApi.exportProfitList({ ...params, ...pageConfig }).then((res) => {
if (res.code == 0) {
......@@ -111,7 +236,7 @@ export default {
} else {
this.$message({
type: 'error',
message: '导出失败!',
message: '导出失败!'
})
}
})
......@@ -124,16 +249,29 @@ export default {
}
if (params.rewardTime && params.rewardTime.length)
delete params.rewardTime
if (params && params.exchangeTime) {
params.exchangeBeginTime = params.exchangeTime[0]
params.exchangeEndTime = params.exchangeTime[1]
}
if (params.exchangeTime && params.exchangeTime.length)
delete params.exchangeTime
this.profitSearchForm = params
setTimeout(() => {
this.$refs.profitTable.refreshTable(false, true)
}, 500)
},
reset() {
if (this.choiceData){
this.$refs.profitTable.mutiSelectArr.list = []
this.$refs.profitTable.$children[0].clearSelection()
}
},
getTotalScore(val) {
let { totalScore } = val
this.totalScore = totalScore
},
},
}
}
}
</script>
......@@ -141,6 +279,12 @@ export default {
.cumulativeAward {
margin: 16px 0;
}
.verificationPoints {
font-size: 16px;
font-weight: 600;
}
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
......
......@@ -1357,15 +1357,6 @@ export default {
// })
}
},
// 页面风格切换
textTypeChange(item, index, itm, index1) {
console.log(itm)
console.log(this.textIds)
if (itm.textType == 1) {
let textId = itm.taskid || itm.id
this.getTextBox(textId, index, index1)
}
},
// 获取任务信息详情
findMissionDeail(taskId) {
var params = { id: taskId }
......
......@@ -43,6 +43,11 @@ export default {
name: '发放渠道:',
value: 'channelName',
id:'channelName'
},
{
name: '积分提现:',
value: 'withdrawalFlag',
id:'withdrawalFlag'
}
]
}
......@@ -55,6 +60,9 @@ export default {
Object.keys(newVal).forEach(key => {
if (item.id == key) {
item.value = newVal[key]
if (item.id == 'withdrawalFlag') {
item.value = item.value == '1' ? '员工发起提现' : item.value == '2' ? '运营从后台核销' : ''
}
}
})
})
......
......@@ -62,8 +62,8 @@ export default {
await taskManagementApi.findMissionDeail({ id }).then(res => {
let copeWithRes = res.data && res.data.platformMerchantMissionDateResponseList
let copeWithResList = copeWithRes[0].platformMerchantMissionResponseList
let { businessSceneName, merchantName, activityName, crowdName, channelName } = res.data
this.taskInfo = { businessSceneName, merchantName, activityName, crowdName, channelName }
let { businessSceneName, merchantName, activityName, crowdName, channelName,withdrawalFlag } = res.data
this.taskInfo = { businessSceneName, merchantName, activityName, crowdName, channelName,withdrawalFlag }
this.hastaskInfo = Object.values(this.taskInfo).length > 0 ? 'true' : 'false'
this.taskSelect = copeWithRes
this.taskSelect.forEach(item => {
......
......@@ -2,8 +2,8 @@
<div class='basicInfo'>
<div class='headline'>基础信息</div>
<div v-for='(item,index) in basicInfoList' :key='index' class='basicInfoList'>
<span class='infoName'>{{item.infoName}}</span>
<span>{{item.infoVal}}</span>
<span class='infoName'>{{ item.infoName }}</span>
<span>{{ item.infoVal }}</span>
</div>
</div>
</template>
......@@ -11,33 +11,38 @@
<script>
export default {
name: 'BasicInfo',
props:{
basicInfo:{
type:Object,
default:{}
props: {
basicInfo: {
type: Object,
default: {}
}
},
data(){
return{
basicInfoList:[
{infoName:'业务场景:',infoVal:'businessSceneName',id:'businessSceneName'},
{infoName:'商户:',infoVal:'merchantName',id:'merchantName'},
{infoName:'活动/产品:',infoVal:'activityName',id:'activityName'},
{infoName:'任务指定人群:',infoVal:'crowdName',id:'crowdName'},
{infoName:'发放渠道:',infoVal:'channelName',id:'channelName'},
{infoName:'备注:',infoVal:'remark',id:'remark'},
data() {
return {
basicInfoList: [
{ infoName: '业务场景:', infoVal: 'businessSceneName', id: 'businessSceneName' },
{ infoName: '商户:', infoVal: 'merchantName', id: 'merchantName' },
{ infoName: '活动/产品:', infoVal: 'activityName', id: 'activityName' },
{ infoName: '任务指定人群:', infoVal: 'crowdName', id: 'crowdName' },
{ infoName: '发放渠道:', infoVal: 'channelName', id: 'channelName' },
{ infoName: '积分提现:', infoVal: 'withdrawalFlag', id: 'withdrawalFlag' },
{ infoName: '备注:', infoVal: 'remark', id: 'remark' }
]
}
},
watch: {
basicInfo:{
handler(newVal,oldVal){
basicInfo: {
handler(newVal, oldVal) {
if (!oldVal || newVal !== oldVal) {
this.basicInfoList.map(item => {
Object.keys(newVal).forEach(key => {
if (item.id == key) {
item.infoVal = newVal[key]
if (item.id == 'withdrawalFlag') {
item.infoVal = item.infoVal == '1' ? '员工发起提现' : item.infoVal == '2' ? '运营从后台核销' : ''
}
}
})
})
}
......@@ -50,16 +55,18 @@ export default {
</script>
<style scoped>
.headline{
.headline {
font-weight: 600;
padding-bottom: 20px;
}
.basicInfoList{
.basicInfoList {
font-size: 14px;
display: flex;
padding: 8px 0;
}
.infoName{
.infoName {
color: #999999;
width: 120px;
padding-right: 16px;
......
......@@ -40,8 +40,8 @@ export default {
},
primaryInfo(id) {
taskManagementApi.findMissionDeail({ id }).then(res => {
let { businessSceneName, merchantName, activityName, crowdName, channelName, remark } = res.data
this.basicInfo = { businessSceneName, merchantName, activityName, crowdName, channelName, remark }
let { businessSceneName, merchantName, activityName, crowdName, channelName, remark,withdrawalFlag} = res.data
this.basicInfo = { businessSceneName, merchantName, activityName, crowdName, channelName, remark,withdrawalFlag }
this.hasbasicInfo = Object.values(this.basicInfo).length > 0 ? 'true' : 'false'
this.taskPlanList = res.data.platformMerchantMissionDateResponseList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!