返乡新增
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<h2>身份证号</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<input placeholder="请输入" type="idcard" v-model="form.idNumber" :maxlength="20"/>
|
||||
<input placeholder="请输入" type="idcard" v-model="form.idNumber" :maxlength="20" @blur="idNumberChange" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,7 +44,7 @@
|
||||
<h2>人员类别</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiSelect v-model="form.type" dict="epidemicRecentPersonType" class="select"></AiSelect>
|
||||
<AiSelect v-model="form.type" dict="EP_registerPersonType" class="select"></AiSelect>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,9 +87,9 @@
|
||||
<h2>出发地区</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiAreaPicker class="ai-area" v-model="form.startAreaId" :fullName.sync="form.startAreaName" all>
|
||||
<AiAreaPicker class="ai-area" v-model="startAreaId" :fullName.sync="startAreaName" all>
|
||||
<div class="ai-area__wrapper">
|
||||
<span class="label" v-if="form.startAreaName">{{ form.startAreaName }}</span>
|
||||
<span class="label" v-if="startAreaName">{{ startAreaName }}</span>
|
||||
<i v-else>请选择</i>
|
||||
<u-icon name="arrow-right" color="#ddd"/>
|
||||
</div>
|
||||
@@ -125,7 +125,7 @@
|
||||
<div class="form-item">
|
||||
<div class="form-item__wrapper">
|
||||
<div class="form-item__title">
|
||||
<i>*</i>
|
||||
<i style="margin-right: 8px;"></i>
|
||||
<h2>车次/航班</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
@@ -136,7 +136,7 @@
|
||||
<div class="form-item form-item__textarea">
|
||||
<div class="form-item__wrapper">
|
||||
<div class="form-item__title">
|
||||
<i>*</i>
|
||||
<i style="margin-right: 8px;"></i>
|
||||
<h2>行程描述</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
@@ -149,7 +149,7 @@
|
||||
<div class="form-item__wrapper">
|
||||
<div class="form-item__title">
|
||||
<i>*</i>
|
||||
<h2>抵平时间</h2>
|
||||
<h2>预计抵平时间</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<div class="ai-area" @click="isShowEndTime = true">
|
||||
@@ -169,7 +169,7 @@
|
||||
<h2>抵平卡口</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiSelect dict="epidemicRecentTravel" v-model="form.travelType" class="select"></AiSelect>
|
||||
<AiSelect :list="getewayData" v-model="form.gatewayId" class="select"></AiSelect>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
<div class="form-item form-item__textarea">
|
||||
<div class="form-item__wrapper">
|
||||
<div class="form-item__title">
|
||||
<i>*</i>
|
||||
<i style="margin-righgt: 8px;"></i>
|
||||
<h2>返乡地址</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
@@ -213,7 +213,7 @@
|
||||
<h2>是否有风险旅居史?</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiRadio style="width: 100%;" v-model="form.touchInFourteen" dict="yesOrNo"></AiRadio>
|
||||
<AiRadio style="width: 100%;" v-model="form.fromHighRiskArea" dict="yesOrNo"></AiRadio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -224,9 +224,9 @@
|
||||
<h2>风险地区</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiAreaPicker class="ai-area" v-model="form.startAreaId" :fullName.sync="form.startAreaName" all>
|
||||
<AiAreaPicker class="ai-area" v-model="form.highRiskAreaId" :fullName.sync="form.highRiskAreaName" all>
|
||||
<div class="ai-area__wrapper">
|
||||
<span class="label" v-if="form.startAreaName">{{ form.startAreaName }}</span>
|
||||
<span class="label" v-if="form.highRiskAreaId">{{ form.highRiskAreaName }}</span>
|
||||
<i v-else>请选择</i>
|
||||
<u-icon name="arrow-right" color="#ddd"/>
|
||||
</div>
|
||||
@@ -241,7 +241,7 @@
|
||||
<h2>近七日内是否接触新冠确诊或疑似患者?</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiRadio style="width: 100%;" v-model="form.health" dict="epidemicTouchInFourteen"></AiRadio>
|
||||
<AiRadio style="width: 100%;" v-model="form.contactPatients" dict="yesOrNo"></AiRadio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -252,7 +252,7 @@
|
||||
<h2>是否有健康异常情况?</h2>
|
||||
</div>
|
||||
<div class="form-item__right">
|
||||
<AiRadio style="width: 100%;" v-model="form.health" dict="yesOrNo"></AiRadio>
|
||||
<AiRadio style="width: 100%;" v-model="form.abnormalHealth" dict="yesOrNo"></AiRadio>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -269,7 +269,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<u-picker mode="time" :params="dataParams" v-model="isShowDate" @confirm="onDateChange"></u-picker>
|
||||
<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>
|
||||
|
||||
@@ -303,6 +302,7 @@ export default {
|
||||
day: true
|
||||
},
|
||||
form: {
|
||||
riskLevel: '', // 风险等级
|
||||
infoType: '1',
|
||||
idNumber: '',
|
||||
name: '',
|
||||
@@ -323,50 +323,45 @@ export default {
|
||||
arriveAreaId: '',
|
||||
arriveAreaName: '',
|
||||
arriveAddress: '',
|
||||
|
||||
|
||||
checkPhoto: [],
|
||||
checkResult: '',
|
||||
checkTime: '',
|
||||
description: '',
|
||||
health: [],
|
||||
idNumber: '',
|
||||
name: '',
|
||||
phone: '',
|
||||
|
||||
|
||||
|
||||
temperature: '',
|
||||
touchInFourteen: '',
|
||||
travelType: '',
|
||||
type: '',
|
||||
unusual: '',
|
||||
fromHighRiskArea: '',
|
||||
highRiskAreaId: '',
|
||||
highRiskAreaName: '',
|
||||
contactPatients: '',
|
||||
abnormalHealth: '',
|
||||
abnormalType: '',
|
||||
companionList: [],
|
||||
},
|
||||
dictList: [],
|
||||
arr: [],
|
||||
gridList: [[], [], []],
|
||||
flag: false,
|
||||
$areaId: '',
|
||||
travelTypeDict: [],
|
||||
travelType: [],
|
||||
getewayData: [],
|
||||
startAreaId: '',
|
||||
startAreaName: '',
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
computed: {
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
watch: {
|
||||
startAreaId: {
|
||||
handler(v) {
|
||||
if(v.length) {
|
||||
this.getRiskLevel(v)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.$areaId = this.user.$areaId
|
||||
this.travelTypeDict = this.$dict.getDict('epidemicRecentTravel')
|
||||
this.getewayList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
onDateChange(e) {
|
||||
this.form.checkTime = `${e.year}-${e.month}-${e.day}`
|
||||
},
|
||||
|
||||
onStartChange(e) {
|
||||
this.form.startTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
|
||||
},
|
||||
@@ -384,107 +379,184 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
submit() {
|
||||
if (!this.form.name) {
|
||||
return this.$toast('请输入返乡人员姓名')
|
||||
}
|
||||
// 获取风险等级
|
||||
getRiskLevel(areaId) {
|
||||
this.$instance.post(`/app/appepidemicpreventionriskarea/queryAreaRiskLevel?areaId=${areaId}`).then(res=> {
|
||||
if(res?.data) {
|
||||
this.form.riskLevel = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
idNumberChange(e) {
|
||||
if(e.detail.value.length) {
|
||||
this.getOwnerInfo(e.detail.value)
|
||||
}
|
||||
},
|
||||
|
||||
// 获取个人信息
|
||||
getOwnerInfo(idNumber) {
|
||||
this.$instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, {
|
||||
params: {
|
||||
idNumber: idNumber,
|
||||
current: this.current,
|
||||
size: 10,
|
||||
infoType: '1',
|
||||
}
|
||||
}).then(res => {
|
||||
if(res?.data) {
|
||||
this.form.name = res.data.records?.[0]?.name || ''
|
||||
this.form.phone = res.data.records?.[0]?.phone || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 获取卡口列表
|
||||
getewayList() {
|
||||
this.$instance.post(`/app/appepidemicpreventiongateway/list`, null, {
|
||||
current: this.current,
|
||||
size: 300,
|
||||
}).then(res => {
|
||||
if(res?.data) {
|
||||
this.getewayData = res.data.records.map(item=> {
|
||||
return {
|
||||
label: item.name,
|
||||
value: item.id
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
submit() {
|
||||
if (!this.form.idNumber) {
|
||||
return this.$toast('请输入返乡人员身份证号')
|
||||
return this.$toast('请输入身份证号')
|
||||
}
|
||||
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)) {
|
||||
return this.$toast('请输入正确的身份证账号')
|
||||
}
|
||||
|
||||
if (!this.form.phone) {
|
||||
return this.$toast('请输入返乡人员手机号码')
|
||||
if (!this.form.name) {
|
||||
return this.$toast('请输入姓名')
|
||||
}
|
||||
|
||||
if (!/^1[0-9]{10,10}$/.test(this.form.phone)) {
|
||||
return this.$toast('请输入正确的手机号码')
|
||||
if (!this.form.phone) {
|
||||
return this.$toast('请输入手机号码')
|
||||
}
|
||||
|
||||
if (!this.form.type) {
|
||||
return this.$toast('请选择人员类别')
|
||||
}
|
||||
|
||||
if (!this.form.travelType) {
|
||||
return this.$toast('请选择出行方式')
|
||||
if (!this.form.highRiskIndustries) {
|
||||
return this.$toast('请选择高危行业')
|
||||
}
|
||||
|
||||
if (!this.form.startTime) {
|
||||
return this.$toast('请选择出发时间')
|
||||
}
|
||||
|
||||
// if (new Date(this.form.startTime.replace(/-/g, '/')).getTime() > new Date().getTime()) {
|
||||
// return this.$toast('出发时间不得晚于当前时间')
|
||||
if (new Date(this.form.startTime.replace(/-/g, '/')).getTime() > new Date().getTime()) {
|
||||
return this.$toast('出发时间不得晚于当前时间')
|
||||
}
|
||||
|
||||
if (!this.startAreaId) {
|
||||
return this.$toast('请选择出发地')
|
||||
}
|
||||
|
||||
if (this.startAreaId.substr(this.startAreaId.length - 3, 3) === '000') {
|
||||
return this.$toast('出发地必须选到村或社区')
|
||||
}
|
||||
|
||||
// if (!this.form.startAddress) {
|
||||
// return this.$toast('请输入出发地详址')
|
||||
// }
|
||||
|
||||
if (!this.form.startAreaName) {
|
||||
return this.$toast('请选择出发地区')
|
||||
}
|
||||
|
||||
if (this.form.startAreaId.substr(this.form.startAreaId.length - 3, 3) === '000') {
|
||||
return this.$toast('出发地区必须选到村或社区')
|
||||
}
|
||||
if (!this.form.startAddress) {
|
||||
return this.$toast('请输入出发详细地址')
|
||||
if (!this.travelType.length) {
|
||||
return this.$toast('请选择出行方式')
|
||||
}
|
||||
|
||||
if (!this.form.arriveTime) {
|
||||
return this.$toast('请选择到达时间')
|
||||
return this.$toast('请选择预计抵平时间')
|
||||
}
|
||||
|
||||
if (new Date(this.form.startTime.replace(/-/g, '/')).getTime() >= new Date(this.form.arriveTime.replace(/-/g, '/')).getTime()) {
|
||||
return this.$toast('到达时间不得早于出发时间')
|
||||
}
|
||||
|
||||
if (!this.form.gatewayId) {
|
||||
return this.$toast('请选择抵平卡口')
|
||||
}
|
||||
|
||||
if (!this.form.arriveAreaName) {
|
||||
return this.$toast('请选择到达地区')
|
||||
return this.$toast('请选择返乡地区')
|
||||
}
|
||||
|
||||
if (this.form.arriveAreaId.substr(this.form.arriveAreaId.length - 3, 3) === '000') {
|
||||
return this.$toast('到达地区必须选到村或社区')
|
||||
}
|
||||
if (!this.form.arriveAddress) {
|
||||
return this.$toast('请输入返乡地址')
|
||||
return this.$toast('返乡地区必须选到村或社区')
|
||||
}
|
||||
|
||||
if (!this.form.description) {
|
||||
return this.$toast('请输入行程描述')
|
||||
}
|
||||
if (!this.form.checkTime) {
|
||||
return this.$toast('请选择核酸检测日期')
|
||||
}
|
||||
if (!this.form.checkPhoto.length) {
|
||||
return this.$toast('请上传本人健康码截图或核酸检测报告')
|
||||
// if (!this.form.arriveAddress) {
|
||||
// return this.$toast('请输入返乡地址')
|
||||
// }
|
||||
|
||||
if (!this.form.fromHighRiskArea) {
|
||||
return this.$toast('请选择是否有风险旅居史')
|
||||
}
|
||||
|
||||
if (!this.form.checkResult) {
|
||||
return this.$toast('请选择核酸检测结果')
|
||||
}
|
||||
if (!this.form.temperature) {
|
||||
return this.$toast('请输入当前体温')
|
||||
}
|
||||
if (!this.form.touchInFourteen) {
|
||||
return this.$toast('请选择14天内是否接触新冠确诊或疑似患者')
|
||||
if (this.form.fromHighRiskArea == 1) {
|
||||
if (!this.form.highRiskAreaId) {
|
||||
return this.$toast('请选择风险旅居地区')
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.form.health.length) {
|
||||
return this.$toast('请选择当前健康状况')
|
||||
if (!this.form.contactPatients) {
|
||||
return this.$toast('请选择近七日内是否接触新冠确诊或疑似患者')
|
||||
}
|
||||
|
||||
if (!this.form.abnormalHealth) {
|
||||
return this.$toast('请选择是否有健康异常情况')
|
||||
}
|
||||
|
||||
if (this.form.abnormalHealth == 1) {
|
||||
if (!this.form.abnormalType) {
|
||||
return this.$toast('请选择异常情况')
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.form.companionCount || this.form.companionCount == 0) {
|
||||
this.form.companionCount = 0
|
||||
this.form.companionList = []
|
||||
}
|
||||
// else {
|
||||
|
||||
// if(this.form.companionCount > 100) {
|
||||
// return this.$u.toast('同行人数最多可填写100人。')
|
||||
// }
|
||||
|
||||
// if(this.people.length != this.form.companionCount) {
|
||||
// return this.$u.toast('请输入正确的同行人信息')
|
||||
// } else {
|
||||
// if(this.people.some(val=> (val.name=='') || (val.phone=='')) ) {
|
||||
// return this.$u.toast('请输入完整的同行人信息')
|
||||
// } else {
|
||||
// this.form.companionList = this.people
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (this.flag) return
|
||||
this.flag = true
|
||||
|
||||
this.$loading()
|
||||
this.$instance.post(`/app/appepidemicpreventionregisterinfo/addOrUpdate`, {
|
||||
...this.form,
|
||||
openid: this.user.openid,
|
||||
startAreaId: this.startAreaId,
|
||||
startAreaName: this.startAreaName,
|
||||
travelType: this.travelType.toString(),
|
||||
startTime: this.form.startTime + ':00',
|
||||
arriveTime: this.form.arriveTime + ':00',
|
||||
checkTime: this.form.checkTime + ' 00:00:00',
|
||||
health: this.form.health.join(','),
|
||||
checkPhoto: JSON.stringify(this.form.checkPhoto)
|
||||
}).then(res => {
|
||||
this.$hideLoading()
|
||||
this.flag = false
|
||||
@@ -492,7 +564,7 @@ export default {
|
||||
uni.$emit('update')
|
||||
this.$toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
uni.reLaunch({url:'./AppReturnHomeRegister'})
|
||||
}, 400)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -76,6 +76,7 @@ export default {
|
||||
getList() {
|
||||
this.$instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, {
|
||||
params: {
|
||||
createUserId: this.user.id,
|
||||
infoType: '1',
|
||||
current: this.current,
|
||||
size: 10,
|
||||
|
||||
Reference in New Issue
Block a user