替换页面列表字段翻译

parent 24df1e15
<!-- <!--
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng * @LastEditors: wsq
* @LastEditTime: 2022-11-01 10:07:10 * @LastEditTime: 2022-11-04 12:46:25
* @Description: * @Description:
--> -->
<template> <template>
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
inject: ["setLoading"], inject: ["setLoading"],
data() { data() {
return { return {
AgreementMode: "向贵院出具授权委托书指定代理人", AgreementMode:this.$i18n.locale=='zh'?"向贵院出具授权委托书指定代理人":'دوختۇخانغا ۋاكالەتچى بەلگىلەنگەن ھوقۇق بېرىش ھاۋالە خىتى چىقىرىپ بىرىمەن',
buildingNumber: "", //楼号 buildingNumber: "", //楼号
agreementFloor: "", //楼层 agreementFloor: "", //楼层
bedNumber: "", //床号 bedNumber: "", //床号
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
}, },
mounted() { mounted() {
this.getResource(); this.getResource();
console.log('this.$i18n.locale',this.$i18n.locale);
this.setAgreementDate(); this.setAgreementDate();
this.setLastValue(); this.setLastValue();
}, },
......
...@@ -2,254 +2,497 @@ ...@@ -2,254 +2,497 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: wsq * @LastEditors: wsq
* @LastEditTime: 2022-11-03 16:08:42 * @LastEditTime: 2022-11-04 15:47:22
* @Description: * @Description:
--> -->
<template> <template>
<div class="page4"> <div class="page4">
<van-field colon clearable v-model="patientName" name="patientName" :label="$t('patientName')" <van-field
:placeholder="$t('patientName')" :rules="[{ required: true, message: `请填写${$t('patientName')}` }]" colon
@blur="setLocalStorge('patientName')"> clearable
</van-field> v-model="patientName"
name="patientName"
<van-field colon clearable name="orNotByEntry" :label="$t('orNotByEntry')"> :label="$t('patientName')"
<template #input> :placeholder="$t('patientName')"
<van-radio-group @change="setLocalStorge('orNotByEntry')" v-model="orNotByEntry" direction="horizontal"> :rules="[{ required: true, message: `请填写${$t('patientName')}` }]"
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> @blur="setLocalStorge('patientName')"
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> >
</van-radio-group> </van-field>
</template>
</van-field> <van-field colon clearable name="orNotByEntry" :label="$t('orNotByEntry')">
<template #input>
<van-field colon clearable name="nationality" :label="$t('nationality')" readonly :value="nationality" <van-radio-group
@click="shownationality = true" :rules="[{ required: true, message: `请填写${$t('nationality')}` }]"> @change="setLocalStorge('orNotByEntry')"
</van-field> v-model="orNotByEntry"
<van-popup v-model="shownationality" position="bottom"> direction="horizontal"
<van-picker :title="$t('nationality')" show-toolbar :columns="nationalityList" @confirm=" >
(value, index) => { <van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
nationality = value; <van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
setLocalStorge('nationality'); </van-radio-group>
shownationality = false; </template>
} </van-field>
" @cancel="
() => { <van-field
shownationality = false; colon
} clearable
" /> name="nationality"
</van-popup> :label="$t('nationality')"
<van-field colon v-if="nationality != $t('China')" clearable v-model="passportId" name="passportId" readonly
:label="$t('passportId')" :placeholder="$t('passportId')" :rules="[ :value="nationality"
{ @click="shownationality = true"
required: nationality != $t('China') ? true : false, :rules="[{ required: true, message: `请填写${$t('nationality')}` }]"
message: `请填写${$t('passportId')}`, >
}, </van-field>
]"></van-field>
<van-popup v-model="shownationality" position="bottom">
<van-field colon clearable v-if="nationality == $t('China')" v-model="idCard" name="idCard" :label="$t('idCard')" <van-picker
:placeholder="$t('idCard')" @blur="getdate" :rules="[ :title="$t('nationality')"
{ required: true, message: `请填写${$t('idCard')}` }, show-toolbar
{ validator, message: `${$t('idCard')}格式错误!` }, :columns="nationalityList"
]"></van-field> @confirm="
(value, index) => {
<van-field colon clearable name="gender" :label="$t('gender')"> nationality = value;
<template #input> setLocalStorge('nationality');
<van-radio-group @change=" shownationality = false;
() => { }
setLocalStorge('gender'); "
if (gender == $t('boy')) { @cancel="
isConceive = $t('Nonpregnant'); () => {
gestationalWeeks = ''; shownationality = false;
setValue('isConceive', $t('Nonpregnant')); }
setValue('gestationalWeeks', ''); "
} />
} </van-popup>
" v-model="gender" direction="horizontal"> <van-field
<van-radio :name="$t('boy')">{{$t('boy')}}</van-radio> colon
<van-radio :name="$t('girl')">{{$t('girl')}}</van-radio> v-if="nationality != $t('China')"
</van-radio-group> clearable
</template> v-model="passportId"
</van-field> name="passportId"
:label="$t('passportId')"
<van-field colon clearable readonly clickable name="birthday" :value="birthday" :label="$t('birthday')" :placeholder="$t('birthday')" :placeholder="$t('passportId')"
@click="showbirthday = true" :rules="[{ required: true, message: `请选择${$t('birthday')}` }]" /> :rules="[
{
<van-popup v-model="showbirthday" position="bottom"> required: nationality != $t('China') ? true : false,
<van-datetime-picker type="date" :min-date="minbirthday" :max-date="maxDate" @confirm="onbirthday" message: `请填写${$t('passportId')}`,
@cancel="showbirthday = false" :formatter="formatter" /> },
</van-popup> ]"
></van-field>
<van-field colon clearable v-model="age" name="age" :label="$t('age')" :placeholder="$t('age')" type="digit"
@blur="setLocalStorge('age')" :rules="[{ required: true, message: `请填写${$t('age')}` }]"></van-field> <van-field
colon
<van-field colon clearable v-model="height" name="height" :label="$t('height')" :placeholder="$t('height')" type="digit" clearable
@blur="setLocalStorge('height')" :rules="[{ required: true, message: `请填写${$t('height')}`}]"> v-if="nationality == $t('China')"
<template #extra> v-model="idCard"
CM name="idCard"
</template> :label="$t('idCard')"
</van-field> :placeholder="$t('idCard')"
@blur="getdate"
<van-field colon clearable v-model="weight" name="weight" :label="$t('weight')" :placeholder="$t('weight')" type="number" :rules="[
@blur="setLocalStorge('weight')" :rules="[{ required: true, message: `请填写${$t('weight')}` }]"> { required: true, message: `请填写${$t('idCard')}` },
<template #extra> { validator, message: `${$t('idCard')}格式错误!` },
KG ]"
</template> ></van-field>
</van-field>
<van-field colon clearable name="gender" :label="$t('gender')">
<van-field colon clearable name="maritalStatus" :label="$t('maritalStatus')"> <template #input>
<template #input> <van-radio-group
<van-radio-group @change="setLocalStorge('maritalStatus')" v-model="maritalStatus" @change="
direction="horizontal"> () => {
setLocalStorge('gender');
<van-radio :name="$t('married')">{{$t('married')}}</van-radio> if (gender == $t('boy')) {
<van-radio :name="$t('unmarried')">{{$t('unmarried')}}</van-radio> isConceive = $t('Nonpregnant');
</van-radio-group> gestationalWeeks = '';
</template> setValue('isConceive', $t('Nonpregnant'));
</van-field> setValue('gestationalWeeks', '');
<van-field colon clearable v-if="gender == $t('girl')" name="isConceive" :label="$t('isConceive')"> }
<template #input> }
<van-radio-group @change="setLocalStorge('isConceive')" v-model="isConceive" direction="horizontal"> "
v-model="gender"
<van-radio :name="$t('Nonpregnant')">{{$t('Nonpregnant')}}</van-radio> direction="horizontal"
<van-radio :name="$t('pregnant')">{{$t('pregnant')}}</van-radio> >
</van-radio-group> <van-radio :name="$t('boy')">{{ $t("boy") }}</van-radio>
</template> <van-radio :name="$t('girl')">{{ $t("girl") }}</van-radio>
</van-field> </van-radio-group>
<van-field colon clearable v-if="gender == $t('girl') && isConceive == $t('pregnant')" v-model="gestationalWeeks" </template>
name="gestationalWeeks" :label="$t('gestationalWeeks')" :placeholder="$t('gestationalWeeks')" type="number" </van-field>
@blur="setLocalStorge('gestationalWeeks')" :rules="[
{ <van-field
required: gender == $t('girl') && isConceive == $t('pregnant') ? true : false, colon
message: `请填写${$t('gestationalWeeks')}`, clearable
}, readonly
]"> clickable
<template #extra>{{$t('week')}} </template> name="birthday"
</van-field> :value="birthday"
:label="$t('birthday')"
<van-field colon clearable name="occupation" :label="$t('occupation')" readonly :value="occupation" :placeholder="$t('birthday')"
@click="showoccupation = true" :rules="[{ required: true, message: `请填写${$t('occupation')}` }]"> @click="showbirthday = true"
</van-field> :rules="[{ required: true, message: `请选择${$t('birthday')}` }]"
<van-popup v-model="showoccupation" position="bottom"> />
<van-picker :title="$t('occupation')" show-toolbar :columns="occupationList" @confirm="
(value, index) => { <van-popup v-model="showbirthday" position="bottom">
occupation = value; <van-datetime-picker
setLocalStorge('occupation'); type="date"
showoccupation = false; :min-date="minbirthday"
} :max-date="maxDate"
" @cancel=" @confirm="onbirthday"
() => { @cancel="showbirthday = false"
showoccupation = false; :formatter="formatter"
} />
" /> </van-popup>
</van-popup>
<van-field
<van-field colon v-show="occupation == $t('other')" clearable autosize type="textarea" v-model="otherOccupation" colon
name="otherOccupation" :label="$t('otherOccupation')" :placeholder="$t('otherOccupation')" :rules="[ clearable
{ v-model="age"
required: occupation == $t('other') ? true : false, name="age"
message: `请填写${$t('otherOccupation')}`, :label="$t('age')"
}, :placeholder="$t('age')"
]" @blur="setLocalStorge('otherOccupation')"></van-field> type="digit"
@blur="setLocalStorge('age')"
:rules="[{ required: true, message: `请填写${$t('age')}` }]"
></van-field>
<van-field colon clearable v-model="contactInformation" name="contactInformation" :label="$t('contactInformation')" :placeholder="$t('contactInformation')" @blur="setLocalStorge('contactInformation')"
:rules="[{ required: true, message: `请填写${$t('contactInformation')}` }]"></van-field> <van-field
<van-field colon clearable v-model="FamilyMembersPhone" name="FamilyMembersPhone" :label="$t('FamilyMembersPhone')" :placeholder="$t('FamilyMembersPhone')" @blur="setLocalStorge('FamilyMembersPhone')" colon
:rules="[{ required: true, message:`请填写${$t('FamilyMembersPhone')}` }]"></van-field> clearable
v-model="height"
name="height"
<!-- <van-field colon clearable readonly clickable name="province" :value="province" :label="$t('province')" v-show="false" /> :label="$t('height')"
:placeholder="$t('height')"
type="digit"
@blur="setLocalStorge('height')"
:rules="[{ required: true, message: `请填写${$t('height')}` }]"
>
<template #extra>
CM
</template>
</van-field>
<van-field
colon
clearable
v-model="weight"
name="weight"
:label="$t('weight')"
:placeholder="$t('weight')"
type="number"
@blur="setLocalStorge('weight')"
:rules="[{ required: true, message: `请填写${$t('weight')}` }]"
>
<template #extra>
KG
</template>
</van-field>
<van-field
colon
clearable
name="maritalStatus"
:label="$t('maritalStatus')"
>
<template #input>
<van-radio-group
@change="setLocalStorge('maritalStatus')"
v-model="maritalStatus"
direction="horizontal"
>
<van-radio :name="$t('married')">{{ $t("married") }}</van-radio>
<van-radio :name="$t('unmarried')">{{ $t("unmarried") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
colon
clearable
v-if="gender == $t('girl')"
name="isConceive"
:label="$t('isConceive')"
>
<template #input>
<van-radio-group
@change="setLocalStorge('isConceive')"
v-model="isConceive"
direction="horizontal"
>
<van-radio :name="$t('Nonpregnant')">{{
$t("Nonpregnant")
}}</van-radio>
<van-radio :name="$t('pregnant')">{{ $t("pregnant") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
colon
clearable
v-if="gender == $t('girl') && isConceive == $t('pregnant')"
v-model="gestationalWeeks"
name="gestationalWeeks"
:label="$t('gestationalWeeks')"
:placeholder="$t('gestationalWeeks')"
type="number"
@blur="setLocalStorge('gestationalWeeks')"
:rules="[
{
required:
gender == $t('girl') && isConceive == $t('pregnant') ? true : false,
message: `请填写${$t('gestationalWeeks')}`,
},
]"
>
<template #extra>{{ $t("week") }} </template>
</van-field>
<van-field
colon
clearable
name="occupation"
:label="$t('occupation')"
readonly
:value="occupation"
@click="showoccupation = true"
:rules="[{ required: true, message: `请填写${$t('occupation')}` }]"
>
</van-field>
<van-popup v-model="showoccupation" position="bottom">
<van-picker
:title="$t('occupation')"
show-toolbar
:columns="occupationList"
@confirm="
(value, index) => {
occupation = value;
setLocalStorge('occupation');
showoccupation = false;
}
"
@cancel="
() => {
showoccupation = false;
}
"
/>
</van-popup>
<van-field
colon
v-show="occupation == $t('other')"
clearable
autosize
type="textarea"
v-model="otherOccupation"
name="otherOccupation"
:label="$t('otherOccupation')"
:placeholder="$t('otherOccupation')"
:rules="[
{
required: occupation == $t('other') ? true : false,
message: `请填写${$t('otherOccupation')}`,
},
]"
@blur="setLocalStorge('otherOccupation')"
></van-field>
<van-field
colon
clearable
v-model="contactInformation"
name="contactInformation"
:label="$t('contactInformation')"
:placeholder="$t('contactInformation')"
@blur="setLocalStorge('contactInformation')"
:rules="[
{ required: true, message: `请填写${$t('contactInformation')}` },
]"
></van-field>
<van-field
colon
clearable
v-model="FamilyMembersPhone"
name="FamilyMembersPhone"
:label="$t('FamilyMembersPhone')"
:placeholder="$t('FamilyMembersPhone')"
@blur="setLocalStorge('FamilyMembersPhone')"
:rules="[
{ required: true, message: `请填写${$t('FamilyMembersPhone')}` },
]"
></van-field>
<!-- <van-field colon clearable readonly clickable name="province" :value="province" :label="$t('province')" v-show="false" />
<van-field colon clearable readonly clickable name="city" :value="city" label="户籍地(市)" v-show="false" /> --> <van-field colon clearable readonly clickable name="city" :value="city" label="户籍地(市)" v-show="false" /> -->
<van-field colon clearable readonly clickable name="Registeredresidence" :value="Registeredresidence" <van-field
:label="$t('Registeredresidence')" :placeholder="`点击选择${$t('Registeredresidence')}`" @click="showArea = true" colon
:rules="[{ required: true, message: `请点击选择${$t('Registeredresidence')}` }]" /> clearable
<van-popup v-model="showArea" position="bottom"> readonly
<van-area :area-list="areaList" :columns-num="2" @confirm="onConfirm" @cancel="showArea = false" /> clickable
</van-popup> name="Registeredresidence"
<van-field colon clearable autosize type="textarea" v-model="address" name="address" :label="$t('address')" :value="Registeredresidence"
:placeholder="$t('address')" @blur="setLocalStorge('address')" :rules="[{ required: true, message: `请填写${$t('address')}` }]"> :label="$t('Registeredresidence')"
</van-field> :placeholder="`点击选择${$t('Registeredresidence')}`"
@click="showArea = true"
<van-field colon clearable name="typeOfMedicalInsurance" :label="$t('typeOfMedicalInsurance')" readonly :value="typeOfMedicalInsurance" :rules="[
@click="showtypeOfMedicalInsurance = true" :rules="[{ required: true, message: `请填写${$t('typeOfMedicalInsurance')}` }]"> { required: true, message: `请点击选择${$t('Registeredresidence')}` },
</van-field> ]"
<van-popup v-model="showtypeOfMedicalInsurance" position="bottom"> />
<van-picker :title="$t('typeOfMedicalInsurance')" show-toolbar :columns="typeOfMedicalInsuranceList" @confirm=" <van-popup v-model="showArea" position="bottom">
(value, index) => { <van-area
typeOfMedicalInsurance = value; :area-list="areaList"
setLocalStorge('typeOfMedicalInsurance'); :columns-num="2"
showtypeOfMedicalInsurance = false; @confirm="onConfirm"
} @cancel="showArea = false"
" @cancel=" />
() => { </van-popup>
showtypeOfMedicalInsurance = false; <van-field
} colon
" /> clearable
</van-popup> autosize
type="textarea"
<!-- 有无商业保险 --> v-model="address"
<van-field colon clearable name="insurance" :label="$t('insurance')"> name="address"
<template #input> :label="$t('address')"
<van-radio-group @change="setLocalStorge('insurance')" v-model="insurance" direction="horizontal"> :placeholder="$t('address')"
<van-radio :name="$t('have')">{{ $t('have') }}</van-radio> @blur="setLocalStorge('address')"
<van-radio :name="$t('noHave')">{{ $t('noHave') }}</van-radio> :rules="[{ required: true, message: `请填写${$t('address')}` }]"
</van-radio-group> >
</template> </van-field>
</van-field>
<van-field style="margin-left: -35px;" colon clearable name="HasSymptom" label-width="130px" :label="$t('HasSymptom')"> <van-field
<template #input> colon
<van-radio-group @change=" clearable
() => { name="typeOfMedicalInsurance"
if (HasSymptom == $t('no')) { :label="$t('typeOfMedicalInsurance')"
symptom = []; readonly
otherSymptom = ''; :value="typeOfMedicalInsurance"
@click="showtypeOfMedicalInsurance = true"
setValue('symptom', ''); :rules="[
setValue('otherSymptom', ''); { required: true, message: `请填写${$t('typeOfMedicalInsurance')}` },
} ]"
setLocalStorge('HasSymptom'); >
} </van-field>
" v-model="HasSymptom" direction="horizontal"> <van-popup v-model="showtypeOfMedicalInsurance" position="bottom">
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> <van-picker
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> :title="$t('typeOfMedicalInsurance')"
</van-radio-group> show-toolbar
</template> :columns="typeOfMedicalInsuranceList"
</van-field> @confirm="
(value, index) => {
<van-field style="margin-left: -35px;" v-if="HasSymptom == $t('yes')" colon :rules="[ typeOfMedicalInsurance = value;
{ setLocalStorge('typeOfMedicalInsurance');
required: HasSymptom == $t('yes') ? true : false, showtypeOfMedicalInsurance = false;
message: `请选择${$t('symptom')}`, }
}, "
]" clearable name="symptom" :label="$t('symptom')" label-width="130px"> @cancel="
<template #input> () => {
<van-checkbox-group @change=" showtypeOfMedicalInsurance = false;
() => { }
setLocalStorge('symptom'); "
} />
" v-model="symptom" direction="horizontal" class="symptom"> </van-popup>
<template v-for="(item, index) in symptomList"> <!-- 有无商业保险 -->
<van-checkbox :key="index" :name="item.element" shape="square"> <van-field colon clearable name="insurance" :label="$t('insurance')">
{{ item.element }}</van-checkbox> <template #input>
</template> <van-radio-group
@change="setLocalStorge('insurance')"
</van-checkbox-group> v-model="insurance"
</template> direction="horizontal"
</van-field> >
<van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
<van-field style="margin-left: 10px;" colon v-if="symptom.includes($t('other')) && HasSymptom == $t('yes')" clearable <van-radio :name="$t('noHave')">{{ $t("noHave") }}</van-radio>
autosize type="textarea" v-model="otherSymptom" name="otherSymptom" :label="$t('otherSymptom')" :placeholder="$t('otherSymptom')" :rules="[ </van-radio-group>
{ </template>
required: symptom.includes($t('other')) && HasSymptom == $t('yes') ? true : false, </van-field>
message: `请填写${$t('otherSymptom')}` , <van-field
}, style="margin-left: -35px;"
]" @blur="setLocalStorge('otherSymptom')"></van-field> colon
clearable
name="HasSymptom"
label-width="130px"
</div> :label="$t('HasSymptom')"
>
<template #input>
<van-radio-group
@change="
() => {
if (HasSymptom == $t('no')) {
symptom = [];
otherSymptom = '';
setValue('symptom', '');
setValue('otherSymptom', '');
}
setLocalStorge('HasSymptom');
}
"
v-model="HasSymptom"
direction="horizontal"
>
<van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
<van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
style="margin-left: -35px;"
v-if="HasSymptom == $t('yes')"
colon
:rules="[
{
required: HasSymptom == $t('yes') ? true : false,
message: `请选择${$t('symptom')}`,
},
]"
clearable
name="symptom"
:label="$t('symptom')"
label-width="130px"
>
<template #input>
<van-checkbox-group
@change="
() => {
setLocalStorge('symptom');
}
"
v-model="symptom"
direction="horizontal"
class="symptom"
>
<template v-for="(item, index) in symptomList">
<van-checkbox :key="index" :name="item.element" shape="square">
{{ item.element }}</van-checkbox
>
</template>
</van-checkbox-group>
</template>
</van-field>
<van-field
style="margin-left: 10px;"
colon
v-if="symptom.includes($t('other')) && HasSymptom == $t('yes')"
clearable
autosize
type="textarea"
v-model="otherSymptom"
name="otherSymptom"
:label="$t('otherSymptom')"
:placeholder="$t('otherSymptom')"
:rules="[
{
required:
symptom.includes($t('other')) && HasSymptom == $t('yes')
? true
: false,
message: `请填写${$t('otherSymptom')}`,
},
]"
@blur="setLocalStorge('otherSymptom')"
></van-field>
</div>
</template> </template>
<script> <script>
...@@ -258,300 +501,341 @@ import { areaList } from "@vant/area-data"; ...@@ -258,300 +501,341 @@ import { areaList } from "@vant/area-data";
import { formatDate } from "../utils/common.js"; import { formatDate } from "../utils/common.js";
export default { export default {
name: "page4", name: "page4",
inject: ["setLoading"], inject: ["setLoading"],
data() { data() {
return { return {
patientName: "", //患者姓名 patientName: "", //患者姓名
orNotByEntry: "否", //近期是否由国外入境 orNotByEntry: this.$i18n.locale == "zh" ? "否" : "ياق", //近期是否由国外入境 ---默认值 否
nationality: "中国", //国籍 nationality: "", //国籍--默认值 中国
passportId: "", //护照号 passportId: "", //护照号
age: "", //年龄 age: "", //年龄
height: "", //身高 height: "", //身高
weight: "", weight: "",
gender: "男", //性别 gender: this.$i18n.locale == "zh" ? "男" : "ئەر", //性别--默认值 男
maritalStatus: "未婚", //婚姻状况 maritalStatus: this.$i18n.locale == "zh" ? "未婚" : "نىكاھلانغانمىغان", //婚姻状况--默认值 未婚
birthday: "", //出生日期 birthday: "", //出生日期
isConceive: "未孕", //怀孕状况 isConceive: this.$i18n.locale == "zh" ? "未孕" : "ھامىلدار", //怀孕状况--默认值 未孕
gestationalWeeks: "", //怀孕周期 gestationalWeeks: "", //怀孕周期
occupation: "", //职业 occupation: "", //职业
otherOccupation: "",//其他职业 otherOccupation: "", //其他职业
contactInformation: "", //联系方式 contactInformation: "", //联系方式
FamilyMembersPhone: "", //家属联系方式 FamilyMembersPhone: "", //家属联系方式
// workOrNotCovid: "否", // workOrNotCovid: "否",
Registeredresidence: "", //籍贯 (包括省市) Registeredresidence: "", //籍贯 (包括省市)
province: "", //籍贯 (省) province: "", //籍贯 (省)
city: "", //籍贯 (市) city: "", //籍贯 (市)
address: "", //地址 address: "", //地址
idCard: "", //身份证号 idCard: "", //身份证号
typeOfMedicalInsurance: "上海医保", //医保类型 typeOfMedicalInsurance: this.$i18n.locale == "", //医保类型---默认值 上海医保
insurance: "无", //商业保险 insurance: this.$i18n.locale == "zh" ? "无" : "يوق", //商业保险---默认值 无
HasSymptom: "否", //有无症状 HasSymptom: this.$i18n.locale == "zh" ? "否" : "ياق", //有无症状---默认值 否
symptom: [], //患者症状 symptom: [], //患者症状
otherSymptom: "", //其他症状 otherSymptom: "", //其他症状
symptomList: [],//症状列表 symptomList: [], //症状列表
areaList, //地址数据选项列表 areaList, //地址数据选项列表
showArea: false, //控制地址弹窗 showArea: false, //控制地址弹窗
showbirthday: false, //出生时间弹窗 showbirthday: false, //出生时间弹窗
minbirthday: new Date(1920, 0, 1), minbirthday: new Date(1920, 0, 1),
occupationList: [], occupationList: [],
showoccupation: false, showoccupation: false,
nationalityList: [], //国籍列表 nationalityList: [], //国籍列表
typeOfMedicalInsuranceList: [], typeOfMedicalInsuranceList: [],
shownationality: false, shownationality: false,
showtypeOfMedicalInsurance: false, showtypeOfMedicalInsurance: false,
maxDate: new Date(), maxDate: new Date(),
}; };
}, },
mounted() { mounted() {
this.getResource(); if (this.$i18n.locale == "zh") {
this.setLastValue(); this.getResource();
}, } else {
methods: { //症状列表
setLastValue() { this.symptomList = [
if (this.getLocalStorge("symptom")) { { id: 1, element: "يۇتقۇنچاق ئاغرىش", sort: 1 },
this.symptom = this.getLocalStorge("symptom").split(","); { id: 2, element: "بۇرنى پۈتۈپ قىلىش", sort: 2 },
} { id: 3, element: "قىزىتماق", sort: 3 },
let arr = [ { id: 5, element: "يۆتەل", sort: 5 },
"patientName", //患者姓名 { id: 6, element: "بەلغەم يۆتەل", sort: 6 },
"nationality", //国籍 { id: 7, element: "بېشى قايماق", sort: 7 },
"passportId", //护照号 { id: 8, element: "باش ئاغرىقى", sort: 8 },
"HasSymptom",//是否有症状 { id: 9, element: "مۇسكۇل ئاغرىش", sort: 9 },
"otherSymptom",//其他症状 { id: 10, element: "ماغدۇرسىزلىق", sort: 10 },
"otherOccupation",//其他职业 { id: 11, element: "نەپەس قىيىنلىشىش", sort: 11 },
"age", //年龄 { id: 12, element: "بۇرنىدىن سۇ ئېقىش", sort: 12 },
"gender", //性别 ];
"height", //身高 //国籍列表
"weight", //体重 this.nationalityList = [
"maritalStatus", //婚姻状况 "جۇڭگو",
"birthday", //出生日期 "جۇڭگو شياڭگاڭ",
"isConceive", //怀孕状况 "جۇڭگو ئاۋمېن",
"gestationalWeeks", //怀孕周期 "جۇڭگو تەيۋەن",
"occupation", //职业 "چەتئەل",
"contactInformation", //联系方式 ];
"FamilyMembersPhone", //家属联系方式 //医保类型列表
"Registeredresidence", //籍贯 (包括省市) this.typeOfMedicalInsuranceList = [
"province", //籍贯 (省) "شاڭخەي داۋالىنىش سۇغۇرتىسى",
"city", //籍贯 (市) "سىرتتىكى داۋالىنىش سۇغۇرتىسى",
"address", //地址 "ئۆزى چىقىم قىلىش",
"idCard", //身份证号 ];
"typeOfMedicalInsurance", //医保类型 //职业列表
"insurance", //商业保险 this.occupationList = [
"خىزمەتچى",
]; "ئىشچى",
"مەمۇرى خادىم",
arr.map((item) => { "دېھقان",
if (this.getLocalStorge(item)) { "دېھقان",
this[`${item}`] = this.getLocalStorge(item); "ھەربىي سەپتىن چېكىنگەن",
} "باشقا خىزمەت",
}); ];
}, }
getLocalStorge(key) { this.setLastValue();
return window.localStorage.getItem(key); },
}, methods: {
setLastValue() {
if (this.getLocalStorge("symptom")) {
this.symptom = this.getLocalStorge("symptom").split(",");
}
let arr = [
"patientName", //患者姓名
"nationality", //国籍
"passportId", //护照号
"HasSymptom", //是否有症状
"otherSymptom", //其他症状
"otherOccupation", //其他职业
"age", //年龄
"gender", //性别
"height", //身高
"weight", //体重
"maritalStatus", //婚姻状况
"birthday", //出生日期
"isConceive", //怀孕状况
"gestationalWeeks", //怀孕周期
"occupation", //职业
"contactInformation", //联系方式
"FamilyMembersPhone", //家属联系方式
"Registeredresidence", //籍贯 (包括省市)
"province", //籍贯 (省)
"city", //籍贯 (市)
"address", //地址
"idCard", //身份证号
"typeOfMedicalInsurance", //医保类型
"insurance", //商业保险
];
arr.map((item) => {
if (this.getLocalStorge(item)) {
this[`${item}`] = this.getLocalStorge(item);
}
});
},
setLocalStorge(key) { getLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]); return window.localStorage.getItem(key);
}, },
setValue(key, value) {
window.localStorage.setItem(key, value);
},
onConfirm(values) {
console.log(values);
this.Registeredresidence = values
.filter((item) => !!item)
.map((item) => item.name)
.join("/");
this.province = values[0].name; setLocalStorge(key) {
this.city = values[1].name; window.localStorage.setItem(key, this[`${key}`]);
},
setValue(key, value) {
window.localStorage.setItem(key, value);
},
onConfirm(values) {
console.log(values);
this.Registeredresidence = values
.filter((item) => !!item)
.map((item) => item.name)
.join("/");
this.setLocalStorge("Registeredresidence"); this.province = values[0].name;
this.setLocalStorge("province"); this.city = values[1].name;
this.setLocalStorge("city");
this.showArea = false; this.setLocalStorge("Registeredresidence");
}, this.setLocalStorge("province");
this.setLocalStorge("city");
validator(val) { this.showArea = false;
const card15 = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/; },
const card18 = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
return card15.test(val) || card18.test(val);
},
getResource() { validator(val) {
this.setLoading(true); const card15 = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
this.$http.get(`/Research/Resource`, {}).then((data) => { const card18 = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
let arr = data.filter((item) => { return card15.test(val) || card18.test(val);
return item.category == "国籍"; },
});
let arr1 = data.filter((item) => {
return item.category == "医保类型";
});
let arr2 = data.filter((item) => {
return item.category == "职业";
});
this.symptomList = data.filter((item) => {
return item.category == "症状";
});
this.nationalityList = arr.map((item) => {
return item.element;
});
this.typeOfMedicalInsuranceList = arr1.map((item) => {
return item.element;
});
this.occupationList = arr2.map((item) => {
return item.element;
});
this.setLoading(false);
});
},
getdate() { getResource() {
let obj = this.getInfo(this.idCard); this.setLoading(true);
this.$http.get(`/Research/Resource`, {}).then((data) => {
let arr = data.filter((item) => {
return item.category == "国籍";
});
let arr1 = data.filter((item) => {
return item.category == "医保类型";
});
let arr2 = data.filter((item) => {
return item.category == "职业";
});
this.symptomList = data.filter((item) => {
return item.category == "症状";
});
//国籍列表
this.nationalityList = arr.map((item) => {
return item.element;
});
//医保类型列表
this.typeOfMedicalInsuranceList = arr1.map((item) => {
return item.element;
});
//职业列表
this.occupationList = arr2.map((item) => {
return item.element;
});
this.setLoading(false);
});
},
if (this.validator(this.idCard)) { getdate() {
this.age = obj.age; let obj = this.getInfo(this.idCard);
this.birthday = obj.birth;
this.gender = obj.sex == 1 ? "男" : "女";
this.setLocalStorge("idCard"); if (this.validator(this.idCard)) {
this.setLocalStorge("birthday"); this.age = obj.age;
this.setLocalStorge("age"); this.birthday = obj.birth;
this.setLocalStorge("gender"); this.gender = obj.sex == 1 ? "男" : "女";
}
},
//根据身份证号码获取出生年月 年龄 性别 this.setLocalStorge("idCard");
getInfo(idCard) { this.setLocalStorge("birthday");
let sex = null; this.setLocalStorge("age");
let birth = null; this.setLocalStorge("gender");
let myDate = new Date(); }
let month = myDate.getMonth() + 1; },
let day = myDate.getDate();
let age = 0;
if (idCard.length === 18) {
age = myDate.getFullYear() - idCard.substring(6, 10) - 1;
sex = idCard.substring(16, 17);
birth =
idCard.substring(6, 10) +
"-" +
idCard.substring(10, 12) +
"-" +
idCard.substring(12, 14);
if (
idCard.substring(10, 12) < month ||
(idCard.substring(10, 12) === month &&
idCard.substring(12, 14) <= day)
)
age++;
}
if (idCard.length === 15) {
age = myDate.getFullYear() - idCard.substring(6, 8) - 1901;
sex = idCard.substring(13, 14);
birth =
"19" +
idCard.substring(6, 8) +
"-" +
idCard.substring(8, 10) +
"-" +
idCard.substring(10, 12);
if (
idCard.substring(8, 10) < month ||
(idCard.substring(8, 10) === month && idCard.substring(10, 12) <= day)
)
age++;
}
if (sex % 2 === 0) sex = 0; //根据身份证号码获取出生年月 年龄 性别
// 性别代码 1代表男,0代表女,暂时不涉及其他类型性别 getInfo(idCard) {
else sex = 1; let sex = null;
return { let birth = null;
age, let myDate = new Date();
sex, let month = myDate.getMonth() + 1;
birth, let day = myDate.getDate();
}; let age = 0;
},
if (idCard.length === 18) {
age = myDate.getFullYear() - idCard.substring(6, 10) - 1;
sex = idCard.substring(16, 17);
birth =
idCard.substring(6, 10) +
"-" +
idCard.substring(10, 12) +
"-" +
idCard.substring(12, 14);
if (
idCard.substring(10, 12) < month ||
(idCard.substring(10, 12) === month &&
idCard.substring(12, 14) <= day)
)
age++;
}
if (idCard.length === 15) {
age = myDate.getFullYear() - idCard.substring(6, 8) - 1901;
sex = idCard.substring(13, 14);
birth =
"19" +
idCard.substring(6, 8) +
"-" +
idCard.substring(8, 10) +
"-" +
idCard.substring(10, 12);
if (
idCard.substring(8, 10) < month ||
(idCard.substring(8, 10) === month && idCard.substring(10, 12) <= day)
)
age++;
}
if (sex % 2 === 0) sex = 0;
// 性别代码 1代表男,0代表女,暂时不涉及其他类型性别
else sex = 1;
return {
age,
sex,
birth,
};
},
onbirthday(date) { onbirthday(date) {
this.birthday = formatDate(date, "yyyy-MM-dd "); this.birthday = formatDate(date, "yyyy-MM-dd ");
console.log( console.log(
"🚀 ~ file: page4.vue ~ line 630 ~ onbirthday ~ this.birthday", "🚀 ~ file: page4.vue ~ line 630 ~ onbirthday ~ this.birthday",
this.birthday this.birthday
); );
this.setLocalStorge("birthday"); this.setLocalStorge("birthday");
// this.getdate(); // this.getdate();
this.age = this.ages(formatDate(date, "yyyy-MM-dd ")); this.age = this.ages(formatDate(date, "yyyy-MM-dd "));
this.showbirthday = false; this.showbirthday = false;
}, },
ages(birth) { ages(birth) {
birth = birth.replace(/-/g, "/"); //把格式中的"-"替换为"/" birth = birth.replace(/-/g, "/"); //把格式中的"-"替换为"/"
birth = new Date(birth); //替换后转为Date类型 birth = new Date(birth); //替换后转为Date类型
var now = new Date(); //获取当前日期 var now = new Date(); //获取当前日期
var nowYear = now.getFullYear(); //当前日期的年份 var nowYear = now.getFullYear(); //当前日期的年份
var nowMonth = now.getMonth(); var nowMonth = now.getMonth();
var nowDay = now.getDay(); var nowDay = now.getDay();
var birthYear = birth.getFullYear(); var birthYear = birth.getFullYear();
var birthMonth = birth.getMonth(); var birthMonth = birth.getMonth();
var birthDay = birth.getDay(); //出生日期的日数 var birthDay = birth.getDay(); //出生日期的日数
var age; var age;
if (birth > now) { if (birth > now) {
return false; return false;
} else if ( } else if (
nowYear == birthYear || nowYear == birthYear ||
(nowYear > birthYear && nowMonth >= birthMonth && nowDay >= birthDay) (nowYear > birthYear && nowMonth >= birthMonth && nowDay >= birthDay)
) { ) {
age = nowYear - birthYear; age = nowYear - birthYear;
} else { } else {
age = nowYear - birthYear - 1; //简而言之,没过生日岁数不能+1 age = nowYear - birthYear - 1; //简而言之,没过生日岁数不能+1
} }
return age; return age;
}, },
formatter(type, val) { formatter(type, val) {
if (type === "year") { if (type === "year") {
return `${val}年`; return `${val}年`;
} }
if (type === "month") { if (type === "month") {
return `${val}月`; return `${val}月`;
} else if (type === "day") { } else if (type === "day") {
return `${val}日`; return `${val}日`;
} else if (type === "hour") { } else if (type === "hour") {
return `${val}时`; return `${val}时`;
} else if (type === "minute") { } else if (type === "minute") {
return `${val}分`; return `${val}分`;
} }
return val; return val;
},
}, },
computed: {}, },
computed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page4 { .page4 {
.symptom { .symptom {
.van-checkbox--horizontal { .van-checkbox--horizontal {
margin-right: 0.32rem; margin-right: 0.32rem;
min-width: 35%; min-width: 35%;
margin-bottom: 5%; margin-bottom: 5%;
}
} }
}
} }
</style> </style>
...@@ -2,169 +2,342 @@ ...@@ -2,169 +2,342 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: wsq * @LastEditors: wsq
* @LastEditTime: 2022-11-03 16:43:33 * @LastEditTime: 2022-11-04 15:59:06
* @Description: * @Description:
--> -->
<template> <template>
<div class="page5"> <div class="page5">
<van-field colon clearable name="HasOnlineClass" label-width="130px" :label="$t('HasOnlineClass')"> <van-field
<template #input> colon
<van-radio-group @change="setLocalStorge('HasOnlineClass')" v-model="HasOnlineClass" clearable
direction="horizontal"> name="HasOnlineClass"
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> label-width="130px"
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> :label="$t('HasOnlineClass')"
</van-radio-group> >
</template> <template #input>
</van-field> <van-radio-group
<van-field colon clearable name="purpose" :label="$t('purpose')" readonly :value="purpose" label-width="130px" @change="setLocalStorge('HasOnlineClass')"
@click="showPurpose = true"> v-model="HasOnlineClass"
</van-field> direction="horizontal"
<van-popup v-model="showPurpose" position="bottom"> >
<van-picker :title="$t('HasOnlineClass')" show-toolbar :columns="purposeList" @confirm="onpurpose" /> <van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
</van-popup> <van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
</van-radio-group>
<van-field colon clearable name="workOrNotCovid" :label="$t('workOrNotCovid')" style="margin-left: 40px;"> </template>
<template #input> </van-field>
<van-radio-group @change="setLocalStorge('workOrNotCovid')" v-model="workOrNotCovid" <van-field
direction="horizontal"> colon
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> clearable
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> name="purpose"
</van-radio-group> :label="$t('purpose')"
</template> readonly
</van-field> :value="purpose"
label-width="130px"
@click="showPurpose = true"
>
</van-field>
<van-field colon clearable name="thirtyDays" :label="$t('thirtyDays')" label-width="130px" <van-popup v-model="showPurpose" position="bottom">
:rules="[{ required: true, message: `请选择${$t('thirtyDays')}`}]"> <van-picker
<template #input> :title="$t('HasOnlineClass')"
<van-radio-group @change=" show-toolbar
setLocalStorge('thirtyDays') :columns="purposeList"
" v-model="thirtyDays" direction="horizontal"> @confirm="onpurpose"
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> />
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> </van-popup>
</van-radio-group>
</template> <van-field
</van-field> colon
clearable
name="workOrNotCovid"
<van-field v-if="thirtyDays == $t('yes')" colon clearable v-model="LeaveShangHai" name="LeaveShangHai" :label="$t('LeaveShangHai')" :label="$t('workOrNotCovid')"
label-width="130px" :placeholder="$t('LeaveShangHai')" type="digit" @blur="setLocalStorge('LeaveShangHai')" :rules="[ style="margin-left: 40px;"
{ >
required: thirtyDays == $t('yes') ? true : false, <template #input>
message: `请填写${$t('LeaveShangHai')}`, <van-radio-group
}, @change="setLocalStorge('workOrNotCovid')"
{ validator, message: `${$t('More30days')}` },//天数不能大于三十天 v-model="workOrNotCovid"
]"> direction="horizontal"
<template #extra v-if="thirtyDays == $t('yes')">{{$t('Day')}}</template> >
</van-field> <van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
<van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
<van-field colon clearable readonly clickable name="normalDate" :value="normalDate" label-width="130px" </van-radio-group>
:label="$t('normalDate')" :placeholder="`点击选择${$t('normalDate')}`" @click="showNormalDate = true" </template>
:rules="[{ required: true, message: `请选择${$t('normalDate')}` }]" /> </van-field>
<van-popup v-model="showNormalDate" position="bottom"> <van-field
<van-datetime-picker type="date" v-model="normalDate1" :min-date="minNormalDate" :max-date="maxDate" colon
@confirm="onNormalDate" @cancel="showNormalDate = false" :formatter="formatter" /> clearable
</van-popup> name="thirtyDays"
:label="$t('thirtyDays')"
<van-field colon clearable readonly clickable name="unusualDate" :value="unusualDate" :label="$t('unusualDate')" label-width="130px"
label-width="130px" :placeholder="`点击选择${$t('unusualDate')}`" @click="showUnusualDate = true" :rules="[{ required: true, message: `请选择${$t('thirtyDays')}` }]"
:rules="[{ required: true, message: `请选择${$t('unusualDate')}` }]" /> >
<template #input>
<van-popup v-model="showUnusualDate" position="bottom"> <van-radio-group
<van-datetime-picker type="date" v-model="unusualDate1" :min-date="minUnusualDate" :max-date="maxDate" @change="setLocalStorge('thirtyDays')"
@confirm="onUnusualDate" @cancel="showUnusualDate = false" :formatter="formatter" /> v-model="thirtyDays"
</van-popup> direction="horizontal"
<van-field colon clearable readonly clickable label-width="130px" name="inHospitalDate" :value="inHospitalDate" >
:label="$t('inHospitalDate')" :placeholder="`点击选择${$t('inHospitalDate')}`" @click="showInHospitalDate = true" <van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
:rules="[{ required: true, message: `请选择${$t('inHospitalDate')}` }]" /> <van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
</van-radio-group>
<van-popup v-model="showInHospitalDate" position="bottom"> </template>
<van-datetime-picker type="date" v-model="inHospitalDate1" :min-date="minInHospitalDate" :max-date="maxDate" </van-field>
@confirm="onInHospitalDate" @cancel="showInHospitalDate = false" :formatter="formatter" />
</van-popup> <van-field
v-if="thirtyDays == $t('yes')"
<van-field colon clearable autosize label-width="130px" type="textarea" v-model="beforeIsolationPoint" colon
name="beforeIsolationPoint" :label="$t('beforeIsolationPoint')" :placeholder="`请填写${$t('beforeIsolationPoint')}`" clearable
@blur="setLocalStorge('beforeIsolationPoint')" :rules="[{ required: true, message: `请填写${$t('beforeIsolationPoint')}` }]"> v-model="LeaveShangHai"
</van-field> name="LeaveShangHai"
:label="$t('LeaveShangHai')"
label-width="130px"
<van-field v-if="hasCOVIDVaccine == $t('yes') || hasCOVIDVaccine == $t('no')" colon clearable name="hasCOVIDVaccine" :placeholder="$t('LeaveShangHai')"
label-width="130px" :label="$t('hasCOVIDVaccine')" > type="digit"
<template #input> @blur="setLocalStorge('LeaveShangHai')"
<van-radio-group @change=" :rules="[
() => { {
setLocalStorge('hasCOVIDVaccine'); required: thirtyDays == $t('yes') ? true : false,
message: `请填写${$t('LeaveShangHai')}`,
if (hasCOVIDVaccine == $t('no')) { },
covidVaccine = ''; { validator, message: `${$t('More30days')}` }, //天数不能大于三十天
vaccineType = []; ]"
othervaccines = ''; >
setValue('covidVaccine', ''); <template #extra v-if="thirtyDays == $t('yes')">{{ $t("Day") }}</template>
setValue('vaccineType', ''); </van-field>
setValue('othervaccines', '');
} <van-field
} colon
" v-model="hasCOVIDVaccine" direction="horizontal"> clearable
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> readonly
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> clickable
</van-radio-group> name="normalDate"
</template> :value="normalDate"
</van-field> label-width="130px"
:label="$t('normalDate')"
<van-field v-if="hasCOVIDVaccine == $t('yes')" colon clearable v-model="covidVaccine" name="covidVaccine" :label="$t('covidVaccine')" :placeholder="`点击选择${$t('normalDate')}`"
:placeholder="$t('covidVaccine')" label-width="130px" type="number" @blur="setLocalStorge('covidVaccine')" @click="showNormalDate = true"
:rules="[{ required: true, message: `请填写${$t('covidVaccine')}` }]"> :rules="[{ required: true, message: `请选择${$t('normalDate')}` }]"
<template #extra v-if="hasCOVIDVaccine == $t('yes')">{{$t('needle')}}</template> />
</van-field>
<van-popup v-model="showNormalDate" position="bottom">
<van-field v-if="hasCOVIDVaccine == $t('yes')" colon clearable label-width="130px" name="vaccineType" :label="$t('vaccineType')" <van-datetime-picker
:rules="[ type="date"
{ v-model="normalDate1"
required: hasCOVIDVaccine == $t('yes') ? true : false, :min-date="minNormalDate"
message: `请选择${$t('vaccineType')}`, :max-date="maxDate"
}, @confirm="onNormalDate"
]"> @cancel="showNormalDate = false"
<template #input> :formatter="formatter"
<van-checkbox-group v-model="vaccineType" direction="horizontal" class="vaccineType" @change=" />
() => { </van-popup>
setLocalStorge('vaccineType');
} <van-field
"> colon
<template v-for="(item, index) in vaccineTypeList"> clearable
<van-checkbox :key="index" :name="item.element" shape="square">{{ readonly
item.element clickable
}}</van-checkbox> name="unusualDate"
</template> :value="unusualDate"
</van-checkbox-group> :label="$t('unusualDate')"
</template> label-width="130px"
</van-field> :placeholder="`点击选择${$t('unusualDate')}`"
@click="showUnusualDate = true"
<van-field colon v-if="vaccineType.includes($t('other'))" clearable autosize type="textarea" label-width="130px" :rules="[{ required: true, message: `请选择${$t('unusualDate')}` }]"
v-model="othervaccines" name="othervaccines" :label="$t('othervaccines')" :placeholder="$t('othervaccines')" :rules="[ />
{
required: vaccineType.includes($t('other')) ? true : false, <van-popup v-model="showUnusualDate" position="bottom">
message: `请填写${$t('othervaccines')}`, <van-datetime-picker
}, type="date"
]" @blur="setLocalStorge('othervaccines')"></van-field> v-model="unusualDate1"
:min-date="minUnusualDate"
<van-field v-if="hasCOVIDVaccine == $t('yes')" colon clearable readonly clickable name="vaccineDate" :max-date="maxDate"
:value="vaccineDate" :label="$t('vaccineDate')" label-width="130px" :placeholder="`点击选择${$t('vaccineDate')}`" @confirm="onUnusualDate"
@click="showVaccineDate = true" :rules="[ @cancel="showUnusualDate = false"
{ :formatter="formatter"
required: covidVaccine > 0 ? true : false, />
message: `请选择${$t('vaccineDate')}`, </van-popup>
}, <van-field
]" /> colon
clearable
<van-popup v-model="showVaccineDate" position="bottom"> readonly
<van-datetime-picker type="date" v-model="vaccineDate1" :min-date="minVaccineDate" :max-date="maxDate" clickable
@confirm="onVaccineDate" @cancel="showVaccineDate = false" :formatter="formatter" /> label-width="130px"
</van-popup> name="inHospitalDate"
</div> :value="inHospitalDate"
:label="$t('inHospitalDate')"
:placeholder="`点击选择${$t('inHospitalDate')}`"
@click="showInHospitalDate = true"
:rules="[{ required: true, message: `请选择${$t('inHospitalDate')}` }]"
/>
<van-popup v-model="showInHospitalDate" position="bottom">
<van-datetime-picker
type="date"
v-model="inHospitalDate1"
:min-date="minInHospitalDate"
:max-date="maxDate"
@confirm="onInHospitalDate"
@cancel="showInHospitalDate = false"
:formatter="formatter"
/>
</van-popup>
<van-field
colon
clearable
autosize
label-width="130px"
type="textarea"
v-model="beforeIsolationPoint"
name="beforeIsolationPoint"
:label="$t('beforeIsolationPoint')"
:placeholder="`请填写${$t('beforeIsolationPoint')}`"
@blur="setLocalStorge('beforeIsolationPoint')"
:rules="[
{ required: true, message: `请填写${$t('beforeIsolationPoint')}` },
]"
>
</van-field>
<van-field
v-if="hasCOVIDVaccine == $t('yes') || hasCOVIDVaccine == $t('no')"
colon
clearable
name="hasCOVIDVaccine"
label-width="130px"
:label="$t('hasCOVIDVaccine')"
>
<template #input>
<van-radio-group
@change="
() => {
setLocalStorge('hasCOVIDVaccine');
if (hasCOVIDVaccine == $t('no')) {
covidVaccine = '';
vaccineType = [];
othervaccines = '';
setValue('covidVaccine', '');
setValue('vaccineType', '');
setValue('othervaccines', '');
}
}
"
v-model="hasCOVIDVaccine"
direction="horizontal"
>
<van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
<van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="hasCOVIDVaccine == $t('yes')"
colon
clearable
v-model="covidVaccine"
name="covidVaccine"
:label="$t('covidVaccine')"
:placeholder="$t('covidVaccine')"
label-width="130px"
type="number"
@blur="setLocalStorge('covidVaccine')"
:rules="[{ required: true, message: `请填写${$t('covidVaccine')}` }]"
>
<template #extra v-if="hasCOVIDVaccine == $t('yes')">{{
$t("needle")
}}</template>
</van-field>
<van-field
v-if="hasCOVIDVaccine == $t('yes')"
colon
clearable
label-width="130px"
name="vaccineType"
:label="$t('vaccineType')"
:rules="[
{
required: hasCOVIDVaccine == $t('yes') ? true : false,
message: `请选择${$t('vaccineType')}`,
},
]"
>
<template #input>
<van-checkbox-group
v-model="vaccineType"
direction="horizontal"
class="vaccineType"
@change="
() => {
setLocalStorge('vaccineType');
}
"
>
<template v-for="(item, index) in vaccineTypeList">
<van-checkbox :key="index" :name="item.element" shape="square">{{
item.element
}}</van-checkbox>
</template>
</van-checkbox-group>
</template>
</van-field>
<van-field
colon
v-if="vaccineType.includes($t('other'))"
clearable
autosize
type="textarea"
label-width="130px"
v-model="othervaccines"
name="othervaccines"
:label="$t('othervaccines')"
:placeholder="$t('othervaccines')"
:rules="[
{
required: vaccineType.includes($t('other')) ? true : false,
message: `请填写${$t('othervaccines')}`,
},
]"
@blur="setLocalStorge('othervaccines')"
></van-field>
<van-field
v-if="hasCOVIDVaccine == $t('yes')"
colon
clearable
readonly
clickable
name="vaccineDate"
:value="vaccineDate"
:label="$t('vaccineDate')"
label-width="130px"
:placeholder="`点击选择${$t('vaccineDate')}`"
@click="showVaccineDate = true"
:rules="[
{
required: covidVaccine > 0 ? true : false,
message: `请选择${$t('vaccineDate')}`,
},
]"
/>
<van-popup v-model="showVaccineDate" position="bottom">
<van-datetime-picker
type="date"
v-model="vaccineDate1"
:min-date="minVaccineDate"
:max-date="maxDate"
@confirm="onVaccineDate"
@cancel="showVaccineDate = false"
:formatter="formatter"
/>
</van-popup>
</div>
</template> </template>
<script> <script>
...@@ -172,190 +345,211 @@ import { mapState, mapMutations } from "vuex"; ...@@ -172,190 +345,211 @@ import { mapState, mapMutations } from "vuex";
import { formatDate } from "../utils/common.js"; import { formatDate } from "../utils/common.js";
export default { export default {
inject: ["setLoading"], inject: ["setLoading"],
name: "page5", name: "page5",
data() { data() {
return { return {
workOrNotCovid: "否",//是否需要接触新冠 workOrNotCovid: this.$i18n.locale == "zh" ? "否" : "ياق", //是否需要接触新冠 --- 默认值 否
HasOnlineClass: "否", //是否上网课 HasOnlineClass: this.$i18n.locale == "zh" ? "否" : "ياق", //是否上网课--- 默认值 否
purpose: "学习", // 来沪目的 purpose: this.$i18n.locale == "zh" ? "学习" : "ئوقۇش سەۋەپ بىلەن", // 来沪目的--- 默认值 学习
thirtyDays: "是", //近三十天内无离开上海 thirtyDays: this.$i18n.locale == "zh" ? "是" : "بار", //近三十天内无离开上海--- 默认值 是
LeaveShangHai: "", //回上海天数 LeaveShangHai: "", //回上海天数
unusualDate: "", //核酸检测异常时间 unusualDate: "", //核酸检测异常时间
normalDate: "", //未发生异常时间 normalDate: "", //未发生异常时间
beforeIsolationPoint: "", //之前隔离点 beforeIsolationPoint: "", //之前隔离点
inHospitalDate: "", //120转运时间 inHospitalDate: "", //120转运时间
// HasSymptom: "否", //有无症状 // HasSymptom: "否", //有无症状--- 默认值 否
// symptom: [], //患者症状 // symptom: [], //患者症状
// otherSymptom: "", //其他症状 // otherSymptom: "", //其他症状
//symptomList: [], //symptomList: [],
hasCOVIDVaccine: "是", hasCOVIDVaccine: this.$i18n.locale == "zh" ? "是" : "بار", //--- 默认值 是
covidVaccine: "", //接种针数 covidVaccine: "", //接种针数
vaccineType: [], //疫苗公司 vaccineType: [], //疫苗公司
othervaccines: "", //其他疫苗 othervaccines: "", //其他疫苗
vaccineDate: "", //最后一次接种日期 vaccineDate: "", //最后一次接种日期
vaccineTypeList: [], vaccineTypeList: [],
showNormalDate: false, //未发生异常时间弹窗
showNormalDate: false, //未发生异常时间弹窗 showUnusualDate: false, //核酸时间弹窗
showUnusualDate: false, //核酸时间弹窗 showInHospitalDate: false, //120时间弹窗
showInHospitalDate: false, //120时间弹窗 showVaccineDate: false, //120时间弹窗
showVaccineDate: false, //120时间弹窗 purposeList:
purposeList: ["学习", "工作", "旅游", "商务", "其他"], this.$i18n.locale == "zh"
minNormalDate: new Date(2021, 0, 1), ? ["学习", "工作", "旅游", "商务", "其他"]
minUnusualDate: new Date(2021, 0, 1), : [
minInHospitalDate: new Date(2021, 0, 1), "ئوقۇش سەۋەپ بىلەن",
minVaccineDate: new Date(2020, 0, 1), "خىزمەت سەۋەپ بىلەن",
maxDate: new Date(), "ساياھەت قىلىش ئۈچۈن",
"سودا ئۈچۈن",
showPurpose: false, "باشقا سەۋەپ",
],
/**时间弹窗默认时间 */ minNormalDate: new Date(2021, 0, 1),
unusualDate1: new Date(), //核酸检测异常时间 minUnusualDate: new Date(2021, 0, 1),
normalDate1: new Date(), //未发生异常时间 minInHospitalDate: new Date(2021, 0, 1),
inHospitalDate1: new Date(), //120转运时间 minVaccineDate: new Date(2020, 0, 1),
vaccineDate1: new Date(), //最后一次接种日期 maxDate: new Date(),
};
}, showPurpose: false,
mounted() {
this.getResource(); /**时间弹窗默认时间 */
this.setDefDate(); unusualDate1: new Date(), //核酸检测异常时间
normalDate1: new Date(), //未发生异常时间
this.setLastValue(); inHospitalDate1: new Date(), //120转运时间
}, vaccineDate1: new Date(), //最后一次接种日期
methods: { };
setLastValue() { },
if (this.getLocalStorge("symptom")) { mounted() {
this.symptom = this.getLocalStorge("symptom").split(","); if (this.$i18n.locale == "zh") {
} this.getResource();
} else {
let arr = [ this.vaccineTypeList = [
"HasOnlineClass", //是否上网课 { id: 13, element: "چاڭچۈن شىڭ ئوۇ", sort: 1 },
"purpose", // 来沪目的 { id: 14, element: "بېيجىڭ شىڭ ئوۇ", sort: 2 },
"thirtyDays", //近三十天内无离开上海 { id: 82, element: "ئۇخەن شىڭ ئوۇ", sort: 2.5 },
"LeaveShangHai", //回上海天数 { id: 83, element: "بېيجىڭ كېشىڭ", sort: 2.6 },
"unusualDate", //核酸检测异常时间 { id: 15, element: "نەنجىڭ شىڭوۇ", sort: 3 },
"normalDate", //未发生异常时间 { id: 89, element: "ئەنخۇي جيفىي", sort: 4 },
"inHospitalDate", //120转运时间 { id: 90, element: "كاڭشىنو", sort: 5 },
"otherSymptom", //其他症状 { id: 91, element: "چىڭدۇ شىڭ ئۇ", sort: 6 },
"vaccineType", { id: 92, element: "لەنجۇچ شىڭ ئوۇ", sort: 7 },
"beforeIsolationPoint", //之前隔离点 { id: 27, element: "باشقا سەۋەپ", sort: 99 },
"HasSymptom", //有无症状 ];
"hasCOVIDVaccine",//是否接种过疫苗 }
"covidVaccine", //接种针数
"othervaccines", //其他疫苗
"vaccineDate", //最后一次接种日期
];
for (let i = 0; i < arr.length; i++) {
if (this.getLocalStorge(arr[i])) {
this[`${arr[i]}`] = this.getLocalStorge(arr[i]);
}
}
if (this.getLocalStorge("vaccineType")) {
this.vaccineType = this.getLocalStorge("vaccineType").split(",");
}
},
getLocalStorge(key) { this.setDefDate();
return window.localStorage.getItem(key);
}, this.setLastValue();
},
methods: {
setLastValue() {
if (this.getLocalStorge("symptom")) {
this.symptom = this.getLocalStorge("symptom").split(",");
}
let arr = [
"HasOnlineClass", //是否上网课
"purpose", // 来沪目的
"thirtyDays", //近三十天内无离开上海
"LeaveShangHai", //回上海天数
"unusualDate", //核酸检测异常时间
"normalDate", //未发生异常时间
"inHospitalDate", //120转运时间
"otherSymptom", //其他症状
"vaccineType",
"beforeIsolationPoint", //之前隔离点
"HasSymptom", //有无症状
"hasCOVIDVaccine", //是否接种过疫苗
"covidVaccine", //接种针数
"othervaccines", //其他疫苗
"vaccineDate", //最后一次接种日期
];
for (let i = 0; i < arr.length; i++) {
if (this.getLocalStorge(arr[i])) {
this[`${arr[i]}`] = this.getLocalStorge(arr[i]);
}
}
setLocalStorge(key) { if (this.getLocalStorge("vaccineType")) {
window.localStorage.setItem(key, this[`${key}`]); this.vaccineType = this.getLocalStorge("vaccineType").split(",");
}, }
},
setValue(key, value) { getLocalStorge(key) {
window.localStorage.setItem(key, value); return window.localStorage.getItem(key);
}, },
setDefDate() { setLocalStorge(key) {
// this.unusualDate = formatDate(new Date(), "yyyy-MM-dd"); //核酸检测异常时间 window.localStorage.setItem(key, this[`${key}`]);
// this.normalDate = formatDate(new Date(), "yyyy-MM-dd"); //未发生异常时间 },
// this.inHospitalDate = formatDate(new Date(), "yyyy-MM-dd"); //120转运时间
// this.vaccineDate = formatDate(new Date(), "yyyy-MM-dd"); //最后一次接种日期
},
onpurpose(value, index) { setValue(key, value) {
this.purpose = value; window.localStorage.setItem(key, value);
this.setLocalStorge("purpose"); },
this.showPurpose = false;
},
validator(val) { setDefDate() {
return val < 61 || val == 61; // this.unusualDate = formatDate(new Date(), "yyyy-MM-dd"); //核酸检测异常时间
}, // this.normalDate = formatDate(new Date(), "yyyy-MM-dd"); //未发生异常时间
// this.inHospitalDate = formatDate(new Date(), "yyyy-MM-dd"); //120转运时间
// this.vaccineDate = formatDate(new Date(), "yyyy-MM-dd"); //最后一次接种日期
},
getResource() { onpurpose(value, index) {
this.setLoading(true); this.purpose = value;
this.$http.get(`/Research/Resource`, {}).then((data) => { this.setLocalStorge("purpose");
this.symptomList = data.filter((item) => { this.showPurpose = false;
return item.category == "症状"; },
});
this.vaccineTypeList = data.filter((item) => { validator(val) {
return item.category == "新冠疫苗种类"; return val < 61 || val == 61;
}); },
this.setLoading(false); getResource() {
}); this.setLoading(true);
}, this.$http.get(`/Research/Resource`, {}).then((data) => {
this.symptomList = data.filter((item) => {
return item.category == "症状";
});
this.vaccineTypeList = data.filter((item) => {
return item.category == "新冠疫苗种类";
});
this.setLoading(false);
});
},
formatter(type, val) { formatter(type, val) {
if (type === "year") { if (type === "year") {
return `${val}年`; return `${val}年`;
} }
if (type === "month") { if (type === "month") {
return `${val}月`; return `${val}月`;
} else if (type === "day") { } else if (type === "day") {
return `${val}日`; return `${val}日`;
} else if (type === "hour") { } else if (type === "hour") {
return `${val}时`; return `${val}时`;
} else if (type === "minute") { } else if (type === "minute") {
return `${val}分`; return `${val}分`;
} }
return val; return val;
}, },
onNormalDate(date) { onNormalDate(date) {
this.normalDate = formatDate(date, "yyyy-MM-dd "); this.normalDate = formatDate(date, "yyyy-MM-dd ");
this.setLocalStorge("normalDate"); 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.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.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.setLocalStorge("vaccineDate");
this.showVaccineDate = false; this.showVaccineDate = false;
},
}, },
computed: {}, },
computed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page5 { .page5 {
.vaccineType { .vaccineType {
.van-checkbox { .van-checkbox {
width: 43%; width: 43%;
margin-bottom: 5%; margin-bottom: 5%;
}
} }
}
} }
</style> </style>
...@@ -2,473 +2,717 @@ ...@@ -2,473 +2,717 @@
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2020-11-24 16:18:58 * @Date: 2020-11-24 16:18:58
* @LastEditors: wsq * @LastEditors: wsq
* @LastEditTime: 2022-11-03 15:14:27 * @LastEditTime: 2022-11-04 15:59:15
* @Description: * @Description:
--> -->
<template> <template>
<div class="page6"> <div class="page6">
<van-field colon clearable name="hasHistoryAllergies" label-width="125px" :label="$t('hasHistoryAllergies')"> <van-field
<template #input> colon
<van-radio-group @change=" clearable
() => { name="hasHistoryAllergies"
setLocalStorge('hasHistoryAllergies'); label-width="125px"
if (hasHistoryAllergies == $t('noHave')) { :label="$t('hasHistoryAllergies')"
foodAllergy = ''; >
drugAllergy = ''; <template #input>
otherAllergy = ''; <van-radio-group
setValue('foodAllergy', ''); @change="
setValue('drugAllergy', ''); () => {
setValue('otherAllergy', ''); setLocalStorge('hasHistoryAllergies');
} if (hasHistoryAllergies == $t('noHave')) {
} foodAllergy = '';
" v-model="hasHistoryAllergies" direction="horizontal"> drugAllergy = '';
<van-radio :name="$t('have')">{{ $t('have') }}</van-radio> otherAllergy = '';
<van-radio :name="$t('noHave')">{{ $t('noHave') }}</van-radio> setValue('foodAllergy', '');
</van-radio-group> setValue('drugAllergy', '');
</template> setValue('otherAllergy', '');
</van-field> }
}
"
v-model="hasHistoryAllergies"
<van-field v-show="hasHistoryAllergies == $t('have')" colon clearable label-width="125px" v-model="foodAllergy" direction="horizontal"
name="foodAllergy" :label="$t('foodAllergy')" :placeholder="$t('foodAllergy')" >
@blur="setLocalStorge('foodAllergy')"> <van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
</van-field> <van-radio :name="$t('noHave')">{{ $t("noHave") }}</van-radio>
</van-radio-group>
<!-- 药物过敏原 --> </template>
<van-field v-show="hasHistoryAllergies == $t('have')" colon clearable label-width="125px" v-model="drugAllergy" </van-field>
name="drugAllergy" :label="$t('drugAllergy')" :placeholder="$t('drugAllergy')"
@blur="setLocalStorge('drugAllergy')"> <van-field
</van-field> v-show="hasHistoryAllergies == $t('have')"
<!-- 其他过敏原 --> colon
<van-field v-show="hasHistoryAllergies == $t('have')" colon clearable label-width="125px" v-model="otherAllergy" clearable
name="otherAllergy" :label="$t('otherAllergy')" :placeholder="$t('otherAllergy')" label-width="125px"
@blur="setLocalStorge('otherAllergy')"> v-model="foodAllergy"
</van-field> name="foodAllergy"
:label="$t('foodAllergy')"
<van-field colon clearable name="hasHistorySurgery" label-width="125px" :label="$t('hasHistorySurgery')"> :placeholder="$t('foodAllergy')"
<template #input> @blur="setLocalStorge('foodAllergy')"
<van-radio-group @change=" >
() => { </van-field>
setLocalStorge('hasHistorySurgery');
if (hasHistorySurgery == $t('noHave')) { <!-- 药物过敏原 -->
historySurgery = ''; <van-field
v-show="hasHistoryAllergies == $t('have')"
setValue('historySurgery', ''); colon
} clearable
} label-width="125px"
" v-model="hasHistorySurgery" direction="horizontal"> v-model="drugAllergy"
<van-radio :name="$t('have')">{{ $t('have') }}</van-radio> name="drugAllergy"
<van-radio :name="$t('noHave')">{{ $t('noHave') }}</van-radio> :label="$t('drugAllergy')"
</van-radio-group> :placeholder="$t('drugAllergy')"
</template> @blur="setLocalStorge('drugAllergy')"
</van-field> >
</van-field>
<van-field v-show="hasHistorySurgery == $t('have')" colon clearable label-width="125px" v-model="historySurgery" <!-- 其他过敏原 -->
name="historySurgery" :label="$t('historySurgery')" :placeholder="$t('historySurgery')" <van-field
@blur="setLocalStorge('historySurgery')" :rules="[ v-show="hasHistoryAllergies == $t('have')"
{ colon
required: hasHistorySurgery == $t('have') ? true : false, clearable
message: `请填写${$t('historySurgery')}`, label-width="125px"
}, v-model="otherAllergy"
]"> name="otherAllergy"
</van-field> :label="$t('otherAllergy')"
:placeholder="$t('otherAllergy')"
<van-field colon clearable name="HasPreviousHistory" label-width="125px" :label="$t('HasPreviousHistory')"> @blur="setLocalStorge('otherAllergy')"
<template #input> >
<van-radio-group @change=" </van-field>
() => {
setLocalStorge('HasPreviousHistory'); <van-field
if (HasPreviousHistory == $t('noHave')) { colon
previousHistory = []; clearable
otherPastHistory = ''; name="hasHistorySurgery"
tuberculosisDate = ''; label-width="125px"
setValue('previousHistory', ''); :label="$t('hasHistorySurgery')"
setValue('otherPastHistory', ''); >
setValue('tuberculosisDate', ''); <template #input>
} <van-radio-group
} @change="
" v-model="HasPreviousHistory" direction="horizontal"> () => {
<van-radio :name="$t('have')">{{ $t('have') }}</van-radio> setLocalStorge('hasHistorySurgery');
<van-radio :name="$t('noHave')"></van-radio> if (hasHistorySurgery == $t('noHave')) {
</van-radio-group> historySurgery = '';
</template>
</van-field> setValue('historySurgery', '');
}
<van-field colon clearable name="previousHistory" label-width="125px" :label="$t('previousHistory')" }
v-show="HasPreviousHistory == $t('have')" :rules="[ "
{ v-model="hasHistorySurgery"
required: HasPreviousHistory == $t('have') ? true : false, direction="horizontal"
message: `请选择${$t('previousHistory')}`, >
}, <van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
]"> <van-radio :name="$t('noHave')">{{ $t("noHave") }}</van-radio>
<template #input> </van-radio-group>
<van-checkbox-group @change="setLocalStorge('previousHistory')" v-model="previousHistory"> </template>
<van-cell-group> </van-field>
<van-cell v-for="(item, index) in previousHistoryList" :key="index">
<van-checkbox :name="item.element" shape="square">{{ <van-field
item.element v-show="hasHistorySurgery == $t('have')"
}}</van-checkbox> colon
</van-cell> clearable
</van-cell-group> label-width="125px"
</van-checkbox-group> v-model="historySurgery"
</template> name="historySurgery"
</van-field> :label="$t('historySurgery')"
:placeholder="$t('historySurgery')"
<van-field colon v-show="previousHistory.includes($t('other'))" clearable autosize type="textarea" @blur="setLocalStorge('historySurgery')"
v-model="otherPastHistory" name="otherPastHistory" :label="$t('otherPastHistory')" :rules="[
:placeholder="$t('otherPastHistory')" :rules="[ {
{ required: hasHistorySurgery == $t('have') ? true : false,
required: previousHistory.includes($t('other')) ? true : false, message: `请填写${$t('historySurgery')}`,
message: `请填写${$t('otherPastHistory')}`, },
}, ]"
]" @blur="setLocalStorge('otherPastHistory')"></van-field> >
</van-field>
<van-field colon clearable readonly clickable <van-field
v-if="HasPreviousHistory != $t('noHave') && previousHistory.includes('肺结核')" :rules="[ colon
{ clearable
required: name="HasPreviousHistory"
HasPreviousHistory != $t('noHave') && previousHistory.includes('肺结核') label-width="125px"
? true :label="$t('HasPreviousHistory')"
: false, >
message: `请选择${$t('tuberculosisDate')}`, <template #input>
}, <van-radio-group
]" name="tuberculosisDate" :value="tuberculosisDate" :label="$t('tuberculosisDate')" :placeholder="`点击选择${$t('tuberculosisDate')}`" @change="
@click="showPicker = true" /> () => {
<van-popup v-model="showPicker" position="bottom"> setLocalStorge('HasPreviousHistory');
<van-datetime-picker :min-date="minDate" :max-date="maxDate" type="date" @confirm="onConfirm" if (HasPreviousHistory == $t('noHave')) {
@cancel="showPicker = false" :formatter="formatter" v-model="deathDate2" /> previousHistory = [];
</van-popup> otherPastHistory = '';
tuberculosisDate = '';
setValue('previousHistory', '');
<van-field colon clearable name="whetherSmoking" :label="$t('whetherSmoking')" label-width="125px"> setValue('otherPastHistory', '');
<template #input> setValue('tuberculosisDate', '');
<van-radio-group @change=" }
() => { }
setLocalStorge('whetherSmoking'); "
if (whetherSmoking == $t('no')) { v-model="HasPreviousHistory"
smokingTypes = []; //烟草类型 direction="horizontal"
smokingYears = ''; //吸烟年数 >
smokingCount = ''; //吸烟支数 <van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
whetherNoSmoking = ''; //是否戒烟 <van-radio :name="$t('noHave')"></van-radio>
setValue('smokingTypes', ''); </van-radio-group>
setValue('smokingYears', ''); </template>
setValue('smokingCount', ''); </van-field>
setValue('whetherNoSmoking', '');
} <van-field
} colon
" v-model="whetherSmoking" direction="horizontal"> clearable
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> name="previousHistory"
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> label-width="125px"
</van-radio-group> :label="$t('previousHistory')"
</template> v-show="HasPreviousHistory == $t('have')"
</van-field> :rules="[
<van-field colon clearable label-width="125px" name="smokingTypes" :label="$t('smokingTypes')" v-if="whetherSmoking == '是'"> {
<template #input> required: HasPreviousHistory == $t('have') ? true : false,
<van-checkbox-group @change="setLocalStorge('smokingTypes')" v-model="smokingTypes" message: `请选择${$t('previousHistory')}`,
direction="horizontal" class="smokingTypes"> },
<template v-for="(item, index) in smokingTypesList"> ]"
<van-checkbox :key="index" :name="item.element" shape="square">{{ >
item.element <template #input>
}}</van-checkbox> <van-checkbox-group
</template> @change="setLocalStorge('previousHistory')"
</van-checkbox-group> v-model="previousHistory"
</template> >
</van-field> <van-cell-group>
<van-cell v-for="(item, index) in previousHistoryList" :key="index">
<van-field v-if="whetherSmoking == $t('yes')" colon clearable label-width="125px" v-model="smokingYears" <van-checkbox :name="item.element" shape="square">{{
name="smokingYears" :label="$t('smokingYears')" :placeholder="`${$t('smokingYears')}`" type="digit" @blur="setLocalStorge('smokingYears')" item.element
:rules="[{ required: false, message:`请填写${$t('smokingYears')}`}]"> }}</van-checkbox>
<template #extra> </van-cell>
{{$t('year')}} </van-cell-group>
</template> </van-checkbox-group>
</van-field> </template>
</van-field>
<van-field v-if="whetherSmoking == $t('yes')" label-width="125px" colon clearable v-model="smokingCount"
name="smokingCount" :label="$t('smokingCount')" :placeholder="$t('smokingCount')" type="digit" @blur="setLocalStorge('smokingCount')" <van-field
:rules="[{ required: false, message: `请填写${$t('smokingCount')}` }]"> colon
<template #extra> v-show="previousHistory.includes($t('other'))"
{{$t('branch')}} clearable
</template> autosize
</van-field> type="textarea"
v-model="otherPastHistory"
<van-field colon clearable label-width="125px" name="whetherNoSmoking" :label="$t('whetherNoSmoking')" name="otherPastHistory"
v-if="whetherSmoking == $t('yes')"> :label="$t('otherPastHistory')"
<template #input> :placeholder="$t('otherPastHistory')"
<van-radio-group @change=" :rules="[
() => { {
setLocalStorge('whetherNoSmoking'); required: previousHistory.includes($t('other')) ? true : false,
if (whetherNoSmoking == $t('no')) { message: `请填写${$t('otherPastHistory')}`,
noSmokingYears = ''; //戒烟年数 },
setValue('noSmokingYears', ''); ]"
} @blur="setLocalStorge('otherPastHistory')"
} ></van-field>
" v-model="whetherNoSmoking" direction="horizontal">
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> <van-field
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> colon
</van-radio-group> clearable
</template> readonly
</van-field> clickable
v-if="
<van-field v-if="whetherNoSmoking == $t('yes')" colon label-width="125px" clearable v-model="noSmokingYears" HasPreviousHistory != $t('noHave') && previousHistory.includes('肺结核')
name="noSmokingYears" :label="$t('noSmokingYears')" :placeholder="$t('noSmokingYears')" type="digit" @blur="setLocalStorge('noSmokingYears')" "
:rules="[{ required: false, message: `请填写${$t('noSmokingYears')}` }]"> :rules="[
<template #extra> {
{{$t('year')}} required:
</template> HasPreviousHistory != $t('noHave') &&
</van-field> previousHistory.includes('肺结核')
? true
<van-field colon clearable name="whetherPassivitySmoking" :label="$t('noSmokingYears')" label-width="125px"> : false,
<template #input> message: `请选择${$t('tuberculosisDate')}`,
<van-radio-group @change=" },
() => { ]"
setLocalStorge('whetherPassivitySmoking'); name="tuberculosisDate"
if (whetherPassivitySmoking == $t('no')) { :value="tuberculosisDate"
passivitySmokingYears = ''; //被动吸烟年数 :label="$t('tuberculosisDate')"
setValue('passivitySmokingYears', ''); :placeholder="`点击选择${$t('tuberculosisDate')}`"
} @click="showPicker = true"
} />
" v-model="whetherPassivitySmoking" direction="horizontal"> <van-popup v-model="showPicker" position="bottom">
<van-radio :name="$t('yes')">{{$t('yes')}}</van-radio> <van-datetime-picker
<van-radio :name="$t('no')">{{$t('no')}}</van-radio> :min-date="minDate"
</van-radio-group> :max-date="maxDate"
</template> type="date"
</van-field> @confirm="onConfirm"
@cancel="showPicker = false"
<van-field v-if="whetherPassivitySmoking == $t('yes')" colon label-width="125px" clearable :formatter="formatter"
v-model="passivitySmokingYears" name="passivitySmokingYears" :label="$t('passivitySmokingYears')" :placeholder="$t('passivitySmokingYears')" v-model="deathDate2"
type="digit" @blur="setLocalStorge('passivitySmokingYears')"> />
<template #extra> </van-popup>
{{$t('year')}}
</template> <van-field
</van-field> colon
clearable
name="whetherSmoking"
<van-popup v-model="showPicker" position="bottom"> :label="$t('whetherSmoking')"
<van-datetime-picker :min-date="minDate" :max-date="maxDate" type="date" @confirm="onConfirm" label-width="125px"
@cancel="showPicker = false" :formatter="formatter" /> >
</van-popup> <template #input>
<van-radio-group
<van-field colon clearable name="yesOrNoCt" label-width="125px" :label="$t('yesOrNoCt')"> @change="
<template #input> () => {
<van-radio-group @change=" setLocalStorge('whetherSmoking');
() => { if (whetherSmoking == $t('no')) {
setLocalStorge('yesOrNoCt'); smokingTypes = []; //烟草类型
if (yesOrNoCt == $t('noHave')) { smokingYears = ''; //吸烟年数
ChestCT = $t('noHave'); smokingCount = ''; //吸烟支数
ChestCTDate = ''; whetherNoSmoking = ''; //是否戒烟
setValue('ChestCT', ''); setValue('smokingTypes', '');
setValue('ChestCTDate', ''); setValue('smokingYears', '');
} setValue('smokingCount', '');
} setValue('whetherNoSmoking', '');
" v-model="yesOrNoCt" direction="horizontal"> }
<van-radio :name="$t('have')">{{ $t('have') }}</van-radio> }
<van-radio :name="$t('noHave')">{{ $t('noHave') }}</van-radio> "
</van-radio-group> v-model="whetherSmoking"
</template> direction="horizontal"
</van-field> >
<van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
<van-field v-if="yesOrNoCt == $t('have')" colon clearable name="ChestCT" label-width="125px" <van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
:label="$t('ChestCT')"> </van-radio-group>
<template #input> </template>
<van-radio-group @change=" </van-field>
() => { <van-field
setLocalStorge('ChestCT'); colon
} clearable
" v-model="ChestCT" direction="horizontal"> label-width="125px"
<van-radio :name="$t('have')">{{ $t('have') }}</van-radio> name="smokingTypes"
<van-radio :name="$t('noHave')">{{ $t('noHave') }}</van-radio> :label="$t('smokingTypes')"
</van-radio-group> v-if="whetherSmoking == '是'"
</template> >
</van-field> <template #input>
<van-checkbox-group
<van-field v-if="yesOrNoCt == $t('have')" colon clearable readonly clickable name="ChestCTDate" @change="setLocalStorge('smokingTypes')"
:value="ChestCTDate" :label="$t('ChestCTDate')" label-width="125px" :placeholder="`点击选择${$t('ChestCTDate')}`" v-model="smokingTypes"
@click="showCalendar = true" :rules="[ direction="horizontal"
{ class="smokingTypes"
required: ChestCT == $t('have') ? true : false, >
message: `请选择${$t('ChestCTDate')}`, <template v-for="(item, index) in smokingTypesList">
}, <van-checkbox :key="index" :name="item.element" shape="square">{{
]" /> item.element
<van-popup v-model="showCalendar" position="bottom"> }}</van-checkbox>
<van-datetime-picker type="date" :min-date="minChestCTDate" :max-date="maxDate" @confirm="onChestCT" </template>
@cancel="showCalendar = false" :formatter="formatter" v-model="ChestCTDate1" /> </van-checkbox-group>
</van-popup> </template>
</div> </van-field>
<van-field
v-if="whetherSmoking == $t('yes')"
colon
clearable
label-width="125px"
v-model="smokingYears"
name="smokingYears"
:label="$t('smokingYears')"
:placeholder="`${$t('smokingYears')}`"
type="digit"
@blur="setLocalStorge('smokingYears')"
:rules="[{ required: false, message: `请填写${$t('smokingYears')}` }]"
>
<template #extra>
{{ $t("year") }}
</template>
</van-field>
<van-field
v-if="whetherSmoking == $t('yes')"
label-width="125px"
colon
clearable
v-model="smokingCount"
name="smokingCount"
:label="$t('smokingCount')"
:placeholder="$t('smokingCount')"
type="digit"
@blur="setLocalStorge('smokingCount')"
:rules="[{ required: false, message: `请填写${$t('smokingCount')}` }]"
>
<template #extra>
{{ $t("branch") }}
</template>
</van-field>
<van-field
colon
clearable
label-width="125px"
name="whetherNoSmoking"
:label="$t('whetherNoSmoking')"
v-if="whetherSmoking == $t('yes')"
>
<template #input>
<van-radio-group
@change="
() => {
setLocalStorge('whetherNoSmoking');
if (whetherNoSmoking == $t('no')) {
noSmokingYears = ''; //戒烟年数
setValue('noSmokingYears', '');
}
}
"
v-model="whetherNoSmoking"
direction="horizontal"
>
<van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
<van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="whetherNoSmoking == $t('yes')"
colon
label-width="125px"
clearable
v-model="noSmokingYears"
name="noSmokingYears"
:label="$t('noSmokingYears')"
:placeholder="$t('noSmokingYears')"
type="digit"
@blur="setLocalStorge('noSmokingYears')"
:rules="[{ required: false, message: `请填写${$t('noSmokingYears')}` }]"
>
<template #extra>
{{ $t("year") }}
</template>
</van-field>
<van-field
colon
clearable
name="whetherPassivitySmoking"
:label="$t('noSmokingYears')"
label-width="125px"
>
<template #input>
<van-radio-group
@change="
() => {
setLocalStorge('whetherPassivitySmoking');
if (whetherPassivitySmoking == $t('no')) {
passivitySmokingYears = ''; //被动吸烟年数
setValue('passivitySmokingYears', '');
}
}
"
v-model="whetherPassivitySmoking"
direction="horizontal"
>
<van-radio :name="$t('yes')">{{ $t("yes") }}</van-radio>
<van-radio :name="$t('no')">{{ $t("no") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="whetherPassivitySmoking == $t('yes')"
colon
label-width="125px"
clearable
v-model="passivitySmokingYears"
name="passivitySmokingYears"
:label="$t('passivitySmokingYears')"
:placeholder="$t('passivitySmokingYears')"
type="digit"
@blur="setLocalStorge('passivitySmokingYears')"
>
<template #extra>
{{ $t("year") }}
</template>
</van-field>
<van-popup v-model="showPicker" position="bottom">
<van-datetime-picker
:min-date="minDate"
:max-date="maxDate"
type="date"
@confirm="onConfirm"
@cancel="showPicker = false"
:formatter="formatter"
/>
</van-popup>
<van-field
colon
clearable
name="yesOrNoCt"
label-width="125px"
:label="$t('yesOrNoCt')"
>
<template #input>
<van-radio-group
@change="
() => {
setLocalStorge('yesOrNoCt');
if (yesOrNoCt == $t('noHave')) {
ChestCT = $t('noHave');
ChestCTDate = '';
setValue('ChestCT', '');
setValue('ChestCTDate', '');
}
}
"
v-model="yesOrNoCt"
direction="horizontal"
>
<van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
<van-radio :name="$t('noHave')">{{ $t("noHave") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="yesOrNoCt == $t('have')"
colon
clearable
name="ChestCT"
label-width="125px"
:label="$t('ChestCT')"
>
<template #input>
<van-radio-group
@change="
() => {
setLocalStorge('ChestCT');
}
"
v-model="ChestCT"
direction="horizontal"
>
<van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
<van-radio :name="$t('noHave')">{{ $t("noHave") }}</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="yesOrNoCt == $t('have')"
colon
clearable
readonly
clickable
name="ChestCTDate"
:value="ChestCTDate"
:label="$t('ChestCTDate')"
label-width="125px"
:placeholder="`点击选择${$t('ChestCTDate')}`"
@click="showCalendar = true"
:rules="[
{
required: ChestCT == $t('have') ? true : false,
message: `请选择${$t('ChestCTDate')}`,
},
]"
/>
<van-popup v-model="showCalendar" position="bottom">
<van-datetime-picker
type="date"
:min-date="minChestCTDate"
:max-date="maxDate"
@confirm="onChestCT"
@cancel="showCalendar = false"
:formatter="formatter"
v-model="ChestCTDate1"
/>
</van-popup>
</div>
</template> </template>
<script> <script>
import { mapState, mapMutations } from "vuex"; import { mapState, mapMutations } from "vuex";
import { formatDate } from "../utils/common.js"; import { formatDate } from "../utils/common.js";
export default { export default {
inject: ["setLoading"], inject: ["setLoading"],
name: "page6", name: "page6",
data() { data() {
return { return {
hasHistoryAllergies: "无", //过敏史 hasHistoryAllergies: this.$i18n.locale == "zh" ? "无" : "يوق", //过敏史 ---默认值 无
historyAllergies: "", //过敏原 historyAllergies: "", //过敏原
foodAllergy: "", //食物过敏 foodAllergy: "", //食物过敏
drugAllergy: "", //药物过敏 drugAllergy: "", //药物过敏
otherAllergy: "", //其他过敏 otherAllergy: "", //其他过敏
hasHistorySurgery: "无", //手术史 hasHistorySurgery: this.$i18n.locale == "zh" ? "无" : "يوق", //手术史---默认值 无
historySurgery: "", //具体内容 historySurgery: "", //具体内容
HasPreviousHistory: "无", //有无既往史 HasPreviousHistory: this.$i18n.locale == "zh" ? "无" : "يوق", //有无既往史---默认值 无
previousHistory: [], //既往史 previousHistory: [], //既往史
otherPastHistory: "", //其他既往史 otherPastHistory: "", //其他既往史
tuberculosisDate: "", //既往史发生时间 tuberculosisDate: "", //既往史发生时间
yesOrNoCt: "无", yesOrNoCt: this.$i18n.locale == "zh" ? "无" : "يوق", //---默认值 无
ChestCT: "无", //有无CT ChestCT: this.$i18n.locale == "zh" ? "无" : "يوق", //有无CT ---默认值 无
ChestCTDate: "", //CT拍照时间 ChestCTDate: "", //CT拍照时间
whetherSmoking: "", //是否吸烟 whetherSmoking: "", //是否吸烟
smokingTypes: [], //烟草类型 smokingTypes: [], //烟草类型
smokingYears: "", //吸烟年数 smokingYears: "", //吸烟年数
smokingCount: "", //每天吸烟支数 smokingCount: "", //每天吸烟支数
whetherNoSmoking: "", //是否戒烟 whetherNoSmoking: "", //是否戒烟
noSmokingYears: "", //戒烟年数 noSmokingYears: "", //戒烟年数
whetherPassivitySmoking: "", //是否被动吸烟 whetherPassivitySmoking: "", //是否被动吸烟
passivitySmokingYears: "", //是否被动吸烟年数 passivitySmokingYears: "", //是否被动吸烟年数
smokingTypesList: [], smokingTypesList: [],
previousHistoryList: [], previousHistoryList: [],
showPicker: false, showPicker: false,
showCalendar: false, showCalendar: false,
minChestCTDate: new Date(2020, 0, 1), minChestCTDate: new Date(2020, 0, 1),
minDate: new Date(2010, 0, 1), minDate: new Date(2010, 0, 1),
maxDate: new Date(), maxDate: new Date(),
deathDate2: new Date(), deathDate2: new Date(),
ChestCTDate1: new Date(), ChestCTDate1: new Date(),
tuberculosisDate1: new Date(), tuberculosisDate1: new Date(),
}; };
}, },
mounted() { mounted() {
this.getResource(); if (this.$i18n.locale == "zh") {
this.setChestCTDate(); this.getResource();
} else {
//既往史列表
this.previousHistoryList = [
{ id: 20, element: "ئۆپكە تۇبېركۇليۇزى", sort: 1 },
{ id: 21, element: "ئاستا خارەكتىرلىق ئۆپكە توسۇلۇش", sort: 2 },
{ id: 22, element: "راك كېسىلى", sort: 3 },
{ id: 23, element: " يۈرەك كېسىلى", sort: 4 },
{ id: 24, element: "دىئابىت كېسىلى", sort: 5 },
{ id: 25, element: "قان بېسىم", sort: 6 },
{ id: 28, element: "باشقا سەۋەپ", sort: 7 },
];
//烟草类型
this.smokingTypesList = [
{element:'نورمال تاماكا'},
{element:'شۆ جيا'},
{element:'توكلۇق تاماكا'},
{element:'چىلىم'}
];
}
this.setLastValue(); this.setChestCTDate();
this.setLastValue();
},
methods: {
setLastValue() {
let arr = [
"hasHistoryAllergies", //过敏史
"historyAllergies", //过敏原
"foodAllergy", //食物过敏
"drugAllergy", //药物过敏
"otherAllergy", //其他过敏
"hasHistorySurgery", //手术史
"historySurgery", //具体内容
"HasPreviousHistory", //有无既往史
"previousHistory", //既往史
"otherPastHistory", //其他既往史
"tuberculosisDate", //既往史发生时间
"yesOrNoCt",
"ChestCT", //有无CT
"ChestCTDate", //CT拍照时间
"whetherSmoking", //是否吸烟
"smokingTypes", //烟草类型
"smokingYears", //吸烟年数
"smokingCount", //每天吸烟支数
"whetherNoSmoking", //是否戒烟
"noSmokingYears", //戒烟年数
"whetherPassivitySmoking", //是否被动吸烟
"passivitySmokingYears", //是否被动吸烟年数
];
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.tuberculosisDate = this.getLocalStorge("tuberculosisDate");
this.otherPastHistory = this.getLocalStorge("otherPastHistory");
this.foodAllergy = this.getLocalStorge("foodAllergy");
this.drugAllergy = this.getLocalStorge("drugAllergy");
this.otherAllergy = this.getLocalStorge("otherAllergy");
if (this.getLocalStorge("previousHistory")) {
this.previousHistory = this.getLocalStorge("previousHistory").split(
","
);
}
if (this.smokingTypes.length > 0) {
this.smokingTypes = this.getLocalStorge("smokingTypes").split(",");
}
}, },
methods: {
setLastValue() {
let arr = [
"hasHistoryAllergies", //过敏史
"historyAllergies", //过敏原
"foodAllergy", //食物过敏
"drugAllergy", //药物过敏
"otherAllergy", //其他过敏
"hasHistorySurgery", //手术史
"historySurgery", //具体内容
"HasPreviousHistory", //有无既往史
"previousHistory", //既往史
"otherPastHistory", //其他既往史
"tuberculosisDate", //既往史发生时间
"yesOrNoCt",
"ChestCT", //有无CT
"ChestCTDate", //CT拍照时间
"whetherSmoking", //是否吸烟
"smokingTypes", //烟草类型
"smokingYears", //吸烟年数
"smokingCount", //每天吸烟支数
"whetherNoSmoking", //是否戒烟
"noSmokingYears", //戒烟年数
"whetherPassivitySmoking", //是否被动吸烟
"passivitySmokingYears", //是否被动吸烟年数
];
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.tuberculosisDate = this.getLocalStorge('tuberculosisDate')
this.otherPastHistory = this.getLocalStorge('otherPastHistory')
this.foodAllergy = this.getLocalStorge('foodAllergy')
this.drugAllergy = this.getLocalStorge('drugAllergy')
this.otherAllergy = this.getLocalStorge('otherAllergy')
if (this.getLocalStorge("previousHistory")) {
this.previousHistory = this.getLocalStorge("previousHistory").split(",");
}
if (this.smokingTypes.length > 0) {
this.smokingTypes = this.getLocalStorge("smokingTypes").split(",");
}
},
getLocalStorge(key) { getLocalStorge(key) {
return window.localStorage.getItem(key); return window.localStorage.getItem(key);
}, },
setLocalStorge(key) { setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]); window.localStorage.setItem(key, this[`${key}`]);
}, },
setValue(key, value) { setValue(key, value) {
window.localStorage.setItem(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");
}, },
getResource() { getResource() {
this.setLoading(true); this.setLoading(true);
this.$http.get(`/Research/Resource`, {}).then((data) => { this.$http.get(`/Research/Resource`, {}).then((data) => {
this.previousHistoryList = data.filter((item) => {
return item.category == "既往史"; console.log('data',data);
}); this.previousHistoryList = data.filter((item) => {
this.smokingTypesList = data.filter((item) => { return item.category == "既往史";
return item.category == "烟草类型"; });
}); this.smokingTypesList = data.filter((item) => {
this.setLoading(false); return item.category == "烟草类型";
}); });
}, this.setLoading(false);
onConfirm(date) { });
this.tuberculosisDate = formatDate(date, "yyyy-MM-dd"); },
this.setLocalStorge("tuberculosisDate"); onConfirm(date) {
this.showPicker = false; this.tuberculosisDate = formatDate(date, "yyyy-MM-dd");
}, this.setLocalStorge("tuberculosisDate");
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.setLocalStorge("ChestCTDate");
this.showCalendar = false; this.showCalendar = false;
}, },
formatter(type, val) { formatter(type, val) {
if (type === "year") { if (type === "year") {
return `${val}年`; return `${val}年`;
} }
if (type === "month") { if (type === "month") {
return `${val}月`; return `${val}月`;
} else if (type === "day") { } else if (type === "day") {
return `${val}日`; return `${val}日`;
} else if (type === "hour") { } else if (type === "hour") {
return `${val}时`; return `${val}时`;
} else if (type === "minute") { } else if (type === "minute") {
return `${val}分`; return `${val}分`;
} }
return val; return val;
},
}, },
computed: {}, },
computed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page6 { .page6 {
.smokingTypes { .smokingTypes {
.van-checkbox { .van-checkbox {
width: 43%; width: 43%;
margin-bottom: 5%; margin-bottom: 5%;
}
} }
}
} }
</style> </style>
/* /*
* @Author: ninglupeng * @Author: ninglupeng
* @Date: 2022-10-31 14:22:41 * @Date: 2022-10-31 14:22:41
* @LastEditors: ninglupeng * @LastEditors: wsq
* @LastEditTime: 2022-11-04 10:39:05 * @LastEditTime: 2022-11-04 13:50:40
* @Description: * @Description:
*/ */
module.exports = { module.exports = {
...@@ -65,14 +65,14 @@ module.exports = { ...@@ -65,14 +65,14 @@ module.exports = {
"typeOfMedicalInsurance": "داۋالىنىش سۇغۇرتىسى تىپى", //医保类型 "typeOfMedicalInsurance": "داۋالىنىش سۇغۇرتىسى تىپى", //医保类型
"insurance": "سودا سۇغۇرتىسى", //商业保险 "insurance": "سودا سۇغۇرتىسى", //商业保险
"boy": 'ئەر', "boy": 'ئەر',//男
"girl": 'ئايال', "girl": 'ئايال',//女
"Nonpregnant": 'ھامىلدار ئەمەس', "Nonpregnant": 'ھامىلدار ئەمەس',//未孕
"pregnant": 'ھامىلدار', "pregnant": 'ھامىلدار',//已孕
"unmarried": 'نىكاھلانغانمىغان', "unmarried": 'نىكاھلانغانمىغان',//未婚
"married": 'نىكاھلانغان', "married": 'نىكاھلانغان',//已婚
//第五页 //第五页
"HasOnlineClass": "تور دەرىسى ئوقامدۇ?", // 是否上网课 "HasOnlineClass": "تور دەرىسى ئوقامدۇ?", // 是否上网课
...@@ -131,12 +131,12 @@ module.exports = { ...@@ -131,12 +131,12 @@ module.exports = {
"concludingRemarks": 'سىز بۇ قېتىمقى تولدۇرۇش مەزمۇنىنى تاماملاپ بولدىڭىز، ياردىمىڭىز ۋە قوللىغىنىڭىزغا رەھمەت.',//您已完成本次填写内容 ,感谢您的帮助和支持 "concludingRemarks": 'سىز بۇ قېتىمقى تولدۇرۇش مەزمۇنىنى تاماملاپ بولدىڭىز، ياردىمىڭىز ۋە قوللىغىنىڭىزغا رەھمەت.',//您已完成本次填写内容 ,感谢您的帮助和支持
"goBack": 'ئالدىغا قايتىش',//返回 "goBack": 'ئالدىغا قايتىش',//返回
"yes": 'ھە ئە',//是 "yes": 'بار',//是
"no": "ياق",//否 "no": "ياق",//否
"have": "بار ",//有 "have": "بار",//有
"noHave": "يوق ",//无 "noHave": "يوق",//无
"other": "باشقا سەۋەپ",//其他 "other": "باشقا سەۋەپ",//其他
"week": 'جۇڭگو',//周 "week": 'ھەپتە',//周
"China": 'جۇڭگو',//中国 "China": 'جۇڭگو',//中国
"Previousstep": 'ئالدىنقى قەدەم',//上一步 "Previousstep": 'ئالدىنقى قەدەم',//上一步
"nextstep": 'كېيىنكى قەدەم',//下一步 "nextstep": 'كېيىنكى قەدەم',//下一步
......
...@@ -123,7 +123,7 @@ Vue.prototype.$deepCopy = function (data) { ...@@ -123,7 +123,7 @@ Vue.prototype.$deepCopy = function (data) {
/*---------使用语言包-----------*/ /*---------使用语言包-----------*/
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: 'zh', // 语言标识 locale: 'Uygur', // 语言标识
//this.$i18n.locale // 通过切换locale的值来实现语言切换 //this.$i18n.locale // 通过切换locale的值来实现语言切换
messages: { messages: {
'zh': require('./lang/zh'), // 中文语言包 'zh': require('./lang/zh'), // 中文语言包
......
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