|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
|
|
|
:table-events="tableEvents" :options-evens-group="optionsEvensGroup"
|
|
|
- :column-parsing="columnParsing" :operation="operation()" :operationColumnWidth="200">
|
|
|
+ :column-parsing="columnParsing" :operation="operation()" :operationColumnWidth="200" :moreParameters="moreParameters">
|
|
|
<div class="cartographer">
|
|
|
<el-dialog :title="formData.id?'详情':'新增'" width="100%" :modal="false" :visible.sync="formDialog"
|
|
|
:before-close="formCancel">
|
|
@@ -70,6 +70,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
|
+ moreParameters() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ name: '状态',
|
|
|
+ key: 'status',
|
|
|
+ value: '',
|
|
|
+ conditions: [{
|
|
|
+ label: "生效中",
|
|
|
+ value: "1"
|
|
|
+ },{
|
|
|
+ label: "待生效",
|
|
|
+ value: "0"
|
|
|
+ },{
|
|
|
+ label: "已过期",
|
|
|
+ value: "2"
|
|
|
+ },{
|
|
|
+ label: "已终止",
|
|
|
+ value: "3"
|
|
|
+ },{
|
|
|
+ label: "全部",
|
|
|
+ value: ""
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
// 事件组合
|
|
|
optionsEvensGroup() {
|
|
|
return [
|
|
@@ -98,11 +123,21 @@ export default {
|
|
|
style: { width: '100%' },
|
|
|
placeholder: '请选择',
|
|
|
'value-format': 'yyyy-MM-dd HH:mm:ss',
|
|
|
+ 'picker-options': {
|
|
|
+ disabledDate: time => {
|
|
|
+ return time.getTime() < (Date.now() - 86400000)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
formItemAttributes: {
|
|
|
label: '活动开始日期',
|
|
|
prop: 'startTime',
|
|
|
rules: [{ required: true, message: '请选择', trigger: 'blur' }]
|
|
|
+ },
|
|
|
+ events:{
|
|
|
+ change: ()=>{
|
|
|
+ this.formData.endTime = ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -113,6 +148,14 @@ export default {
|
|
|
style: { width: '100%' },
|
|
|
placeholder: '请选择',
|
|
|
'value-format': 'yyyy-MM-dd HH:mm:ss',
|
|
|
+ 'picker-options': {
|
|
|
+ disabledDate: time => {
|
|
|
+ if(this.formData.startTime){
|
|
|
+ return time.getTime() < (new Date(this.formData.startTime)).getTime()
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
formItemAttributes: {
|
|
|
label: '活动结束日期',
|
|
@@ -374,11 +417,25 @@ export default {
|
|
|
<div style="padding:6px;">
|
|
|
<div style="font-weight:bold;">{row.isRequire?<span style="color:red">*</span> : null}{index+1}、{row.question}({['单选','多选','填写','图片','视频'][row.type-1]})</div>
|
|
|
{[
|
|
|
- <div>
|
|
|
- {row.answer.map(item=><el-radio disabled label="">{item.option_value}</el-radio>)}
|
|
|
+ <div style="display: flex">
|
|
|
+ {row.answer.map(item=>{
|
|
|
+ return <div style="margin-right:10px">
|
|
|
+ <el-radio disabled label="">{item.option_value}</el-radio>
|
|
|
+ <div>
|
|
|
+ {item.option_files.map(v => <el-image src={v.url} preview-src-list={[v.url]} fit="fit" style="width:80px;height:80px;" />)}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ })}
|
|
|
</div>,
|
|
|
- <div>
|
|
|
- {row.answer.map(item=><el-checkbox disabled label="">{item.option_value}</el-checkbox>)}
|
|
|
+ <div style="display: flex">
|
|
|
+ {row.answer.map(item=>{
|
|
|
+ return <div style="margin-right:10px">
|
|
|
+ <el-checkbox disabled label="">{item.option_value}</el-checkbox>
|
|
|
+ <div>
|
|
|
+ {item.option_files.map(v => <el-image src={v.url} preview-src-list={[v.url]} fit="fit" style="width:80px;height:80px;" />)}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ })}
|
|
|
</div>,
|
|
|
<div>
|
|
|
<el-input disabled placeholder="请输入内容"></el-input>
|
|
@@ -440,11 +497,24 @@ export default {
|
|
|
columnParsing(item, defaultData) {
|
|
|
if (item.jname === 'qrcode') {
|
|
|
defaultData.render = (h, { row, index, column }) => {
|
|
|
- return (
|
|
|
- <div style="padding:0 6px;cursor: pointer;">
|
|
|
- {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
|
|
|
- </div>
|
|
|
- )
|
|
|
+ return (
|
|
|
+ <div style="padding:0 6px;cursor: pointer;">
|
|
|
+ {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ //if(!!~[0, 2].indexOf(row.status) || !!~['待生效','生效中'].indexOf(row.statusText)){
|
|
|
+ // return (
|
|
|
+ // <div style="padding:0 6px;cursor: pointer;">
|
|
|
+ // {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} preview-src-list={[url]} fit="fit" style="width:80px;height:80px;" />) : null}
|
|
|
+ // </div>
|
|
|
+ // )
|
|
|
+ //}else{
|
|
|
+ // return (
|
|
|
+ // <div style="padding:0 6px;cursor: pointer;opacity: 0.3;">
|
|
|
+ // {row.qrcode ? row.qrcode.split(",").map(url => <el-image src={url} fit="fit" style="width:80px;height:80px;" />) : null}
|
|
|
+ // </div>
|
|
|
+ // )
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
if (item.jname == 'startTime') {
|
|
@@ -494,6 +564,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
createActivity: {
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return !!~[0, 2].indexOf(row.status) || !!~['待生效','生效中'].indexOf(row.statusText)
|
|
|
+ },
|
|
|
click: ({ row, index, column }) => {
|
|
|
this.$router.push({
|
|
|
name: "activityOrder",
|
|
@@ -584,6 +657,9 @@ export default {
|
|
|
this.formData.promotionQuestionnaireItems.splice(data.rowIndex, 1, {...data})
|
|
|
}
|
|
|
this.questionClose()
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs.formRef.validateField(["promotionQuestionnaireItems"], (v) => {})
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|