<template>
|
<view class="cen">
|
<view style="height: 100%">
|
<view class="add-address">
|
<view class="add-form">
|
<view class="" style="margin-left: 10px;font-size: 14px;">
|
{{pacName}}
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputcnName" placeholder="单位名称" :value="inspect.cnName"
|
auto-focus />
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputcontactPerson" :value="inspect.contactPerson"
|
placeholder="联系人" />
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputcontactPhone" :value="inspect.contactPhone"
|
placeholder="联系电话" />
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputemail" :value="inspect.email" placeholder="邮箱" />
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputtaxNumber" :value="inspect.taxNumber" placeholder="税号" />
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputmailingAddress" :value="inspect.mailingAddress"
|
placeholder="通讯地址" />
|
</view>
|
<view class="form-item">
|
<!-- <uni-datetime-picker v-model="range" type="daterange" @change="maskClick" /> -->
|
<uni-datetime-picker type="date" :clear-icon="false" v-model="tjTime" @change="maskClick" :start="new Date().getTime()" />
|
</view>
|
<view class="form-item">
|
<uni-forms-item prop="idType">
|
<picker style="margin-top: 20px;" class="pic" v-model="inspect.tjPacType" @change="picker"
|
range-key="dictLabel" mode="selector" :value="cardOptions.dictValue"
|
:range="cardOptions">
|
<view class="uni-input">{{cardOptions[index].dictLabel}}</view>
|
</picker>
|
</uni-forms-item>
|
</view>
|
<view class="form-item">
|
<input class="input" @input="bindinputuserNum" :value="inspect.count" placeholder="预约人数" />
|
</view>
|
|
</view>
|
|
</view>
|
<view class="btns">
|
<button class="save" @tap="saveInspect">立即预约</button>
|
</view>
|
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
<script>
|
import {
|
getDicts
|
} from "@/api/system/dict/data";
|
import {
|
addTeam
|
} from "@/api/system/timeappointment";
|
export default {
|
data() {
|
return {
|
tjTime: Number(new Date()),
|
marryOptions: [],
|
NationalOptions: [],
|
cardOptions: [],
|
range: ['2023-11-15', '2023-11-30'],
|
pacName: '',
|
pacId: '',
|
index: 0,
|
index2: 0,
|
index3: 0,
|
searchStatus: false,
|
pac: {},
|
inspect: {
|
cusName: '',
|
cusPhone: '',
|
cusIdcard: '',
|
cusNational: '',
|
cusMarryStatus: '',
|
idType: "",
|
},
|
item: {},
|
defaultKeyword: {
|
pacName: ""
|
}
|
}
|
},
|
onLoad(option) {
|
this.pac = JSON.parse(decodeURIComponent(option.pac));
|
console.log(this.pac);
|
this.pacName = this.pac.pacName;
|
this.pacId = this.pac.pacId;
|
// this.pacName = option.pacId
|
// this.getList(option.pacId);
|
this.getList();
|
},
|
methods: {
|
getList() {
|
getDicts("dict_tjtype").then(response => {
|
this.cardOptions = response.data;
|
});
|
},
|
maskClick(e) {
|
console.log(111);
|
console.log('maskClick事件:', e);
|
},
|
picker(cardOptions) {
|
this.index = cardOptions.detail.value;
|
console.log(this.index);
|
},
|
bindinputcnName(e) {
|
let inspect = this.inspect;
|
inspect.cnName = e.detail.value;
|
},
|
bindinputcontactPerson(e) {
|
let inspect = this.inspect;
|
inspect.contactPerson = e.detail.value;
|
},
|
bindinputcontactPhone(e) {
|
let inspect = this.inspect;
|
inspect.contactPhone = e.detail.value;
|
},
|
bindinputemail(e) {
|
let inspect = this.inspect;
|
inspect.email = e.detail.value;
|
},
|
bindinputtaxNumber(e) {
|
let inspect = this.inspect;
|
inspect.taxNumber = e.detail.value;
|
},
|
bindinputmailingAddress(e) {
|
let inspect = this.inspect;
|
inspect.mailingAddress = e.detail.value;
|
},
|
bindinputuserNum(e) {
|
let inspect = this.inspect;
|
inspect.count = e.detail.value;
|
},
|
|
saveInspect() {
|
let inspect = this.inspect;
|
console.log(inspect.cnName);
|
if (inspect.cnName == undefined) {
|
console.log(111);
|
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.cardOptions[this.index].dictValue;
|
console.log(this.inspect.tjPacType);
|
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: this.tjTime,
|
tjPacType: this.inspect.tjPacType,
|
pacId: this.pacId,
|
pacName: this.pacName
|
}
|
addTeam(tjTeamAppLog).then(res => {
|
if (res.code == 200)
|
// 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')
|
},
|
}
|
}
|
</script>
|
|
<style>
|
page {
|
height: 100%;
|
background: #f4f4f4;
|
}
|
|
.cen {
|
padding-bottom: 100rpx
|
}
|
|
.add-address .add-form {
|
background: #fff;
|
width: 100%;
|
height: auto;
|
overflow: hidden;
|
}
|
|
.add-address .form-item {
|
height: 116rpx;
|
padding-left: 31.25rpx;
|
border-bottom: 1px solid #d9d9d9;
|
display: flex;
|
align-items: center;
|
padding-right: 31.25rpx;
|
}
|
|
.add-address .input {
|
flex: 1;
|
height: 44rpx;
|
line-height: 44rpx;
|
overflow: hidden;
|
}
|
|
.add-address .form-default {
|
border-bottom: 1px solid #d9d9d9;
|
height: 96rpx;
|
background: #fff;
|
padding-top: 28rpx;
|
font-size: 28rpx;
|
padding-left: 31.25rpx;
|
}
|
|
.add-address .form-default .van-checkbox .van-icon {
|
color: #fff;
|
}
|
|
.add-address .btns {
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
overflow: hidden;
|
display: flex;
|
height: 100rpx;
|
width: 100%;
|
}
|
|
.add-address .cannel,
|
.add-address .save {
|
flex: 1;
|
height: 100rpx;
|
text-align: center;
|
line-height: 100rpx;
|
font-size: 28rpx;
|
color: #fff;
|
border: none;
|
border-radius: 0;
|
}
|
|
.add-address .cannel {
|
background: #333;
|
}
|
|
.add-address .save {
|
background: #2f54eb;
|
}
|
|
|
|
.text-ABC {
|
padding: 10px 10px;
|
font-size: 12px;
|
color: #b8b8b8;
|
height: 210px;
|
}
|
</style>
|