riskLevel

This commit is contained in:
shijingjing
2022-09-27 16:20:06 +08:00
parent f5c4734430
commit 63a116bc65

View File

@@ -99,9 +99,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>
@@ -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',