master
xy 1 year ago
parent 52ccc7db6a
commit 01ef01eb61

@ -3,3 +3,44 @@
* *
*/ */
export function getAgeByIdcard(identityCard) {
let len = (identityCard + "").length;
if (len == 0) {
return 0;
} else {
if ((len != 15) && (len != 18)) //身份证号码只能为15位或18位其它不合法
{
return 0;
}
}
let strBirthday = "";
if (len == 18) //处理18位的身份证号码从号码中得到生日和性别代码
{
strBirthday = identityCard.substr(6, 4) + "/" + identityCard.substr(10, 2) + "/" + identityCard.substr(12, 2);
}
if (len == 15) {
strBirthday = "19" + identityCard.substr(6, 2) + "/" + identityCard.substr(8, 2) + "/" + identityCard.substr(10,
2);
}
//时间字符串里,必须是“/”
let birthDate = new Date(strBirthday);
let nowDateTime = new Date();
let age = nowDateTime.getFullYear() - birthDate.getFullYear();
//再考虑月、天的因素;.getMonth()获取的是从0开始的这里进行比较不需要加1
if (nowDateTime.getMonth() < birthDate.getMonth() || (nowDateTime.getMonth() == birthDate.getMonth() && nowDateTime
.getDate() < birthDate.getDate())) {
age--;
}
return age;
}
export function getSexByIdcard (idCard) {
let sexStr;
if (parseInt(idCard.slice(-2, -1)) % 2 == 1) {
sexStr = '男';
}
else {
sexStr = '女';
}
return sexStr;
}

@ -62,6 +62,33 @@
</view> </view>
</view> </view>
<view class="card" v-if="form.nurse_id && nurse.id">
<view class="desc-card__title">
护工信息
</view>
<view class="desc-card__content">
<view class="desc-card__content--title">
<u-tag :text="workStatus.get(form.status)" mode="dark" />
</view>
<br />
<view class="desc-card__content--title"> 姓名 </view>
<view class="desc-card__content--value">
{{ nurse.name }}
</view>
<br />
<view class="desc-card__content--title"> 联系方式 </view>
<view class="desc-card__content--value"> {{ nurse.mobile }} </view>
<br />
<view class="desc-card__content--title"> 性别 </view>
<view class="desc-card__content--value"> {{ sex(nurse.sex) }} </view>
<br />
</view>
</view>
<u-form <u-form
:model="form" :model="form"
:rules="rules" :rules="rules"
@ -580,6 +607,13 @@ export default {
}, },
data() { data() {
return { return {
workStatus: new Map([
[0, '待处理'],
[1, '已到客户家'],
[2, '已接到客户'],
[3, '已到医院'],
[4, '完成服务']
]),
payBtnStyle: { payBtnStyle: {
"background-image": "background-image":
"linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)", "linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
@ -622,6 +656,7 @@ export default {
list_hospital: [], list_hospital: [],
list_archive: [], list_archive: [],
orderId: "", orderId: "",
nurse: {},
form: { form: {
type: 1, type: 1,
is_show: false, is_show: false,
@ -735,6 +770,7 @@ export default {
this.form['created_at'] = res['created_at'] this.form['created_at'] = res['created_at']
this.form['status'] = res['status'] this.form['status'] = res['status']
this.form['nurse_id'] = res['nurse_id'] this.form['nurse_id'] = res['nurse_id']
this.nurse = res['nurse']
this.fileList = res.files.map(i => ({ this.fileList = res.files.map(i => ({
url: i.url url: i.url
})) }))
@ -938,9 +974,9 @@ export default {
}, },
sex() { sex() {
return function (val) { return function (val) {
if (val === 1) { if (val == 1) {
return "男"; return "男";
} else if (val === 2) { } else if (val == 2) {
return "女"; return "女";
} else { } else {
return "都可以"; return "都可以";
@ -1165,6 +1201,12 @@ export default {
.page { .page {
position: relative; position: relative;
.card {
background: #fff;
margin: 60rpx 25rpx 0;
padding: 36rpx 38rpx;
border-radius: 10rpx;
}
.bkg { .bkg {
width: 100vw; width: 100vw;
z-index: 0; z-index: 0;

Loading…
Cancel
Save