Commit 24d46880 by nlp97

本地永久化存储

parent 078591ea
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-21 12:59:01 * @LastEditTime: 2022-03-21 18:38:00
* @Description: * @Description:
--> -->
<template> <template>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<page6 v-show="page === 6"></page6> <page6 v-show="page === 6"></page6>
<leaveHospital v-show="page === 7"></leaveHospital> <leaveHospital v-show="page === 7"></leaveHospital>
<page7 v-show="page === 8"></page7> <page7 v-show="page === 8"></page7>
<!-- {{ symptom }} -->
<div class="index_form_footer" v-if="page != 1 && page != 2 && page != 8"> <div class="index_form_footer" v-if="page != 1 && page != 2 && page != 8">
<van-button <van-button
class="index_form_footer_next" class="index_form_footer_next"
...@@ -74,7 +74,9 @@ export default { ...@@ -74,7 +74,9 @@ export default {
inject: ["setLoading", "reload"], inject: ["setLoading", "reload"],
name: "index", name: "index",
data() { data() {
return {}; return {
symptom: null,
};
}, },
mounted() {}, mounted() {},
methods: { methods: {
...@@ -231,10 +233,13 @@ export default { ...@@ -231,10 +233,13 @@ export default {
}); });
}, },
save(values) { save(values) {
// this.symptom = values.previousHistory;
this.setLoading(true); this.setLoading(true);
window.localStorage.clear();
this.$http.post(`/Research`, values).then((data) => { this.$http.post(`/Research`, values).then((data) => {
this.$notify({ type: "success", message: "保存成功" }); this.$notify({ type: "success", message: "保存成功" });
this.$store.dispatch("user/setpage", 8); this.$store.dispatch("user/setpage", 8);
window.localStorage.clear();
this.reload(); this.reload();
this.setLoading(false); this.setLoading(false);
}); });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-20 12:12:49 * @LastEditTime: 2022-03-21 16:15:01
* @Description: * @Description:
--> -->
<template> <template>
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
<div class="leaveHospital_text"> <div class="leaveHospital_text">
<van-field colon clearable name="leaveProtagonist" label="今日与患者"> <van-field colon clearable name="leaveProtagonist" label="今日与患者">
<template #input> <template #input>
<van-radio-group v-model="leaveProtagonist" direction="horizontal"> <van-radio-group
@change="setLocalStorge('leaveProtagonist')"
v-model="leaveProtagonist"
direction="horizontal"
>
<van-radio name="本人">本人</van-radio> <van-radio name="本人">本人</van-radio>
<van-radio name="家属">家属</van-radio> <van-radio name="家属">家属</van-radio>
</van-radio-group> </van-radio-group>
...@@ -115,14 +119,39 @@ export default { ...@@ -115,14 +119,39 @@ export default {
}, },
mounted() { mounted() {
this.setleaveDate(); this.setleaveDate();
this.setLastValue();
}, },
methods: { methods: {
setLastValue() {
let arr = [
"leaveProtagonist",
"leaveSign", //出院签字
"leaveDate", // 签字日期
];
arr.map((item) => {
if (this.getLocalStorge(item)) {
this[`${item}`] = this.getLocalStorge(item);
}
});
},
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]);
},
setleaveDate() { setleaveDate() {
this.leaveDate = formatDate(new Date(), "yyyy-MM-dd"); this.leaveDate = formatDate(new Date(), "yyyy-MM-dd");
}, },
onCancel(val) { onCancel(val) {
if (val) { if (val) {
this.leaveSign = val; this.leaveSign = val;
this.setLocalStorge("leaveSign");
} }
this.showSignHandleVue = false; this.showSignHandleVue = false;
...@@ -130,6 +159,7 @@ export default { ...@@ -130,6 +159,7 @@ export default {
onleaveDate(date) { onleaveDate(date) {
this.leaveDate = formatDate(date, "yyyy-MM-dd"); this.leaveDate = formatDate(date, "yyyy-MM-dd");
this.setLocalStorge("leaveDate");
this.showCalendar = false; this.showCalendar = false;
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-20 12:15:21 * @LastEditTime: 2022-03-21 14:32:44
* @Description: * @Description:
--> -->
<template> <template>
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
<van-field colon name="AgreementMode"> <van-field colon name="AgreementMode">
<template #input> <template #input>
<van-radio-group v-model="AgreementMode"> <van-radio-group
@change="setLocalStorge('AgreementMode')"
v-model="AgreementMode"
>
<van-cell-group> <van-cell-group>
<van-cell> <van-cell>
<van-radio name="向贵院出具授权委托书指定代理人" <van-radio name="向贵院出具授权委托书指定代理人"
...@@ -42,6 +45,7 @@ ...@@ -42,6 +45,7 @@
label="住院号" label="住院号"
placeholder="住院号" placeholder="住院号"
:rules="[{ required: true, message: '请填写住院号' }]" :rules="[{ required: true, message: '请填写住院号' }]"
@blur="setLocalStorge('inpatientNumber')"
></van-field> ></van-field>
<van-field <van-field
...@@ -52,6 +56,7 @@ ...@@ -52,6 +56,7 @@
label="楼层" label="楼层"
placeholder="楼层" placeholder="楼层"
:rules="[{ required: true, message: '请填写楼层' }]" :rules="[{ required: true, message: '请填写楼层' }]"
@blur="setLocalStorge('agreementFloor')"
></van-field> ></van-field>
<van-field <van-field
...@@ -61,6 +66,7 @@ ...@@ -61,6 +66,7 @@
name="bedNumber" name="bedNumber"
label="床号" label="床号"
placeholder="床号" placeholder="床号"
@blur="setLocalStorge('bedNumber')"
:rules="[{ required: true, message: '请填写床号' }]" :rules="[{ required: true, message: '请填写床号' }]"
></van-field> ></van-field>
...@@ -154,8 +160,34 @@ export default { ...@@ -154,8 +160,34 @@ export default {
}, },
mounted() { mounted() {
this.setAgreementDate(); this.setAgreementDate();
this.setLastValue();
}, },
methods: { methods: {
setLastValue() {
let arr = [
"AgreementMode",
"inpatientNumber", //入院号
"agreementFloor", //楼层
"bedNumber", //床号
"agreementSign", // 患者签字
"agreementDate",
]; // 签字日期
arr.map((item) => {
if (this.getLocalStorge(item)) {
this[`${item}`] = this.getLocalStorge(item);
}
});
},
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]);
},
// 设置默认时间 // 设置默认时间
setAgreementDate() { setAgreementDate() {
this.agreementDate = formatDate(new Date(), "yyyy-MM-dd"); this.agreementDate = formatDate(new Date(), "yyyy-MM-dd");
...@@ -165,11 +197,13 @@ export default { ...@@ -165,11 +197,13 @@ export default {
console.log(`${val}`); console.log(`${val}`);
if (val) { if (val) {
this.agreementSign = val; this.agreementSign = val;
this.setLocalStorge("agreementSign");
} }
this.showSignHandleVue = false; this.showSignHandleVue = false;
}, },
onAgreementDate(date) { onAgreementDate(date) {
this.agreementDate = formatDate(date, "yyyy-MM-dd"); this.agreementDate = formatDate(date, "yyyy-MM-dd");
this.setLocalStorge("agreementDate");
this.showCalendar = false; this.showCalendar = false;
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-20 14:34:29 * @LastEditTime: 2022-03-21 16:20:00
* @Description: * @Description:
--> -->
<template> <template>
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
label="患者姓名" label="患者姓名"
placeholder="患者姓名" placeholder="患者姓名"
:rules="[{ required: true, message: '请填写患者姓名' }]" :rules="[{ required: true, message: '请填写患者姓名' }]"
@blur="setLocalStorge('patientName')"
></van-field> ></van-field>
<van-field <van-field
...@@ -31,8 +32,6 @@ ...@@ -31,8 +32,6 @@
]" ]"
></van-field> ></van-field>
<!-- 出生日期 birthday-->
<van-field <van-field
colon colon
clearable clearable
...@@ -65,11 +64,26 @@ ...@@ -65,11 +64,26 @@
label="年龄" label="年龄"
placeholder="年龄" placeholder="年龄"
type="digit" type="digit"
@blur="setLocalStorge('age')"
:rules="[{ required: true, message: '请填写年龄' }]" :rules="[{ required: true, message: '请填写年龄' }]"
></van-field> ></van-field>
<van-field colon clearable name="gender" label="性别"> <van-field colon clearable name="gender" label="性别">
<template #input> <template #input>
<van-radio-group v-model="gender" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('gender');
if (gender == '男') {
isConceive = '未孕';
gestationalWeeks = '';
setValue('isConceive','未孕');
setValue('gestationalWeeks','');
}
}
"
v-model="gender"
direction="horizontal"
>
<van-radio name="男"></van-radio> <van-radio name="男"></van-radio>
<van-radio name="女"></van-radio> <van-radio name="女"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -78,7 +92,11 @@ ...@@ -78,7 +92,11 @@
<van-field colon clearable name="maritalStatus" label="婚姻状况"> <van-field colon clearable name="maritalStatus" label="婚姻状况">
<template #input> <template #input>
<van-radio-group v-model="maritalStatus" direction="horizontal"> <van-radio-group
@change="setLocalStorge('maritalStatus')"
v-model="maritalStatus"
direction="horizontal"
>
<van-radio name="已婚">已婚</van-radio> <van-radio name="已婚">已婚</van-radio>
<van-radio name="未婚">未婚</van-radio> <van-radio name="未婚">未婚</van-radio>
</van-radio-group> </van-radio-group>
...@@ -92,7 +110,11 @@ ...@@ -92,7 +110,11 @@
label="怀孕状况" label="怀孕状况"
> >
<template #input> <template #input>
<van-radio-group v-model="isConceive" direction="horizontal"> <van-radio-group
@change="setLocalStorge('isConceive')"
v-model="isConceive"
direction="horizontal"
>
<van-radio name="未孕">未孕</van-radio> <van-radio name="未孕">未孕</van-radio>
<van-radio name="已孕">已孕</van-radio> <van-radio name="已孕">已孕</van-radio>
</van-radio-group> </van-radio-group>
...@@ -107,6 +129,7 @@ ...@@ -107,6 +129,7 @@
label="怀孕周期" label="怀孕周期"
placeholder="怀孕周期" placeholder="怀孕周期"
type="number" type="number"
@blur="setLocalStorge('gestationalWeeks')"
:rules="[ :rules="[
{ {
required: gender == '女' && isConceive == '已孕' ? true : false, required: gender == '女' && isConceive == '已孕' ? true : false,
...@@ -123,6 +146,7 @@ ...@@ -123,6 +146,7 @@
name="occupation" name="occupation"
label="职业" label="职业"
placeholder="职业" placeholder="职业"
@blur="setLocalStorge('occupation')"
:rules="[{ required: true, message: '请填写职业' }]" :rules="[{ required: true, message: '请填写职业' }]"
></van-field> ></van-field>
...@@ -133,6 +157,7 @@ ...@@ -133,6 +157,7 @@
name="contactInformation" name="contactInformation"
label="联系方式" label="联系方式"
placeholder="联系方式" placeholder="联系方式"
@blur="setLocalStorge('contactInformation')"
:rules="[{ required: true, message: '请填写联系方式' }]" :rules="[{ required: true, message: '请填写联系方式' }]"
></van-field> ></van-field>
...@@ -188,13 +213,18 @@ ...@@ -188,13 +213,18 @@
name="address" name="address"
label="详细住址" label="详细住址"
placeholder="详细住址" placeholder="详细住址"
@blur="setLocalStorge('address')"
:rules="[{ required: true, message: '请填写详细住址' }]" :rules="[{ required: true, message: '请填写详细住址' }]"
></van-field> ></van-field>
<!-- 有无商业保险 --> <!-- 有无商业保险 -->
<van-field colon clearable name="insurance" label="商业保险"> <van-field colon clearable name="insurance" label="商业保险">
<template #input> <template #input>
<van-radio-group v-model="insurance" direction="horizontal"> <van-radio-group
@change="setLocalStorge('insurance')"
v-model="insurance"
direction="horizontal"
>
<van-radio name="有"></van-radio> <van-radio name="有"></van-radio>
<van-radio name="无"></van-radio> <van-radio name="无"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -237,8 +267,46 @@ export default { ...@@ -237,8 +267,46 @@ export default {
maxDate: new Date(), maxDate: new Date(),
}; };
}, },
mounted() {}, mounted() {
this.setLastValue();
},
methods: { methods: {
setLastValue() {
let arr = [
"patientName", //患者姓名
"age", //年龄
"gender", //性别
"maritalStatus", //婚姻状况
"birthday", //出生日期
"isConceive", //怀孕状况
"gestationalWeeks", //怀孕周期
"occupation", //职业
"contactInformation", //联系方式
"Registeredresidence", //籍贯 (包括省市)
"province", //籍贯 (省)
"city", //籍贯 (市)
"address", //地址
"idCard", //身份证号
"insurance", //商业保险
];
arr.map((item) => {
if (this.getLocalStorge(item)) {
this[`${item}`] = this.getLocalStorge(item);
}
});
},
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]);
},
setValue(key, value) {
window.localStorage.setItem(key, value);
},
onConfirm(values) { onConfirm(values) {
console.log(values); console.log(values);
this.Registeredresidence = values this.Registeredresidence = values
...@@ -249,6 +317,10 @@ export default { ...@@ -249,6 +317,10 @@ export default {
this.province = values[0].name; this.province = values[0].name;
this.city = values[1].name; this.city = values[1].name;
this.setLocalStorge("Registeredresidence");
this.setLocalStorge("province");
this.setLocalStorge("city");
this.showArea = false; this.showArea = false;
}, },
...@@ -265,6 +337,11 @@ export default { ...@@ -265,6 +337,11 @@ export default {
this.age = obj.age; this.age = obj.age;
this.birthday = obj.birth; this.birthday = obj.birth;
this.gender = obj.sex == 1 ? "男" : "女"; this.gender = obj.sex == 1 ? "男" : "女";
this.setLocalStorge("idCard");
this.setLocalStorge("birthday");
this.setLocalStorge("age");
this.setLocalStorge("gender");
} }
}, },
...@@ -322,6 +399,7 @@ export default { ...@@ -322,6 +399,7 @@ export default {
onbirthday(date) { onbirthday(date) {
this.birthday = formatDate(date, "yyyy-MM-dd "); this.birthday = formatDate(date, "yyyy-MM-dd ");
this.setLocalStorge("birthday");
this.getdate(); this.getdate();
this.showbirthday = false; this.showbirthday = false;
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-21 13:36:08 * @LastEditTime: 2022-03-21 18:29:33
* @Description: * @Description:
--> -->
<template> <template>
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
label="是否上网课" label="是否上网课"
> >
<template #input> <template #input>
<van-radio-group v-model="HasOnlineClass" direction="horizontal"> <van-radio-group
@change="setLocalStorge('HasOnlineClass')"
v-model="HasOnlineClass"
direction="horizontal"
>
<van-radio name="是"></van-radio> <van-radio name="是"></van-radio>
<van-radio name="否"></van-radio> <van-radio name="否"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -51,7 +55,11 @@ ...@@ -51,7 +55,11 @@
label="近30天是否离开过上海" label="近30天是否离开过上海"
> >
<template #input> <template #input>
<van-radio-group v-model="thirtyDays" direction="horizontal"> <van-radio-group
@change="setLocalStorge('thirtyDays')"
v-model="thirtyDays"
direction="horizontal"
>
<van-radio name="是"></van-radio> <van-radio name="是"></van-radio>
<van-radio name="否"></van-radio> <van-radio name="否"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -68,6 +76,7 @@ ...@@ -68,6 +76,7 @@
label-width="130px" label-width="130px"
placeholder="回上海天数" placeholder="回上海天数"
type="digit" type="digit"
@blur="setLocalStorge('LeaveShangHai')"
:rules="[ :rules="[
{ {
required: thirtyDays == '是' ? true : false, required: thirtyDays == '是' ? true : false,
...@@ -161,11 +170,22 @@ ...@@ -161,11 +170,22 @@
clearable clearable
name="HasSymptom" name="HasSymptom"
label-width="130px" label-width="130px"
label="有无症状" label="是否无症状"
@click="HasSymptomChange"
> >
<template #input> <template #input>
<van-radio-group v-model="HasSymptom" direction="horizontal"> <van-radio-group
@change="
() => {
if (HasSymptom == '否') {
symptom = [];
setValue('symptom', '');
}
setLocalStorge('HasSymptom');
}
"
v-model="HasSymptom"
direction="horizontal"
>
<van-radio name="是"></van-radio> <van-radio name="是"></van-radio>
<van-radio name="否"></van-radio> <van-radio name="否"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -173,21 +193,28 @@ ...@@ -173,21 +193,28 @@
</van-field> </van-field>
<van-field <van-field
v-show="HasSymptom == '是'"
colon colon
clearable
v-if="HasSymptom == '是'"
name="symptom"
label="症状"
label-width="130px"
:rules="[ :rules="[
{ {
required: HasSymptom == '是' ? true : false, required: HasSymptom == '是' ? true : false,
message: '请选择症状', message: '请选择症状',
}, },
]" ]"
clearable
name="symptom"
label="症状"
label-width="130px"
> >
<template #input> <template #input>
<van-checkbox-group v-model="symptom"> <van-checkbox-group
@change="
() => {
setLocalStorge('symptom');
}
"
v-model="symptom"
>
<van-cell-group> <van-cell-group>
<van-cell :key="index" v-for="(item, index) in symptomList"> <van-cell :key="index" v-for="(item, index) in symptomList">
<van-checkbox :name="item.element" shape="square"> <van-checkbox :name="item.element" shape="square">
...@@ -198,6 +225,8 @@ ...@@ -198,6 +225,8 @@
</van-checkbox-group> </van-checkbox-group>
</template> </template>
</van-field> </van-field>
<!-- {{ symptom }} -->
<!-- --> <!-- -->
<van-field <van-field
...@@ -208,12 +237,30 @@ ...@@ -208,12 +237,30 @@
label="是否接种过疫苗" label="是否接种过疫苗"
> >
<template #input> <template #input>
<van-radio-group v-model="HasCOVIDVaccine" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('HasCOVIDVaccine');
if (HasCOVIDVaccine == '否') {
covidVaccine = 0;
vaccineType = '';
othervaccines = '';
setValue('covidVaccine', 0);
setValue('vaccineType', '');
setValue('othervaccines', '');
}
}
"
v-model="HasCOVIDVaccine"
direction="horizontal"
>
<van-radio name="是"></van-radio> <van-radio name="是"></van-radio>
<van-radio name="否"></van-radio> <van-radio name="否"></van-radio>
</van-radio-group> </van-radio-group>
</template> </template>
</van-field> </van-field>
<van-field <van-field
v-if="HasCOVIDVaccine == '是'" v-if="HasCOVIDVaccine == '是'"
colon colon
...@@ -224,9 +271,10 @@ ...@@ -224,9 +271,10 @@
placeholder="接种针数" placeholder="接种针数"
label-width="130px" label-width="130px"
type="number" type="number"
@blur="setLocalStorge('covidVaccine')"
:rules="[{ required: true, message: '请填写接种针数' }]" :rules="[{ required: true, message: '请填写接种针数' }]"
> >
<template #extra> </template></van-field <template #extra></template></van-field
> >
<van-field <van-field
...@@ -238,7 +286,11 @@ ...@@ -238,7 +286,11 @@
label="疫苗公司" label="疫苗公司"
> >
<template #input> <template #input>
<van-radio-group v-model="vaccineType" direction="horizontal"> <van-radio-group
@change="setLocalStorge('vaccineType')"
v-model="vaccineType"
direction="horizontal"
>
<van-cell-group> <van-cell-group>
<van-cell :key="index" v-for="(item, index) in vaccineTypeList"> <van-cell :key="index" v-for="(item, index) in vaccineTypeList">
<van-radio :name="item.element">{{ item.element }}</van-radio> <van-radio :name="item.element">{{ item.element }}</van-radio>
...@@ -248,8 +300,6 @@ ...@@ -248,8 +300,6 @@
</template> </template>
</van-field> </van-field>
<!-- -->
<van-field <van-field
colon colon
v-if="vaccineType == '其他'" v-if="vaccineType == '其他'"
...@@ -266,7 +316,9 @@ ...@@ -266,7 +316,9 @@
message: '请填写其他疫苗', message: '请填写其他疫苗',
}, },
]" ]"
@blur="setLocalStorge('othervaccines')"
></van-field> ></van-field>
<van-field <van-field
v-if="covidVaccine > 0" v-if="covidVaccine > 0"
colon colon
...@@ -285,7 +337,7 @@ ...@@ -285,7 +337,7 @@
message: '请选择最后一次接种日期', message: '请选择最后一次接种日期',
}, },
]" ]"
/>, />
<van-popup v-model="showVaccineDate" position="bottom"> <van-popup v-model="showVaccineDate" position="bottom">
<van-datetime-picker <van-datetime-picker
...@@ -325,8 +377,10 @@ export default { ...@@ -325,8 +377,10 @@ export default {
vaccineType: "", //疫苗公司 vaccineType: "", //疫苗公司
othervaccines: "", //其他疫苗 othervaccines: "", //其他疫苗
vaccineDate: "", //最后一次接种日期 vaccineDate: "", //最后一次接种日期
vaccineTypeList: [], vaccineTypeList: [],
symptomList: [], symptomList: [],
showNormalDate: false, //未发生异常时间弹窗 showNormalDate: false, //未发生异常时间弹窗
showUnusualDate: false, //核酸时间弹窗 showUnusualDate: false, //核酸时间弹窗
showInHospitalDate: false, //120时间弹窗 showInHospitalDate: false, //120时间弹窗
...@@ -349,10 +403,51 @@ export default { ...@@ -349,10 +403,51 @@ export default {
}, },
mounted() { mounted() {
this.getResource(); this.getResource();
this.setDefDate(); this.setDefDate();
this.setLastValue();
}, },
methods: { methods: {
setLastValue() {
if (this.getLocalStorge("symptom")) {
this.symptom = this.getLocalStorge("symptom").split(",");
}
let arr = [
"HasOnlineClass", //是否上网课
"purpose", // 来沪目的
"thirtyDays", //近三十天内无离开上海
"LeaveShangHai", //回上海天数
"unusualDate", //核酸检测异常时间
"normalDate", //未发生异常时间
"inHospitalDate", //120转运时间
"HasSymptom", //有无症状
"HasCOVIDVaccine",
"covidVaccine", //接种针数
"vaccineType", //疫苗公司
"othervaccines", //其他疫苗
"vaccineDate", //最后一次接种日期
];
for (let i = 0; i < arr.length; i++) {
if (this.getLocalStorge(arr[i])) {
this[`${arr[i]}`] = this.getLocalStorge(arr[i]);
}
}
},
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]);
},
setValue(key, value) {
window.localStorage.setItem(key, value);
},
setDefDate() { setDefDate() {
this.unusualDate = formatDate(new Date(), "yyyy-MM-dd"); //核酸检测异常时间 this.unusualDate = formatDate(new Date(), "yyyy-MM-dd"); //核酸检测异常时间
this.normalDate = formatDate(new Date(), "yyyy-MM-dd"); //未发生异常时间 this.normalDate = formatDate(new Date(), "yyyy-MM-dd"); //未发生异常时间
...@@ -362,6 +457,7 @@ export default { ...@@ -362,6 +457,7 @@ export default {
onpurpose(value, index) { onpurpose(value, index) {
this.purpose = value; this.purpose = value;
this.setLocalStorge("purpose");
this.showPurpose = false; this.showPurpose = false;
}, },
...@@ -384,12 +480,6 @@ export default { ...@@ -384,12 +480,6 @@ export default {
}); });
}, },
HasSymptomChange() {
if (this.HasSymptom == "否") {
this.symptom = [];
}
},
formatter(type, val) { formatter(type, val) {
if (type === "year") { if (type === "year") {
return `${val}年`; return `${val}年`;
...@@ -407,20 +497,25 @@ export default { ...@@ -407,20 +497,25 @@ export default {
}, },
onNormalDate(date) { onNormalDate(date) {
this.normalDate = formatDate(date, "yyyy-MM-dd "); this.normalDate = formatDate(date, "yyyy-MM-dd ");
this.setLocalStorge("normalDate");
this.showNormalDate = false; this.showNormalDate = false;
}, },
onUnusualDate(date) { onUnusualDate(date) {
this.unusualDate = formatDate(date, "yyyy-MM-dd"); this.unusualDate = formatDate(date, "yyyy-MM-dd");
this.setLocalStorge("unusualDate");
this.showUnusualDate = false; this.showUnusualDate = false;
}, },
onInHospitalDate(date) { onInHospitalDate(date) {
this.inHospitalDate = formatDate(date, "yyyy-MM-dd "); this.inHospitalDate = formatDate(date, "yyyy-MM-dd ");
this.setLocalStorge("inHospitalDate");
this.showInHospitalDate = false; this.showInHospitalDate = false;
}, },
onVaccineDate(date) { onVaccineDate(date) {
this.vaccineDate = formatDate(date, "yyyy-MM-dd"); this.vaccineDate = formatDate(date, "yyyy-MM-dd");
this.setLocalStorge("vaccineDate");
this.showVaccineDate = false; this.showVaccineDate = false;
}, },
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-21 13:10:20 * @LastEditTime: 2022-03-21 18:32:17
* @Description: * @Description:
--> -->
<template> <template>
...@@ -15,7 +15,23 @@ ...@@ -15,7 +15,23 @@
label="过敏史" label="过敏史"
> >
<template #input> <template #input>
<van-radio-group v-model="hasHistoryAllergies" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('hasHistoryAllergies');
if (hasHistoryAllergies == '无') {
foodAllergy = '';
drugAllergy = '';
otherAllergy = '';
setValue('foodAllergy', '');
setValue('drugAllergy', '');
setValue('otherAllergy', '');
}
}
"
v-model="hasHistoryAllergies"
direction="horizontal"
>
<van-radio name="有"></van-radio> <van-radio name="有"></van-radio>
<van-radio name="无"></van-radio> <van-radio name="无"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -48,6 +64,7 @@ ...@@ -48,6 +64,7 @@
name="foodAllergy" name="foodAllergy"
label="食物过敏原" label="食物过敏原"
placeholder="食物过敏原" placeholder="食物过敏原"
@blur="setLocalStorge('foodAllergy')"
></van-field> ></van-field>
<van-field <van-field
v-if="hasHistoryAllergies == '有'" v-if="hasHistoryAllergies == '有'"
...@@ -58,6 +75,7 @@ ...@@ -58,6 +75,7 @@
name="drugAllergy " name="drugAllergy "
label="药物过敏原" label="药物过敏原"
placeholder="食物过敏原" placeholder="食物过敏原"
@blur="setLocalStorge('drugAllergy')"
></van-field> ></van-field>
<van-field <van-field
v-if="hasHistoryAllergies == '有'" v-if="hasHistoryAllergies == '有'"
...@@ -68,6 +86,7 @@ ...@@ -68,6 +86,7 @@
name="otherAllergy" name="otherAllergy"
label="其他过敏原" label="其他过敏原"
placeholder="其他过敏原" placeholder="其他过敏原"
@blur="setLocalStorge('otherAllergy')"
></van-field> ></van-field>
<van-field <van-field
...@@ -78,7 +97,20 @@ ...@@ -78,7 +97,20 @@
label="手术史" label="手术史"
> >
<template #input> <template #input>
<van-radio-group v-model="hasHistorySurgery" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('hasHistorySurgery');
if (hasHistorySurgery == '无') {
historySurgery = '';
setValue('historySurgery', '');
}
}
"
v-model="hasHistorySurgery"
direction="horizontal"
>
<van-radio name="有"></van-radio> <van-radio name="有"></van-radio>
<van-radio name="无"></van-radio> <van-radio name="无"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -94,6 +126,7 @@ ...@@ -94,6 +126,7 @@
name="historySurgery" name="historySurgery"
label="手术史具体内容" label="手术史具体内容"
placeholder="具体内容" placeholder="具体内容"
@blur="setLocalStorge('historySurgery')"
:rules="[ :rules="[
{ {
required: hasHistorySurgery == '有' ? true : false, required: hasHistorySurgery == '有' ? true : false,
...@@ -110,7 +143,21 @@ ...@@ -110,7 +143,21 @@
label="有无既往史" label="有无既往史"
> >
<template #input> <template #input>
<van-radio-group v-model="HasPreviousHistory" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('HasPreviousHistory');
if (HasPreviousHistory == '无') {
previousHistory = [];
otherPastHistory = '';
setValue('previousHistory');
setValue('otherPastHistory', '');
}
}
"
v-model="HasPreviousHistory"
direction="horizontal"
>
<van-radio name="有"></van-radio> <van-radio name="有"></van-radio>
<van-radio name="无"></van-radio> <van-radio name="无"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -123,7 +170,7 @@ ...@@ -123,7 +170,7 @@
name="previousHistory" name="previousHistory"
label-width="125px" label-width="125px"
label="既往史" label="既往史"
v-if="HasPreviousHistory != '无'" v-show="HasPreviousHistory != '无'"
:rules="[ :rules="[
{ {
required: HasPreviousHistory != '无' ? true : false, required: HasPreviousHistory != '无' ? true : false,
...@@ -132,7 +179,10 @@ ...@@ -132,7 +179,10 @@
]" ]"
> >
<template #input> <template #input>
<van-checkbox-group v-model="previousHistory"> <van-checkbox-group
@change="setLocalStorge('previousHistory')"
v-model="previousHistory"
>
<van-cell-group> <van-cell-group>
<van-cell v-for="(item, index) in previousHistoryList" :key="index"> <van-cell v-for="(item, index) in previousHistoryList" :key="index">
<van-checkbox :name="item.element" shape="square">{{ <van-checkbox :name="item.element" shape="square">{{
...@@ -160,6 +210,7 @@ ...@@ -160,6 +210,7 @@
message: '请填写其他既往史', message: '请填写其他既往史',
}, },
]" ]"
@blur="setLocalStorge('otherPastHistory')"
></van-field> ></van-field>
<van-field <van-field
...@@ -204,7 +255,19 @@ ...@@ -204,7 +255,19 @@
label="有无CT检查" label="有无CT检查"
> >
<template #input> <template #input>
<van-radio-group v-model="yesOrNoCt" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('yesOrNoCt');
if (yesOrNoCt == '无') {
ChestCT = '无';
setValue('ChestCT', '');
}
}
"
v-model="yesOrNoCt"
direction="horizontal"
>
<van-radio name="有"></van-radio> <van-radio name="有"></van-radio>
<van-radio name="无"></van-radio> <van-radio name="无"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -220,7 +283,15 @@ ...@@ -220,7 +283,15 @@
label="有无新冠肺炎CT" label="有无新冠肺炎CT"
> >
<template #input> <template #input>
<van-radio-group v-model="ChestCT" direction="horizontal"> <van-radio-group
@change="
() => {
setLocalStorge('ChestCT');
}
"
v-model="ChestCT"
direction="horizontal"
>
<van-radio name="有"></van-radio> <van-radio name="有"></van-radio>
<van-radio name="无"></van-radio> <van-radio name="无"></van-radio>
</van-radio-group> </van-radio-group>
...@@ -299,8 +370,53 @@ export default { ...@@ -299,8 +370,53 @@ export default {
mounted() { mounted() {
this.getResource(); this.getResource();
this.setChestCTDate(); this.setChestCTDate();
this.setLastValue();
}, },
methods: { methods: {
setLastValue() {
let arr = [
"hasHistoryAllergies", //过敏史
"historyAllergies", //过敏原
"foodAllergy", //食物过敏
"drugAllergy", //药物过敏
"otherAllergy", //其他过敏
"hasHistorySurgery", //手术史
"historySurgery", //具体内容
"HasPreviousHistory", //有无既往史
"previousHistory", //既往史
"otherPastHistory", //其他既往史
"tuberculosisDate", //既往史发生时间
"yesOrNoCt",
"ChestCT", //有无CT
"ChestCTDate", //CT拍照时间
];
arr.map((item) => {
if (this.getLocalStorge(item)) {
// if (item == "previousHistory") {
// this[`${item}`] = this.getLocalStorge(item).split(",");
// } else if (item != "previousHistory") {
this[`${item}`] = this.getLocalStorge(item);
// }
}
});
this.previousHistory = this.getLocalStorge("previousHistory").split(",");
},
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]);
},
setValue(key, value) {
window.localStorage.setItem(key, value);
},
setChestCTDate() { setChestCTDate() {
this.ChestCTDate = formatDate(new Date(), "yyyy-MM-dd"); this.ChestCTDate = formatDate(new Date(), "yyyy-MM-dd");
}, },
...@@ -315,11 +431,13 @@ export default { ...@@ -315,11 +431,13 @@ export default {
}, },
onConfirm(date) { onConfirm(date) {
this.tuberculosisDate = formatDate(date, "yyyy-MM"); this.tuberculosisDate = formatDate(date, "yyyy-MM");
this.setLocalStorge("tuberculosisDate");
this.showPicker = false; this.showPicker = false;
}, },
onChestCT(date) { onChestCT(date) {
this.ChestCTDate = formatDate(date, "yyyy-MM-dd "); this.ChestCTDate = formatDate(date, "yyyy-MM-dd ");
this.setLocalStorge("ChestCTDate");
this.showCalendar = false; this.showCalendar = false;
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2022-03-17 15:06:50 * @Date: 2022-03-17 15:06:50
* @LastEditors: ninglupeng * @LastEditors: ninglupeng
* @LastEditTime: 2022-03-21 13:40:05 * @LastEditTime: 2022-03-21 16:15:57
* @Description: * @Description:
*/ */
import http from '@/http/index' import http from '@/http/index'
......
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