Commit 8fa86e09 authored by songrui's avatar songrui

简易筛查表单接口对接

parent b186fe49
import { fetchBase } from './fetch.js'
// 简易筛查 新增
export function addSimpleScreen(params, loading = true) {
return fetchBase({ url: `/v1/h5-app/add-simple-screen`, body: params, loading })
}
......@@ -455,8 +455,9 @@ export function getQuestion(key, info) {
remark: '建议进一步检查前列腺特异性抗原、前列腺特异性抗原正常—定期复查、前列腺特异性抗原升—高前列腺磁共振及穿刺活检'
}
}
const result = questions['q' + key]
return result ? new Question(result, info) : {}
const q = questions['q' + key]
const result = q ? new Question(q, info) : {}
return { ...result, key }
}
class Question {
......
......@@ -35,7 +35,8 @@ export default {
// 操作步骤
setp: 1,
// 步骤1中选中的癌种
species: []
species: [],
baseInfo: {}
}
},
computed: {
......@@ -53,13 +54,18 @@ export default {
onNext() {
this.$refs.base.submit().then(res => {
console.log(res)
this.baseInfo = res
this.species = res.species || []
this.setp = 2
})
},
submit() {
this.$refs.question.submit().then(res => {
console.log(res)
const result = {
...this.baseInfo,
details: res
}
console.log(result)
})
}
......
......@@ -8,7 +8,7 @@
:label="q.title"
:rules="[{ required: true, message: '请选择' }]">
<template #input>
<van-radio-group v-model="q.value" @change="onChange($event, item)">
<van-radio-group v-model="q.value" @change="onChange($event, item)" class="pl-2">
<van-radio v-for="a in q.answer.cont" shape="dot" class="mt-2"
:name="a.value" :key="a.value">{{a.name}}</van-radio>
</van-radio-group>
......@@ -65,15 +65,26 @@ export default {
console.log(this.formData)
},
onChange(val, item) {
console.log(val, item)
console.log('高危判断', item.check())
// console.log(val, item)
// console.log('高危判断', item.check())
item.highRisk = item.check() ? 1 : 2
},
submit() {
return new Promise((resolve) => {
this.$refs.form.validate().then(res => {
console.log(res, this.formData)
resolve(this.formData)
const result = {}
this.formData.forEach(e => {
const issue = {}
e.issue.forEach(i => {
issue[i.key] = i.value
})
result[e.key] = {
highRisk: e.highRisk,
...issue
}
})
resolve(result)
}).catch(err => {
console.warn(err)
})
......
......@@ -176,7 +176,7 @@
label-width="100%"
:rules="rules.species">
<template #input>
<van-checkbox-group v-model="form.species" class="pt-2">
<van-checkbox-group v-model="form.species" class="pt-2 pl-2">
<van-checkbox v-for="(item, index) in cancerArray" :key="index"
:name="item.value" shape="square"
class="mb-3">{{ item.name }}</van-checkbox>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment