Commit 84d08131 authored by songrui's avatar songrui

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

parents d94f7db2 d6075159
......@@ -159,3 +159,8 @@ export function getScreenDyslipemiaLastTime(params) {
export function getVisitDyslipemiaLastTime(params) {
return fetchBase({ url: `/chronic-admin/v1/chronic-visit-dyslipemia/reference-last-time`, body: params, loading: true })
}
// 药品列表
export function getDrugList(params) {
return fetchBase({ url: `/chronic-admin/v1/base-info/phl-drug-list`, body: params })
}
\ 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 = '33bcb102-cf56-4eec-b1b4-1894314e4361'
token = 'e91f5936-1adb-41bd-984b-b4e2ce5f33b2'
}
}
if (token) {
......
<template>
<div>
<van-field
v-model='innerValueName'
readonly
is-link
label='药品名称:'
placeholder='请选择'
class='input-back mt-2 form-input w-full'
:rules="[{required: true, message:'请选择'}]"
@click='showDrug= true'
/>
<!-- {{ array }} -->
<van-popup v-model:show='showDrug' position='bottom'>
<div class='pb-4 pr-4 pl-4'>
<van-picker
:columns='array'
:columns-field-names='fieldNames'
@confirm='drugConfirm'
@cancel='showDrug = false'
>
<template #columns-top>
<van-search v-model="searchStr" :placeholder='placeholder' @search='onSearch' clearable/>
</template>
</van-picker>
</div>
</van-popup>
</div>
</template>
<script>
import { getDrugList } from '@/api/doctor/separateFU'
import { debounce } from '@/utils/common'
export default {
name: 'DocDrug',
props: {
value: [String, Number],
valueName: String,
placeholder: String,
fieldNames: {
type: Object,
default: () => {
return { text: 'chemicalName', value: 'id' }
}
}
},
emits: ['update:value', 'change'],
data() {
return {
innerValue: null,
innerValueName: undefined,
array: [],
loading: false,
showDrug: false,
searchStr: ''
}
},
created() {
this.onSearch = debounce(this.onSearch, 500)
this.onSearch('')
},
methods: {
onSearch(value) {
if (this.loading) return
this.array = []
if (!value) {
return
}
if (!value.trim()) return
this.loading = true
getDrugList({ pinyinCode: value }).then(res => {
this.array = res.data || []
if (this.array.length && this.innerValue) {
let list = this.array.filter(item => item.id == this.innerValue)
if (list && list.length) {
this.innerValueName = list[0].chemicalName
}
}
}).finally(() => {
this.loading = false
})
},
drugConfirm({ selectedOptions }) {
this.innerValueName = selectedOptions[0].chemicalName
this.$emit('update:value', selectedOptions[0].id)
this.$emit('change', selectedOptions[0])
this.searchStr = ''
this.showDrug = false
}
},
watch: {
value: {
handler(value) {
this.innerValue = value
},
immediate: true
},
valueName: {
handler(value) {
if (!value) {
return
}
this.onSearch(value)
},
immediate: true
},
searchStr: {
handler(val) {
if (!val) return
this.onSearch(val)
}
}
}
}
</script>
<style lang='less' scoped>
.form-input {
padding: 8px 12px;
border-radius: 8px;
}
.input-back {
background: #FAFAFA;
}
//灰色
.greyColor {
color: var(--van-text-color-2);
}
//确认按钮颜色
.blueColor {
color: var(--van-primary-color)
}
</style>
\ No newline at end of file
<template>
</template>
\ No newline at end of file
......@@ -294,7 +294,7 @@
</template>
<script>
import { useStore } from '@/doctor/store'
import DocDrug from '@/doctor/components/docDrug/DocDrug.vue'
import DocDrug from './DocDrug.vue'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
export default {
name: 'HypertensionDrugs',
......@@ -414,10 +414,18 @@ export default {
handler() {
let { currentMedicateCase, addMedicateCase, noComplianceReason } = this.form
if (currentMedicateCase) {
this.currentMedicateCase = JSON.parse(currentMedicateCase)
this.currentMedicateCase = JSON.parse(currentMedicateCase) || {}
this.currentMedicateCase.unitName = this.currentMedicateCase.unitName || this.store.getDictValue('CP00081', this.currentMedicateCase.unit)
this.currentMedicateCase.frequencyName = this.currentMedicateCase.frequencyName || this.store.getDictValue('CP00084', this.currentMedicateCase.frequency)
this.currentMedicateCase.usageName = this.currentMedicateCase.usageName || this.store.getDictValue('CP00083', this.currentMedicateCase.usage)
}
if (addMedicateCase) {
this.addMedicateCase = JSON.parse(addMedicateCase)
this.addMedicateCase = JSON.parse(addMedicateCase) || []
this.addMedicateCase.map(item => {
item.unitName = item.unitName || this.store.getDictValue('CP00081', item.unit)
item.frequencyName = item.frequencyName || this.store.getDictValue('CP00084', item.frequency)
item.usageName = item.usageName || this.store.getDictValue('CP00083', item.usage)
})
}
if (noComplianceReason) {
this.form.noComplianceReason = noComplianceReason.split(',').map(e => +e)
......
<template>
<div class="label-title mt-2">{{ firstText }}</div>
<div class="bg-fa">
<div class="label-title" required style="font-size: 14px; color: #262626; line-height: 24px">{{ secondText }}</div>
<van-field :rules="[{ required: true, message: '请选择' }]" style="padding: 0" class="mt-2">
<div class="label-title" style="font-size: 14px; color: #262626; line-height: 24px">{{ secondText }}</div>
<van-field style="padding: 0" class="mt-2">
<template #input>
<van-radio-group
v-model="form.adjustTreat"
......@@ -133,7 +133,7 @@
</template>
<script>
import { useStore } from '@/doctor/store'
import DocDrug from '@/doctor/components/docDrug/DocDrug.vue'
import DocDrug from './DocDrug.vue'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
export default {
components: { DocDrug, CheckBtn },
......@@ -218,7 +218,12 @@ export default {
watch: {
'form.medicateCase': {
handler() {
this.medicateCase = JSON.parse(this.form.medicateCase)
this.medicateCase = JSON.parse(this.form.medicateCase) || []
this.medicateCase.map(item => {
item.unitName = item.unitName || this.store.getDictValue('CP00081', item.unit)
item.frequencyName = item.frequencyName || this.store.getDictValue('CP00084', item.frequency)
item.usageName = item.usageName || this.store.getDictValue('CP00083', item.usage)
})
}
}
}
......
......@@ -306,6 +306,7 @@
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import ImagePreview from '@/doctor/components/imagePreview/imagePreview.vue'
export default {
components: { ImagePreview },
......@@ -317,6 +318,7 @@ export default {
},
data() {
return {
store: useStore(),
collapseAll: false,
activeCollapse: [],
columnsBase: [
......
......@@ -234,16 +234,19 @@
<span class="text-end">{{ visitInfo.adjustTreatName }}</span>
</div>
</div>
<template v-if="visitInfo.adjustTreat === 1">
<div class="py-1">用药方案</div>
<div v-for="(item, index) in medicateCase" :key="index" class="gray-box mb-2">
<div>药物名称:{{ item.drugName }}</div>
<div>
<span>剂量:</span>
<span>{{ item.dose }}</span>
<span class="ml-1">{{ item.unitName }}</span>
<span class="ml-1">{{ item.unitName || store.getDictValue('CP00081', item.unit) }}</span>
</div>
<div>频次:{{ item.frequencyName }}</div>
<div>用法:{{ item.usageName }}</div>
<div>频次:{{ item.frequencyName || store.getDictValue('CP00084', item.frequency) }}</div>
<div>用法:{{ item.usageName || store.getDictValue('CP00083', item.usage) }}</div>
</div>
</template>
</van-collapse-item>
<van-collapse-item key="12" title="转诊" name="12">
<template #right-icon>
......@@ -303,6 +306,7 @@
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import ImagePreview from '@/doctor/components/imagePreview/imagePreview.vue'
export default {
components: { ImagePreview },
......@@ -314,6 +318,7 @@ export default {
},
data() {
return {
store: useStore(),
collapseAll: false,
activeCollapse: [],
columnsBase: [
......
......@@ -348,6 +348,7 @@
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import ImagePreview from '@/doctor/components/imagePreview/imagePreview.vue'
export default {
components: { ImagePreview },
......@@ -359,6 +360,7 @@ export default {
},
data() {
return {
store: useStore(),
collapseAll: false,
activeCollapse: [],
columnsBase: [
......
......@@ -306,6 +306,7 @@
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import ImagePreview from '@/doctor/components/imagePreview/imagePreview.vue'
export default {
components: { ImagePreview },
......@@ -317,6 +318,7 @@ export default {
},
data() {
return {
store: useStore(),
collapseAll: false,
activeCollapse: [],
columnsBase: [
......
......@@ -172,17 +172,6 @@
<template #right-icon>
<doc-icon type="doc-down" />
</template>
<!-- <div class="list">
<div v-for="item in columnsAuxiliary" :key="item.key">
<div class="flex justify-between py-1 border-bottom item">
<span class="shrink-0 mr-2 label">{{ item.title }}</span>
<span class="text-end">
<span>{{ visitInfo[item.key] || '-' }}</span>
<span v-if="item.unit" class="ml-1">{{ item.unit }}</span>
</span>
</div>
</div>
</div> -->
<div v-for="(x, xIndex) in inspectList" :key="xIndex">
<div style="color: #262626" :class="[xIndex === 0 ? '' : 'mt-2']">{{ x.insName }}</div>
<div class="gray-box mt-1">
......
......@@ -228,6 +228,25 @@
<template #right-icon>
<doc-icon type="doc-down" />
</template>
<div class="list">
<div class="flex justify-between py-1 border-bottom item">
<span class="shrink-0 mr-2 label">是否调整治疗方案</span>
<span class="text-end">{{ visitInfo.adjustTreatName }}</span>
</div>
</div>
<template v-if="visitInfo.adjustTreat === 1">
<div class="py-1">用药方案</div>
<div v-for="(item, index) in medicateCase" :key="index" class="gray-box mb-2">
<div>药物名称:{{ item.drugName }}</div>
<div>
<span>剂量:</span>
<span>{{ item.dose }}</span>
<span class="ml-1">{{ item.unitName || store.getDictValue('CP00081', item.unit) }}</span>
</div>
<div>频次:{{ item.frequencyName || store.getDictValue('CP00084', item.frequency) }}</div>
<div>用法:{{ item.usageName || store.getDictValue('CP00083', item.usage) }}</div>
</div>
</template>
</van-collapse-item>
<van-collapse-item key="12" title="转诊" name="12">
<template #right-icon>
......@@ -287,6 +306,7 @@
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import ImagePreview from '@/doctor/components/imagePreview/imagePreview.vue'
export default {
components: { ImagePreview },
......@@ -298,6 +318,7 @@ export default {
},
data() {
return {
store: useStore(),
collapseAll: false,
activeCollapse: [],
columnsBase: [
......@@ -339,8 +360,15 @@ export default {
},
inspectList() {
return this.visitInfo.inspectList || []
},
medicateCase() {
if (this.visitInfo.medicateCase) {
return JSON.parse(this.visitInfo.medicateCase)
} else {
return []
}
},
},
methods: {
// 全部展开、收起
toggleAll() {
......
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