Commit 0af1f5a9 authored by songrui's avatar songrui

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

parents e4c9d5e1 0e788961
<template>
<div>
<van-form ref='form'>
<div class='title'>居民信息</div>
<!-- <div class='label-title'>证件类型</div>
<van-field
v-model='form.certificateTypeName'
is-link
readonly
placeholder='证件类型'
class='input-back mt-2 form-input'
:rules='rules.certificateTypeName'
/>-->
<div class='label-title mt-5'>证件号码</div>
<van-field
v-model='form.idCard'
readonly
placeholder='证件号码'
class='input-back mt-2 form-input'
:rules='rules.idCard'
/>
<div class='label-title mt-5'>姓名</div>
<van-field
v-model='form.residentName'
clearable
placeholder='姓名'
class='input-back mt-2 form-input'
:rules='rules.residentName'
/>
<div class='label-title mt-5'>性别</div>
<van-field
v-model='form.genderName'
is-link
readonly
placeholder='性别'
class='input-back mt-2 form-input'
:rules='rules.genderName'
/>
<div class='label-title mt-5'>出生日期</div>
<van-field
v-model='form.dataBirth'
is-link
readonly
placeholder='出生日期'
class='input-back mt-2 form-input'
:rules='rules.dataBirth'
/>
<div class='label-title mt-5'>本人电话</div>
<van-field
v-model='form.telephone'
clearable
placeholder='本人电话'
class='input-back mt-2 form-input'
:rules='rules.telephone'
/>
<div class='label-title mt-5'>民族</div>
<van-field
v-model='form.nationalName'
is-link
readonly
name='national'
placeholder='请选择'
class='input-back mt-2 form-input'
:rules='rules.nationalName'
@click='showNational = true' />
<van-popup v-model:show='showNational' position='bottom'>
<van-picker
:columns-field-names="{ text: 'name', value: 'value' }"
:columns="store.getDict('DC00006')"
@confirm='nationalConfirm'
@cancel='showNational = false'
/>
</van-popup>
<div class='label-title mt-5'>年龄</div>
<van-field
v-model='form.currentAge'
readonly
placeholder='年龄'
class='input-back mt-2 form-input'
:rules='rules.currentAge'
/>
<div class='label-title mt-5'>现住址</div>
<van-field
v-model='form.presentCodeName'
is-link
readonly
placeholder='请选择所在地区'
class='input-back mt-2 form-input'
:rules='rules.presentCodeName'
@click='showPresent = true'
>
<template #input>
<span class='text-end'>{{ form.presentCodeName }}</span>
</template>
</van-field>
<van-popup v-model:show='showPresent' :close-on-click-overlay='false' position='bottom'>
<DocAddress v-model:value='form.presentCode' @close='showPresent = false'
:viewData='addressRecord.presentCode'
@change='presentChange' />
</van-popup>
<div class='no-req-label mt-5'>详细地址</div>
<van-field
v-model='form.nowAddress'
clearable
class='input-back mt-2 form-input'
placeholder='请填写详细地址'
maxlength='50'
/>
<div class='flex items-center justify-between mt-5'>
<div class='label-title '>户口地址</div>
<van-button size='mini' plain type='primary'
@click='setRegisteredAddress'>同步现住址
</van-button>
</div>
<van-field
v-model='form.registeredCodeName'
is-link
readonly
placeholder='请选择所在地区'
class='input-back mt-2 form-input'
:rules='rules.registeredCode'
@click='showRegistered = true'
>
<template #input>
<span class='text-end'>{{ form.registeredCodeName }}</span>
</template>
</van-field>
<van-popup v-model:show='showRegistered' :close-on-click-overlay='false' position='bottom'>
<DocAddress v-model:value='form.registeredCode' @close='showRegistered = false'
:viewData='addressRecord.registeredCode'
@change='registeredChange' />
</van-popup>
<div class='no-req-label mt-5'>详细地址</div>
<van-field
v-model='form.permanentAddress'
clearable
class='input-back mt-2 form-input'
placeholder='请填写详细地址'
maxlength='50'
/>
<div class='title mt-5'>联系人信息</div>
<div class='no-req-label mt-5'>联系人姓名</div>
<van-field
v-model='form.contactName'
clearable
placeholder='联系人姓名'
class='input-back mt-2 form-input'
:rules='rules.contactName'
/>
<div class='no-req-label mt-5'>与居民关系</div>
<van-field
v-model='form.relationName'
readonly
is-link
placeholder='与居民关系'
class='input-back mt-2 form-input'
@click='showRelation= true'
/>
<van-popup v-model:show='showRelation' position='bottom'>
<van-picker
:columns-field-names="{ text: 'name', value: 'value' }"
:columns="store.getDict('DC00023')"
@confirm='relationlConfirm'
@cancel='showRelation = false'
/>
</van-popup>
<van-field
v-if='form.relation == 99'
v-model='form.relationOther'
clearable
placeholder='其他关系'
class='input-back mt-2 form-input'
/>
<div class='no-req-label mt-5'>联系电话</div>
<van-field
v-model='form.contactPhone'
clearable
placeholder='联系电话'
class='input-back mt-2 form-input'
:rules='rules.contactPhone'
/>
</van-form>
</div>
</template>
<script>
import { addToArr } from '@/utils/common'
import { useStore } from '@/doctor/store'
import DocAddress from '@/components/docAddress/DocAddress'
import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
const defaultForm = (info = {}) => {
const form = {
id: undefined,
residentInfoId: undefined,
// 年龄
currentAge: undefined,
// 出生地详细地址
birthAddress: undefined,
// 出生地编码
birthCode: undefined,
// 证件类型,[DC00004]
certificateType: 1,
certificateTypeName: '身份证',
// 联系人姓名
contactName: undefined,
contactName2: undefined,
// 联系人电话
contactPhone: undefined,
// 与居民关系,[DC00023]
contactRelation: undefined,
contactRelationName: undefined,
// 出生日期
dataBirth: undefined,
// 职业,[DC00010]
duty: undefined,
dutyName: undefined,
// 文化程度(学历),[DC00007]
education: undefined,
educationName: undefined,
// 性别,[DC00005]
gender: undefined,
genderName: undefined,
// 身份证号
idCard: undefined,
// innerMarital: undefined,
// 民族,[DC00006]
national: undefined,
nationalName: undefined,
// 现住址
nowAddress: undefined,
// 户籍地址
permanentAddress: undefined,
// 现住址编码
presentCode: undefined,
presentCodeName: undefined,
// 户籍地编码
registeredCode: undefined,
registeredCodeName: undefined,
// 居民档案id
residentId: undefined,
// 姓名
residentName: undefined,
// 本人电话
telephone: undefined,
// 工作单位
workUnit: undefined,
// 与居民关系
relation: undefined,
relationName: undefined,
relationOther: undefined,
// 人群
chronicCrowd: undefined,
chronicTagsArray: undefined,
firstScreenDate: undefined,
firstScreenResult: undefined,
highTagsArray: undefined,
highTags: undefined,
latelyDiagnoseDate: undefined,
latelyScreenDate: undefined,
// 建档单位、科室、医生
createDoctorId: undefined,
createDoctorName: undefined,
createOfficeId: undefined,
createOfficeName: undefined,
createUnitId: undefined,
createUnitName: undefined,
// 当前人群-显示type=CP00181
groupsArrays: undefined,
// 当前人群-查询
groups: undefined
}
Reflect.ownKeys(form).forEach(key => {
if (info[key] != undefined) {
form[key] = info[key]
}
})
return form
}
export default {
name: 'archiveCommon',
components: { DocAddress, DocNavBar },
props: {
info: {
default: () => {
return {}
}
}
},
data() {
return {
store: useStore(),
// 民族
showNational: false,
showRelation: false,
// 现住址
showPresent: false,
// 户籍地址
showRegistered: false,
// 地址回显使用
addressRecord: {},
form: {},
rules: {
certificateTypeName: [{ required: true, message: '请选择证件类型' }],
idCard: [{ required: true, message: '请填写证件号码' }],
residentName: [{ required: true, message: '请填写姓名' }],
genderName: [{ required: true, message: '请选择性别' }],
dataBirth: [{ required: true, message: '请选择出生日期' }],
nationalName: [{ required: true, message: '请选择名族' }],
currentAge: [{ required: true, message: '请填写年龄' }],
telephone: [{ required: true, message: '请填写本人电话' }],
contactName: [{ required: false, message: '请填写联系人姓名' }],
contactPhone: [{ required: false, message: '请填写联系电话' }],
presentCodeName: [{ required: true, message: '请选择所在地区' }],
registeredCode: [{ required: true, message: '请选择所在地区' }]
}
}
},
computed: {
authInfo() {
return this.store.$state.authInfo
},
residentInfoId() {
return this.$route.query.residentInfoId
}
},
watch: {
'info': {
handler() {
this.init()
}
}
},
methods: {
init() {
this.form = defaultForm(this.info)
if (this.form.presentCode) {
this.addressRecord.presentCode = addToArr(this.form.presentCode)
}
if (this.form.registeredCode) {
this.addressRecord.registeredCode = addToArr(this.form.registeredCode)
}
},
// 民族
nationalConfirm({ selectedValues, selectedOptions }) {
this.form.national = selectedValues[0]
this.form.nationalName = selectedOptions[0].name
this.showNational = false
},
//与居民关系
relationlConfirm({ selectedValues, selectedOptions }) {
this.form.relation = selectedValues[0]
this.form.relationName = selectedOptions[0].name
this.showRelation = false
},
// 现住址
presentChange(val) {
const selectedOptions = val.selectedOptions
this.form.presentCodeName = selectedOptions.map(e => e.text).join('/')
},
// 户口地址
registeredChange(val) {
const selectedOptions = val.selectedOptions
this.form.registeredCodeName = selectedOptions.map(e => e.text).join('/')
if (!this.form.presentCode && selectedOptions.length >= 5) {
this.form.presentCode = val.value
this.form.presentCodeName = this.form.registeredCodeName
}
},
// 同步现住址
setRegisteredAddress() {
this.$refs.form.validate(['presentCode']).then(res => {
this.form.registeredCode = this.form.presentCode
this.form.registeredCodeName = this.form.presentCodeName
this.form.permanentAddress = this.form.nowAddress
this.addressRecord.registeredCode = addToArr(this.form.presentCode)
}).catch(err => console.warn(err))
},
onSubmit() {
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
resolve(...this.form)
}).catch((e) => {
console.warn('ArchiveCommon error', e)
})
})
}
}
}
</script>
<style scoped lang='less'>
.h-overflow {
height: calc(100vh - 110px);
overflow-y: auto;
}
.title {
font-weight: bold;
margin-bottom: 20px;
}
.label-title {
font-size: 13px;
color: #595959;
font-weight: 500;
&::after {
content: "*";
color: red;
font-weight: bold;
margin-left: 4px;
}
}
.no-req-label {
font-size: 13px;
color: #595959;
font-weight: 500;
}
.form-input {
padding: 8px 12px;
border-radius: 8px;
}
.input-back {
background: #FAFAFA;
}
.tel-back {
background: #F5F5F5;
padding: 8px;
border-radius: 0px 0px 8px 8px;
}
.tel {
background: #FFFFFF;
padding: 8px;
border-radius: 8px;
}
.tel-label {
color: #607FF0;
font-weight: bold;
}
.p-12-0 {
padding: 12px 0px;
}
:deep(.van-nav-bar .van-icon) {
color: #000000;
}
:deep(.van-cell-group--inset) {
overflow: visible;
}
:deep(.van-cell) {
overflow: visible;
}
/*:deep(.van-field__error-message) {
position: absolute;
margin-top: 3px;
}*/
:deep(.van-cell:after) {
border-bottom: 0px;
}
</style>
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
v-model='data.selectedValues' v-model='data.selectedValues'
:min-date='data.minDate' :min-date='data.minDate'
:max-date='data.maxDate' :max-date='data.maxDate'
@change='changeTime'
/> />
</van-popup> </van-popup>
</template> </template>
...@@ -74,6 +74,10 @@ watch( ...@@ -74,6 +74,10 @@ watch(
} }
) )
watch(()=> data.selectedValues, val => {
changeTime()
})
function getcolumns() { function getcolumns() {
let strtime = props.values //传入的时间 let strtime = props.values //传入的时间
//console.log(strtime); 2023-09-05 19:28:00 //console.log(strtime); 2023-09-05 19:28:00
...@@ -159,7 +163,7 @@ function getcolumns() { ...@@ -159,7 +163,7 @@ function getcolumns() {
if (data.minDate && minYear == Y) { if (data.minDate && minYear == Y) {
let minDay = new Date(data.minDate).getDate() let minDay = new Date(data.minDate).getDate()
let allD = Object.keys(Array.apply(null, { length: days + 1 })) let allD = Object.keys(Array.apply(null, { length: days + 1 }))
allDays = allD.filter(item => item >= minDay) allDays = allD.filter(item => item >=(minDay - 1))
} else { } else {
allDays = Object.keys(Array.apply(null, { length: days + 1 })) allDays = Object.keys(Array.apply(null, { length: days + 1 }))
} }
...@@ -183,7 +187,9 @@ function getcolumns() { ...@@ -183,7 +187,9 @@ function getcolumns() {
if (data.showType.includes('hour')) { if (data.showType.includes('hour')) {
let hour = [] //创建小时数组 let hour = [] //创建小时数组
let allHour = [] let allHour = []
if (data.minDate && minYear == Y) { let minMon = new Date(data.minDate).getMonth()
let minDay = new Date(data.minDate).getDate()
if (data.minDate && minYear == Y && minMon == M && minDay == D) {
let minHour = new Date(data.minDate).getHours() ? new Date(data.minDate).getHours(): new Date().getHours() let minHour = new Date(data.minDate).getHours() ? new Date(data.minDate).getHours(): new Date().getHours()
let allH = Object.keys(Array.apply(null, { length: 24 })) let allH = Object.keys(Array.apply(null, { length: 24 }))
allHour = allH.filter(item => item >= minHour) allHour = allH.filter(item => item >= minHour)
...@@ -366,10 +372,10 @@ function changeColumns(val) { ...@@ -366,10 +372,10 @@ function changeColumns(val) {
let allDays = [] let allDays = []
if (data.minDate && minYear == Y) { if (data.minDate && minYear == Y) {
let minDay = new Date(data.minDate).getDate() let minDay = new Date(data.minDate).getDate()
let allD = Object.keys(Array.apply(null, { length: days + 1 })) let allD = Object.keys(Array.apply(null, { length: days + 1}))
allDays = allD.filter(item => item >= minDay) allDays = allD.filter(item => item >= (minDay - 1))
} else { } else {
allDays = Object.keys(Array.apply(null, { length: days + 1 })) allDays = Object.keys(Array.apply(null, { length: days + 1}))
} }
day = allDays.map(function(item) { day = allDays.map(function(item) {
if (+item + 1 <= 10) { if (+item + 1 <= 10) {
...@@ -391,7 +397,9 @@ function changeColumns(val) { ...@@ -391,7 +397,9 @@ function changeColumns(val) {
if (data.showType.includes('hour')) { if (data.showType.includes('hour')) {
let hour = [] //创建小时数组 let hour = [] //创建小时数组
let allHour = [] let allHour = []
if (data.minDate && minYear == Y) { let minMon = new Date(data.minDate).getMonth()
let minDay = new Date(data.minDate).getDate()
if (data.minDate && minYear == Y && minMon == M && minDay == D) {
let minHour = new Date(data.minDate).getHours() ? new Date(data.minDate).getHours(): new Date().getHours() let minHour = new Date(data.minDate).getHours() ? new Date(data.minDate).getHours(): new Date().getHours()
let allH = Object.keys(Array.apply(null, { length: 24 })) let allH = Object.keys(Array.apply(null, { length: 24 }))
allHour = allH.filter(item => item >= minHour) allHour = allH.filter(item => item >= minHour)
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</div> </div>
</div> </div>
<div class='card mt-2' v-if='detailInfo?.publicizeType?.includes(3)'> <div class='card mt-2' v-if='detailInfo?.publicizeType?.includes(3)'>
<Mp4 :files='mp4List' :activeMediaUrl="activeMediaUrl" <Mp4 :files='mp4List' :activeMediaUrl='activeMediaUrl'
@play='e => activeMediaUrl = e.annexUrl' /> @play='e => activeMediaUrl = e.annexUrl' />
</div> </div>
<div class='card flex flex-col mt-2' style='row-gap: .06rem;' <div class='card flex flex-col mt-2' style='row-gap: .06rem;'
...@@ -173,9 +173,12 @@ ...@@ -173,9 +173,12 @@
<template #right-icon> <template #right-icon>
<doc-icon type='doc-down' /> <doc-icon type='doc-down' />
</template> </template>
<div> <div v-if='info.uploadVisitRecordImageList && info.uploadVisitRecordImageList.length'>
<image-preview :img-list='info.uploadVisitRecordImageList'></image-preview> <image-preview :img-list='info.uploadVisitRecordImageList'></image-preview>
</div> </div>
<div v-else class='w-full' style='text-align: right'>
<span>-</span>
</div>
</van-collapse-item> </van-collapse-item>
<van-collapse-item key='11' title='现场随访照片' name='11'> <van-collapse-item key='11' title='现场随访照片' name='11'>
<template #right-icon> <template #right-icon>
...@@ -186,9 +189,12 @@ ...@@ -186,9 +189,12 @@
<img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" /> <img style='width: 1.47rem;height: 2.04rem' :src="url.trueDownloadUrl" />
</div> </div>
</div>--> </div>-->
<div> <div v-if='info.sceneVisitImageList && info.sceneVisitImageList.length'>
<image-preview :img-list='info.sceneVisitImageList'></image-preview> <image-preview :img-list='info.sceneVisitImageList'></image-preview>
</div> </div>
<div v-else class='w-full' style='text-align: right'>
<span>-</span>
</div>
</van-collapse-item> </van-collapse-item>
<van-collapse-item key='12' title='推送渠道' name='12' <van-collapse-item key='12' title='推送渠道' name='12'
v-if='info?.visitWayRules?.includes(2) || info?.visitWayRules?.includes(3) || info?.visitWayRules?.includes(4)'> v-if='info?.visitWayRules?.includes(2) || info?.visitWayRules?.includes(3) || info?.visitWayRules?.includes(4)'>
...@@ -211,7 +217,8 @@ ...@@ -211,7 +217,8 @@
<span class='text-end'> <span class='text-end'>
<div class='flex items-center'> <div class='flex items-center'>
<span>{{ info?.serviceResidents?.messageStateName || '-' }}</span> <span>{{ info?.serviceResidents?.messageStateName || '-' }}</span>
<span class='ml-4' v-if='info?.serviceResidents?.messageState == 4' style='font-size: 12px'> <span class='ml-4' v-if='info?.serviceResidents?.messageState == 4'
style='font-size: 12px'>
<van-button plain type='primary' size='small' @click='toReSend'>重新发送</van-button> <van-button plain type='primary' size='small' @click='toReSend'>重新发送</van-button>
</span> </span>
</div> </div>
...@@ -297,7 +304,7 @@ export default { ...@@ -297,7 +304,7 @@ export default {
], ],
// 控制音频同一时间只播放一个 // 控制音频同一时间只播放一个
activeMediaUrl: '', activeMediaUrl: '',
hideActiveMediaUrl: '', hideActiveMediaUrl: ''
} }
}, },
computed: { computed: {
......
...@@ -323,6 +323,10 @@ const defaultForm = (info = {}) => { ...@@ -323,6 +323,10 @@ const defaultForm = (info = {}) => {
//随访人群 //随访人群
groupsArrays: undefined, groupsArrays: undefined,
groupsArraysName: undefined, groupsArraysName: undefined,
//慢病标签
//随访方式 //随访方式
visitWay: undefined, visitWay: undefined,
visitWayName: undefined, visitWayName: undefined,
...@@ -572,6 +576,7 @@ export default { ...@@ -572,6 +576,7 @@ export default {
sendNumber, sendNumber,
residentInfoId: this.form.residentInfoId, residentInfoId: this.form.residentInfoId,
residentsRecord: { residentsRecord: {
...this.info,
...others, ...others,
groupsArrays: this.info.groupsArrays, groupsArrays: this.info.groupsArrays,
id: this.form.personId id: this.form.personId
......
...@@ -312,7 +312,7 @@ export default { ...@@ -312,7 +312,7 @@ export default {
this.currentTime1 = time.split('-') this.currentTime1 = time.split('-')
this.startTime = new dayjs().add(1, 'day').format('YYYY-MM-DD HH:mm:ss') this.startTime = new dayjs().add(1, 'day').format('YYYY-MM-DD HH:mm:ss')
this.startDateRange.max = new Date(date.year() + 10, date.month(), date.date()) this.startDateRange.max = new Date(date.year() + 10, date.month(), date.date())
this.startDateRange.min = new Date(date.year(), date.month(), date.date()) this.startDateRange.min = new Date(date.year(), date.month(), date.date() + 1)
}, },
methods: { methods: {
setForm(data = {}) { setForm(data = {}) {
......
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