Commit 2681b7dc by 前端

Merge branch 'v3.21.0' of http://192.168.3.233:8090/saas/outbound into v3.21.0_10

2 parents 57511f8a abf0260d
import { http } from '@/main'
const url = 'http://192.168.3.226:8593/rop-scrm-marketing/router'
// const url = '/rop-scrm-marketing/router'
// const url = 'http://192.168.3.226:8593/rop-scrm-marketing/router'
const url = '/rop-scrm-marketing/router'
export default {
/**
* 分页查询调查问卷列表
......@@ -34,6 +34,24 @@ export default {
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'
......@@ -52,6 +70,16 @@ export default {
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'
......@@ -66,7 +94,7 @@ export default {
method: 'scrm.api.coupon.list.merchant',
validType: 'valid',
directionalFlag: 1,
pageSize: 9,
pageSize: 20,
discountTypes: [2, 3, 4],
status: 2,
...params
......
......@@ -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,
......
......@@ -11,6 +11,8 @@ export default {
}
}
},
mounted () {
},
methods: {
selectFocus () {
const { configForm } = this
......@@ -61,7 +63,7 @@ export default {
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
const condition = (this.scrollHeight - this.scrollTop) <= this.clientHeight
if (condition) binding.value()
})
}
......
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">
<div class="layout" v-loading="loading">
<div class="tabs flex">
<template v-for="(i,index) in tabs">
<template>
......@@ -57,7 +57,8 @@ export default {
return {
parsedData: [],
step: 1,
tabs: ['基本信息', '配置内容']
tabs: ['基本信息', '配置内容'],
loading:false
}
},
mounted () {
......@@ -79,6 +80,7 @@ export default {
} else {
stepTwo.formRef().validate(async valid => {
if (valid) {
this.loading = true
try {
const params = {
...stepOne.configForm,
......@@ -95,6 +97,7 @@ export default {
}
else throw '创建失败'
} catch (error) {
this.loading = false
if (error) this.$message.error(error)
}
}
......
......@@ -6,12 +6,17 @@
: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>
......@@ -19,6 +24,7 @@
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: '',
props: {
......@@ -34,7 +40,26 @@ export default {
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
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',
......@@ -43,28 +68,24 @@ export default {
{
label: '微信昵称',
prop: 'wechatNickname',
minWidth: 100,
minWidth: 180,
},
{
label: '答题时间',
prop: 'updatedTime',
minWidth: 100
prop: 'createdTime',
minWidth: 180
},
]
},
tableData: [],
tableTotal: 0
}
},
mounted () {
},
watch: {
'dataObj' (n) {
if (n.id) this.refreshTable()
}
},
methods: {
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,
......@@ -75,20 +96,30 @@ export default {
...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'>
.link {
/deep/.el-form-item--small {
width: fit-content;
}
.el-button {
display: flex;
margin: 0 0 8px auto;
}
</style>
\ No newline at end of file
......@@ -30,7 +30,7 @@
:value="item.confId"
></el-option>
<template v-if="merchantObj.nothing">
<div class="nothing">到底了!</div>
<div class="select-nothing">到底了!</div>
</template>
</el-select>
</template>
......@@ -51,6 +51,7 @@
<div
class="activity-box"
:key="activityObj.key"
v-loading="activityObj.loading"
>
<template v-if="activityObj.flag">
<template v-if="activityObj.data.length">
......@@ -94,6 +95,7 @@ import { getMerchantListMixin } from '@/mixins'
import EquityItem from './EquityItem.vue'
import CouponItem from './CouponItem.vue'
import RedEnvelopeItem from './RedEnvelopeItem.vue'
// import CombiForm from '@/components/glsx-combi-form/index.vue'
export default {
name: 'StepOne',
mixins: [getMerchantListMixin],
......@@ -169,9 +171,11 @@ export default {
activityObj: {
data: [],
key: Date.now(),
flag: true,
flag: false,
pageNum: 1,
total: 0
total: 0,
nothing: false,
loading: false
},
merchantObj: {
nothing: false,
......@@ -186,27 +190,33 @@ export default {
watch: {
'configForm.merchantId' (n) {
this.configForm.merchantName = this.merchantObj.data.find(e => e.confId == n).confName
this.activityObj = this.$options.data.call(this).activityObj
this.getActivityList()
}
},
mounted () {
this.onReachBottom(this)
this.onActivityReachBottom(this)
this.activityObj.flag = true
},
methods: {
formRef () {
return this.$refs.formRef.$refs.formRef
},
onReachBottom (_this) {
onActivityReachBottom (_this) {
this.$refs.stepBox.wrap.addEventListener('scroll', function () {
const condition = this.scrollHeight - this.scrollTop - 20 <= this.clientHeight,
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight,
{ index } = _this.tabsObj,
{ total, pageNum } = _this.activityObj
if (condition) {
if (index == 2) {
if (Math.ceil(total / 9) > pageNum) {
if (Math.ceil(total / 20) > pageNum) {
_this.activityObj.pageNum += 1
_this.getActivityList()
} else _this.activityObj.nothing = true
} else {
_this.activityObj.nothing = true
_this.activityObj.key = Date.now()
}
console.log(_this.activityObj)
}
}
})
......@@ -214,13 +224,11 @@ export default {
changeActivity (index) {
const { merchantId } = this.configForm
if (this.tabsObj.index == index) return
if (!merchantId) return this.$message.error('请先选择所属渠道')
if (!merchantId) return this.$message.error('请选择所属渠道')
this.tabsObj.index = index
this.configForm.activityId = ''
this.configForm.activityType = ''
this.activityObj.pageNum = 1
this.activityObj.nothing = false
this.activityObj.flag = false
this.activityObj = this.$options.data.call(this).activityObj
this.getActivityList()
},
async getActivityList () {
......@@ -235,12 +243,16 @@ export default {
params = {
merchantId
}
if (index == 2) params.pageNum = pageNum
if (index == 2) {
this.activityObj.loading = true
params.pageNum = pageNum
}
const res = await this.$apis.questionnaire[targetApi](params)
let data = res
if (index == 2) {
data = [...this.activityObj.data, ...res.list]
this.activityObj.total = res.total
this.activityObj.loading = false
}
console.log(data)
this.activityObj.data = data
......@@ -274,7 +286,7 @@ export default {
}
/deep/.el-form-item__content {
width: fit-content;
max-width: calc(100% - 154px);
max-width: calc(100% - 174px);
}
/deep/.activity-img,
/deep/.muti-imgs {
......@@ -292,10 +304,11 @@ export default {
height: 100%;
}
}
/deep/.activity-img {
/deep/.activity-img ,/deep/.muti-imgs{
margin-bottom: 30px;
&::before {
content: '图片大小10M以内';
// content: '图片大小10M以内';
content: '\56fe\7247\5927\5c0f\0031\0030M\4ee5\5185';
display: block;
font-size: 14px;
color: #999999;
......@@ -334,6 +347,7 @@ export default {
gap: 16px;
flex-wrap: wrap;
margin-top: 16px;
.nothing {
margin-top: 24px;
font-weight: 500;
......@@ -355,4 +369,13 @@ export default {
}
}
}
.select-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
......@@ -106,6 +106,25 @@
prop="value"
class="m-t-20"
>
<template #label>
<span class="tips-block">
<span class="tips-label">选项</span>
<el-popover
placement="top"
:width="200"
trigger="hover"
>
<div>
{{configForm.type != 5?'各选项之间需回车换行':'最多支持3级,各级间使用“/”进行分隔。如: 广东省/深圳市/南山区'}}
</div>
<img
slot="reference"
class="tips-icon"
src="@/assets/icon-tip.png"
/>
</el-popover>:
</span>
</template>
<template v-if="configForm.type == 5">
<div class="btn-box">
<el-button
......@@ -165,12 +184,12 @@
<el-input-number
size="small"
:min="1"
:max="99999"
:max="500"
v-model="configForm.maxLength"
:step="1"
step-strictly
></el-input-number>
<span class="number-tips">最多支持大于0的整数</span>
<span class="number-tips">最多支持大于0的整数,数值范围1-500。</span>
</el-form-item>
</template>
</el-form>
......@@ -257,11 +276,16 @@ export default {
close () {
this.configForm = this.$options.data.call(this).configForm
this.$refs.configRef.resetFields()
this.errorList = []
this.$emit('update:show', false)
},
handleFileUpload (event) {
const [file] = event.target.files
if (file) {
if (this.configForm.cascaderValue.length) {
this.$refs.file.value = ''
return this.$message.error('已有数据,不能批量导入!')
}
const reader = new FileReader()
reader.onload = e => {
try {
......@@ -272,34 +296,48 @@ export default {
[firstSheetName] = workbook.SheetNames,
worksheet = workbook.Sheets[firstSheetName],
parsedData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }),
errorList = []
let str = ''
parsedData.map((i, rowNum) => {
let [row] = i
formattedData = []
parsedData.map(i => {
const [row] = i
if (row) {
const [one, two, three] = row.split('/')
if (!one || !two) errorList.push(`第${rowNum + 1}行第${one ? '2' : '1'}列数据异常,请重新输入`)
str += `${one || ''}/${two || ''}/${three || ''}${rowNum == parsedData.length - 1 ? '' : '\n'}`
const [one, two, three] = String(row).split('/')
formattedData.push(`${one || ''}/${two || ''}${three ? `/${three}` : ''}`)
}
})
this.configForm.cascaderValue = str
this.errorList = errorList
this.configForm.cascaderValue = formattedData.join('\n')
this.$refs.configRef.clearValidate('value')
} else throw '数据不能为空'
} catch (error) {
console.log(error)
this.$message.error(error || '读取文件时出错')
}
}
reader.readAsArrayBuffer(file)
}
},
checkData (data) {
const errorList = [],
list = data.split('\n'),
[, , hasThree] = list[0].split('/')
list.forEach((row, rowNum) => {
if (rowNum != 0) {
const [one, two] = String(row).split('/')
if (hasThree) {
if (!one || !two) errorList.push(`第${rowNum + 1}行第${(one ? '2' : '1')}列数据异常,请重新输入`)
}
else if (!one) errorList.push(`第${rowNum + 1}行第1列数据异常,请重新输入`)
}
})
if (errorList.length) this.errorList = [errorList[0]]
return errorList.length
},
delError (index) {
this.errorList.splice(index, 1)
},
inputBlur () {
const { type } = this.configForm,
value = this.configForm[inputKeyObject[type]]
let arr = value.split('\n'),
let arr = Array.from(new Set([...value.split('\n').map(e => e)])),
str = []
arr.map(i => {
if (i && ((type === 1 || type === 2) && str.length < 10 || (type === 4 || type === 5))) {
......@@ -313,48 +351,60 @@ export default {
{ userInfoFields } = this
this.$refs.configRef.validate(valid => {
if (valid) {
let option = this.configForm[inputKeyObject[type]],
data = type == 3 ? option : option.split('\n'),
itemValue = ''
if (type == 2 || type == 5) itemValue = []
if (type == 5) {
data.splice(0, 1)
option = data.join('\n')
data = this.transformData(data)
userInfoField = userInfoFields.join('/')
try {
this.errorList = []
let option = this.configForm[inputKeyObject[type]],
data = type == 3 ? option : option.split('\n'),
itemValue = ''
if (type != 3) {
if (type == 2 || type == 5) itemValue = []
if (type == 5) {
const title = data[0].split('/')
if (data.length < 2) throw '数据不能为空'
const [, two, three] = title
option = data.join('\n')
if (this.checkData(option)) throw ''
data.splice(0, 1)
data = this.transformData(data, three ? 3 : two ? 2 : 1)
userInfoField = userInfoFields.join('/')
}
// else data = Array.from(new Set([...data.map(e => e)]))
}
this.$emit('addQuestions', {
type,
required,
text,
userInfoField,
data,
option,
itemValue
})
this.close()
} catch (error) {
console.log(error)
if (error) this.$message.error(error)
}
this.$emit('addQuestions', {
type,
required,
text,
userInfoField,
data,
option,
itemValue
})
this.close()
}
})
},
transformData (data) {
transformData (data, childrenDepth) {
const result = []
data.forEach((item, index) => {
data.forEach(item => {
const levels = item.split('/')
let currentLevel = result
for (let i = 0; i < levels.length; i++) {
for (let i = 0; i < childrenDepth; i++) {
const label = levels[i],
value = label,
existingOption = currentLevel.find((option) => option.label === label)
if (existingOption) {
if (i === levels.length - 1) {
if (i === childrenDepth - 1) {
continue
}
currentLevel = existingOption.children
} else {
const newOption = { label, value, children: [] }
currentLevel.push(newOption)
if (i === levels.length - 1) {
if (label && value) currentLevel.push(newOption)
if (i === childrenDepth - 1) {
delete newOption.children
}
currentLevel = newOption.children
......@@ -388,6 +438,17 @@ export default {
border-left: none;
padding: 20px;
overflow-y: scroll;
.tips-label {
margin-right: 2px;
}
.tips-icon {
display: inline-block;
width: 14px;
height: 14px;
margin-right: 0px !important;
vertical-align: middle;
cursor: pointer;
}
.fit-width {
width: fit-content;
display: flex;
......
......@@ -170,9 +170,10 @@ export default {
text: params.text,
userInfoField: params.userInfoField
}
if(params.type == 3) obj.maxLength = params.data
if (params.type == 3) obj.maxLength = params.data
else obj.option = params.option
this.configForm.questions.push(obj)
this.formRef().validateField('questions')
}
}
}
......@@ -183,6 +184,7 @@ export default {
width: 100%;
height: 100%;
box-sizing: border-box;
/deep/.el-scrollbar__wrap {
&::-webkit-scrollbar {
width: 0;
......@@ -211,6 +213,11 @@ export default {
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 {
......
......@@ -18,6 +18,10 @@
path: '/questionnaire/add'
})"
>新建问卷</el-button>
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div>
</div>
</div>
......@@ -37,13 +41,17 @@
>
<el-popover
placement="top"
trigger="hover"
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"
>
......@@ -86,13 +94,15 @@
<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: 'RedEnvelopeConfig',
name: 'Questionnaire',
components: { DataTable },
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
merchantName: '',
name: '',
......@@ -200,6 +210,14 @@ export default {
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)
}
}
}
</script>
......@@ -269,4 +287,13 @@ export default {
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
......@@ -151,7 +151,7 @@ import * as dayjs from 'dayjs'
import { getMerchantListMixin } from '@/mixins'
export default {
mixins:[getMerchantListMixin],
mixins: [getMerchantListMixin],
name: '',
props: {
editObj: {
......@@ -233,7 +233,7 @@ export default {
activityTime: [dayjs(res.activityStartTime).toDate(), dayjs(res.activityEndTime).toDate()],
id
}
this.merchantList = [{
this.merchantObj.data = [{
confId: merchantId,
confName: res.merchantName
}]
......@@ -249,19 +249,19 @@ export default {
this.disabled = false
this.fileError = ''
this.$refs.configRef.resetFields()
this.merchantList = []
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)
......
......@@ -211,8 +211,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)
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!