| xqd
@@ -11,6 +11,14 @@
|
|
|
<input v-model="name" placeholder-style="text-align:right" style="text-align: right;" placeholder="请输入姓名"></input>
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
+ <view class="title">出身年月:</view>
|
|
|
+ <picker mode="date" :value="date" :end="time" @change="bindDateChange">
|
|
|
+ <view class="picker">
|
|
|
+ {{date}}
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
+ </view>
|
|
|
+ <view class="cu-form-group" v-if="jsGetAge(date)<18&&date!='请选择出生日期'">
|
|
|
<view class="title">监护人姓名:</view>
|
|
|
<input v-model="jianhuname" placeholder-style="text-align:right" style="text-align: right;" placeholder="请输入监护人姓名"></input>
|
|
|
</view>
|
| xqd
@@ -18,10 +26,10 @@
|
|
|
<view class="title">联系电话:</view>
|
|
|
<input type="number" v-model="phone" placeholder-style="text-align:right" style="text-align: right;" placeholder="请输入联系电话"></input>
|
|
|
</view>
|
|
|
- <view class="cu-form-group">
|
|
|
+ <!-- <view class="cu-form-group">
|
|
|
<view class="title">出生医院:</view>
|
|
|
<input v-model="birthhospital" placeholder-style="text-align:right" style="text-align: right;" placeholder="请输入出生医院"></input>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">地址:</view>
|
|
|
<input v-model="address" placeholder-style="text-align:right" :disabled="true" style="text-align: right;"></input>
|
| xqd
@@ -39,14 +47,6 @@
|
|
|
</u-radio>
|
|
|
</u-radio-group>
|
|
|
</view>
|
|
|
- <view class="cu-form-group">
|
|
|
- <view class="title">出身年月:</view>
|
|
|
- <picker mode="date" :value="date" :end="time" @change="bindDateChange">
|
|
|
- <view class="picker">
|
|
|
- {{date}}
|
|
|
- </view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
<view class="cu-form-group" @click="show=!show">
|
|
|
<view class="title">与就诊人关系:</view>
|
|
|
<picker :value="guanxi" @change="confirm" :range="guanxilist" range-key="label">
|
| xqd
@@ -115,7 +115,7 @@
|
|
|
this.jianhuname = this.info.guardian_name
|
|
|
this.phone = this.info.phone
|
|
|
this.email = this.info.email
|
|
|
- this.birthhospital = this.info.born_hospital
|
|
|
+ // this.birthhospital = this.info.born_hospital
|
|
|
this.address = this.info.address
|
|
|
this.social = this.info.social_card_number
|
|
|
}
|
| xqd
@@ -149,36 +149,28 @@
|
|
|
guanxiindex: -1,
|
|
|
guanxilist: [{
|
|
|
value: '1',
|
|
|
- label: '父亲'
|
|
|
+ label: '父子'
|
|
|
},
|
|
|
{
|
|
|
value: '2',
|
|
|
- label: '母亲'
|
|
|
+ label: '母子'
|
|
|
},
|
|
|
{
|
|
|
value: '3',
|
|
|
- label: '祖父'
|
|
|
+ label: '祖孙'
|
|
|
},
|
|
|
{
|
|
|
value: '4',
|
|
|
- label: '祖母'
|
|
|
+ label: '亲属'
|
|
|
},
|
|
|
{
|
|
|
value: '5',
|
|
|
- label: '外祖父'
|
|
|
+ label: '本人'
|
|
|
},
|
|
|
{
|
|
|
value: '6',
|
|
|
- label: '外祖母'
|
|
|
- },
|
|
|
- {
|
|
|
- value: '7',
|
|
|
- label: '叔侄'
|
|
|
- },
|
|
|
- {
|
|
|
- value: '8',
|
|
|
label: '其他'
|
|
|
- }
|
|
|
+ },
|
|
|
],
|
|
|
idcrad: "",
|
|
|
touxiang: "",
|
| xqd
@@ -188,6 +180,42 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ jsGetAge(strBirthday) {
|
|
|
+ let returnAge;
|
|
|
+ let strBirthdayArr = strBirthday.split("-");
|
|
|
+ let birthYear = strBirthdayArr[0];
|
|
|
+ let birthMonth = strBirthdayArr[1];
|
|
|
+ let birthDay = strBirthdayArr[2];
|
|
|
+ let d = new Date();
|
|
|
+ let nowYear = d.getFullYear();
|
|
|
+ let nowMonth = d.getMonth() + 1;
|
|
|
+ let nowDay = d.getDate();
|
|
|
+ if (nowYear == birthYear) {
|
|
|
+ returnAge = 0; //同年 则为0岁
|
|
|
+ } else {
|
|
|
+ let ageDiff = nowYear - birthYear; //年之差
|
|
|
+ if (ageDiff > 0) {
|
|
|
+ if (nowMonth == birthMonth) {
|
|
|
+ let dayDiff = nowDay - birthDay; //日之差
|
|
|
+ if (dayDiff < 0) {
|
|
|
+ returnAge = ageDiff - 1;
|
|
|
+ } else {
|
|
|
+ returnAge = ageDiff;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let monthDiff = nowMonth - birthMonth; //月之差
|
|
|
+ if (monthDiff < 0) {
|
|
|
+ returnAge = ageDiff - 1;
|
|
|
+ } else {
|
|
|
+ returnAge = ageDiff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return returnAge; //返回周岁年龄
|
|
|
+ },
|
|
|
ChooseImage() {
|
|
|
uni.chooseImage({
|
|
|
count: 1, //默认9
|
| xqd
@@ -261,13 +289,13 @@
|
|
|
// })
|
|
|
// return false
|
|
|
// }
|
|
|
- if (this.birthhospital == "") {
|
|
|
- uni.showToast({
|
|
|
- title: "请填写正确的医院",
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
+ // if (this.birthhospital == "") {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: "请填写正确的医院",
|
|
|
+ // icon: "none"
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
if (this.infoaddress == "") {
|
|
|
uni.showToast({
|
|
|
title: "请填写正确的地址",
|
| xqd
@@ -301,7 +329,7 @@
|
|
|
phone: this.phone,
|
|
|
guardian_name: this.jianhuname,
|
|
|
address: this.address,
|
|
|
- born_hospital: this.birthhospital,
|
|
|
+ // born_hospital: this.birthhospital,
|
|
|
social_card_number: this.social
|
|
|
})
|
|
|
if (res.status == 0) {
|
| xqd
@@ -365,13 +393,13 @@
|
|
|
// })
|
|
|
// return false
|
|
|
// }
|
|
|
- if (this.birthhospital == "") {
|
|
|
- uni.showToast({
|
|
|
- title: "请填写正确的医院",
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
+ // if (this.birthhospital == "") {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: "请填写正确的医院",
|
|
|
+ // icon: "none"
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
if (this.infoaddress == "") {
|
|
|
uni.showToast({
|
|
|
title: "请填写正确的地址",
|
| xqd
@@ -406,7 +434,7 @@
|
|
|
phone: this.phone,
|
|
|
guardian_name: this.jianhuname,
|
|
|
address: this.address,
|
|
|
- born_hospital: this.birthhospital,
|
|
|
+ // born_hospital: this.birthhospital,
|
|
|
social_card_number: this.social
|
|
|
})
|
|
|
if (res.status == 0) {
|