Merge branch 'nbs' into dev

This commit is contained in:
lihaoda
2020-02-07 17:39:18 +08:00
6 changed files with 89 additions and 11 deletions

View File

@@ -57,3 +57,11 @@ export function nbsTable(data) {
data
})
}
export function makePDF(data) {
return request({
url: getUrl('/proposal/nbs/getPdfInfo', 1),
method: 'post',
data
})
}

View File

@@ -7,6 +7,7 @@ let nbsBase = () => import('@/views/ebiz/nbs/Base')
let nbsNecessary = () => import('@/views/ebiz/nbs/Necessary')
let nbsPrepared = () => import('@/views/ebiz/nbs/Prepared')
let nbsDetail = () => import('@/views/ebiz/nbs/Detail')
let nbsPDF = () => import('@/views/ebiz/nbs/PDF')
export default [
{
path: '/nbs/list',
@@ -36,7 +37,7 @@ export default [
}
},
{
path: '/nbs/result/:id',
path: '/nbs/result/:id/:half/:nbsState',
name: 'nbsResult',
component: nbsResult,
meta: {
@@ -88,5 +89,14 @@ export default [
title: '资料',
index: 9
}
},
{
path: '/nbs/pdf/:id',
name: 'nbsPDF',
component: nbsPDF,
meta: {
title: 'PDF',
index: 10
}
}
]

View File

@@ -22,7 +22,7 @@
>销售成功</van-button
>
<van-button class="ml5" type="danger" size="small" round @click="entryDetail(item.orderNo)">资料</van-button>
<van-button class="ml5" type="danger" size="small" round @click="entryReport(item.orderNo)">报告</van-button>
<van-button class="ml5" type="danger" size="small" round @click="entryReport(item.orderNo, item.flag)">报告</van-button>
<van-button class="ml5" type="danger" size="small" round plain @click="del(item.orderNo, index)">删除</van-button>
</template>
</div>
@@ -159,14 +159,15 @@ export default {
}
})
},
entryReport(id) {
entryReport(id, flag) {
const state = this.params.nbsState
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/nbs/result/${id}`
url: location.origin + `/#/nbs/result/${id}/${flag}/${state}`
},
routerInfo: {
path: `/nbs/result/${id}`
path: `/nbs/result/${id}/${flag}/${state}`
}
})
}

View File

@@ -32,7 +32,8 @@ import { nbsDetail, saveForm } from '@/api/ebiz/nbs'
export default {
data() {
return {
status: -1 //-1还未填写 0填完基本信息 1填完应备费用 2填完已备费用
status: -1, //-1还未填写 0填完基本信息 1填完应备费用 2填完已备费用
half: null //这个值表示是否添加了配偶
}
},
created() {
@@ -44,7 +45,9 @@ export default {
nbsState: localStorage.getItem('nbsState')
}).then(res => {
if (res.result === '0') {
this.status = Number(res.content.type)
const content = res.content
this.status = Number(content.type)
this.half = content.flag
} else {
this.$toast(res.resultMessage)
this.$jump({
@@ -96,10 +99,10 @@ export default {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/nbs/result/${id}`
url: location.origin + `/#/nbs/result/${id}/${this.half}/02`
},
routerInfo: {
path: `/nbs/result/${id}`
path: `/nbs/result/${id}/${this.half}/02`
}
})
} else {

View File

@@ -0,0 +1,17 @@
<template>
<iframe style="width:100vw;height:100vh" :src="pdfUrl"></iframe>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
pdfUrl: ''
}
},
created() {
const pdfUrl = encodeURIComponent(config.imgDomain + '/returnDirectStream?imgPath=' + this.$route.params.id)
this.pdfUrl = location.origin + '/pdfjs/web/viewer.html?file=' + pdfUrl
}
}
</script>

View File

@@ -5,11 +5,46 @@
</div>
<div class="mt50 fs18 text-center">报告已生成点击查看</div>
<div>
<div class="result-button">经济支柱为客户本人</div>
<div class="result-button">经济支柱为客户配偶</div>
<div class="result-button" @click="makePDF('00')">经济支柱为客户本人</div>
<div class="result-button" :class="{'result-button-disabled': !isHalfActive}" @click="isHalfActive && makePDF('01')">经济支柱为客户配偶</div>
</div>
</div>
</template>
<script>
import { makePDF } from '@/api/ebiz/nbs'
export default {
created () {
},
data() {
return {
isHalfActive: this.$route.params.half === '0'
}
},
methods: {
makePDF(type) {
makePDF({
nbsState: this.$route.params.nbsState,
orderNo: this.$route.params.id,
nbsCalculusResDTO: {
type
}
}).then(res => {
let content = res.content
this.$jump({
flag: 'h5',
extra: {
url: location.origin + `/#/nbs/pdf/${content}`
},
routerInfo: {
path: `/nbs/pdf/${content}`
}
})
})
}
}
}
</script>
<style lang="scss" scoped>
.success-icon {
font-size: 100px;
@@ -28,5 +63,9 @@
&:first-child {
margin-top: 200px;
}
&-disabled {
color: #666;
border-color: #666;
}
}
</style>