This commit is contained in:
zzyuan 2025-08-08 15:13:52 +08:00
commit 1b0778606e
2 changed files with 41 additions and 16 deletions

View File

@ -5,7 +5,7 @@ import request from '@/utils/request';
*/ */
export function healthDetailApi(data) { export function healthDetailApi(data) {
return request({ return request({
url: '/smart-canteen/health_person_info/detail-health-info', url: '/smart-canteen/health_person_info/detail-health-appinfo',
method: 'post', method: 'post',
data data
}) })

View File

@ -65,8 +65,19 @@
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="医嘱" borderBottom labelWidth="200rpx"> <!-- <u-form-item label="医嘱" borderBottom labelWidth="200rpx">
<text class="u-content-color">{{doctorAdvices}}</text> <text class="u-content-color">{{doctorAdvices}}</text>
</u-form-item> -->
<u-form-item label="医嘱" prop="doctorAdvice" borderBottom labelWidth="200rpx" @click="showSelector('doctorAdvice')">
<u--input
v-model="doctorAdviceName"
disabled
border="none"
disabledColor="#ffffff"
placeholder="请选择"
></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="孕否" prop="pregnantStatus" borderBottom labelWidth="200rpx" @click="showSelector('pregnantStatus')"> <u-form-item label="孕否" prop="pregnantStatus" borderBottom labelWidth="200rpx" @click="showSelector('pregnantStatus')">
@ -135,7 +146,8 @@ export default {
weightControl: { options: [{ name: '减重', value: '1' }, { name: '增重', value: '2' }], title: '请选择体重控制' }, weightControl: { options: [{ name: '减重', value: '1' }, { name: '增重', value: '2' }], title: '请选择体重控制' },
labourIntensity: { options: [{ name: '轻劳力', value: '1' }, { name: '中等强度劳动', value: '2' }, { name: '重强度劳动', value: '3' }], title: '请选择劳动强度' }, labourIntensity: { options: [{ name: '轻劳力', value: '1' }, { name: '中等强度劳动', value: '2' }, { name: '重强度劳动', value: '3' }], title: '请选择劳动强度' },
ifHospitalized: { options: [{ name: '是', value: '1' }, { name: '否', value: '2' }], title: '是否住院' }, ifHospitalized: { options: [{ name: '是', value: '1' }, { name: '否', value: '2' }], title: '是否住院' },
pregnantStatus: { options: [{ name: '保密', value: '0' },{ name: '是', value: '2' }, { name: '否', value: '1' }], title: '是否怀孕' } pregnantStatus: { options: [{ name: '保密', value: '0' },{ name: '是', value: '2' }, { name: '否', value: '1' }], title: '是否怀孕' },
doctorAdvice: { options: [{ name: '禁食', value: '1' }, { name: '流食', value: '2' }, { name: '半流食', value: '3' }, { name: '治疗饮食', value: '4' }], title: '请选择医嘱' },
}, },
chronicDiseaseOptions: [ chronicDiseaseOptions: [
{ label: '糖尿病', value: 'diabetes' }, { label: '糖尿病', value: 'diabetes' },
@ -148,15 +160,16 @@ export default {
weight: { type: 'number', required: true, message: '请输入体重', trigger: ['blur', 'change'] }, weight: { type: 'number', required: true, message: '请输入体重', trigger: ['blur', 'change'] },
// labourIntensity: { type: 'string',required: true, message: '', trigger: ['change'] } // labourIntensity: { type: 'string',required: true, message: '', trigger: ['change'] }
}, },
doctorAdvices:'暂无医嘱', // doctorAdvices:'',
weightControlName: '', weightControlName: '',
labourIntensityName: '', labourIntensityName: '',
ifHospitalizedName: '', ifHospitalizedName: '',
pregnantStatusName: '', pregnantStatusName: '',
doctorAdviceName:'',
chronicList:[], chronicList:[],
form: { form: {
nickName:null, nickName:null,
userId:null, userId:uni.getStorageSync('userId'),
orgFullName:null, orgFullName:null,
userType:null, userType:null,
mobile:null, mobile:null,
@ -186,6 +199,7 @@ export default {
'form.labourIntensity': 'updateDisplayLaborIntensityName', 'form.labourIntensity': 'updateDisplayLaborIntensityName',
'form.ifHospitalized': 'updateDisplayHousingName', 'form.ifHospitalized': 'updateDisplayHousingName',
'form.pregnantStatus': 'updatePregnantStatusName', 'form.pregnantStatus': 'updatePregnantStatusName',
'form.doctorAdvice': 'updateDoctorAdviceName',
}, },
onLoad() { onLoad() {
@ -206,18 +220,24 @@ export default {
"userId": uni.getStorageSync('userId') "userId": uni.getStorageSync('userId')
} }
const res = await healthDetailApi(param) const res = await healthDetailApi(param)
console.log("无信息",res);
if(res.data==null||res.data==undefined||res.data==''){
return;
}
this.form = res.data; this.form = res.data;
this.form.userId=uni.getStorageSync('userId');
console.log("this.form",this.form)
if(this.form.chronicIds){ if(this.form.chronicIds){
this.form.chronicDiseases = this.form.chronicIds.split(",") this.form.chronicDiseases = this.form.chronicIds.split(",")
if(this.form.doctorAdvice=='1'){ // if(this.form.doctorAdvice=='1'){
this.doctorAdvices='禁食'; // this.doctorAdvices='';
}else if(this.form.doctorAdvice=='2'){ // }else if(this.form.doctorAdvice=='2'){
this.doctorAdvices='流食'; // this.doctorAdvices='';
}else if(this.form.doctorAdvice=='3'){ // }else if(this.form.doctorAdvice=='3'){
this.doctorAdvices='半流食'; // this.doctorAdvices='';
}else if(this.form.doctorAdvice=='4'){ // }else if(this.form.doctorAdvice=='4'){
this.doctorAdvices='治疗饮食'; // this.doctorAdvices='';
} // }
} }
console.log(res, '详情') console.log(res, '详情')
}, },
@ -257,9 +277,14 @@ export default {
}, },
updateDisplayHousingName() { updateDisplayHousingName() {
this.ifHospitalizedName = this.getDisplayName('ifHospitalized', this.form.ifHospitalized); this.ifHospitalizedName = this.getDisplayName('ifHospitalized', this.form.ifHospitalized);
console.log("this.ifHospitalizedName",this.ifHospitalizedName);
}, },
updatePregnantStatusName() { updatePregnantStatusName() {
this.pregnantStatusName = this.getDisplayName('pregnantStatus', this.form.pregnantStatus); this.pregnantStatusName = this.getDisplayName('pregnantStatus', this.form.pregnantStatus);
},
updateDoctorAdviceName() {
this.doctorAdviceName = this.getDisplayName('doctorAdvice', this.form.doctorAdvice);
console.log("this.doctorAdviceName",this.doctorAdviceName);
}, },
getDisplayName(selector, value) { getDisplayName(selector, value) {
const options = this.selectors[selector]?.options || []; const options = this.selectors[selector]?.options || [];
@ -286,7 +311,7 @@ export default {
} }
}).catch(errors => { }).catch(errors => {
console.error('Validation failed:', errors); console.error('Validation failed:', errors);
uni.$u.toast('请检查并修正错误'); uni.$u.toast('请填写完整信息');
}); });
}, },
hideKeyboard() { hideKeyboard() {