|
@@ -1,26 +1,24 @@
|
|
|
<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" :moreParameters="moreParameters">
|
|
|
+ :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :column-parsing="columnParsing"
|
|
|
+ :operation="operation()" :operationColumnWidth="200" :moreParameters="moreParameters">
|
|
|
<div class="cartographer">
|
|
|
- <el-dialog :title="formData.id?'详情':'新增'" width="100%" :modal="false" :visible.sync="formDialog"
|
|
|
+ <el-dialog :title="formData.id ? '详情' : '新增'" width="100%" :modal="false" :visible.sync="formDialog"
|
|
|
:before-close="formCancel">
|
|
|
<zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
|
- <zj-form-module title="活动信息" label-width="120px" :form-data="formData"
|
|
|
- :form-items="formItems">
|
|
|
+ <zj-form-module title="活动信息" label-width="120px" :form-data="formData" :form-items="formItems">
|
|
|
</zj-form-module>
|
|
|
- <zj-form-module title="活动填写内容" label-width="100px" :form-data="formData"
|
|
|
- :form-items="formItems2">
|
|
|
+ <zj-form-module title="活动填写内容" label-width="100px" :form-data="formData" :form-items="formItems2">
|
|
|
</zj-form-module>
|
|
|
</zj-form-container>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button size="mini" @click="formCancel">取 消</el-button>
|
|
|
- <el-button v-if="!formData.id" size="mini" type="primary" @click="formConfirm">确 定</el-button>
|
|
|
- <el-button v-if="formData.id && !!~[0, 1].indexOf(formData.status)" size="mini" type="primary" @click="zhongzhi">终 止</el-button>
|
|
|
+ <el-button v-if="formData.id && qx(formData)" size="mini" type="primary" @click="zhongzhi">终 止</el-button>
|
|
|
+ <el-button v-if="qx(formData)" size="mini" type="primary" @click="formConfirm">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
- <answer v-if="showQuestion" :defaultData="questionData" @close="questionClose" @confirm="questionConfirm"/>
|
|
|
+ <answer v-if="showQuestion" :defaultData="questionData" @close="questionClose" @confirm="questionConfirm" />
|
|
|
</template-page>
|
|
|
</template>
|
|
|
|
|
@@ -28,7 +26,7 @@
|
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
|
import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
-import {promotionQuestionnaireList,promotionQuestionnaireExport,promotionQuestionnaireAdd,promotionQuestionnaireStop,promotionQuestionnaireDetail} from "@/api/setActivity.js"
|
|
|
+import { promotionQuestionnaireList, promotionQuestionnaireExport, promotionQuestionnaireAdd, promotionQuestionnaireStop, promotionQuestionnaireDetail } from "@/api/setActivity.js"
|
|
|
import answer from "./answer.vue"
|
|
|
import ImageUpload from '@/components/file-upload'
|
|
|
import quillEditor from '@/components/v-quill-editor'
|
|
@@ -67,9 +65,10 @@ export default {
|
|
|
},
|
|
|
// 表格事件
|
|
|
tableEvents: {},
|
|
|
+ typeView: 0,
|
|
|
}
|
|
|
},
|
|
|
- computed:{
|
|
|
+ computed: {
|
|
|
moreParameters() {
|
|
|
return [
|
|
|
{
|
|
@@ -79,16 +78,16 @@ export default {
|
|
|
conditions: [{
|
|
|
label: "生效中",
|
|
|
value: "1"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "待生效",
|
|
|
value: "0"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "已过期",
|
|
|
value: "2"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "已终止",
|
|
|
value: "3"
|
|
|
- },{
|
|
|
+ }, {
|
|
|
label: "全部",
|
|
|
value: ""
|
|
|
}]
|
|
@@ -107,7 +106,7 @@ export default {
|
|
|
]
|
|
|
]
|
|
|
},
|
|
|
- formItems(){
|
|
|
+ formItems() {
|
|
|
return [
|
|
|
{
|
|
|
name: 'el-input',
|
|
@@ -119,7 +118,7 @@ export default {
|
|
|
name: 'el-date-picker',
|
|
|
md: 6,
|
|
|
attributes: {
|
|
|
- disabled: !!this.formData.id,
|
|
|
+ disabled: !this.qx(this.formData),
|
|
|
style: { width: '100%' },
|
|
|
placeholder: '请选择',
|
|
|
'value-format': 'yyyy-MM-dd HH:mm:ss',
|
|
@@ -134,8 +133,8 @@ export default {
|
|
|
prop: 'startTime',
|
|
|
rules: [{ required: true, message: '请选择', trigger: 'blur' }]
|
|
|
},
|
|
|
- events:{
|
|
|
- change: ()=>{
|
|
|
+ events: {
|
|
|
+ change: () => {
|
|
|
this.formData.endTime = ''
|
|
|
}
|
|
|
}
|
|
@@ -144,13 +143,13 @@ export default {
|
|
|
name: 'el-date-picker',
|
|
|
md: 6,
|
|
|
attributes: {
|
|
|
- disabled: !!this.formData.id,
|
|
|
+ disabled: !this.qx(this.formData),
|
|
|
style: { width: '100%' },
|
|
|
placeholder: '请选择',
|
|
|
'value-format': 'yyyy-MM-dd HH:mm:ss',
|
|
|
'picker-options': {
|
|
|
disabledDate: time => {
|
|
|
- if(this.formData.startTime){
|
|
|
+ if (this.formData.startTime) {
|
|
|
return time.getTime() < (new Date(this.formData.startTime)).getTime()
|
|
|
}
|
|
|
return true
|
|
@@ -166,9 +165,9 @@ export default {
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 12,
|
|
|
- attributes: { disabled: !!this.formData.id, placeholder: '请选择' },
|
|
|
- formItemAttributes: {
|
|
|
- label: '活动名称',
|
|
|
+ attributes: { disabled: !this.qx(this.formData), placeholder: '请选择' },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '活动名称',
|
|
|
prop: 'name',
|
|
|
rules: [{ required: true, message: '请填写', trigger: 'blur' }]
|
|
|
}
|
|
@@ -176,9 +175,9 @@ export default {
|
|
|
{
|
|
|
name: 'el-input',
|
|
|
md: 12,
|
|
|
- attributes: { disabled: !!this.formData.id, placeholder: '请选择', maxlength:8 },
|
|
|
- formItemAttributes: {
|
|
|
- label: '二维码主题',
|
|
|
+ attributes: { disabled: !this.qx(this.formData), placeholder: '请选择', maxlength: 8 },
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '二维码主题',
|
|
|
prop: 'title',
|
|
|
rules: [{ required: true, message: '请填写', trigger: 'blur' }]
|
|
|
}
|
|
@@ -198,10 +197,10 @@ export default {
|
|
|
return (
|
|
|
<div class="redbordererr" style="">
|
|
|
<el-form-item label="" label-width="0px" prop="submitLimit" rules={value ? [{ required: true, message: '请填写', trigger: 'blur' }] : []}>
|
|
|
- <el-radio-group disabled={!!this.formData.id} value={value} onInput={onInput}>
|
|
|
- <el-radio disabled={!!this.formData.id} label={0}>不限制</el-radio>
|
|
|
- <el-radio disabled={!!this.formData.id} label={1}>
|
|
|
- 限制{value?[<el-input disabled={!!this.formData.id} style="margin: 0 10px;width:100px;" value={this.formData.submitLimit} onInput={(val)=>{this.formData.submitLimit = val}} type="number" placeholder="请输入内容"></el-input>,<span>次</span>]:null}
|
|
|
+ <el-radio-group disabled={!this.qx(this.formData)} value={value} onInput={onInput}>
|
|
|
+ <el-radio disabled={!this.qx(this.formData)} label={0}>不限制</el-radio>
|
|
|
+ <el-radio disabled={!this.qx(this.formData)} label={1}>
|
|
|
+ 限制{value ? [<el-input disabled={!this.qx(this.formData)} style="margin: 0 10px;width:100px;" value={this.formData.submitLimit} onInput={(val) => { this.formData.submitLimit = val }} type="number" placeholder="请输入内容"></el-input>, <span>次</span>] : null}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
@@ -221,7 +220,7 @@ export default {
|
|
|
render: (h, { props, onInput }) => {
|
|
|
var { value } = props
|
|
|
return (
|
|
|
- <ImageUpload isEdit={!this.formData.id} fileList={this.formData.banner} uid={`questionFiles_bananner`} limit={1} isUpdate={false} />
|
|
|
+ <ImageUpload isEdit={this.qx(this.formData)} fileList={this.formData.banner} uid={`questionFiles_bananner`} limit={1} isUpdate={false} />
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -237,7 +236,7 @@ export default {
|
|
|
render: (h, { props, onInput }) => {
|
|
|
var { value } = props
|
|
|
return (
|
|
|
- <ImageUpload isEdit={!this.formData.id} fileList={this.formData.detailImgs} uid={`questionFiles_detaidetailImgsdetailImgs`} limit={100} isUpdate={false} />
|
|
|
+ <ImageUpload isEdit={this.qx(this.formData)} fileList={this.formData.detailImgs} uid={`questionFiles_detaidetailImgsdetailImgs`} limit={100} isUpdate={false} />
|
|
|
)
|
|
|
}
|
|
|
},
|
|
@@ -253,15 +252,15 @@ export default {
|
|
|
render: (h, { props, onInput }) => {
|
|
|
var { value } = props
|
|
|
return (
|
|
|
- <quillEditor disabled={!!this.formData.id} value={value} onInput={onInput}></quillEditor>
|
|
|
+ <quillEditor disabled={!this.qx(this.formData)} value={value} onInput={onInput}></quillEditor>
|
|
|
)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
name: 'slot-component',
|
|
|
md: 24,
|
|
|
- formItemAttributes: {
|
|
|
- label: '提交记录',
|
|
|
+ formItemAttributes: {
|
|
|
+ label: '提交记录',
|
|
|
prop: 'promotionQuestionnaireUsers',
|
|
|
rules: [{ required: true, message: '请设置', trigger: 'blur' }]
|
|
|
},
|
|
@@ -341,11 +340,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
], {
|
|
|
- isEdit: !this.formData.id,
|
|
|
- isAdd: !this.formData.id,
|
|
|
- isDel: !this.formData.id,
|
|
|
+ isEdit: this.qx(this.formData),
|
|
|
+ isAdd: this.qx(this.formData),
|
|
|
+ isDel: this.qx(this.formData),
|
|
|
}, {
|
|
|
- add: ()=>{
|
|
|
+ add: () => {
|
|
|
this.formData.promotionQuestionnaireUsers.push({
|
|
|
"min": '',
|
|
|
"mobile": "",
|
|
@@ -388,7 +387,7 @@ export default {
|
|
|
},
|
|
|
]
|
|
|
},
|
|
|
- formItems2(){
|
|
|
+ formItems2() {
|
|
|
return [{
|
|
|
md: 24,
|
|
|
name: 'slot-component',
|
|
@@ -403,7 +402,7 @@ export default {
|
|
|
return (
|
|
|
<div>
|
|
|
<div>
|
|
|
- {!this.formData.id?<el-button type="primary" onClick={()=>{ this.showQuestion = true }}>新增</el-button>:null}
|
|
|
+ {this.qx(this.formData) ? <el-button type="primary" onClick={() => { this.showQuestion = true }}>新增</el-button> : null}
|
|
|
</div>
|
|
|
<div>
|
|
|
<zj-table
|
|
@@ -415,40 +414,40 @@ export default {
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return (
|
|
|
<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 style="font-weight:bold;">{row.isRequire ? <span style="color:red">*</span> : null}{index + 1}、{row.question}({['单选', '多选', '填写', '图片', '视频'][row.type - 1]})</div>
|
|
|
{[
|
|
|
- <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 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>,
|
|
|
- <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 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>,
|
|
|
- <div>
|
|
|
- <el-input disabled placeholder="请输入内容"></el-input>
|
|
|
- </div>,
|
|
|
- null
|
|
|
- ][row.type-1]}
|
|
|
+ })}
|
|
|
+ </div>,
|
|
|
+ <div>
|
|
|
+ <el-input disabled placeholder="请输入内容"></el-input>
|
|
|
+ </div>,
|
|
|
+ null
|
|
|
+ ][row.type - 1]}
|
|
|
</div>
|
|
|
)
|
|
|
},
|
|
|
},
|
|
|
- ...(()=>{
|
|
|
- if(!this.formData.id){
|
|
|
- return[{
|
|
|
+ ...(() => {
|
|
|
+ if (this.qx(this.formData)) {
|
|
|
+ return [{
|
|
|
columnAttributes: {
|
|
|
label: '操作',
|
|
|
prop: '',
|
|
@@ -457,19 +456,19 @@ export default {
|
|
|
render: (h, { row, column, index }) => {
|
|
|
return (
|
|
|
<div style="padding-left:5px">
|
|
|
- <el-button size="mini" onClick={()=>{
|
|
|
+ <el-button size="mini" onClick={() => {
|
|
|
this.questionData = {
|
|
|
...JSON.parse(JSON.stringify(row)),
|
|
|
rowIndex: index
|
|
|
}
|
|
|
- this.$nextTick(()=>{
|
|
|
+ this.$nextTick(() => {
|
|
|
this.showQuestion = true
|
|
|
})
|
|
|
}}>编辑</el-button>
|
|
|
- <el-button size="mini" onClick={()=>{
|
|
|
- this.formData.promotionQuestionnaireItems.push({...JSON.parse(JSON.stringify(row))})
|
|
|
+ <el-button size="mini" onClick={() => {
|
|
|
+ this.formData.promotionQuestionnaireItems.push({ ...JSON.parse(JSON.stringify(row)) })
|
|
|
}}>复制</el-button>
|
|
|
- <el-button size="mini" onClick={()=>{
|
|
|
+ <el-button size="mini" onClick={() => {
|
|
|
this.formData.promotionQuestionnaireItems.splice(index, 1)
|
|
|
}}>删除</el-button>
|
|
|
</div>
|
|
@@ -490,13 +489,13 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 列表请求函数
|
|
|
- getList:promotionQuestionnaireList,
|
|
|
+ getList: promotionQuestionnaireList,
|
|
|
// 列表导出函数
|
|
|
exportList: promotionQuestionnaireExport,
|
|
|
// 表格列解析渲染数据更改
|
|
|
columnParsing(item, defaultData) {
|
|
|
if (item.jname === 'qrcode') {
|
|
|
- defaultData.render = (h, { row, index, column }) => {
|
|
|
+ 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}
|
|
@@ -515,26 +514,26 @@ export default {
|
|
|
// </div>
|
|
|
// )
|
|
|
//}
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (item.jname == 'startTime') {
|
|
|
- defaultData.render = (h, { row, index, column }) => {
|
|
|
- return (
|
|
|
- <div style="padding:0 6px;cursor: pointer;">
|
|
|
- {row.startTime && row.startTime.split(" ")[0]}
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
+ defaultData.render = (h, { row, index, column }) => {
|
|
|
+ return (
|
|
|
+ <div style="padding:0 6px;cursor: pointer;">
|
|
|
+ {row.startTime && row.startTime.split(" ")[0]}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
if (item.jname == 'endTime') {
|
|
|
- defaultData.render = (h, { row, index, column }) => {
|
|
|
- return (
|
|
|
- <div style="padding:0 6px;cursor: pointer;">
|
|
|
- {row.endTime && row.endTime.split(" ")[0]}
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
+ defaultData.render = (h, { row, index, column }) => {
|
|
|
+ return (
|
|
|
+ <div style="padding:0 6px;cursor: pointer;">
|
|
|
+ {row.endTime && row.endTime.split(" ")[0]}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
return defaultData
|
|
|
},
|
|
|
// 操作按钮
|
|
@@ -544,20 +543,47 @@ export default {
|
|
|
click: ({ row, index, column }) => {
|
|
|
promotionQuestionnaireDetail({
|
|
|
id: row.id
|
|
|
- }).then(res=>{
|
|
|
+ }).then(res => {
|
|
|
this.formData = {
|
|
|
...res.data,
|
|
|
submitLimitBool: res.data.submitLimit == -1 ? 0 : 1,
|
|
|
- promotionQuestionnaireItems:res.data.promotionQuestionnaireItems.map(item=>{
|
|
|
+ promotionQuestionnaireItems: res.data.promotionQuestionnaireItems.map(item => {
|
|
|
return {
|
|
|
...item,
|
|
|
- answer: JSON.parse(item?.answer||"[]")
|
|
|
+ answer: JSON.parse(item?.answer || "[]")
|
|
|
}
|
|
|
}),
|
|
|
- banner:res.data?.banner?.split(",").map(url=>({url})),
|
|
|
- detailImgs:res.data?.detailImgs?.split(",").map(url=>({url}))
|
|
|
+ banner: res.data?.banner?.split(",").map(url => ({ url })),
|
|
|
+ detailImgs: res.data?.detailImgs?.split(",").map(url => ({ url }))
|
|
|
}
|
|
|
- this.$nextTick(()=>{
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.formDialog = true
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ edit: {
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
+ return !!~[0, 1].indexOf(row.status) || !!~['待生效', '生效中'].indexOf(row.statusText)
|
|
|
+ },
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ this.typeView = 1
|
|
|
+ promotionQuestionnaireDetail({
|
|
|
+ id: row.id
|
|
|
+ }).then(res => {
|
|
|
+ this.formData = {
|
|
|
+ ...res.data,
|
|
|
+ submitLimitBool: res.data.submitLimit == -1 ? 0 : 1,
|
|
|
+ promotionQuestionnaireItems: res.data.promotionQuestionnaireItems.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ answer: JSON.parse(item?.answer || "[]")
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ banner: res.data?.banner?.split(",").map(url => ({ url })),
|
|
|
+ detailImgs: res.data?.detailImgs?.split(",").map(url => ({ url }))
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
this.formDialog = true
|
|
|
})
|
|
|
})
|
|
@@ -565,7 +591,7 @@ export default {
|
|
|
},
|
|
|
createActivity: {
|
|
|
conditions: ({ row, index, column }) => {
|
|
|
- return !!~[0, 2].indexOf(row.status) || !!~['待生效','生效中'].indexOf(row.statusText)
|
|
|
+ return !!~[0, 1].indexOf(row.status) || !!~['待生效', '生效中'].indexOf(row.statusText)
|
|
|
},
|
|
|
click: ({ row, index, column }) => {
|
|
|
this.$router.push({
|
|
@@ -593,11 +619,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 新增
|
|
|
- addData(){
|
|
|
+ addData() {
|
|
|
+ this.typeView = 1
|
|
|
this.formDialog = true
|
|
|
},
|
|
|
// 关闭弹窗
|
|
|
- formCancel(){
|
|
|
+ formCancel() {
|
|
|
+ this.typeView = 0
|
|
|
this.formDialog = false
|
|
|
this.$data.formData = this.$options.data().formData
|
|
|
},
|
|
@@ -608,9 +636,9 @@ export default {
|
|
|
var data = {
|
|
|
...this.formData,
|
|
|
endTime: this.formData.endTime ? `${this.formData.endTime.split(" ")[0]} 23:59:59` : '',
|
|
|
- banner:this.formData.banner.map(item=>item.url).join(","),
|
|
|
- detailImgs:this.formData.detailImgs.map(item=>item.url).join(","),
|
|
|
- promotionQuestionnaireItems:this.formData.promotionQuestionnaireItems.map(item=>{
|
|
|
+ banner: this.formData.banner.map(item => item.url).join(","),
|
|
|
+ detailImgs: this.formData.detailImgs.map(item => item.url).join(","),
|
|
|
+ promotionQuestionnaireItems: this.formData.promotionQuestionnaireItems.map(item => {
|
|
|
return {
|
|
|
...item,
|
|
|
answer: JSON.stringify(item.answer)
|
|
@@ -618,22 +646,22 @@ export default {
|
|
|
}),
|
|
|
submitLimit: !!this.formData.submitLimitBool ? this.formData.submitLimit : -1
|
|
|
}
|
|
|
- promotionQuestionnaireAdd(data).then(res=>{
|
|
|
+ promotionQuestionnaireAdd(data).then(res => {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: `添加成功!`,
|
|
|
- })
|
|
|
- this.$refs.pageRef.refreshList()
|
|
|
+ type: 'success',
|
|
|
+ message: `添加成功!`,
|
|
|
+ })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
this.formCancel()
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 终止
|
|
|
- zhongzhi(){
|
|
|
+ zhongzhi() {
|
|
|
promotionQuestionnaireStop({
|
|
|
- id:this.formData.id
|
|
|
- }).then(res=>{
|
|
|
+ id: this.formData.id
|
|
|
+ }).then(res => {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: `终止成功!`,
|
|
@@ -643,27 +671,29 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 关闭题目编辑
|
|
|
- questionClose(){
|
|
|
+ questionClose() {
|
|
|
this.showQuestion = false
|
|
|
this.questionData = {
|
|
|
rowIndex: -1
|
|
|
}
|
|
|
},
|
|
|
// 确定题目编辑
|
|
|
- questionConfirm(data){
|
|
|
- if(data.rowIndex==-1){
|
|
|
- this.formData.promotionQuestionnaireItems.push({...data})
|
|
|
- }else{
|
|
|
- this.formData.promotionQuestionnaireItems.splice(data.rowIndex, 1, {...data})
|
|
|
+ questionConfirm(data) {
|
|
|
+ if (data.rowIndex == -1) {
|
|
|
+ this.formData.promotionQuestionnaireItems.push({ ...data })
|
|
|
+ } else {
|
|
|
+ this.formData.promotionQuestionnaireItems.splice(data.rowIndex, 1, { ...data })
|
|
|
}
|
|
|
this.questionClose()
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.formRef.validateField(["promotionQuestionnaireItems"], (v) => {})
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.formRef.validateField(["promotionQuestionnaireItems"], (v) => { })
|
|
|
})
|
|
|
+ },
|
|
|
+ qx(item) {
|
|
|
+ return this.typeView && (!item.id || !!~[0, 1].indexOf(item.status) || !!~['待生效', '生效中'].indexOf(item.statusText))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss">
|
|
|
-</style>
|
|
|
+<style lang="scss"></style>
|