Commit b3e2ebf3 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 6fd4f53f 36a0fee3
......@@ -18,4 +18,24 @@ export function getInspectCode(configType) {
//查询疾病编码(诊断名称)
export function queryDiseaseCode(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-disease-code/icd-list`, body: params, loading: true })
}
//获取诊断详细信息
export function getDiagnoseDetail(id){
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/record`,body:{ id: id }, loading: true })
}
// 根据病种和居民id查询已经有诊断信息
export function getDiagnoseFirst(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/first-record`, body: params, loading: true })
}
// 新增诊断
export function addDiagnose(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/save`, body: params, loading: true })
}
// 修改诊断
export function updateDiagnose(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-diagnose-record/update`, body: params, loading: true })
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ export default {
if (!token) {
token = sessionStorage.getItem('token')
if (process.env.NODE_ENV !== 'production') {
token = 'c6a57b4f-20c4-4b12-961c-c41989b121c0'
token = 'f44efca7-3c9b-4638-b8b0-8e35c6fbb54b'
}
}
if (token) {
......
......@@ -45,6 +45,9 @@ export default {
methods: {
init() {
this.innerValue = this.value
this.multipleCheck()
},
multipleCheck() {
if (this.multiple) {
if (this.value != null && !Array.isArray(this.value)) {
console.warn('CheckBtn: multiple must be Array type')
......@@ -92,6 +95,7 @@ export default {
value: {
handler(value) {
this.innerValue = value
this.multipleCheck()
},
immediate: true
},
......
......@@ -98,10 +98,10 @@
@change="onSelectInputConfirm"></InputSelect>
</div>
<van-field name="imageData"
class="no-back mb-2"
class="no-back"
label="图片上传"
label-align="top"
style="order: 99">
style="padding: 0">
<template #input>
<DocImageUpload :imageData="imageData"
@change="(ids, option) => image = ids"
......
......@@ -3,9 +3,12 @@
<DocNavBar :title="`${id ? '修改' : '新增'}慢病诊断`" class="shrink-0"
:backFunc="onBack"></DocNavBar>
<div class="p-4 overflow-y-auto grow" ref="all">
<DiseaseSelect v-if="step == 1" :excludeType="excludeType" ref="DiseaseSelect"/>
<DiseaseSelect v-if="step == 1"
:excludeType="excludeType"
:value="diseaseType"
ref="DiseaseSelect"/>
<archiveCommon :info="baseInfo" v-else-if="step == 2"></archiveCommon>
<FormCont :diseaseType="innerDiseaseType" v-else-if="step == 3"/>
<FormCont :info="diagnoseInfo" v-else-if="step == 3"/>
</div>
<div class="shrink-0">
<div class='bottom-small-line'></div>
......@@ -36,8 +39,10 @@ import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue'
import DiseaseSelect from './DiseaseSelect.vue'
import FormCont from './FormCont.vue'
import { fetchDataHandle } from '@/utils/common.js'
import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { showSuccessToast } from 'vant'
import { getDiagnoseDetail, getDiagnoseFirst, addDiagnose, updateDiagnose } from '@/api/doctor/disease.js'
export default {
components: {
......@@ -51,7 +56,8 @@ export default {
step: 1,
// 患者基础信息
baseInfo: {},
innerDiseaseType: null
// 诊断信息
diagnoseInfo: {}
}
},
computed: {
......@@ -59,11 +65,15 @@ export default {
return this.$route.query.id
},
diseaseType() {
return this.$route.query.diseaseType
const val = this.$route.query.diseaseType
return val ? +val : undefined
},
residentInfoId() {
return this.$route.query.residentInfoId
},
idCard() {
return this.$route.query.idCard
},
excludeType() {
const excludeType = this.$route.query.excludeType
return excludeType && excludeType.split(',').map(e => Number(e))
......@@ -75,10 +85,32 @@ export default {
methods: {
async init() {
if (this.id) {
const res = await getDiagnoseDetail(this.id)
const result = res.data || {}
this.diagnoseInfo = fetchDataHandle(result, {
diagnoseResult: 'strToArrNum'
})
this.baseInfo = result.residentsRecord || {}
} else {
let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {}
if (this.residentInfoId) {
let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {}
this.diagnoseInfo.residentInfoId = this.residentInfoId
} else if (this.idCard) {
// 新建用户
this.baseInfo.idCard = this.idCard
}
if (this.diseaseType) {
this.diagnoseInfo.diseaseType = this.diseaseType
const res = await getDiagnoseFirst({
residentInfoId: this.residentInfoId,
diseaseType: this.diseaseType
})
const firstInfo = res.data || {}
this.diagnoseInfo.manageDate = firstInfo.manageDate
this.diagnoseInfo.icdCode = firstInfo.icdCode
this.diagnoseInfo.diseaseName = firstInfo.diseaseName
}
}
},
submit() {
......@@ -98,9 +130,9 @@ export default {
if (this.step == 1) {
const diseaseType = await this.$refs.DiseaseSelect.submit()
console.log(diseaseType)
this.innerDiseaseType = diseaseType
this.diagnoseInfo.diseaseType = diseaseType
}
this.onStep(this.step + 1)
this.onStep(this.step + 1)
} catch (e) {
console.warn(e)
}
......
......@@ -21,7 +21,8 @@ import { useStore } from '@/doctor/store/index.js'
export default {
props: {
// 排除已选择的疾病
excludeType: { default: () => [] }
excludeType: { default: () => [] },
value: { default: () => [] }
},
data() {
return {
......@@ -33,6 +34,10 @@ export default {
methods: {
onSelect(item) {
if (this.excludeType.includes(item.value)) return
if (this.value) {
this.$message.info('无法修改已选中的慢病类型')
return
}
this.diseaseType = item.value
},
submit() {
......@@ -45,6 +50,14 @@ export default {
resolve(this.diseaseType)
})
}
},
watch: {
value: {
handler(val) {
this.diseaseType = val
},
immediate: true
}
}
}
</script>
......
<template>
<van-form ref='form' class="doc-form doctor-info">
<div class="doc-form-label" required>诊断单位</div>
<van-field is-link
v-model='form.diseaseUnitName'
readonly
placeholder='请选择'
name="diseaseUnitId"
/>
<div class="doc-form-label" required>诊断科室</div>
<van-field is-link
v-model='form.diseaseOfficeName'
readonly
placeholder='请选择'
name="diseaseOfficeId"
@click="showOffice = true"
:rules="[{ required: true, message: '请选择' }]"
/>
<DocOffice v-model:show="showOffice"
v-model:value="form.diseaseOfficeId"
:unitId="form.diseaseUnitId"
@change="officeChange"
/>
<div class="doc-form-label" required>诊断医生</div>
<van-field is-link
v-model='form.diseaseDoctorName'
readonly
placeholder='请选择'
name="diseaseDoctorId"
@click="showDoctor = true"
:rules="[{ required: true, message: '请选择' }]"
/>
<DocOfficeDoctor v-model:show="showDoctor"
:allowClear="false"
v-model:value="form.diseaseDoctorId"
:unitId="form.diseaseUnitId"
:officeId="form.diseaseOfficeId"
@change="(option) => { form.diseaseDoctorName = option.staffName }"
/>
</van-form>
</template>
<script>
import { useStore } from '@/doctor/store'
import dayjs from 'dayjs'
import DocOffice from '@/doctor/components/docOffice/DocOffice.vue'
import DocOfficeDoctor from '@/doctor/components/docOfficeDoctor/DocOfficeDoctor.vue'
const defaultForm = (info = {}) => {
const form = {
createDate: undefined,
// 诊断单位
diseaseUnitId: undefined,
diseaseUnitName: undefined,
// 诊断科室
diseaseOfficeId: undefined,
diseaseOfficeName: undefined,
// 诊断医生
diseaseDoctorId: undefined,
diseaseDoctorName: undefined,
// 录入单位
createUnitId: undefined,
createUnitName: undefined,
// 录入科室
createOfficeId: undefined,
createOfficeName: undefined,
// 录入医生
createDoctorId: undefined,
createDoctorName: undefined
}
Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) {
form[key] = info[key]
}
})
return form
}
export default {
components: {
DocOffice,
DocOfficeDoctor
},
props: {
info: { default: () => ({}) }
},
data() {
return {
form: {},
store: useStore(),
showUnit: false,
showOffice: false,
showDoctor: false
}
},
computed: {
authInfo() {
return this.store.authInfo
}
},
methods: {
initForm() {
this.form.createDate = dayjs().format('YYYY-MM-DD')
// 诊断单位
this.form.diseaseUnitId = this.authInfo.unitId
this.form.diseaseUnitName = this.authInfo.unitName
// 诊断科室
this.form.diseaseOfficeId = this.authInfo.officeId
this.form.diseaseOfficeName = this.authInfo.officeName
// 诊断医生
this.form.diseaseDoctorId = this.authInfo.relationId
this.form.diseaseDoctorName = this.authInfo.nickName
// 录入单位
this.form.createUnitId = this.authInfo.unitId
this.form.createUnitName = this.authInfo.unitName
// 录入科室
this.form.createOfficeId = this.authInfo.officeId
this.form.createOfficeName = this.authInfo.officeName
// 录入医生
this.form.createDoctorId = this.authInfo.relationId
this.form.createDoctorName = this.authInfo.nickName
},
unitChange(option = {}) {
this.form.diseaseUnitName = option.unitName
this.form.diseaseDoctorId = undefined
this.form.diseaseDoctorName = undefined
this.form.diseaseOfficeId = undefined
this.form.diseaseOfficeName = undefined
},
officeChange(option = {}) {
this.form.diseaseOfficeName = option.officeName
this.form.diseaseDoctorId = undefined
this.form.diseaseDoctorName = undefined
},
submit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
resolve(this.form)
}).catch((e) => {
reject(e)
})
})
}
},
watch: {
info: {
handler(info) {
this.form = defaultForm(info)
if (!this.info.id) {
this.initForm()
}
},
immediate: true
}
}
}
</script>
<style lang="less" scoped></style>
This diff is collapsed.
......@@ -58,7 +58,10 @@ export default {
},
residentInfoId() {
return this.$route.query.residentInfoId
}
},
idCard() {
return this.$route.query.idCard
},
},
created() {
this.init()
......@@ -76,10 +79,15 @@ export default {
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
if (this.residentInfoId) {
let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {}
this.screenInfo.currentAge = this.baseInfo.currentAge
this.screenInfo.residentInfoId = this.residentInfoId
} else if (this.idCard) {
// 新建用户
this.baseInfo.idCard = this.idCard
}
}
},
toNext(val) {
......
......@@ -29,6 +29,12 @@ export const useStore = defineStore('chronic', {
if (!array || !array.length) {
return ''
}
if (value instanceof Array) {
return value.map(v => {
let temp = array.find(e => e.value == v) || {}
return temp.name || ''
}).filter(e => e).join('、')
}
let temp = array.find(e => e.value == value) || {}
return temp.name || ''
},
......
......@@ -265,7 +265,7 @@ export default {
return
}
this.$router.push({
path: '/doctor/screening/secondForm',
path: '/doctor/diagnose/form',
query: {
residentInfoId: record.residentInfoId,
diseaseType: record.diseaseType
......
......@@ -64,8 +64,18 @@ function setDirective(app) {
app.directive('destory', {
beforeUnmount(el, binding, vnode, prevVnod) {
const field = binding.arg
const form = binding.value
const value = binding.value
const modifiers = binding.modifiers
if (value instanceof Array) {
const form = value[0]
for (let i = 1; i < value.length; i++) {
if (form[value[i]] != null) {
form[value[i]] = modifiers.string ? '' : undefined
}
}
return
}
const form = value
if (form && field && form[field] != null) {
form[field] = modifiers.string ? '' : undefined
}
......
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