Commit 0a2f4a0f by nlp97

Merge branch 'feature/语言国际化--dev公卫' of…

Merge branch 'feature/语言国际化--dev公卫' of https://gitlab.suvalue.com/ninglupeng/ShanghaiGongwei into feature/语言国际化--dev公卫

# Conflicts:
#	src/components/page4.vue
#	src/components/page6.vue
parents eef26273 5c75918f
<!--
* @Author: ninglupeng
* @Date: 2020-11-24 16:18:58
* @LastEditors: ninglupeng
* @LastEditTime: 2022-11-04 16:39:07
* @LastEditors: wsq
* @LastEditTime: 2022-11-04 16:26:05
* @Description:
-->
<template>
......@@ -302,7 +302,7 @@ export default {
city: "", //籍贯 (市)
address: "", //地址
idCard: "", //身份证号
typeOfMedicalInsurance: "", //医保类型---默认值
typeOfMedicalInsurance: "", //医保类型---默认值 上海医保
insurance: this.$i18n.locale == "zh" ? "无" : "يوق", //商业保险---默认值 无
HasSymptom: this.$i18n.locale == "zh" ? "否" : "ياق", //有无症状---默认值 否
......@@ -409,198 +409,282 @@ export default {
}
});
},
mounted() {
if (this.$i18n.locale == "zh") {
this.getResource();
} else {
//症状列表
this.symptomList = [
{ id: 1, element: "يۇتقۇنچاق ئاغرىش", sort: 1 },
{ id: 2, element: "بۇرنى پۈتۈپ قىلىش", sort: 2 },
{ id: 3, element: "قىزىتماق", sort: 3 },
{ id: 5, element: "يۆتەل", sort: 5 },
{ id: 6, element: "بەلغەم يۆتەل", sort: 6 },
{ id: 7, element: "بېشى قايماق", sort: 7 },
{ id: 8, element: "باش ئاغرىقى", sort: 8 },
{ id: 9, element: "مۇسكۇل ئاغرىش", sort: 9 },
{ id: 10, element: "ماغدۇرسىزلىق", sort: 10 },
{ id: 11, element: "نەپەس قىيىنلىشىش", sort: 11 },
{ id: 12, element: "بۇرنىدىن سۇ ئېقىش", sort: 12 },
];
//国籍列表
this.nationalityList = [
"جۇڭگو",
"جۇڭگو شياڭگاڭ",
"جۇڭگو ئاۋمېن",
"جۇڭگو تەيۋەن",
"چەتئەل",
];
//医保类型列表
this.typeOfMedicalInsuranceList = [
"شاڭخەي داۋالىنىش سۇغۇرتىسى",
"سىرتتىكى داۋالىنىش سۇغۇرتىسى",
"ئۆزى چىقىم قىلىش",
];
//职业列表
this.occupationList = [
"خىزمەتچى",
"ئىشچى",
"مەمۇرى خادىم",
"دېھقان",
"دېھقان",
"ھەربىي سەپتىن چېكىنگەن",
"باشقا خىزمەت",
];
}
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
setLocalStorge(key) {
window.localStorage.setItem(key, this[`${key}`]);
this.setLastValue();
},
setValue(key, value) {
window.localStorage.setItem(key, value);
},
onConfirm(values) {
console.log(values);
this.Registeredresidence = values
.filter((item) => !!item)
.map((item) => item.name)
.join("/");
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);
}
});
},
this.province = values[0].name;
this.city = values[1].name;
getLocalStorge(key) {
return window.localStorage.getItem(key);
},
this.setLocalStorge("Registeredresidence");
this.setLocalStorge("province");
this.setLocalStorge("city");
setLocalStorge(key) {
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.showArea = false;
},
this.province = values[0].name;
this.city = values[1].name;
validator(val) {
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);
},
this.setLocalStorge("Registeredresidence");
this.setLocalStorge("province");
this.setLocalStorge("city");
getResource() {
this.setLoading(true);
this.$http.get(`/Research/Resource`, {}).then((data) => {
let arr = data.filter((item) => {
return item.category == "国籍";
});
this.showArea = false;
},
let arr1 = data.filter((item) => {
return item.category == "医保类型";
});
validator(val) {
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);
},
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;
getResource() {
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);
});
},
this.setLoading(false);
});
},
getdate() {
let obj = this.getInfo(this.idCard);
getdate() {
let obj = this.getInfo(this.idCard);
if (this.validator(this.idCard)) {
this.age = obj.age;
this.birthday = obj.birth;
this.gender = obj.sex == 1 ? "男" : "女";
if (this.validator(this.idCard)) {
this.age = obj.age;
this.birthday = obj.birth;
this.gender = obj.sex == 1 ? "男" : "女";
this.setLocalStorge("idCard");
this.setLocalStorge("birthday");
this.setLocalStorge("age");
this.setLocalStorge("gender");
}
},
this.setLocalStorge("idCard");
this.setLocalStorge("birthday");
this.setLocalStorge("age");
this.setLocalStorge("gender");
}
},
//根据身份证号码获取出生年月 年龄 性别
getInfo(idCard) {
let sex = null;
let birth = null;
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++;
}
//根据身份证号码获取出生年月 年龄 性别
getInfo(idCard) {
let sex = null;
let birth = null;
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代表女,暂时不涉及其他类型性别
else sex = 1;
return {
age,
sex,
birth,
};
},
if (sex % 2 === 0) sex = 0;
// 性别代码 1代表男,0代表女,暂时不涉及其他类型性别
else sex = 1;
return {
age,
sex,
birth,
};
},
onbirthday(date) {
this.birthday = formatDate(date, "yyyy-MM-dd ");
console.log(
"🚀 ~ file: page4.vue ~ line 630 ~ onbirthday ~ this.birthday",
this.birthday
);
onbirthday(date) {
this.birthday = formatDate(date, "yyyy-MM-dd ");
console.log(
"🚀 ~ file: page4.vue ~ line 630 ~ onbirthday ~ this.birthday",
this.birthday
);
this.setLocalStorge("birthday");
// this.getdate();
this.age = this.ages(formatDate(date, "yyyy-MM-dd "));
this.showbirthday = false;
},
this.setLocalStorge("birthday");
// this.getdate();
this.age = this.ages(formatDate(date, "yyyy-MM-dd "));
this.showbirthday = false;
},
ages(birth) {
birth = birth.replace(/-/g, "/"); //把格式中的"-"替换为"/"
birth = new Date(birth); //替换后转为Date类型
var now = new Date(); //获取当前日期
var nowYear = now.getFullYear(); //当前日期的年份
var nowMonth = now.getMonth();
var nowDay = now.getDay();
var birthYear = birth.getFullYear();
var birthMonth = birth.getMonth();
var birthDay = birth.getDay(); //出生日期的日数
var age;
if (birth > now) {
return false;
} else if (
nowYear == birthYear ||
(nowYear > birthYear && nowMonth >= birthMonth && nowDay >= birthDay)
) {
age = nowYear - birthYear;
} else {
age = nowYear - birthYear - 1; //简而言之,没过生日岁数不能+1
}
return age;
},
ages(birth) {
birth = birth.replace(/-/g, "/"); //把格式中的"-"替换为"/"
birth = new Date(birth); //替换后转为Date类型
var now = new Date(); //获取当前日期
var nowYear = now.getFullYear(); //当前日期的年份
var nowMonth = now.getMonth();
var nowDay = now.getDay();
var birthYear = birth.getFullYear();
var birthMonth = birth.getMonth();
var birthDay = birth.getDay(); //出生日期的日数
var age;
if (birth > now) {
return false;
} else if (
nowYear == birthYear ||
(nowYear > birthYear && nowMonth >= birthMonth && nowDay >= birthDay)
) {
age = nowYear - birthYear;
} else {
age = nowYear - birthYear - 1; //简而言之,没过生日岁数不能+1
}
return age;
},
formatter(type, val) {
if (type === "year") {
return `${val}年`;
}
if (type === "month") {
return `${val}月`;
} else if (type === "day") {
return `${val}日`;
} else if (type === "hour") {
return `${val}时`;
} else if (type === "minute") {
return `${val}分`;
}
return val;
formatter(type, val) {
if (type === "year") {
return `${val}年`;
}
if (type === "month") {
return `${val}月`;
} else if (type === "day") {
return `${val}日`;
} else if (type === "hour") {
return `${val}时`;
} else if (type === "minute") {
return `${val}分`;
}
return val;
},
},
},
computed: {},
};
computed: {},
};
</script>
<style lang="scss" scoped>
......
<!--
* @Author: ninglupeng
* @Date: 2020-11-24 16:18:58
* @LastEditors: wsq
* @LastEditTime: 2022-11-04 15:59:15
* @LastEditors: ninglupeng
* @LastEditTime: 2022-11-04 16:58:20
* @Description:
-->
<template>
......@@ -88,7 +88,7 @@
}
" v-model="HasPreviousHistory" direction="horizontal">
<van-radio :name="$t('have')">{{ $t("have") }}</van-radio>
<van-radio :name="$t('noHave')"></van-radio>
<van-radio :name="$t('noHave')">{{ $t("noHave") }}</van-radio>
</van-radio-group>
</template>
</van-field>
......
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