<template>
|
<view class="container">
|
<view class="">
|
<view class="header">
|
<!-- <text class="title">团队预约</text> -->
|
<text class="subtitle">请认真填写体检人信息</text>
|
</view>
|
|
<view class="form">
|
<!-- 表单项 -->
|
<view class="form-item">
|
<text class="label">单位名称</text>
|
<input class="input" placeholder="请输入单位名称" v-model="inspect.cnName" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">联系人</text>
|
<input class="input" placeholder="请输入联系人" v-model="inspect.contactPerson" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">联系电话</text>
|
<input class="input" placeholder="15866211200" v-model="inspect.contactPhone" />
|
<!-- <picker @change="bindNationChange" mode="selector" :range="nations">
|
<input class="input" :value="inspect.contactPhone" placeholder="请选择民族" disabled />
|
</picker> -->
|
</view>
|
|
<view class="form-item">
|
<text class="label">邮箱</text>
|
<input class="input" placeholder="请输入邮箱" v-model="inspect.email" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">税号</text>
|
<input class="input" placeholder="请输入税号" v-model="inspect.taxNumber" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">通讯地址</text>
|
<input class="input" placeholder="请输入通讯地址" v-model="inspect.mailingAddress" />
|
</view>
|
|
<view class="form-item">
|
<text class="label">体检时间</text>
|
<picker mode="date" @change="bindDateChange">
|
<input class="input" :value="inspect.tjTime" placeholder="请选择体检时间" disabled />
|
</picker>
|
<!-- <uni-datetime-picker type="date" :clear-icon="false" v-model="inspect.tjTime" :start="new Date().getTime()" /> -->
|
</view>
|
|
<view class="form-item">
|
<text class="label">体检类型</text>
|
<picker @change="bindTypeChange" mode="selector" :range="checkupTypes"
|
:value="checkupTypes.dictValue" range-key="dictLabel">
|
<!-- <input class="input" :value="inspect.tjPacType" placeholder="请选择体检类型" disabled /> -->
|
<view class="input">{{checkupTypes[index].dictLabel}}</view>
|
</picker>
|
</view>
|
|
<view class="form-item">
|
<text class="label">预约人数</text>
|
<input class="input" placeholder="请输入预约人数" type="number" v-model="inspect.count" />
|
</view>
|
|
<button class="submit-btn" @tap="saveInspect">立即预约</button>
|
</view>
|
</view>
|
<view class="">
|
<uni-popup ref="popup" type="center" >
|
<view class="popup">
|
<div>
|
<img class="text_img" src="../img/bbbb.png" alt="">
|
</div>
|
<view class="box2">
|
<view class="box_name">预约成功!</view>
|
<view class="box_name1">体检顾问将在2个工作日内与您联系</view>
|
<button class="buton" @tap="saveyes">确定</button>
|
|
</view>
|
</view>
|
|
|
|
</uni-popup>
|
</view>
|
|
|
</view>
|
</template>
|
|
<script>
|
import {
|
getDicts
|
} from "@/api/system/dict/data";
|
import {
|
addTeam
|
} from "@/api/system/timeappointment";
|
export default {
|
data() {
|
return {
|
inspect: {
|
cusName: '',
|
cusPhone: '',
|
cusIdcard: '',
|
cusNational: '',
|
cusMarryStatus: '',
|
idType: "",
|
tjTime: "",
|
pacName: '',
|
pacId: '',
|
},
|
index: 0,
|
pac: {},
|
nations: ['汉族', '壮族', '回族', '其他'],
|
checkupTypes: []
|
}
|
},
|
onLoad(option) {
|
this.pac = JSON.parse(decodeURIComponent(option.pac));
|
this.inspect.pacName = this.pac.pacName;
|
this.inspect.pacId = this.pac.pacId;
|
// this.pacName = option.pacId
|
// this.getList(option.pacId);
|
this.getList();
|
},
|
methods: {
|
getList() {
|
getDicts("dict_tjtype").then(response => {
|
this.checkupTypes = response.data;
|
});
|
},
|
bindDateChange(e) {
|
this.inspect.tjTime = e.detail.value
|
},
|
bindTypeChange(e) {
|
this.index = e.detail.value;
|
// this.inspect.tjPacType = this.checkupTypes[e.detail.value].dictLabel
|
},
|
saveInspect() {
|
let inspect = this.inspect;
|
if (inspect.cnName == undefined) {
|
this.$modal.msgError("请输入单位名称")
|
return false;
|
}
|
if (inspect.contactPerson == undefined) {
|
this.$modal.msgError("请输入联系人");
|
return false;
|
}
|
if (inspect.contactPhone == undefined) {
|
this.$modal.msgError("请输入联系电话");
|
return false;
|
}
|
if (inspect.email == undefined) {
|
this.$modal.msgError("请输入邮箱");
|
return false;
|
}
|
if (inspect.taxNumber == undefined) {
|
this.$modal.msgError("请输入税号");
|
return false;
|
}
|
if (inspect.mailingAddress == undefined) {
|
this.$modal.msgError("请输入通讯地址");
|
return false;
|
}
|
if (inspect.count == undefined) {
|
this.$modal.msgError("请输入预约人数");
|
return false;
|
}
|
this.inspect.tjPacType = this.checkupTypes[this.index].dictValue;
|
let tjTeamAppLog = {
|
cnName: inspect.cnName,
|
contactPerson: inspect.contactPerson,
|
contactPhone: inspect.contactPhone,
|
email: inspect.email,
|
taxNumber: inspect.taxNumber,
|
mailingAddress: inspect.mailingAddress,
|
count: inspect.count,
|
fromBy: "1",
|
tjTime: inspect.tjTime,
|
tjPacType: inspect.tjPacType,
|
pacId: inspect.pacId,
|
pacName: inspect.pacName
|
}
|
|
addTeam(tjTeamAppLog).then(res => {
|
if (res.code == 200)
|
this.$refs.popup.open()
|
this.inspect={
|
cusName: '',
|
cusPhone: '',
|
cusIdcard: '',
|
cusNational: '',
|
cusMarryStatus: '',
|
idType: "",
|
tjTime: "",
|
pacName: '',
|
pacId: '',
|
}
|
// this.$modal.showToast('预约成功');
|
// uni.showModal({
|
// content: '提交成功!体检顾问将在2个工作日内与您联系',
|
// showCancel: false,
|
// buttonText: '确定',
|
// success: (res) => {
|
// if (res.confirm) {
|
// console.log('用户点击确定');
|
// uni.navigateBack();
|
// } else if (res.cancel) {
|
// console.log('用户点击取消');
|
// }
|
// }
|
// })
|
// uni.navigateBack();
|
})
|
// this.$tab.navigateTo('/pagesB/mine/myReservation/myReservation')
|
},
|
saveyes(){
|
this.$refs.popup.close()
|
|
},
|
}
|
}
|
</script>
|
|
<style scoped>
|
.container {
|
padding: 20rpx;
|
height: 1624rpx;
|
background: #FBFDFF;
|
}
|
|
.header {
|
margin-bottom: 20rpx;
|
}
|
|
|
.subtitle {
|
width: 280rpx;
|
height: 28rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #9496A2;
|
line-height: 36rpx;
|
text-align: right;
|
font-style: normal;
|
text-transform: none;
|
}
|
|
.form {
|
width: 702rpx;
|
height: 1051rpx;
|
background: linear-gradient(90deg, #FFFFFF 0%, #FCFFFE 100%);
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
padding: 37rpx 29rpx;
|
}
|
|
.form-item {
|
display: flex;
|
margin-bottom: 30rpx;
|
background-color: #fff;
|
padding: 20rpx;
|
border-radius: 12rpx;
|
}
|
|
.label {
|
/* display: block;
|
font-size: 30rpx;
|
color: #333;
|
margin-bottom: 15rpx; */
|
width: 120rpx;
|
/* height: 246rpx; */
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #373E58;
|
/* line-height: 20rpx; */
|
text-align: left;
|
font-style: normal;
|
text-transform: none;
|
}
|
|
.input {
|
/* height: 80rpx;
|
font-size: 28rpx;
|
color: #333;
|
|
background-color: #f9f9f9;
|
border-radius: 8rpx; */
|
width: 280rpx;
|
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;
|
|
}
|
|
|
.popup {
|
width: 620rpx;
|
height: 440rpx;
|
background: linear-gradient( 180deg, #E9F7FE 0%, #FFFFFF 44%, #FFFFFF 100%);
|
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
|
position: relative;
|
/* 父级需设为相对定位 */
|
|
padding: 20px;
|
}
|
|
.submit-btn {
|
margin-top: 70rpx;
|
color: white;
|
font-size: 32rpx;
|
width: 600rpx;
|
height: 88rpx;
|
background: #419FFD;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
}
|
|
.box_name {
|
width: 160rpx;
|
height: 32rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #373E58;
|
line-height: 42rpx;
|
text-align: right;
|
font-style: normal;
|
text-transform: none;
|
margin-left: 200rpx;
|
margin-top: 100rpx;
|
}
|
|
.box_name1 {
|
/* width: 436rpx; */
|
height: 28rpx;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #565860;
|
line-height: 42rpx;
|
text-align: center;
|
font-style: normal;
|
text-transform: none;
|
/* margin-left: 50rpx; */
|
margin-top: 40rpx;
|
}
|
|
.text_img {
|
width: 239rpx;
|
height: 239rpx;
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
position: absolute;
|
top: -50px;
|
/* 图片高度的一半(假设图片高度100px) */
|
left: 50%;
|
/* 水平居中起点 */
|
transform: translateX(-50%);
|
/* 向左偏移50%宽度 */
|
|
z-index: 999;
|
/* 确保图片在弹框上方 */
|
}
|
|
.buton {
|
width: 340rpx;
|
height: 96rpx;
|
background: #D8EDFF;
|
border-radius: 48rpx 48rpx 48rpx 48rpx;
|
margin-top: 40rpx;
|
}
|
</style>
|