From a703ed79c329ef81015827f16f1f0560b7ceb613 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Sun, 9 Oct 2022 11:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E4=B9=A1=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pingchang/AppReturnHomeRegister/Add.vue | 256 +++++++++++------- .../AppReturnHomeRegister.vue | 1 + 2 files changed, 165 insertions(+), 92 deletions(-) diff --git a/src/project/pingchang/AppReturnHomeRegister/Add.vue b/src/project/pingchang/AppReturnHomeRegister/Add.vue index 882b34d..71940f7 100644 --- a/src/project/pingchang/AppReturnHomeRegister/Add.vue +++ b/src/project/pingchang/AppReturnHomeRegister/Add.vue @@ -11,7 +11,7 @@

身份证号

- +
@@ -44,7 +44,7 @@

人员类别

- +
@@ -87,9 +87,9 @@

出发地区

- +
- {{ form.startAreaName }} + {{ startAreaName }} 请选择
@@ -125,7 +125,7 @@
- * +

车次/航班

@@ -136,7 +136,7 @@
- * +

行程描述

@@ -149,7 +149,7 @@
* -

抵平时间

+

预计抵平时间

@@ -169,7 +169,7 @@

抵平卡口

- +
@@ -193,7 +193,7 @@
- * +

返乡地址

@@ -213,7 +213,7 @@

是否有风险旅居史?

- +
@@ -224,9 +224,9 @@

风险地区

- +
- {{ form.startAreaName }} + {{ form.highRiskAreaName }} 请选择
@@ -241,7 +241,7 @@

近七日内是否接触新冠确诊或疑似患者?

- +
@@ -252,7 +252,7 @@

是否有健康异常情况?

- +
@@ -269,7 +269,6 @@
- @@ -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) } }) diff --git a/src/project/pingchang/AppReturnHomeRegister/AppReturnHomeRegister.vue b/src/project/pingchang/AppReturnHomeRegister/AppReturnHomeRegister.vue index a28e5a8..7fc2184 100644 --- a/src/project/pingchang/AppReturnHomeRegister/AppReturnHomeRegister.vue +++ b/src/project/pingchang/AppReturnHomeRegister/AppReturnHomeRegister.vue @@ -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,