<template>
|
<view class="container">
|
<image class="bg-image" src="/static/images/tabbar/loginbg.png" mode="scaleToFill"></image>
|
<view class="address-list">
|
<u-modal :show="show" @confirm="confirm" ref="uModal" :asyncClose="true" title="解绑" confirmText="确认解绑"
|
confirmColor="#EF0000" cancelColor="#9496A2" showCancelButton="true" @cancel="show = false">
|
<div class="txt">是否确认解绑当前就诊卡?</div>
|
</u-modal>
|
<view class="item" :data-address-id="item.id" v-for="(item, index) in list" :key="index"
|
>
|
<!-- @tap.native.stop.prevent="xiugai($event,
|
{ cusName: item.cusName,
|
cusPhone: item.cusPhone,
|
cusIdcard: item.cusIdcard,
|
cusNational: item.cusNational,
|
cusMarryStatus: item.cusMarryStatus,
|
connect: item.connect,
|
})" -->
|
<!-- <view class="jiuzhdnka" :class="{ 'default': item.mr === '默认', 'not-default': item.mr === '设为默认' }"> -->
|
<view class="jiuzhdnka">
|
<view class="jiuzhdnka_left" @tap.native.stop.prevent="xuanze($event, { cusName: item.cusName,
|
cusPhone: item.cusPhone,
|
cusIdcard: item.cusIdcard,
|
cusNational: item.cusNational,
|
cusMarryStatus: item.cusMarryStatus,
|
connect: item.cusNational,
|
})">
|
<view class="l">
|
<view class="name">{{ item.cusName }}</view>
|
<view class="c">
|
<view class="card">{{ item.cusPhone }}</view>
|
<view class="card">{{ item.cusIdcard }}</view>
|
</view>
|
</view>
|
<!-- <view class="rz">已认证</view> -->
|
<view class="mr" v-show="item.isDefault">默认</view>
|
</view>
|
<view class="qh" @click="jiebang(item)">解绑</view>
|
<!-- <view class="qh" @tap.native.stop.prevent="xuanze($event, { cusName: item.cusName,
|
cusPhone: item.cusPhone,
|
cusIdcard: item.cusIdcard,
|
cusNational: item.cusNational,
|
cusMarryStatus: item.cusMarryStatus,
|
connect: item.cusNational,
|
})">选择</view> -->
|
</view>
|
</view>
|
<view class="last" v-if="list.length > 0">
|
<text>温馨提示</text>:最多可绑定5个就诊人
|
</view>
|
|
|
</view>
|
<view class="empty-view" v-if="list.length <= 0">
|
<view class="image">
|
<img src="./cal.png" mode="scaleToFill"></img>
|
</view>
|
<view class="tjr">暂无体检人哦~</view>
|
<view class="text">当前暂无体检人员,<view style="color:#7BBBFF;" @tap="goxinjian">请添加</view>
|
</view>
|
</view>
|
<button class="add-address" @tap="goxinjian">添加就诊人</button>
|
|
<!-- 底部弹窗 -->
|
<uni-popup class="select_popup" type="bottom" ref="selectPopup">
|
<view class="selectPopup">
|
|
<view class="header">
|
<text class="subtitle">添加体检人</text>
|
</view>
|
|
<view class="form">
|
<!-- 表单项 -->
|
<view class="form-item">
|
<text class="label">姓名</text>
|
<input class="input" placeholder="请输入就诊人姓名" v-model="form.cusName" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">手机号</text>
|
<input class="input" placeholder="请输入手机号" v-model="form.cusPhone" />
|
</view>
|
<view class="form-item">
|
<text class="label">身份证</text>
|
<input class="input" placeholder="请输入身份证" v-model="form.cusIdcard" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">民族</text>
|
<picker @change="NationalTypeChange" mode="selector" :range="NationalOptions"
|
:value="NationalOptions.dictValue" range-key="dictLabel">
|
<!-- <input class="input" :value="inspect.tjPacType" placeholder="请选择体检类型" disabled /> -->
|
<view class="input">{{NationalOptions[index].dictLabel}}</view>
|
</picker>
|
</view>
|
<view class="form-item">
|
<text class="label">婚否</text>
|
<picker @change="marryTypeChange" mode="selector" :range="marryOptions"
|
:value="marryOptions.dictValue" range-key="dictLabel">
|
<!-- <input class="input" :value="inspect.tjPacType" placeholder="请选择体检类型" disabled /> -->
|
<view class="input">{{marryOptions[index1].dictLabel}}</view>
|
</picker>
|
</view>
|
</view>
|
|
<button class="buton" @tap="saveInspect">确定</button>
|
|
</view>
|
</uni-popup>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getListByOpenId,
|
delCustomer,
|
showCustomer,
|
canUpdate
|
} from "@/api/system/inspect";
|
import {
|
getInfoById,
|
} from "@/api/system/history";
|
import {
|
bindPhone,
|
} from "@/api/login";
|
import {
|
getDicts
|
} from "@/api/system/dict/data";
|
import {
|
addNew
|
} from "@/api/system/inspect";
|
import {
|
getInfo
|
} from "@/api/login";
|
import {
|
CLIENT_RENEG_LIMIT
|
} from "tls";
|
export default {
|
data() {
|
return {
|
list: [],
|
tjCustomers: [],
|
marryOptions: [],
|
NationalOptions: [],
|
curuser:{},
|
cusId: "",
|
cusName: "",
|
show:false,
|
id: "",
|
index1: 0,
|
index: 0,
|
form: {
|
cusName: '',
|
cusPhone: '',
|
cusIdcard: '',
|
cusNational: '',
|
cusMarryStatus: '',
|
}
|
}
|
},
|
onShow() {
|
this.getList();
|
},
|
//生命周期方法 —— 页面加载时
|
onLoad(option) {
|
console.log(option)
|
this.id = option.id
|
},
|
methods: {
|
getList() {
|
const openId = uni.getStorageSync('openId');
|
getListByOpenId(openId).then(res => {
|
this.list = res.data;
|
})
|
},
|
xiugai(event, _dataset) {
|
// let tjCustomer = _dataset
|
// showCustomer(tjCustomer).then(res => {
|
// this.tjCustomers = res.data;
|
// })
|
let cusName = _dataset.cusName;
|
let cusPhone = _dataset.cusPhone;
|
let cusIdcard = _dataset.cusIdcard;
|
let cusNational = _dataset.cusNational;
|
let cusMarryStatus = _dataset.cusMarryStatus;
|
let connect = _dataset.connect;
|
let tjCustomer = {
|
cusName: cusName,
|
cusPhone: cusPhone,
|
cusIdcard: cusIdcard,
|
cusNational: cusNational,
|
cusMarryStatus: cusMarryStatus,
|
connect: connect,
|
}
|
canUpdate(tjCustomer).then(res => {
|
if (res.data == 1) {
|
uni.navigateTo({
|
url: `/pagesA/alter/alter?cusName=${cusName}&cusPhone=${cusPhone}&cusIdcard=${cusIdcard}&cusNational=${cusNational}&cusMarryStatus=${cusMarryStatus}&connect=${connect}`,
|
});
|
} else {
|
this.$modal.showToast('该体检人不可修改!');
|
}
|
})
|
|
},
|
goxinjian() {
|
|
// uni.navigateTo({
|
// url: '/pagesA/newbuilt/newbuilt'
|
// });
|
this.$refs.selectPopup.open()
|
getDicts("dict_user_marry").then(response => {
|
this.marryOptions = response.data;
|
});
|
getDicts("dict_user_national").then(response => {
|
this.NationalOptions = response.data;
|
});
|
|
|
},
|
|
|
jiebang(item) {
|
this.curuser = item
|
this.show = true
|
},
|
confirm() {
|
let tjCustomer=this.curuser
|
delCustomer(tjCustomer).then(res => {
|
if (res.code == 200) {
|
this.show = false
|
this.getList()
|
}
|
})
|
},
|
deleteAddress(event, _dataset) {
|
let tjCustomer = _dataset
|
delCustomer(tjCustomer).then(res => {
|
if (res.code == 200) {
|
this.getList();
|
}
|
})
|
},
|
xuanze(event, _dataset) {
|
|
let cusName = _dataset.cusName;
|
let cusIdCard = _dataset.cusIdcard;
|
// getInfoById(cusIdCard).then(res => {
|
// if (res.msg == "0") {
|
// this.$modal.showToast('暂无体检号!');
|
// } else {
|
|
if (this.id == "1") {
|
uni.navigateTo({
|
url: `/pages/history/history?cusName=${cusName}&cusIdCard=${cusIdCard}`
|
})
|
} else if (this.id == "2") {
|
uni.navigateTo({
|
url: `/pages/tjrecord/tjrecord?cusIdCard=${cusIdCard}`
|
})
|
} else {
|
uni.$emit('updateNote', _dataset);
|
uni.navigateBack({
|
delta: 1
|
})
|
}
|
// }
|
// })
|
},
|
NationalTypeChange(e) {
|
this.index = e.detail.value;
|
},
|
marryTypeChange(e) {
|
this.index1 = e.detail.value;
|
},
|
saveInspect() {
|
console.log(1111)
|
let inspect = this.form;
|
if (inspect.cusName == '') {
|
this.$modal.msgError("请输入姓名")
|
return false;
|
}
|
if (inspect.cusPhone == '') {
|
this.$modal.msgError("请输入手机号");
|
return false;
|
}
|
if (inspect.cusIdcard == '') {
|
this.$modal.msgError("请输入身份证号");
|
return false;
|
}
|
|
const openId = uni.getStorageSync('openId');
|
this.form.cusMarryStatus = this.marryOptions[this.index1].dictValue;
|
this.form.cusNational = this.NationalOptions[this.index].dictValue;
|
let tjCustomer = {
|
connect: openId,
|
cusName: inspect.cusName,
|
cusPhone: inspect.cusPhone,
|
cusIdcard: inspect.cusIdcard,
|
cusNational: inspect.cusNational,
|
cusMarryStatus: inspect.cusMarryStatus,
|
idType: 1,
|
}
|
addNew(tjCustomer).then(res => {
|
if (res.code == 200)
|
this.$modal.showToast('添加成功');
|
this.getList();
|
this.$refs.selectPopup.close()
|
})
|
},
|
|
}
|
}
|
</script>
|
|
<style>
|
/* page {
|
height: 100%;
|
width: 100%;
|
background: #f4f4f4;
|
} */
|
.text {
|
font-size: 16px;
|
display: flex;
|
margin-top: 5px;
|
}
|
|
.container {
|
/* height: 100%; */
|
width: 100%;
|
}
|
|
.bg-image {
|
position: absolute;
|
top: 0;
|
left: 0;
|
width: 100vw;
|
height: 100vh;
|
z-index: -1;
|
left: 50%;
|
transform: translateX(-50%);
|
object-fit: cover;
|
}
|
|
.address-list {
|
padding-left: 15rpx;
|
/* background: #fff; */
|
background-size: auto 10.5rpx;
|
margin-bottom: 90rpx;
|
}
|
|
.address-list .item {
|
height: 156.55rpx;
|
align-items: center;
|
display: flex;
|
justify-content: space-around;
|
}
|
|
.address-list .l {
|
/* width: 240rpx; */
|
height: 80rpx;
|
overflow: hidden;
|
display: flex;
|
}
|
|
.address-list .name {
|
/* width: 125rpx; */
|
height: 80rpx;
|
line-height: 80rpx;
|
font-weight: bold;
|
font-size: 36rpx;
|
color: #FBFDFF;
|
margin-bottom: 5.2rpx;
|
text-overflow: ellipsis;
|
white-space: nowrap;
|
overflow: hidden;
|
padding-left: 15rpx;
|
}
|
|
.card{
|
margin-left: 10rpx;
|
font-weight: 500;
|
font-size: 28rpx;
|
color: #FBFDFF;
|
}
|
|
.address-list .default {
|
width: 62.5rpx;
|
height: 33rpx;
|
line-height: 28rpx;
|
text-align: center;
|
font-size: 20rpx;
|
color: #b4282d;
|
border: 1rpx solid #b4282d;
|
visibility: visible;
|
}
|
|
.address-list .c {
|
height: 80rpx;
|
width: 290rpx;
|
flex: 1;
|
height: auto;
|
overflow: hidden;
|
margin-top: 10rpx;
|
margin-left: 15rpx;
|
}
|
|
.image {
|
margin-top: 410rpx;
|
margin-left: 114rpx;
|
}
|
|
.tjr {
|
margin-left: 254rpx;
|
font-size: 32rpx;
|
color: #464F72
|
}
|
|
.address-list .mobile {
|
height: 29rpx;
|
font-size: 29rpx;
|
line-height: 29rpx;
|
overflow: hidden;
|
color: #333;
|
margin-bottom: 6.25rpx;
|
}
|
|
.address-list .address {
|
height: 37rpx;
|
font-size: 25rpx;
|
line-height: 37rpx;
|
overflow: hidden;
|
color: #666;
|
}
|
|
.address-list .r {
|
width: 52rpx;
|
height: auto;
|
overflow: hidden;
|
margin-right: 16.5rpx;
|
}
|
|
.address-list .del {
|
display: block;
|
width: 52rpx;
|
height: 52rpx;
|
}
|
|
.jiuzhdnka {
|
width: 720rpx;
|
height: 124rpx;
|
margin: 10rpx auto;
|
background: linear-gradient(270deg, #79BCFE 0%, #61B0FF 100%);
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
display: flex;
|
justify-content: space-between;
|
}
|
|
.jiuzhdnka_left {
|
display: flex;
|
align-items: center;
|
justify-content: space-around;
|
}
|
|
.last {
|
width: 411rpx;
|
height: 28rpx;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #9496A2;
|
margin-left: 44rpx;
|
margin-top: 30rpx;
|
}
|
|
text {
|
color: #4186FD;
|
}
|
|
.rz {
|
// width: 88rpx;
|
padding: 0 10rpx;
|
height: 28rpx;
|
background: linear-gradient(313deg, #FFAE5D 0%, #FFD341 100%);
|
font-weight: 400;
|
font-size: 22rpx;
|
color: #774605;
|
text-align: center;
|
margin-left: 10rpx;
|
}
|
|
.mr {
|
// width: 88rpx;
|
padding: 0 10rpx;
|
height: 36rpx;
|
background: #FFFFFF;
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
border: 1rpx solid rgba(255, 255, 255, 0.48);
|
font-size: 24rpx;
|
color: #659EFF;
|
text-align: center;
|
font-weight: 400;
|
// margin-top: 8rpx;
|
margin-left: 40rpx;
|
}
|
|
.qh {
|
width: 107rpx;
|
height: 124rpx;
|
background: #419FFD;
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
font-weight: bold;
|
font-size: 28rpx;
|
color: #FBFDFF;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
writing-mode: vertical-rl;
|
text-orientation: upright;
|
line-height: 1.5;
|
}
|
|
.add-address {
|
border: none;
|
right: 0;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
width: 90%;
|
height: 90rpx;
|
line-height: 98rpx;
|
position: absolute;
|
bottom: 2%;
|
left: 0;
|
border-radius: 0;
|
padding: 0;
|
margin: 0;
|
margin-left: 5%;
|
text-align: center;
|
/* padding-left: -5rpx; */
|
font-size: 25rpx;
|
color: #fff;
|
border-top-left-radius: 50rpx;
|
border-bottom-left-radius: 50rpx;
|
border-top-right-radius: 50rpx;
|
border-bottom-right-radius: 50rpx;
|
letter-spacing: 3rpx;
|
background-image: linear-gradient(to right, #419FFD 0%, #419FFD 100%);
|
}
|
|
.empty-view {
|
height: 100%;
|
width: 100%;
|
/* display: flex;
|
flex-direction: column;
|
align-items: center; */
|
/* justify-content: center; */
|
}
|
|
.empty-view .text {
|
width: auto;
|
padding-top: 40rpx;
|
margin-left: 203rpx;
|
font-size: 26rpx;
|
line-height: 35rpx;
|
color: #9496A2;
|
}
|
|
.selectPopup {
|
width: 750rpx;
|
height: 793rpx;
|
background: linear-gradient(180deg, #E9F7FE 0%, #FFFFFF 44%, #FFFFFF 100%);
|
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
}
|
|
.header {
|
padding: 50rpx 285rpx;
|
}
|
|
|
.vue-ref {
|
padding-bottom: 0px !important;
|
}
|
|
.subtitle {
|
width: 160rpx;
|
height: 32rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #65686A;
|
line-height: 36rpx;
|
text-align: right;
|
font-style: normal;
|
text-transform: none;
|
}
|
|
.form {
|
width: 702rpx;
|
padding: 5rpx 53rpx;
|
}
|
|
.form-item {
|
display: flex;
|
margin-bottom: 20rpx;
|
padding: 15rpx;
|
border-radius: 12rpx;
|
}
|
|
.label {
|
width: 120rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #373E58;
|
text-align: left;
|
font-style: normal;
|
text-transform: none;
|
}
|
|
.input {
|
width: 290rpx;
|
/* padding: 0 30rpx; */
|
height: 30rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #9496A2;
|
line-height: 36rpx;
|
text-align: left;
|
font-style: normal;
|
text-transform: none;
|
|
}
|
|
.buton {
|
width: 600rpx;
|
height: 88rpx;
|
background: #419FFD;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
line-height: 88rpx;
|
text-align: center;
|
margin: 0 75rpx;
|
padding-bottom: 50rpx;
|
color: #FFFFFF;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 32rpx;
|
}
|
</style>
|