改个名字

This commit is contained in:
shijingjing
2022-09-26 13:50:24 +08:00
parent e4a910e832
commit 48f58d5380
2 changed files with 109 additions and 63 deletions

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="AddGetway"> <div class="getewayAdd">
<div class="tips">请确保以下信息全部由本人填写本人对所填写内容的真实性和完整性负责</div> <div class="tips">请确保以下信息全部由本人填写本人对所填写内容的真实性和完整性负责</div>
<!-- 基本信息 --> <!-- 基本信息 -->
<div class="title">基本信息</div> <div class="title">基本信息</div>
@@ -11,7 +11,18 @@
<h2>卡口选择</h2> <h2>卡口选择</h2>
</div> </div>
<div class="form-item__right"> <div class="form-item__right">
<AiSelect v-model="form.gatewayId" :list="getwayData" class="select"></AiSelect> <AiSelect v-model="form.gatewayId" :list="getewayData" class="select"></AiSelect>
</div>
</div>
</div>
<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> </div>
</div> </div>
</div> </div>
@@ -37,17 +48,6 @@
</div> </div>
</div> </div>
</div> </div>
<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="20"/>
</div>
</div>
</div>
<div class="form-item"> <div class="form-item">
<div class="form-item__wrapper"> <div class="form-item__wrapper">
<div class="form-item__title"> <div class="form-item__title">
@@ -121,18 +121,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <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 dict="EP_travelType" v-model="form.travelType" class="select"></AiSelect>
</div>
</div>
</div> -->
<div class="form-item form-item__imgs"> <div class="form-item form-item__imgs">
<div class="form-item__wrapper"> <div class="form-item__wrapper">
<div class="form-item__title"> <div class="form-item__title">
@@ -140,7 +128,10 @@
<h2>出行方式</h2> <h2>出行方式</h2>
</div> </div>
<div class="form-item__right"> <div class="form-item__right">
<AiCheckbox style="width: 100%;" v-model="travelType" dict="EP_travelType"/> <!-- <AiCheckbox style="width: 100%;" v-model="travelType" dict="EP_travelType"/> -->
<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>
</div> </div>
</div> </div>
</div> </div>
@@ -347,7 +338,7 @@ export default {
contactPatients: '', contactPatients: '',
abnormalHealth: '', abnormalHealth: '',
abnormalType: '', abnormalType: '',
companionCount: '0', // companionCount: '', //
companionList: [], // companionList: [], //
riskLevel: '1', riskLevel: '1',
}, },
@@ -372,26 +363,13 @@ export default {
phone: '', phone: '',
}], }],
current: 1, current: 1,
getwayData: [], getewayData: [],
flag: false, flag: false,
travelType: [], // travelType: [], //
travelTypeDict: [],
} }
}, },
watch: {
startAreaId: {
handler(v){
if(v?.length) {
console.log(v);
this.getReskLevel(v)
}
},
deep: true,
immediate: true,
}
},
components: { components: {
NamePhone, NamePhone,
}, },
@@ -401,9 +379,15 @@ export default {
}, },
onLoad() { onLoad(o) {
if(o) {
this.form.id = o?.id;
this.form.gatewayId = o?.gatewayId
this.getInfo(o.id)
}
this.$areaId = this.user.$areaId this.$areaId = this.user.$areaId
this.getwayList() this.travelTypeDict = this.$dict.getDict('EP_travelType')
this.getewayList()
}, },
methods: { methods: {
@@ -426,14 +410,36 @@ export default {
this.form.arriveTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}` this.form.arriveTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}`
}, },
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)
}
this.$hideLoading()
})
},
// //
getwayList() { getewayList() {
this.$instance.post(`/app/appepidemicpreventiongateway/list`, null, { this.$instance.post(`/app/appepidemicpreventiongateway/list`, null, {
current: this.current, current: this.current,
size: 300, size: 300,
}).then(res => { }).then(res => {
if(res?.data) { if(res?.data) {
this.getwayData = res.data.records.map(item=> { this.getewayData = res.data.records.map(item=> {
return { return {
label: item.name, label: item.name,
value: item.id value: item.id
@@ -443,12 +449,25 @@ export default {
}) })
}, },
// idNumberChange(e) {
getReskLevel(id) { if(e.detail) {
this.$instance.post(`/app/appepidemicpreventionriskarea/queryAreaRiskLevel`,null, { this.getOwnerInfo(e.detail.value)
areaId: id, }
},
//
getOwnerInfo(idNumber) {
this.$instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, {
params: {
idNumber: idNumber,
current: this.current,
size: 10,
}
}).then(res => { }).then(res => {
console.log(res); if(res?.data) {
this.form.name = res.data.records?.[0].name
this.form.phone = res.data.records?.[0].phone
}
}) })
}, },
@@ -550,6 +569,17 @@ export default {
} }
} }
if (!this.form.companionCount) {
this.form.companionCount = 0
this.form.companionList = []
} else {
if(this.people.length != this.form.companionCount) {
this.$u.toast('请输入完整的同行人信息')
} else {
this.form.companionList = this.people
}
}
if (this.flag) return if (this.flag) return
this.flag = true this.flag = true
@@ -557,7 +587,6 @@ export default {
this.$instance.post(`/app/appepidemicpreventionregisterinfo/addOrUpdate`, { this.$instance.post(`/app/appepidemicpreventionregisterinfo/addOrUpdate`, {
...this.form, ...this.form,
travelType: this.travelType.toString(), travelType: this.travelType.toString(),
companionList: this.people,
startTime: this.form.startTime + ':00', startTime: this.form.startTime + ':00',
arriveTime: this.form.arriveTime + ':00', arriveTime: this.form.arriveTime + ':00',
}).then(res => { }).then(res => {
@@ -567,7 +596,7 @@ export default {
uni.$emit('update') uni.$emit('update')
this.$toast('提交成功') this.$toast('提交成功')
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.reLaunch({url:'./AppgetewayRegister'})
}, 400) }, 400)
} }
}) })
@@ -577,7 +606,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.AddGetway { .getewayAdd {
padding-bottom: 140px; padding-bottom: 140px;
.tips { .tips {
@@ -728,6 +757,28 @@ export default {
margin-right: 8px; margin-right: 8px;
color: #999999; color: #999999;
} }
.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;
}
}
} }
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="DetailGetway" v-if="pageShow"> <div class="getewayDetail" v-if="pageShow">
<div class="detail-header"> <div class="detail-header">
<h2>{{ info.name }}的返乡登记信息</h2> <h2>{{ info.name }}的返乡登记信息</h2>
<div class="item-info"> <div class="item-info">
@@ -186,7 +186,7 @@
</div> </div>
</div> </div>
<div class="btn-wrapper" v-if="info.handleType == 0"> <div class="btn-wrapper" v-if="info.handleType == 0">
<div class="btn" @click="toEdit" hover-class="text-hover">编辑</div> <div class="btn" @click="$linkTo(`./AddGetway?id=${info.id}`)" hover-class="text-hover">编辑</div>
</div> </div>
</div> </div>
</template> </template>
@@ -226,15 +226,10 @@ export default {
this.travelType = res.data.travelType?.split(',') this.travelType = res.data.travelType?.split(',')
this.pageShow = true this.pageShow = true
} }
this.$hideLoading() this.$hideLoading()
}) })
}, },
toEdit() {
console.log('编辑');
},
call(phone) { call(phone) {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone phoneNumber: phone
@@ -245,7 +240,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.DetailGetway { .getewayDetail {
padding-bottom: 150px; padding-bottom: 150px;
box-sizing: border-box; box-sizing: border-box;
@@ -357,7 +352,7 @@ export default {
} }
.companionList { .companionList {
padding: 16px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
u-table { u-table {