Commit 575e0c35 authored by songrui's avatar songrui

简易筛查 判断可筛查的癌种

parent f246f72e
...@@ -19,3 +19,8 @@ export function getInspectCode() { ...@@ -19,3 +19,8 @@ export function getInspectCode() {
export function getSimpleScreenYears(id, loading = true) { export function getSimpleScreenYears(id, loading = true) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/years-simple/${id}`, loading}) return fetchBase({ url: `/tumour-admin/v1/h5-app/years-simple/${id}`, loading})
} }
// 居民确诊癌种 residentId
export function getDisease(residentId, loading = true) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/query-disease/${residentId}`, loading})
}
...@@ -182,7 +182,9 @@ ...@@ -182,7 +182,9 @@
<van-checkbox-group v-model="form.species" class="pt-2 pl-2"> <van-checkbox-group v-model="form.species" class="pt-2 pl-2">
<van-checkbox v-for="(item, index) in cancerArray" :key="index" <van-checkbox v-for="(item, index) in cancerArray" :key="index"
:name="item.value" shape="square" :name="item.value" shape="square"
:disabled="speciesChecked.includes(item.value + '')" :disabled="speciesChecked.includes(item.value + '') ||
form.gender == 2 && [9].includes(item.value) ||
form.gender == 1 && [5].includes(item.value)"
class="mb-3">{{ item.name }}</van-checkbox> class="mb-3">{{ item.name }}</van-checkbox>
</van-checkbox-group> </van-checkbox-group>
</template> </template>
...@@ -197,7 +199,7 @@ import { idCardRule, mobileValidator } from '@/utils/commonReg.js' ...@@ -197,7 +199,7 @@ import { idCardRule, mobileValidator } from '@/utils/commonReg.js'
import { useStore } from '@/tumour/store/index.js' import { useStore } from '@/tumour/store/index.js'
import { getResidentInfo } from '@/tumour/api/base.js' import { getResidentInfo } from '@/tumour/api/base.js'
import { getDictValue } from '@/tumour/utils/dictionaries.js' import { getDictValue } from '@/tumour/utils/dictionaries.js'
import { getSimpleScreenYears } from '@/tumour/api/screening.js' import { getSimpleScreenYears, getDisease } from '@/tumour/api/screening.js'
import { showToast, showConfirmDialog } from 'vant' import { showToast, showConfirmDialog } from 'vant'
import DocAddress from '@/components/docAddress/DocAddress.vue' import DocAddress from '@/components/docAddress/DocAddress.vue'
...@@ -295,7 +297,9 @@ export default { ...@@ -295,7 +297,9 @@ export default {
species: [{ required: true, message: '请选择' }] species: [{ required: true, message: '请选择' }]
}, },
// 已筛查过的癌种 // 已筛查过的癌种
speciesChecked: [] speciesChecked: [],
// 确诊的癌种
diseaseList: []
} }
}, },
setup() { setup() {
...@@ -305,6 +309,7 @@ export default { ...@@ -305,6 +309,7 @@ export default {
computed: { computed: {
cancerArray() { cancerArray() {
const exclude = [11, 99] const exclude = [11, 99]
exclude.push(...this.diseaseList.map(e => e.species))
return this.store.getDict('DC00032').filter(e => !exclude.includes(e.value)) return this.store.getDict('DC00032').filter(e => !exclude.includes(e.value))
}, },
}, },
...@@ -313,14 +318,17 @@ export default { ...@@ -313,14 +318,17 @@ export default {
getInfo() { getInfo() {
const idCard = this.form.idCard const idCard = this.form.idCard
if (!idCard || idCardRule.validator(idCard)) return if (!idCard || idCardRule.validator(idCard)) return
this.diseaseList = []
getResidentInfo(idCard).then(res => { getResidentInfo(idCard).then(res => {
const result = res.data || {} const result = res.data || {}
if (result.id) { if (result.id) {
this.form = defaultForm({ this.form = defaultForm({
...result, ...result,
residentId: result.id,
id: null, id: null,
species: [] species: []
}) })
this.loadDisease(result.id)
return return
} }
const info = getInfoByIdCard(idCard) const info = getInfoByIdCard(idCard)
...@@ -372,6 +380,12 @@ export default { ...@@ -372,6 +380,12 @@ export default {
// }).catch(() => {}) // }).catch(() => {})
}) })
}, },
// 获取确诊癌症
loadDisease(residentId) {
getDisease(residentId).then(res => {
this.diseaseList = res.data
})
},
submit() { submit() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
......
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