Commit 08bf4164 by 前端

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

2 parents c24aa616 fd96ceca
import { http } from '@/main'
const url = '/rop-scrm-marketing/router'
export default {
/**权益卡试用 */
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: 9,
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 \ No newline at end of file
...@@ -7,6 +7,11 @@ html { ...@@ -7,6 +7,11 @@ html {
overflow: hidden; overflow: hidden;
background-color: #f4f5fa; background-color: #f4f5fa;
} }
img{
width: 100%;
height: 100%;
vertical-align: top;
}
.el-message { .el-message {
z-index: 3000 !important; z-index: 3000 !important;
} }
......
export default {
data () {
return {
merchantObj: {
nothing: false,
data: [],
currentPage: 1,
name: '',
loading: false,
total: 0
}
}
},
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 \ No newline at end of file
import getMerchantListMixin from './getMerchantListMixin'
export {
getMerchantListMixin
}
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div class="layout">
<input <div class="tabs flex">
type="file" <template v-for="(i,index) in tabs">
@change="handleFileUpload" <template>
accept=".xlsx" <div
/>
<table v-if="parsedData.length > 0">
<!-- <thead>
<tr>
<th
v-for="(header, index) in parsedData[0]"
:key="index" :key="index"
>{{ header }}</th> :class="['tab flex',{'active':step == index + 1}]"
</tr>
</thead> -->
<tbody>
<tr
v-for="(row, rowIndex) in parsedData"
:key="rowIndex"
> >
<td <template v-if="index != 0">
v-for="(cell, cellIndex) in row" <div class="line"></div>
:key="cellIndex" </template>
>{{ cell }}</td> <template v-if="step == 2 && index == 0">
</tr> <div class="icon finish">
</tbody> <span class="el-icon-check"></span>
</table> </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> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import * as XLSX from 'xlsx' import StepOne from './components/StepOne/index.vue'
import StepTwo from './components/StepTwo/index.vue'
export default { export default {
components: { StepOne, StepTwo },
name: '', name: '',
data () { data () {
return { return {
parsedData: [], parsedData: [],
step: 2,
tabs: ['基本信息', '配置内容']
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
handleFileUpload (event) { handleCancel () {
const [file] = event.target.files const { step } = this
if (file) { step == 1 ? this.$router.go(-1) : this.step = 1
const reader = new FileReader() },
reader.onload = (e) => { handleConfirm () {
try { const { step, $refs: {
const data = e.target.result stepOne,
if (data) { stepTwo
const workbook = XLSX.read(data, { type: 'array' }), } } = this
firstSheetName = workbook.SheetNames[0], if (step == 1) {
worksheet = workbook.Sheets[firstSheetName] stepOne.formRef().validate(valid => {
this.parsedData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }) if (valid) this.step = 2
console.log(this.parsedData) })
} else throw 'File data is empty.' } else {
} catch (error) { stepTwo.formRef().validate(valid => {
this.$message.error(error || 'Error reading the file') if (valid) console.log(stepOne.configForm, stepTwo.configForm)
} })
} }
reader.readAsArrayBuffer(file)
} }
},
} }
} }
</script> </script>
<style scoped lang='scss'> <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> </style>
\ No newline at end of file \ No newline at end of file
<template>
<GLDialog
mode="big"
bigTitle="数据"
:hasFooter="false"
:before-close="handleClose"
:visible.sync="dataObj.show"
>
<GLTable
:tableData="tableData"
:noDataImg="url"
:tableParams="tableParams"
:tableTotal="tableTotal"
:pageConf="pageConf"
>
</GLTable>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
export default {
name: '',
props: {
dataObj: {
type: Object,
default: () => { }
}
},
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '导入时间',
prop: 'exportTime',
minWidth: 180
},
{
label: '状态',
prop: 'statusStr',
minWidth: 100,
},
{
label: '微信昵称',
prop: 'wechatName',
minWidth: 100
},
]
},
tableData: [],
tableTotal: 0
}
},
mounted () {
},
watch: {
'dataObj' (n) {
if (n.id) this.refreshTable()
}
},
methods: {
async refreshTable (pageCon) {
pageCon && (this.pageConfig = pageCon)
const params = {
redEnvelopeId: this.dataObj.id,
pageSize: 10,
pageNum: 1,
...this.pageConfig
}
const { data, count } = await this.$apis.redenvelope.getActivityRedEnvelopeLinkDetailPage(params)
this.tableData = data || []
this.tableTotal = count || 0
},
handleClose () {
this.$emit('update:dataObj', {})
},
}
}
</script>
<style scoped lang='scss'>
.link {
/deep/.el-form-item--small {
width: fit-content;
}
}
</style>
\ No newline at end of file \ 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 == 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 \ 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.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 == 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 \ 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 == 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 \ No newline at end of file
<template>
<el-scrollbar
class="step-box"
ref="stepBox"
>
<div class="step-content">
<glsx-combi-form
ref="formRef"
:isEdit="true"
:isBlock="true"
:formObj="configForm"
:formData="formData"
:formRules="rule"
>
<template #merchantId>
<el-select
v-model="configForm.merchantId"
placeholder="请选择"
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>
</template>
<template #activity>
<div class="tabs flex">
<template v-for="(i,index) in tabsObj.data">
<template>
<el-button
type="text"
@click="changeActivity(index)"
:class="['tab',{active:index == tabsObj.index}]"
:key="index"
:disabled="index == 1"
>{{i}}</el-button>
</template>
</template>
</div>
<div
class="activity-box"
:key="activityObj.key"
>
<template v-if="activityObj.flag">
<template v-if="activityObj.data.length">
<template v-for="(i,index) in activityObj.data">
<template>
<component
:key="index"
:is="{
0:'EquityItem',
2:'CouponItem',
3:'RedEnvelopeItem'
}[tabsObj.index]"
:configForm="configForm"
:data="i"
@choose="choose"
></component>
</template>
</template>
<template v-if="activityObj.nothing">
<div class="nothing-text">
到底了!
</div>
</template>
</template>
<template v-else>
<div class="nothing">
<img src="@/assets/activity-nothing.png">
<div>暂无内容</div>
</div>
</template>
</template>
</div>
</template>
</glsx-combi-form>
</div>
</el-scrollbar>
</template>
<script type='text/ecmascript-6'>
import { getMerchantListMixin } from '@/mixins'
import EquityItem from './EquityItem.vue'
import CouponItem from './CouponItem.vue'
import RedEnvelopeItem from './RedEnvelopeItem.vue'
export default {
name: 'StepOne',
mixins: [getMerchantListMixin],
components: { RedEnvelopeItem, EquityItem, CouponItem },
data () {
return {
configForm: {
activityName: '',
merchantId: '',
activityTime: '',
activityImg: '',
activityId: ''
},
rule: {
activityName: [{ required: true, message: '请输入问卷名称', trigger: 'change' }],
merchantId: [{ required: true, message: '请选择所属渠道', trigger: 'change' }],
activityTime: [{ required: true, message: '请输入卡片标题', trigger: 'change' }],
activityImg: [{ required: true, message: '请上传卡片封面', trigger: 'change' }],
},
formData: [
{
label: '问卷名称',
name: 'activityName',
type: 'input',
maxlength: 50,
},
{
label: '所属渠道',
type: 'select',
name: 'merchantId',
addHtml: 'merchantId'
},
{
label: '卡片标题',
name: 'activityTime',
type: 'input',
maxlength: 20,
},
{
label: '卡片封面',
name: 'activityImg',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
suffixSlot: 'activityImg',
handleUpload: async (e, file, targetItem) => {
try {
const imgFile = e.target.result,
arrBase64 = imgFile.split(',')[1],
str = file.name.split('.'),
base64 = str.at(-1) + '@' + arrBase64,
res = await this.$apis.common.pictureUpload({ file: base64, fileType: 'image' })
if (res) {
this.configForm[targetItem.name] = res
this.formRef().validateField(targetItem.name)
} else throw '上传失败'
} catch (error) {
this.$message(error)
}
}
},
{
label: '关联活动',
addHtml: 'activity'
}
],
tabsObj: {
data: ['权益卡试用', '权益套餐', '商城券', '红包活动'],
index: 0
},
activityObj: {
data: [],
key: Date.now(),
flag: true,
pageNum: 1,
total: 0
},
merchantObj: {
nothing: false,
data: [],
currentPage: 1,
name: '',
loading: false,
total: 0
}
}
},
watch: {
'configForm.merchantId' (n) {
this.getActivityList()
}
},
mounted () {
this.onReachBottom(this)
},
methods: {
formRef () {
return this.$refs.formRef.$refs.formRef
},
onReachBottom (_this) {
this.$refs.stepBox.wrap.addEventListener('scroll', function () {
const condition = this.scrollHeight - this.scrollTop - 20 <= this.clientHeight,
{ index } = _this.tabsObj,
{ total, pageNum } = _this.activityObj
if (condition) {
if (index == 2) {
if (Math.ceil(total / 9) > pageNum) {
_this.activityObj.pageNum += 1
_this.getActivityList()
} else _this.activityObj.nothing = true
}
}
})
},
changeActivity (index) {
const { merchantId } = this.configForm
if (this.tabsObj.index == index) return
if (!merchantId) return this.$message.error('请先选择所属渠道')
this.tabsObj.index = index
this.configForm.activityId = ''
this.activityObj.pageNum = 1
this.activityObj.nothing = false
this.activityObj.flag = false
this.getActivityList()
},
async getActivityList () {
const { index } = this.tabsObj,
{ merchantId } = this.configForm,
{ pageNum } = this.activityObj,
targetApi = {
0: 'getEquityActivityList',
2: 'getMerchantCouponList',
3: 'getActivityRedEnvelopeList'
}[index],
params = {
merchantId
}
if (index == 2) 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
}
console.log(data)
this.activityObj.data = data
this.activityObj.flag = true
},
choose (e) {
this.configForm.activityId = e
}
},
}
</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;
}
}
.step-content {
padding-top: 32px;
}
/deep/.el-form-item__content {
width: fit-content;
max-width: calc(100% - 154px);
}
/deep/.activity-img,
/deep/.muti-imgs {
width: 104px;
height: 104px;
background: #0000000a;
border: 1px dashed #00000026;
border-radius: 4px;
input {
margin-top: 0;
}
.img-w-h,
.img-btns {
width: 100%;
height: 100%;
}
}
/deep/.activity-img {
margin-bottom: 30px;
&::before {
content: '图片大小10M以内';
display: block;
font-size: 14px;
color: #999999;
position: absolute;
left: 0;
line-height: 20px;
bottom: -30px;
width: 200px;
}
}
.tabs {
height: 36px;
background: #f8f8f8;
border-radius: 4px;
padding: 0 2px;
width: fit-content;
.tab {
height: 32px;
font-size: 14px;
color: #666666;
padding: 0 16px;
margin: 0;
}
.active {
background: #ffffff;
border-radius: 3px;
font-weight: 500;
color: #5850ff;
}
.is-disabled {
color: #cfcfcf;
}
}
.activity-box {
display: flex;
gap: 16px;
flex-wrap: wrap;
margin-top: 16px;
.nothing {
margin-top: 24px;
font-weight: 500;
font-size: 16px;
color: #666666;
text-align: center;
img {
width: 323px;
height: 92px;
margin-bottom: 16px;
}
}
.nothing-text {
color: #666666;
text-align: center;
font-weight: 500;
font-size: 16px;
width: 100%;
}
}
}
</style>
\ No newline at end of file \ 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="activityName"
class="m-t-20"
>
<el-input
style="width:432px"
size="small"
v-model="configForm.activityName"
placeholder="请输入"
maxlength="8"
></el-input>
</el-form-item>
<el-form-item
label="问卷说明:"
prop="activityTime"
class="m-t-20"
>
<el-input
style="width:580px"
type="textarea"
rows="3"
v-model="configForm.activityTime"
placeholder="请输入"
maxlength="50"
show-word-limit
></el-input>
</el-form-item>
<el-form-item
label="题目配置:"
prop="activityImg"
class="m-t-20"
>
<div class="config-box">
<template v-for="(i,index) in configForm.activityImg">
<template>
<div
:key="index"
class="item"
>
<div :class="['label',{'required':i.required}]">
{{i.title}}:
</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"
/>
</el-scrollbar>
</template>
<script type='text/ecmascript-6'>
import EditQuestions from './EditQuestions.vue'
export default {
name: 'StepTwo',
components: { EditQuestions },
data () {
return {
configForm: {
activityName: '',
activityTime: '',
activityImg: [],
},
rule: {
activityName: [{ required: true, message: '请输入问卷标题', trigger: 'change' }],
activityTime: [{ required: true, message: '请输入问卷说明', trigger: 'change' }],
activityImg: [{ required: true, message: '请添加题目', trigger: 'change' }],
},
showEditQuestions: true
}
},
mounted () {
},
methods: {
formRef () {
return this.$refs.formRef
},
addQuestions (params) {
this.configForm.activityImg.push(params)
}
}
}
</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;
}
.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 \ No newline at end of file
...@@ -63,14 +63,32 @@ ...@@ -63,14 +63,32 @@
</span> </span>
</GLTable> </GLTable>
</div> </div>
<data-table :dataObj.sync="dataObj" />
<GLDialog
title="结束"
@onOk="handleDel"
@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> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from 'dayjs' import DataTable from './components/DataTable/index.vue'
export default { export default {
name: 'RedEnvelopeConfig', name: 'RedEnvelopeConfig',
components: { DataTable },
data () { data () {
return { return {
url, url,
...@@ -142,10 +160,12 @@ export default { ...@@ -142,10 +160,12 @@ export default {
type: 'text', type: 'text',
}, },
listeners: { listeners: {
click: row => this.showEditFun(row) click: row => this.overQiestion(row)
} }
}, },
], ],
dataObj: {},
dialogVisible: false
} }
}, },
mounted () { mounted () {
...@@ -158,6 +178,18 @@ export default { ...@@ -158,6 +178,18 @@ export default {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
}, },
jumpDetail (row) {
this.dataObj = {
show: true,
id: 22
}
},
overQiestion (row) {
this.dialogVisible = true
},
handleDel(){
this.dialogVisible = false
}
} }
} }
</script> </script>
...@@ -209,4 +241,22 @@ export default { ...@@ -209,4 +241,22 @@ export default {
width: 200px; width: 200px;
height: 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;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -48,12 +48,12 @@ ...@@ -48,12 +48,12 @@
:loading="loading" :loading="loading"
> >
<el-option <el-option
v-for="item in merchantList" v-for="item in merchantObj.data"
:key="item.confId" :key="item.confId"
:label="item.confName" :label="item.confName"
:value="item.confId" :value="item.confId"
></el-option> ></el-option>
<template v-if="nothing"> <template v-if="merchantObj.nothing">
<div class="nothing">到底了!</div> <div class="nothing">到底了!</div>
</template> </template>
</el-select> </el-select>
...@@ -148,8 +148,10 @@ export const afterRangePickerOptions = { ...@@ -148,8 +148,10 @@ export const afterRangePickerOptions = {
} }
import commonFun from '../common/fun.js' import commonFun from '../common/fun.js'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import { getMerchantListMixin } from '@/mixins'
export default { export default {
mixins:[getMerchantListMixin],
name: '', name: '',
props: { props: {
editObj: { editObj: {
...@@ -204,14 +206,8 @@ export default { ...@@ -204,14 +206,8 @@ export default {
} }
], ],
}, },
merchantList: [],
fileName: '', fileName: '',
fileError: '', fileError: '',
loading: false,
currentPage: 1,
total: 0,
nothing: false,
merchantName: ''
} }
}, },
mounted () { mounted () {
...@@ -223,46 +219,7 @@ export default { ...@@ -223,46 +219,7 @@ export default {
if (n.id) this.getRedEnvelopeActivityDetail(n.id) if (n.id) this.getRedEnvelopeActivityDetail(n.id)
} }
}, },
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()
})
}
}
},
methods: { methods: {
selectFocus () {
const { configForm } = this
if (!configForm.merchantId) {
this.merchantList = []
this.merchantName = ''
this.currentPage = 1
this.getMerchantList()
}
},
onReachBottom () {
const { total, currentPage } = this
if (Math.ceil(total / 50) > currentPage) {
this.currentPage += 1
this.getMerchantList()
} else this.nothing = true
},
remoteMethod (val) {
this.merchantName = val
if (val) {
this.loading = true
this.configForm.merchantId = ''
this.nothing = false
this.merchantList = []
this.currentPage = 1
this.getMerchantList(val)
}
},
async getRedEnvelopeActivityDetail (id) { async getRedEnvelopeActivityDetail (id) {
try { try {
const { configForm } = this, const { configForm } = this,
...@@ -287,22 +244,6 @@ export default { ...@@ -287,22 +244,6 @@ export default {
this.$message.error(error) this.$message.error(error)
} }
}, },
async getMerchantList () {
const { currentPage, merchantList, merchantName } = this,
{ list, total } = await this.$apis.redenvelope.getRedEnvelopeMerchantList({
currentPage,
merchantName
})
this.total = total
list && list.map(e => {
merchantList.push({
confId: e.merchantNo,
confName: e.merchantName,
})
})
this.merchantList = merchantList
this.loading = false
},
handleClose () { handleClose () {
this.configForm = this.$options.data.call(this).configForm this.configForm = this.$options.data.call(this).configForm
this.disabled = false this.disabled = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!