Commit 5e5ca3c8 by 王志慧

Merge branch 'v3.24.0_wzh' into v3.24.0

2 parents 023ff59d 9e212c6f
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"bignumber.js": "^9.1.1",
"china-area-data": "^5.0.1", "china-area-data": "^5.0.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
......
import { http } from '@/main' import { http } from '@/main'
const url = '/rop-scrm-marketing/router' const url = '/rop-scrm-marketing/router'
export default { export default {
/**获取红包配置列表 */ /**获取红包配置列表 */
getRedEnvelopeConfigList (params) { getRedEnvelopeConfigList(params) {
params.method = 'marketing.api.activityRedEnvelope.page' params.method = 'marketing.api.activityRedEnvelope.page'
return http({ return http({
url, url,
...@@ -11,7 +10,7 @@ export default { ...@@ -11,7 +10,7 @@ export default {
}) })
}, },
/**获取红包活动列表 */ /**获取红包活动列表 */
getRedEnvelopeActivityList (params) { getRedEnvelopeActivityList(params) {
params.method = 'marketing.api.activityRedEnvelope.merchant.list' params.method = 'marketing.api.activityRedEnvelope.merchant.list'
return http({ return http({
url, url,
...@@ -20,7 +19,7 @@ export default { ...@@ -20,7 +19,7 @@ export default {
}, },
/**获取所属渠道列表 */ /**获取所属渠道列表 */
getRedEnvelopeMerchantList (params) { getRedEnvelopeMerchantList(params) {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant' params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant'
params.pageSize = params.pageSize || 50 params.pageSize = params.pageSize || 50
return http({ return http({
...@@ -28,9 +27,26 @@ export default { ...@@ -28,9 +27,26 @@ export default {
data: params data: params
}) })
}, },
/*获取模板 */
getRedEnvelopeTemplateList(params) {
params.method = 'marketing.api.self.red.envelope.template.page'
params.pageSize = params.pageSize || 10000
return http({
url,
data: params
})
},
//获取优惠券
getCouponList(params) {
params.method = 'scrm.api.coupon.equity.list.merchant'
params.pageSize = params.pageSize || 1000
return http({
url: '/rop-scrm-coupon/router',
data: params
})
},
/**查询红包活动详情 */ /**查询红包活动详情 */
getRedEnvelopeActivityDetail (params) { getRedEnvelopeActivityDetail(params) {
params.method = 'marketing.api.activityRedEnvelope.findOne' params.method = 'marketing.api.activityRedEnvelope.findOne'
return http({ return http({
url, url,
...@@ -39,7 +55,7 @@ export default { ...@@ -39,7 +55,7 @@ export default {
}, },
/** 新建红包活动接口 */ /** 新建红包活动接口 */
createActivityRedEnvelope (params) { createActivityRedEnvelope(params) {
params.method = 'marketing.api.activityRedEnvelope.create' params.method = 'marketing.api.activityRedEnvelope.create'
return http({ return http({
url, url,
...@@ -48,7 +64,7 @@ export default { ...@@ -48,7 +64,7 @@ export default {
}, },
/** 更新红包活动 */ /** 更新红包活动 */
updateActivityRedEnvelope (params) { updateActivityRedEnvelope(params) {
params.method = 'marketing.api.activityRedEnvelope.update' params.method = 'marketing.api.activityRedEnvelope.update'
return http({ return http({
url, url,
...@@ -59,7 +75,7 @@ export default { ...@@ -59,7 +75,7 @@ export default {
* /新建活动文件校验上传文件接口 * /新建活动文件校验上传文件接口
*/ */
createCheckFile (params) { createCheckFile(params) {
params.method = 'marketing.api.activityRedEnvelope.createCheckFile' params.method = 'marketing.api.activityRedEnvelope.createCheckFile'
return http({ return http({
url, url,
...@@ -71,7 +87,7 @@ export default { ...@@ -71,7 +87,7 @@ export default {
* /编辑活动文件校验上传文件接口 * /编辑活动文件校验上传文件接口
*/ */
updateCheckFile (params) { updateCheckFile(params) {
params.method = 'marketing.api.activityRedEnvelope.updateCheckFile' params.method = 'marketing.api.activityRedEnvelope.updateCheckFile'
return http({ return http({
url, url,
...@@ -80,7 +96,7 @@ export default { ...@@ -80,7 +96,7 @@ export default {
}, },
/** 红包配置列表导出 */ /** 红包配置列表导出 */
exportActivityRedEnvelope (params) { exportActivityRedEnvelope(params) {
params.method = 'marketing.api.activityRedEnvelope.export' params.method = 'marketing.api.activityRedEnvelope.export'
return http({ return http({
url, url,
...@@ -89,7 +105,7 @@ export default { ...@@ -89,7 +105,7 @@ export default {
}, },
/** 查询红包链接详情 */ /** 查询红包链接详情 */
getActivityRedEnvelopeLinkDetailPage (params) { getActivityRedEnvelopeLinkDetailPage(params) {
params.method = 'marketing.api.activityRedEnvelope.linkDetailPage' params.method = 'marketing.api.activityRedEnvelope.linkDetailPage'
return http({ return http({
url, url,
...@@ -97,10 +113,9 @@ export default { ...@@ -97,10 +113,9 @@ export default {
}) })
}, },
/**获取红包记录列表 */ /**获取红包记录列表 */
getRedEnvelopeRecordList (params) { getRedEnvelopeRecordList(params) {
params.method = 'marketing.api.activityRedEnvelope.record.page' params.method = 'marketing.api.activityRedEnvelope.record.page'
return http({ return http({
url, url,
...@@ -110,7 +125,7 @@ export default { ...@@ -110,7 +125,7 @@ export default {
/** /**
* /校验中奖记录导入 * /校验中奖记录导入
*/ */
checkImport (params) { checkImport(params) {
params.method = 'marketing.api.activityRedEnvelope.winningRecord.checkImport' params.method = 'marketing.api.activityRedEnvelope.winningRecord.checkImport'
return http({ return http({
url, url,
...@@ -118,7 +133,7 @@ export default { ...@@ -118,7 +133,7 @@ export default {
}) })
}, },
/** 导入中奖记录 */ /** 导入中奖记录 */
importRedEnvelopeRecord (params) { importRedEnvelopeRecord(params) {
params.method = 'marketing.api.activityRedEnvelope.winningRecord.import' params.method = 'marketing.api.activityRedEnvelope.winningRecord.import'
return http({ return http({
url, url,
...@@ -128,7 +143,7 @@ export default { ...@@ -128,7 +143,7 @@ export default {
// 提现记录分页列表 // 提现记录分页列表
getRedEnvelopeWithdraw (params) { getRedEnvelopeWithdraw(params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.page' params.method = 'marketing.api.activityRedEnvelope.cash.out.record.page'
return http({ return http({
url, url,
...@@ -136,14 +151,14 @@ export default { ...@@ -136,14 +151,14 @@ export default {
}) })
}, },
exportRedEnvelopeWithdraw (params) { exportRedEnvelopeWithdraw(params) {
params.method = 'marketing.api.activityRedEnvelope.cash.out.record.export' params.method = 'marketing.api.activityRedEnvelope.cash.out.record.export'
return http({ return http({
url, url,
data: params data: params
}) })
}, },
exportRedEnvelopeRecord (params) { exportRedEnvelopeRecord(params) {
params.method = 'marketing.api.activityRedEnvelope.record.export' params.method = 'marketing.api.activityRedEnvelope.record.export'
return http({ return http({
url, url,
...@@ -152,7 +167,7 @@ export default { ...@@ -152,7 +167,7 @@ export default {
}, },
// 获取白名单列表 // 获取白名单列表
getWhiteListPage(params){ getWhiteListPage(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.page' params.method = 'marketing.api.activityRedEnvelope.whiteList.page'
return http({ return http({
url, url,
...@@ -160,7 +175,7 @@ export default { ...@@ -160,7 +175,7 @@ export default {
}) })
}, },
// 校验红包活动白名单导入 // 校验红包活动白名单导入
checkImportWhiteList(params){ checkImportWhiteList(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.checkImport' params.method = 'marketing.api.activityRedEnvelope.whiteList.checkImport'
return http({ return http({
url, url,
...@@ -168,7 +183,7 @@ export default { ...@@ -168,7 +183,7 @@ export default {
}) })
}, },
// 红包活动白名单导入 // 红包活动白名单导入
whiteListImport(params){ whiteListImport(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.import' params.method = 'marketing.api.activityRedEnvelope.whiteList.import'
return http({ return http({
url, url,
...@@ -176,7 +191,7 @@ export default { ...@@ -176,7 +191,7 @@ export default {
}) })
}, },
whiteListDelete(params){ whiteListDelete(params) {
params.method = 'marketing.api.activityRedEnvelope.whiteList.delete' params.method = 'marketing.api.activityRedEnvelope.whiteList.delete'
return http({ return http({
url, url,
...@@ -185,7 +200,7 @@ export default { ...@@ -185,7 +200,7 @@ export default {
}, },
// 展示记录列表 // 展示记录列表
displayListApi(params){ displayListApi(params) {
params.method = 'marketing.api.activityRedEnvelope.show.record.page' params.method = 'marketing.api.activityRedEnvelope.show.record.page'
return http({ return http({
url, url,
...@@ -194,7 +209,7 @@ export default { ...@@ -194,7 +209,7 @@ export default {
}, },
// 展示记录导出 // 展示记录导出
displayExportApi(params){ displayExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.show.record.export' params.method = 'marketing.api.activityRedEnvelope.show.record.export'
return http({ return http({
url, url,
...@@ -202,7 +217,7 @@ export default { ...@@ -202,7 +217,7 @@ export default {
}) })
}, },
// 抽奖记录列表 // 抽奖记录列表
drawListApi(params){ drawListApi(params) {
params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.page' params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.page'
return http({ return http({
url, url,
...@@ -211,7 +226,7 @@ export default { ...@@ -211,7 +226,7 @@ export default {
}, },
// 导出红包抽奖记录 // 导出红包抽奖记录
drawExportApi(params){ drawExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.export' params.method = 'marketing.api.activityRedEnvelope.lottery.draw.record.export'
return http({ return http({
url, url,
...@@ -219,7 +234,7 @@ export default { ...@@ -219,7 +234,7 @@ export default {
}) })
}, },
// 中奖记录列表 // 中奖记录列表
winningListApi(params){ winningListApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.record.page' params.method = 'marketing.api.activityRedEnvelope.winning.record.page'
return http({ return http({
url, url,
...@@ -227,7 +242,7 @@ export default { ...@@ -227,7 +242,7 @@ export default {
}) })
}, },
// 导出中奖记录列表 // 导出中奖记录列表
winningExportApi(params){ winningExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.record.export' params.method = 'marketing.api.activityRedEnvelope.winning.record.export'
return http({ return http({
url, url,
...@@ -235,7 +250,7 @@ export default { ...@@ -235,7 +250,7 @@ export default {
}) })
}, },
// 实物奖品核销列表 // 实物奖品核销列表
winningGoodsApi(params){ winningGoodsApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.page' params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.page'
return http({ return http({
url, url,
...@@ -243,7 +258,7 @@ export default { ...@@ -243,7 +258,7 @@ export default {
}) })
}, },
// 实物奖品核销导出 // 实物奖品核销导出
winningGoodsExportApi(params){ winningGoodsExportApi(params) {
params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.export' params.method = 'marketing.api.activityRedEnvelope.winning.goods.record.export'
return http({ return http({
url, url,
...@@ -298,4 +313,3 @@ export default { ...@@ -298,4 +313,3 @@ export default {
}) })
} }
} }
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则 // 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
function limitPrice (newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) { function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
/* eslint-disable */ /* eslint-disable */
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, priceReg: /^\d[\d\.]*$/,
...@@ -76,14 +76,15 @@ const statusList = [ ...@@ -76,14 +76,15 @@ const statusList = [
} }
] ]
//会员订单类型字典 //会员订单类型字典
const orderTypesList = [{ const orderTypesList = [
{
confId: 1, confId: 1,
confName: '套餐' confName: '套餐'
}, },
{ {
confId: 2, confId: 2,
confName: '会员卡' confName: '会员卡'
} }
] ]
const orderStatusList = [ const orderStatusList = [
// 2: '待收货', // 2: '待收货',
...@@ -110,45 +111,48 @@ const orderStatusList = [ ...@@ -110,45 +111,48 @@ const orderStatusList = [
{ {
confId: 6, confId: 6,
confName: '已退款' confName: '已退款'
}, }
] ]
const serviceStatusList = [{ const serviceStatusList = [
{
confId: 1, confId: 1,
confName: '未生效' confName: '未生效'
}, },
{ {
confId: 2, confId: 2,
confName: '生效中' confName: '生效中'
}, },
{ {
confId: 3, confId: 3,
confName: '已失效' confName: '已失效'
} }
] ]
const memberTypeList = [{ const memberTypeList = [
{
confId: 1, confId: 1,
confName: '正式会员' confName: '正式会员'
}, },
{ {
confId: 2, confId: 2,
confName: '试用会员' confName: '试用会员'
} }
] ]
const stateList = [{ const stateList = [
{
confId: 0, confId: 0,
confName: '待上架' confName: '待上架'
}, },
{ {
confId: 1, confId: 1,
confName: '在售中' confName: '在售中'
}, },
{ {
confId: 2, confId: 2,
confName: '已下架' confName: '已下架'
}, }
] ]
function getExplorer () { function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase() var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) { if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
...@@ -173,7 +177,7 @@ function getExplorer () { ...@@ -173,7 +177,7 @@ function getExplorer () {
return browserType return browserType
} }
function exportFn (url) { function exportFn(url) {
let browserType = getExplorer() let browserType = getExplorer()
if (browserType == 'QQ') { if (browserType == 'QQ') {
window.open(url) window.open(url)
...@@ -200,7 +204,7 @@ const transformData = (data, childrenDepth) => { ...@@ -200,7 +204,7 @@ const transformData = (data, childrenDepth) => {
for (let i = 0; i < childrenDepth; i++) { for (let i = 0; i < childrenDepth; i++) {
const label = levels[i], const label = levels[i],
value = label, value = label,
existingOption = currentLevel && currentLevel.find((option) => option.label === label) existingOption = currentLevel && currentLevel.find(option => option.label === label)
if (existingOption) { if (existingOption) {
if (i === childrenDepth - 1) continue if (i === childrenDepth - 1) continue
if (existingOption.children) currentLevel = existingOption.children if (existingOption.children) currentLevel = existingOption.children
...@@ -217,7 +221,7 @@ const transformData = (data, childrenDepth) => { ...@@ -217,7 +221,7 @@ const transformData = (data, childrenDepth) => {
}) })
return result return result
} }
const checkSpace = (rule, value, callback,target ) => { const checkSpace = (rule, value, callback, target) => {
const { field, message } = rule const { field, message } = rule
if (!value) callback(new Error(message)) if (!value) callback(new Error(message))
else if (!value.trim()) callback(new Error(rule.message)) else if (!value.trim()) callback(new Error(rule.message))
...@@ -226,20 +230,11 @@ const checkSpace = (rule, value, callback,target ) => { ...@@ -226,20 +230,11 @@ const checkSpace = (rule, value, callback,target ) => {
callback() callback()
} }
} }
export {
limitPrice,
orderManageStatusList,
orderSourceList,
deliveryTypeList,
statusList,
serviceStatusList,
memberTypeList,
stateList,
orderTypesList,
orderStatusList,
exportFn,
getExplorer,
activityStatusList,
transformData,
checkSpace
}
\ No newline at end of file \ No newline at end of file
const awardType = [
{ confId: 0, confName: '红包' },
{ confId: 1, confName: '实物' },
{ confId: 2, confName: '优惠券' },
{ confId: 3, confName: '谢谢惠顾' }
]
export { awardType,limitPrice, orderManageStatusList, orderSourceList, deliveryTypeList, statusList, serviceStatusList, memberTypeList, stateList, orderTypesList, orderStatusList, exportFn, getExplorer, activityStatusList, transformData, checkSpace }
<template>
<div class="add-wrap">
<div class="container gl-form-page">
<el-form ref="configRef" label-width="154px" :rules="configRules" :model="configForm">
<el-form-item label="活动名称:" prop="activityName" class="m-t-20">
<el-input :size="size" v-model="configForm.activityName" placeholder="请输入" maxlength="25" :disabled="disabled"></el-input>
</el-form-item>
<el-form-item label="所属渠道:" prop="merchantId" class="m-t-20">
<el-select :size="size" v-model="configForm.merchantId" placeholder="请选择" :disabled="disabled" filterable remote :remote-method="remoteMethod" v-reachbottom="onReachBottom" @focus="selectFocus" :loading="loading">
<el-option 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 label="活动时间:" prop="activityTime" class="m-t-20">
<el-date-picker :size="size" v-model="configForm.activityTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="afterRangePickerOptions"></el-date-picker>
</el-form-item>
<el-form-item label="活动形式:" prop="activityType" class="m-t-20">
<el-radio-group :size="size" v-model="configForm.activityType" style="width: 400px" :disabled="disabled">
<el-radio :label="0">随机红包</el-radio>
<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">
<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="configForm.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>
<GLFooter>
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">提交</el-button>
</GLFooter>
</div>
</template>
<script type='text/ecmascript-6'>
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
import commonFun from '../common/fun.js'
import * as dayjs from 'dayjs'
import { getMerchantListMixin } from '@/mixins'
export default {
mixins: [getMerchantListMixin],
name: '',
props: {
editObj: {
type: Object,
default: () => {}
}
},
data() {
return {
id: this.$route.query.id,
afterRangePickerOptions,
disabled: false,
configForm: {
activityName: '',
merchantId: '',
activityTime: '',
activityType: 0,
exportUrl: ''
},
configRules: {
activityName: [
{
required: true,
message: '请输入活动名称',
trigger: 'blur'
}
],
merchantId: [
{
required: true,
message: '请选择所属渠道',
trigger: 'blur'
}
],
activityTime: [
{
required: true,
message: '请输入活动时间',
trigger: 'blur'
}
],
activityType: [
{
required: true
}
],
exportUrl: [
{
required: true,
message: '请导入链接'
}
]
},
fileName: '',
fileError: ''
}
},
created() {
if (this.id) this.getRedEnvelopeActivityDetail()
},
methods: {
async getRedEnvelopeActivityDetail() {
let { id } = this
try {
const { configForm } = this,
res = await this.$apis.redenvelope.getRedEnvelopeActivityDetail({ id }),
merchantId = String(res.merchantId)
this.configForm = {
...configForm,
activityName: res.activityName,
activityType: res.activityType,
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
} catch (error) {
this.$message.error(error)
}
},
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', {})
this.$router.push('/redEnvelope/index')
},
handleConfirm() {
this.$refs.configRef.validate(async valid => {
if (valid) {
try {
const { configForm, merchantObj } = this
let params = this.$common.utils.deepClone(configForm),
targetName = params.id ? 'updateActivityRedEnvelope' : 'createActivityRedEnvelope'
params.sourceType = 1
params.activityStartTime = dayjs(params.activityTime[0]).format('YYYY-MM-DD')
params.activityEndTime = dayjs(params.activityTime[1]).format('YYYY-MM-DD')
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)
if (res) {
this.$message({
message: params.id ? '编辑成功' : '创建成功',
type: 'success'
})
this.handleClose()
} else throw params.id ? '编辑失败' : '创建失败'
} catch (error) {
this.$message.error(error)
}
}
})
},
async uploadFile(e) {
const { id } = this.configForm,
target = id ? 'updateCheckFile' : 'createCheckFile'
try {
const { url, name } = await commonFun.uploadFile(e, this),
params = { exportUrl: url }
if (id) params.id = id
this.$refs.file.value = ''
const res = await this.$apis.redenvelope[target](params)
if (res) {
if (res.totalCount == 0 || res.failCount > 0) {
this.fileError = res.errorUrl
this.$message.error('红包链接导入失败')
this.configForm.exportUrl = ''
return
}
this.$message({
message: '导入成功',
type: 'success'
})
this.fileError = ''
this.configForm.exportUrl = url
this.fileName = name
}
} catch (error) {
console.log(error)
if (error) this.$message.error(error)
this.$refs.file.value = ''
}
}
}
}
</script>
<style scoped lang='scss'>
.container {
padding: 32px 20px;
background: #ffffff;
border-radius: 0 4px 4px 4px;
margin: 16px;
}
.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;
}
}
}
.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 \ No newline at end of file
<template>
<div>
<div class="tabs">
<GLTabs v-model="currentComponent" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<component :is="currentComponent" ref="componentRef"></component>
</div>
</div>
</template>
<script>
export default {
components: {
FreeInnovate: () => import('./FreeAdd.vue'),
OffshoreProcurement: () => import('./OffAdd.vue')
},
data() {
return {
currentComponent: '',
sourceType: this.$route.query.sourceType,
tabPaneList: [
{
label: '自研红包',
name: 'FreeInnovate'
},
{
label: '外采红包',
name: 'OffshoreProcurement'
}
]
}
},
created() {
this.currentComponent = this.sourceType == 1 ? 'OffshoreProcurement' : 'FreeInnovate'
},
methods: {
handleClick() {}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="container"> <div class="container">
<div class="sticky"> <div class="sticky">
<GLCombiForm <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns"> <div class="sticky-btns">
<div class="btns"> <div class="btns">
<el-button <el-button type="default" plain @click="showEditFun">新建</el-button>
type="default" <el-button type="default" @click="handleExport">导出</el-button>
plain
@click="showEditFun"
>新建</el-button>
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
</div> </div>
</div> </div>
<div class="tabelList"> <div class="tabelList">
<div class="table-title">红包配置列表</div> <div class="table-title">红包配置列表</div>
<GLTable <GLTable ref="listRef" :getListApi="getListApi" :searchForm="tableSearchForm" :noDataImg="url" :tableParams="tableParams" :pageConf="pageConf">
ref="listRef" <span slot="auth-button" slot-scope="scope">
:getListApi="getListApi" <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
: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> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -50,7 +22,6 @@ ...@@ -50,7 +22,6 @@
<transition name="fade"> <transition name="fade">
<whiteList v-if="whiteListObj.show" :whiteListObj.sync="whiteListObj" :key="whiteListKey"></whiteList> <whiteList v-if="whiteListObj.show" :whiteListObj.sync="whiteListObj" :key="whiteListKey"></whiteList>
</transition> </transition>
</div> </div>
</template> </template>
...@@ -60,12 +31,12 @@ import * as dayjs from 'dayjs' ...@@ -60,12 +31,12 @@ import * as dayjs from 'dayjs'
import linkDetail from './linkDetail.vue' import linkDetail from './linkDetail.vue'
import edit from './edit.vue' import edit from './edit.vue'
import whiteList from './whiteList' import whiteList from './whiteList'
import {exportFn, activityStatusList} from '@/common/constant' import { exportFn, activityStatusList } from '@/common/constant'
export default { export default {
components: {linkDetail, edit, whiteList}, components: { linkDetail, edit, whiteList },
name: 'RedEnvelopeConfig', name: 'RedEnvelopeConfig',
data () { data() {
return { return {
url, url,
whiteListKey: 0, whiteListKey: 0,
...@@ -110,11 +81,11 @@ export default { ...@@ -110,11 +81,11 @@ export default {
optionList: [ optionList: [
{ text: '全部', id: '' }, { text: '全部', id: '' },
{ text: '外采', id: '1' }, { text: '外采', id: '1' },
{ text: '自研', id: '0' }, { text: '自研', id: '0' }
], ],
optionId: 'id', optionId: 'id',
optionLabel: 'text' optionLabel: 'text'
}, }
], ],
getListApi: this.$apis.redenvelope.getRedEnvelopeConfigList, getListApi: this.$apis.redenvelope.getRedEnvelopeConfigList,
tableParams: { tableParams: {
...@@ -136,14 +107,14 @@ export default { ...@@ -136,14 +107,14 @@ export default {
prop: 'questionCount', prop: 'questionCount',
minWidth: 100, minWidth: 100,
formatter: cell => { formatter: cell => {
return cell.activityStartTime ? `${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')} ` : ''
} }
}, },
{ {
label: '创建类型', label: '创建类型',
minWidth: 100, minWidth: 100,
formatter:cell => { formatter: cell => {
return {'0':'自研','1':'外采'}[cell.createdSource] return { 0: '自研', 1: '外采' }[cell.createdSource]
} }
}, },
{ {
...@@ -155,13 +126,11 @@ export default { ...@@ -155,13 +126,11 @@ export default {
label: '红包链接总数', label: '红包链接总数',
prop: 'amount', prop: 'amount',
minWidth: 150 minWidth: 150
}, },
{ {
label: '已用总数', label: '已用总数',
prop: 'usedAmount', prop: 'usedAmount',
minWidth: 100 minWidth: 100
}, },
{ {
label: '可用总数', label: '可用总数',
...@@ -172,7 +141,7 @@ export default { ...@@ -172,7 +141,7 @@ export default {
label: '状态', label: '状态',
prop: 'activityStatusStr', prop: 'activityStatusStr',
minWidth: 100 minWidth: 100
}, }
] ]
}, },
// 表格按钮 // 表格按钮
...@@ -181,7 +150,7 @@ export default { ...@@ -181,7 +150,7 @@ export default {
type: 'el-button', type: 'el-button',
name: '编辑', name: '编辑',
attrs: { attrs: {
type: 'text', type: 'text'
}, },
listeners: { listeners: {
click: row => this.showEditFun(row) click: row => this.showEditFun(row)
...@@ -191,7 +160,7 @@ export default { ...@@ -191,7 +160,7 @@ export default {
type: 'el-button', type: 'el-button',
name: '链接详情', name: '链接详情',
attrs: { attrs: {
type: 'text', type: 'text'
}, },
listeners: { listeners: {
click: row => this.jumpDetail(row) click: row => this.jumpDetail(row)
...@@ -201,7 +170,7 @@ export default { ...@@ -201,7 +170,7 @@ export default {
type: 'el-button', type: 'el-button',
name: '白名单', name: '白名单',
attrs: { attrs: {
type: 'text', type: 'text'
}, },
listeners: { listeners: {
click: row => this.whiteList(row) click: row => this.whiteList(row)
...@@ -214,11 +183,9 @@ export default { ...@@ -214,11 +183,9 @@ export default {
tableSearchForm: {} tableSearchForm: {}
} }
}, },
mounted () { mounted() {},
},
methods: { methods: {
getParams () { getParams() {
const searchForm = JSON.parse(JSON.stringify(this.searchForm)) const searchForm = JSON.parse(JSON.stringify(this.searchForm))
if (searchForm.activityTime) { if (searchForm.activityTime) {
searchForm.activityStartTime = dayjs(this.searchForm.activityTime[0]).format('YYYY-MM-DD') searchForm.activityStartTime = dayjs(this.searchForm.activityTime[0]).format('YYYY-MM-DD')
...@@ -227,50 +194,60 @@ export default { ...@@ -227,50 +194,60 @@ export default {
delete searchForm.activityTime delete searchForm.activityTime
return searchForm return searchForm
}, },
handleSearch () { handleSearch() {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable() this.$refs.listRef.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
}, },
jumpDetail (e) { jumpDetail(e) {
this.linkDetailObj = { this.linkDetailObj = {
show: true, show: true,
id: e.id id: e.id
} }
}, },
whiteList(e) { whiteList(e) {
this.whiteListKey++; // 更改key值,强制Vue重新渲染whiteList组件 this.whiteListKey++ // 更改key值,强制Vue重新渲染whiteList组件
setTimeout(() => { setTimeout(() => {
this.whiteListObj = { this.whiteListObj = {
show: true, show: true,
id: e.id id: e.id
}; }
}, ); // 延迟100毫秒,您可以根据需要调整这个值 }) // 延迟100毫秒,您可以根据需要调整这个值
}, },
showEditFun (e) { showEditFun(e) {
this.editObj = { // this.editObj = {
show: true, // show: true,
title: e.id ? '编辑' : '新建', // title: e.id ? '编辑' : '新建',
id: e.id || '' // id: e.id || ''
// }
this.$router.push({
path: `/redEnvelope/components/RedEnvelopeConfig/add`,
query:{
id:e.id,
sourceType:e.sourceType
} }
})
}, },
handleExport () { handleExport() {
this.$apis.redenvelope.exportActivityRedEnvelope({ this.$apis.redenvelope
.exportActivityRedEnvelope({
...this.getParams(), ...this.getParams(),
...this.$refs.listRef.page ...this.$refs.listRef.page
}).then(res => { })
.then(res => {
exportFn(res) exportFn(res)
}) })
}, }
} }
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.fade-enter-active, .fade-leave-active { .fade-enter-active,
.fade-leave-active {
transition: opacity 0.1s; transition: opacity 0.1s;
} }
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ { .fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!