Files
dvcp_v2_wechat_app/src/project/pingchang/AppGetewayRegister/getewayAdd.vue

921 lines
26 KiB
Vue
Raw Normal View History

2022-09-22 11:20:10 +08:00
<template>
2022-09-26 13:50:24 +08:00
<div class="getewayAdd">
2022-09-29 13:58:18 +08:00
<div class="addBox" v-show="pageShow">
<div class="tips">请确保以下信息全部由本人填写本人对所填写内容的真实性和完整性负责</div>
<!-- 基本信息 -->
<div class="title">基本信息</div>
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>卡口选择</h2>
</div>
<div class="form-item__right">
2022-09-29 18:13:22 +08:00
<AiSelect v-model="form.gatewayId" :list="getewayData" :disabled="scene.length" class="select"></AiSelect>
2022-09-29 13:58:18 +08:00
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>身份证号</h2>
</div>
<div class="form-item__right">
<input placeholder="请输入" type="idcard" v-model="form.idNumber" :maxlength="18" @blur="idNumberChange"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>手机号码</h2>
</div>
<div class="form-item__right">
<input placeholder="请输入" type="number" v-model="form.phone" :maxlength="11"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>姓名</h2>
</div>
<div class="form-item__right">
<input placeholder="请输入" v-model="form.name" :maxlength="20"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>人员类别</h2>
</div>
<div class="form-item__right">
<AiSelect v-model="form.type" dict="EP_registerPersonType" class="select"></AiSelect>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>高危行业</h2>
</div>
<div class="form-item__right">
<AiSelect v-model="form.highRiskIndustries" dict="EP_highRiskIndustries" class="select"></AiSelect>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
</div>
2022-09-22 14:47:44 +08:00
2022-09-29 13:58:18 +08:00
<!-- 行程信息 -->
<div class="title">行程信息</div>
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>出发时间</h2>
</div>
<div class="form-item__right">
<div class="ai-area" @click="isShowStartTime = true">
<div class="ai-area__wrapper">
<span class="label" v-if="form.startTime">{{ form.startTime }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
2022-10-08 17:57:17 +08:00
<h2>出发地</h2>
2022-09-29 13:58:18 +08:00
</div>
<div class="form-item__right">
<AiAreaPicker class="ai-area" v-model="startAreaId" :fullName.sync="startAreaName" all>
<div class="ai-area__wrapper">
<span class="label" v-if="startAreaName">{{ startAreaName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</AiAreaPicker>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item form-item__textarea">
<div class="form-item__wrapper">
<div class="form-item__title">
2022-09-30 08:42:45 +08:00
<i style="margin-right:8px;"></i>
2022-10-09 09:21:09 +08:00
<h2>出发地详址</h2>
2022-09-29 13:58:18 +08:00
</div>
<div class="form-item__right">
2022-10-09 09:16:17 +08:00
<textarea auto-height v-model="form.startAddress" :maxlength="500" placeholder="请尽量详细填写至街道、小区。"
2022-09-29 13:58:18 +08:00
placeholder-style="font-size: 16px"></textarea>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item form-item__imgs">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>出行方式</h2>
</div>
<div class="form-item__right">
<div class="travelType">
<div class="travelItem" v-for="(v,index) in travelTypeDict" :key="index" :class="[travelType.includes(v.dictValue)? 'active':'']" @click="travelTypeSelect(v.dictValue)">{{ v.dictName }}</div>
</div>
2022-09-26 13:50:24 +08:00
</div>
2022-09-26 09:34:06 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i style="margin-right:8px;"></i>
2022-10-08 17:57:17 +08:00
<h2>车次/车牌/航班</h2>
2022-09-29 13:58:18 +08:00
</div>
<div class="form-item__right">
<input placeholder="请输入" v-model="form.trainNo" :maxlength="20"/>
</div>
2022-09-22 14:47:44 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item form-item__textarea">
<div class="form-item__wrapper">
<div class="form-item__title">
<i style="margin-right:8px;"></i>
<h2>行程描述</h2>
</div>
<div class="form-item__right">
<textarea auto-height style="height: 90px" v-model="form.description" :maxlength="500" placeholder="请输入行程描述"
placeholder-style="font-size: 16px"></textarea>
</div>
2022-09-22 14:47:44 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>抵平时间</h2>
</div>
<div class="form-item__right">
<div class="ai-area" @click="isShowEndTime = true">
<div class="ai-area__wrapper">
<span class="label" v-if="form.arriveTime">{{ form.arriveTime }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
2022-10-08 17:57:17 +08:00
<h2>目的地</h2>
2022-09-29 13:58:18 +08:00
</div>
<div class="form-item__right">
<AiAreaPicker class="ai-area" v-model="form.arriveAreaId" :fullName.sync="form.arriveAreaName" :areaId="$areaId">
<div class="ai-area__wrapper">
<span class="label" v-if="form.arriveAreaName">{{ form.arriveAreaName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</AiAreaPicker>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item form-item__textarea">
<div class="form-item__wrapper">
<div class="form-item__title">
2022-09-30 08:42:45 +08:00
<i style="margin-right:8px;"></i>
2022-10-09 09:21:09 +08:00
<h2>目的地详址</h2>
2022-09-29 13:58:18 +08:00
</div>
<div class="form-item__right">
2022-10-09 09:16:17 +08:00
<textarea auto-height v-model="form.arriveAddress" :maxlength="500" placeholder="请尽量详细填写至小区、楼栋号。"
2022-09-29 13:58:18 +08:00
placeholder-style="font-size: 16px"></textarea>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
</div>
2022-09-22 14:47:44 +08:00
2022-09-29 13:58:18 +08:00
<!-- 健康状况 -->
<div class="title">健康状况</div>
<div class="form-item__group">
<div class="form-item form-item__imgs">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>是否有风险旅居史</h2>
</div>
<div class="form-item__right">
<AiRadio style="width: 100%;" v-model="form.fromHighRiskArea" dict="yesOrNo"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item" v-show="form.fromHighRiskArea == 1">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>风险地区</h2>
</div>
<div class="form-item__right">
<AiAreaPicker class="ai-area" v-model="form.highRiskAreaId" :fullName.sync="form.highRiskAreaName" all>
<div class="ai-area__wrapper">
<span class="label" v-if="form.highRiskAreaName">{{ form.highRiskAreaName }}</span>
<i v-else>请选择</i>
<u-icon name="arrow-right" color="#ddd"/>
</div>
</AiAreaPicker>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item form-item__imgs">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>近七日内是否接触新冠确诊或疑似患者</h2>
</div>
<div class="form-item__right">
<AiRadio style="width: 100%;" v-model="form.contactPatients" dict="epidemicTouchInFourteen"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item form-item__imgs">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>是否有健康异常情况</h2>
</div>
<div class="form-item__right">
<AiRadio style="width: 100%;" v-model="form.abnormalHealth" dict="yesOrNo"/>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div class="form-item" v-if="form.abnormalHealth==1">
<div class="form-item__wrapper">
<div class="form-item__title">
<i>*</i>
<h2>异常情况</h2>
</div>
<div class="form-item__right">
<AiSelect dict="EP_abnormalType" v-model="form.abnormalType" class="select"></AiSelect>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
</div>
2022-09-22 14:47:44 +08:00
2022-09-29 13:58:18 +08:00
<!-- 同行情况 -->
<div class="title">同行情况</div>
<div class="form-item__group">
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<i style="margin-right: 8px;"></i>
<h2>同行人数</h2>
</div>
<div class="form-item__right">
<input placeholder="请输入" type="number" v-model="form.companionCount" :maxlength="20"/>
<i></i>
</div>
2022-09-22 11:20:10 +08:00
</div>
</div>
2022-09-29 13:58:18 +08:00
<div style="padding: 16px 16px" v-if="form.companionCount > 0"><span style="color: #FF4466">*</span>同行人信息</div>
<div class="form" v-if="form.companionCount > 0">
<NamePhone v-for="(item, index) in people" :key="index" :name.sync="item.name"
:phone.sync="item.phone" :index="index" @delCountHandle="delCountHandle"/>
</div>
<div class="addCount" @click="addCountHandle" v-if="form.companionCount > 0">添加同行人</div>
2022-09-22 11:20:10 +08:00
</div>
2022-09-22 14:47:44 +08:00
2022-09-29 13:58:18 +08:00
<u-picker mode="time" :params="params" v-model="isShowStartTime" @confirm="onStartChange"></u-picker>
<u-picker mode="time" :params="params" v-model="isShowEndTime" @confirm="onEndChange"></u-picker>
<div class="btn-wrapper">
<div class="btn" hover-class="text-hover" @click="submit">提交</div>
</div>
2022-09-22 11:20:10 +08:00
</div>
2022-09-29 15:28:57 +08:00
2022-09-29 14:07:58 +08:00
<AiLogin ref="login" @success="getAuth()"/>
2022-09-22 11:20:10 +08:00
</div>
</template>
<script>
2022-09-29 14:07:58 +08:00
import { mapState, mapActions } from 'vuex'
2022-09-22 17:41:38 +08:00
import NamePhone from './components/namePhone.vue'
2022-09-22 11:20:10 +08:00
export default {
2022-09-22 18:07:34 +08:00
appName: "添加卡口记录",
2022-09-22 11:20:10 +08:00
data() {
return {
2022-09-23 16:09:06 +08:00
form: {
infoType: '0',
gatewayId: '', // 卡口id
gatewayName: '', // 卡口名称
phone: '',
name: '',
idNumber: '',
type: '', // 人员类别
highRiskIndustries: '',
startTime: '',
startAreaId: '',
startAreaName: '',
startAddress: '',
travelType: '',
trainNo: '', // 车次航班
description: '',
arriveTime: '',
arriveAreaId: '',
arriveAreaName: '',
arriveAddress: '',
fromHighRiskArea: '',
highRiskAreaId: '',
highRiskAreaName: '',
contactPatients: '',
abnormalHealth: '',
abnormalType: '',
2022-09-26 13:50:24 +08:00
companionCount: '', // 同行人数量
2022-09-23 16:09:06 +08:00
companionList: [], // 同行人集合
2022-09-27 16:20:06 +08:00
riskLevel: '',
2022-09-23 16:09:06 +08:00
},
2022-09-22 11:20:10 +08:00
isShowEndTime: false,
isShowStartTime: false,
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true
},
2022-09-22 17:41:38 +08:00
$areaId: '',
people: [{
name: '',
phone: '',
2022-09-23 16:09:06 +08:00
}],
current: 1,
2022-09-26 13:50:24 +08:00
getewayData: [],
2022-09-23 16:09:06 +08:00
flag: false,
2022-09-26 09:34:06 +08:00
travelType: [], // 出行方式
2022-09-26 13:50:24 +08:00
travelTypeDict: [],
2022-09-27 16:20:06 +08:00
startAreaId: '',
startAreaName: '',
2022-09-29 13:58:18 +08:00
pageShow: false,
2022-09-29 16:35:45 +08:00
scene: '',
2022-09-29 17:58:50 +08:00
gatewayName: '',
2022-09-23 16:09:06 +08:00
}
},
2022-09-22 18:07:34 +08:00
components: {
2022-09-22 17:41:38 +08:00
NamePhone,
},
2022-09-22 11:20:10 +08:00
computed: {
2022-09-29 11:49:08 +08:00
...mapState(['user','token'])
2022-09-22 11:20:10 +08:00
},
2022-09-26 13:50:24 +08:00
onLoad(o) {
2022-09-27 14:58:48 +08:00
if(o.id) {
2022-09-27 08:56:51 +08:00
this.form.id = o?.id
2022-09-26 13:50:24 +08:00
this.getInfo(o.id)
}
2022-09-29 18:13:22 +08:00
if(decodeURIComponent(o.scene) != 'undefined') {
this.scene = decodeURIComponent(o.scene)
}
2022-09-28 16:18:40 +08:00
},
onShow() {
this.$dict.load(['EP_travelType']).then(()=> {
this.travelTypeDict = this.$dict.getDict('EP_travelType')
2022-09-29 15:39:08 +08:00
this.$areaId = this.user.$areaId
this.getewayList()
2022-09-29 17:58:50 +08:00
setTimeout(()=>{
if(this.scene.length) {
this.form.gatewayId = this.scene
this.form.gatewayName = this.getewayData.filter(item=> item.value == this.scene)?.[0].label || ''
}
}, 400)
2022-09-29 15:39:08 +08:00
if(!this.token) {
this.$refs.login.show()
2022-09-29 15:53:03 +08:00
} else {
this.pageShow = true
2022-09-29 15:39:08 +08:00
}
2022-09-28 16:18:40 +08:00
})
2022-09-22 11:20:10 +08:00
},
2022-09-27 16:20:06 +08:00
watch: {
startAreaId: {
handler(v) {
if(v.length) {
this.getRiskLevel(v)
}
}
2022-09-30 09:04:44 +08:00
},
2022-09-27 16:20:06 +08:00
},
2022-09-22 11:20:10 +08:00
methods: {
2022-09-29 14:07:58 +08:00
...mapActions(['getUserInfo']),
2022-09-29 18:19:18 +08:00
// 授权登录
2022-09-29 14:07:58 +08:00
getAuth() {
2022-09-29 19:27:42 +08:00
2022-09-29 14:07:58 +08:00
this.$nextTick(() => {
2022-10-08 17:57:17 +08:00
// if(this.token) {
this.token && this.getUserInfo()
2022-09-29 18:43:13 +08:00
this.form.gatewayId = this.scene
2022-09-29 19:27:42 +08:00
this.getewayList()
2022-09-29 18:53:57 +08:00
this.$forceUpdate()
2022-09-29 19:27:42 +08:00
setTimeout(()=>{
let item = this.getewayData.filter(item=> item.value == this.scene)
this.form.gatewayName = item?.[0].label
},400)
this.pageShow = true
2022-10-08 17:57:17 +08:00
// }
2022-09-29 14:07:58 +08:00
})
},
2022-09-22 17:41:38 +08:00
addCountHandle() {
this.people.push({
name: "",
phone: "",
});
},
delCountHandle(index) {
this.people.splice(index, 1);
},
2022-09-22 11:20:10 +08:00
onStartChange(e) {
this.form.startTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
},
onEndChange(e) {
this.form.arriveTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
},
2022-09-26 13:50:24 +08:00
travelTypeSelect(value) {
const index = this.travelType.indexOf(value)
if (index === -1) {
this.travelType.push(value)
} else {
this.travelType.splice(index, 1)
}
},
getInfo(id) {
this.$instance.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${id}`).then(res => {
if (res?.data) {
this.form = res.data
this.people = res.data.companionList
this.travelType = res.data.travelType?.split(',')
this.form.startTime = res.data.startTime.substr(0, res.data.startTime.length - 3)
this.form.arriveTime = res.data.arriveTime.substr(0, res.data.arriveTime.length - 3)
2022-09-27 16:20:06 +08:00
this.startAreaId = res.data.startAreaId
this.arriveAreaName = res.data.startAreaName
2022-09-26 13:50:24 +08:00
}
this.$hideLoading()
})
},
2022-09-27 16:20:06 +08:00
// 获取风险等级
getRiskLevel(areaId) {
this.$instance.post(`/app/appepidemicpreventionriskarea/queryAreaRiskLevel?areaId=${areaId}`).then(res=> {
if(res?.data) {
this.form.riskLevel = res.data
}
})
},
2022-09-23 16:09:06 +08:00
// 获取卡口列表
2022-09-26 13:50:24 +08:00
getewayList() {
2022-09-23 16:09:06 +08:00
this.$instance.post(`/app/appepidemicpreventiongateway/list`, null, {
current: this.current,
size: 300,
}).then(res => {
if(res?.data) {
2022-09-26 13:50:24 +08:00
this.getewayData = res.data.records.map(item=> {
2022-09-23 16:09:06 +08:00
return {
label: item.name,
value: item.id
}
})
}
})
},
2022-09-26 13:50:24 +08:00
idNumberChange(e) {
2022-09-27 14:14:44 +08:00
if(e.detail.value.length) {
2022-09-26 13:50:24 +08:00
this.getOwnerInfo(e.detail.value)
}
},
// 获取个人信息
getOwnerInfo(idNumber) {
this.$instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, {
params: {
idNumber: idNumber,
current: this.current,
size: 10,
2022-10-09 09:16:17 +08:00
infoType: '0',
2022-09-26 13:50:24 +08:00
}
2022-09-23 16:09:06 +08:00
}).then(res => {
2022-09-26 13:50:24 +08:00
if(res?.data) {
2022-09-27 14:58:48 +08:00
this.form.name = res.data.records?.[0]?.name || ''
this.form.phone = res.data.records?.[0]?.phone || ''
2022-09-26 13:50:24 +08:00
}
2022-09-23 16:09:06 +08:00
})
},
2022-09-22 11:20:10 +08:00
submit() {
2022-09-23 16:09:06 +08:00
if (!this.form.gatewayId) {
return this.$toast('请选择卡口')
}
2022-09-22 11:20:10 +08:00
if (!this.form.idNumber) {
2022-09-23 16:09:06 +08:00
return this.$toast('请输入身份证号')
2022-09-22 11:20:10 +08:00
}
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)) {
return this.$toast('请输入正确的身份证账号')
}
2022-09-27 13:56:06 +08:00
if (!this.form.phone) {
return this.$toast('请输入手机号码')
}
if (!this.form.name) {
return this.$toast('请输入姓名')
}
2022-09-23 16:09:06 +08:00
if (!this.form.highRiskIndustries) {
return this.$toast('请选择高危行业')
2022-09-22 11:20:10 +08:00
}
if (!this.form.type) {
return this.$toast('请选择人员类别')
}
2022-09-23 16:09:06 +08:00
2022-09-22 11:20:10 +08:00
if (!this.form.startTime) {
return this.$toast('请选择出发时间')
}
2022-09-23 16:09:06 +08:00
if (new Date(this.form.startTime.replace(/-/g, '/')).getTime() > new Date().getTime()) {
return this.$toast('出发时间不得晚于当前时间')
}
2022-09-22 11:20:10 +08:00
2022-09-27 16:20:06 +08:00
if (!this.startAreaId) {
2022-10-08 17:57:17 +08:00
return this.$toast('请选择出发地')
2022-09-22 11:20:10 +08:00
}
2022-09-27 16:20:06 +08:00
if (this.startAreaId.substr(this.startAreaId.length - 3, 3) === '000') {
2022-10-08 17:57:17 +08:00
return this.$toast('出发地必须选到村或社区')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
2022-09-30 08:42:45 +08:00
// if (!this.form.startAddress) {
2022-10-09 09:21:09 +08:00
// return this.$toast('请输入出发地详址')
2022-09-30 08:42:45 +08:00
// }
2022-09-22 11:20:10 +08:00
2022-09-30 09:08:50 +08:00
if (!this.travelType.length) {
2022-09-23 16:09:06 +08:00
return this.$toast('请选择出行方式')
}
2022-09-22 11:20:10 +08:00
if (!this.form.arriveTime) {
2022-09-23 18:03:52 +08:00
return this.$toast('请选择抵平时间')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
2022-09-22 11:20:10 +08:00
if (new Date(this.form.startTime.replace(/-/g, '/')).getTime() >= new Date(this.form.arriveTime.replace(/-/g, '/')).getTime()) {
return this.$toast('到达时间不得早于出发时间')
}
2022-09-23 16:09:06 +08:00
2022-09-22 11:20:10 +08:00
if (!this.form.arriveAreaName) {
2022-10-08 17:57:17 +08:00
return this.$toast('请选择目的地')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
2022-09-22 11:20:10 +08:00
if (this.form.arriveAreaId.substr(this.form.arriveAreaId.length - 3, 3) === '000') {
2022-10-09 09:16:17 +08:00
return this.$toast('目的地必须选到村或社区')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
2022-09-30 08:42:45 +08:00
// if (!this.form.arriveAddress) {
// return this.$toast('请输入到达地址')
// }
2022-09-22 11:20:10 +08:00
2022-09-23 16:09:06 +08:00
if (!this.form.fromHighRiskArea) {
return this.$toast('请选择是否有风险旅居史')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
if (this.form.fromHighRiskArea == 1) {
if (!this.form.highRiskAreaId) {
return this.$toast('请选择风险旅居地区')
}
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
if (!this.form.contactPatients) {
return this.$toast('请选择近七日内是否接触新冠确诊或疑似患者')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
if (!this.form.abnormalHealth) {
return this.$toast('请选择是否有健康异常情况')
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
if (this.form.abnormalHealth == 1) {
if (!this.form.abnormalType) {
return this.$toast('请选择异常情况')
}
2022-09-22 11:20:10 +08:00
}
2022-09-23 16:09:06 +08:00
2022-10-08 17:57:17 +08:00
if (!this.form.companionCount || this.form.companionCount == 0) {
2022-09-26 13:50:24 +08:00
this.form.companionCount = 0
this.form.companionList = []
} else {
2022-09-30 08:46:31 +08:00
2022-10-09 09:17:21 +08:00
if(this.form.companionCount > 100) {
return this.$u.toast('同行人数最多可填写100人。')
2022-09-30 08:42:45 +08:00
}
2022-09-26 13:50:24 +08:00
if(this.people.length != this.form.companionCount) {
2022-09-28 10:17:31 +08:00
return this.$u.toast('请输入正确的同行人信息')
2022-09-26 13:50:24 +08:00
} else {
2022-09-28 09:27:43 +08:00
if(this.people.some(val=> (val.name=='') || (val.phone=='')) ) {
2022-09-28 10:17:52 +08:00
return this.$u.toast('请输入完整的同行人信息')
2022-09-28 09:22:16 +08:00
} else {
this.form.companionList = this.people
}
2022-09-26 13:50:24 +08:00
}
}
2022-09-22 11:20:10 +08:00
if (this.flag) return
this.flag = true
this.$loading()
2022-09-23 16:09:06 +08:00
this.$instance.post(`/app/appepidemicpreventionregisterinfo/addOrUpdate`, {
2022-09-22 11:20:10 +08:00
...this.form,
2022-09-27 16:20:06 +08:00
startAreaId: this.startAreaId,
startAreaName: this.startAreaName,
2022-09-26 09:34:06 +08:00
travelType: this.travelType.toString(),
2022-09-22 11:20:10 +08:00
startTime: this.form.startTime + ':00',
arriveTime: this.form.arriveTime + ':00',
}).then(res => {
this.$hideLoading()
this.flag = false
if (res.code == 0) {
uni.$emit('update')
this.$toast('提交成功')
setTimeout(() => {
2022-09-27 17:16:11 +08:00
uni.reLaunch({url:'./AppGetewayRegister'})
2022-09-22 11:20:10 +08:00
}, 400)
}
})
}
}
}
</script>
2022-09-26 14:02:17 +08:00
<style lang="scss" scoped>
2022-09-26 13:50:24 +08:00
.getewayAdd {
2022-09-29 13:58:18 +08:00
.addBox {
padding-bottom: 140px;
.tips {
line-height: 1.3;
padding: 32px 32px;
color: #FF883C;
font-size: 30px;
text-align: justify;
background: #FFF8F3;
2022-09-22 17:41:38 +08:00
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
.title {
padding: 16px 32px 0 32px;
box-sizing: border-box;
background: #fff;
font-size: 36px;
font-weight: 600;
2022-09-22 11:20:10 +08:00
}
2022-09-29 13:58:18 +08:00
.form-item__group {
margin-bottom: 24px;
background: #fff;
.addCount {
padding: 16px 32px;
box-sizing: border-box;
color: #4181FF;
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
::v-deep .u-btn--primary {
border-radius: 16px;
2022-09-22 11:20:10 +08:00
}
}
}
2022-09-29 13:58:18 +08:00
.form-item {
padding-left: 32px;
2022-09-28 15:31:18 +08:00
2022-09-29 13:58:18 +08:00
.form-item__checkbox {
width: 100%;
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
div {
width: 100%;
height: 80px;
line-height: 80px;
margin-bottom: 24px;
text-align: center;
background: #FFFFFF;
border-radius: 16px;
color: #333333;
font-size: 28px;
border: 1px solid #CCCCCC;
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
&.active {
background: #4181FF;
color: #fff;
border-color: #4181FF;
}
}
2022-09-22 11:20:10 +08:00
}
2022-09-29 13:58:18 +08:00
.form-item__radio {
display: flex;
align-items: center;
flex-wrap: wrap;
div {
width: 212px;
height: 80px;
line-height: 80px;
margin-right: 16px;
margin-bottom: 8px;
text-align: center;
background: #FFFFFF;
border-radius: 16px;
color: #333333;
font-size: 28px;
border: 1px solid #CCCCCC;
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
&:nth-of-type(3n) {
margin-right: 0;
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
&.active {
background: #4181FF;
color: #fff;
border-color: #4181FF;
}
}
2022-09-22 11:20:10 +08:00
}
2022-09-29 13:58:18 +08:00
.ai-area__wrapper {
2022-09-22 11:20:10 +08:00
display: flex;
align-items: center;
2022-09-29 13:58:18 +08:00
padding-left: 100px;
2022-09-22 11:20:10 +08:00
span {
2022-09-29 13:58:18 +08:00
color: #333;
font-size: 30px;
2022-09-22 11:20:10 +08:00
overflow: hidden;
text-overflow: ellipsis;
2022-09-29 13:58:18 +08:00
white-space: nowrap;
2022-09-22 11:20:10 +08:00
}
i {
2022-09-29 13:58:18 +08:00
color: #999;
font-size: 30px;
2022-09-22 11:20:10 +08:00
}
2022-09-26 13:50:24 +08:00
2022-09-29 13:58:18 +08:00
image {
width: 16px;
height: 8px;
}
}
.form-item__wrapper {
display: flex;
align-items: center;
justify-content: space-between;
height: 128px;
padding-right: 28px;
border-bottom: 1px solid #DDDDDD;
input {
flex: 1;
height: 100%;
text-align: right;
color: #333;
padding-right: 10px;
}
.form-item__right {
display: flex;
align-items: center;
font-size: 32px;
.select {
._i {
padding-left: 100px;
}
}
span {
max-width: 300px;
margin-right: 8px;
2022-09-26 13:50:24 +08:00
color: #333333;
2022-09-29 13:58:18 +08:00
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
2022-09-26 13:50:24 +08:00
}
2022-09-29 13:58:18 +08:00
i {
margin-right: 8px;
color: #999999;
2022-09-26 13:50:24 +08:00
}
2022-09-29 13:58:18 +08:00
.travelType {
width: 100%;
.travelItem {
width: 100%;
line-height: 1.3;
padding: 20px 32px;
margin-bottom: 16px;
text-align: center;
background: #FFFFFF;
box-sizing: border-box;
border-radius: 16px;
color: #333333;
font-size: 28px;
border: 1px solid #CCCCCC;
}
.active {
background: #4181FF;
}
}
2022-09-26 13:50:24 +08:00
}
2022-09-22 11:20:10 +08:00
}
2022-09-29 13:58:18 +08:00
&:last-child {
.form-item__wrapper {
border-bottom: none;
}
2022-09-22 11:20:10 +08:00
}
2022-09-29 13:58:18 +08:00
.form-item__title {
display: flex;
align-items: center;
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
i {
font-size: 32px;
color: #FF4466;
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
span {
font-size: 28px;
color: #999999;
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
h2 {
padding: 0 4px;
font-weight: 400;
font-size: 32px;
color: #333333;
max-width: 100%;
min-width: 260px;
}
2022-09-22 11:20:10 +08:00
}
2022-09-29 13:58:18 +08:00
&.form-item__imgs, &.form-item__textarea {
.form-item__wrapper {
display: block;
height: auto;
padding-bottom: 32px;
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
textarea {
width: 100%;
height: 90px;
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
.form-item__title {
padding: 32px 0;
}
2022-09-22 11:20:10 +08:00
2022-09-29 13:58:18 +08:00
.form-item__right {
padding-left: 18px;
}
2022-09-22 11:20:10 +08:00
}
}
2022-09-22 14:47:44 +08:00
2022-09-29 13:58:18 +08:00
.form {
padding: 0 32px;
box-sizing: border-box;
}
2022-09-23 16:09:06 +08:00
}
2022-09-22 11:20:10 +08:00
}
</style>