hz-zhhq-app/pages/epidemic/travel-check.vue

896 lines
24 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="hzIndex">
<hzHeader title="涉疫排查"></hzHeader>
<!-- <view class="banner-box">
<image src="/static/images//epidemic//sypc-banner.png" mode=""></image>
</view> -->
<view class="hzContent">
<view class="main">
<view class="tab-box">
<view class="tab-item" :class="currentTabIndex == 0 ? 'active' : ''" @click="currentTabIndex = 0">涉疫排查<view class="activeLine" v-if="currentTabIndex == 0"></view></view>
<view class="tab-item" :class="currentTabIndex == 1 ? 'active' : ''" @click="currentTabIndex = 1">排查记录<view class="activeLine" v-if="currentTabIndex == 1"></view></view>
</view>
</view>
<view class="content" v-if="currentTabIndex == 0">
<view class="interviewee">
<view v-if="themeList[0]" class="form-box" style="border-radius: 10upx;">
<view style="padding: 20upx 0px 20upx 20upx;">
<view style='font-size: 30upx;font-weight: 600;'>{{themeList[0].TITLE}}</view>
<view style='font-size: 26upx;color: #666;padding-top: 14upx;'>{{themeList[0].SUBTITLE}}</view>
</view>
</view>
<view class="form-box" style="border-radius: 10upx;margin-top: 20upx;">
<view class="form-item" >
<text class="label">姓  名:</text>
<view class="ipt-box"><input class="top-t" v-model="formData.userName" placeholder="请输入姓名" type="text" maxlength="50" disabled="true" /></view>
</view>
<view class="form-item" >
<text class="label">联系方式:</text>
<view class="ipt-box"><input class="top-t" v-model="formData.phone" placeholder="请输入联系方式" type="text" maxlength="50" disabled="true" /></view>
</view>
<view class="form-item" >
<text class="label">部  门:</text>
<view class="ipt-box"><input class="top-t" v-model="formData.orgName" placeholder="请输入部门" type="text" maxlength="50" disabled="true" /></view>
</view>
</view>
<view class="form-box-ud" style="border-radius: 10upx;margin-top: 20upx;">
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>1.用工类型</text>
<view class="ipt-box">
<!-- <image class="arrow" src="/static/icons/right-arrow.png" mode=""></image>
<picker class="picker" v-if="genders.length > 0" :range="genders" @change="changeGenders" range-key="name">
<view>{{ genders[gendersIndex].name }}</view>
</picker> -->
<radio-group @change="changeRadioGroup($event,'userType')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in userType" :key="item.id" >
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label" ><text style="color: red;">*</text>2.居住地址</text>
<view class="ipt-box">
<input class="top-t" v-model="formData.address" placeholder="请输入省市区+详细地址" type="text" maxlength="50" />
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>3.目前状态</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'currentStatus')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in currentStatus" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>4.健康状况</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'healthStatus')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in healthStatus" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>5.健康码颜色</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'healthCodeColor')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in healthCodeColor" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>6.涉疫情况</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'involvedStatus')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in involvedStatus" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>7.是否向社区报备</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'isReport')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in isReport" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>8.是否已接种新冠疫苗</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'isVaccination')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in isVaccination" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>9.最近一次核酸检测结果时间</text>
<view class="ipt-box ">
<uni-datetime-picker v-model="formData.testingTime" type="date" />
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>10.同住人员涉疫情况</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'cohabitantInvolvedStatus')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in involvedStatus" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;" v-if="formData.cohabitantInvolvedStatus!='无'">*</text>10.同住人员目前状态</text>
<view class="ipt-box ">
<radio-group @change="changeRadioGroup($event,'cohabitantStatus')" >
<label class="uni-list-cell uni-list-cell-pd radio-group" v-for="(item, index) in currentStatus" :key="item.id">
<view>
<radio color="#4db4ea" :value="item.id" />
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
</view>
</view>
<view class="occupied"></view>
<view class="footer-btn" @click="submit"><view class="btn">提交</view></view>
</view>
<!-- 检查列表 -->
<view v-if="currentTabIndex == 1">
<view class="list-content" v-if="reportList.length > 0">
<view class="details" v-for="(item, i) in reportList" :key="i" >
<view class="detail_header" @click="details(item)">
<!-- <text class="blueSign"></text> -->
<image src="/static/img/travelIcon.png" mode="" style="width: 35upx;height: 40upx;margin-left: 20upx;vertical-align: middle;"></image>
<text class="font-tilte">{{item.TITLE}}</text>
</view>
<view class="detail_msg">
<view class="info-item" @click="details(item)">
<text>提交时间:</text>
<text class="infoSpan">{{ formatDate(item.GMT_CREATED,'dateTime')}}</text>
</view>
<!-- <view class="info-item" style="width: 100%;text-align: center;" @click="details(item)">
<text style="width: 100%;color: #4db4ea;">点击查看详情</text>
</view> -->
</view>
</view>
</view>
<content-none v-else :padTop="20"></content-none>
</view>
<load-more v-if="currentTabIndex == 1" :loadingType="loadingType" :contentText="contentText"></load-more>
<!-- <view class="common-shade box box-center box-align-center" v-if="showAlert" @click="showAlert=false" >
<view style="background: white;height: 160upx;width: 100%;border-radius: 10upx 10upx 0upx 0upx;position: absolute;bottom: 0upx;">
<view @click="photo" style="border-bottom: 1px solid #000000; border-radius: 10upx 10upx 0upx 0upx; height: 80upx;line-height: 80upx;text-align: center;">
拍摄
</view>
<view @click="getImage" style="height: 80upx;line-height: 80upx;text-align: center;">
从相册选择
</view>
</view>
</view> -->
</view>
</view>
</template>
<script>
import { addEpidemicInfo ,epidemicPage,travelCheckThemeList} from '@/common/api.js';
import { callbackRequest,callbackRequestNoLoading, getStorage, alertTip, convertImgToBase64, formatDate,wxSdk } from '@/common/util.js';
import loadMore from '@/components/loadMore.vue';
import contentNone from '@/components/contentNone.vue';
import { pathToBase64 } from '@/js_sdk/mmmm-image-tools/index.js';
export default {
components: {
loadMore,
contentNone
},
data() {
return {
today:new Date().getTime(),
formatDate: formatDate,
//分页
page: 1,
pageSize: 10,
loadingType: 0, //0-loading前1-loading中2-没有更多了
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
},
currentTabIndex:0,
userType: [{ id: '正式职工', name: '正式职工' }, { id: '其他', name: '其他' }],
currentStatus: [{ id: '在岗', name: '在岗' }, { id: '居家隔离', name: '居家隔离' }, { id: '集中隔离', name: '集中隔离' }],
healthStatus:[{ id: '正常', name: '正常' }, { id: '有发热、咳嗽等症状', name: '有发热、咳嗽等症状' }],
healthCodeColor:[{ id: '绿码', name: '绿码'}, { id: '黄码', name: '黄码' }, { id: '红码', name: '红码' }],
involvedStatus:[{ id: '时空伴随者', name: '时空伴随者' }, { id: '次密接', name: '次密接' }, { id: '密接', name: '密接' }, { id: '无症状感染者', name: '无症状感染者' }, { id: '确诊', name: '确诊' },{ id: '无', name: '无' }],
isReport:[{ id: '是', name: '是' }, { id: '否', name: '否' }],
isVaccination:[{ id: '未接种', name: '未接种' }, { id: '已接种第二针', name: '已接种第二针' },{ id: '已接种第一针', name: '已接种第一针' }, { id: '已接种加强针', name: '已接种加强针' }],
travelTypes: [{ id: '因公', name: '因公' }, { id: '因私', name: '因私' }],//,{ id: '离婚', name: '离婚' }, { id: '丧偶', name: '丧偶' }
travelMethods:[{ id: '公共交通', name: '公共交通' }, { id: '自驾', name: '自驾' }],
formData:{
userId: getStorage('userInfo').userId,
userName: getStorage('userInfo').userName,
phone: getStorage('userInfo').telnumber,
orgId: getStorage('userInfo').department_id,
orgName: getStorage('userInfo').departmentName,
address:"",
currentStatus:"",
healthStatus:"",
healthCodeColor:"",
involvedStatus:"",
isReport:"",
isVaccination:"",
testingTime:"",
cohabitantInvolvedStatus:"",
cohabitantInterrelation:"",
cohabitantStatus:"",
userType:""
},
reportList:[],
imgs:[],
showAlert:false,
submitFlag:true,
themeList:[]
};
},
watch: {
currentTabIndex: function(newVal, oldVal) {
if (newVal ==1) {
this.page = 1;
this.loadingType = 0;
this.dataList();
}else{
}
}
},
onLoad(option) {
this.currentTabIndex = option.currentTabIndex || 0;
},
onShow() {
if (this.currentTabIndex == 0) {
this.travelCheckThemeList();
}else{
this.page = 1;
this.loadingType = 0;
this.dataList();
}
},
methods: {
travelCheckThemeList(){
let params = {
method: travelCheckThemeList,
data: {
userId: getStorage('userInfo').userId,
}
};
callbackRequest(params).then(res => {
res = res.data;
if (res.returnCode == 1) {
this.themeList = res.returnData;
} else {
alertTip(res.returnMsg);
}
});
},
changeRadioGroup(e,radioData){
this.formData[radioData] = e.detail.value;
console.log(this.formData);
// console.log(data);
},
dataList() {
let params = {
method: epidemicPage,
data: {
userId:getStorage('userInfo').userId,
pageNum: this.page,
pageSize: this.pageSize,
}
};
callbackRequest(params).then(res => {
res = res.data;
if (res.returnCode == 1) {
if (this.page == 1) {
this.reportList = res.returnData || [];
} else {
if (res.returnData.length > 0) {
this.reportList = this.reportList.concat(res.returnData);
this.loadingType = 0;
} else {
this.loadingType = 2;
}
}
} else {
alertTip(res.returnMsg);
}
});
},
submit() {
if(this.submitFlag){
this.submitFlag = false;
// if(typeof this.formData.travelDate != 'string'){
// this.formData.travelDate = this.formData.travelDate.join("|");
// }
if(!this.verificationForm()){
return false;
}
let params = {
method: addEpidemicInfo,
data: {
userId: getStorage('userInfo').userId,
userName: getStorage('userInfo').userName,
phone: getStorage('userInfo').telnumber,
orgId: getStorage('userInfo').department_id,
orgName: getStorage('userInfo').departmentName,
address:this.formData.address,
currentStatus:this.formData.currentStatus,
healthStatus:this.formData.healthStatus,
healthCodeColor:this.formData.healthCodeColor,
involvedStatus:this.formData.involvedStatus,
isReport:this.formData.isReport,
isVaccination:this.formData.isVaccination,
testingTime:this.formData.testingTime,
cohabitantInvolvedStatus:this.formData.cohabitantInvolvedStatus,
cohabitantInterrelation:this.formData.cohabitantInterrelation,
cohabitantStatus:this.formData.cohabitantStatus,
userType:this.formData.userType,
themeId:this.themeList[0].UUID
}
};
// let dates = [this.formData.travelDate[0],this.formData.travelDate[1]];
// dates.push(this.formData.travelDate);
// params.data.travelDate = dates.join("|");
callbackRequest(params).then(res => {
res = res.data;
if (res.returnCode == 1) {
this.submitFlag = true;
alertTip(res.returnMsg);
setTimeout(_ => {
this.currentTabIndex = 1;
}, 2000);
} else {
this.submitFlag = true;
alertTip(res.returnMsg);
}
});
}
},
verificationForm(){
// address:this.formData.address,
// currentStatus:this.formData.currentStatus,
// healthStatus:this.formData.healthStatus,
// healthCodeColor:this.formData.healthCodeColor,
// involvedStatus:this.formData.involvedStatus,
// isReport:this.formData.isReport,
// isVaccination:this.formData.isVaccination,
// testingTime:this.formData.testingTime,
// cohabitantInvolvedStatus:this.formData.cohabitantInvolvedStatus,
// cohabitantInterrelation:this.formData.cohabitantInterrelation,
// cohabitantStatus:this.formData.cohabitantStatus,
// userType:this.formData.userType
if(!this.formData.userType){
alertTip('请选择用工类型');
this.submitFlag = true;
return false;
}
if(!this.formData.address){
alertTip('请输入居住地址');
this.submitFlag = true;
return false;
}
if(!this.formData.currentStatus){
alertTip('请选择目前状态');
this.submitFlag = true;
return false;
}
if(!this.formData.healthStatus){
alertTip('请选择健康状况');
this.submitFlag = true;
return false;
}
if(!this.formData.healthCodeColor){
alertTip('请选择健康码颜色');
this.submitFlag = true;
return false;
}
if(!this.formData.involvedStatus){
alertTip('请选择涉疫情况');
this.submitFlag = true;
return false;
}
if(!this.formData.isReport){
alertTip('请选择是否向社区报备');
this.submitFlag = true;
return false;
}
if(!this.formData.isVaccination){
alertTip('请选择是否已接种新冠疫苗');
this.submitFlag = true;
return false;
}
if(!this.formData.testingTime){
alertTip('请选择最近一次核酸检测结果时间');
this.submitFlag = true;
return false;
}
if(!this.formData.cohabitantInvolvedStatus){
alertTip('请选择同住人员涉疫情况');
this.submitFlag = true;
return false;
}
if(this.formData.cohabitantInvolvedStatus!='无'&&!this.formData.cohabitantStatus){
alertTip('请选择同住人员目前状态');
this.submitFlag = true;
return false;
}
return true;
},
details: function(item) {
uni.navigateTo({
url: '/pages/epidemic/travel-check-detail?item=' + JSON.stringify(item)
});
},
changeTravelType(e){
this.formData.travelType = e.detail.value;
},
changeTravelMethod(e){
this.formData.travelMethod = e.detail.value;
if(e.detail.value=='自驾'){
this.formData.travelMethodInfo = '';
}
},
chooseImg() {
let chec = 0;
let sty = [];
let _this = this;
uni.showActionSheet({
itemList:['拍照','相册'],
success:function(resp){
chec = resp.tapIndex;
if (chec == 0) {
sty = ['camera']; //从相册相机选择
} else {
sty = ['album']; //从相册相机选择
}
uni.chooseImage({
count:1,
sizeType: ['compressed'],
sourceType: sty,
quality: 0.7,
success:function(res){
let resData = res.tempFilePaths;
for(let i=0;i<resData.length;i++){
uni.getImageInfo({
src: resData[i],
success: (path) => {
pathToBase64(path.path).then(base64 => {
if(_this.imgs.length<1){
_this.imgs.push(base64);
}
})
.catch(error => {
})
}
})
}
}
});
},
fail:function(resp){
console.log(resp.errMsg);
}
});
},
//删除图片
removeImg(index) {
this.imgs.splice(index, 1);
},
},
onReachBottom() {
if (this.loadingType !== 0 || this.currentTabIndex == 0) {
return;
}
this.loadingType = 1;
this.page = this.page + 1;
this.dataList();
},
};
</script>
<style lang="scss">
@import url('../../static/css/repair/malfunction-repair.css');
@import '@/static/css/common.scss';
.uni-textarea-textarea{
text-align:left
}
.nolist {
font-size: 30upx;
color: #797979;
text-align: center;
margin-top: 20upx;
}
// .container {
// position: relative;
// overflow: hidden;
// .banner-box {
// width: 100%;
// height: 240upx;
// position: absolute;
// top: 0;
// left: 0;
// image {
// width: 100%;
// height: 100%;
// }
// border-radius: 30upx;
// }
.main {
margin: 180upx 40upx 0;
position: relative;
z-index: 10;
.tab-box {
overflow: hidden;
// border-radius: 10upx 10upx 0 0;
// background: rgba(132, 149, 167, 0.8);
height: 80upx;
.tab-item {
float: left;
height: 70upx;
width: 30%;
font-size: 30upx;
// color: #e5f6ff;
// text-align: center;
line-height: 70upx;
}
.active {
// background: #fff;
color: #333;
border-radius: 10upx 10upx 0 0;
font-weight: bold;
}
.activeLine{
background: linear-gradient( 90deg, #50CBA1 0%, #06AEA6 100%), #5685F2;
border-radius: 10upx;
width: 80upx;
height: 10upx;
}
}
}
// }
.list-content {
font-size: 28upx;
margin: 20upx 40rpx;
.details {
background: white;
padding: 0 15upx 15upx;
border-radius: 15upx;
margin-bottom: 20upx;
.detail_header {
border-bottom: #f8f8f8 5upx solid;
height: 90upx;
line-height: 90upx;
// margin: 0;
// border-radius: 10upx;
.blueSign {
height: 28upx;
width: 5upx;
background: #00c277;
display: inline-block;
margin-left: 20upx;
vertical-align: middle;
}
.font-tilte {
font-weight: bold;
margin-left: 20upx;
vertical-align: middle;
}
}
.detail_msg {
margin-left: 20upx;
border-radius: 10upx;
overflow: hidden;
view {
height: 60upx;
line-height: 60upx;
}
.status {
position: absolute;
color: red;
margin-left: 580upx;
margin-top: -15upx;
}
}
}
}
.statusgr {
float: right;
margin-right: 30upx;
color: #00c277;
}
.statusred {
float: right;
margin-right: 30upx;
color: red;
}
.img-box {
overflow: hidden;
padding-top: 20rpx;
padding-bottom: 10rpx;
.img-item {
float: left;
width: 200upx;
height: 200upx;
border: 1px solid #ddd;
margin: 0 22rpx 20upx 0upx;
position: relative;
box-sizing: border-box;
.img {
display: block;
width: 100%;
height: 100%;
}
.remove-btn {
position: absolute;
top: -18upx;
right: -18upx;
width: 44upx;
height: 44upx;
z-index: 2;
}
}
.upload-btn {
.img {
width: 60upx;
height: 60upx;
margin: 70upx auto 0;
}
}
}
.detail_msg .info-item {
font-size: 28upx;
margin-right: 30upx;
text {
display: inline-block;
width: 140upx;
color: #999;
}
.infoSpan {
width: auto;
font-size: 28upx;
color: #999;
float: right;
}
}
.form-box {
background: #fff;
.form-item {
overflow: hidden;
border-bottom: 1px solid #eee;
padding: 30upx 20upx;
.label {
float: left;
width: 150upx;
font-size: 28upx;
color: #333;
font-weight: bold;
line-height: 50upx;
}
.ipt-box {
margin-left: 160upx;
input {
width: 100%;
height: 50upx;
line-height: 50upx;
font-size: 26upx;
color: #666;
}
}
.select {
.arrow {
float: right;
width: 16upx;
height: 29upx;
margin-top: 10upx;
}
.picker {
height: 50upx;
line-height: 50upx;
font-size: 26upx;
color: #666;
margin-left: 10upx;
}
}
}
}
.form-box-ud {
background: #fff;
.form-item {
overflow: hidden;
// border-bottom: 1px solid #eee;
padding: 30upx 20upx 10upx 20upx;
.label {
width: 150upx;
font-size: 28upx;
color: #333;
font-weight: bold;
line-height: 50upx;
}
.ipt-box {
margin-left: 40upx;
margin-top: 20upx;
input {
width: 100%;
height: 70upx;
line-height: 70upx;
font-size: 28upx;
color: #666;
border: 1px solid #e5e5e5;
padding-left: 20upx;
border-radius: 10upx;
// padding: 40upx 20upx;
}
.radio-group{
font-size: 26upx;
display: flex;
justify-content: flex-start;
align-items: center;
margin-right: 40upx;
min-width: 140upx;
margin-bottom: 20upx;
}
}
.select {
.arrow {
float: right;
width: 16upx;
height: 29upx;
margin-top: 10upx;
}
.picker {
height: 50upx;
line-height: 50upx;
font-size: 26upx;
color: #666;
margin-left: 10upx;
}
}
}
}
.comment-btn {
float: right;
font-size: 24upx;
border-radius: 10upx;
color: #fff;
// line-height: 30upx;
text-align: center;
min-width: 120upx;
margin-right: 30upx;
background-color: #00c277;
padding:0px 20upx
}
.common-shade{
position:fixed;
top:0;
left:0;
width:100%;
height:100vh;
background: rgba(0,0,0,0.7);
z-index:9999;
}
.box {
display: flex;
display: -webkit-flex;
}
.box-row-reverse {
flex-direction: row;
}
/*上下排列*/
.box-column {
flex-direction: column;
}
/*上下排列*/
.box-left {
justify-content: flex-start;
}
/*居右*/
.box-right {
justify-content: flex-end;
}
/*居左*/
.box-center {
justify-content: center;
}
/*居中*/
.box-between {
justify-content: space-between;
}
/*两端对齐*/
.box-align-center {
align-items: center;
}
.box-wrap {
flex-wrap: wrap;
}
</style>