|
|
@ -47,7 +47,7 @@ |
|
|
|
<input name="input" placeholder="请输入就诊医院" type="text" v-model="hospital" /> |
|
|
|
</view> |
|
|
|
<view class="cu-form-group flex flex-direction padding-top"> |
|
|
|
<view class="title padding-bottom-sm">最近14天是否有武汉居住史、旅游史或武汉亲戚来访</view> |
|
|
|
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>最近14天是否有武汉居住史、旅游史或武汉亲戚来访</view> |
|
|
|
<radio-group @change="TourChange" class="block"> |
|
|
|
<view class="flex"> |
|
|
|
<view :key="index" class="flex-sub margin-tb-sm" v-for="(tour,index) in tours"> |
|
|
@ -65,7 +65,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-top"> |
|
|
|
<view class="title padding-bottom-sm">最近14天是否有新冠肺炎患者或疑似患者接触史</view> |
|
|
|
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>最近14天是否有新冠肺炎患者或疑似患者接触史</view> |
|
|
|
<radio-group @change="TouchChange" class="block"> |
|
|
|
<view class="flex"> |
|
|
|
<view :key="index" class="flex-sub margin-tb-sm" v-for="(touch,index) in touches"> |
|
|
@ -81,14 +81,71 @@ |
|
|
|
</view> |
|
|
|
</radio-group> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-top"> |
|
|
|
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>最近14天有无接触过近期境外返回人员</view> |
|
|
|
<radio-group class="block" @change="TouchOverseasChange"> |
|
|
|
<view class="flex"> |
|
|
|
<view class="flex-sub margin-tb-sm" v-for="(touch,index) in overseas" :key="index"> |
|
|
|
<label class="flex justify-between align-center"> |
|
|
|
<radio class="round margin-right-xs" :checked="index === touchOverseas" :value="touch.value"></radio> |
|
|
|
<text class="flex-sub" style="font-size: 34rpx;">{{ touch.name }}</text> |
|
|
|
</label> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</radio-group> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-top"> |
|
|
|
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>是否在学校所在地</view> |
|
|
|
<radio-group class="block" @change="SchoolLocationChange"> |
|
|
|
<view class="flex"> |
|
|
|
<view class="flex-sub margin-tb-sm" v-for="(location,index) in locations" :key="location.value"> |
|
|
|
<label class="flex justify-between align-center"> |
|
|
|
<radio class="round margin-right-xs" :checked="index === schoolLocation" :value="location.value"></radio> |
|
|
|
<text class="flex-sub" style="font-size: 34rpx;">{{ location.name }}</text> |
|
|
|
</label> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</radio-group> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
|
<view class="title padding-bottom-sm"> |
|
|
|
<span class="text-red padding-right-xs">*</span>当前体温(℃) |
|
|
|
</view> |
|
|
|
<input name="input" placeholder="请输入当前真实体温" type="digit" v-model="animalHeat" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
|
<view class="title padding-bottom-sm"><span class="text-red padding-right-xs">*</span>紧急联系人</view> |
|
|
|
<view class="flex"> |
|
|
|
<input placeholder="姓名" class="flex flex-sub" name="input" type="text" v-model="emergencyName"/> |
|
|
|
<input placeholder="联系方式" class="flex flex-sub" name="input" type="number" v-model="emergencyPhone"/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="cu-form-group flex flex-direction padding-tb"> |
|
|
|
<view class="title padding-bottom-sm">备注(选填)</view> |
|
|
|
<textarea placeholder="请填写具体情况..." name="input" v-model="remark"/> |
|
|
|
|
|
|
|
<!-- 上传图片 --> |
|
|
|
<view class="grid col-4 grid-square flex-sub"> |
|
|
|
<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]"> |
|
|
|
<image :src="imgList[index]" mode="aspectFill"></image> |
|
|
|
<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index"> |
|
|
|
<text class='cuIcon-close'></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="solids" @tap="ChooseImage" v-if="imgList.length<9"> |
|
|
|
<text class='cuIcon-cameraadd'></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</form> |
|
|
|
<user-agreement @changeIntentions="changeIntentions"></user-agreement> |
|
|
|
<user-agreement @changeIntentions="changeIntentions" @changeIntentions1="changeIntentions1" @changeIntentions2="changeIntentions2"></user-agreement> |
|
|
|
<button @tap="handleHealthSign" class="bg-cyan margin primary-btn" hover-class="cc-active">确认提交</button> |
|
|
|
<!-- 历史 --> |
|
|
|
<button |
|
|
@ -101,7 +158,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { showToast } from 'common/script/util'; |
|
|
|
import { HEALTH_SIGN } from 'api/api'; |
|
|
|
import { HEALTH_SIGN, HEALTH_FILE } from 'api/api'; |
|
|
|
import { mapState, mapMutations } from 'vuex'; |
|
|
|
|
|
|
|
export default { |
|
|
@ -131,11 +188,34 @@ export default { |
|
|
|
name: '是', |
|
|
|
}, |
|
|
|
], |
|
|
|
overseas: [{ |
|
|
|
value: '0', |
|
|
|
name: '无' |
|
|
|
}, { |
|
|
|
value: '1', |
|
|
|
name: '有' |
|
|
|
}], |
|
|
|
locations: [{ |
|
|
|
value: '0', |
|
|
|
name: '否' |
|
|
|
}, { |
|
|
|
value: '1', |
|
|
|
name: '是' |
|
|
|
}], |
|
|
|
animalHeat: 0, |
|
|
|
healthTypeId: 0, |
|
|
|
touchHubei: 0, |
|
|
|
touchSick: 0, |
|
|
|
touchOverseas: 0, |
|
|
|
schoolLocation: 0, |
|
|
|
emergencyName: '', |
|
|
|
emergencyPhone: '', |
|
|
|
remark: '', |
|
|
|
fileIdList: [], |
|
|
|
imgList: [], |
|
|
|
agree: false, |
|
|
|
agree1: false, |
|
|
|
agree2: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: mapState('user', ['token', 'status']), |
|
|
@ -156,6 +236,12 @@ export default { |
|
|
|
changeIntentions(data) { |
|
|
|
this.agree = data; |
|
|
|
}, |
|
|
|
changeIntentions1(data) { |
|
|
|
this.agree1 = data; |
|
|
|
}, |
|
|
|
changeIntentions2(data) { |
|
|
|
this.agree2 = data; |
|
|
|
}, |
|
|
|
|
|
|
|
// 状态 |
|
|
|
StateChange: function(evt) { |
|
|
@ -179,7 +265,6 @@ export default { |
|
|
|
|
|
|
|
// 接触 |
|
|
|
TouchChange(evt) { |
|
|
|
console.log(this.touches, 'aa'); |
|
|
|
for (let b = 0; b < this.touches.length; b++) { |
|
|
|
if (this.touches[b].value === evt.target.value) { |
|
|
|
this.touchSick = b; |
|
|
@ -188,6 +273,86 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 境外 |
|
|
|
TouchOverseasChange(evt) { |
|
|
|
for (let i = 0; i < this.overseas.length; i++) { |
|
|
|
if (this.overseas[i].value === evt.target.value) { |
|
|
|
this.touchOverseas = i; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 学校所在地 |
|
|
|
SchoolLocationChange(evt) { |
|
|
|
for (let i = 0; i < this.locations.length; i++) { |
|
|
|
if (this.locations[i].value === evt.target.value) { |
|
|
|
this.schoolLocation = i; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
ChooseImage() { |
|
|
|
uni.chooseImage({ |
|
|
|
count: 9, //默认9 |
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
|
|
|
sourceType: ['album'], //从相册选择 |
|
|
|
success: (res) => { |
|
|
|
if (this.imgList.length != 0) { |
|
|
|
this.imgList = this.imgList.concat(res.tempFilePaths) |
|
|
|
} else { |
|
|
|
this.imgList = res.tempFilePaths |
|
|
|
} |
|
|
|
uni.uploadFile({ |
|
|
|
url: `https://test.tall.wiki/gateway${HEALTH_FILE}`, |
|
|
|
filePath: res.tempFilePaths[0], |
|
|
|
fileType: 'image', |
|
|
|
name: 'file', |
|
|
|
success: (res) => { |
|
|
|
const resData = JSON.parse(res.data) |
|
|
|
const { |
|
|
|
success, |
|
|
|
code, |
|
|
|
msg, |
|
|
|
data |
|
|
|
} = resData; |
|
|
|
this.fileIdList.splice(-1,0,resData.data.fileId); |
|
|
|
uni.showToast({ |
|
|
|
title: '图片提交成功', |
|
|
|
duration: 1000, |
|
|
|
}); |
|
|
|
},fail: (err) => { |
|
|
|
uni.showModal({ |
|
|
|
content: err.errMsg, |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
ViewImage(e) { |
|
|
|
uni.previewImage({ |
|
|
|
urls: this.imgList, |
|
|
|
current: e.currentTarget.dataset.url |
|
|
|
}); |
|
|
|
}, |
|
|
|
DelImg(e) { |
|
|
|
uni.showModal({ |
|
|
|
title: '删除', |
|
|
|
content: '确定要删除这张图片吗?', |
|
|
|
cancelText: '再想想', |
|
|
|
confirmText: '再见', |
|
|
|
success: res => { |
|
|
|
if (res.confirm) { |
|
|
|
this.imgList.splice(e.currentTarget.dataset.index, 1) |
|
|
|
this.fileIdList.splice(e.currentTarget.dataset.index, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 申请健康码 |
|
|
|
*/ |
|
|
@ -204,6 +369,14 @@ export default { |
|
|
|
token, |
|
|
|
touchHubei, |
|
|
|
touchSick, |
|
|
|
touchOverseas, |
|
|
|
schoolLocation, |
|
|
|
emergencyName, |
|
|
|
emergencyPhone, |
|
|
|
remark, |
|
|
|
fileIdList, |
|
|
|
agree1, |
|
|
|
agree2, |
|
|
|
} = this; |
|
|
|
const params = { |
|
|
|
param: { |
|
|
@ -215,9 +388,16 @@ export default { |
|
|
|
token, |
|
|
|
touchHubei, |
|
|
|
touchSick, |
|
|
|
touchOverseas, |
|
|
|
schoolLocation, |
|
|
|
emergencyName, |
|
|
|
emergencyPhone, |
|
|
|
remark, |
|
|
|
fileIdList, |
|
|
|
healthAgreement: agree1 ? 1 : 0, |
|
|
|
selfFill: agree2 ? 1 : 0, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
const res = await this.$http.post(HEALTH_SIGN, params); |
|
|
|
const { success, code, msg, data } = res.data; |
|
|
|
if (success && code === 200) { |
|
|
@ -249,7 +429,7 @@ export default { |
|
|
|
|
|
|
|
// 验证信息 |
|
|
|
checkRules() { |
|
|
|
const { district, address, healthTypeId, animalHeat, agree } = this; |
|
|
|
const { district, address, healthTypeId, animalHeat,emergencyName,emergencyPhone, agree,agree1,agree2 } = this; |
|
|
|
if (!district || district === '请选择当前所在地区') { |
|
|
|
showToast('请选择当前所在地区'); |
|
|
|
return; |
|
|
@ -266,12 +446,37 @@ export default { |
|
|
|
showToast('请输入当前体温'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!emergencyName) { |
|
|
|
showToast('请输入紧急联系人姓名'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!this.verifyPhone(emergencyPhone)) { |
|
|
|
showToast('请输入正确的紧急联系人手机号'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!agree) { |
|
|
|
showToast('请选择是否同意《用户服务协议》和《隐私政策》'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!agree1) { |
|
|
|
showToast('请选择是否同意信息提交山西大学管理'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!agree2) { |
|
|
|
showToast('请确定是否为本人填写'); |
|
|
|
return; |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 验证手机号格式 |
|
|
|
* @param {string} phone 手机号 |
|
|
|
*/ |
|
|
|
verifyPhone(phone) { |
|
|
|
const phoneExg = /^1\d{10}$/; |
|
|
|
return phoneExg.test(phone); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|