Commit 7821a959 authored by gengchunlei's avatar gengchunlei

Merge branch 'chronic-dev' of http://gitlab.yiboshi.com/nightkis1995/frontend-h5 into chronic-dev

 Conflicts:
	src/doctor/Doctor.vue
parents f2053694 65827e46
...@@ -38,4 +38,9 @@ export function addDiagnose(params) { ...@@ -38,4 +38,9 @@ export function addDiagnose(params) {
// 修改诊断 // 修改诊断
export function updateDiagnose(params) { export function updateDiagnose(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/update`, body: params, loading: true }) return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/update`, body: params, loading: true })
}
//删除诊断
export function delDiagnose(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/delete`, body: params, loading: true })
} }
\ No newline at end of file
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
if (!token) { if (!token) {
token = sessionStorage.getItem('token') token = sessionStorage.getItem('token')
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
token = 'ce71f4f0-5464-4b22-9cad-5f53e66a8875' token = '779099b2-3d34-41ef-b14a-4a435fb48adb'
} }
} }
if (token) { if (token) {
...@@ -263,4 +263,40 @@ export default { ...@@ -263,4 +263,40 @@ export default {
flex-grow: 1; flex-grow: 1;
} }
} }
// 折叠面板
.doc-collapse {
margin-top: .1rem;
&::after {
display: none;
}
.van-cell {
padding: .1rem 0;
color: #8C8C8C;
font-weight: 600;
background: transparent;
&::after {
display: none;
}
.svg-icon {
font-size: .12rem;
transition: all .2s;
}
}
.van-collapse-item {
.van-collapse-item__content {
padding: 0;
color: #262626;
}
&::after {
display: none;
}
}
// 展开
.van-collapse-item__title--expanded {
.svg-icon {
transform: rotate(-180deg);
}
}
}
</style> </style>
...@@ -374,7 +374,12 @@ export default { ...@@ -374,7 +374,12 @@ export default {
this.$refs.form.validate().then(() => { this.$refs.form.validate().then(() => {
resolve(this.form) resolve(this.form)
}).catch((e) => { }).catch((e) => {
console.warn('ArchiveCommon error', e) reject('档案信息校验失败')
console.warn('档案信息校验失败', e)
const array = e || []
if (array.length) {
this.$refs.form.scrollToField(array[0].name)
}
}) })
}) })
} }
......
...@@ -105,8 +105,9 @@ export default { ...@@ -105,8 +105,9 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 90px; min-height: 90px;
border: 1px dashed #d9d9d9; // border: 1px dashed #d9d9d9;
background: #fafafa; // background: #fafafa;
background: #EFF2F7;
img { img {
width: 100%; width: 100%;
height: 90px; height: 90px;
......
<template> <template>
<div> <div>
<div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'> <div class='list gap-x-2.5 gap-y-1 flex items-center flex-wrap'>
<div v-for="(url, index) in imgList" :key="index" @click='toPreview(index)'> <div v-for="(url, index) in imgList" :key="index" @click='toPreview(index)'
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" /> class="flex gap-x-2.5">
<!-- <img :style="{width: imgSize.width, height: imgSize.height}" :src="url.trueDownloadUrl" /> -->
<DocImage :style="{width: imgSize.width, height: imgSize.height}" :src="url.trueDownloadUrl"/>
</div> </div>
</div> </div>
<van-overlay :show='imgShow' @click='imgShow = false'> <van-overlay :show='imgShow' @click='imgShow = false'>
...@@ -18,10 +20,22 @@ ...@@ -18,10 +20,22 @@
</template> </template>
<script> <script>
import DocImage from '../docImageUpload/DocImage.vue'
export default { export default {
name: 'imagePreview', name: 'imagePreview',
components: {
DocImage
},
props: { props: {
imgList: Array, imgList: Array,
imgSize: {
default: () => {
return {
width: '.97rem',
height: '.97rem'
}
}}
}, },
data() { data() {
return { return {
......
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
if (this.info.check) { if (this.info.check) {
let check = this.info.check let check = this.info.check
this.check = typeof check === 'string' ? check.split(',') : check this.check = typeof check === 'string' ? check.split(',') : check
this.checkName = this.store.getDictValue('CP00111', this.check)
} }
getInspectCode(2).then(res => { getInspectCode(2).then(res => {
console.log(res) console.log(res)
...@@ -152,7 +153,12 @@ export default { ...@@ -152,7 +153,12 @@ export default {
console.log(data, check) console.log(data, check)
resolve({ check, data }) resolve({ check, data })
}).catch((e) => { }).catch((e) => {
reject(e) reject('检查表单校验失败')
console.warn('检查表单校验失败', e)
const array = e || []
if (array.length) {
this.$refs.form.scrollToField(array[0].name)
}
}) })
}) })
}, },
......
...@@ -174,6 +174,7 @@ export default { ...@@ -174,6 +174,7 @@ export default {
if (this.info.inspect) { if (this.info.inspect) {
let inspect = this.info.inspect let inspect = this.info.inspect
this.inspect = typeof inspect === 'string' ? inspect.split(',') : inspect this.inspect = typeof inspect === 'string' ? inspect.split(',') : inspect
this.inspectName = this.store.getDictValue('CP00100', this.inspect)
} }
this.image = this.info.image this.image = this.info.image
this.imageData = this.info.imageData || [] this.imageData = this.info.imageData || []
...@@ -210,7 +211,12 @@ export default { ...@@ -210,7 +211,12 @@ export default {
console.log(data, inspect, image) console.log(data, inspect, image)
resolve({ inspect, data, image }) resolve({ inspect, data, image })
}).catch((e) => { }).catch((e) => {
reject(e) reject('检验表单校验失败')
console.warn('检验表单校验失败', e)
const array = e || []
if (array.length) {
this.$refs.form.scrollToField(array[0].name)
}
}) })
}) })
}, },
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
:excludeType="excludeType" :excludeType="excludeType"
:value="diseaseType" :value="diseaseType"
ref="DiseaseSelect"/> ref="DiseaseSelect"/>
<archiveCommon :info="baseInfo" v-else-if="step == 2"></archiveCommon> <archiveCommon :info="baseInfo" v-else-if="step == 2" ref="archiveCommon"></archiveCommon>
<FormCont :info="diagnoseInfo" v-else-if="step == 3"/> <FormCont :info="diagnoseInfo" v-else-if="step == 3" ref="FormCont"/>
</div> </div>
<div class="shrink-0"> <div class="shrink-0">
<div class='bottom-small-line'></div> <div class='bottom-small-line'></div>
...@@ -39,6 +39,7 @@ import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue' ...@@ -39,6 +39,7 @@ import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue' import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue'
import DiseaseSelect from './DiseaseSelect.vue' import DiseaseSelect from './DiseaseSelect.vue'
import FormCont from './FormCont.vue' import FormCont from './FormCont.vue'
import { useStore } from '@/doctor/store/index.js'
import { fetchDataHandle } from '@/utils/common.js' import { fetchDataHandle } from '@/utils/common.js'
import { getChronicResidentsId } from '@/api/doctor/generalFU' import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { showSuccessToast } from 'vant' import { showSuccessToast } from 'vant'
...@@ -53,6 +54,7 @@ export default { ...@@ -53,6 +54,7 @@ export default {
}, },
data() { data() {
return { return {
store: useStore(),
step: 1, step: 1,
// 患者基础信息 // 患者基础信息
baseInfo: {}, baseInfo: {},
...@@ -114,12 +116,24 @@ export default { ...@@ -114,12 +116,24 @@ export default {
} }
}, },
submit() { submit() {
showSuccessToast('提交成功') this.$refs.FormCont.submit().then(res => {
setTimeout(() => { if (!res) return
this.$router.replace({ console.log('FormCont.submit', res)
path: '/doctor/workbench' const query = {
...res,
residentsRecord: this.baseInfo
}
const func = query.id ? updateDiagnose : addDiagnose
func(query).then(() => {
this.store.onRefreshMark()
showSuccessToast('提交成功')
setTimeout(() => {
this.$router.replace({
path: '/doctor/workbench'
})
}, 600)
}) })
}, 600) })
}, },
// 上一步 // 上一步
toPrev() { toPrev() {
...@@ -131,6 +145,10 @@ export default { ...@@ -131,6 +145,10 @@ export default {
const diseaseType = await this.$refs.DiseaseSelect.submit() const diseaseType = await this.$refs.DiseaseSelect.submit()
console.log(diseaseType) console.log(diseaseType)
this.diagnoseInfo.diseaseType = diseaseType this.diagnoseInfo.diseaseType = diseaseType
} else if (this.step == 2) {
const baseInfo = await this.$refs.archiveCommon.onSubmit()
console.log(baseInfo)
this.baseInfo = baseInfo
} }
this.onStep(this.step + 1) this.onStep(this.step + 1)
} catch (e) { } catch (e) {
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
props: { props: {
// 排除已选择的疾病 // 排除已选择的疾病
excludeType: { default: () => [] }, excludeType: { default: () => [] },
value: { default: () => [] } value: Number
}, },
data() { data() {
return { return {
......
...@@ -139,7 +139,12 @@ export default { ...@@ -139,7 +139,12 @@ export default {
this.$refs.form.validate().then(() => { this.$refs.form.validate().then(() => {
resolve(this.form) resolve(this.form)
}).catch((e) => { }).catch((e) => {
reject(e) reject('医生信息校验失败')
console.warn('医生信息校验失败', e)
const array = e || []
if (array.length) {
this.$refs.form.scrollToField(array[0].name)
}
}) })
}) })
} }
......
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
name="diagnoseResult" name="diagnoseResult"
placeholder="请选择" placeholder="请选择"
@click="showOptions('diagnoseResult', 'CP00103', 'checkbox')" @click="showOptions('diagnoseResult', 'CP00103', 'checkbox')"
:rules="rules.requiredSelect"
/> />
<div class='doc-form-label' required>出血性脑卒中</div> <div class='doc-form-label' required>出血性脑卒中</div>
<van-field <van-field
...@@ -89,7 +88,6 @@ ...@@ -89,7 +88,6 @@
name="diagnoseLevel" name="diagnoseLevel"
placeholder="请选择" placeholder="请选择"
@click="showOptions('diagnoseLevel', 'CP00104')" @click="showOptions('diagnoseLevel', 'CP00104')"
:rules="rules.requiredSelect"
/> />
</template> </template>
<template v-else-if="[2,3].includes(diseaseType)"> <template v-else-if="[2,3].includes(diseaseType)">
...@@ -184,12 +182,13 @@ ...@@ -184,12 +182,13 @@
:disease="diseaseType" :disease="diseaseType"
:info="checkInfo" :info="checkInfo"
ref="check"/> ref="check"/>
<DoctorInfo :info="info"/> <DoctorInfo :info="info" ref="DoctorInfo"/>
</div> </div>
</template> </template>
<script> <script>
import { useStore } from '@/doctor/store' import { useStore } from '@/doctor/store'
import { fetchDataHandle } from '@/utils/common.js'
import InstpectCommon from '../common/Instpect.vue' import InstpectCommon from '../common/Instpect.vue'
import CheckCommon from '../common/Check.vue' import CheckCommon from '../common/Check.vue'
import DiagnosePicker from './DiagnosePicker.vue' import DiagnosePicker from './DiagnosePicker.vue'
...@@ -222,7 +221,12 @@ const defaultForm = (info = {}) => { ...@@ -222,7 +221,12 @@ const defaultForm = (info = {}) => {
isInspect: 2, isInspect: 2,
// 是否需要检查 // 是否需要检查
isCheck: 2, isCheck: 2,
diseaseType: undefined diseaseType: undefined,
checkItem: undefined,
checkItemName: undefined,
inspectItem: undefined,
inspectItemName: undefined,
source: undefined,
} }
Reflect.ownKeys(form).forEach(key => { Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) { if (info[key] != undefined) {
...@@ -360,8 +364,98 @@ export default { ...@@ -360,8 +364,98 @@ export default {
this.dateRange.min = new Date(date.year() - 20, date.month(), date.date()) this.dateRange.min = new Date(date.year() - 20, date.month(), date.date())
}, },
submit() { async submit() {
this.form.diseaseType = this.diseaseType try {
this.$refs.form.validate()
if (this.form.diseaseType === 4) {
const diagnoseResult = this.form.diagnoseResult || []
if (!diagnoseResult.length && !this.form.diagnoseLevel) {
this.$message.info('请在 缺血性脑卒中 和 出血性脑卒中 中选择一项填写')
this.$refs.form.scrollToField('diagnoseResult')
return
}
}
this.form.diagnoseInspectList = []
if (this.form.isInspect === 1) {
let { inspect: inspectItems, data, image} = await this.$refs.inspect.submit()
let inspectObj = {}
for (let item of data) {
if (inspectObj[item.insType] === void 0) {
inspectObj[item.insType] = []
}
const insItem = {
insType: item.insType,
insName: item.insName,
itemCode: item.itemCode,
itemName: item.itemName,
itemType: item.itemType,
itemValue: item.itemValue,
unit: item.unit
}
inspectObj[item.insType].push(insItem)
}
for (let diagType in inspectObj) {
let diagInspect = {
projectType: 0,
diagnoseType: diagType,
diagnoseName: inspectObj[diagType][0].insName,
inspectDetailed: JSON.stringify(inspectObj[diagType])
}
// inspectItems.push(inspectObj[diagType][0].insType)
this.form.diagnoseInspectList.push(diagInspect)
}
this.form.inspectItem = inspectItems
this.form.inspectFile = image
}
if (this.form.isCheck === 1) {
let { check: checkItems, data } = await this.$refs.check.submit()
let checkObj = {}, fileObj = {}
for (let item of data) {
if (item.itemType === 5 && item.itemValue !== void 0 && item.itemValue !== '') {
fileObj[item.insType] = item.itemValue
} else {
if (checkObj[item.insType] === void 0) {
checkObj[item.insType] = []
}
let checkItem = {
insType: item.insType,
insName: item.insName,
itemCode: item.itemCode,
itemName: item.itemName,
itemType: item.itemType,
itemValue: item.itemValue
}
checkObj[item.insType].push(checkItem)
}
}
for (let diagType in checkObj) {
let diagCheck = {
projectType: 1,
diagnoseType: diagType,
diagnoseName: checkObj[diagType][0].insName,
inspectDetailed: JSON.stringify(checkObj[diagType]),
inspectFile: fileObj[diagType]
}
// checkItems.push(checkObj[diagType][0].insType);
this.form.diagnoseInspectList.push(diagCheck)
}
this.form.checkItem = checkItems
}
const doctorInfo = await this.$refs.DoctorInfo.submit()
let query = fetchDataHandle(this.form, {
diagnoseResult: 'arrToStr'
})
return {
...query,
...doctorInfo
}
} catch(err) {
this.$message.info('表单校验不通过')
const array = err || []
if (array.length) {
this.$refs.form.scrollToField(array[0].name)
}
}
}, },
// 日期确定 // 日期确定
dateConfirm({ selectedValues }) { dateConfirm({ selectedValues }) {
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
</template> </template>
<script> <script>
import { useStore } from '@/doctor/store'
import { queryResidentInfo } from '@/api/doctor/resident.js' import { queryResidentInfo } from '@/api/doctor/resident.js'
import { showNotify } from 'vant' import { showNotify } from 'vant'
import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue' import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
...@@ -118,6 +119,7 @@ export default { ...@@ -118,6 +119,7 @@ export default {
}, },
data() { data() {
return { return {
store: useStore(),
residentInfoId: null, residentInfoId: null,
residentInfo: {}, residentInfo: {},
// 折叠 // 折叠
...@@ -190,6 +192,9 @@ export default { ...@@ -190,6 +192,9 @@ export default {
} }
queryResidentInfo({ residentInfoId: this.residentInfoId }).then(res => { queryResidentInfo({ residentInfoId: this.residentInfoId }).then(res => {
this.residentInfo = res.data || {} this.residentInfo = res.data || {}
if (!this.activeTabItem.value) {
this.activeTab = 0
}
}) })
}, },
onAddChange(val, option) { onAddChange(val, option) {
...@@ -221,6 +226,9 @@ export default { ...@@ -221,6 +226,9 @@ export default {
if (!val) return if (!val) return
this.residentInfo = {} this.residentInfo = {}
this.load() this.load()
},
'store.refreshMark'() {
this.load()
} }
} }
} }
......
...@@ -136,8 +136,9 @@ ...@@ -136,8 +136,9 @@
</template> </template>
<script> <script>
import { fetchDiseaseTypeList } from '@/api/doctor/disease.js' import { fetchDiseaseTypeList, delDiagnose } from '@/api/doctor/disease.js'
import { useStore } from '@/doctor/store' import { useStore } from '@/doctor/store'
import { showConfirmDialog } from 'vant'
export default { export default {
inject: ['residentInfo'], inject: ['residentInfo'],
...@@ -210,8 +211,20 @@ export default { ...@@ -210,8 +211,20 @@ export default {
} }
}) })
}, },
delBtn() { delBtn(record) {
showConfirmDialog({
message: '确定要删除吗?'
}).then(() => {
delDiagnose({ id: record.id }).then(res => {
setTimeout(() => {
this.$message.info('删除成功')
}, 600)
this.diagnoseRecord = this.diagnoseRecord.filter(e => e.id !== record.id)
if (!this.diagnoseRecord.length) {
this.store.onRefreshMark()
}
})
}).catch((err) => { console.warn('delDiagnoseBtn', err) })
} }
}, },
watch: { watch: {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<DocNavBar :title="`${id ? '修改' : '新增'}主要慢病高危筛查`" class="shrink-0" <DocNavBar :title="`${id ? '修改' : '新增'}主要慢病高危筛查`" class="shrink-0"
:backFunc="onBack" :hideBack="step == 3"></DocNavBar> :backFunc="onBack" :hideBack="step == 3"></DocNavBar>
<div class="p-4 overflow-y-auto grow" ref="all"> <div class="p-4 overflow-y-auto grow" ref="all">
<archiveCommon :info="baseInfo" v-if="step == 1"></archiveCommon> <archiveCommon :info="baseInfo" v-if="step == 1" ref="archiveCommon"></archiveCommon>
<FormCont :resident-info="baseInfo" :info="screenInfo" 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" :info="resultInfo"/> <Result v-else-if="step == 3" :info="resultInfo"/>
</div> </div>
...@@ -91,7 +91,15 @@ export default { ...@@ -91,7 +91,15 @@ export default {
} }
}, },
toNext(val) { toNext(val) {
if (val == 3) { if (val == 2) {
// 基础信息
this.$refs.archiveCommon.onSubmit().then(res => {
this.baseInfo = res
this.step = val
this.$refs.all.scrollTo(0, 0)
})
} else if (val == 3) {
// 筛查信息
this.$refs.FormCont.submit().then(res => { this.$refs.FormCont.submit().then(res => {
if (!res) return if (!res) return
console.log('FormCont.submit', res) console.log('FormCont.submit', res)
...@@ -108,10 +116,10 @@ export default { ...@@ -108,10 +116,10 @@ export default {
this.step = val this.step = val
}) })
}) })
return } else {
this.step = val
this.$refs.all.scrollTo(0, 0)
} }
this.step = val
this.$refs.all.scrollTo(0, 0)
}, },
onBack() { onBack() {
if (this.step == 1) { if (this.step == 1) {
......
...@@ -350,7 +350,7 @@ ...@@ -350,7 +350,7 @@
<script> <script>
import { useStore } from '@/doctor/store' import { useStore } from '@/doctor/store'
import { checkboxReject, fetchDataHandle } from '@/utils/common.js' import { checkboxReject } from '@/utils/common.js'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import DoctorInfo from './DoctorInfo.vue' import DoctorInfo from './DoctorInfo.vue'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue' import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
......
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