detailInvest.vue
12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<template>
<div>
<div style="padding:20px;
overflow-y: auto;">
<TitleWithCircle title="问卷详情" style="margin-bottom: 20px;" />
<div>
<div style="padding: 10px 0 20px 0;">基本信息</div>
<el-descriptions class="margin-top" :column="3" border :label-style="labelStyle"
:content-style="contentStyle">
<el-descriptions-item :span="2">
<template slot="label">
问卷标题
</template>
{{ secondData.title }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
{{ secondData.reviewStatus == '1' ? '待提交' : secondData.reviewStatus == '2' ? '待审核' :
secondData.reviewStatus
==
'3' ? '审核通过' : secondData.reviewStatus == '4' ?'不通过': secondData.reviewStatus == '5' ?'已禁用':'' }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
开始时间
</template>
{{ secondData.startDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
结束时间
</template>
{{ secondData.endDate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
预计填写时长(分钟)
</template>
{{ secondData.estimatedTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
发布端口
</template>
{{ secondData.publishPort }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
问卷类型
</template>
{{ secondData.questionnaireType }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
填写条件
</template>
{{ secondData.fillingConditions }}
</el-descriptions-item>
</el-descriptions>
<div style="padding: 20px 0;">问卷介绍</div>
<div v-html="secondData.remarks" />
<div style="padding: 20px 0;">问卷封面</div>
<div>
<el-image style="width: 280px; height: 200px" :src="this.$hostUrl + secondData.coverImage"
fit="fill" />
</div>
<div style="padding: 20px 0 ;">参与答卷奖励</div>
<el-descriptions class="margin-top" :column="3" border :label-style="labelStylejiang"
:content-style="contentStylejiang">
<el-descriptions-item>
<template slot="label">
提交问卷后
</template>
<span v-if="secondData.rewardForParticipation">{{ secondData.rewardForParticipation!=''?'转盘抽奖':'不设置奖励'}}</span>
<span v-else></span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
奖励
</template>
<div>
<span>{{ secondData.rewardForParticipation!=''?getStatusText(secondData.actStyle):'无'}}</span>
<span v-if="jiangli.id && jiangli.id!=''"
style="padding: 0 20px;color: #3F9B6A;cursor: pointer;" @click="actGo(1)">查看</span>
</div>
</el-descriptions-item>
</el-descriptions>
<div style="padding: 20px 0 ;">问卷题目</div>
<el-table :data="wenData"
:header-cell-style="{ fontSize: '14px', color: '#0009', fontWeight: 'normal', backgroundColor: '#F2F3F5' }">
<el-table-column label="序号" min-width="100">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="题目" min-width="300" prop="title" :show-overflow-tooltip="true" />
<el-table-column label="题型" min-width="80" prop="type" />
<el-table-column label="是否必填" prop="required" min-width="80" />
<el-table-column label="选项" min-width="120">
<template slot-scope="scope">
<div v-for="(value, index) in scope.row.options " v-if="scope.row.type != '文本'"
:key="index">
{{ index + 1 }}:{{ value.answer }}
</div>
<div v-else>
-
</div>
</template>
</el-table-column>
</el-table>
<div style="padding: 20px 0 ;">系统信息</div>
<el-descriptions class="margin-top" :column="3" border :label-style="labelStyle"
:content-style="contentStyle">
<el-descriptions-item>
<template slot="label">
创建人
</template>
{{ secondData.createUser }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
创建时间
</template>
{{ secondData.createTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
更新时间
</template>
{{ secondData.updateTime }}
</el-descriptions-item>
</el-descriptions>
<div style="padding: 20px 0 ;">审核信息</div>
<el-descriptions class="margin-top" :column="3" border :label-style="labelStyle"
:content-style="contentStyle">
<el-descriptions-item>
<template slot="label">
审核状态
</template>
{{ secondData.reviewStatus == '1' ? '待提交' : secondData.reviewStatus == '2' ? '待审核' :
secondData.reviewStatus
==
'3' ? '审核通过' : secondData.reviewStatus == '4' ?'不通过': secondData.reviewStatus == '5' ?'已禁用':'' }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
审核意见
</template>
<div>{{ secondData.reviewComments }}</div>
</el-descriptions-item>
</el-descriptions>
</div>
</div>
<el-dialog :visible.sync="iframaShow" title="创建活动" width="90%" center top="1%" :close-on-click-modal="false"
>
<div style="padding:20px;">
<iframe :src="iframaUrl" ref="iframe" frameborder="0" width="100%" height="700px" />
<div style="padding-top:20px;display:flex;justify-content: flex-end;">
</div>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import {
async
} from 'q'
import Vue from 'vue'
import axios from 'axios'
import DynamicChartTable from '@/components/dajuanTongji/index.vue'
import tiaoxing from '@/components/dajuanTongji/tiaoxing.vue'
import wangEditor from '@/components/editor/index';
import {
TerminaGetAll,
TerminaAdd,
TerminaEdit,
TerminaDel,
QuestionGetAll,
QuestionAdd,
} from '../../api/investigation.js'
import upimg from '@/components/ImageUpload/index'
import TitleWithCircle from '@/components/top/index';
export default {
components: {
upimg,
DynamicChartTable,
tiaoxing,
wangEditor,
TitleWithCircle
},
data() {
return {
secondData:{},
labelStylejiang: {
width: '180px'
},
contentStylejiang: {
width: '300px'
},
labelStyle: {
width: '250px'
},
contentStyle: {
width: '246px'
},
wenData: [],
jiangli: {
// id: '1895043663592030209', //活动id
// actName: '商业测试活动1', //活动名称
// actStyle: '1', //抽奖样式 1:大转盘 2:砸金蛋 3:刮刮卡 4:翻牌乐 5:福袋 6:摇一摇
id:'',
actName:'',
actStyle:'', //抽奖样式 1:大转盘 2:砸金蛋 3:刮刮卡 4:翻牌乐 5:福袋 6:摇一摇
},
iframaShow:false,
iframaUrl:''
}
},
computed: {
},
created() {},
mounted() {
this.moren()
},
methods: {
getIdValue(urlPart) {
const queryIndex = urlPart.indexOf('?');
if (queryIndex === -1) {
return null;
}
const queryString = urlPart.slice(queryIndex + 1);
const paramPairs = queryString.split('&');
for (let i = 0; i < paramPairs.length; i++) {
const pair = paramPairs[i].split('=');
if (pair[0] === 'id') {
return pair[1];
}
}
return null;
},
moren() {
const idValue = this.getIdValue(window.location.href)
console.log(idValue, 'idValue')
if (idValue != null) {
let obj = {
id: idValue,
pageNumber: 0,
pageSize: 10,
}
TerminaGetAll(obj).then(res => {
this.secondData = res.data.content[0]
if (typeof this.secondData.question === 'string') {
this.secondData.question = JSON.parse(this.secondData.question)
}
const array = this.objectToArray(this.secondData.question)
this.jiangli.id = this.secondData.rewardForParticipation
this.wenData = array
})
}
},
objectToArray(obj) {
return Object.keys(obj).map(key => {
const item = obj[key];
return {
id: key,
...item
}
})
},
getStatusText(val) {
switch (val) {
case '1':
return '大转盘';
case '2':
return '砸金蛋';
case '3':
return '刮刮卡';
case '4':
return '翻牌乐';
case '5':
return '福袋';
case '6':
return '摇一摇';
default:
return '无';
}
},
actGo(val) {
let token = localStorage.getItem('token');
if (token && token.startsWith('Bearer')) {
token = token.substring(7);
}
// token =
// 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqd3RfdXNlcl9pbmZvIjoie1wiYXBwSWRcIjoxLFwiYXJlYUNvZGVzXCI6W10sXCJjb21wYW55QWRtaW5cIjpmYWxzZSxcImNvbXBhbnlDb2RlXCI6XCJKSkxEXzAwMVwiLFwiZGVwdENvZGVcIjpcIjAwMlwiLFwiZGVwdFRhZ1wiOlwiXCIsXCJsb2dpblR5cGVcIjpcIlBDXCIsXCJtYWluRGVwdENvZGVcIjpcIjAwMlwiLFwibWFuYWdlclwiOnRydWUsXCJuYW1lXCI6XCLotoXnuqfnrqHnkIblkZhcIixcInBob25lXCI6XCIxMzU0MTMwNDkxMFwiLFwicm9sZXNcIjpbXCJyb2xlX3N1cGVyX2FkbWluXCIsXCJ2aXAtYWRtaW5cIl0sXCJzdXBlckFkbWluXCI6dHJ1ZSxcInRvcERlcHRDb2RlXCI6XCIwMDJcIixcInVzZXJJZFwiOjEsXCJ1c2VybmFtZVwiOlwic3VwZXItampsZFwifSIsImp0aSI6ImMxMWQ5ZjJjLTc1ZjItNDM5Yy05NjMzLTliYzU4MTc2NmZmYiIsImV4cCI6MTc0MDY2Mjg2NywiaWF0IjoxNzQwNjQ4NDY3LCJzdWIiOiJDRFdMIiwiaXNzIjoiT0EifQ.-2jv7Vq8pqn8PehIpd1lMXJrSqPsmCfhXp7fddL56qI'
this.iframaShow = true
if (val == 0) {
this.iframaUrl =
// `https://jy.scjysm.asia:18086/cdwltool/addEmptyLottery?token=${token}&channel=shangye&thirdPartyUrl=http://localhost:9529/#/investigation/index`
`https://zhgw-uat.028wlkj.com/liuliang/cdwltool/addEmptyLottery?token=${token}&channel=shangye&thirdPartyUrl=http://localhost:9529/#/investigation/index`
} else if (val == 1) {
this.iframaUrl =
`https://zhgw-uat.028wlkj.com/liuliang/cdwltool/addEmptyLottery?token=${token}&id=${this.jiangli.id}&title=活动详情&channel=shangye&thirdPartyUrl=http://localhost:9529/#/investigation/index`
} else if (val == 2) {
this.iframaUrl =
`https://zhgw-uat.028wlkj.com/liuliang/cdwltool/addEmptyLottery?token=${token}&id=${this.jiangli.id}&channel=shangye&thirdPartyUrl=http://localhost:9529/#/investigation/index`
}
// window.location.href =
},
}
}
</script>
<style lang="scss" scoped>
::v-deep .bian_css {
.el-dialog__header {
padding: 0px;
}
.el-input__inner {
height: 18px;
border: 0px;
margin-top: 0px;
}
.el-input__inner:hover {
border: 0px;
}
.el-input__inner:focus {
border: 0px;
}
}
::v-deep .buttonHover:hover {
color: #3f9b6a !important;
border-color: #c5e1d2 !important;
background-color: #ecf5f0 !important;
outline: none;
}
::v-deep .el-pagination__total {
position: absolute;
left: 33px;
}
::v-deep .diaslog_zhong {
.el-dialog__body {
padding: 10px 20px 20px 20px;
}
.el-upload--picture-card {
width: 130px;
height: 130px;
}
}
::v-deep .el-radio-group {
.el-radio {
font-weight: 400;
height: 29px;
}
}
::v-deep .el-checkbox-group {
.el-checkbox {
height: 29px;
}
label {
font-weight: 400;
}
}
.questionnaire {
width: 100%;
flex-grow: 1;
background-color: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 5px;
box-sizing: border-box;
}
.question-title {
// font-size: 18px;
color: #000;
margin-bottom: 10px;
}
.question {
background-color: white;
padding: 15px;
margin: 10px 0;
border-radius: 10px;
}
.answerItem {
width: auto;
padding: 10px 15px;
margin: 0 0 5px 10px;
border-radius: 6px;
background-color: #f5f7fa;
display: flex;
align-items: center;
}
// ::v-deep .tongyong_css {
// max-height: 850px;
// }
// .tongyong_css {
// max-height: calc(100vh - 200px); /* Adjust the 200px to the combined height of your header and footer */
// overflow-y: auto;
// }
::v-deep .xddTable {
height: 100% !important;
.el-table__body-wrapper {
overflow: auto !important;
height: 100% !important;
}
.el-table__body-wrapper is-scrolling-none {
height: 100% !important;
}
.el-table--scrollable-y .el-table__body-wrapper {
overflow-y: inherit !important;
}
}
</style>