This commit is contained in:
shijing 2022-10-27 16:31:45 +08:00
parent 4cf6e44ffa
commit be7db35cc3
1 changed files with 78 additions and 26 deletions

View File

@ -8,14 +8,14 @@
<view class="content"></view>
</view>
<view class="item item_bottom_border">
<view class="title">访客</view>
<view class="title"><text class="star">*</text>访客</view>
<view class="content">
<uni-data-select name="visitor" :localdata="userRange" v-model="formData.visitor">
</uni-data-select>
</view>
</view>
<view class="item item_bottom_border">
<view class="title">返乡时间</view>
<view class="title"><text class="star">*</text>返乡时间</view>
<view class="content">
<uni-datetime-picker
v-model="formData.return_date"
@ -25,26 +25,26 @@
</view>
</view>
<view class="item item_bottom_border">
<view class="title">来源地</view>
<view class="title"><text class="star">*</text>来源地</view>
<view class="content">
<input type="text" v-model="formData.come_place" maxlength="20" placeholder="请输入来源地" />
</view>
</view>
<view class="item item_bottom_border">
<view class="title">行程轨迹</view>
<view class="title"><text class="star">*</text>行程轨迹</view>
<view class="content">
<input type="text" v-model="formData.trip_desc" maxlength="20" placeholder="请输入行程轨迹" />
</view>
</view>
<view class="item item_bottom_border">
<view class="title">管控措施</view>
<view class="title"><text class="star">*</text>管控措施</view>
<view class="content">
<uni-data-select name="measure" :localdata="measureRange" v-model="formData.measure">
</uni-data-select>
</view>
</view>
<view class="item item_bottom_border">
<view class="title">核酸检测日期</view>
<view class="title"><text class="star">*</text>核酸日期</view>
<view class="content">
<uni-datetime-picker
v-model="formData.test_date"
@ -54,33 +54,33 @@
</view>
</view>
<view class="item item_bottom_border">
<view class="title">是否报备</view>
<view class="title"><text class="star">*</text>是否报备</view>
<view class="content">
<u-switch v-model="formData.is_reported"></u-switch>
</view>
</view>
<view class="item item_bottom_border">
<view class="title">是否主访客</view>
<view class="title"><text class="star">*</text>是否主访客</view>
<view class="content">
<u-switch v-model="formData.is_main"></u-switch>
</view>
</view>
<view class="item item_bottom_border" style="height: fit-content;">
<view class="title">健康码</view>
<view class="title"><text class="star">*</text>健康码</view>
<view style="flex: 3;">
<u-upload :action="vuex_apifile" :header="header" ref="uUpload" max-count="1" @on-success="imgUpdataHealth"></u-upload>
<!-- <imgUpload :count="1" :header="header" :url="vuex_apifile" @obtain_img="imgUpdataHealth" :list="healthFileList"></imgUpload> -->
</view>
</view>
<view class="item item_bottom_border" style="height: fit-content;">
<view class="title">行程码</view>
<view class="title"><text class="star">*</text>行程码</view>
<view style="flex: 3;">
<u-upload :action="vuex_apifile" :header="header" ref="uUpload" max-count="1" @on-success="imgUpdataTravel"></u-upload>
<!-- <imgUpload :count="1" :header="header" :url="vuex_apifile" @obtain_img="imgUpdataTravel" :list="travelFileList"></imgUpload> -->
</view>
</view>
<view class="item item_bottom_border" style="height: fit-content;">
<view class="title">核酸报告</view>
<view class="title"><text class="star">*</text>核酸报告</view>
<view style="flex: 3;">
<u-upload :action="vuex_apifile" :header="header" ref="uUpload" max-count="1" @on-success="imgUpdataReport"></u-upload>
<!-- <imgUpload :count="1" :header="header" :url="vuex_apifile" @obtain_img="imgUpdataReport" :list="reportFileList"></imgUpload> -->
@ -146,11 +146,6 @@
this.getUserRange();
},
methods: {
getHeader() {
this.header = {
Authorization: "Bearer " + this.vuex_token
}
},
getHeader() {
this.header = {
Authorization: "Bearer " + this.vuex_token
@ -165,9 +160,6 @@
imgUpdataReport(data){
this.formData.test_report = data.path;
},
/* imgUpdataReport(data){
this.formData.test_report = data[0];
}, */
//
getUserRange() {
let that = this;
@ -196,18 +188,78 @@
})
return false;
}
if (!nonNullCheck(this.formData.return_date)) {
uni.showToast({
title: '请选择返乡时间',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.come_place)) {
uni.showToast({
title: '请选择来源地',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.trip_desc)) {
uni.showToast({
title: '请选择行程轨迹',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.measure)) {
uni.showToast({
title: '请选择管控措施',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.test_date)) {
uni.showToast({
title: '请选择核酸日期',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.health_code)) {
uni.showToast({
title: '请上传健康码',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.travel_code)) {
uni.showToast({
title: '请上传行程码',
icon: "none"
})
return false;
}
if (!nonNullCheck(this.formData.test_report)) {
uni.showToast({
title: '请上传核酸报告',
icon: "none"
})
return false;
}
return true;
},
formSubmit(val) {
let that = this;
that.$u.api.vpeopleCreate(that.formData).then(res => {
if (res.err_msg) {} else {
uni.navigateBack({
delta: 1
})
}
})
if (!that.paramsCheck()) {
return;
} else {
that.$u.api.vpeopleCreate(that.formData).then(res => {
if (res.err_msg) {} else {
uni.navigateBack({
delta: 1
})
}
})
}
},
goBack() {
uni.navigateBack({