Commit dbe549f8 authored by gengchunlei's avatar gengchunlei

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

parents ef3e2411 2a5b3437
<template> <template>
<div class="flex flex-wrap check-btn"> <div class="check-btn">
<div v-for="item in options" :key="item[fieldNames.value]" <div v-for="item in options" :key="item[fieldNames.value]"
@click="onClick(item)" @click="onClick(item)"
:class="['py-2 px-3 shrink-0 check-btn-item', :class="['py-2 px-3 shrink-0 check-btn-item',
...@@ -103,6 +103,8 @@ export default { ...@@ -103,6 +103,8 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.check-btn { .check-btn {
display: flex;
flex-wrap: wrap;
row-gap: 10px; row-gap: 10px;
column-gap: 10px; column-gap: 10px;
.check-btn-item { .check-btn-item {
...@@ -145,7 +147,14 @@ export default { ...@@ -145,7 +147,14 @@ export default {
color: var(--van-primary-color); color: var(--van-primary-color);
} }
} }
// 圆角
.check-btn[round] {
.check-btn-item {
border-radius: 30px;
}
}
// 每行排列个数
.check-btn[column-3] { .check-btn[column-3] {
.check-btn-item { .check-btn-item {
width: calc(33.3% - 6.6px); width: calc(33.3% - 6.6px);
......
<template> <template>
<div class="instpect-common"> <van-form ref='form' class="instpect-common" >
<div class='doc-form-label' required>检验项目</div> <div class='doc-form-label' required>检验项目</div>
<van-field is-link <van-field is-link
:modelValue='inspectName' :modelValue='inspectName'
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
:dict="selectOption.dict" :dict="selectOption.dict"
@change="onSelectInputConfirm"></InputSelect> @change="onSelectInputConfirm"></InputSelect>
</div> </div>
</div> </van-form>
</template> </template>
<script> <script>
...@@ -183,6 +183,22 @@ export default { ...@@ -183,6 +183,22 @@ export default {
console.log(this.viewData) console.log(this.viewData)
}) })
}, },
submit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
const inspect = this.inspect.join(',')
const image = this.image
let data = []
this.viewData.forEach(e => {
data = data.concat(e.items)
})
console.log(data, inspect, image)
resolve({ inspect, data, image })
}).catch((e) => {
reject(e)
})
})
},
inspectConfirm() { inspectConfirm() {
this.inspectName = this.store.getDict('CP00100').map(e => { this.inspectName = this.store.getDict('CP00100').map(e => {
return this.inspect.includes(e.value) ? e.name : '' return this.inspect.includes(e.value) ? e.name : ''
......
...@@ -12,18 +12,24 @@ ...@@ -12,18 +12,24 @@
@click="showMedical = true" @click="showMedical = true"
/> />
<van-popup v-model:show="showMedical" position="bottom"> <van-popup v-model:show="showMedical" position="bottom">
<div class="pt-4 popup-checkbox"> <div class="pt-4 pb-4 popup-checkbox">
<div class="flex justify-between pb-2"> <div class="flex justify-between pb-2">
<button class="van-picker__cancel van-haptics-feedback" @click="showMedical = false">取消</button> <button class="van-picker__cancel van-haptics-feedback" @click="showMedical = false">取消</button>
<span class="text-16" >既往史(可多选)</span>
<button class="van-picker__confirm van-haptics-feedback" @click="medicalConfirm">确认</button> <button class="van-picker__confirm van-haptics-feedback" @click="medicalConfirm">确认</button>
</div> </div>
<div class="bottom-small-line"></div> <div class="bottom-small-line"></div>
<van-checkbox-group v-model="form.medicalHistory" class="px-4 pb-4 pt-2"> <!-- <van-checkbox-group v-model="form.medicalHistory" class="px-4 pb-4 pt-2">
<van-checkbox v-for="(item, index) in store.getDict('CP00118')" :key="index" <van-checkbox v-for="(item, index) in store.getDict('CP00118')" :key="index"
@click="medicalChange" @click="medicalChange"
:name="item.value" :name="item.value"
class="mb-3">{{ item.name }}</van-checkbox> class="mb-3">{{ item.name }}</van-checkbox>
</van-checkbox-group> </van-checkbox-group> -->
<CheckBtn v-model:value="form.medicalHistory"
:options="medicalHistoryArray"
multiple round column-1
class="py-3 px-4"
@change="medicalChange" />
</div> </div>
</van-popup> </van-popup>
...@@ -40,17 +46,24 @@ ...@@ -40,17 +46,24 @@
@click="showFamily = true" @click="showFamily = true"
/> />
<van-popup v-model:show="showFamily" position="bottom"> <van-popup v-model:show="showFamily" position="bottom">
<div class="pt-4 popup-checkbox"> <div class="pt-4 pb-4 popup-checkbox">
<div class="flex justify-between"> <div class="flex justify-between pb-2">
<button class="van-picker__cancel van-haptics-feedback" @click="showFamily = false">取消</button> <button class="van-picker__cancel van-haptics-feedback" @click="showFamily = false">取消</button>
<span class="text-16" >家族史(可多选)</span>
<button class="van-picker__confirm van-haptics-feedback" @click="familyConfirm">确认</button> <button class="van-picker__confirm van-haptics-feedback" @click="familyConfirm">确认</button>
</div> </div>
<van-checkbox-group v-model="form.familyHistory" class="p-4"> <div class="bottom-small-line"></div>
<!-- <van-checkbox-group v-model="form.familyHistory" class="p-4">
<van-checkbox v-for="(item, index) in store.getDict('CP00167').filter(e => e.value != 7)" :key="index" <van-checkbox v-for="(item, index) in store.getDict('CP00167').filter(e => e.value != 7)" :key="index"
@click="familyChange" @click="familyChange"
:name="item.value" :name="item.value"
class="mb-3">{{ item.name }}</van-checkbox> class="mb-3">{{ item.name }}</van-checkbox>
</van-checkbox-group> </van-checkbox-group> -->
<CheckBtn v-model:value="form.familyHistory"
:options="familyHistoryArray"
multiple round column-1
class="py-3 px-4"
@change="familyChange" />
</div> </div>
</van-popup> </van-popup>
...@@ -340,6 +353,7 @@ import { useStore } from '@/doctor/store' ...@@ -340,6 +353,7 @@ import { useStore } from '@/doctor/store'
import { checkboxReject, fetchDataHandle } from '@/utils/common.js' import { checkboxReject, fetchDataHandle } 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 { BloodPressurePanel, BloodPressureBt } from '@/doctor/components/bloodPressure/index.js' import { BloodPressurePanel, BloodPressureBt } from '@/doctor/components/bloodPressure/index.js'
const defaultForm = (info = {}) => { const defaultForm = (info = {}) => {
...@@ -397,6 +411,7 @@ const defaultForm = (info = {}) => { ...@@ -397,6 +411,7 @@ const defaultForm = (info = {}) => {
} }
export default { export default {
components: { components: {
CheckBtn,
DoctorInfo, DoctorInfo,
BloodPressurePanel, BloodPressurePanel,
BloodPressureBt BloodPressureBt
...@@ -451,6 +466,30 @@ export default { ...@@ -451,6 +466,30 @@ export default {
bmi() { bmi() {
const { height, weight } = this.form const { height, weight } = this.form
return height && weight ? (weight / (height / 100 * height / 100)).toFixed(2) : undefined return height && weight ? (weight / (height / 100 * height / 100)).toFixed(2) : undefined
},
// 既往史
medicalHistoryArray() {
const result = []
this.store.getDict('CP00118').forEach(e => {
if (e.value == 9) {
result.unshift(e)
return
}
result.push(e)
})
return result
},
// 家族史
familyHistoryArray() {
const result = []
this.store.getDict('CP00167').forEach(e => {
if (e.value == 9) {
result.unshift(e)
return
}
result.push(e)
})
return result
} }
}, },
methods: { methods: {
...@@ -471,7 +510,7 @@ export default { ...@@ -471,7 +510,7 @@ export default {
}).filter(e => e).join('、') }).filter(e => e).join('、')
this.showMedical = false this.showMedical = false
}, },
medicalChange(e) { medicalChange(val) {
this.form.medicalHistory = checkboxReject(this.form.medicalHistory, [9]) this.form.medicalHistory = checkboxReject(this.form.medicalHistory, [9])
}, },
// 家族史 // 家族史
......
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