Commit 8dac47b0 authored by 罗成兵's avatar 罗成兵

细节优化

parent 1c0c40dc
......@@ -4,8 +4,7 @@ import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{path: '/',redirect: '/provideUnit'},
{path: '/provideUnit',name: 'provideUnit',component: () => import('../views/provideUnit/provideUnit.vue'),meta: { keepAlive: true,}},
{path: '/',name: 'provideUnit',component: () => import('../views/provideUnit/provideUnit.vue'),meta: { keepAlive: true,}},
{path: '/receiveApply',name: 'receiveApply',component: () => import('../views/receiveApply/receiveApply.vue'),meta: { keepAlive: true, isBack: false,}},
{path: '/informedConsentForm',name: 'informedConsentForm',component: () => import('../views/informedConsentForm/informedConsentForm.vue'),},
{path: '/applyRecord',name: 'applyRecord',component: () => import('../views/applyRecord/applyRecord.vue'),meta: { keepAlive: true, isBack: false}},
......@@ -13,6 +12,8 @@ const routes = [
{path: '/receiveDetail',name: 'receiveDetail',component: () => import('../views/receiveDetail/receiveDetail.vue')},
{path: '/canvas',name: 'canvas',component: () => import('../views/canvas/canvas.vue')},
{path: '/questionAnswer',name: 'canvas',component: () => import('../views/questionAnswer/questionAnswer.vue')},
{path: '/test1',name: 'test1',component: () => import('../views/test/test1.vue')},
]
const router = new VueRouter({
......
......@@ -109,6 +109,7 @@
<br>
<br>
</div>
<br><br>
</div>
</div>
</template>
......
......@@ -23,11 +23,19 @@
</van-checkbox-group>
<p style="margin-left: 15%;color:#F5222D ">建议服用:{{ formData.recommendEat }}</p>
<br>
<van-button style="margin-left: 40px;width: 120px" round color="#EC808D" plain @click="onSubmit(1)">忽略
<div style="text-align: center">
<van-row>
<van-col span="12">
<van-button style="width: 150px" round color="#EC808D" plain @click="onSubmit(1)">忽略
</van-button>
<van-button style="margin-left: 20px;width: 160px" round type="danger" color="#EC808D" @click="onSubmit(2)">
</van-col>
<van-col span="12">
<van-button style="width: 150px" round type="danger" color="#EC808D" @click="onSubmit(2)">
提交问卷
</van-button>
</van-col>
</van-row>
</div>
</div>
</div>
</template>
......@@ -45,7 +53,10 @@ export default {
{value: "4", name: "4、您是否患有同型半胱氨酸血症?"},
{value: "5", name: "5、您是否患有先天性脑积水、先天性心脏病、唇腭裂、肢体缺陷、泌尿系统缺陷?"},
{value: "6", name: "6、您的一二级直系女性亲属是否有神经管缺陷生育史?"},
{value: "7", name: "7、您是否正在服用以下药物:卡马西平、丙戊酸、苯妥英钠、二甲双胍、扑米酮、苯巴比妥、甲氨蝶呤、柳氮磺胺吡啶、甲氧咔啶、氨苯蝶啶、考来烯胺?"},
{
value: "7",
name: "7、您是否正在服用以下药物:卡马西平、丙戊酸、苯妥英钠、二甲双胍、扑米酮、苯巴比妥、甲氨蝶呤、柳氮磺胺吡啶、甲氧咔啶、氨苯蝶啶、考来烯胺?"
},
{value: "8", name: "8、你是否患有胃肠道吸收不良?"}],
formData: {recommendEat: "2颗/天(0.8mg/天)"},
}
......@@ -94,7 +105,7 @@ export default {
},
onSubmit(type) {
if (type == 1) {
this.formData.question=null;
this.formData.question = null;
sessionStorage.setItem("lastRecord", JSON.stringify(this.formData));
this.$router.push('receiveApply');
return;
......
......@@ -89,7 +89,7 @@
</div>
<div class="item_box">
<span>*</span>
<van-field v-model.trim="formData.telephone" label="联系电话" placeholder="请输入联系电话"/>
<van-field type="number" v-model.trim="formData.telephone" label="联系电话" placeholder="请输入联系电话"/>
</div>
<div class="item_box">
<span>*</span>
......
<template>
<div>
<van-cascader
v-model="formData.presentCode"
title="请选择现住地址"
:options="optionsList"
@close="showPopup = false"
@change="areaChange"
@finish="areaFinish"
/>
</div>
</template>
<script>
import {addReceiveApply, getChildAreaByParentCode} from '@/axios/api'
export default {
name: "test1",
data() {
return {
// 表单信息 130102001001
formData: {
presentCode: '130104002000'
},
optionsList: [],
showPopup: false,
scrollPosition: 0,
applyUnitInfo: {unitName: ""},
birthDateShow: false,
minDate: new Date(1950, 0, 1),
maxDate: new Date(),
indexArr: []
}
},
created() {
let areaCodeList = [];
let areaCode = this.formData.presentCode;
let provinceCode = areaCode.substring(0, 2);
areaCodeList.push(provinceCode)
if (areaCode.length > 2) {
let cityCodeFull = areaCode.substring(0, 4) + "00000000";
areaCodeList.push(cityCodeFull)
let countyCodeFull, townshipCodeFull;
let level = 2;
if (areaCode.substring(2, 4) != '00') {
level = 3
countyCodeFull = areaCode.substring(0, 6) + "000000";
if (countyCodeFull != cityCodeFull) {
areaCodeList.push(countyCodeFull)
level = 4;
townshipCodeFull = areaCode.substring(0, 9) + "000";
if (countyCodeFull != townshipCodeFull) {
areaCodeList.push(townshipCodeFull)
}
if (areaCode != townshipCodeFull) {
areaCodeList.push(areaCode)
}
}
}
}
//let areaCodeList = [provinceCode, cityCodeFull, countyCodeFull, townshipCodeFull, villageCode];
this.initAa(areaCodeList)
// this.getChildArea(0, 0);
}
,
methods: {
areaChange(val) {
console.log(111, val)
console.log(222, this.formData.presentCode)
this.formData.presentName = val.selectedOptions.map((item) => item.text).join('/');
let indexArr = [];
val.selectedOptions.forEach(item => {
indexArr.push(item.index);
});
if (indexArr.length == 5) {
this.showPopup = false;
return;
}
// console.log(this.formData)
this.indexArr = indexArr;
this.getChildArea(val.value, val.areaLevel);
}
,
areaFinish(val) {
this.formData.presentName = val.selectedOptions.map((item) => item.text).join('/');
}
,
getChildArea(areaCode, areaLevel) {
getChildAreaByParentCode(areaCode).then(res => {
if (res.code === 'SUCCESS') {
let optionsList = [];
let areaList = res.data;
if (areaList != null) {
let index = 0;
let length = this.indexArr.length;
areaList.forEach(area => {
let item = {
text: area.areaName,
value: area.areaCode,
index: index,
areaLevel: area.areaLevel,
children: []
};
if (length == 4) {
delete item.children;
}
optionsList.push(item)
index++;
})
if (areaLevel == 0) {
this.optionsList = optionsList;
} else {
if (this.indexArr.length == 1) {
this.optionsList[this.indexArr[0]].children = optionsList;
}
if (this.indexArr.length == 2) {
this.optionsList[this.indexArr[0]].children[this.indexArr[1]].children = optionsList;
}
if (this.indexArr.length == 3) {
this.optionsList[this.indexArr[0]].children[this.indexArr[1]].children[this.indexArr[2]].children = optionsList;
}
if (this.indexArr.length == 4) {
this.optionsList[this.indexArr[0]].children[this.indexArr[1]].children[this.indexArr[2]].children[this.indexArr[3]].children = optionsList;
}
}
}
}
}).catch(res => {
})
},
initAa(areaCodeList) {
areaCodeList.unshift("0")
let number = 0
let code1 = areaCodeList[number++];
let length = areaCodeList.length;
let allList = []
if (!code1) return;
getChildAreaByParentCode(code1).then(res => {
let currentList = this.handleData(res.data, allList,length,number)
this.optionsList = currentList;
let code2 = areaCodeList[number++];
if (!code2) return;
getChildAreaByParentCode(code2).then(res => {
let currentList = this.handleData(res.data, allList,length,number)
this.findChildList(allList, code2, currentList)
let code3 = areaCodeList[number++];
if (!code3) return;
getChildAreaByParentCode(code3).then(res => {
let currentList = this.handleData(res.data, allList,length,number)
this.findChildList(allList, code3, currentList)
let code4 = areaCodeList[number++];
if (!code4) return;
getChildAreaByParentCode(code4).then(res => {
let currentList = this.handleData(res.data, allList,length,number)
this.findChildList(allList, code4, currentList)
let code5 = areaCodeList[number++];
if (!code5) return;
getChildAreaByParentCode(code5).then(res => {
let currentList = this.handleData(res.data, allList,length,number)
this.findChildList(allList, code5, currentList)
})
})
})
})
})
},
handleData(areaList, allList,length,number) {
let optionsList = [];
if (areaList != null) {
let index = 0;
areaList.forEach(area => {
let item = {
text: area.areaName,
value: area.areaCode,
index: index,
areaLevel: area.areaLevel,
children: []
};
if (length == number+1) {
delete item.children;
}
optionsList.push(item)
index++;
})
allList.push(optionsList)
}
return optionsList;
},
findChildList(allList, code, currentList) {
let lastList = allList[allList.length - 2]
for (let item of lastList) {
if (item.value == code) {
item.children = currentList
}
}
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
NODE_ENV = bb-prod
VUE_APP_BASE_URL = https://ys-service.zmnyjk.com
VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/
VUE_APP_SERVICE_API=/service-api
NODE_ENV = bb-test
VUE_APP_BASE_URL =
VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://beta-cqbp-yesuan.yiboshi.com:86/#/
VUE_APP_SERVICE_API=/service-api
......@@ -10,3 +10,5 @@ VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION2 = https://beta-yesuan.yiboshi.com/#/
VUE_APP_LOCATION1 = https://yesuan.yiboshi.com/#/
VUE_APP_LOCATION = http://127.0.0.1:8080/#/
VUE_APP_SERVICE_API=
......@@ -3,3 +3,4 @@ VUE_APP_BASE_URL = https://ys-service.zmnyjk.com
VUE_APP_BASE_PATH = https://lcgwypt-login.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_LOCATION = https://yesuan.zmnyjk.com/#/
VUE_APP_SERVICE_API=
......@@ -4,3 +4,4 @@ VUE_APP_BASE_URL = https://beta-ysservice.zmnyjk.com
VUE_APP_LOCATION = https://beta-yesuan.zmnyjk.com/#/
VUE_APP_BASE_PATH = https://beta-yac.zmnyjk.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
VUE_APP_SERVICE_API=
......@@ -32,10 +32,11 @@ function fetch(url = '', params = {}, method = 'get', contentType = 'form', toke
if (contentType !== 'application/x-www-form-urlencoded' && method !== 'get') {
qs = params
}
let serviceApi = process.env.VUE_APP_SERVICE_API;
return new Promise((resolve, reject) => {
axios({
method: method,
url: url,
url: serviceApi+url,
data: params,
headers: {
Authorization: token || window.sessionStorage.getItem('token'),
......
......@@ -19,17 +19,16 @@ apiInstance.interceptors.request.use(config => {
});
// 响应拦截器
apiInstance.interceptors.response.use(response => {
NProgress.done();
if(response.data.code === 'BIZ.BUSSINESS_EXCEPTION') {
if (response.data.code === 'BIZ.BUSSINESS_EXCEPTION') {
}
if(response.data.code === 'PARAM.EXCEPTION') {
if (response.data.code === 'PARAM.EXCEPTION') {
}
if(response.data.code === 'SYS.UNKNOWN_EXCEPTION') {
if (response.data.code === 'SYS.UNKNOWN_EXCEPTION') {
}
return response.data;
......
......@@ -47,7 +47,7 @@ export default {
},
created() {
//获取妇幼权限和登录基本信息
let cookieToken = "29cc399b-af98-4fbd-8984-ecbd97f125b7";
let cookieToken = "dd21a4cd-844a-47df-8627-d0dff82482c1";
if (process.env.NODE_ENV != "dev") {
cookieToken = getCookie('bGNnd3lwdF9hdA');
}
......
......@@ -56,7 +56,6 @@ export default {
this.areaCode = [];
return;
}
let level = 1;
if (areaCode.length == 2) {
this.areaCode = [areaCode];
return;
......@@ -65,7 +64,7 @@ export default {
let cityCodeFull = areaCode.substring(0, 4) + "00000000";
let countyCode, townshipCode, villageCode;
let countyCodeFull, townshipCodeFull;
level = 2;
let level = 2;
if (areaCode.substring(2, 4) != '00') {
level = 3
countyCode = areaCode.substring(0, 6);
......
......@@ -22,11 +22,11 @@
created() {
let ranges = {
'今天': [moment(), moment()],
'本周': [moment().add(-7, 'days'), moment()],
'本月': [moment().startOf('month'), moment().endOf('month')],
'近三个月': [moment().add(-90, 'days'), moment()],
'近半年': [moment().add(-180, 'days'), moment()],
'近一年': [moment().add(-365, 'days'), moment()],
'近一周': [moment().add(-7,'day'), moment()],
'近一月': [moment().add(-1,'month'), moment()],
'近三个月': [moment().add(-3, 'month'), moment()],
'近半年': [moment().add(-6, 'month'), moment()],
'近一年': [moment().add(-1, 'year'), moment()],
}
this.ranges=ranges;
},
......
......@@ -59,7 +59,7 @@
<a-col :span="12">
<a-form-model-item label="身高" prop="height">
<a-input type="number" placeholder="请输入身高,1000以内的数值"
<a-input type="number" placeholder="请输入身高,范围100cm-200cm"
@keyup.enter.native="nextFocus(5)" ref="input5"
@blur="onBlur(1,formData.height)" :disabled="disabled"
v-model="formData.height" suffix="cm"
......@@ -68,7 +68,7 @@
</a-col>
<a-col :span="12">
<a-form-model-item label="体重" prop="weight">
<a-input type="number" placeholder="请输入体重,1000以内的数值"
<a-input type="number" placeholder="请输入体重,范围30kg-180kg"
@keyup.enter.native="nextFocus(6)" ref="input6"
@blur="onBlur(2,formData.weight)" :disabled="disabled"
v-model="formData.weight" suffix="kg"
......@@ -286,7 +286,7 @@ export default {
disabled: false,
formRules: {
womanName: [
{required: true, message: '请输入姓名',trigger: 'change'}
{required: true, message: '请输入姓名', trigger: 'change'}
],
womenCertificateType: [
{required: true, message: '请选择证件类型'}
......@@ -306,11 +306,11 @@ export default {
{required: true, message: '请输入出生日期'}
],
height: [
{required: true, message: '请输入身高,1000以内的数值'},
{required: true, message: '请输入身高,范围100cm-200cm'},
{validator: this.checkHeightWeight},
],
weight: [
{required: true, message: '请输入体重,1000以内的数值'},
{required: true, message: '请输入体重,范围30kg-180kg'},
{validator: this.checkHeightWeight},
],
manName: [
......@@ -445,13 +445,21 @@ export default {
})
},
checkHeightWeight(rule, value, callback) {
if (value == null || value < 0 || value > 1000) {
if (rule.field == "height") {
callback(new Error('请输入身高,1000以内的数值'));
let msg = rule.field == "height" ? "请输入身高,范围100cm-200cm" : "请输入体重,范围30kg-180kg"
if (value == null) {
callback(new Error(msg));
} else {
callback(new Error('请输入体重,1000以内的数值'));
if (rule.field == "height") {
if (value < 100 || value > 200) {
callback(new Error(msg));
return
}
}else {
if (value < 30 || value > 180) {
callback(new Error(msg));
return;
}
}
} else {
callback()
}
},
......
......@@ -12,6 +12,9 @@
<a-form-item label="联系电话">
<a-input v-model="searchForm.telephone" placeholder="请输入联系电话" style="width: 250px"></a-input>
</a-form-item>
<a-form-item label="发放日期">
<date-range-picker :date.sync="searchForm.date"></date-range-picker>
</a-form-item>
<a-form-item>
<a-button type="primary" icon="search" class="search_btn" style="margin-left: 10px" @click="searchList">
搜索
......@@ -20,6 +23,7 @@
@click="restSearchForm">清空
</a-button>
</a-form-item>
<a-button type="primary" class="search_btn" style="float: right" @click="share">发放二维码</a-button>
<a-button type="primary" class="search_btn" style="float: right;margin-right: 20px" @click="toAdd">发放登记
</a-button>
......@@ -155,7 +159,7 @@
<script>
import QRCode from 'qrcode'
import {GetUserInfoByCardDevice, isEmptyParams} from "../../utils/common";
import dateRangePicker from "../../components/dateRangePicker.vue";
const columns = [
{
......@@ -214,11 +218,12 @@ const columns = [
},
]
export default {
components: {},
components: {dateRangePicker},
data() {
return {
// 搜索框对象
searchForm: {
date:[],
womenName: "",
womenIdCard: undefined,
telephone: ""
......@@ -279,6 +284,8 @@ export default {
let pars = isEmptyParams(this.searchForm)
let par = {
...pars,
provideDateStart: this.searchForm.date[0],
provideDateEnd: this.searchForm.date[1],
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
menuId: this.menuId
......@@ -305,7 +312,8 @@ export default {
},
restSearchForm() {
this.searchForm = {
idCar: undefined
idCar: undefined,
date: []
}
this.searchList()
},
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment