Commit fff0e692 by llj

feat:任务记录详情数字问卷

1 parent 5c26acf7
......@@ -5,5 +5,9 @@
import { post } from '@/utils/http';
const basePath = '/rest/saas/crm/xcx';
// 获取任务详情
// 可配置和调研
export const makeSceneTaskInfo = data =>
post(`${basePath}/pdf/ms/makeSceneTaskInfo`, data);
// 数字问卷
export const numQuestTaskInfo = data =>
post(`${basePath}/pdf/nq/numQuestTaskInfo`, data);
......@@ -57,7 +57,7 @@
<div class="bi_title_text_content">
<!-- 任务内容信息标题顺序 可配置是03 调研是02 -->
<div class="bi_title_text_index">
{{ { 5: '02', 7: '02', 20: '03' }[+projectType] }}
{{ +projectType === 20 ? '03' : '02' }}
</div>
任务内容信息
</div>
......@@ -69,6 +69,18 @@
/>
</div>
</div>
<div>
<div class="block_box information" v-if="+projectType === 21">
<img :src="resData.channelInformation.picUrl" />
<div style="margin:10px">
<span>资讯标题:</span>
<strong>
{{ resData.channelInformation.title }}
</strong>
</div>
</div>
<div v-html="resData.channelInformation.content"></div>
</div>
<div v-for="(item, index) in resData.contentTitleList" :key="item.id">
<!-- 单选题/多选/投票题 -->
<div v-if="[1, 2, 3].includes(item.type)" class="question-item">
......@@ -76,9 +88,7 @@
<span>{{ `${index + 1}.${item.title}` }}</span>
<span>{{ titleMap(item.type) }}</span>
<div>
此条任务收集的选择项为:{{
item.type == 2 ? item.answer.join(',') : item.answer
}}
此条任务收集的选择项为:{{ isMultiple(item.type, item.answer) }}
</div>
</div>
<div
......@@ -216,6 +226,17 @@ export default {
dateFormat(e) {
return dateFormat(e);
},
isMultiple(type, answer) {
if (type == 2) {
if (Array.isArray(answer)) {
return answer.join(',');
} else {
return JSON.parse(answer).join(',');
}
} else {
return answer;
}
},
titleMap(type) {
return qustionMap[type];
}
......@@ -223,4 +244,14 @@ export default {
};
</script>
<style></style>
<style lang="scss" scoped>
.information {
display: flex;
align-items: center;
margin: 15px;
img {
width: 300px;
height: 150px;
}
}
</style>
......@@ -53,7 +53,11 @@
<span>任务编码:</span>
<span>{{ resData.taskCode }}</span>
</div>
<div v-if="resData.isAuditGongye > 0" class="info-item">
<!-- 数字问卷没有审核人,自动通过的 -->
<div
v-if="resData.isAuditGongye > 0 && projectType !== 21"
class="info-item"
>
<span>服务商审核人:</span>
<span>{{ resData.csoAuditUser }}</span>
</div>
......@@ -67,7 +71,10 @@ import dateFormat from '@/utils/dateFormat';
export default {
props: {
from: String || Number,
resData: Object
resData: Object,
projectType: {
type: [Number, String]
}
},
methods: {
dateFormat(e) {
......
......@@ -4,7 +4,7 @@
-->
<template>
<div class="template-container">
<Header :from="from" :resData="resData"></Header>
<Header :from="from" :projectType="projectType" :resData="resData"></Header>
<component
:is="componentName"
:resData="resData"
......@@ -18,13 +18,13 @@
import Footer from './components/footer.vue';
import Header from './components/header.vue';
import Configurable from './components/configurable.vue';
import { makeSceneTaskInfo } from './api';
import { makeSceneTaskInfo, numQuestTaskInfo } from './api';
export default {
name: 'XrkTaskRecordPdf',
props: {
from: {
type: String,
default: '1'
default: '2'
},
projectType: {
type: [Number, String]
......@@ -46,10 +46,15 @@ export default {
};
},
created() {
makeSceneTaskInfo({ taskId: this.taskId }).then(res => {
this.resData = res.data;
});
console.log(this.from, 'v-if="+from===1"');
if ([20, 5].includes(this.projectType)) {
makeSceneTaskInfo({ taskId: this.taskId }).then(res => {
this.resData = res.data;
});
} else if ([21].includes(this.projectType)) {
numQuestTaskInfo({ taskId: this.taskId }).then(res => {
this.resData = res.data;
});
}
}
};
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!