|
@@ -0,0 +1,484 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <common @asynCallBack="asynCallBack"></common>
|
|
|
+
|
|
|
+ <div class="mui-content vongi-fx">
|
|
|
+ <div class="mui-content-padded">
|
|
|
+ <h1 class="mui-text-center color4fc5f7">返乡人员登记</h1>
|
|
|
+ <p>目前,疫情防控形势仍严峻复杂,您家或亲戚朋友家有亲人欲返荆过春节,请您尽量劝其减少流动风险、留在原地过春节。请您出行一定记得戴口罩、与他人保持安全距离(- 米以上)
|
|
|
+ :非必要不出境、不去国内中、高风险区域若邻居家有外地返荆人员,请帮忙提醒他与社区联系报备。请您记住:少聚集、少聚餐、勤洗手、红事缓办、白事简办,聚会不办。
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <form class="mui-input-group vongi-editme">
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label><i class="colorfe616c">*</i> 您的姓名</label>
|
|
|
+ <input v-model="subForm.name" name="name" type="text" class="mui-input-clear" placeholder="请填写您的姓名" autocomplete="off">
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label><i class="colorfe616c">*</i> 身份证号码</label>
|
|
|
+ <input v-model="subForm.idCard" name="idCard" type="text" class="mui-input-clear" placeholder="请填写身份证号码 "
|
|
|
+ autocomplete="off" maxlength="18">
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label><i class="colorfe616c">*</i> 手机号码</label>
|
|
|
+ <input v-model="subForm.phone" name="phone" type="number" maxlength="11" class="mui-input-clear" placeholder="请输入手机号码 "
|
|
|
+ autocomplete="off">
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row vongi-fx-yzm">
|
|
|
+ <label><i class="colorfe616c">*</i> 验证码</label>
|
|
|
+ <input v-model="subForm.code" name="code" type="text" class="mui-input-clear" placeholder="请填写验证码 " autocomplete="off">
|
|
|
+ <a @click="sendMsg" v-text="sendMsgWz"></a>
|
|
|
+ </div>
|
|
|
+ <div @click="selectLiveRegionId" class="mui-input-row">
|
|
|
+ <label style="width:50%"><i class="colorfe616c">*</i> 居住所在地</label>
|
|
|
+ <button v-text="liveRegionIdName" class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:50%">
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label style="width:100%"><i class="colorfe616c">*</i> 详细地址</label>
|
|
|
+ <textarea v-model="subForm.liveDetailAddress" name="liveDetailAddress" rows="2" placeholder="请填写详细地址信息"
|
|
|
+ autocomplete="off"></textarea>
|
|
|
+ </div>
|
|
|
+ <div @click="selectOriginId" class="mui-input-row">
|
|
|
+ <label><i class="colorfe616c">*</i> 始发地</label>
|
|
|
+ <button v-text="originIdName" class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:65%">
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label style="width:100%"><i class="colorfe616c">*</i> 始发地详细地址</label>
|
|
|
+ <textarea v-model="subForm.originDetailAddress" name="originDetailAddress" rows="2" placeholder="请填写始发地详细地址"
|
|
|
+ autocomplete="off"></textarea>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label><i class="colorfe616c">*</i> 途径地</label>
|
|
|
+ <textarea v-model="subForm.avenuePlace" name="avenuePlace" rows="2" placeholder="请填写详细途径地信息" autocomplete="off"></textarea>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label style="width:100%"><i class="colorfe616c">*</i> 返乡乘坐(或使用)交通工具情况(飞机航班、动车车次、汽车车牌号)</label>
|
|
|
+ <textarea v-model="subForm.vehicle" name="vehicle" rows="2" placeholder="请填写详细返乡交通工具信息" autocomplete="off"></textarea>
|
|
|
+ </div>
|
|
|
+ <div @click="selectDate" class="mui-input-row">
|
|
|
+ <label style="width:60%"><i class="colorfe616c">*</i> 返乡时间(已到/预计)</label>
|
|
|
+ <button v-text="subForm.arriveTime?subForm.arriveTime:'请选择'" class="mui-btn mui-btn-block mui-navigate-right" type='button'
|
|
|
+ style="width:40%"></button>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row vongi-fx-yzm">
|
|
|
+ <label style="width:70%;padding:11px 0 11px 15px"><i class="colorfe616c">*</i> 是否有7日内核酸检测阴性证明</label>
|
|
|
+ <div class="mui-radio mui-left">
|
|
|
+ <label>是</label>
|
|
|
+ <input v-model="subForm.haveCheck" name="haveCheck" type="radio" value="true">
|
|
|
+ </div>
|
|
|
+ <div class="mui-radio mui-left" style="margin-right:15px">
|
|
|
+ <label>否</label>
|
|
|
+ <input v-model="subForm.haveCheck" name="haveCheck" type="radio" value="false">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label>备注</label>
|
|
|
+ <textarea v-model="subForm.remark" name="remark" rows="2" placeholder="可输入备注" autocomplete="off"></textarea>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label style="width:75%;padding:11px 0 11px 15px">如有7日内核酸检测报告请上传照片</label>
|
|
|
+ <button @click="chooseImage('checkImageUrl')" class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:25%">
|
|
|
+ <img v-if="subForm.checkImageUrl" :src="subForm.checkImageUrl" />
|
|
|
+ <span v-else>点击上传</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label style="width:50%">上传“行程卡”截图</label>
|
|
|
+ <button @click="chooseImage('travelImageUrl')" class="mui-btn mui-btn-block mui-navigate-right" type='button'
|
|
|
+ style="width:50%">
|
|
|
+ <img v-if="subForm.travelImageUrl" :src="subForm.travelImageUrl" />
|
|
|
+ <span v-else>点击上传</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="mui-input-row">
|
|
|
+ <label style="width:50%">上传本人健康码截图</label>
|
|
|
+ <button @click="chooseImage('healthCodeUrl')" class="mui-btn mui-btn-block mui-navigate-right" type='button' style="width:50%">
|
|
|
+ <img v-if="subForm.healthCodeUrl" :src="subForm.healthCodeUrl" />
|
|
|
+ <span v-else>点击上传</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ <div class="vongi-btn vongi-login-btn">
|
|
|
+ <button @click="submit" class="mui-btn mui-btn-primary" style="border-radius: 30px;">
|
|
|
+ 提交
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ require('$project/assets/js/mui.picker.min.js');
|
|
|
+ import * as API_WeiXin from '$project/apis/weixin'
|
|
|
+ import * as API_return from '@/apis/Other/return'
|
|
|
+ import Common from '$project/components/Common.vue'
|
|
|
+ import Loading from '$project/components/Loading.vue'
|
|
|
+ import TopHeader from '$project/components/TopHeader.vue'
|
|
|
+ import * as API_Common from '$project/apis/common'
|
|
|
+ import {
|
|
|
+ mapGetters,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex'
|
|
|
+ import {
|
|
|
+ checkPhone,
|
|
|
+ checkIdCard
|
|
|
+ } from '$project/utils'
|
|
|
+ import * as WxJsApi from '$project/utils/wxJsApi'
|
|
|
+ export default {
|
|
|
+ name: 'OtherReturnQuestionnaire',
|
|
|
+ components: {
|
|
|
+ Common,
|
|
|
+ Loading,
|
|
|
+ TopHeader
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isLoading: false,
|
|
|
+
|
|
|
+ //pageTitle: '填写问卷',
|
|
|
+
|
|
|
+ subForm: {
|
|
|
+ openId: '',
|
|
|
+ name: '',
|
|
|
+ idCard: '',
|
|
|
+ phone: '',
|
|
|
+ liveRegionId: '',
|
|
|
+ liveDetailAddress: '',
|
|
|
+ originId: '',
|
|
|
+ originDetailAddress: '',
|
|
|
+ avenuePlace: '',
|
|
|
+ vehicle: '',
|
|
|
+ arriveTime: '',
|
|
|
+ haveCheck: true,
|
|
|
+ code: '',
|
|
|
+ remark: '',
|
|
|
+ checkImageUrl: '',
|
|
|
+ travelImageUrl: '',
|
|
|
+ healthCodeUrl: '',
|
|
|
+ },
|
|
|
+
|
|
|
+ liveRegionIdCheckArr: [],
|
|
|
+ originIdCheckArr: [],
|
|
|
+
|
|
|
+
|
|
|
+ sendMsgWz: '发送验证码',
|
|
|
+
|
|
|
+ liveRegionIdList: [],
|
|
|
+ originIdList: [],
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ //选择时间
|
|
|
+ selectDate() {
|
|
|
+ var _this = this;
|
|
|
+ var picker = new mui.DtPicker({
|
|
|
+ "type": "date",
|
|
|
+ "beginYear": new Date().getFullYear(),
|
|
|
+ "endYear": 2021,
|
|
|
+ "startDate": new Date(),
|
|
|
+ "value": _this.subForm.arriveTime
|
|
|
+ });
|
|
|
+ picker.show(function(rs) {
|
|
|
+ _this.subForm.arriveTime = rs.text;
|
|
|
+ picker.dispose();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //微信选择图片
|
|
|
+ chooseImage(field) {
|
|
|
+ WxJsApi.chooseImage().then(res => {
|
|
|
+ var localData = res.localData;
|
|
|
+
|
|
|
+ if (localData.indexOf('data:image') != 0) {
|
|
|
+ //判断是否有这样的头部
|
|
|
+ localData = 'data:image/jpeg;base64,' + localData
|
|
|
+ }
|
|
|
+ localData = localData.replace(/\r|\n/g, '').replace('data:image/jgp', 'data:image/jpeg')
|
|
|
+ this.imgBase64 = localData;
|
|
|
+
|
|
|
+ this.uploadpic(field);
|
|
|
+ }).catch(error => {
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //上传图片
|
|
|
+ uploadpic(field) {
|
|
|
+ this.isLoading = true;
|
|
|
+ WxJsApi.uploadPic(this.imgBase64).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ this.subForm[field] = response;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //发送验证码检测手机号
|
|
|
+ checkPhone() {
|
|
|
+ let phoneResult = checkPhone(this.subForm.phone);
|
|
|
+ if (typeof phoneResult == 'string') {
|
|
|
+ mui.toast(phoneResult);
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //发送验证码
|
|
|
+ sendMsg() {
|
|
|
+ if (this.checkPhone()) {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_Common.sendMsg({
|
|
|
+ telephone: this.subForm.phone,
|
|
|
+ }).then(response => {
|
|
|
+ //倒计时
|
|
|
+ this.msgTimeInterval();
|
|
|
+ this.isLoading = false;
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //倒计时
|
|
|
+ msgTimeInterval() {
|
|
|
+ var time = 60;
|
|
|
+ var _this = this;
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (time > 0) {
|
|
|
+ _this.sendMsgWz = time-- + '秒';
|
|
|
+ } else {
|
|
|
+ _this.isSendMsg = true;
|
|
|
+ _this.sendMsgWz = '发送验证码';
|
|
|
+ clearInterval(_this.timer)
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+ //获取地区列表
|
|
|
+ getregionList(name, fun) {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_return.regionList(name).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ fun(response.list)
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //检测表单
|
|
|
+ checkForm() {
|
|
|
+ let phoneResult = checkPhone(this.subForm.phone);
|
|
|
+ let idCardResult = checkIdCard(this.subForm.idCard);
|
|
|
+ if (!this.subForm.openId) {
|
|
|
+ mui.toast('未获取您的微信授权');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.name) {
|
|
|
+ mui.toast('请输入姓名');
|
|
|
+ return false;
|
|
|
+ } else if (typeof idCardResult == 'string') {
|
|
|
+ mui.toast(idCardResult);
|
|
|
+ return false;
|
|
|
+ } else if (typeof phoneResult == 'string') {
|
|
|
+ mui.toast(phoneResult);
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.code) {
|
|
|
+ mui.toast('请输入手机验证码');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.liveRegionId) {
|
|
|
+ mui.toast('请选择居住所在地');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.liveDetailAddress) {
|
|
|
+ mui.toast('请填写居住所在地详情地址');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.originId) {
|
|
|
+ mui.toast('请选择始发地');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.originDetailAddress) {
|
|
|
+ mui.toast('请填写始发地详情地址');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.avenuePlace) {
|
|
|
+ mui.toast('请填写途经地');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.vehicle) {
|
|
|
+ mui.toast('请填写返乡乘坐(或使用)交通工具情况');
|
|
|
+ return false;
|
|
|
+ } else if (!this.subForm.arriveTime) {
|
|
|
+ mui.toast('请选择返乡时间');
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ submit() {
|
|
|
+ if (this.checkForm()) {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_return.submitReturnInfo(this.subForm).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ mui.toast('提交成功');
|
|
|
+ this.getInfo();
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取详情
|
|
|
+ getInfo() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API_return.returnInfoDetail(this.subForm.openId).then(response => {
|
|
|
+ this.isLoading = false;
|
|
|
+
|
|
|
+ if (response) {
|
|
|
+ for (let key in this.subForm) {
|
|
|
+ if (response[key]) {
|
|
|
+ this.$set(this.subForm, key, response[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ this.isLoading = false;
|
|
|
+ mui.toast(error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //选择居住地
|
|
|
+ selectLiveRegionId() {
|
|
|
+ var _this = this;
|
|
|
+ var picker = new mui.PopPicker({
|
|
|
+ layer: 3
|
|
|
+ });
|
|
|
+ picker.setData(this.liveRegionIdList);
|
|
|
+
|
|
|
+ //多级筛选设置默认值
|
|
|
+ picker.pickers[0].setSelectedValue(this.liveRegionIdCheckArr[0], 0, function() {
|
|
|
+ setTimeout(function() {
|
|
|
+ picker.pickers[1].setSelectedValue(_this.liveRegionIdCheckArr[1], 0, function() {
|
|
|
+ setTimeout(function() {
|
|
|
+ picker.pickers[2].setSelectedValue(_this.liveRegionIdCheckArr[2]);
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
+ picker.show(function(selectItems) {
|
|
|
+ //重置数据集
|
|
|
+ _this.liveRegionIdCheckArr = [];
|
|
|
+ for (var i = 0; i < 3; i++) {
|
|
|
+ if (selectItems[i].value) {
|
|
|
+ _this.liveRegionIdCheckArr.push(selectItems[i].value);
|
|
|
+ _this.subForm.liveRegionId = selectItems[i].value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //选择始发地
|
|
|
+ selectOriginId() {
|
|
|
+ var _this = this;
|
|
|
+ var picker = new mui.PopPicker({
|
|
|
+ layer: 3
|
|
|
+ });
|
|
|
+ picker.setData(this.originIdList);
|
|
|
+
|
|
|
+ //多级筛选设置默认值
|
|
|
+ picker.pickers[0].setSelectedValue(this.originIdCheckArr[0], 0, function() {
|
|
|
+ setTimeout(function() {
|
|
|
+ picker.pickers[1].setSelectedValue(_this.originIdCheckArr[1], 0, function() {
|
|
|
+ setTimeout(function() {
|
|
|
+ picker.pickers[2].setSelectedValue(_this.originIdCheckArr[2]);
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ });
|
|
|
+
|
|
|
+ picker.show(function(selectItems) {
|
|
|
+ //重置数据集
|
|
|
+ _this.originIdCheckArr = [];
|
|
|
+ for (var i = 0; i < 3; i++) {
|
|
|
+ if (selectItems[i].value) {
|
|
|
+ _this.originIdCheckArr.push(selectItems[i].value);
|
|
|
+ _this.subForm.originId = selectItems[i].value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ asynCallBack() {
|
|
|
+ //赋值
|
|
|
+ this.subForm.openId = this.openId;
|
|
|
+ //获取详情
|
|
|
+ this.getInfo();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ //获取微信配置
|
|
|
+ WxJsApi.getWxConfig();
|
|
|
+ var _this = this;
|
|
|
+ //获取居住地
|
|
|
+ this.getregionList('1', function(list) {
|
|
|
+ _this.liveRegionIdList = list;
|
|
|
+ })
|
|
|
+ //获取始发地
|
|
|
+ this.getregionList('2', function(list) {
|
|
|
+ _this.originIdList = list;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ destroyed() {},
|
|
|
+ computed: {
|
|
|
+ liveRegionIdName: function() {
|
|
|
+ for (var i = 0; i < this.liveRegionIdList.length; i++) {
|
|
|
+ if (this.liveRegionIdList[i]['value'] == this.subForm.liveRegionId) {
|
|
|
+ return this.liveRegionIdList[i]['text'];
|
|
|
+ }
|
|
|
+ for (var j = 0; j < this.liveRegionIdList[i]['children'].length; j++) {
|
|
|
+ if (this.liveRegionIdList[i]['children'][j]['value'] == this.subForm.liveRegionId) {
|
|
|
+ return this.liveRegionIdList[i]['children'][j]['text'];
|
|
|
+ }
|
|
|
+ for (var s = 0; s < this.liveRegionIdList[i]['children'][j]['children'].length; s++) {
|
|
|
+ if (this.liveRegionIdList[i]['children'][j]['children'][s]['value'] == this.subForm.liveRegionId) {
|
|
|
+ return this.liveRegionIdList[i]['children'][j]['children'][s]['text'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '点击选择';
|
|
|
+ },
|
|
|
+ originIdName: function() {
|
|
|
+ for (var i = 0; i < this.originIdList.length; i++) {
|
|
|
+ if (this.originIdList[i]['value'] == this.subForm.originId) {
|
|
|
+ return this.originIdList[i]['text'];
|
|
|
+ }
|
|
|
+ for (var j = 0; j < this.originIdList[i]['children'].length; j++) {
|
|
|
+ if (this.originIdList[i]['children'][j]['value'] == this.subForm.originId) {
|
|
|
+ return this.originIdList[i]['children'][j]['text'];
|
|
|
+ }
|
|
|
+ for (var s = 0; s < this.originIdList[i]['children'][j]['children'].length; s++) {
|
|
|
+ if (this.originIdList[i]['children'][j]['children'][s]['value'] == this.subForm.originId) {
|
|
|
+ return this.originIdList[i]['children'][j]['children'][s]['text'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return '点击选择';
|
|
|
+ },
|
|
|
+ ...mapGetters({
|
|
|
+ openId: 'wx_openid',
|
|
|
+ token: 'token',
|
|
|
+ person_data: 'person_data',
|
|
|
+ person_popedom: 'person_popedom',
|
|
|
+ menu_list: 'menu_list',
|
|
|
+ common_menu_list: 'common_menu_list',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
|
+<style src="$project/assets/css/iconfont.css"></style>
|
|
|
+<style src="$project/assets/css/mui.picker.min.css"></style>
|
|
|
+<style>
|
|
|
+</style>
|