Commit 43dbeb24 authored by songrui's avatar songrui

添加全局message;初筛校验修改

parent 13b24a20
......@@ -7,7 +7,7 @@ export function getScreenAllList(residentInfoId, loading) {
// 慢病高危筛查详情
export function firstScreenDetail(params) {
return fetchBase({ url: `/chronic-resident/v1/chronic-screening-record/screening-detail`, body: params, loading: true })
return fetchBase({ url: `/chronic-resident/v1/chronic-screening-record/record`, body: params, loading: true })
}
// 慢病专病筛查详情
......
......@@ -71,7 +71,6 @@
</template>
<script>
import { showToast } from 'vant'
import { getTemplateDetail } from '@/api/doctor/workbench'
import Mp3 from '@/doctor/components/mediaPlay/Mp3.vue'
import Mp4 from '@/doctor/components/mediaPlay/Mp4.vue'
......@@ -114,7 +113,7 @@ export default {
methods: {
async load() {
if (!this.id) {
showToast('未获取到信息')
this.$message.info('未获取到信息')
return
}
let par = {
......
......@@ -91,7 +91,6 @@
</template>
<script>
import { showToast } from 'vant'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn'
import { getTemplateByPage } from '@/api/doctor/workbench'
import { useStore } from '@/doctor/store'
......
......@@ -61,7 +61,6 @@
</div>
</div>
</van-form>
</template>
......
......@@ -17,7 +17,6 @@
<script>
import { useStore } from '@/doctor/store/index.js'
import { showToast } from 'vant'
export default {
props: {
......@@ -39,7 +38,7 @@ export default {
submit() {
return new Promise((resolve, reject) => {
if (!this.diseaseType) {
showToast('请选择慢病类型')
this.$message.info('请选择慢病类型')
reject('请选择慢病类型')
return
}
......
......@@ -248,7 +248,6 @@
</template>
<script>
import { showToast } from 'vant'
import Mp3 from '@/doctor/components/mediaPlay/Mp3.vue'
import Mp4 from '@/doctor/components/mediaPlay/Mp4.vue'
import ImagePreview from '@/residentWX/components/imagePreview/imagePreview'
......@@ -376,7 +375,7 @@ export default {
methods: {
async load() {
if (!this.routerDetail.relationId) {
showToast('未获取到信息')
this.$message.info('未获取到信息')
return
}
let par = {
......
......@@ -193,7 +193,7 @@
import { useStore } from '@/resident/store'
import dayjs from 'dayjs'
import DocIcon from '@/components/docIcon/DocIcon'
import { showFailToast, showToast } from 'vant'
import { showFailToast } from 'vant'
import { fetchDataHandle, uniqueArr } from '@/utils/common'
import DocImageUpload from '@/doctor/components/docImageUpload/DocImageUpload'
import TemList from '@/doctor/components/template/temList'
......
......@@ -93,7 +93,7 @@
<script>
import { queryResidentInfo } from '@/api/doctor/resident.js'
import { showNotify, showToast } from 'vant'
import { showNotify } from 'vant'
import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import ChronicTag from '@/doctor/components/chronicTag/ChronicTag.vue'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
......@@ -195,7 +195,7 @@ export default {
onAddChange(val, option) {
console.log(val, option)
if (this.deathStatus === 9) {
showToast('该患者已死亡')
this.$message.info('该患者已死亡')
return
}
this.addVisible = false
......
......@@ -94,7 +94,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
}
......
......@@ -141,7 +141,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
if (record.serveType === 5) {
......
......@@ -57,7 +57,6 @@
<script>
import { fetchCurrencyList, delCurrencyById } from '@/api/doctor/generalFU.js'
import { showToast } from 'vant'
import { useStore } from '@/doctor/store'
export default {
......@@ -125,7 +124,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......
......@@ -98,7 +98,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
}
......
......@@ -103,7 +103,6 @@
<script>
import { useStore } from '@/doctor/store'
import { getScreenAllList } from '@/api/doctor/screening.js'
import { showToast } from 'vant'
export default {
inject: ['residentInfo'],
......@@ -151,7 +150,7 @@ export default {
toFirstDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......@@ -165,7 +164,7 @@ export default {
toSecondDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......
......@@ -128,7 +128,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.id == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
if (record.serveType == 3) {
......
......@@ -68,7 +68,7 @@
</van-popup>
<div class='doc-form-label'>年龄</div>
<van-field v-model="form.currentAge"
<van-field :modelValue="form.currentAge"
name="currentAge"
type="digit"
placeholder="请输入年龄"
......@@ -326,7 +326,7 @@
</template>
</van-field>
<DoctorInfo />
<DoctorInfo :info="info" ref="DoctorInfo"/>
<div class='doc-form-label' required>筛查日期</div>
<van-field
......@@ -417,7 +417,8 @@ export default {
BloodPressureBt
},
props: {
info: { default: () => ({}) }
info: { default: () => ({}) },
residentInfo: { default: () => ({}) },
},
inject: ['pressureObj'],
data() {
......@@ -490,8 +491,50 @@ export default {
result.push(e)
})
return result
},
// 筛查高危项目
highItem() {
const {currentAge, waistline, familyHistory = [], isSmoking, gender,
pressureOneSbp, pressureOneDbp, pressureTwoSbp, pressureTwoDbp,
fastingGlucose, ldlCholesterin, serumCholesterin} = this.form
let list = []
if (currentAge >= 50) {
list.push(1)
}
let bmi = parseFloat(this.bmi)
if ((bmi >= 24)||
(gender == 2 && waistline >=80) ||
(gender == 1 && waistline >=85) ){
list.push(2)
}
if (isSmoking == 1) {
list.push(3)
}
if (familyHistory && familyHistory.length && (familyHistory.includes(1) || familyHistory.includes(2) ||
familyHistory.includes(3) || familyHistory.includes(4) || familyHistory.includes(5) || familyHistory.includes(6))) {
list.push(4)
}
if ((pressureOneSbp >= 130 || pressureTwoSbp >= 130) ||
(pressureOneDbp >= 85 || pressureTwoDbp >= 85)
) {
list.push(5)
}
if (fastingGlucose >= 6.1) {
list.push(6)
}
// if (ldlCholesterin >= 3.4) {
// list.push(7)
// }
if (serumCholesterin >= 5.2) {
list.push(7)
}
list = Array.from(new Set(list))
return list
}
},
created() {
this.init()
},
methods: {
init() {
const date = dayjs()
......@@ -500,8 +543,23 @@ export default {
this.screenDateRange.max = new Date(date.year(), date.month(), date.date())
this.screenDateRange.min = new Date(date.year() - 20, date.month(), date.date())
},
submit() {
return this.$refs.form.validate()
async submit() {
try {
await this.$refs.form.validate()
const result = {
...this.form,
...this.$refs.DoctorInfo.submit()
}
return result
} catch (err) {
console.warn(err)
this.$message.info('表单校验不通过')
const array = err || []
if (array.length) {
this.$refs.form.scrollToField(array[0].name)
}
}
},
// 既往史
medicalConfirm() {
......@@ -529,8 +587,9 @@ export default {
this.showScreenDate = false
},
resultHandle() {
const {currentAge, height = 0, weight = 0, waistline, familyHistory = [], isSmoking, gender,
pressureOneSbp, pressureOneDbp, pressureTwoSbp, pressureTwoDbp, fastingGlucose, ldlCholesterin, serumCholesterin} = this.form
const {currentAge, waistline, familyHistory = [], isSmoking, gender,
pressureOneSbp, pressureOneDbp, pressureTwoSbp, pressureTwoDbp,
fastingGlucose, ldlCholesterin, serumCholesterin} = this.form
let list = []
if (currentAge >= 50) {
list.push(1)
......@@ -593,6 +652,16 @@ export default {
this.form.bmi = this.bmi
},
immediate: true
},
highItem: {
handler(val) {
this.form.highItem = val
if (val.length >= 3){
this.form.screenResult = 2
}else {
this.form.screenResult = 1
}
},
}
}
}
......
......@@ -4,7 +4,7 @@
:backFunc="onBack"></DocNavBar>
<div class="p-4 overflow-y-auto grow" ref="all">
<archiveCommon :info="baseInfo" v-if="step == 1"></archiveCommon>
<FormCont v-else-if="step == 2" ref="FormCont"/>
<FormCont :resident-info="baseInfo" :info="screenInfo" v-else-if="step == 2" ref="FormCont"/>
<Result v-else-if="step == 3" :residentInfoId="residentInfoId"/>
</div>
<div class="shrink-0" v-if="step !== 3">
......@@ -29,6 +29,8 @@ import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue'
import FormCont from './FormCont.vue'
import Result from './Result.vue'
import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { firstScreenDetail } from '@/api/doctor/screening.js'
import { fetchDataHandle } from '@/utils/common.js'
export default {
components: {
......@@ -41,7 +43,9 @@ export default {
return {
step: 1,
// 患者基础信息
baseInfo: {}
baseInfo: {},
// 筛查信息
screenInfo: {}
}
},
computed: {
......@@ -58,15 +62,27 @@ export default {
methods: {
async init() {
if (this.id) {
const res = await firstScreenDetail({id: this.id})
const result = res.data || {}
this.screenInfo = fetchDataHandle(result, {
medicalHistory: 'strToArrNum',
familyHistory: 'strToArrNum',
highItem: 'strToArrNum'
})
this.baseInfo = this.screenInfo.residentsRecord
console.log(this.screenInfo)
} else {
let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {}
this.screenInfo.currentAge = this.baseInfo.currentAge
this.screenInfo.residentInfoId = this.residentInfoId
}
},
toNext(val) {
if (val == 3) {
this.$refs.FormCont.submit()
this.$refs.FormCont.submit().then(res => {
console.log('FormCont.submit', res)
})
return
}
this.step = val
......
......@@ -14,7 +14,6 @@
<script>
import { useStore } from '@/doctor/store/index.js'
import { showToast } from 'vant'
export default {
props: {
......
......@@ -104,7 +104,6 @@ import { getBeSecondScreenByPage, addIgnoreRecord } from '@/api/doctor/workbench
import { useStore } from '@/doctor/store'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import IdCardScan from '@/doctor/components/idCardScan/IdCardScan.vue'
import { showToast } from 'vant'
const DefaultForm = {
// 数据来源,[DC00051]
......@@ -220,7 +219,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.residentInfoId == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......@@ -232,7 +231,7 @@ export default {
},
toScreen(record) {
if (record.residentInfoId == null) {
showToast('暂时无法进行筛查')
this.$message.info('暂时无法进行筛查')
return
}
this.$router.push({
......@@ -250,7 +249,7 @@ export default {
addIgnoreRecord(params).then(() => {
this.list = this.list.filter(e => e.screenId !== record.screenId)
setTimeout(() => {
showToast('操作成功')
this.$message.info('操作成功')
}, 800);
})
}
......
......@@ -108,7 +108,6 @@ import { useStore } from '@/doctor/store'
import { getDiagnoseByPage, addIgnoreRecord } from '@/api/doctor/workbench.js'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import IdCardScan from '@/doctor/components/idCardScan/IdCardScan.vue'
import { showToast } from 'vant'
const DefaultForm = {
// 数据来源,[DC00051]
......@@ -250,7 +249,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.residentInfoId == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......@@ -262,7 +261,7 @@ export default {
},
toDiagnose(record) {
if (record.residentInfoId == null) {
showToast('暂时无法进行诊断')
this.$message.info('暂时无法进行诊断')
return
}
this.$router.push({
......@@ -282,7 +281,7 @@ export default {
addIgnoreRecord(params).then(() => {
this.list = this.list.filter(e => e.id !== record.id)
setTimeout(() => {
showToast('操作成功')
this.$message.info('操作成功')
}, 800);
})
},
......
......@@ -116,7 +116,6 @@ import { useStore } from '@/doctor/store'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import IdCardScan from '@/doctor/components/idCardScan/IdCardScan.vue'
import DocUnit from '@/doctor/components/docUnit/DocUnit.vue'
import { showToast } from 'vant'
const DefaultForm = {
// 转出单位id
......@@ -235,7 +234,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.residentInfoId == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......@@ -253,7 +252,7 @@ export default {
ignoreReceive(params).then(() => {
this.list = this.list.filter(e => e.id !== record.id)
setTimeout(() => {
showToast('操作成功')
this.$message.info('操作成功')
}, 800);
})
}
......
......@@ -125,7 +125,6 @@ import { getVisitByPage, delVisit } from '@/api/doctor/workbench.js'
import ChronicTag from '@/doctor/components/chronicTag/ChronicTag.vue'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import IdCardScan from '@/doctor/components/idCardScan/IdCardScan.vue'
import { showToast } from 'vant'
const DefaultForm = {
// 数据来源,[CP00124]
......@@ -267,7 +266,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.residentInfoId == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......@@ -281,7 +280,7 @@ export default {
delVisit({ id: record.id }).then(() => {
this.list = this.list.filter(e => e.id !== record.id)
setTimeout(() => {
showToast('操作成功')
this.$message.info('操作成功')
}, 800);
})
},
......
......@@ -110,7 +110,6 @@ import { getWorkByPage } from '@/api/doctor/workbench.js'
import { useStore } from '@/doctor/store'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import IdCardScan from '@/doctor/components/idCardScan/IdCardScan.vue'
import { showToast } from 'vant'
const DefaultForm = {
// 数据来源,[DC00051]
......@@ -224,7 +223,7 @@ export default {
toDetail(record) {
if (!record) return
if (record.residentInfoId == null) {
showToast('暂时无法查看 详情信息')
this.$message.info('暂时无法查看 详情信息')
return
}
this.$router.push({
......
......@@ -3,7 +3,7 @@ import 'vant/es/toast/style/index'
import 'vant/es/notify/style/index'
import 'vant/es/dialog/style/index'
import 'vant/es/image-preview/style/index'
import { DatePicker } from 'vant'
import { DatePicker, showToast, showSuccessToast, showFailToast } from 'vant'
// 自定义svg 图标组件
import DocIcon from '@/components/docIcon/index'
......@@ -21,6 +21,11 @@ export function registe(app) {
app.config.globalProperties.$idCardHide = idCardHide
app.config.globalProperties.$phoneHide = phoneHide
app.config.globalProperties.$addrJoin = addrJoin
app.config.globalProperties.$message = {
info: showToast,
success: showSuccessToast,
fail: showFailToast
}
// 日期选择框默认选中当前日期
DatePicker.props.modelValue.default = () => {
......
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