diff --git a/src/project/pingchang/AppGetewayRegister/getewayAdd.vue b/src/project/pingchang/AppGetewayRegister/getewayAdd.vue index fe8a743..c563c9c 100644 --- a/src/project/pingchang/AppGetewayRegister/getewayAdd.vue +++ b/src/project/pingchang/AppGetewayRegister/getewayAdd.vue @@ -99,9 +99,9 @@

出发地区

- +
- {{ form.startAreaName }} + {{ startAreaName }} 请选择
@@ -339,7 +339,7 @@ export default { abnormalType: '', companionCount: '', // 同行人数量 companionList: [], // 同行人集合 - riskLevel: '1', + riskLevel: '', }, isShowType: false, @@ -356,7 +356,6 @@ export default { dictList: [], arr: [], $areaId: '', - people: [{ name: '', phone: '', @@ -366,6 +365,8 @@ export default { flag: false, travelType: [], // 出行方式 travelTypeDict: [], + startAreaId: '', + startAreaName: '', } }, @@ -388,6 +389,16 @@ export default { this.getewayList() }, + watch: { + startAreaId: { + handler(v) { + if(v.length) { + this.getRiskLevel(v) + } + } + } + }, + methods: { addCountHandle() { this.people.push({ @@ -425,11 +436,22 @@ export default { 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) + this.startAreaId = res.data.startAreaId + this.arriveAreaName = res.data.startAreaName } this.$hideLoading() }) }, + // 获取风险等级 + getRiskLevel(areaId) { + this.$instance.post(`/app/appepidemicpreventionriskarea/queryAreaRiskLevel?areaId=${areaId}`).then(res=> { + if(res?.data) { + this.form.riskLevel = res.data + } + }) + }, + // 获取卡口列表 getewayList() { this.$instance.post(`/app/appepidemicpreventiongateway/list`, null, { @@ -507,11 +529,11 @@ export default { return this.$toast('出发时间不得晚于当前时间') } - if (!this.form.startAreaId) { + if (!this.startAreaId) { return this.$toast('请选择出发地区') } - if (this.form.startAreaId.substr(this.form.startAreaId.length - 3, 3) === '000') { + if (this.startAreaId.substr(this.startAreaId.length - 3, 3) === '000') { return this.$toast('出发地区必须选到村或社区') } @@ -584,6 +606,8 @@ export default { this.$loading() this.$instance.post(`/app/appepidemicpreventionregisterinfo/addOrUpdate`, { ...this.form, + startAreaId: this.startAreaId, + startAreaName: this.startAreaName, travelType: this.travelType.toString(), startTime: this.form.startTime + ':00', arriveTime: this.form.arriveTime + ':00',