Commit 16dc0402 by 前端

Merge branch 'v2.12.0' into 'master'

V2.12.0

See merge request !45
2 parents 60d1f9ca 0897fbd6
Showing 71 changed files with 1953 additions and 58 deletions
This diff could not be displayed because it is too large.
...@@ -13,11 +13,14 @@ ...@@ -13,11 +13,14 @@
"axios": "^0.18.0", "axios": "^0.18.0",
"dayjs": "^1.11.4", "dayjs": "^1.11.4",
"element-ui": "^2.15.1", "element-ui": "^2.15.1",
"glsx-common": "^2.0.1",
"glsx-vue-common": "^2.0.5", "glsx-vue-common": "^2.0.5",
"lodash": "^4.17.10", "lodash": "^4.17.10",
"sass-loader": "^7.1.0", "node-sass": "4.14.1",
"sass-loader": "7.3.1",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"vue": "^2.5.17" "md5": "^2.3.0",
"vue": "^2.6.11"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1", "@vue/cli-plugin-babel": "^3.0.1",
...@@ -27,6 +30,6 @@ ...@@ -27,6 +30,6 @@
"eslint-plugin-html": "^4.0.5", "eslint-plugin-html": "^4.0.5",
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"vue-template-compiler": "^2.5.17" "vue-template-compiler": "^2.6.11"
} }
} }
import request from './request'
import Vue from 'vue'
const commonApi = {
uploadImgApi(data) {
data.method = 'glsx.accounts.biz.common.pictureUpload'
return request(
data,
'glsx.accounts.biz.common.pictureUpload',
['file'],
Vue.prototype.fileUploadURL,
true
)
},
}
export { commonApi }
import request from './request'
import Vue from 'vue'
const path = 'merchants.api.'
const addNamelistApi = {
// 根据商户名称和渠道类型查询商户列表
getMerchantsList(data = {}) {
data.method = 'merchants.api.open.findMerchantList'
return request(
data,
'merchants.api.open.findMerchantList',
[],
Vue.prototype.otherUrl
)
}
}
export { addNamelistApi }
import request from './request'
const path = 'merchants.api.staff.score.'
const profitApi = {
searchProfitList(data = {}) {
data.method = `${path}page`
return request(data)
},
exportProfitList(data = {}) {
data.method = `${path}exportList`
return request(data)
}
}
export { profitApi }
...@@ -3,22 +3,33 @@ import axios from 'axios' ...@@ -3,22 +3,33 @@ import axios from 'axios'
import qs from 'qs' import qs from 'qs'
// import GlsxVueCommon from 'glsx-vue-common' // import GlsxVueCommon from 'glsx-vue-common'
import sign from './sign' import sign from './sign'
import { import { GlAxios } from 'glsx-vue-common'
GlAxios const request = (
} from 'glsx-vue-common' params = {},
const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], url = '') => { method = RequestMethods.GET,
params.source = 'glsx-oss-merchant-data' noSignAttr = [],
url = '',
isMd5 = false
) => {
params.source = 'glsx-oss-withdrawal-data'
params.appKey = '48e5e13229b82c1b4e6e8c96151f0637' params.appKey = '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime() params.timestamp = new Date().getTime()
params.v = '1.0.0' params.v = '1.0.0'
params.format = 'json' params.format = 'json'
// params.createBy = this.$get_session_config().user.id // params.createBy = this.$get_session_config().user.id
var data = sign(params, noSignAttr) if (isMd5) {
params.app_key = params.appKey
delete params.appKey
// return axios.post(`${url}/router?method=${method}`, qs.stringify(data))
}
var data = isMd5 ? sign(params, noSignAttr, true) : sign(params, noSignAttr)
if (url) { if (url) {
return axios.post(`${url}/router?method=${method}`, qs.stringify(data)) return axios.post(`${url}/router?method=${method}`, qs.stringify(data))
} }
return method === RequestMethods.GET ? GlAxios.get('router', { return method === RequestMethods.GET
params: sign(params, noSignAttr) ? GlAxios.get('router', {
}) : GlAxios.post('router', data) params: sign(params, noSignAttr),
})
: GlAxios.post('router', data)
} }
export default request export default request
import sha1 from 'sha1' import sha1 from 'sha1'
import md5 from 'md5'
import qs from 'qs' import qs from 'qs'
import _ from 'lodash' import _ from 'lodash'
const secret = window.location.href.includes('dj.glsx.com.cn') ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' const secret = window.location.href.includes('dj.glsx.com.cn')
const sign = (params, noSignAttr = []) => { ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = [], isMd5) => {
delete params.sign delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), { var objStr = qs.stringify(_.cloneDeep(params), {
arrayFormat: 'indices', arrayFormat: 'indices',
allowDots: true, allowDots: true,
encodeValuesOnly: true encodeValuesOnly: true,
}) })
var objVal = objStr.split('&') var objVal = objStr.split('&')
var realObj = {} var realObj = {}
objVal.forEach(item => { objVal.forEach((item) => {
const idx = item.indexOf('=') const idx = item.indexOf('=')
realObj[item.split('=')[0]] = decodeURIComponent(item.slice(idx + 1)) realObj[item.split('=')[0]] = decodeURIComponent(item.slice(idx + 1))
}) })
...@@ -27,10 +30,12 @@ const sign = (params, noSignAttr = []) => { ...@@ -27,10 +30,12 @@ const sign = (params, noSignAttr = []) => {
} }
realObj[key] = obj realObj[key] = obj
} }
keys.forEach(e => { keys.forEach((e) => {
!noSignAttr.includes(e) && str.push(e + realObj[e]) !noSignAttr.includes(e) && str.push(e + realObj[e])
}) })
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase() realObj.sign = isMd5
? md5(secret + str.join('') + secret).toUpperCase()
: sha1(secret + str.join('') + secret).toUpperCase()
return realObj return realObj
} }
export default sign export default sign
import request from './request'
import Vue from 'vue'
// const path = 'scrm.api.renewal.insurance.customer.name.list.'
// const defaultPath = 'scrm.api.renewal.order.'
// 获取任务列表详情
const taskApi = {
// 获取活动列表
findMissionList(data) {
data.method = 'merchants.api.mission.findMissionList'
return request(data)
},
// 任务状态更新
updateStatusMission(data) {
data.method = 'merchants.api.mission.updateStatusMission'
return request(data)
},
// 通过业务场景获取商户
findMerchantByScene(data) {
data.method = 'merchants.api.open.findMerchantNoListByMerAccTypeId'
return request(data, 'post')
},
// 获取所有未结束活动
getActivityBypage(data) {
data.method = 'scrm.api.assistant.crowd.activity.page'
return request(
data,
'scrm.api.assistant.crowd.activity.page',
[],
Vue.prototype.otherUrl
)
},
// 新建任务
creatMission(data) {
data.method = 'merchants.api.mission.createMission'
return request(data, 'post')
},
// 获取任务详情
findMissionDeail(data) {
data.method = 'merchants.api.mission.findMissionDeail'
return request(data, 'post')
},
// 编辑任务
updateMission(data) {
data.method = 'merchants.api.mission.updateMission'
return request(data, 'post')
},
}
export { taskApi }
import request from './request'
const path = 'merchants.api.mission.'
const taskManagementApi = {
findMissionDeail(data = {}) {
data.method = `${path}findMissionDeail`
return request(data)
},
findStaffMissionPageList(data = {}) {
data.method = `${path}findStaffMissionPageList`
return request(data)
},
getStaffMissionLink(data = {}) {
data.method = `${path}getStaffMissionLink`
return request(data)
}
}
export { taskManagementApi }
import request from './request' import request from './request'
const path = 'merchants.api.accountype.' const path = 'withdrawals.api.accountype.'
const accountApi = { const accountApi = {
/** 账户类型分页数据*/ /** 账户类型分页数据*/
getPageApi(data = {}) { getPageApi(data = {}) {
......
import request from './request'
const path = 'merchants.api.staff.withdrawal.'
const withdrawalApi = {
// 客户名单列表查询
withdrawalListApi(data = {}) {
data.method = `${path}page`
return request(data)
},
exportList(data = {}) {
data.method = `${path}exportList`
return request(data)
},
batchWithdrawal(data = {}) {
data.method = `${path}batchWithdrawal`
return request(data)
}
}
export { withdrawalApi }
...@@ -20,7 +20,7 @@ Vue.use(ElementUI) ...@@ -20,7 +20,7 @@ Vue.use(ElementUI)
var mixin = { var mixin = {
data() { data() {
return { return {
eventBus: new Vue() eventBus: new Vue(),
} }
}, },
mounted() { mounted() {
...@@ -36,14 +36,14 @@ var mixin = { ...@@ -36,14 +36,14 @@ var mixin = {
}, },
translate(params) { translate(params) {
_this.eventBus.$emit('params', params) _this.eventBus.$emit('params', params)
} },
} },
}) })
connection.promise.then(parent => { connection.promise.then((parent) => {
const cfg = _this.$get_session_config() const cfg = _this.$get_session_config()
_this.$$parent = parent _this.$$parent = parent
if (cfg) return if (cfg) return
parent.getResources().then(config => { parent.getResources().then((config) => {
_this.$set_session_config(config) _this.$set_session_config(config)
}) })
}) })
...@@ -59,24 +59,25 @@ var mixin = { ...@@ -59,24 +59,25 @@ var mixin = {
* @param {*} params 传给下一个页面的参数 * @param {*} params 传给下一个页面的参数
*/ */
to(path, params) { to(path, params) {
console.log(path, params, '000')
if (this.$$parent) { if (this.$$parent) {
this.$$parent.to(path, params) this.$$parent.to(path, params)
} else { } else {
this.$$connection.promise.then(parent => { this.$$connection.promise.then((parent) => {
parent.to(path, params) parent.to(path, params)
}) })
} }
}, },
close() { close(title) {
this.$$parent.close() this.$$parent.close(title)
} },
} },
} }
const URL = const URL =
'https://oss-config.dev.glsx.com.cn/mock/5be17454f31545347559d499/config' 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/task-config') => { const getConfig = (url = URL + '/task-config') => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
request({ url }).then(res => { request({ url }).then((res) => {
if (res.status === 'success') { if (res.status === 'success') {
resolve({ vue: Vue, config: JSON.parse(res.data) }) resolve({ vue: Vue, config: JSON.parse(res.data) })
} else { } else {
...@@ -86,11 +87,11 @@ const getConfig = (url = URL + '/task-config') => { ...@@ -86,11 +87,11 @@ const getConfig = (url = URL + '/task-config') => {
}) })
} }
/* eslint-disable no-new */ /* eslint-disable no-new */
const render = App => { const render = (App) => {
window.vm = new Vue({ window.vm = new Vue({
el: '#app', el: '#app',
mixins: [mixin], mixins: [mixin],
render: h => h(App) render: (h) => h(App),
}) })
} }
......
<template>
<div class="ly-emotion">
<slot></slot>
</div>
</template>
<script>
import emoji from '../../utils/emo'
export default {
name: 'ly-emotion',
mounted() {
const name = this.$el.innerHTML
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(name)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
},
}
</script>
<style scoped>
.ly-emotion {
display: inline-block;
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<Emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</Emotion>
</div>
</div>
</div>
</template>
<script>
import emoji from '../../utils/emo'
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
name: 'emotionWords',
data() {
return {
list: emoji
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
line-height: 23px;
/deep/ {
img {
width: 24px;
// -webkit-user-select: none;
cursor: default;
pointer-events: none;
}
}
}
</style>
...@@ -130,7 +130,11 @@ export default { ...@@ -130,7 +130,11 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
tableTotal: { // tableTotal: {
// type: Number,
// default: 0
// },
tableScore: {
type: Number, type: Number,
default: 0 default: 0
}, },
...@@ -231,6 +235,7 @@ export default { ...@@ -231,6 +235,7 @@ export default {
}, },
// 多选 // 多选
handleSelect(val) { handleSelect(val) {
console.log(val)
this.mutiSelectArr[this.tableParams.mutiSelectName] = val this.mutiSelectArr[this.tableParams.mutiSelectName] = val
}, },
// 清空多选 // 清空多选
...@@ -259,9 +264,9 @@ export default { ...@@ -259,9 +264,9 @@ export default {
} }
this.getListApi(params) this.getListApi(params)
.then(res => { .then(res => {
console.log(res)
this.data = this.findVal(res, this.tableParams.listName) this.data = this.findVal(res, this.tableParams.listName)
this.total = this.findVal(res, this.pageConf.totalCount) this.total = this.findVal(res, this.pageConf.totalCount)
this.$emit('sendAlldata',res.data)
this.loading = false this.loading = false
}) })
.catch(() => { .catch(() => {
......
import Vue from 'vue' import Vue from 'vue'
import GLEditor from './GLEditor/index.vue'
// 注意 有些组件使用异步加载会有影响 // 注意 有些组件使用异步加载会有影响
Vue.component('d2-table', () => import('./d2-table/index.vue')) Vue.component('d2-table', () => import('./d2-table/index.vue'))
Vue.component('GLEditor', GLEditor)
export const nearlyAMonth = {
data() {
return {
defalutStartTime: '',
defalutEndTime: ''
}
},
created() {
let date = new Date()
let year = date.getFullYear()
let preYear = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
let aheadOfMonth = month == '1' ? '12' : month - 1
let preDays = this.mGetDate(year, aheadOfMonth)
if (aheadOfMonth == '12') {
preYear = preYear - 1
}
this.defalutEndTime = year + '-' + month + '-' + day
if (day > preDays) {
this.defalutStartTime = preYear + '-' + aheadOfMonth + '-' + preDays
} else {
this.defalutStartTime = preYear + '-' + aheadOfMonth + '-' + day
}
},
methods: {
mGetDate(year, month) {
let d = new Date(year, month, 0)
return d.getDate()
}
}
}
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
</div> </div>
<ul> <ul>
<li> <li>
<a href="../insurance/customer.html" target="_self"> <a href="../profitManagement/profitList/index.html" target="_self">
客户名单管理列表 客户名单管理列表11
</a> </a>
</li> </li>
<li> <li>
......
import App from './index' import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import Vue from 'vue'
base.getConfig().then(data => { base.getConfig().then(data => {
const { vue, config } = data const { vue, config } = data
Vue.prototype.otherUrl = config.axios.otherURL
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
base.render(App) base.render(App)
}) })
<template>
<el-form
size='small'
inline
ref='withdrawalForm'
:model='profitSearchForm'
label-width='120px'
class='demo-form-inline'
>
<el-form-item label='员工名称'>
<el-input
clearable
v-model='profitSearchForm.staffName'
placeholder='请输入员工名称'
></el-input>
</el-form-item>
<el-form-item label='员工手机号'>
<el-input
clearable
v-model='profitSearchForm.staffPhone'
placeholder='请输入员工手机号'
></el-input>
</el-form-item>
<el-form-item label='所属业务场景'>
<el-select v-model='profitSearchForm.businessScene' placeholder='所属业务场景'>
<el-option label='全部' value=''></el-option>
<el-option label='1.0 新车权益销售' value='0'></el-option>
<el-option label='1.1 次新车精品升级' value='1'></el-option>
<el-option label='1.2 次新车线上转化' value='2'></el-option>
<el-option label='1.3 存量用户众筹' value='3'></el-option>
</el-select>
</el-form-item>
<el-form-item label='所属商户:'>
<el-input
clearable
v-model='profitSearchForm.merchantName'
placeholder='请输入所属商户'
></el-input>
</el-form-item>
<el-form-item label='所属活动/产品:'>
<el-input
clearable
v-model='profitSearchForm.activityName'
placeholder='请输入所属活动/产品'
></el-input>
</el-form-item>
<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-input
clearable
v-model='profitSearchForm.missionName'
placeholder='请输入关联任务'
></el-input>
</el-form-item>
<el-form-item label='奖励时间'>
<el-date-picker
value-format='yyyy-MM-dd'
v-model='profitSearchForm.rewardTime'
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>
</el-form-item>
</el-form>
</template>
<script>
import { nearlyAMonth } from '@/mixin/nearlyAMonth'
export default {
name: 'ProfitSearch',
mixins:[nearlyAMonth],
data() {
return {
profitSearchForm: {
businessScene:'',
channel:''
},
}
},
methods: {
handleSearch() {
this.$emit('sendSearchForm', this.profitSearchForm)
},
reset() {
Object.keys(this.profitSearchForm).forEach((key) => {
this.profitSearchForm[key] = ''
})
this.$set(this.profitSearchForm, 'rewardTime', [this.defalutStartTime, this.defalutEndTime])
this.$nextTick(() => {
this.handleSearch()
})
}
},
created() {
this.$set(this.profitSearchForm, 'rewardTime', [this.defalutStartTime, this.defalutEndTime])
},
mounted() {
this.handleSearch()
}
}
</script>
<style scoped>
</style>
<template> <template>
<div>收益</div> <div style='margin: 16px'>
<ProfitSearch @sendSearchForm='getSearchForm' />
<el-button type='primary' size='small' @click='handleOutput'>导出</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'
>
<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>
</div>
<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>
</div>
</template> </template>
<script> <script>
export default {} import ProfitSearch from '@/views/profitManagement/profitList/cpns/ProfitSearch'
import { profitApi } from '@/api/profitManagement'
export default {
name: 'WithdrawalSearch',
components: {
ProfitSearch
},
data() {
return {
profitSearchForm:{},
totalScore: '',
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count'
},
getListApi: profitApi.searchProfitList,
profitTableParams: {
listName: 'data.data',
tableColumns: [
{
label: '员工名称',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '奖励积分值',
prop: 'rewardScore'
},
{
label: '关联任务',
prop: 'missionName'
},
{
label: '发放渠道',
prop: 'channel',
addHtml: 'channel'
},
{
label: '所属活动/产品',
prop: 'activityName'
},
{
label: '所属商户',
prop: 'merchantName'
},
{
label: '所属业务场景',
prop: 'businessScene',
addHtml:'businessScene'
},
{
label: '奖励时间',
prop: 'rewardTime'
}
]
}
}
},
methods: {
// 导出
handleOutput() {
let params = JSON.parse(JSON.stringify(this.profitSearchForm))
let pageConfig = {
pageSize:9999,pageNum:1
}
profitApi.exportProfitList({...params,...pageConfig}).then(res => {
if (res.code == 0) {
this.$Utils.exportFn(res.data)
} else {
this.$message({
type: 'error',
message: '导出失败!'
})
}
})
},
getSearchForm(val){
let params = JSON.parse(JSON.stringify(val))
if (params && params.rewardTime) {
params.rewardBeginTime = params.rewardTime[0]
params.rewardEndTime = params.rewardTime[1]
}
if(params.rewardTime && params.rewardTime.length) delete params.rewardTime
this.profitSearchForm = params
setTimeout(() =>{
this.$refs.profitTable.refreshTable(false,true)
},500)
},
getTotalScore(val){
let {totalScore} = val
this.totalScore = totalScore
}
},
}
</script> </script>
<style> <style scoped>
.cumulativeAward{
margin: 16px 0;
}
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
</style> </style>
import App from './index.vue' import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => { import Vue from 'vue'
base.getConfig().then((data) => {
const { vue, config } = data const { vue, config } = data
Vue.prototype.otherUrl = config.axios.otherURL
Vue.prototype.fileUploadURL = config.axios.fileUploadURL
Vue.prototype.businessURL = config.axios.businessURL
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
base.render(App) base.render(App)
}) })
<template>
<div>
<el-dialog
title="选择活动"
:visible.sync="activityDiaVisible"
width="1098px"
:before-close="handleClose"
>
<div class="activity-box">
<!-- <span>系统中已存在活动不可选择;</span>
<span v-if="isClone">复制功能,活动天数不一致的活动不可选择</span> -->
<div class="model-item-panel" v-if="activityData.length">
<div
class="model-item"
:class="{
checked: selectItem == item && item.taskStatus != 1,
abandon: item.taskStatus == 1,
}"
v-for="(item, index) in activityData"
:key="index"
@click="!item.taskStatus && handleSelectItem(item)"
>
<img class="model-item-img" :src="item.activityImg" alt="" />
<div class="model-item-title" :title="item.activityName">
{{ item.activityName }}
</div>
<div class="model-item-content">
开始时间:
{{ item.startTime }}
</div>
<div class="model-item-content">
结束时间:
{{ item.endTime }}
</div>
</div>
</div>
<div v-else v-loading="loading">
<div>暂无数据</div>
</div>
</div>
<div v-if="activityData.length">
<el-pagination
background
layout="sizes, total, prev, pager, next, jumper"
:page-sizes="[12, 24, 48]"
:page-size="pageParam.pageSize"
:total="pageParam.total"
:current-page="pageParam.currentPage"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="activityDiaVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmActivity">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import { taskApi } from '../../../../api/task'
export default {
name: 'activityDia',
data() {
return {
activityDiaVisible: false,
loading: false,
isClone: false,
taskDateNum: 0,
activityData: [],
selectItem: {},
pageParam: {
currentPage: 1,
pageSize: 12,
total: 0,
},
}
},
methods: {
init(merchantId, isClone, taskDateNum) {
this.activityDiaVisible = true
this.isClone = isClone
this.taskDateNum = taskDateNum
this.getActivityData(merchantId)
},
getActivityData(merchantId) {
let params = {
currentPage: 1,
pageSize: 12,
merchantId: merchantId,
activityStatuList: [1, 2],
}
taskApi.getActivityBypage(params).then((res) => {
this.activityData = res.data.data.list
this.pageParam.total = res.data.data.total
// 活动时间戳转化
this.activityData.map((item) => {
item.startTime = dayjs(item.startTime).format('YYYY-MM-DD')
item.endTime = dayjs(item.endTime).format('YYYY-MM-DD')
if (this.isClone) {
console.log(this.taskDateNum)
let activityDays = this.getDateByDays(item.startTime, item.endTime)
if (activityDays != this.taskDateNum) {
item.taskStatus = 1
}
}
})
console.log(this.activityData, 'this.activityData')
})
},
// 根据日期获取天数
getDateByDays(startDate, endDdate) {
let d1 = Date.parse(new Date(startDate))
let d2 = Date.parse(new Date(endDdate))
// 时间戳相减 / 天数
let day = parseInt((d2 - d1) / (1000 * 60 * 60 * 24)) + 1
return day
},
handleSelectItem(item) {
console.log(item)
this.selectItem = item
},
// 确认活动
confirmActivity() {
console.log(11)
if (!this.selectItem.id) {
this.$message({
message: '请选择活动',
type: 'warning',
})
return
}
this.$emit('selectActivity', this.selectItem)
this.handleClose()
},
// 关闭弹窗
handleClose() {
this.selectItem = {}
this.activityDiaVisible = false
},
handleSizeChange(val) {
this.pageParam.pageSize = val
this.getActivityData()
},
handleCurrentChange(val) {
this.pageParam.currentPage = val
this.getActivityData()
},
},
}
</script>
<style lang="scss" scoped>
.activity-box {
min-height: 200px;
}
.model-item-panel {
// display: grid;
// grid-template-columns: repeat(4, 25%);
// grid-row-gap: 10px;
// max-height: 38vh;
overflow: auto;
display: flex;
flex-wrap: wrap;
align-items: stretch;
flex-direction: row;
.model-item {
width: 248px;
margin-right: 16px;
margin-bottom: 16px;
position: relative;
height: 190px;
background: #f9f9f9;
border-radius: 4px;
padding: 14px 16px;
box-sizing: border-box;
&.checked {
border: 2px solid #5850ff;
}
&.abandon {
cursor: not-allowed;
}
&:nth-child(4n) {
margin-right: 0px;
}
&-title {
font-size: 12px;
font-weight: 400;
color: #333333;
line-height: 25px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-img {
width: 100%;
height: 100px;
}
&-content {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 16px;
height: 16px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.model-item-weight {
line-height: 20px;
height: 20px;
}
span {
color: #5850ff;
font-size: 20px;
}
}
&-contents {
line-height: 22px;
height: 22px;
}
}
}
</style>
import App from './index' import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => { base.getConfig().then(data => {
......
<template>
<div>
<div class='taskDetails' v-for='(item,index) in taskDetails' :key='index'>
<div class='leftContent'>
<p>{{ item.missonTypeName }}</p>
<p>{{ item.missionName }}</p>
<p>{{ item.missonDesc }}</p>
<template v-if='item.platformMerchantMissionMaterialResponseList && item.platformMerchantMissionMaterialResponseList.length'>
<div v-for='(sub,idx,) in item.platformMerchantMissionMaterialResponseList' :key='idx'>
<template v-if="sub.materialType == '1'">
<p v-html='tramWord(sub.materialContent)'></p>
</template>
<template v-if="sub.materialType == '2'">
<img class='displayImg' :src='sub.materialContent'>
</template>
<template v-if="sub.materialType == '3'">
<video class='displayImg' :src='sub.materialContent' />
</template>
<template v-if="sub.materialType == '4'">
<p class='content'>{{sub.materialContent}}</p>
</template>
</div>
</template>
<div class='taskAward'>
<div class='showInfoForm'>
<span v-if='item.rewardTypeName'>奖励模式:{{ item.rewardTypeName }}</span>
<span v-if='item.rewardCountName'>奖励次数:{{ item.rewardCountName }}</span>
<span v-if="item.rewardCountName == '重复累计'">
重复次数:{{ item.repeatCount == '-1' ? '无限制' : item.repeatCount }}
</span>
<span v-if='item.triggerValue'>触发值:{{ item.triggerValue }}</span>
<span v-if='item.rewardScore'>奖励积分值:{{ item.rewardScore }}</span>
</div>
</div>
</div>
<div v-if="item.missonType != '1'" class='copyLine' id='copy' v-on:click='copy(item.id)'>
复制任务提醒链接
</div>
</div>
</div>
</template>
<script>
import { taskManagementApi } from '@/api/taskManagement'
import emoji from '@/utils/emo'
export default {
name: 'TaskDetails',
props: {
taskDetails: {
type: Array,
default: []
}
},
data() {
return {}
},
methods: {
tramWord(val) {
let htm = val.replace(/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
return htm
},
async copy(id) {
await taskManagementApi.getStaffMissionLink({ missionId: id }).then(res => {
if (res.code == '0' && res.data) {
var input = document.createElement('input')
input.value = res.data
document.body.appendChild(input)
input.select()
document.execCommand('copy')
this.$message.success('复制成功!')
document.body.removeChild(input)
} else {
this.$message.error('复制失败!')
}
})
}
}
}
</script>
<style scoped>
.taskDetails {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #eee;
padding: 20px;
margin-bottom: 20px;
}
.leftContent{
width: 70%;
}
.content{
height: auto;
word-wrap: break-word;
word-break: break-all;
}
.taskAward {
display: flex;
justify-content: space-between;
}
.showInfoForm {
margin-top: 10px;
width: 700px;
}
.showInfoForm > span {
display: inline-block;
padding-bottom: 8px;
width: 50%;
}
.copyLine {
color: #409EFF;
cursor: pointer;
}
.displayImg{
width: 500px;
height: 300px;
}
</style>
<template>
<div class='taskInfo'>
<div v-for='(item,index) in taskInfoList' :key='index'>
<span> {{ item.name }}</span>
<span> {{ item.value }}</span>
</div>
</div>
</template>
<script>
export default {
name: 'TaskInfo',
props: {
taskInfo: {
type: Object,
defalut: {}
}
},
data() {
return {
taskInfoList: [
{
name: '业务场景:',
value: 'businessSceneName',
id:'businessSceneName'
},
{
name: '商户:',
value: 'merchantName',
id:'merchantName'
},
{
name: '活动/产品:',
value: 'activityName',
id:'activityName'
},
{
name: '任务指定人群:',
value: 'crowdName',
id:'crowdName'
},
{
name: '发放渠道:',
value: 'channelName',
id:'channelName'
}
]
}
},
watch: {
taskInfo:{
handler(newVal,oldVal){
if (!oldVal || newVal !== oldVal) {
this.taskInfoList.map(item => {
Object.keys(newVal).forEach(key => {
if (item.id == key) {
item.value = newVal[key]
}
})
})
}
},
immediate: true,
deep: true
},
}
}
</script>
<style scoped>
.taskInfo {
display: flex;
justify-content: space-between;
font-size: 14px;
}
</style>
<template>
<d2-table
class='my-row-height'
ref='Table'
:hasNum='true'
:tableParams='withdrawalTableParams'
:searchForm='taskTableSearchForm'
:getListApi='getListApi'
:pageConf='pageConf'
>
</d2-table>
</template>
<script>
import { taskManagementApi } from '@/api/taskManagement'
export default {
name: 'TaskTable',
props:{
taskTableSearchForm:{
type:Object,
default:{}
}
},
data() {
return {
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count'
},
getListApi: taskManagementApi.findStaffMissionPageList,
withdrawalTableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.data',
tableColumns: [
{
label: '员工名称',
prop: 'staffName'
},
{
label: '微信昵称',
prop: 'staffNickName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '部门',
prop: 'staffDepartName'
},
{
label: '任务状态',
prop: 'completeStatusName'
},
{
label: '已获得收益',
prop: 'gainScore'
}
]
}
}
}
}
</script>
<style scoped>
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
</style>
<template>
<div class='analyseTask'>
<TaskInfo v-if='hastaskInfo' :taskInfo='taskInfo'></TaskInfo>
<el-form class='taskForm' :inline='true' v-model='taskTime'>
<el-form-item label='任务时间:'>
<el-select v-model='taskTime.activityTime' placeholder='请选择任务时间' @change='changeactivityTime'>
<el-option v-for='(item,index) in taskSelect' :key='index' :label='item.activityTime'
:value='item.activityTime'></el-option>
</el-select>
</el-form-item>
<el-form-item label='具体任务:'>
<el-select v-model='taskTime.missionName' placeholder='请选择具体任务' @change='changeactivityTask'>
<el-option v-for='(item,index) in taskSelectItem' :key='index' :label='item.missionName'
:value='item.id'></el-option>
</el-select>
</el-form-item>
</el-form>
<TaskDetails v-if='hasTaskDetails' :taskDetails='taskDetails'></TaskDetails>
<TaskTable class='taskTable' ref='taskTable' :taskTableSearchForm='searchForm'></TaskTable>
<div class='footer'>
<el-button @click='backUp'>返回</el-button>
</div>
</div>
</template>
<script>
import TaskInfo from '@/views/task/analyseTask/cpns/TaskInfo'
import TaskDetails from '@/views/task/analyseTask/cpns/TaskDetails'
import TaskTable from '@/views/task/analyseTask/cpns/TaskTable'
import { taskManagementApi } from '@/api/taskManagement'
export default {
name: 'index',
components: {
TaskInfo,
TaskDetails,
TaskTable
},
data() {
return {
hastaskInfo: false,
hasTaskDetails:false,
searchForm: {},
taskInfo: {},
taskSelect: [],
taskSelectItem: [],
taskTime: {},
taskDetails: []
}
},
mounted() {
this.$root.eventBus.$on('params', params => {
let taskId = params.taskId
this.primaryInfo(taskId)
})
},
methods: {
async primaryInfo(id) {
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 }
this.hastaskInfo = Object.values(this.taskInfo).length > 0 ? 'true' : 'false'
this.taskSelect = copeWithRes
this.taskSelect.forEach(item => {
if (item.activityTime == '-1'){
item.activityTime = '完整周期'
}
})
this.taskSelectMap = JSON.parse(JSON.stringify(copeWithRes))
this.taskTime.activityTime = copeWithRes[0].activityTime
this.taskTime.missionName = copeWithResList[0].missionName
this.taskSelectItem = copeWithResList
let id = this.taskSelectItem[0].id
this.changeactivityTask(id)
})
},
changeactivityTime(val) {
this.taskSelectMap.forEach(item => {
if (item.activityTime == val) {
this.taskSelectItem = []
this.taskSelectItem.push(...item.platformMerchantMissionResponseList)
}
})
this.taskTime.missionName = this.taskSelectItem[0].missionName
let id = this.taskSelectItem[0].id
this.changeactivityTask(id)
},
changeactivityTask(val) {
let selectItem = this.taskSelectItem && this.taskSelectItem.filter(item => {
return item.id == val
})
this.taskDetails = selectItem
this.hasTaskDetails = this.taskDetails && this.taskDetails.length ? 'true' : 'false'
this.searchForm = { missionId: val }
this.$nextTick(() => {
this.$refs.taskTable.$refs.Table.refreshTable()
})
},
backUp() {
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'任务管理列表'
])
}
}
}
</script>
<style scoped>
.analyseTask {
padding: 20px;
}
.taskForm {
padding-top: 20px;
}
.footer {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
}
.taskTable{
margin-bottom: 50px;
}
</style>
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
<template>
<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>
</div>
</div>
</template>
<script>
export default {
name: 'BasicInfo',
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'},
]
}
},
watch: {
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]
}
})
})
}
},
immediate: true,
deep: true
}
}
}
</script>
<style scoped>
.headline{
font-weight: 600;
padding-bottom: 20px;
}
.basicInfoList{
font-size: 14px;
display: flex;
padding: 8px 0;
}
.infoName{
color: #999999;
width: 120px;
padding-right: 16px;
text-align: right;
}
</style>
<template>
<div class='taskPlan'>
<div class='headline'>任务计划</div>
<el-tabs v-model='activeName' type='card'>
<el-tab-pane v-for='(item,index) in taskPlanList' :key='index'
:label="item.activityTime =='-1'?'完整周期' : item.activityTime" :name='item.activityTime'>
<div class='taskInfo' v-for='(displayList,idx) in item.platformMerchantMissionResponseList' :key='idx'>
<p class='taskType'>{{ displayList.missonTypeName }}</p>
<p>{{ displayList.missionName }}</p>
<p>{{ displayList.missonDesc }}</p>
<template
v-if='displayList.platformMerchantMissionMaterialResponseList && displayList.platformMerchantMissionMaterialResponseList.length'>
<div v-for='(sub,idx,) in displayList.platformMerchantMissionMaterialResponseList' :key='idx'>
<template v-if="sub.materialType == '1'">
<p v-html='tramWord(sub.materialContent)'></p>
</template>
<template v-if="sub.materialType == '2'">
<img class='displayImg' :src='sub.materialContent'>
</template>
<template v-if="sub.materialType == '3'">
<video class='displayImg' :src='sub.materialContent' />
</template>
<template v-if="sub.materialType == '4'">
<p>{{ sub.materialContent }}</p>
</template>
</div>
</template>
<div class='showInfoForm'>
<span v-if='displayList.rewardTypeName'>奖励模式:{{ displayList.rewardTypeName }}</span>
<span v-if='displayList.rewardCountName'>奖励次数:{{ displayList.rewardCountName }}</span>
<span v-if="displayList.rewardCountName == '重复累计'">
重复次数:{{ displayList.repeatCount == '-1' ? '无限制' : displayList.repeatCount }}
</span>
<span v-if='displayList.triggerValue'>触发值:{{ displayList.triggerValue }}</span>
<span v-if='displayList.rewardScore'>奖励积分值:{{ displayList.rewardScore }}</span>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import emoji from '@/utils/emo'
export default {
name: 'taskPlan',
props: {
taskPlanList: {
type: Array,
default: []
}
},
data() {
return {
activeName: ''
}
},
watch: {
taskPlanList:{
handler(newVal,oldVal){
if (!oldVal || newVal !== oldVal) {
this.activeName = newVal && newVal[0].activityTime
this.taskPlanList = newVal
}
},
immediate: true,
deep: true
}
},
methods:{
tramWord(val) {
let htm = val.replace(/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
return htm
},
}
}
</script>
<style scoped>
.taskPlan{
margin-top: 20px;
}
.headline {
font-weight: 600;
padding-bottom: 20px;
}
.taskInfo {
border: 1px solid #E4E7ED;
padding-left: 20px;
padding-right: 20px;
margin-bottom: 16px;
}
.taskType {
font-weight: 600;
}
.displayImg {
width: 500px;
height: 300px
}
.showInfoForm {
margin-top: 10px;
width: 700px;
}
.showInfoForm > span {
display: inline-block;
padding-bottom: 8px;
width: 50%;
}
</style>
<template>
<div class='observeTask'>
<BasicInfo v-if='hasbasicInfo' :basicInfo='basicInfo'></BasicInfo>
<taskPlan class='taskPlan' v-if='hastaskPlanList' :taskPlanList='taskPlanList'/>
<div class='footer'>
<el-button @click='backUp'>返回</el-button>
</div>
</div>
</template>
<script>
import { taskManagementApi } from '@/api/taskManagement'
import BasicInfo from './cpns/BasicInfo'
import taskPlan from './cpns/taskPlan'
export default {
name: 'index',
components: {
BasicInfo,
taskPlan
},
data(){
return{
hasbasicInfo:false,
hastaskPlanList:false,
basicInfo:{},
taskPlanList:[]
}
},
methods: {
backUp() {
this.$root.to([
'任务中心',
'任务平台',
'任务管理',
'任务模板管理',
'任务管理列表'
])
},
primaryInfo(id) {
taskManagementApi.findMissionDeail({ id }).then(res => {
let { businessSceneName, merchantName, activityName, crowdName, channelName, remark } = res.data
this.basicInfo = { businessSceneName, merchantName, activityName, crowdName, channelName, remark }
this.hasbasicInfo = Object.values(this.basicInfo).length > 0 ? 'true' : 'false'
this.taskPlanList = res.data.platformMerchantMissionDateResponseList
this.hastaskPlanList = this.taskPlanList && this.taskPlanList.length ? 'true' : 'false'
})
}
},
mounted() {
this.$root.eventBus.$on('params', params => {
let taskId = params.taskId
this.primaryInfo(taskId)
})
},
}
</script>
<style scoped>
.observeTask {
padding: 20px;
}
.footer {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
}
.taskPlan{
margin-bottom: 50px;
}
</style>
<template>
<div>用户</div>
</template>
<script>
export default {}
</script>
<style>
</style>
<template>
<el-dialog title='提示' :visible.sync='dialogVisible' width='30%'>
<div v-html='textTooltip'></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>
</template>
<script>
import { withdrawalApi } from '@/api/withdrawalManagement'
export default {
name: 'WithdrawalDialog',
props: ['textTooltip', 'auditId'],
data() {
return {
dialogVisible: false
}
},
methods: {
async comfirmDialog() {
const params = {
...JSON.parse(JSON.stringify(
{ idList: this.auditId }
))
}
await withdrawalApi.batchWithdrawal(params).then(res => {
if (res.code == '0'){
this.$message.success('审核成功')
this.dialogVisible = false
}else{
this.$message.error('审核失败')
}
}).catch(err =>{
this.$message.error('审核失败')
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div style='margin: 16px'>
<el-form
size='small'
inline
ref='withdrawalForm'
:model='withdrawalSearchForm'
label-width='100px'
class='demo-form-inline'
>
<el-form-item label='员工名称'>
<el-input
clearable
v-model='withdrawalSearchForm.staffName'
placeholder='请输入员工名称'
></el-input>
</el-form-item>
<el-form-item label='员工手机号'>
<el-input
clearable
v-model='withdrawalSearchForm.staffPhone'
placeholder='请输入员工手机号'
></el-input>
</el-form-item>
<el-form-item label='状态'>
<el-select v-model='withdrawalSearchForm.status' 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-option label='到账失败' value='4'></el-option>
</el-select>
</el-form-item>
<el-form-item label='提现时间'>
<el-date-picker
value-format='yyyy-MM-dd'
v-model='withdrawalSearchForm.withdrawalTime'
type='daterange'
range-separator='至'
start-placeholder='开始日期'
end-placeholder='结束日期'>
</el-date-picker>
</el-form-item>
<el-form-item label='审核时间'>
<el-date-picker
value-format='yyyy-MM-dd'
v-model='withdrawalSearchForm.reviewTime'
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>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { nearlyAMonth } from '@/mixin/nearlyAMonth'
export default {
name: 'WithdrawalSearch',
mixins: [nearlyAMonth],
data() {
return {
withdrawalSearchForm: {
status:''
}
}
},
created() {
this.$set(this.withdrawalSearchForm, 'withdrawalTime', [this.defalutStartTime, this.defalutEndTime])
},
mounted() {
this.handleSearch()
},
methods: {
handleSearch() {
this.$emit('sendSearchForm', this.withdrawalSearchForm)
},
reset() {
Object.keys(this.withdrawalSearchForm).forEach((key) => {
this.withdrawalSearchForm[key] = ''
})
this.$set(this.withdrawalSearchForm, 'withdrawalTime', [this.defalutStartTime, this.defalutEndTime])
this.$nextTick(() => {
this.handleSearch()
})
}
}
}
</script>
<style scoped>
</style>
<template>
<d2-table
class='my-row-height'
ref='withdrawalTable'
:hasNum='true'
:tableParams='withdrawalTableParams'
:searchForm='searchForm'
:getListApi='getListApi'
:pageConf='pageConf'
@sendAlldata = 'getAmountCollection'
>
<div slot="status" slot-scope="scope">
<span v-if="scope.scope.status == '1'">待审核</span>
<span v-if="scope.scope.status == '2'">到账中</span>
<span v-if="scope.scope.status == '3'">已到账</span>
<span v-if="scope.scope.status == '4'">到账失败</span>
</div>
</d2-table>
</template>
<script>
import { withdrawalApi } from '@/api/withdrawalManagement'
export default {
name: 'WithdrawalTable',
props:{
searchForm:{
type:Object,
default:{}
}
},
data() {
return {
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count'
},
withdrawalTableParams: {
mutiSelectUniqueKey: 'id',
mutiSelectName: 'list',
listName: 'data.data',
tableColumns: [
{
label: '员工名称',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'staffPhone'
},
{
label: '积分值',
prop: 'withdrawalScore'
},
{
label: '提现金额(元)',
prop: 'withdrawalAmount'
},
{
label: '提现时间',
prop: 'withdrawalTime'
},
{
label: '微信昵称',
prop: 'wechatNickName'
},
{
label: '微信手机号',
prop: 'wechatPhone'
},
{
label: '微信openid',
prop: 'wechatOpenId'
},
{
label: '状态',
prop: 'status',
addHtml:'status'
},
{
label: '审核人',
prop: 'reviewer'
},
{
label: '审核时间',
prop: 'reviewTime'
},
{
label: '到账时间',
prop: 'successTime'
}
]
},
getListApi: withdrawalApi.withdrawalListApi,
}
},
methods:{
getAmountCollection(val){
let {receivedAmount,receivingAmount,reviewingAmount,totalAmount,failureAmount} =val
let amountCollection = {receivedAmount,receivingAmount,reviewingAmount,totalAmount,failureAmount}
this.$emit('sendCollection',amountCollection)
}
}
}
</script>
<style scoped>
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
</style>
<template> <template>
<div>收益</div> <div>
<WithdrawalSearch @sendSearchForm='getSearchForm' />
<div class='btnOptons'>
<el-button
size='small'
type='primary'
@click="handleDialog('check')"
>批量审核
</el-button
>
<!-- <el-button-->
<!-- size='small'-->
<!-- type='primary'-->
<!-- @click="handleDialog('transfer')"-->
<!-- >-->
<!-- 批量重新发起转账-->
<!-- </el-button-->
<!-- >-->
<el-button
size='small'
type='primary'
@click='handleOutput'
>导出
</el-button
>
</div>
<div class='account'>
<p>累计提现金额:{{ collectionCash.totalAmount }};</p>
<p>待审核:{{ collectionCash.reviewingAmount }};</p>
<p>到账中:{{ collectionCash.receivingAmount }};</p>
<p>已到账:{{ collectionCash.receivedAmount }};</p>
<p>到账失败:{{ collectionCash.failureAmount }}</p>
</div>
<WithdrawalTable ref='table' :searchForm='searchForm' @sendCollection='getCollection' />
<WithdrawalDialog :textTooltip='textTooltip' :auditId='auditId' ref='dialogRef' />
</div>
</template> </template>
<script> <script>
export default {} import { withdrawalApi } from '@/api/withdrawalManagement'
import WithdrawalSearch from './components/WithdrawalSearch'
import WithdrawalTable from './components/WithdrawalTable'
import WithdrawalDialog from './components/WithdrawalDialog'
import { profitApi } from '@/api/profitManagement'
export default {
components: {
WithdrawalSearch,
WithdrawalTable,
WithdrawalDialog
},
data() {
return {
textTooltip: '',
searchForm: {},
choiceStatus: [],
auditId: [],
collectionCash: {}
}
},
methods: {
getCollection(val) {
this.collectionCash = val
},
getSearchForm(val) {
let params = JSON.parse(JSON.stringify(val))
if (params && params.withdrawalTime) {
params.withdrawalBeginTime = params.withdrawalTime[0]
params.withdrawalEndTime = params.withdrawalTime[1]
}
if (params.withdrawalTime && params.withdrawalTime.length) delete params.withdrawalTime
if (params && params.reviewTime) {
params.reviewBeginTime = params.reviewTime[0]
params.reviewEndTime = params.reviewTime[1]
}
if (params.reviewTime && params.reviewTime.length) delete params.reviewTime
this.searchForm = params
setTimeout(() => {
this.$refs.table.$refs.withdrawalTable.refreshTable(true,true)
}, 500)
},
getSeletedData() {
this.choiceStatus = this.$refs.table.$children[0].mutiSelectArr.list &&
this.$refs.table.$children[0].mutiSelectArr.list.map(item => {
let { status, id, ...params } = item
return { status, id }
})
},
handleOutput() {
let params = JSON.parse(JSON.stringify(this.searchForm))
let pageConfig = {
pageSize: 9999, pageNum: 1
}
withdrawalApi.exportList({ ...params, ...pageConfig }).then(res => {
if (res.code == 0) {
this.$Utils.exportFn(res.data)
} else {
this.$message({
type: 'error',
message: '导出失败!'
})
}
})
},
vertify(selectType, status) {
this.getSeletedData()
let errMsg = selectType == 'check' ? '请选择待审核的提现记录!' : '请选择到账失败的提现记录'
if ((selectType && (this.choiceStatus && !this.choiceStatus.length)) || !(selectType && (this.choiceStatus && this.choiceStatus.every(item => item.status == status)))) {
this.$message({
type: 'error',
message: errMsg
})
return false
} else {
return true
}
},
handleDialog(type) {
let vertifycheck
if (type == 'check') {
vertifycheck = this.vertify('check', '1')
} else {
vertifycheck = this.vertify('transfer', '4')
}
if (vertifycheck) {
this.auditId = this.choiceStatus.map(item => item.id)
const checkText = `<p>审核通过, 系统将自动转账至员工的微信零钱中</p><p>是否确定审核?</p>`
const transferText = `<p>手动发起转账,系统将重新发起转账至员工的微信零钱中</p><p>是否确定发起?</p>`
this.textTooltip = type == 'check' ? checkText : transferText
this.$refs.dialogRef.dialogVisible = true
}
}
}
}
</script> </script>
<style scoped>
.addList {
width: 112px;
background: #1994f9;
border-radius: 2px;
margin-bottom: 16px;
}
<style> .el-icon-plus {
</style> padding-right: 5px;
}
.my-row-height >>> .el-table__body-wrapper .el-table__row {
height: 48px;
}
.btnOptons {
margin-bottom: 10px;
}
.account {
display: flex;
}
.account > p {
margin-right: 10px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!