Commit 575e0c35 authored by songrui's avatar songrui

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

parent f246f72e
......@@ -19,3 +19,8 @@ export function getInspectCode() {
export function getSimpleScreenYears(id, loading = true) {
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 @@
<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"
: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>
</van-checkbox-group>
</template>
......@@ -197,7 +199,7 @@ import { idCardRule, mobileValidator } from '@/utils/commonReg.js'
import { useStore } from '@/tumour/store/index.js'
import { getResidentInfo } from '@/tumour/api/base.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 DocAddress from '@/components/docAddress/DocAddress.vue'
......@@ -295,7 +297,9 @@ export default {
species: [{ required: true, message: '请选择' }]
},
// 已筛查过的癌种
speciesChecked: []
speciesChecked: [],
// 确诊的癌种
diseaseList: []
}
},
setup() {
......@@ -305,6 +309,7 @@ export default {
computed: {
cancerArray() {
const exclude = [11, 99]
exclude.push(...this.diseaseList.map(e => e.species))
return this.store.getDict('DC00032').filter(e => !exclude.includes(e.value))
},
},
......@@ -313,14 +318,17 @@ export default {
getInfo() {
const idCard = this.form.idCard
if (!idCard || idCardRule.validator(idCard)) return
this.diseaseList = []
getResidentInfo(idCard).then(res => {
const result = res.data || {}
if (result.id) {
this.form = defaultForm({
...result,
residentId: result.id,
id: null,
species: []
})
this.loadDisease(result.id)
return
}
const info = getInfoByIdCard(idCard)
......@@ -372,6 +380,12 @@ export default {
// }).catch(() => {})
})
},
// 获取确诊癌症
loadDisease(residentId) {
getDisease(residentId).then(res => {
this.diseaseList = res.data
})
},
submit() {
return new Promise((resolve) => {
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