Commit 23137f42 by 前端

Merge branch 'v3.21.0' into 'master'

V3.21.0

See merge request !20
2 parents e64f95c9 576abcb0
Showing 32 changed files with 2851 additions and 124 deletions
......@@ -1837,6 +1837,7 @@
"thread-loader": "^2.1.3",
"url-loader": "^2.2.0",
"vue-loader": "^15.9.2",
"vue-loader-v16": "npm:vue-loader@^16.1.0",
"vue-style-loader": "^4.1.2",
"webpack": "^4.0.0",
"webpack-bundle-analyzer": "^3.8.0",
......@@ -12673,6 +12674,75 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz",
......
import { http } from '@/main'
// const url = 'http://192.168.3.226:8593/rop-scrm-marketing/router'
const url = '/rop-scrm-marketing/router'
export default {
/**
* 分页查询调查问卷列表
*/
getQuestionnaireList (params) {
params.method = 'marketing.api.activityQuestionnaireForm.page'
return http({
url,
data: params
})
},
/**
* 分页查询用户-调查问卷列表
*/
getQuestionnaireDetailPage (params) {
params.method = 'marketing.api.activityQuestionnaireUserForm.page'
return http({
url,
data: params
})
},
/**
* 结束调查问卷
*/
closeQuestionnaire (params) {
params.method = 'marketing.api.activityQuestionnaireForm.close'
return http({
url,
data: params
})
},
/**
*导出调查问卷列表
*/
exportQuestionnaireList (params) {
params.method = 'marketing.api.activityQuestionnaireForm.export'
return http({
url,
data: params
})
},
/**导出用户调查问卷 */
exportUserQuestionnaireList(params) {
params.method = 'marketing.api.activityQuestionnaireUserForm.export'
return http({
url,
data: params
})
},
/**新增调查问卷 */
addQuestionnaire (params) {
params.method = 'marketing.api.activityQuestionnaireForm.add'
return http({
url,
data: params
})
},
/**
* 查询关联客户信息
*/
getUserInfoFieldList (params = {}) {
params.method = 'marketing.api.activityQuestionnaireUserInfoField.getAll'
return http({
url,
data: params
})
},
/**
*
*/
getQuestionnaireDetail (params = {}) {
params.method = 'marketing.api.activityQuestionnaireForm.detail'
return http({
url,
data: params
})
},
/**权益卡试用 */
getEquityActivityList (params) {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: '/rop-scrm-equity/router',
data: params
})
},
/**商城券 */
getMerchantCouponList (params) {
const data = {
method: 'scrm.api.coupon.list.merchant',
validType: 'valid',
directionalFlag: 1,
pageSize: 20,
discountTypes: [2, 3, 4],
status: 2,
...params
}
return http({
url: '/rop-scrm-coupon/router',
data
})
},
/**
* 查询门店红包活动列表
*/
getActivityRedEnvelopeList (params) {
params.method = 'marketing.api.activityRedEnvelope.merchant.list'
return http({
url,
data: params,
})
}
}
\ No newline at end of file
......@@ -22,8 +22,7 @@ export default {
getRedEnvelopeMerchantList (params) {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant'
params.pageSize = 999999
params.currentPage = 1
params.pageSize = 50
return http({
url: '/rop-scrm-carlife/router',
data: params
......@@ -69,7 +68,7 @@ export default {
},
/**
* /编辑活动文件校验上传文件接口
* /编辑活动文件校验上传文件接口
*/
updateCheckFile (params) {
......@@ -126,4 +125,63 @@ export default {
data: params
})
},
}
\ No newline at end of file
// 提现记录分页列表
getRedEnvelopeWithdraw (params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.page'
return http({
url,
data: params
})
},
exportRedEnvelopeWithdraw (params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.export'
return http({
url,
data: params
})
},
exportRedEnvelopeRecord (params) {
params.method = 'marketing.api.activityRedEnvelope.record.export'
return http({
url,
data: params
})
},
// 获取白名单列表
getWhiteListPage(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.page'
return http({
url,
data: params
})
},
// 校验红包活动白名单导入
checkImportWhiteList(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.checkImport'
return http({
url,
data: params
})
},
// 红包活动白名单导入
whiteListImport(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.import'
return http({
url,
data: params
})
},
whiteListDelete(params){
params.method = 'marketing.api.activityRedEnvelope.whiteList.delete'
return http({
url,
data: params
})
}
}
......@@ -7,6 +7,11 @@ html {
overflow: hidden;
background-color: #f4f5fa;
}
img{
width: 100%;
height: 100%;
vertical-align: top;
}
.el-message {
z-index: 3000 !important;
}
......
......@@ -93,6 +93,14 @@
</template>
<slot name="footer"></slot>
</el-form>
<GLDialog v-if="isImgVisible" bigTitle="查看" mode="big" :visible.sync="isImgVisible" :close-on-click-modal="false" @onOk="isImgVisible = false" @onCancel="isImgVisible = false">
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div>
</GLDialog>
</div>
</template>
<script>
......@@ -230,6 +238,7 @@ export default {
},
// 图片查看
handleImgLook(src, targetItem) {
console.log(src, targetItem)
this.isImgVisible = true
this.dialogObj = {
url: src,
......
<template>
<div>
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input
ref="input_from"
v-model="formData[keyObj.from]"
:disabled="disabled"
onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
placeholder=""
@input="handleInputChangeFrom"
></el-input>
</div>
<div class="center">
<span>至</span>
</div>
<div class="to">
<el-input
ref="input_to"
v-model="formData[keyObj.to]"
onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
:disabled="disabled"
placeholder=""
@input="handleInputChangeTo"
></el-input>
</div>
<div class="unit">
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InputNumberRange',
props: {
// 是否禁用
disabled: {
type: Boolean,
default: false
},
formData:{
type: Object,
default: ()=>{
return {}
}
},
keyObj:{
type: Object,
default: ()=>{
return {
from: 'a',
to: 'b'
}
}
},
},
data() {
return {
}
},
methods: {
// from输入框change事件
handleInputChangeFrom(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
// to输入框change事件
handleInputChangeTo(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
}
}
</script>
<style lang="scss" scoped>
.input-number-range {
background-color: #fff;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.flex {
display: flex;
flex-direction: row;
width: 100%;
justify-content: center;
align-items: center;
/deep/ .el-input .el-input__inner {
border: 0px;
margin: 0;
padding: 0 10px;
background-color: transparent;
}
.center {
margin-top: 1px;
color: #666;
}
.unit{
margin-right: 10px;
color: #666;
}
}
.is-disabled {
background-color: #eef0f6;
border-color: #e4e7ed;
color: #c0c4cc;
cursor: not-allowed;
}
</style>
......@@ -20,6 +20,7 @@ export const fetchConfig = function(common) {
// }
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config')
let params = { moduleName: 'outbound', mockUrl: 'https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
console.log(common.utils.getConfig(params))
return common.utils.getConfig(params)
}
export const config = {
......
export default {
data () {
return {
merchantObj: {
nothing: false,
data: [],
currentPage: 1,
name: '',
loading: false,
total: 0
}
}
},
mounted () {
},
methods: {
selectFocus () {
const { configForm } = this
if (!configForm.merchantId) {
this.merchantObj.data = []
this.merchantObj.name = ''
this.merchantObj.currentPage = 1
this.getMerchantList()
}
},
onReachBottom () {
const { total, currentPage } = this.merchantObj
if (Math.ceil(total / 50) > currentPage) {
this.merchantObj.currentPage += 1
this.getMerchantList()
} else this.merchantObj.nothing = true
},
remoteMethod (val) {
this.merchantObj.name = val
if (val) {
this.merchantObj.loading = true
this.configForm.merchantId = ''
this.merchantObj.nothing = false
this.merchantObj.data = []
this.merchantObj.currentPage = 1
this.getMerchantList(val)
}
},
async getMerchantList () {
const { currentPage, data, name } = this.merchantObj,
{ list, total } = await this.$apis.redenvelope.getRedEnvelopeMerchantList({
currentPage,
merchantName: name
})
this.merchantObj.total = total
list && list.map(e => {
data.push({
confId: e.merchantNo,
confName: e.merchantName,
})
})
this.merchantObj.data = data
this.merchantObj.loading = false
},
},
directives: {
'reachbottom': {
inserted (el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition = (this.scrollHeight - this.scrollTop) <= this.clientHeight
if (condition) binding.value()
})
}
}
},
}
\ No newline at end of file
import getMerchantListMixin from './getMerchantListMixin'
export {
getMerchantListMixin
}
\ No newline at end of file
import { Message } from 'element-ui'
let util = {}
util.cloneText = function(message) {
util.cloneText = function (message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
......@@ -9,7 +9,7 @@ util.cloneText = function(message) {
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function(sign = '-') {
util.getBeforeDate = function (sign = '-') {
let day = new Date()
let month = day.getMonth() + 1
let date = day.getDate()
......@@ -18,7 +18,7 @@ util.getBeforeDate = function(sign = '-') {
var s = day.getFullYear() + sign + month + sign + date
return s
}
util.getTimeFomat = function(time, sign = '-') {
util.getTimeFomat = function (time, sign = '-') {
let day = new Date(time)
let month = day.getMonth() + 1
let date = day.getDate()
......@@ -31,7 +31,7 @@ util.getTimeFomat = function(time, sign = '-') {
var s = day.getFullYear() + sign + month + sign + date + ' ' + hour + ':' + mm
return s
}
util.getBetweenDate = function(day, num, str = '-') {
util.getBetweenDate = function (day, num, str = '-') {
var today = new Date(day)
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * (num - 1)
......@@ -43,7 +43,7 @@ util.getBetweenDate = function(day, num, str = '-') {
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.getBeforeMonth = function(days) {
util.getBeforeMonth = function (days) {
let month = new Date().getMonth() + 1
let year = new Date().getFullYear()
let arr = new Array()
......@@ -58,7 +58,7 @@ util.getBeforeMonth = function(days) {
}
return arr
}
util.getPrevMonth = function() {
util.getPrevMonth = function () {
let month = new Date().getMonth()
let year = new Date().getFullYear()
if (month == 0) {
......@@ -67,7 +67,7 @@ util.getPrevMonth = function() {
}
return year + '年' + month + '月'
}
util.getCurrentMonthLast = function(date) {
util.getCurrentMonthLast = function (date) {
var endDate = new Date(date)
var month = endDate.getMonth()
var nextMonth = ++month
......@@ -76,23 +76,23 @@ util.getCurrentMonthLast = function(date) {
var dateString = new Date(nextMonthFirstDay - oneDay)
return dateString.toLocaleDateString().replace(new RegExp('/', 'g'), '-') //toLocaleDateString() 返回 如:2018/8/31
}
util.openUrl = function(url) {
util.openUrl = function (url) {
const link = document.createElement('a')
link.href = url
link.click()
}
util.openTab = function(url) {
util.openTab = function (url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.isShowBtn = function(value, permissions) {
util.isShowBtn = function (value, permissions) {
let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menuLevel(menu)
function menuLevel(item) {
function menuLevel (item) {
item.forEach(itm => {
if (value && itm.path == value) {
isShowStatus = true
......@@ -100,11 +100,11 @@ util.isShowBtn = function(value, permissions) {
if (
!value &&
itm.path ==
'/' +
location.pathname
.split('/')
.slice(-2)
.join('/') &&
'/' +
location.pathname
.split('/')
.slice(-2)
.join('/') &&
itm.meta &&
itm.meta.permissions.includes(permissions)
) {
......@@ -123,5 +123,24 @@ util.getArrayIsSubset = (arr2, arr1) => {
return arr1.includes(item)
})
}
util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
export default util
<template>
<div class="layout" v-loading="loading">
<div class="tabs flex">
<template v-for="(i,index) in tabs">
<template>
<div
:key="index"
:class="['tab flex',{'active':step == index + 1}]"
>
<template v-if="index != 0">
<div class="line"></div>
</template>
<template v-if="step == 2 && index == 0">
<div class="icon finish">
<span class="el-icon-check"></span>
</div>
</template>
<template v-else>
<div class="icon">{{index + 1}}</div>
</template>
{{i}}
</div>
</template>
</template>
</div>
<div class="content">
<step-one
v-show="step == 1"
ref="stepOne"
/>
<step-two
v-show="step == 2"
ref="stepTwo"
/>
</div>
<GLFooter class="footer">
<el-button
@click="handleCancel"
size="medium"
>{{step == 1?'取消':'上一步'}}</el-button>
<el-button
type="primary"
@click="handleConfirm"
size="medium"
>{{step == 1?'下一步':'提交'}}</el-button>
</GLFooter>
</div>
</template>
<script type='text/ecmascript-6'>
import StepOne from './components/StepOne/index.vue'
import StepTwo from './components/StepTwo/index.vue'
export default {
components: { StepOne, StepTwo },
name: '',
data () {
return {
parsedData: [],
step: 1,
tabs: ['基本信息', '配置内容'],
loading:false
}
},
mounted () {
},
methods: {
handleCancel () {
const { step } = this
step == 1 ? this.$router.go(-1) : this.step = 1
},
handleConfirm () {
const { step, $refs: {
stepOne,
stepTwo
} } = this
if (step == 1) {
stepOne.formRef().validate(valid => {
if (valid) this.step = 2
})
} else {
stepTwo.formRef().validate(async valid => {
if (valid) {
this.loading = true
try {
const params = {
...stepOne.configForm,
...stepTwo.configForm,
status: 1
}, res = await this.$apis.questionnaire.addQuestionnaire(params)
console.log(res)
if (res) {
this.$message({
message: '创建成功',
type: 'success'
})
this.$router.go(-1)
}
else throw '创建失败'
} catch (error) {
this.loading = false
if (error) this.$message.error(error)
}
}
})
}
}
}
}
</script>
<style scoped lang='scss'>
.layout {
position: absolute;
width: 100%;
height: calc(100vh - 48px);
top: 0;
left: 0;
.tabs {
height: 64px;
justify-content: center;
-webkit-user-select: none;
.tab {
font-size: 16px;
color: #000000a6;
line-height: 24px;
.icon {
width: 32px;
height: 32px;
border-radius: 100%;
border: 1px solid #c6c6c6;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
margin-right: 8px;
font-size: 14px;
color: #c6c6c6;
}
.finish {
border-color: #5850ff !important;
border-width: 2px;
}
.line {
width: 160px;
height: 1px;
background: #e5e5e5;
margin: 0 8px;
}
}
.active {
font-weight: 500;
color: #000000d9;
.icon {
background: #5850ff;
border-color: #5850ff;
color: #fff;
}
}
.el-icon-check {
color: #5850ff;
font-size: 18px;
font-weight: 700;
}
}
.content {
height: calc(100% - 136px);
background-color: #fff;
margin: 0 24px;
border-radius: 0 4px 4px 4px;
}
.footer {
padding: 16px 0;
}
}
</style>
\ No newline at end of file
<template>
<GLDialog
mode="big"
bigTitle="数据"
:hasFooter="false"
:before-close="handleClose"
:visible.sync="dataObj.show"
>
<el-button
type="default"
@click="handleExport"
>导出</el-button>
<GLTable
:tableData="tableData"
:noDataImg="url"
:tableParams="tableParams"
:tableTotal="tableTotal"
:pageConf="pageConf"
ref="listRef"
>
</GLTable>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: '',
props: {
dataObj: {
type: Object,
default: () => { }
}
},
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: []
},
tableData: [],
tableTotal: 0
}
},
mounted () {
},
watch: {
'dataObj' (n) {
if (n.id) {
this.setTableColumns(n.id)
this.refreshTable()
}
}
},
methods: {
async setTableColumns (id) {
const data = await this.$apis.questionnaire.getQuestionnaireDetail({ id }),
tableColumns = [
{
label: '手机号码',
prop: 'phone',
minWidth: 180
},
{
label: '微信昵称',
prop: 'wechatNickname',
minWidth: 180,
},
{
label: '答题时间',
prop: 'updatedTime',
minWidth: 180
},
]
data.questions.map(e => {
tableColumns.push({
label: e.text,
prop: `${e.num}_prop`,
minWidth: 180
})
})
this.tableParams.tableColumns = tableColumns
console.log(data)
},
async refreshTable (pageCon) {
pageCon && (this.pageConfig = pageCon)
const { id } = this.dataObj,
params = {
formId: id,
pageSize: 10,
pageNum: 1,
...this.pageConfig
}
const { data, count } = await this.$apis.questionnaire.getQuestionnaireDetailPage(params)
data.map(e => {
e.questions.map(i => {
e[`${i.num}_prop`] = i.answer
})
})
this.tableData = data || []
this.tableTotal = count || 0
},
handleClose () {
this.$emit('update:dataObj', {})
},
handleExport () {
const { id } = this.dataObj
this.$apis.questionnaire.exportUserQuestionnaireList({ formId: id, ...this.$refs.listRef.page }).then(res => {
exportFn(res)
})
}
}
}
</script>
<style scoped lang='scss'>
.el-button {
display: flex;
margin: 0 0 8px auto;
}
</style>
\ No newline at end of file
<template>
<div
@click="chooseRed(data.id)"
:class="['item',{'active':configForm.activityId == data.id}]"
>
<div class="icon">
<img src="@/assets/red-radio.png" />
</div>
<div class="title">{{ data.couponName }}</div>
<template v-if="[2,3,6].includes(data.effectiveType)">
<div class="type">有效期:
<template v-if="data.effectiveType == 2">
{{ data.effectiveStartTime ? data.effectiveStartTime.split(' ')[0] : '' }}~{{ data.effectiveEndTime ? data.effectiveEndTime.split(' ')[0] : '' }}
</template>
<template v-if="data.effectiveType == 3">
无限制
</template>
<template v-if="data.effectiveType == 6">
{{ data.effectiveDays }}天
</template>
</div>
</template>
<div class="time">使用途径: {{ data.useChannel == 1 ? '线上商品' : '到店核销' }}</div>
<div class="status flex">数量:<span>{{ data.residueAmount || 0 }}</span></div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
}
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (id) {
const {activityId} = this.configForm
if(activityId && activityId == id) id = ''
this.$emit('choose', id)
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 282px;
height: 132px;
background: #f9f9f9;
border-radius: 4px;
border: 2px solid #f9f9f9;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 14px;
color: #666666;
line-height: 20px;
position: relative;
user-select: none;
.icon {
display: none;
}
div {
margin-top: 8px;
span {
color: #5850ff;
font-size: 20px;
}
}
.title {
font-weight: 500;
font-size: 14px;
color: #333333;
padding-top: 4px;
}
&:hover {
opacity: 0.95;
}
}
.active {
border-color: #5850ff;
.icon {
display: block;
position: absolute;
right: 0;
bottom: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
}
}
</style>
\ No newline at end of file
<template>
<div
@click="chooseRed(data.equityClassId)"
:class="['item',{'active':configForm.activityId == data.equityClassId}]"
>
<div class="icon">
<img src="@/assets/red-radio.png" />
</div>
<div class="title">{{ data.equityName }}</div>
<div class="time">领取方式:免费领用</div>
<div class="status flex">试用天数:<span>{{data.freeDay }}天</span></div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
}
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (id) {
const {activityId} = this.configForm
if(activityId && activityId == id) id = ''
this.$emit('choose', id)
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 282px;
height: 132px;
background: #f9f9f9;
border-radius: 4px;
border: 2px solid #f9f9f9;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 14px;
color: #666666;
line-height: 20px;
position: relative;
user-select: none;
.icon {
display: none;
}
div {
margin-top: 8px;
}
.title {
font-size: 16px;
font-weight: 600;
color: #333;
line-height: 25px;
margin-bottom: 5px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.status {
margin-top: 28px;
span {
color: #5850ff;
font-size: 20px;
}
}
&:hover {
opacity: 0.95;
}
}
.active {
border-color: #5850ff;
.icon {
display: block;
position: absolute;
right: 0;
bottom: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
}
}
</style>
\ No newline at end of file
<template>
<div
@click="chooseRed(data.id)"
:class="['item',{'active':configForm.activityId == data.id}]"
>
<div class="icon">
<img src="@/assets/red-radio.png" />
</div>
<div class="title">{{ data.activityName }}</div>
<div class="type">活动形式:{{ {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[data.activityType] }}</div>
<div class="time">活动时间:{{dayjs(data.activityStartTime).format('YYYY/MM/DD')}} - {{dayjs(data.activityEndTime).format('YYYY/MM/DD')}}</div>
<div class="status">状态:{{ {0: '活动待进行', 1: '活动进行中', 2: '红包已用完', 3: '活动已结束' }[data.activityStatus] }}</div>
</div>
</template>
<script type='text/ecmascript-6'>
import * as dayjs from 'dayjs'
export default {
name: '',
props: {
data: {
type: Object,
default: () => { }
},
configForm: {
type: Object,
default: () => { }
}
},
data () {
return {
dayjs,
}
},
mounted () {
},
methods: {
chooseRed (id) {
const {activityId} = this.configForm
if(activityId && activityId == id) id = ''
this.$emit('choose', id)
}
}
}
</script>
<style scoped lang='scss'>
.item {
width: 282px;
height: 132px;
background: #f9f9f9;
border-radius: 4px;
border: 2px solid #f9f9f9;
box-sizing: border-box;
cursor: pointer;
padding: 0 16px;
font-size: 14px;
color: #666666;
line-height: 20px;
position: relative;
user-select: none;
.icon {
display: none;
}
div {
margin-top: 8px;
}
.title {
font-weight: 500;
font-size: 14px;
color: #333333;
padding-top: 4px;
}
&:hover {
opacity: 0.95;
}
}
.active {
border-color: #5850ff;
.icon {
display: block;
position: absolute;
right: 0;
bottom: 0;
width: 16px;
height: 16px;
background-color: #5850ff;
}
}
</style>
\ No newline at end of file
<template>
<el-scrollbar class="step-box">
<div class="step-content">
<el-form
ref="formRef"
label-width="154px"
:rules="rule"
:model="configForm"
>
<el-form-item
label="问卷标题:"
prop="title"
class="m-t-20"
>
<el-input
style="width:432px"
size="small"
v-model="configForm.title"
placeholder="请输入"
maxlength="8"
></el-input>
</el-form-item>
<el-form-item
label="问卷说明:"
prop="desc"
class="m-t-20"
>
<el-input
style="width:580px"
type="textarea"
rows="3"
v-model="configForm.desc"
placeholder="请输入"
maxlength="50"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label="题目配置:"
prop="questions"
class="m-t-20"
>
<div class="config-box">
<template v-for="(i,index) in questionsList">
<template>
<div
:key="index"
class="item"
>
<div :class="['label',{'required':i.required}]">
{{i.text}}:
</div>
<template v-if="i.type == 1">
<el-radio-group
v-model="i.itemValue"
class="radio"
>
<template v-for="(item,ind) in i.data">
<template>
<el-radio
:key="ind"
:label="item"
>{{item}}</el-radio>
</template>
</template>
</el-radio-group>
</template>
<template v-if="i.type == 2">
<el-checkbox-group v-model="i.itemValue">
<template v-for="(item,ind) in i.data">
<template>
<el-checkbox
:label="item"
:key="ind"
></el-checkbox>
</template>
</template>
</el-checkbox-group>
</template>
<template v-if="i.type == 3">
<el-input
style="width:580px"
v-model="i.itemValue"
placeholder="请输入"
type="textarea"
:autosize="{ minRows: 3,maxRows:3}"
:maxlength="i.data"
show-word-limit
></el-input>
</template>
<template v-if="i.type == 4">
<el-select
v-model="i.itemValue"
placeholder="请选择"
style="width:432px;"
>
<el-option
v-for="(item,ind) in i.data"
:key="ind"
:label="item"
:value="item"
></el-option>
</el-select>
</template>
<template v-if="i.type == 5">
<el-cascader
v-model="i.itemValue"
:options="i.data"
style="width:432px;"
></el-cascader>
</template>
</div>
</template>
</template>
<el-button
icon="el-icon-plus"
size="small"
@click="showEditQuestions = true"
>添加题目</el-button>
</div>
</el-form-item>
</el-form>
</div>
<edit-questions
:show.sync="showEditQuestions"
@addQuestions="addQuestions"
:userInfoFieldList="userInfoFieldList"
/>
</el-scrollbar>
</template>
<script type='text/ecmascript-6'>
import EditQuestions from './EditQuestions.vue'
export default {
name: 'StepTwo',
components: { EditQuestions },
data () {
return {
configForm: {
title: '',
desc: '',
questions: [],
},
rule: {
title: [{ required: true, message: '请输入问卷标题', trigger: 'change' }],
desc: [{ required: true, message: '请输入问卷说明', trigger: 'change' }],
questions: [{ required: true, message: '请添加题目', trigger: 'change' }],
},
showEditQuestions: false,
questionsList: [],
userInfoFieldList: []
}
},
mounted () {
this.getUserInfoFieldList()
},
methods: {
formRef () {
return this.$refs.formRef
},
async getUserInfoFieldList () {
const res = await this.$apis.questionnaire.getUserInfoFieldList()
this.userInfoFieldList = res || []
},
addQuestions (params) {
this.questionsList.push(params)
const obj = {
type: params.type,
required: params.required,
text: params.text,
userInfoField: params.userInfoField
}
if (params.type == 3) obj.maxLength = params.data
else obj.option = params.option
this.configForm.questions.push(obj)
this.formRef().validateField('questions')
}
}
}
</script>
<style scoped lang='scss'>
.step-box {
width: 100%;
height: 100%;
box-sizing: border-box;
/deep/.el-scrollbar__wrap {
&::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.el-form-item__content {
width: calc(100% - 154px);
}
}
.step-content {
padding-top: 32px;
}
.config-box {
width: 100%;
}
.item {
width: 870px;
background: #f9f9f9;
display: flex;
margin-bottom: 16px;
padding: 20px;
.label {
font-size: 14px;
color: #333333;
width: 154px;
display: flex;
justify-content: flex-end;
flex-shrink: 0;
}
/deep/.el-radio__label {
word-break: break-all;
white-space: break-spaces;
}
.required {
&::before {
content: '*';
color: #eb4e4e;
display: block;
margin: 2px 4px 0 0;
}
}
.radio {
line-height: 22px;
font-size: 40px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
type="default"
plain
@click="edit"
>新建问卷</el-button>
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">问卷列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<template
slot="qrcode"
slot-scope="scope"
>
<el-popover
placement="top"
trigger="click"
>
<img
class="img-plus"
:src="scope.scope.qrcode"
/>
<div
class="download-img "
@click="download(scope.scope.qrcode)"
>下载二维码</div>
<div
slot="reference"
class="qr"
>
<img :src="scope.scope.qrcode" />
</div>
</el-popover>
</template>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
<data-table :dataObj.sync="dataObj" />
<GLDialog
title="结束"
@onOk="overQiestion"
@onCancel="dialogVisible = false"
:visible.sync="dialogVisible"
mode="small"
>
<template #default>
<div class="over-box">
<div class="el-icon-warning"></div>
请确认是否结束该调查问卷?
<div class="tips">结束后,客户点击将提示:问卷活动已结束</div>
</div>
</template>
</GLDialog>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import DataTable from './components/DataTable/index.vue'
import { exportFn } from '@/common/constant'
import util from '@/utils/util'
export default {
name: 'Questionnaire',
components: { DataTable },
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
merchantName: '',
name: '',
},
searchFormData: [
{
label: '问卷名称',
name: 'name',
type: 'input',
maxlength: 100
},
{
label: '所属渠道',
name: 'merchantName',
type: 'input',
maxlength: 100
},
],
getListApi: this.$apis.questionnaire.getQuestionnaireList,
tableParams: {
listName: 'data',
tableOption: {
width: '110px'
},
tableColumns: [
{
label: '问卷名称',
prop: 'name',
minWidth: 100
},
{
label: '所属渠道',
minWidth: 100,
formatter: cell => `${cell.merchantId}/${cell.merchantName}`
},
{
label: '卡片标题',
prop: 'cardTitle',
minWidth: 100
},
{
label: '二维码',
minWidth: 100,
addHtml: 'qrcode'
},
]
},
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '数据',
attrs: {
type: 'text',
},
listeners: {
click: row => this.jumpDetail(row)
}
},
{
type: 'el-button',
name: '结束',
attrs: {
type: 'text',
},
listeners: {
click: row => {
this.dialogVisible = true
this.closeParams = row
}
},
condition: row => row.status != -1
},
],
dataObj: {},
dialogVisible: false,
closeParams: {}
}
},
mounted () {
},
methods: {
handleSearch () {
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
jumpDetail (row) {
this.dataObj = {
show: true,
...row
}
},
async overQiestion () {
const { id } = this.closeParams,
res = await this.$apis.questionnaire.closeQuestionnaire({ id })
if (res) {
this.dialogVisible = false
this.$message({
message: '操作成功',
type: 'success'
})
this.handleSearch()
} else this.$message.error('操作失败,请重试。')
},
handleExport () {
this.$apis.questionnaire.exportQuestionnaireList({ ...this.searchForm, ...this.$refs.listRef.page }).then(res => {
exportFn(res)
})
},
download (url) {
util.downloadIamge(url)
},
edit (row) {
this.$router.push({
path: '/questionnaire/add',
query: {
$title: row.id ? '编辑问卷' : '新建问卷'
}
})
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
.qr {
width: 36px;
height: 36px;
img {
width: 100%;
height: 100%;
vertical-align: top;
}
}
}
.img-plus {
width: 200px;
height: 200px;
}
/deep/.over-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
font-size: 16px;
color: #333333;
gap: 8px;
.el-icon-warning {
font-size: 48px;
color: #e6a23c;
}
.tips {
font-size: 14px;
color: #666666;
}
}
.download-img {
cursor: pointer;
margin-top: 10px;
font-size: 14px;
font-weight: 600;
color: #5850ff;
line-height: 20px;
text-align: center;
}
</style>
\ No newline at end of file
......@@ -41,13 +41,21 @@
placeholder="请选择"
:disabled="disabled"
filterable
remote
:remote-method="remoteMethod"
v-reachbottom="onReachBottom"
@focus="selectFocus"
:loading="loading"
>
<el-option
v-for="item in merchantList"
v-for="item in merchantObj.data"
:key="item.confId"
:label="item.confName"
:value="item.confId"
></el-option>
<template v-if="merchantObj.nothing">
<div class="nothing">到底了!</div>
</template>
</el-select>
</el-form-item>
<el-form-item
......@@ -140,8 +148,10 @@ export const afterRangePickerOptions = {
}
import commonFun from '../common/fun.js'
import * as dayjs from 'dayjs'
import { getMerchantListMixin } from '@/mixins'
export default {
mixins: [getMerchantListMixin],
name: '',
props: {
editObj: {
......@@ -196,13 +206,12 @@ export default {
}
],
},
merchantList: [],
fileName: '',
fileError: ''
fileError: '',
}
},
mounted () {
this.getMerchantList()
},
watch: {
'editObj' (n) {
......@@ -214,15 +223,20 @@ export default {
async getRedEnvelopeActivityDetail (id) {
try {
const { configForm } = this,
res = await this.$apis.redenvelope.getRedEnvelopeActivityDetail({ id })
res = await this.$apis.redenvelope.getRedEnvelopeActivityDetail({ id }),
merchantId = String(res.merchantId)
this.configForm = {
...configForm,
activityName: res.activityName,
activityType: res.activityType,
merchantId: String(res.merchantId),
merchantId,
activityTime: [dayjs(res.activityStartTime).toDate(), dayjs(res.activityEndTime).toDate()],
id
}
this.merchantObj.data = [{
confId: merchantId,
confName: res.merchantName
}]
this.disabled = true
this.configRules.exportUrl[0].required = false
console.log(res)
......@@ -230,34 +244,24 @@ export default {
this.$message.error(error)
}
},
async getMerchantList () {
const { list } = await this.$apis.redenvelope.getRedEnvelopeMerchantList({})
let merchantList = []
list && list.map(e => {
merchantList.push({
confId: e.merchantNo,
confName: e.merchantName,
})
})
this.merchantList = merchantList
},
handleClose () {
this.configForm = this.$options.data.call(this).configForm
this.disabled = false
this.fileError = ''
this.$refs.configRef.resetFields()
this.merchantObj.data = []
this.$emit('update:editObj', {})
},
handleConfirm () {
this.$refs.configRef.validate(async (valid) => {
if (valid) {
try {
const { configForm, merchantList } = this
const { configForm, merchantObj } = this
let params = this.$common.utils.deepClone(configForm),
targetName = params.id ? 'updateActivityRedEnvelope' : 'createActivityRedEnvelope'
params.activityStartTime = dayjs(params.activityTime[0]).format('YYYY-MM-DD')
params.activityEndTime = dayjs(params.activityTime[1]).format('YYYY-MM-DD')
params.merchantName = merchantList.find(e => e.confId == params.merchantId).confName
params.merchantName = merchantObj.data.find(e => e.confId == params.merchantId).confName
delete params.activityTime
console.log(JSON.parse(JSON.stringify(params)))
const res = await this.$apis.redenvelope[targetName](params)
......@@ -352,4 +356,13 @@ export default {
}
}
}
.nothing {
font-size: 14px;
padding: 0 20px;
white-space: nowrap;
color: #606266;
height: 34px;
line-height: 34px;
text-align: center;
}
</style>
\ No newline at end of file
......@@ -47,6 +47,10 @@
</div>
<link-detail :linkDetailObj.sync="linkDetailObj"></link-detail>
<edit :editObj.sync="editObj"></edit>
<transition name="fade">
<whiteList v-if="whiteListObj.show" :whiteListObj.sync="whiteListObj" :key="whiteListKey"></whiteList>
</transition>
</div>
</template>
......@@ -55,13 +59,16 @@ import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import linkDetail from './linkDetail.vue'
import edit from './edit.vue'
import { exportFn, activityStatusList } from '@/common/constant'
import whiteList from './whiteList'
import {exportFn, activityStatusList} from '@/common/constant'
export default {
components: { linkDetail, edit },
components: {linkDetail, edit, whiteList},
name: 'RedEnvelopeConfig',
data () {
return {
url,
whiteListKey: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
activityName: '',
......@@ -117,7 +124,7 @@ export default {
prop: 'questionCount',
minWidth: 100,
formatter: cell => {
return `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}`
return cell.activityStartTime ? `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')} `: ''
}
},
{
......@@ -170,10 +177,21 @@ export default {
listeners: {
click: row => this.jumpDetail(row)
}
},
{
type: 'el-button',
name: '白名单',
attrs: {
type: 'text',
},
listeners: {
click: row => this.whiteList(row)
}
}
],
editObj: {},
linkDetailObj: {},
whiteListObj: {},
tableSearchForm: {}
}
},
......@@ -204,6 +222,15 @@ export default {
id: e.id
}
},
whiteList(e) {
this.whiteListKey++; // 更改key值,强制Vue重新渲染whiteList组件
setTimeout(() => {
this.whiteListObj = {
show: true,
id: e.id
};
}, ); // 延迟100毫秒,您可以根据需要调整这个值
},
showEditFun (e) {
this.editObj = {
show: true,
......@@ -211,8 +238,11 @@ export default {
id: e.id || ''
}
},
handleExport (row) {
this.$apis.redenvelope.exportActivityRedEnvelope(this.getParams()).then(res => {
handleExport () {
this.$apis.redenvelope.exportActivityRedEnvelope({
...this.getParams(),
...this.$refs.listRef.page
}).then(res => {
exportFn(res)
})
},
......@@ -221,6 +251,13 @@ export default {
</script>
<style scoped lang='scss'>
.fade-enter-active, .fade-leave-active {
transition: opacity 0.1s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
opacity: 0;
}
.container {
height: 100%;
background-color: #fff;
......@@ -254,4 +291,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<GLDialog
mode="big"
class="muti link"
bigTitle="白名单"
:hasFooter="true"
:before-close="handleClose"
:visible.sync="whiteListObj.show"
@onOk="handleConfirm"
@onCancel="handleClose"
>
<div class="tabs">
<GLTabs
v-model="currentComponent"
:tabPaneList="tabPaneList"
@tab-click="handleClick"
></GLTabs>
</div>
<div class="component">
<component
:is="currentComponent"
:DetailObj="whiteListObj"
v-if="currentComponent"
ref="componentRef"
></component>
</div>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import WhiteListImport from "./whiteListImport";
import WhiteListSearch from "./whiteListSearch";
export default {
name: '',
components: {
WhiteListSearch,
WhiteListImport },
props: {
whiteListObj: {
type: Object,
default: () => { }
}
},
data () {
return {
currentComponent: 'WhiteListSearch',
tabPaneList: [
{
label: '白名单列表',
name: 'WhiteListSearch'
},
{
label: '导入白名单',
name: 'WhiteListImport'
},
],
}
},
mounted () {
// this.currentComponent = this.tabPaneList[0].name;
},
methods: {
handleConfirm(){
if (this.currentComponent == 'WhiteListSearch'){
this.$message.success('确定成功')
this.handleClose()
}
if (this.currentComponent == 'WhiteListImport'){
this.$refs.componentRef.handleConfirm()
}
},
handleClose () {
this.$emit('update:whiteListObj', {
id:this.whiteListObj.id,
show:false
})
this.currentComponent = this.tabPaneList[0].name;
},
}
}
</script>
<style scoped lang='scss'>
.link {
/deep/.el-form-item--small {
width: fit-content;
}
}
</style>
<template>
<div class="whiteListImport">
<el-form
ref="recordRef"
label-width="154px"
:rules="configRules"
:model="recordForm"
>
<el-form-item
label="导入白名单:"
prop="exportUrl"
class="m-t-20"
>
<div class="activity-link">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传文件
</el-button>
<input
type="file"
style="opacity: 0"
ref="file"
accept="*"
@change="uploadFile"
/>
</div>
<a
href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/白名单模板.xlsx"
target="_blank"
>下载导入模板</a>
<template v-if="recordForm.exportUrl">
<div class="file-info flex">
{{ fileName }}
<div class="el-icon-success"></div>
</div>
</template>
<template v-if="fileError">
<div class="file-info flex error">
<a
:href="fileError"
target="_blank"
>下载失败列表</a>
<div class="el-icon-error"></div>
</div>
</template>
</div>
</el-form-item>
</el-form>
</div>
</template>
<script>
import commonFun from "../common/fun";
export default {
name: "whiteListImport",
props: {
DetailObj: {
type: Object,
default: () => {
}
}
},
data() {
return {
recordForm: {
activityRedEnvelopeId: this.DetailObj.id,
exportUrl: ''
},
configRules: {
exportUrl: [
{
required: true,
message: '请导入白名单',
}
],
},
fileName: '',
fileError: ''
}
},
methods: {
handleClose() {
this.recordForm = this.$options.data.call(this).recordForm
this.fileError = ''
this.$refs.recordRef.resetFields()
this.$emit('update:show', false)
},
handleConfirm() {
this.$refs.recordRef.validate(async (valid) => {
if (valid) {
try {
const {recordForm} = this,
res = await this.$apis.redenvelope.whiteListImport(recordForm)
if (res) {
this.$message({
message: '导入成功',
type: 'success'
})
this.handleClose()
this.$parent.handleClose()
}
} catch (error) {
this.$message.error(error)
}
}
})
},
async uploadFile(e) {
try {
const {url, name} = await commonFun.uploadFile(e, this),
{activityRedEnvelopeId} = this.recordForm
this.$refs.file.value = ''
const res = await this.$apis.redenvelope.checkImportWhiteList({activityRedEnvelopeId, exportUrl: url})
if (res) {
if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl
this.$message.error('导入失败')
this.recordForm.exportUrl = ''
return
}
this.$message({
message: '导入成功',
type: 'success'
})
this.fileError = ''
this.recordForm.exportUrl = url
this.fileName = name
}
} catch (error) {
if (error) this.$message.error(error)
}
}
}
}
</script>
<style scoped lang='scss'>
.whiteListImport {
margin-top: 20px;
}
.activity-link {
display: flex;
width: 500px;
.upload-btn {
position: relative;
width: 110px;
height: 32px;
.el-button--small {
width: 100%;
height: 100%;
}
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
a,
.error {
margin-left: 8px;
color: #5850ff;
font-size: 14px;
cursor: pointer;
}
.file-info {
margin-left: 8px;
.el-icon-success {
margin-left: 8px;
color: #67c23a;
}
.el-icon-error {
margin-left: 8px;
color: red;
}
}
}
</style>
<template>
<div class="whiteListSearch">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<GLTable
ref="listRef"
:getListApi="getListApi"
:tableData="tableData"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
@refreshTable="refreshTable"
:tableTotal="tableTotal"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import * as dayjs from "dayjs";
export default {
name: "whiteListSearch",
props: {
DetailObj: {
type: Object,
default: () => {
}
}
},
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
activityRedEnvelopeId:this.DetailObj.id,
phone: ''
},
getListApi: this.$apis.redenvelope.getWhiteListPage,
searchFormData: [
{
label: '手机号码',
name: 'phone',
type: 'input',
maxlength: 11
}
],
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '手机号',
prop: 'phone',
minWidth: 100
},
{
label: '导入时间',
prop: 'importTime',
minWidth: 180
},
]
},
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
},
listeners: {
click: row => this.showDelFun(row)
}
}
],
tableData: [],
tableTotal: 0
}
},
methods: {
handleSearch() {
console.log(this.DetailObj)
this.$refs.listRef.refreshTable()
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
showDelFun({id}) {
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const params = {
id
}
this.$apis.redenvelope.whiteListDelete(params).then(res => {
if (res) {
this.$message.success('删除成功')
this.handleSearch()
}
})
})
.catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
.whiteListSearch {
margin-top: 20px;
}
</style>
<template>
<GLDialog
mode="mid"
class="muti"
title="导入记录"
:before-close="handleClose"
@onOk="handleConfirm"
@onCancel="handleClose"
:visible.sync="show"
:modal-append-to-body="true"
mode="mid"
class="muti"
title="导入记录"
:before-close="handleClose"
@onOk="handleConfirm"
@onCancel="handleClose"
:visible.sync="show"
:modal-append-to-body="true"
>
<el-form
ref="recordRef"
label-width="154px"
:rules="configRules"
:model="recordForm"
ref="recordRef"
label-width="154px"
:rules="configRules"
:model="recordForm"
>
<el-form-item
label="活动形式:"
prop="importType"
class="m-t-20"
label="活动形式:"
prop="importType"
class="m-t-20"
>
<el-radio-group
:size="size"
v-model="recordForm.importType"
:size="size"
v-model="recordForm.importType"
>
<el-radio :label="1">展示记录</el-radio>
<el-radio :label="2">抽奖记录</el-radio>
<el-radio :label="3">中奖记录</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="导入链接:"
prop="exportUrl"
class="m-t-20"
label="导入链接:"
prop="exportUrl"
class="m-t-20"
>
<div class="activity-link">
<div class="upload-btn">
......@@ -39,28 +41,26 @@
上传文件
</el-button>
<input
type="file"
style="opacity: 0"
ref="file"
accept="*"
@change="uploadFile"
type="file"
style="opacity: 0"
ref="file"
accept="*"
@change="uploadFile"
/>
</div>
<a
href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/中奖记录.xlsx"
target="_blank"
>下载中奖记录模板</a>
<!-- 下载模板-->
<a :href="downloadLink" target="_blank">{{ downloadText }}</a>
<template v-if="recordForm.exportUrl">
<div class="file-info flex">
{{fileName}}
{{ fileName }}
<div class="el-icon-success"></div>
</div>
</template>
<template v-if="fileError">
<div class="file-info flex error">
<a
:href="fileError"
target="_blank"
:href="fileError"
target="_blank"
>下载失败列表</a>
<div class="el-icon-error"></div>
</div>
......@@ -73,18 +73,19 @@
<script type='text/ecmascript-6'>
import commonFun from '../common/fun.js'
export default {
name: '',
props: {
show: Boolean,
},
data () {
data() {
return {
formItemWidth: 'width: 284px;',
size: 'small',
channelList: [],
recordForm: {
importType: 3,
importType: 1,
exportUrl: ''
},
configRules: {
......@@ -105,21 +106,44 @@ export default {
fileError: ''
}
},
mounted () {
mounted() {
},
watch:{
'recordForm.importType'(){
this.fileError = false
}
},
computed:{
downloadLink(){
const links = {
'1': 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/展示记录.xlsx',
'2': 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/抽奖记录.xlsx',
'3': 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/中奖记录.xlsx'
}
return links[this.recordForm.importType] || ''
},
downloadText(){
const typeMap = {
'1': '下载展示记录模板',
'2': '下载抽奖记录模板',
'3': '下载中奖记录模板'
}
return typeMap[this.recordForm.importType] || '下载模板';
}
},
methods: {
handleClose () {
handleClose() {
this.recordForm = this.$options.data.call(this).recordForm
this.fileError = ''
this.$refs.recordRef.resetFields()
this.$emit('update:show', false)
},
handleConfirm () {
handleConfirm() {
this.$refs.recordRef.validate(async (valid) => {
if (valid) {
try {
const { recordForm } = this,
res = await this.$apis.redenvelope.importRedEnvelopeRecord(recordForm)
const {recordForm} = this,
res = await this.$apis.redenvelope.importRedEnvelopeRecord(recordForm)
if (res) {
this.$message({
message: '导入成功',
......@@ -127,20 +151,19 @@ export default {
})
this.handleClose()
this.$parent.handleSearch()
}
else throw '导入成功'
} else throw '导入失败'
} catch (error) {
this.$message.error(error)
}
}
})
},
async uploadFile (e) {
async uploadFile(e) {
try {
const { url, name } = await commonFun.uploadFile(e, this),
{ importType } = this.recordForm
const {url, name} = await commonFun.uploadFile(e, this),
{importType} = this.recordForm
this.$refs.file.value = ''
const res = await this.$apis.redenvelope.checkImport({ importType, exportUrl: url })
const res = await this.$apis.redenvelope.checkImport({importType, exportUrl: url})
if (res) {
if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl
......@@ -169,14 +192,17 @@ export default {
.activity-link {
display: flex;
width: 500px;
.upload-btn {
position: relative;
width: 110px;
height: 32px;
.el-button--small {
width: 100%;
height: 100%;
}
input {
cursor: pointer;
position: absolute;
......@@ -187,6 +213,7 @@ export default {
font-size: 0px;
}
}
a,
.error {
margin-left: 8px;
......@@ -194,16 +221,25 @@ export default {
font-size: 14px;
cursor: pointer;
}
.file-info {
margin-left: 8px;
.el-icon-success {
margin-left: 8px;
color: #67c23a;
}
.el-icon-error {
margin-left: 8px;
color: red;
}
}
}
</style>
\ No newline at end of file
.muti {
/deep/ .el-form-item__content {
width: auto;
}
}
</style>
......@@ -2,41 +2,46 @@
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
type="default"
plain
@click="showImportRecord = true"
>导入记录</el-button>
type="default"
plain
@click="showImportRecord = true"
>导入记录
</el-button>
<el-button
@click="handleExport"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">红包记录列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
......@@ -49,13 +54,14 @@
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import importRecord from './importRecord.vue'
import {exportFn} from '@/common/constant'
export default {
name: 'RedEnvelopeConfig',
components: { importRecord },
data () {
components: {importRecord},
data() {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {
merchantName: '',
merchantId: '',
......@@ -86,6 +92,38 @@ export default {
type: 'input',
maxlength: 11
},
{
label: '展示时间',
name: 'showTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
},
{
label: '抽奖时间',
name: 'lotteryDrawTime',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.redenvelope.getRedEnvelopeRecordList,
tableParams: {
......@@ -123,7 +161,7 @@ export default {
minWidth: 100,
formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType]
return {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘'}[cell.activityType]
}
},
// {
......@@ -132,8 +170,18 @@ export default {
// minWidth: 100
// },
{
label: '展示时间',
prop: 'showTime',
minWidth: 150
},
{
label: '抽奖时间',
prop: 'lotteryDrawTime',
minWidth: 150
},
{
label: '奖品类型',
prop: 'thirdPrizeName',
prop: 'thirdPrizeType',
minWidth: 100
},
{
......@@ -143,19 +191,46 @@ export default {
},
]
},
showImportRecord: false
showImportRecord: false,
tableSearchForm: {}
}
},
mounted () {
mounted() {
},
methods: {
handleSearch () {
handleSearch() {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable()
},
handleReset () {
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
handleExport() {
const params = this.getParams()
this.$apis.redenvelope.exportRedEnvelopeRecord(params).then(res => {
exportFn(res)
})
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime');
this.updateParams(params, 'lotteryDrawTime', 'lotteryDrawTime', 'startLotteryDrawTime', 'endLotteryDrawTime');
return params
},
updateParams(params, paramKey, formKey, beginKey, endKey) {
if (params[paramKey]) {
params[beginKey] = this.searchForm[formKey][0];
params[endKey] = this.searchForm[formKey][1];
delete params[paramKey];
} else {
delete params[beginKey];
delete params[endKey];
}
// delete params[paramKey];
return params
}
}
}
</script>
......@@ -167,25 +242,31 @@ export default {
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
......@@ -194,4 +275,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
<template>
<GLDialog
mode="mid"
class="muti"
title="导入记录"
:before-close="handleClose"
@onOk="handleConfirm"
@onCancel="handleClose"
:visible.sync="show"
:modal-append-to-body="true"
>
<el-form
ref="recordRef"
label-width="154px"
:rules="configRules"
:model="recordForm"
>
<el-form-item
label="记录类型:"
prop="importType"
class="m-t-20"
>
<el-radio-group
:size="size"
v-model="recordForm.importType"
>
<el-radio :label="4">提现记录</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="导入链接:"
prop="exportUrl"
class="m-t-20"
>
<div class="activity-link">
<div class="upload-btn">
<el-button size="small">
<i class="el-icon-plus"></i>
上传文件
</el-button>
<input
type="file"
style="opacity: 0"
ref="file"
accept="*"
@change="uploadFile"
/>
</div>
<!-- 下载模板-->
<a :href="downloadLink" target="_blank">{{ downloadText }}</a>
<template v-if="recordForm.exportUrl">
<div class="file-info flex">
{{ fileName }}
<div class="el-icon-success"></div>
</div>
</template>
<template v-if="fileError">
<div class="file-info flex error">
<a
:href="fileError"
target="_blank"
>下载失败列表</a>
<div class="el-icon-error"></div>
</div>
</template>
</div>
</el-form-item>
</el-form>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import commonFun from '../common/fun.js'
export default {
name: '',
props: {
show: Boolean,
},
data() {
return {
formItemWidth: 'width: 284px;',
size: 'small',
channelList: [],
recordForm: {
importType: 4,
exportUrl: ''
},
configRules: {
importType: [
{
required: true,
trigger: 'change'
}
],
exportUrl: [
{
required: true,
message: '请导入链接',
}
],
},
fileName: '',
fileError: ''
}
},
mounted() {
},
computed:{
downloadLink(){
const links = {
'4': 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/提现记录.xlsx'
}
return links[this.recordForm.importType] || ''
},
downloadText(){
const typeMap = {
'4': '下载提现记录模板'
}
return typeMap[this.recordForm.importType] || '下载模板';
}
},
methods: {
handleClose() {
this.recordForm = this.$options.data.call(this).recordForm
this.fileError = ''
this.$refs.recordRef.resetFields()
this.$emit('update:show', false)
},
handleConfirm() {
this.$refs.recordRef.validate(async (valid) => {
if (valid) {
try {
const {recordForm} = this,
res = await this.$apis.redenvelope.importRedEnvelopeRecord(recordForm)
if (res) {
this.$message({
message: '导入成功',
type: 'success'
})
this.handleClose()
this.$parent.handleSearch()
} else throw '导入失败'
} catch (error) {
this.$message.error(error)
}
}
})
},
async uploadFile(e) {
try {
const {url, name} = await commonFun.uploadFile(e, this),
{importType} = this.recordForm
this.$refs.file.value = ''
const res = await this.$apis.redenvelope.checkImport({importType, exportUrl: url})
if (res) {
if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl
this.$message.error('红包记录导入失败')
this.recordForm.exportUrl = ''
return
}
this.$message({
message: '导入成功',
type: 'success'
})
this.fileError = ''
this.recordForm.exportUrl = url
this.fileName = name
}
} catch (error) {
console.log(error)
if (error) this.$message.error(error)
}
}
}
}
</script>
<style scoped lang='scss'>
.activity-link {
display: flex;
width: 500px;
.upload-btn {
position: relative;
width: 110px;
height: 32px;
.el-button--small {
width: 100%;
height: 100%;
}
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
a,
.error {
margin-left: 8px;
color: #5850ff;
font-size: 14px;
cursor: pointer;
}
.file-info {
margin-left: 8px;
.el-icon-success {
margin-left: 8px;
color: #67c23a;
}
.el-icon-error {
margin-left: 8px;
color: red;
}
}
}
.muti {
/deep/ .el-form-item__content {
width: auto;
}
}
</style>
<template>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
>
<div slot="thirdCashOutMoneySlot">
<inputNumRange :formData="searchForm"
:keyObj="{from: 'startThirdCashOutMoney', to:'endThirdCashOutMoney'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
type="default"
plain
@click="showImportRecord = true"
>导入记录
</el-button>
<el-button
@click="handleExport"
>导出
</el-button>
</div>
</div>
</div>
<div class="tabelList">
<div class="table-title">红包记录列表</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
<import-record :show.sync="showImportRecord"></import-record>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
import importRecord from './importRecord.vue'
import {exportFn} from '@/common/constant'
import inputNumRange from '@/components/inputNumRange'
export default {
name: 'RedEnvelopeWithdraw',
components: {importRecord, inputNumRange},
data() {
return {
url,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
searchForm: {},
searchFormData: [
{
label: '流水号',
name: 'thirdSerialNumber',
type: 'input',
maxlength: 100
},
{
label: '提现状态',
name: 'thirdCashOutStatus',
type: 'select',
optionLabel: 'optionLabel',
optionId: 'optionId',
optionList: [
{
optionLabel: '全部',
optionId: null
},
{
optionLabel: '提现成功',
optionId: '提现成功'
},
{
optionLabel: '提现失败',
optionId: '提现失败'
},
{
optionLabel: '补发成功',
optionId: '补发成功'
},
{
optionLabel: '补发失败',
optionId: '补发失败'
},
{
optionLabel: '发放中',
optionId: '发放中'
}
]
},
{
label: '微信昵称',
name: 'wechatName',
type: 'input',
maxlength: 100
},
{
label: '提现金额/元',
addHtml: 'thirdCashOutMoneySlot',
// type: 'input'
},
{
label: '提现时间',
name: 'thirdCashOutTime',
type: 'datePicker',
isClear: true,
valueFormat: 'yyyy-MM-dd',
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
}
],
getListApi: this.$apis.redenvelope.getRedEnvelopeWithdraw,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '手机号码',
prop: 'userPhone',
minWidth: 100
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
{
label: '流水号',
prop: 'thirdSerialNumber',
minWidth: 100
},
{
label: '提现金额/元',
prop: 'thirdCashOutMoney',
minWidth: 100,
// formatter: cell => `${cell.merchantId}/${cell.merchantName}`
},
{
label: '提现状态',
minWidth: 100,
prop: 'thirdCashOutStatus'
},
{
label: '提现时间',
minWidth: 150,
prop: 'thirdCashOutTime',
// formatter: cell => `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}`
},
{
label: '备注',
prop: 'thirdCashOutRemark',
minWidth: 100
},
]
},
showImportRecord: false,
tableSearchForm: {}
}
},
mounted() {
},
methods: {
handleSearch() {
this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable()
},
handleReset() {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
updateParams(params, paramKey, formKey, beginKey, endKey) {
if (params[paramKey]) {
params[beginKey] = this.searchForm[formKey][0];
params[endKey] = this.searchForm[formKey][1];
} else {
delete params[beginKey];
delete params[endKey];
}
delete params[paramKey];
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'thirdCashOutTime', 'thirdCashOutTime', 'startThirdCashOutTime', 'endThirdCashOutTime');
params.startThirdCashOutMoney = params.startThirdCashOutMoney ? Math.round(params.startThirdCashOutMoney * 100) : ''
params.endThirdCashOutMoney = params.endThirdCashOutMoney ? Math.round(params.endThirdCashOutMoney * 100) : '';
console.log(params)
return params
},
handleExport() {
const params = this.getParams()
this.$apis.redenvelope.exportRedEnvelopeWithdraw(params).then(res => {
exportFn(res)
})
},
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.table-title {
font-weight: 700;
font-size: 16px;
color: #333333;
padding-bottom: 18px;
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -23px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
}
</style>
......@@ -16,13 +16,16 @@
</div>
</template>
<script type='text/ecmascript-6'>
import RedEnvelopeConfig from './components/RedEnvelopeConfig/index.vue'
import RedEnvelopeRecord from './components/RedEnvelopeRecord/index.vue'
import RedEnvelopeWithdraw from "./components/RedEnvelopeWithdraw/index.vue";
export default {
components: {
RedEnvelopeConfig,
RedEnvelopeRecord,
RedEnvelopeWithdraw
},
name: '',
data () {
......@@ -37,6 +40,10 @@ export default {
label: '红包记录',
name: 'RedEnvelopeRecord'
},
{
label: '提现记录',
name: 'RedEnvelopeWithdraw'
},
]
}
},
......@@ -51,4 +58,4 @@ export default {
.tabs{
margin-bottom: 16px;
}
</style>
\ No newline at end of file
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!