Commit fe759723 authored by 罗成兵's avatar 罗成兵

获取用户信息

parent 5d2a9635
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
<div class="height_44"></div> <div class="height_44"></div>
<vue-esign ref="esign" :isCrop="false" :width="400" :height="700"/> <vue-esign ref="esign" :isCrop="false" :width="400" :height="600"/>
<div class="btn"> <div class="btn">
<div class="btn_right" @click="handleReset"> <div class="btn_right" @click="handleReset">
<img src="../../assets/images/abrase.png" alt=""> <img src="../../assets/images/abrase.png" alt="">
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
scrollPosition: 0, scrollPosition: 0,
userInfo: { userInfo: {
account: null, account: null,
token: "52d30e396dff44eca2f51f614e42a8c0", token: "44c1ef4e-de9e-4d32-9af4-3c0196e1ec83",
userId: null, userId: null,
residentId: null, residentId: null,
nickName: null, nickName: null,
......
<template> <template>
<div class="receiveApply"> <div class="receiveApply">
<!-- 头部 --> <!-- 头部 -->
<van-nav-bar fixed title="叶酸领取申请"> <van-nav-bar fixed title="叶酸领取申请">
<template #left> <template #left>
<img src="../../assets/images/back.png" alt="" @click="goBack"/> <img src="../../assets/images/back.png" alt="" @click="goBack"/>
</template> </template>
</van-nav-bar> </van-nav-bar>
<!-- 警告提示部分 --> <!-- 警告提示部分 -->
<div class="warning"> <div class="warning">
<img src="../../assets/images/warning.png" alt=""/> <img src="../../assets/images/warning.png" alt=""/>
<span>请完整准确填写下列内容,所有内容只用于本次领取申请</span> <span>请完整准确填写下列内容,所有内容只用于本次领取申请</span>
</div> </div>
<!-- 表单部分 --> <!-- 表单部分 -->
<div class="form_block"> <div class="form_block">
<div class="item_box"> <div class="item_box">
<p style="font-size: 15px"><span>*</span>申领单位:{{ applyUnitInfo.unitName }}</p> <p style="font-size: 15px"><span>*</span>申领单位:{{ applyUnitInfo.unitName }}</p>
</div> </div>
<div class="title_info"> <div class="title_info">
<div class="line"></div> <div class="line"></div>
<div class="title">女方信息</div> <div class="title">女方信息</div>
</div> </div>
<div class="item_box"> <div class="item_box">
<span>*</span> <span>*</span>
<van-field v-model.trim="formData.womanName" label="姓名" placeholder="请输入女方姓名"/> <van-field v-model.trim="formData.womanName" label="姓名" placeholder="请输入女方姓名"/>
</div> </div>
<div class="tags"> <div class="tags">
<span> <span>
<span class="sign">*</span> <span class="sign">*</span>
<span>证件类型</span> <span>证件类型</span>
</span> </span>
<div> <div>
<van-tag plain @click="hanleTags1(1)" <van-tag plain @click="hanleTags1(1)"
:class="formData.womenCertificateType === 1 ? 'active' : ''">身份证 :class="formData.womenCertificateType === 1 ? 'active' : ''">身份证
</van-tag> </van-tag>
<van-tag plain @click="hanleTags1(2)" <van-tag plain @click="hanleTags1(2)"
:class="formData.womenCertificateType === 2 ? 'active' : ''">护照 :class="formData.womenCertificateType === 2 ? 'active' : ''">护照
</van-tag> </van-tag>
<van-tag plain @click="hanleTags1(3)" <van-tag plain @click="hanleTags1(3)"
:class="formData.womenCertificateType === 3 ? 'active' : ''">无证件 :class="formData.womenCertificateType === 3 ? 'active' : ''">无证件
</van-tag> </van-tag>
</div>
</div>
<div class="item_box" v-if="formData.womenCertificateType!=3">
<span>*</span>
<van-field v-model.trim="formData.womenIdCard" label="证件号码" placeholder="请输入证件号码"
@change="womenIdCardChange"/>
</div>
<div class="item_box">
<span>*</span>
<van-field v-model="formData.birthDate" label="出生日期" placeholder="出生日期" disabled
@click="birthDateShow=true"/>
<van-popup v-model="birthDateShow" position="bottom">
<van-datetime-picker
type="date"
v-model="formData.birthDateObj"
title="请选择出生日期"
@confirm="birthDateConfirm"
@cancel="birthDateShow = false"
:min-date="minDate"
:max-date="maxDate"
/>
</van-popup>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim="formData.height" @blur="onBlur(1,formData.height)" label="身高(cm)"
placeholder="请输入身高,范围100cm-200cm"/>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim.toFixed(2)="formData.weight" @blur="onBlur(2,formData.weight)"
label="体重(kg)" placeholder="请输入体重,1000以内数值"/>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim.toFixed(2)="formData.bmi" disabled
label="BMI"/>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model="formData.provideNumber"
label="领取数量(瓶)" placeholder="请输入领取数量,1-999之间"/>
</div>
<div class="split"></div>
<div class="title_info">
<div class="line"></div>
<div class="title">其他信息</div>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim="formData.telephone" label="联系电话" placeholder="请输入联系电话"/>
</div>
<div class="item_box">
<span>*</span>
<van-field
is-link
readonly
label="现住地址"
placeholder="点击选择"
@click="showPopup = true"
/>
</div>
<div class="item_box" style="font-size: 14px;margin-left: 20px" @click="showPopup = true">
{{ formData.presentName }}
</div>
<van-popup v-model="showPopup" position="bottom" round>
<!-- <van-area v-model="formData.presentCode" title="地区" :area-list="areaList" @confirm="handleConfirm"-->
<!-- @cancel="showPopup = false"/>-->
<van-cascader
v-model="formData.presentCode"
title="请选择现住地址"
:options="optionsList"
@close="showPopup = false"
@change="areaChange"
@finish="areaFinish"
/>
</van-popup>
<div class="item_box">
<span>*</span>
<van-field v-model.trim="formData.nowAddress" label="详细地址" placeholder="请输入详细地址"/>
</div>
<div class="item_box border_none">
<span>*</span>
<van-field
is-link
readonly
label="签名知情同意书"
placeholder="去签名"
@click="handleRouter"
v-model="formData.isSignedName"
/>
</div>
<div class="split"></div>
<div class="submit_btn_block">
<van-button @click="handleSubmit">提交申请</van-button>
</div>
</div> </div>
</div>
<div class="item_box" v-if="formData.womenCertificateType!=3">
<span>*</span>
<van-field v-model.trim="formData.womenIdCard" label="证件号码" placeholder="请输入证件号码"
@change="womenIdCardChange"/>
</div>
<div class="item_box">
<span>*</span>
<van-field v-model="formData.birthDate" label="出生日期" placeholder="出生日期" disabled
@click="birthDateShow=true"/>
<van-popup v-model="birthDateShow" position="bottom">
<van-datetime-picker
type="date"
v-model="formData.birthDateObj"
title="请选择出生日期"
@confirm="birthDateConfirm"
@cancel="birthDateShow = false"
:min-date="minDate"
:max-date="maxDate"
/>
</van-popup>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim="formData.height" @blur="onBlur(1,formData.height)" label="身高(cm)"
placeholder="请输入身高,范围100cm-200cm"/>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim.toFixed(2)="formData.weight" @blur="onBlur(2,formData.weight)"
label="体重(kg)" placeholder="请输入体重,1000以内数值"/>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim.toFixed(2)="formData.bmi" disabled
label="BMI"/>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model="formData.provideNumber"
label="领取数量(瓶)" placeholder="请输入领取数量,1-999之间"/>
</div>
<div class="split"></div>
<div class="title_info">
<div class="line"></div>
<div class="title">其他信息</div>
</div>
<div class="item_box">
<span>*</span>
<van-field type="number" v-model.trim="formData.telephone" label="联系电话" placeholder="请输入联系电话"/>
</div>
<div class="item_box">
<span>*</span>
<van-field
is-link
readonly
label="户籍地址"
placeholder="点击选择"
@click="showPopup1 = true"
/>
</div>
<div class="item_box" style="font-size: 14px;margin-left: 20px" @click="showPopup1 = true">
{{ formData.registeredCodeName }}
</div>
<van-popup v-model="showPopup1" position="bottom" round>
<van-cascader
v-model="formData.registeredCode"
title="请选择户籍地址"
:options="optionsList1"
@close="showPopup1 = false"
@change="(val)=>{areaChange(val,'registeredCode')}"
@finish="(val)=>{areaFinish(val,'registeredCode')}"
/>
</van-popup>
<div class="item_box">
<span>*</span>
<van-field v-model.trim="formData.permanentAddress" label="户籍详细地址" placeholder="请输入详细地址"/>
</div>
<div class="item_box">
<span>*</span>
<van-field
is-link
readonly
label="现住地址"
placeholder="点击选择"
@click="showPopup = true"
/>
</div>
<div class="item_box" style="font-size: 14px;margin-left: 20px" @click="showPopup = true">
{{ formData.presentCodeName }}
</div>
<van-popup v-model="showPopup" position="bottom" round>
<van-cascader
v-model="formData.presentCode"
title="请选择现住地址"
:options="optionsList"
@close="showPopup = false"
@change="(val)=>{areaChange(val,'presentCode')}"
@finish="(val)=>{areaFinish(val,'presentCode')}"
/>
</van-popup>
<div class="item_box">
<span>*</span>
<van-field v-model.trim="formData.nowAddress" label="现住详细地址" placeholder="请输入详细地址"/>
</div>
<div class="item_box border_none">
<span>*</span>
<van-field
is-link
readonly
label="签名知情同意书"
placeholder="去签名"
@click="handleRouter"
v-model="formData.isSignedName"
/>
</div>
<div class="split"></div>
<div class="submit_btn_block">
<van-button @click="handleSubmit">提交申请</van-button>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import {isEmpty, validateCard, validatePhone, getDateStr} from '../../utils/common' import {isEmpty, validateCard, validatePhone, getDateStr} from '../../utils/common'
...@@ -144,385 +171,443 @@ import {Dialog} from 'vant' ...@@ -144,385 +171,443 @@ import {Dialog} from 'vant'
import {addReceiveApply, getChildAreaByParentCode} from '@/axios/api' import {addReceiveApply, getChildAreaByParentCode} from '@/axios/api'
export default { export default {
data() { data() {
return { return {
// 表单信息 // 表单信息
formData: { formData: {
birthDate: undefined, birthDate: undefined,
womanName: "", womanName: "",
womenCertificateType: 1, womenCertificateType: 1,
presentName: undefined, presentCodeName: undefined,
height: undefined, registeredCodeName: undefined,
weight: undefined, height: undefined,
bmi: undefined, weight: undefined,
question: '', bmi: undefined,
telephone: '', question: '',
recommendEat: "", telephone: '',
birthDateObj: new Date(), presentCode: '', womenIdCard: '', nowAddress: '', provideNumber: undefined recommendEat: "",
}, birthDateObj: new Date(),
optionsList: [], registeredCode: '',
showPopup: false, permanentAddress:'',
scrollPosition: 0, presentCode: '',
applyUnitInfo: {unitName: ""}, womenIdCard: '',
birthDateShow: false, nowAddress: '',
minDate: new Date(1950, 0, 1), provideNumber: undefined
maxDate: new Date(), },
indexArr: [], optionsList: [],
} optionsList1: [],
}, showPopup: false,
created() { showPopup1: false,
this.getChildArea(0, 0); scrollPosition: 0,
applyUnitInfo: {unitName: ""},
birthDateShow: false,
minDate: new Date(1950, 0, 1),
maxDate: new Date(),
indexArr: [],
indexArr1: [],
}
},
created() {
this.getChildArea(0, 0,'registeredCode');
this.getChildArea(0, 0,'presentCode');
},
watch: {
'formData.height': {
deep: true,
handler: function (newV, oldV) {
this.heightWeightChange();
}
}, },
watch: { 'formData.weight': {
'formData.height': { deep: true,
deep: true, handler: function (newValue, oldValue) {
handler: function (newV, oldV) { this.heightWeightChange();
this.heightWeightChange(); }
} }
}, },
'formData.weight': { activated() {
deep: true, let applyUnitInfo = JSON.parse(sessionStorage.getItem('applyUnitInfo'));
handler: function (newValue, oldValue) { if (applyUnitInfo) {
this.heightWeightChange(); this.applyUnitInfo = applyUnitInfo;
}
if (!this.$route.meta.isBack) {
sessionStorage.removeItem('esignImg');
this.getUserInfo();
} else {
this.getIsEsign();
window.scrollTo(0, this.scrollPosition);
}
},
methods: {
getChildArea(areaCode, areaLevel, filed) {
getChildAreaByParentCode(areaCode).then(res => {
if (res.code === 'SUCCESS') {
let optionsList = [];
let areaList = res.data;
if (areaList != null) {
let index = 0;
let length = 0;
if (filed == 'presentCode') {
length = this.indexArr.length;
} else {
length = this.indexArr1.length;
} }
} areaList.forEach(area => {
}, let item = {
activated() { text: area.areaName,
let applyUnitInfo = JSON.parse(sessionStorage.getItem('applyUnitInfo')); value: area.areaCode,
if (applyUnitInfo) { index: index,
this.applyUnitInfo = applyUnitInfo; areaLevel: area.areaLevel,
} children: []
if (!this.$route.meta.isBack) { };
sessionStorage.removeItem('esignImg'); if (length == 4) {
this.getUserInfo(); delete item.children;
} else { }
this.getIsEsign(); optionsList.push(item)
window.scrollTo(0, this.scrollPosition); index++;
}
},
methods: {
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 => {
}) })
}, if (filed == 'presentCode') {
areaChange(val) { if (areaLevel == 0) {
this.formData.presentName = val.selectedOptions.map((item) => item.text).join('/'); this.optionsList = optionsList;
let indexArr = []; } else {
val.selectedOptions.forEach(item => { if (this.indexArr.length == 1) {
indexArr.push(item.index); this.optionsList[this.indexArr[0]].children = optionsList;
});
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('/');
}
,
//计算BMI值
heightWeightChange() {
let height = null, weight = null;
if (this.formData.height) {
height = Number(this.formData.height);
}
if (this.formData.weight) {
weight = Number(this.formData.weight);
}
if (height != null && height != 0) {
if (weight != null) {
this.formData.bmi = (weight / ((height / 100) * (height / 100))).toFixed(2);
} }
} if (this.indexArr.length == 2) {
} this.optionsList[this.indexArr[0]].children[this.indexArr[1]].children = optionsList;
,
onBlur(type, value) {
if (value) {
if (type == 1) {
this.formData.height = Number(value).toFixed(2);
} else {
this.formData.weight = Number(value).toFixed(2);
} }
} if (this.indexArr.length == 3) {
} this.optionsList[this.indexArr[0]].children[this.indexArr[1]].children[this.indexArr[2]].children = optionsList;
, }
womenIdCardChange() { if (this.indexArr.length == 4) {
if (!this.formData.womenIdCard) { this.optionsList[this.indexArr[0]].children[this.indexArr[1]].children[this.indexArr[2]].children[this.indexArr[3]].children = optionsList;
return }
} }
let womenIdCard = this.formData.womenIdCard.trim(); } else {
this.formData.womenIdCard = womenIdCard; if (areaLevel == 0) {
if (this.formData.womenCertificateType == 1) { this.optionsList1 = optionsList;
let length = womenIdCard.length; } else {
if (length == 15 | length == 18) { if (this.indexArr1.length == 1) {
let year = this.formData.womenIdCard.substring(6, 10); this.optionsList1[this.indexArr1[0]].children = optionsList;
let moth = this.formData.womenIdCard.substring(10, 12); }
let day = this.formData.womenIdCard.substring(12, 14); if (this.indexArr1.length == 2) {
this.formData.birthDate = year + "-" + moth + "-" + day; this.optionsList1[this.indexArr1[0]].children[this.indexArr1[1]].children = optionsList;
this.formData.birthDateObj = new Date(Number(year), Number(moth) - 1, Number(day)); }
if (this.indexArr1.length == 3) {
this.optionsList1[this.indexArr1[0]].children[this.indexArr1[1]].children[this.indexArr1[2]].children = optionsList;
} }
if (this.indexArr1.length == 4) {
this.optionsList1[this.indexArr1[0]].children[this.indexArr1[1]].children[this.indexArr1[2]].children[this.indexArr1[3]].children = optionsList;
}
}
} }
}
} }
, }).catch(res => {
birthDateConfirm(date) { })
this.birthDateShow = false; },
this.formData.birthDate = getDateStr(date); areaChange(val, filed) {
this.formData[filed + "Name"] = val.selectedOptions.map((item) => item.text).join('/');
let indexArr = [];
val.selectedOptions.forEach(item => {
indexArr.push(item.index);
});
if (indexArr.length == 5) {
if (filed == 'presentCode') {
this.showPopup = false;
} else {
this.showPopup1 = false;
} }
, return;
// 返回 }
goBack() { if (filed == 'presentCode') {
this.$router.push('provideUnit'); this.indexArr = indexArr;
} else {
this.indexArr1 = indexArr;
}
this.getChildArea(val.value, val.areaLevel, filed);
}
,
areaFinish(val,field) {
this.formData[field+"Name"] = val.selectedOptions.map((item) => item.text).join('/');
},
//计算BMI值
heightWeightChange() {
let height = null, weight = null;
if (this.formData.height) {
height = Number(this.formData.height);
}
if (this.formData.weight) {
weight = Number(this.formData.weight);
}
if (height != null && height != 0) {
if (weight != null) {
this.formData.bmi = (weight / ((height / 100) * (height / 100))).toFixed(2);
} }
, }
// 选择tags标签 }
hanleTags1(val) { ,
this.formData.womenCertificateType = val; onBlur(type, value) {
}, if (value) {
// 地区选择确定按钮 if (type == 1) {
handleConfirm(val) { this.formData.height = Number(value).toFixed(2);
this.showPopup = false; } else {
this.formData.presentName = val.map((item) => item.name).join('/'); this.formData.weight = Number(value).toFixed(2);
this.formData.presentCode = val[2].code;
} }
, }
// 签名知情同意书 }
handleRouter() { ,
this.$router.push('informedConsentForm'); womenIdCardChange() {
if (!this.formData.womenIdCard) {
return
}
let womenIdCard = this.formData.womenIdCard.trim();
this.formData.womenIdCard = womenIdCard;
if (this.formData.womenCertificateType == 1) {
let length = womenIdCard.length;
if (length == 15 | length == 18) {
let year = this.formData.womenIdCard.substring(6, 10);
let moth = this.formData.womenIdCard.substring(10, 12);
let day = this.formData.womenIdCard.substring(12, 14);
this.formData.birthDate = year + "-" + moth + "-" + day;
this.formData.birthDateObj = new Date(Number(year), Number(moth) - 1, Number(day));
} }
, }
// 提交申请 }
handleSubmit() { ,
if (isEmpty(this.formData.womanName)) { birthDateConfirm(date) {
this.$toast.tips('请输入女方姓名'); this.birthDateShow = false;
return false; this.formData.birthDate = getDateStr(date);
} }
if (isEmpty(this.formData.womenCertificateType)) { ,
this.$toast.tips('请选择女方证件类型'); // 返回
return false; goBack() {
} else { this.$router.push('provideUnit');
if (this.formData.womenCertificateType != 3) { }
if (isEmpty(this.formData.womenIdCard)) { ,
this.$toast.tips('请输入女方证件号码'); // 选择tags标签
return false; hanleTags1(val) {
} else { this.formData.womenCertificateType = val;
if (validateCard(this.formData.womenCertificateType, this.formData.womenIdCard)) { },
this.$toast.tips('请输入正确的证件号码'); // 地区选择确定按钮
return false; handleConfirm(val) {
} this.showPopup = false;
if (this.formData.womenIdCard.length > 50) { this.formData.presentCodeName = val.map((item) => item.name).join('/');
this.$toast.tips('证件号码不得超过50位'); this.formData.presentCode = val[2].code;
return false; }
} ,
} // 签名知情同意书
} else { handleRouter() {
this.formData.womenIdCard = null; this.$router.push('informedConsentForm');
} }
} ,
if (isEmpty(this.formData.height) || this.formData.height < 100 || this.formData.height > 200) { // 提交申请
this.$toast.tips('请输入身高,范围100cm-200cm'); handleSubmit() {
return false; if (isEmpty(this.formData.womanName)) {
} this.$toast.tips('请输入女方姓名');
if (isEmpty(this.formData.weight) || this.formData.weight < 0 || this.formData.weight > 1000) { return false;
this.$toast.tips('请输入体重,1000以内的数值'); }
return false; if (isEmpty(this.formData.womenCertificateType)) {
} this.$toast.tips('请选择女方证件类型');
if (isEmpty(this.formData.provideNumber)) { return false;
this.$toast.tips('请输入领取数量'); } else {
return false; if (this.formData.womenCertificateType != 3) {
} if (isEmpty(this.formData.womenIdCard)) {
if (this.formData.provideNumber <= 0 || this.formData.provideNumber > 999) { this.$toast.tips('请输入女方证件号码');
this.$toast.tips('领取数量在1-999之间'); return false;
return false; } else {
} if (validateCard(this.formData.womenCertificateType, this.formData.womenIdCard)) {
if (isEmpty(this.formData.birthDate)) { this.$toast.tips('请输入正确的证件号码');
this.$toast.tips('请输入出生日期'); return false;
return false;
}
if (isEmpty(this.formData.telephone)) {
this.$toast.tips('请输入联系电话');
return false;
}
if (validatePhone(this.formData.telephone)) {
this.$toast.tips('请输入正确的电话号码');
return false;
}
if (isEmpty(this.formData.presentCode)) {
this.$toast.tips('请选择现住地址');
return false;
}
if (isEmpty(this.formData.nowAddress)) {
this.$toast.tips('请输入详细地址');
return false;
}
if (isEmpty(this.formData.isSignedName)) {
this.$toast.tips('请先签订知情同意书');
return false;
}
if (this.formData.womanName.length > 15) {
this.$toast.tips('姓名不得超过15个字');
return false;
} }
if (this.formData.nowAddress.length > 100) { if (this.formData.womenIdCard.length > 50) {
this.$toast.tips('详细地址不得超过100个字'); this.$toast.tips('证件号码不得超过50位');
return false; return false;
} }
Dialog.confirm({ }
title: '提示', } else {
message: '确定要提交该申请么?', this.formData.womenIdCard = null;
}).then(() => {
let createUnitId = JSON.parse(sessionStorage.getItem('applyUnitInfo')).unitId;
let userInfo = JSON.parse(sessionStorage.getItem('userInfo'));
let applySignId = sessionStorage.getItem('esignImgId');
let params = {
nowAddress: this.formData.nowAddress,
telephone: this.formData.telephone,
womenIdCard: this.formData.womenIdCard,
womanName: this.formData.womanName,
residentId: userInfo.userId,
residentMobile: userInfo.account,
createUnitId: createUnitId,
birthDate: this.formData.birthDate,
height: this.formData.height,
weight: this.formData.weight,
womenCertificateType: this.formData.womenCertificateType,
presentCode: this.formData.presentCode,
applySignId: applySignId,
question: this.formData.question,
recommendEat: this.formData.recommendEat,
provideNumber: this.formData.provideNumber,
bmi: 0,
};
let height = null, weight = null;
if (this.formData.height) {
height = Number(this.formData.height);
}
if (this.formData.weight) {
weight = Number(this.formData.weight);
}
if (weight != 0) {
params.bmi = (weight / ((height / 100) * (height / 100))).toFixed(2);
}
if (!params.question && this.formData.bmi < 28) {
params.recommendEat = "1颗/天(0.4mg/天)";
}
this.$toast.submit();
addReceiveApply(params).then(res => {
if (res.code === 'SUCCESS') {
this.$toast.success('操作成功');
this.$router.push('receiveDetail');
}
}).catch(() => {
this.$toast.close();
});
}).catch(() => {
return false;
});
} }
, }
getIsEsign() { if (isEmpty(this.formData.height) || this.formData.height < 100 || this.formData.height > 200) {
let imgUrl = window.sessionStorage.getItem('esignImg'); this.$toast.tips('请输入身高,范围100cm-200cm');
if (isEmpty(imgUrl)) { return false;
this.formData.isSignedName = ''; }
} else { if (isEmpty(this.formData.weight) || this.formData.weight < 0 || this.formData.weight > 1000) {
this.formData.isSignedName = '已签名'; this.$toast.tips('请输入体重,1000以内的数值');
this.formData.isSigned = 1; return false;
this.$forceUpdate(); }
} if (isEmpty(this.formData.provideNumber)) {
this.$toast.tips('请输入领取数量');
return false;
}
if (this.formData.provideNumber <= 0 || this.formData.provideNumber > 999) {
this.$toast.tips('领取数量在1-999之间');
return false;
}
if (isEmpty(this.formData.birthDate)) {
this.$toast.tips('请输入出生日期');
return false;
}
if (isEmpty(this.formData.telephone)) {
this.$toast.tips('请输入联系电话');
return false;
}
if (validatePhone(this.formData.telephone)) {
this.$toast.tips('请输入正确的电话号码');
return false;
}
if (isEmpty(this.formData.registeredCode)) {
this.$toast.tips('请选择户籍地址');
return false;
}
if (isEmpty(this.formData.permanentAddress)) {
this.$toast.tips('请输入户籍详细地址');
return false;
}
if (isEmpty(this.formData.presentCode)) {
this.$toast.tips('请选择现住地址');
return false;
}
if (isEmpty(this.formData.nowAddress)) {
this.$toast.tips('请输入现住详细地址');
return false;
}
if (isEmpty(this.formData.isSignedName)) {
this.$toast.tips('请先签订知情同意书');
return false;
}
if (this.formData.womanName.length > 15) {
this.$toast.tips('姓名不得超过15个字');
return false;
}
if (this.formData.nowAddress.length > 100) {
this.$toast.tips('详细地址不得超过100个字');
return false;
}
Dialog.confirm({
title: '提示',
message: '确定要提交该申请么?',
}).then(() => {
let createUnitId = JSON.parse(sessionStorage.getItem('applyUnitInfo')).unitId;
let userInfo = JSON.parse(sessionStorage.getItem('userInfo'));
let applySignId = sessionStorage.getItem('esignImgId');
let params = {
nowAddress: this.formData.nowAddress,
telephone: this.formData.telephone,
womenIdCard: this.formData.womenIdCard,
womanName: this.formData.womanName,
residentId: userInfo.userId,
residentMobile: userInfo.account,
createUnitId: createUnitId,
birthDate: this.formData.birthDate,
height: this.formData.height,
weight: this.formData.weight,
womenCertificateType: this.formData.womenCertificateType,
presentCode: this.formData.presentCode,
applySignId: applySignId,
question: this.formData.question,
recommendEat: this.formData.recommendEat,
provideNumber: this.formData.provideNumber,
bmi: 0,
registeredCode: this.formData.registeredCode,
permanentAddress: this.formData.permanentAddress,
};
let height = null, weight = null;
if (this.formData.height) {
height = Number(this.formData.height);
} }
, if (this.formData.weight) {
getUserInfo() { weight = Number(this.formData.weight);
let lastRecord = JSON.parse(sessionStorage.getItem("lastRecord"));
if (!lastRecord) {
return;
}
let {
question, recommendEat, presentCode, womenCertificateType, womanName, womenIdCard,
birthDate, height, weight, bmi, telephone, nowAddress, provideNumber, presentCodeName
} = lastRecord;
if (!womenCertificateType) {
return;
}
this.formData.question = question;
this.formData.recommendEat = recommendEat;
this.formData.womanName = womanName;
this.formData.womenCertificateType = womenCertificateType;
this.formData.womenIdCard = womenIdCard;
this.formData.birthDate = birthDate;
this.formData.height = height;
this.formData.weight = weight;
this.formData.bmi = bmi;
this.formData.telephone = telephone;
this.formData.nowAddress = nowAddress;
this.formData.provideNumber = provideNumber;
this.formData.presentName = presentCodeName;
this.formData.presentCode = presentCode;
if (!presentCodeName) {
this.formData.presentCode = null;
}
if (this.formData.birthDate) {
let dateArr = this.formData.birthDate.split("-");
this.formData.birthDateObj = new Date(Number(dateArr[0]), Number(dateArr[1]) - 1, Number(dateArr[2]));
}
} }
, if (weight != 0) {
}, params.bmi = (weight / ((height / 100) * (height / 100))).toFixed(2);
beforeRouteEnter(to, from, next) { }
if (from.name === 'informedConsentForm') { if (!params.question && this.formData.bmi < 28) {
to.meta.isBack = true; params.recommendEat = "1颗/天(0.4mg/天)";
} else {
to.meta.isBack = false;
} }
next(); this.$toast.submit();
addReceiveApply(params).then(res => {
if (res.code === 'SUCCESS') {
this.$toast.success('操作成功');
this.$router.push('receiveDetail');
}
}).catch(() => {
this.$toast.close();
});
}).catch(() => {
return false;
});
} }
, ,
beforeRouteLeave(to, from, next) { getIsEsign() {
this.scrollPosition = document.documentElement.scrollTop || document.body.scrollTop; let imgUrl = window.sessionStorage.getItem('esignImg');
next(); if (isEmpty(imgUrl)) {
this.formData.isSignedName = '';
} else {
this.formData.isSignedName = '已签名';
this.formData.isSigned = 1;
this.$forceUpdate();
}
} }
, ,
getUserInfo() {
let lastRecord = JSON.parse(sessionStorage.getItem("lastRecord"));
if (!lastRecord) {
return;
}
let {
question, recommendEat, presentCode, womenCertificateType, womanName, womenIdCard,
birthDate, height, weight, bmi, telephone, nowAddress, provideNumber, presentCodeName,registeredCodeName,
registeredCode,permanentAddress
} = lastRecord;
if (!womenCertificateType) {
return;
}
this.formData.question = question;
this.formData.recommendEat = recommendEat;
this.formData.womanName = womanName;
this.formData.womenCertificateType = womenCertificateType;
this.formData.womenIdCard = womenIdCard;
this.formData.birthDate = birthDate;
this.formData.height = height;
this.formData.weight = weight;
this.formData.bmi = bmi;
this.formData.telephone = telephone;
this.formData.nowAddress = nowAddress;
this.formData.provideNumber = provideNumber;
this.formData.presentCodeName = presentCodeName;
this.formData.presentCode = presentCode;
this.formData.registeredCode = registeredCode;
this.formData.registeredCodeName = registeredCodeName;
this.formData.permanentAddress = permanentAddress;
if (!presentCodeName) {
this.formData.presentCode = null;
}
if (!registeredCodeName) {
this.formData.registeredCode = null;
}
if (this.formData.birthDate) {
let dateArr = this.formData.birthDate.split("-");
this.formData.birthDateObj = new Date(Number(dateArr[0]), Number(dateArr[1]) - 1, Number(dateArr[2]));
}
}
,
},
beforeRouteEnter(to, from, next) {
if (from.name === 'informedConsentForm') {
to.meta.isBack = true;
} else {
to.meta.isBack = false;
}
next();
}
,
beforeRouteLeave(to, from, next) {
this.scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;
next();
}
,
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
...@@ -3,8 +3,8 @@ NODE_ENV = dev ...@@ -3,8 +3,8 @@ NODE_ENV = dev
VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com VUE_APP_BASE_URL2222= https://beta-ysservice.yiboshi.com
VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com VUE_APP_BASE_URL22 = https://ys-service.yiboshi.com
VUE_APP_BASE_URL4 = http://59.230.237.90:8115 VUE_APP_BASE_URL4 = http://59.230.237.90:8115
VUE_APP_BASE_URL2 = http://127.0.0.1:8083 VUE_APP_BASE_URL = http://127.0.0.1:8083
VUE_APP_BASE_URL = https://beta-cqbp-yesuan.yiboshi.com:86/service-api VUE_APP_BASE_URL33 = https://beta-cqbp-yesuan.yiboshi.com:86/service-api
VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com VUE_APP_BASE_PATH = https://beta-yac.yiboshi.com
VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B' VUE_APP_KEY_WORD = 'XwKsGlMcdPMEhR1B'
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
}, },
created() { created() {
//获取妇幼权限和登录基本信息 //获取妇幼权限和登录基本信息
let cookieToken = "dd21a4cd-844a-47df-8627-d0dff82482c1"; let cookieToken = "44c1ef4e-de9e-4d32-9af4-3c0196e1ec83";
if (process.env.NODE_ENV != "dev") { if (process.env.NODE_ENV != "dev") {
cookieToken = getCookie('bGNnd3lwdF9hdA'); cookieToken = getCookie('bGNnd3lwdF9hdA');
} }
......
<template> <template>
<div> <div>
<a-spin tip="加载中..." :spinning="spinning"> <a-spin tip="加载中..." :spinning="spinning">
<a-card> <a-card>
<div style="font-size: 18px;font-weight: 600"> <div style="font-size: 18px;font-weight: 600">
<span>叶酸发放登记</span> <span>叶酸发放登记</span>
</div> </div>
<a-form-model ref="formRef" :model="formData" :rules="formRules" :labelCol="{span: 6}" <a-form-model ref="formRef" :model="formData" :rules="formRules" :labelCol="{span: 6}"
:wrapperCol="{span: 16}"> :wrapperCol="{span: 16}">
<div style="margin: 30px 0px"> <div style="margin: 30px 0px">
<div class="divider_my"><span class="midText">居民信息</span></div> <div class="divider_my"><span class="midText">居民信息</span></div>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
<a-card size="small" :headStyle="{background: '#FAFAFA'}"> <a-card size="small" :headStyle="{background: '#FAFAFA'}">
<div slot="title"> <div slot="title">
<img class="title_img" src="../../../../../static/images/user_info_index.png"> <img class="title_img" src="../../../../../static/images/user_info_index.png">
<span class="title_font">女方信息</span> <span class="title_font">女方信息</span>
</div> </div>
<a-button slot="extra" class="ant-table-btn" @click="getWomenIdCardInfo">身份证识别</a-button> <a-button slot="extra" class="ant-table-btn" @click="getWomenIdCardInfo">身份证识别</a-button>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="姓名" prop="womanName"> <a-form-model-item label="姓名" prop="womanName">
<a-input v-toInputNum="{num: 15}" @keyup.enter.native="nextFocus(1)" ref="input1" <a-input v-toInputNum="{num: 15}" @keyup.enter.native="nextFocus(1)" ref="input1"
placeholder="请输入姓名,最多可输入15个字" placeholder="请输入姓名,最多可输入15个字"
:disabled="disabled" :disabled="disabled"
v-model="formData.womanName"></a-input> v-model="formData.womanName"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="证件类型" prop="womenCertificateType"> <a-form-model-item label="证件类型" prop="womenCertificateType">
<a-select v-model="formData.womenCertificateType" placeholder="请选择" <a-select v-model="formData.womenCertificateType" placeholder="请选择"
@keyup.enter.native="nextFocus(2)" ref="input2" @keyup.enter.native="nextFocus(2)" ref="input2"
:disabled="disabled" @change="changeWomenCardType"> :disabled="disabled" @change="changeWomenCardType">
<a-select-option v-for="item in certificateTypeList" <a-select-option v-for="item in certificateTypeList"
:key="item.enumValue" :value="item.enumValue" :key="item.enumValue" :value="item.enumValue"
> >
{{ item.enumName }} {{ item.enumName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12" v-if="formData.womenCertificateType!=3"> <a-col :span="12" v-if="formData.womenCertificateType!=3">
<a-form-model-item label="证件号码" prop="womenIdCard"> <a-form-model-item label="证件号码" prop="womenIdCard">
<a-input placeholder="请输入证件号码" @blur="womenIdCardChange" style="width: 100%" <a-input placeholder="请输入证件号码" @blur="womenIdCardChange" style="width: 100%"
@keyup.enter.native="nextFocus(3)" ref="input3" @keyup.enter.native="nextFocus(3)" ref="input3"
v-model="formData.womenIdCard" v-model="formData.womenIdCard"
:disabled="disabled"></a-input> :disabled="disabled"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="出生日期" prop="birthDate"> <a-form-model-item label="出生日期" prop="birthDate">
<a-date-picker style="width: 100%" placeholder="请输入出生日期" format="YYYY-MM-DD" <a-date-picker style="width: 100%" placeholder="请输入出生日期" format="YYYY-MM-DD"
ref="input4" @change="nextFocus(4)" ref="input4" @change="nextFocus(4)"
value-format="yyyy-MM-DD" :disabled="disabled" value-format="yyyy-MM-DD" :disabled="disabled"
v-model="formData.birthDate"/> v-model="formData.birthDate"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="身高" prop="height"> <a-form-model-item label="身高" prop="height">
<a-input type="number" placeholder="请输入身高,范围100cm-200cm" <a-input type="number" placeholder="请输入身高,范围100cm-200cm"
@keyup.enter.native="nextFocus(5)" ref="input5" @keyup.enter.native="nextFocus(5)" ref="input5"
@blur="onBlur(1,formData.height)" :disabled="disabled" @blur="onBlur(1,formData.height)" :disabled="disabled"
v-model="formData.height" suffix="cm" v-model="formData.height" suffix="cm"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="体重" prop="weight"> <a-form-model-item label="体重" prop="weight">
<a-input type="number" placeholder="请输入体重,范围30kg-180kg" <a-input type="number" placeholder="请输入体重,范围30kg-180kg"
@keyup.enter.native="nextFocus(6)" ref="input6" @keyup.enter.native="nextFocus(6)" ref="input6"
@blur="onBlur(2,formData.weight)" :disabled="disabled" @blur="onBlur(2,formData.weight)" :disabled="disabled"
v-model="formData.weight" suffix="kg" v-model="formData.weight" suffix="kg"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="BMI" prop="bmi"> <a-form-model-item label="BMI" prop="bmi">
<a-input <a-input
v-model="formData.bmi" v-model="formData.bmi"
disabled> disabled>
</a-input> </a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
<a-card size="small" :headStyle="{background: '#FAFAFA'}" style="margin-top: 16px"> <a-card size="small" :headStyle="{background: '#FAFAFA'}" style="margin-top: 16px">
<div slot="title"> <div slot="title">
<img class="title_img" src="../../../../../static/images/user_info_index.png"> <img class="title_img" src="../../../../../static/images/user_info_index.png">
<span class="title_font">问卷<p <span class="title_font">问卷<p
style="font-size: 14px;display:inline;color: red;margin-left: 10px">请提示用户:如新鲜蔬果摄入少、血液叶酸水平低、备孕时间短,请酌情增补每日叶酸服用量。</p></span> style="font-size: 14px;display:inline;color: red;margin-left: 10px">请提示用户:如新鲜蔬果摄入少、血液叶酸水平低、备孕时间短,请酌情增补每日叶酸服用量。</p></span>
</div> </div>
<a-row :gutter="16" style="margin-left: 150px"> <a-row :gutter="16" style="margin-left: 150px">
<a-col :span="12"> <a-col :span="12">
<span style="font-weight: bold">符合以下情况的,请在□里打√:</span> <span style="font-weight: bold">符合以下情况的,请在□里打√:</span>
<a-form-model-item label="" prop="checkedList"> <a-form-model-item label="" prop="checkedList">
<a-checkbox-group style="width: 100%" v-model="checkedList" :options="plainOptions" <a-checkbox-group style="width: 100%" v-model="checkedList" :options="plainOptions"
@change="onChange"/> @change="onChange"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<p style="font-size: 20px;margin-top: 15%">建议服用:{{ formData.recommendEat }}</p> <p style="font-size: 20px;margin-top: 15%">建议服用:{{ formData.recommendEat }}</p>
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
<a-card size="small" :headStyle="{background: '#FAFAFA'}" style="margin-top: 16px"> <a-card size="small" :headStyle="{background: '#FAFAFA'}" style="margin-top: 16px">
<div slot="title"> <div slot="title">
<img class="title_img" src="../../../../../static/images/user_info_index.png"> <img class="title_img" src="../../../../../static/images/user_info_index.png">
<span class="title_font">其他信息</span> <span class="title_font">其他信息</span>
</div> </div>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="联系电话" prop="telephone" :labelCol="{span: 3}" <a-form-model-item label="联系电话" prop="telephone" :labelCol="{span: 3}"
:wrapperCol="{span: 8}"> :wrapperCol="{span: 8}">
<a-input placeholder="请输入联系电话" v-model="formData.telephone" <a-input placeholder="请输入联系电话" v-model="formData.telephone"
@keyup.enter.native="nextFocus(7)" ref="input7" @keyup.enter.native="nextFocus(7)" ref="input7"
:disabled="disabled"></a-input> :disabled="disabled"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> </a-row>
<a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}" <a-row :gutter="16">
:wrapperCol="{span: 20}"> <a-col :span="24">
<DocAddress v-model="formData.presentCode"/> <a-form-model-item label="户籍地址" prop="registeredCode" :labelCol="{span: 3}"
</a-form-model-item> :wrapperCol="{span: 20}">
</a-col> <a-row>
</a-row> <a-col :span="12">
<a-row :gutter="16"> <DocAddress v-model="formData.registeredCode" />
<a-col :span="24"> </a-col>
<a-form-model-item label="详细地址" prop="nowAddress" :labelCol="{span: 3}" <a-col :span="12">
:wrapperCol="{span: 20}"> <a-form-model-item label="" prop="permanentAddress" :labelCol="{span: 3}">
<a-input <a-input
@keyup.enter.native="nextFocus(9)" ref="input9" @keyup.enter.native="nextFocus(9)" ref="input9"
v-toInputNum="{num: 100}" v-toInputNum="{num: 100}"
placeholder="请输入详细地址,最多可输入100个字" placeholder="详细地址,最多可输入100个字"
v-model="formData.nowAddress" v-model="formData.permanentAddress"
:disabled="disabled"></a-input> :disabled="disabled"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> </a-row>
<a-form-model-item label="签署方式" prop="signedMode"> </a-form-model-item>
<a-select v-model="formData.signedMode" placeholder="请选择" disabled> </a-col>
<a-select-option v-for="item in signedModeList" </a-row>
:key="item.enumValue" :value="item.enumValue" <a-row :gutter="16">
> <a-col :span="24">
{{ item.enumName }} <a-form-model-item label="现住地址" prop="presentCode" :labelCol="{span: 3}"
</a-select-option> :wrapperCol="{span: 20}">
</a-select> <a-row>
</a-form-model-item> <a-col :span="12">
</a-col> <DocAddress v-model="formData.presentCode"/>
<a-col :span="12"> </a-col>
<a-form-model-item label="签署日期" prop="parentDate"> <a-col :span="12">
<a-date-picker v-model="formData.parentDate" format="yyyy-MM-DD" <a-form-model-item label="" prop="nowAddress" :labelCol="{span: 3}">
@change="nextFocus(10)" ref="input10" <a-input
value-format="yyyy-MM-DD" @keyup.enter.native="nextFocus(10)" ref="input10"
:disabled="disabled" v-toInputNum="{num: 100}"
style="width: 100%"/> placeholder="详细地址,最多可输入100个字"
</a-form-model-item> v-model="formData.nowAddress"
</a-col> :disabled="disabled"></a-input>
<a-col :span="12" :offset="3" v-if="this.routerParams.routerFlag == 'applyGrant'">
<a-form-model-item :wrapperCol="{span: 16}">
<div style="border: 1px dashed #EEEEEE;text-align: center">
<div class="sign">签字</div>
<img
style="height: 100px;margin-top: 20px;width: auto;transform: rotate(-90deg);"
:src="formData.applySignUrl">
</div>
</a-form-model-item>
</a-col>
</a-row>
</a-card>
<div style="margin: 30px 0px">
<div class="divider_my"><span class="midText">发放信息</span></div>
</div>
<div style="clear: both"></div>
<a-row>
<a-col :span="12">
<a-form-model-item label="发放日期" prop="provideDate">
<a-date-picker v-model="formData.provideDate" value-format="yyyy-MM-DD"
@change="nextFocus(11)" ref="input11"
format="YYYY-MM-DD"
style="width: 100%"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="发放数量" prop="provideNumber">
<a-input type="number" placeholder="请输入发放数量"
@keyup.enter.native="nextFocus(12)" ref="input12"
v-model="formData.provideNumber" suffix="瓶"
></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="发放医生" prop="provideDoctorId">
<a-select v-model="formData.provideDoctorId" placeholder="请选择"
@keyup.enter.native="nextFocus(13)" ref="input13">
<a-select-option v-for="item in doctorInfoList"
:key="item.id" :value="item.id"
>
{{ item.staffName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-col :span="24">
<a-form-model-item label="备注" prop="remarks" :labelCol="{span: 3}" :wrapperCol="{span: 20}">
<a-textarea placeholder="请输入备注,最多可输入500字" v-model="formData.remarks" :rows="5"
@keyup.enter.native="nextFocus(14)" ref="input14"
:maxLength="500"></a-textarea>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-form-model> </a-row>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :span="12">
<a-form-model-item label="签署方式" prop="signedMode">
<a-select v-model="formData.signedMode" placeholder="请选择" disabled>
<a-select-option v-for="item in signedModeList"
:key="item.enumValue" :value="item.enumValue"
>
{{ item.enumName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="签署日期" prop="parentDate">
<a-date-picker v-model="formData.parentDate" format="yyyy-MM-DD"
@change="nextFocus(11)" ref="input11"
value-format="yyyy-MM-DD"
:disabled="disabled"
style="width: 100%"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :span="12" :offset="3" v-if="this.routerParams.routerFlag == 'applyGrant'">
<a-form-model-item :wrapperCol="{span: 16}">
<div style="border: 1px dashed #EEEEEE;text-align: center">
<div class="sign">签字</div>
<img
style="height: 100px;margin-top: 20px;width: auto;transform: rotate(-90deg);"
:src="formData.applySignUrl">
</div>
</a-form-model-item>
</a-col>
</a-row>
</a-card>
<div style="margin: 30px 0px">
<div class="divider_my"><span class="midText">发放信息</span></div>
</div>
<div style="clear: both"></div>
<a-row>
<a-col :span="12">
<a-form-model-item label="发放日期" prop="provideDate">
<a-date-picker v-model="formData.provideDate" value-format="yyyy-MM-DD"
@change="nextFocus(12)" ref="input12"
format="YYYY-MM-DD"
style="width: 100%"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="发放数量" prop="provideNumber">
<a-input type="number" placeholder="请输入发放数量"
@keyup.enter.native="nextFocus(13)" ref="input13"
v-model="formData.provideNumber" suffix="瓶"
></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="发放医生" prop="provideDoctorId">
<a-select v-model="formData.provideDoctorId" placeholder="请选择"
@keyup.enter.native="nextFocus(14)" ref="input14">
<a-select-option v-for="item in doctorInfoList"
:key="item.id" :value="item.id"
>
{{ item.staffName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-col :span="24">
<a-form-model-item label="备注" prop="remarks" :labelCol="{span: 3}" :wrapperCol="{span: 20}">
<a-textarea placeholder="请输入备注,最多可输入500字" v-model="formData.remarks" :rows="5"
@keyup.enter.native="nextFocus(15)" ref="input15"
:maxLength="500"></a-textarea>
</a-form-model-item>
</a-col>
</a-form-model>
<!-- 选择叶酸种类弹框--> <!-- 选择叶酸种类弹框-->
<div> <div>
<in-stock-manage-info ref="inStockManageInfo" @selectedIdList="getChecked" <in-stock-manage-info ref="inStockManageInfo" @selectedIdList="getChecked"
v-if="readyGetChecked" :menuId="routerParams.menuId"></in-stock-manage-info> v-if="readyGetChecked" :menuId="routerParams.menuId"></in-stock-manage-info>
</div> </div>
<div style="text-align: center;margin-top: 16px"> <div style="text-align: center;margin-top: 16px">
<a-button class="ant-table-btn" @click="goBack">取消</a-button> <a-button class="ant-table-btn" @click="goBack">取消</a-button>
<a-button type="primary" :loading="spinning" @click="addMaterialDis" style="margin-left: 8px"> <a-button type="primary" :loading="spinning" @click="addMaterialDis" style="margin-left: 8px">
确认 确认
</a-button> </a-button>
</div> </div>
</a-card> </a-card>
</a-spin> </a-spin>
</div> </div>
</template> </template>
...@@ -237,561 +266,580 @@ import {cardType} from "../../../utils/dropDownCollection"; ...@@ -237,561 +266,580 @@ import {cardType} from "../../../utils/dropDownCollection";
import moment from 'moment' import moment from 'moment'
import InStockManageInfo from "./inStockManageInfo"; import InStockManageInfo from "./inStockManageInfo";
import DocAddress from "../../../components/DocAddress.vue"; import DocAddress from "../../../components/DocAddress.vue";
let vm = this let vm = this
export default { export default {
components: {InStockManageInfo,DocAddress}, components: {InStockManageInfo, DocAddress},
data() { data() {
let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo')); let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo'));
let userInfo = JSON.parse(window.sessionStorage.getItem('userInfo')); let userInfo = JSON.parse(window.sessionStorage.getItem('userInfo'));
let date = moment(new Date()).format('YYYY-MM-DD'); let date = moment(new Date()).format('YYYY-MM-DD');
return { return {
modelType: "", modelType: "",
userInfo: userInfo, userInfo: userInfo,
unitInfo: unitInfo, unitInfo: unitInfo,
indeterminate: true, indeterminate: true,
checkedList: [], checkedList: [],
plainOptions: [], plainOptions: [],
checkAll: false, checkAll: false,
spinning: false, spinning: false,
// 弹窗内表单 // 弹窗内表单
formData: { formData: {
weight: null, weight: null,
height: null, height: null,
bmi: "", bmi: "",
womanName: "", womanName: "",
womenCertificateType: '1', womenCertificateType: '1',
womenIdCard: undefined, womenIdCard: undefined,
oncePregnant: '', oncePregnant: '',
pregnantNum: undefined, pregnantNum: undefined,
manName: undefined, manName: undefined,
menIdCard: undefined, menIdCard: undefined,
telephone: undefined, telephone: undefined,
presentCode: undefined, registeredCode: undefined,
nowAddress: "", permanentAddress: "",
signedMode: '2', presentCode: undefined,
parentDate: date, nowAddress: "",
provideDate: date, signedMode: '2',
provideDoctorId: userInfo.relationId, parentDate: date,
provideNumber: "", provideDate: date,
provideRecordList: [], provideDoctorId: userInfo.relationId,
remarks: undefined, provideNumber: "",
birthDate: "", provideRecordList: [],
recommendEat: "1颗/天(0.4mg/天)", remarks: undefined,
question: "" birthDate: "",
}, recommendEat: "1颗/天(0.4mg/天)",
cardType, question: ""
disabled: false, },
formRules: { cardType,
womanName: [ disabled: false,
{required: true, message: '请输入姓名', trigger: 'change'} formRules: {
], womanName: [
womenCertificateType: [ {required: true, message: '请输入姓名', trigger: 'change'}
{required: true, message: '请选择证件类型'} ],
], womenCertificateType: [
womenIdCard: [ {required: true, message: '请选择证件类型'}
{required: true, message: '请输入证件号码'}, ],
{ womenIdCard: [
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, {required: true, message: '请输入证件号码'},
message: '请输入正确的身份证号' {
} pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
], message: '请输入正确的身份证号'
provideNumber: [ }
{required: true, message: '请输入发放数量'}, ],
{validator: this.checkProvideNumber, trigger: 'blur'}, provideNumber: [
], {required: true, message: '请输入发放数量'},
birthDate: [ {validator: this.checkProvideNumber, trigger: 'blur'},
{required: true, message: '请输入出生日期'} ],
], birthDate: [
height: [ {required: true, message: '请输入出生日期'}
{required: true, message: '请输入身高,范围100cm-200cm'}, ],
{validator: this.checkHeightWeight}, height: [
], {required: true, message: '请输入身高,范围100cm-200cm'},
weight: [ {validator: this.checkHeightWeight},
{required: true, message: '请输入体重,范围30kg-180kg'}, ],
{validator: this.checkHeightWeight}, weight: [
], {required: true, message: '请输入体重,范围30kg-180kg'},
manName: [ {validator: this.checkHeightWeight},
{required: true, message: '请输入姓名'} ],
], manName: [
menCertificateType: [ {required: true, message: '请输入姓名'}
{required: true, message: '请选择证件类型'} ],
], menCertificateType: [
menIdCard: [ {required: true, message: '请选择证件类型'}
{required: true, message: '请输入证件号码'}, ],
{ menIdCard: [
pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, {required: true, message: '请输入证件号码'},
message: '请输入正确的身份证号' {
} pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
], message: '请输入正确的身份证号'
telephone: [ }
{required: true, message: '请输入联系电话'}, ],
{validator: checkPhone}, telephone: [
], {required: true, message: '请输入联系电话'},
nowAddress: [ {validator: checkPhone},
{required: true, message: '请输入详细地址'} ],
], nowAddress: [
signedMode: [ {required: true, message: '请输入详细地址'}
{required: true, message: '请选择签署方式'} ],
], signedMode: [
parentDate: [ {required: true, message: '请选择签署方式'}
{required: true, message: '请选择签署日期'} ],
], parentDate: [
provideDate: [ {required: true, message: '请选择签署日期'}
{required: true, message: '请选择发放日期'} ],
], provideDate: [
provideDoctorId: [ {required: true, message: '请选择发放日期'}
{required: true, message: '请选择发放医生'} ],
], provideDoctorId: [
presentCode: [ {required: true, message: '请选择发放医生'}
{required: true, message: '请选现住地址', trigger: 'change'} ],
], presentCode: [
sendNumber: [ {required: true, message: '请选现住地址', trigger: 'change'}
{required: true, message: '请输入发放数量'} ],
] registeredCode: [
}, {required: true, message: '请选择户籍地址', trigger: 'change'}
womanPregnant: false,//是否怀孕 ],
options: { permanentAddress: [
penColor: "#000",//画笔颜色 {required: true, message: '请输入详细地址', trigger: 'change'}
}, ],
certificateTypeList: [], sendNumber: [
signedModeList: [], {required: true, message: '请输入发放数量'}
bookHtmlContent: '', ]
modalinfo: { },
selectedRowKeys: [] womanPregnant: false,//是否怀孕
}, options: {
readyGetChecked: true, penColor: "#000",//画笔颜色
doctorInfoList: [], },
areaInfo: [], certificateTypeList: [],
fieldNames: { signedModeList: [],
label: 'areaName', bookHtmlContent: '',
value: 'areaCode', modalinfo: {
children: 'children' selectedRowKeys: []
}, },
routerParams: {} readyGetChecked: true,
doctorInfoList: [],
areaInfo: [],
fieldNames: {
label: 'areaName',
value: 'areaCode',
children: 'children'
},
routerParams: {}
}
},
created() {
this.routerParams = this.$route.query;
this.certificateTypeList = getEnumByFlag('folacin_resident_info_certificate_type')
this.signedModeList = getEnumByFlag('folacin_resident_info_signed_mode')
let questionEnum = getEnumByFlag('folacin_resident_info_question');
questionEnum.forEach(enums => {
this.plainOptions.push({label: enums.enumName, value: enums.enumValue});
});
this.getBookHtmlContent()
this.getAllDoctorList()
this.modelType = this.routerParams.routerFlag;
if (this.modelType == 'applyGrant' || this.modelType == 'updateRecord') {//从申请过来的发放
if (this.modelType == 'applyGrant') {
//this.disabled = true;
this.getApplyDetail()
} else {
this.getStockListDetail()
}
} else {//由新增过来的发放
this.formData.presentCode = this.unitInfo.areaCode
this.formData.registeredCode = this.unitInfo.areaCode
}
},
mounted() {
let input = this.$refs["input1"];
if (this.ApiUtils.isNotBlank(input)) {
input.focus();
}
},
watch: {},
methods: {
nextFocus(index) {
let input = this.$refs["input" + (index + 1)];
if (this.ApiUtils.isBlank(input)) {
index = 1;
input = this.$refs["input" + index];
}
input.focus();
},
onBlur(type, value) {
if (value) {
if (type == 1) {
this.formData.height = Number(value).toFixed(2);
} else {
this.formData.weight = Number(value).toFixed(2);
}
this.formData.bmi = !this.formData.height || this.formData.height == 0 ? '-' : this.formData.weight / this.formData.height ? (this.formData.weight / ((this.formData.height / 100) * (this.formData.height / 100))).toFixed(2) : '-';
if (this.formData.bmi >= 28 && this.checkedList.length == 0) {
this.formData.recommendEat = "2颗/天(0.8mg/天)";
}
if (this.formData.bmi < 28 && this.checkedList.length == 0) {
this.formData.recommendEat = "1颗/天(0.4mg/天)";
} }
}
}, },
created() { onChange(checkedList) {
this.routerParams = this.$route.query; this.formData.recommendEat = "2颗/天(0.8mg/天)";
this.certificateTypeList = getEnumByFlag('folacin_resident_info_certificate_type') if (this.formData.bmi >= 28 && checkedList.length == 0) {
this.signedModeList = getEnumByFlag('folacin_resident_info_signed_mode') this.formData.recommendEat = "2颗/天(0.8mg/天)";
let questionEnum = getEnumByFlag('folacin_resident_info_question'); }
questionEnum.forEach(enums => { if (this.formData.bmi < 28 && checkedList.length == 0) {
this.plainOptions.push({label: enums.enumName, value: enums.enumValue}); this.formData.recommendEat = "1颗/天(0.4mg/天)";
}); }
this.getBookHtmlContent() checkedList.forEach(x => {
this.getAllDoctorList() if (x == '3') {
this.modelType = this.routerParams.routerFlag; this.formData.recommendEat = "10颗/天(4mg/天)";
if (this.modelType == 'applyGrant' || this.modelType == 'updateRecord') {//从申请过来的发放
if (this.modelType == 'applyGrant') {
//this.disabled = true;
this.getApplyDetail()
} else {
this.getStockListDetail()
}
} else {//由新增过来的发放
this.formData.presentCode = this.unitInfo.areaCode
} }
if (x == '4') {
this.formData.recommendEat = "13颗/天(5.2mg/天)";
}
})
}, },
mounted() { checkHeightWeight(rule, value, callback) {
let input = this.$refs["input1"]; let msg = rule.field == "height" ? "请输入身高,范围100cm-200cm" : "请输入体重,范围30kg-180kg"
if (this.ApiUtils.isNotBlank(input)) { if (value == null) {
input.focus(); callback(new Error(msg));
} else {
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;
}
} }
callback()
}
}, },
watch: {}, checkProvideNumber(rule, value, callback) {
methods: { if (value == null || value < 1 || value > 999) {
nextFocus(index) { callback(new Error('请输入1-999的整数值'));
let input = this.$refs["input" + (index + 1)]; } else {
if (this.ApiUtils.isBlank(input)) { callback()
index = 1; }
input = this.$refs["input" + index]; },
} //获取申请详情
input.focus(); getApplyDetail() {
}, this.spinning = true;
onBlur(type, value) { this.$api.folviteDistributionManage.fetchApplyDetail(this.routerParams.id).then(({data = [], code}) => {
if (value) { this.formData = {
if (type == 1) { applyId: data.id,
this.formData.height = Number(value).toFixed(2); height: data.height,
} else { weight: data.weight,
this.formData.weight = Number(value).toFixed(2); birthDate: data.birthDate,
} womanName: data.womanName,
this.formData.bmi = !this.formData.height || this.formData.height == 0 ? '-' : this.formData.weight / this.formData.height ? (this.formData.weight / ((this.formData.height / 100) * (this.formData.height / 100))).toFixed(2) : '-'; womenCertificateType: data.womenCertificateType.toString(),
if (this.formData.bmi >= 28 && this.checkedList.length == 0) { womenIdCard: data.womenIdCard,
this.formData.recommendEat = "2颗/天(0.8mg/天)"; provideNumber: data.provideNumber,
} telephone: data.telephone,
if (this.formData.bmi < 28 && this.checkedList.length == 0) { registeredCode: data.registeredCode,
this.formData.recommendEat = "1颗/天(0.4mg/天)"; permanentAddress: data.permanentAddress,
} presentCode: data.presentCode,
} nowAddress: data.nowAddress,
}, signedMode: data.signedMode ? data.signedMode.toString() : "1",
onChange(checkedList) { applySignUrl: data.applySignUrl,
this.formData.recommendEat = "2颗/天(0.8mg/天)"; parentDate: data.parentDate,
if (this.formData.bmi >= 28 && checkedList.length == 0) { provideDate: data.provideDate || moment(new Date()).format('yyyy-MM-DD'),
this.formData.recommendEat = "2颗/天(0.8mg/天)"; remarks: data.remarks,
} provideDoctorId: this.userInfo.relationId,
if (this.formData.bmi < 28 && checkedList.length == 0) { recommendEat: data.recommendEat,
this.formData.recommendEat = "1颗/天(0.4mg/天)"; question: data.question,
} bmi: data.bmi
checkedList.forEach(x => { }
if (x == '3') { if (this.formData.question) {
this.formData.recommendEat = "10颗/天(4mg/天)"; this.checkedList = this.formData.question.split(",");
} }
if (x == '4') { this.changeWomenCardType()
this.formData.recommendEat = "13颗/天(5.2mg/天)"; this.changeMenCardType()
} this.spinning = false;
}) }).catch(() => {
}, this.spinning = false
checkHeightWeight(rule, value, callback) { })
let msg = rule.field == "height" ? "请输入身高,范围100cm-200cm" : "请输入体重,范围30kg-180kg" },
if (value == null) { getStockListDetail() {
callback(new Error(msg)); this.spinning = true;
} else { let par = {
if (rule.field == "height") { residentId: this.routerParams.id,
if (value < 100 || value > 200) { menuId: this.routerParams.menuId
callback(new Error(msg)); }
return this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => {
} this.formData = {
}else { id: data.id,
if (value < 30 || value > 180) { height: data.height,
callback(new Error(msg)); weight: data.weight,
return; birthDate: data.birthDate,
} womanName: data.womanName,
} womenCertificateType: data.womenCertificateType.toString(),
callback() womenIdCard: data.womenIdCard,
} oncePregnant: +data.oncePregnant,
}, pregnantNum: data.pregnantNum,
checkProvideNumber(rule, value, callback) { provideNumber: data.provideNumber,
if (value == null || value < 1 || value > 999) { telephone: data.telephone,
callback(new Error('请输入1-999的整数值')); registeredCode: data.registeredCode,
} else { permanentAddress: data.permanentAddress,
callback() presentCode: data.presentCode,
} nowAddress: data.nowAddress,
}, signedMode: data.signedMode ? data.signedMode.toString() : "1",
//获取申请详情 applySignUrl: data.applySignUrl,
getApplyDetail() { parentDate: data.parentDate,
this.spinning = true; provideDate: data.provideDate || moment(new Date()).format('yyyy-MM-DD'),
this.$api.folviteDistributionManage.fetchApplyDetail(this.routerParams.id).then(({data = [], code}) => { provideDoctorId: this.userInfo.relationId,
this.formData = { provideRecordList: data.provideRecordList,
applyId: data.id, remarks: data.remarks,
height: data.height, recommendEat: data.recommendEat,
weight: data.weight, }
birthDate: data.birthDate, this.formData.bmi = !this.formData.height || this.formData.height == 0 ? '-' : this.formData.weight / this.formData.height ? (this.formData.weight / ((this.formData.height / 100) * (this.formData.height / 100))).toFixed(2) : '-';
womanName: data.womanName, if (this.formData.bmi >= 28) {
womenCertificateType: data.womenCertificateType.toString(), this.formData.recommendEat = "2颗/天(0.8mg/天)";
womenIdCard: data.womenIdCard, }
provideNumber: data.provideNumber, if (!this.disabled) {
telephone: data.telephone, this.formData.recommendEat = data.recommendEat;
presentCode: data.presentCode, }
nowAddress: data.nowAddress, if (data.question) {
signedMode: data.signedMode ? data.signedMode.toString() : "1", let questionList = data.question.split(",");
applySignUrl: data.applySignUrl, this.checkedList = questionList;
parentDate: data.parentDate, }
provideDate: data.provideDate || moment(new Date()).format('yyyy-MM-DD'), if (this.formData.womenCertificateType == '1') {
remarks: data.remarks, let length = this.formData.womenIdCard.length;
provideDoctorId: this.userInfo.relationId, if (length == 15 | length == 18) {
recommendEat: data.recommendEat, let year = this.formData.womenIdCard.substring(6, 10);
question: data.question, let moth = this.formData.womenIdCard.substring(10, 12);
bmi: data.bmi let day = this.formData.womenIdCard.substring(12, 14);
} this.formData.birthDate = year + "-" + moth + "-" + day;
if (this.formData.question) { }
this.checkedList = this.formData.question.split(","); }
} this.formData.recommendEat = data.recommendEat;
this.changeWomenCardType() this.changeWomenCardType()
this.changeMenCardType() this.changeMenCardType()
this.spinning = false; this.spinning = false;
}).catch(() => { }).catch(() => {
this.spinning = false this.spinning = false
}) })
}, },
getStockListDetail() { getLastRecord() {
this.spinning = true; this.$api.folviteDistributionManage.fetchLastRecord(this.formData.womenIdCard).then(({data = [], code}) => {
let par = { if (data == null) {
residentId: this.routerParams.id, return;
menuId: this.routerParams.menuId }
} this.formData.womanName = data.residentName;
this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => { this.formData.telephone = data.telephone;
this.formData = { this.formData.presentCode = data.presentCode;
id: data.id, this.formData.nowAddress = data.nowAddress;
height: data.height, this.formData.registeredCode = data.registeredCode;
weight: data.weight, this.formData.permanentAddress = data.permanentAddress;
birthDate: data.birthDate, }).catch(() => {
womanName: data.womanName, })
womenCertificateType: data.womenCertificateType.toString(), },
womenIdCard: data.womenIdCard, getWomenIdCardInfo() {
oncePregnant: +data.oncePregnant, GetUserInfoByCardDevice().then(res => {
pregnantNum: data.pregnantNum, let {cardno, name, born} = res;
provideNumber: data.provideNumber, this.formData.womanName = name;
telephone: data.telephone, this.formData.womenCertificateType = '1';
presentCode: data.presentCode, this.formData.womenIdCard = cardno;
nowAddress: data.nowAddress, let year = born.substring(0, 4);
signedMode: data.signedMode ? data.signedMode.toString() : "1", let moth = born.substring(4, 6);
applySignUrl: data.applySignUrl, let day = born.substring(6, 8);
parentDate: data.parentDate, this.formData.birthDate = year + "-" + moth + "-" + day;
provideDate: data.provideDate || moment(new Date()).format('yyyy-MM-DD'), })
provideDoctorId: this.userInfo.relationId, },
provideRecordList: data.provideRecordList, getBookHtmlContent() {//获取用户知情书模板
remarks: data.remarks, let par = {
recommendEat: data.recommendEat, menuId: this.routerParams.menuId
} }
this.formData.bmi = !this.formData.height || this.formData.height == 0 ? '-' : this.formData.weight / this.formData.height ? (this.formData.weight / ((this.formData.height / 100) * (this.formData.height / 100))).toFixed(2) : '-'; this.$api.common.fetchConsentInfo(par).then(({data}) => {
if (this.formData.bmi >= 28) { if (this.$api.utils.isBlank(data)) {
this.formData.recommendEat = "2颗/天(0.8mg/天)"; this.bookHtmlContent = {content: ""}
} } else {
if (!this.disabled) { this.bookHtmlContent = data;
this.formData.recommendEat = data.recommendEat; }
} })
if (data.question) { },
let questionList = data.question.split(","); getAllDoctorList() {
this.checkedList = questionList; let par = {
} menuId: this.menuId
if (this.formData.womenCertificateType == '1') { }
let length = this.formData.womenIdCard.length; this.$api.common.fetchAllDoctor(par).then(({data}) => {
if (length == 15 | length == 18) { this.doctorInfoList = data
let year = this.formData.womenIdCard.substring(6, 10); })
let moth = this.formData.womenIdCard.substring(10, 12); },
let day = this.formData.womenIdCard.substring(12, 14); getChecked(val) {
this.formData.birthDate = year + "-" + moth + "-" + day; this.readyGetChecked = false
} this.$refs.inStockManageInfo.visible = false
} this.modalinfo.selectedRowKeys = [...val]
this.formData.recommendEat = data.recommendEat; this.getSelectedMedical(val)
this.changeWomenCardType() },
this.changeMenCardType() changeWomenCardType() {
this.spinning = false; let cardInfo = this.cardType.filter(item => item.id == this.formData.womenCertificateType)
}).catch(() => { this.formRules.womenIdCard = cardInfo[0].rule;
this.spinning = false this.$refs["input3"].focus();
}) },
}, changeMenCardType() {
getLastRecord() { let cardInfo = this.cardType.filter(item => item.id == this.formData.menCertificateType)
this.$api.folviteDistributionManage.fetchLastRecord(this.formData.womenIdCard).then(({data = [], code}) => { this.formRules.menIdCard = cardInfo[0].rule;
if (data == null) { },
return; getSelectedMedical(val) {//获取被选中的药具
} if (val.length > 0) {
this.formData.womanName = data.residentName; let par = {
this.formData.telephone = data.telephone; idList: val.join(','),
this.formData.presentCode = data.presentCode; menuId: this.routerParams.menuId
this.formData.nowAddress = data.nowAddress; }
}).catch(() => { this.$api.stockManage.fetchMedicalListByIds(par).then(({data = []}) => {
}) this.formData.provideRecordList = data
}, })
getWomenIdCardInfo() { }
GetUserInfoByCardDevice().then(res => { },
let {cardno, name, born} = res; addMaterialDis() {//发放
this.formData.womanName = name; let vm = this;
this.formData.womenCertificateType = '1'; this.$refs.formRef.validate(valid => {
this.formData.womenIdCard = cardno; if (valid) {
let year = born.substring(0, 4); if (this.checkedList.length > 0) {
let moth = born.substring(4, 6); let questionList = "";
let day = born.substring(6, 8); this.checkedList.forEach(x => {
this.formData.birthDate = year + "-" + moth + "-" + day; questionList += x + ",";
})
},
getBookHtmlContent() {//获取用户知情书模板
let par = {
menuId: this.routerParams.menuId
}
this.$api.common.fetchConsentInfo(par).then(({data}) => {
if (this.$api.utils.isBlank(data)) {
this.bookHtmlContent = {content: ""}
} else {
this.bookHtmlContent = data;
}
})
},
getAllDoctorList() {
let par = {
menuId: this.menuId
}
this.$api.common.fetchAllDoctor(par).then(({data}) => {
this.doctorInfoList = data
}) })
}, this.formData.question = questionList.substring(0, questionList.length - 1);
save() { } else {
const {isEmpty, data} = this.$refs.signaturePad.saveSignature(); this.formData.question = "";
}, }
this.spinning = true;
getChecked(val) { let params = {};
this.readyGetChecked = false const {
this.$refs.inStockManageInfo.visible = false id,
this.modalinfo.selectedRowKeys = [...val] parentDate,
this.getSelectedMedical(val) provideNumber,
}, provideDate,
changeWomenCardType() { registeredCode,
let cardInfo = this.cardType.filter(item => item.id == this.formData.womenCertificateType) presentCode,
this.formRules.womenIdCard = cardInfo[0].rule; provideDoctorId,
this.$refs["input3"].focus(); ...others
}, } = vm.formData
changeMenCardType() { let parentTime = moment(parentDate).format('YYYY-MM-DD')
let cardInfo = this.cardType.filter(item => item.id == this.formData.menCertificateType) let provideTme = moment(provideDate).format('YYYY-MM-DD')
this.formRules.menIdCard = cardInfo[0].rule; let presentCodeInfo = "",registeredCodeInfo="";
}, if (presentCode != null && presentCode.length > 1) {
getSelectedMedical(val) {//获取被选中的药具 presentCodeInfo = presentCode;
if (val.length > 0) { } else {
let par = { presentCodeInfo = this.unitInfo.areaCode;
idList: val.join(','), }
menuId: this.routerParams.menuId if (registeredCode != null && registeredCode.length > 1) {
} registeredCodeInfo = registeredCode;
this.$api.stockManage.fetchMedicalListByIds(par).then(({data = []}) => { } else {
this.formData.provideRecordList = data registeredCodeInfo = this.unitInfo.areaCode;
}
let provideDoctorInfo = vm.doctorInfoList.filter(item => item.id == provideDoctorId)
params = {
id: id,
parentDate: parentTime,
provideDate: provideTme,
registeredCode: registeredCodeInfo,
presentCode: presentCodeInfo,
provideDoctorId: provideDoctorInfo[0].id,
provideDoctorName: provideDoctorInfo[0].staffName,
provideNumber: provideNumber,
...others
}
params.menuId = this.routerParams.menuId;
let msg = this.modelType == 'updateRecord' ? '确定提交修改吗?' : '确定提交发放吗?'
this.$confirm({
title: msg,
okType: 'success',
onOk: () => {
if (this.modelType == 'applyGrant') {
params.applyId = vm.formData.applyId
this.$api.folviteApplyManage.addApplyGrant(params).then(({code}) => {
vm.spinning = false;
if (code === 'SUCCESS') {
this.$message.success('发放成功!');
this.goBack()
}
}).catch(() => {
vm.spinning = false
});
return;
}
if (this.modelType == 'updateRecord') {
this.$api.folviteApplyManage.addFolviteDistributionByApply(params).then(({code}) => {
vm.spinning = false;
if (code === 'SUCCESS') {
this.$message.success('修改成功!');
this.goBack()
}
}).catch(() => {
vm.spinning = false
}) })
} return;
}, }
addMaterialDis() {//发放 this.$api.folviteDistributionManage.fetchAddFolviteDistribution(params).then(({code}) => {
let vm = this; vm.spinning = false;
this.$refs.formRef.validate(valid => { if (code === 'SUCCESS') {
if (valid) { vm.$message.success('发放成功!');
if (this.checkedList.length > 0) { this.goBack()
let questionList = "";
this.checkedList.forEach(x => {
questionList += x + ",";
})
this.formData.question = questionList.substring(0, questionList.length - 1);
} else {
this.formData.question = "";
}
this.spinning = true;
let params = {};
const {
id,
parentDate,
provideNumber,
provideDate,
presentCode,
provideDoctorId,
...others
} = vm.formData
let parentTime = moment(parentDate).format('YYYY-MM-DD')
let provideTme = moment(provideDate).format('YYYY-MM-DD')
let presentCodeInfo = "";
if (presentCode != null && presentCode.length > 1) {
presentCodeInfo = presentCode;
} else {
presentCodeInfo = this.unitInfo.areaCode;
}
let provideDoctorInfo = vm.doctorInfoList.filter(item => item.id == provideDoctorId)
params = {
id: id,
parentDate: parentTime,
provideDate: provideTme,
presentCode: presentCodeInfo,
provideDoctorId: provideDoctorInfo[0].id,
provideDoctorName: provideDoctorInfo[0].staffName,
provideNumber: provideNumber,
...others
}
params.menuId = this.routerParams.menuId;
let msg = this.modelType == 'updateRecord' ? '确定提交修改吗?' : '确定提交发放吗?'
this.$confirm({
title: msg,
okType: 'success',
onOk: () => {
if (this.modelType == 'applyGrant') {
params.applyId = vm.formData.applyId
this.$api.folviteApplyManage.addApplyGrant(params).then(({code}) => {
vm.spinning = false;
if (code === 'SUCCESS') {
this.$message.success('发放成功!');
this.goBack()
}
}).catch(() => {
vm.spinning = false
});
return;
}
if (this.modelType == 'updateRecord') {
this.$api.folviteApplyManage.addFolviteDistributionByApply(params).then(({code}) => {
vm.spinning = false;
if (code === 'SUCCESS') {
this.$message.success('修改成功!');
this.goBack()
}
}).catch(() => {
vm.spinning = false
})
return;
}
this.$api.folviteDistributionManage.fetchAddFolviteDistribution(params).then(({code}) => {
vm.spinning = false;
if (code === 'SUCCESS') {
vm.$message.success('发放成功!');
this.goBack()
}
}).catch(() => {
vm.spinning = false
})
},
onCancel: () => {
vm.spinning = false;
},
});
}
});
},
womenIdCardChange() {
if (!this.formData.womenIdCard) {
return
}
if (this.modelType == 'add') {
this.getLastRecord();
}
let womenIdCard = this.formData.womenIdCard.trim();
this.formData.womenIdCard = womenIdCard;
if (this.formData.womenCertificateType == 1) {
let length = womenIdCard.length;
if (length == 15 | length == 18) {
let year = this.formData.womenIdCard.substring(6, 10);
let moth = this.formData.womenIdCard.substring(10, 12);
let day = this.formData.womenIdCard.substring(12, 14);
this.formData.birthDate = year + "-" + moth + "-" + day;
} }
} }).catch(() => {
vm.spinning = false
})
},
onCancel: () => {
vm.spinning = false;
},
});
}
});
},
womenIdCardChange() {
if (!this.formData.womenIdCard) {
return
}
if (this.modelType == 'add') {
this.getLastRecord();
}
let womenIdCard = this.formData.womenIdCard.trim();
this.formData.womenIdCard = womenIdCard;
if (this.formData.womenCertificateType == 1) {
let length = womenIdCard.length;
if (length == 15 | length == 18) {
let year = this.formData.womenIdCard.substring(6, 10);
let moth = this.formData.womenIdCard.substring(10, 12);
let day = this.formData.womenIdCard.substring(12, 14);
this.formData.birthDate = year + "-" + moth + "-" + day;
}
}
}, },
//打开库存弹框 //打开库存弹框
openStockModel() { openStockModel() {
this.readyGetChecked = true this.readyGetChecked = true
let vm = this let vm = this
this.$nextTick(() => { this.$nextTick(() => {
vm.$refs.inStockManageInfo.visible = true; vm.$refs.inStockManageInfo.visible = true;
}) })
}, },
goBack() { goBack() {
this.formData = {}; this.formData = {};
if (process.env.NODE_ENV !== "dev") { if (process.env.NODE_ENV !== "dev") {
window.top.postMessage({ window.top.postMessage({
messageType: 'THIRD_PAGECHANGE', messageType: 'THIRD_PAGECHANGE',
name: `${this.routerParams.menuCode}`, name: `${this.routerParams.menuCode}`,
source: "yesuan" source: "yesuan"
}, '*'); }, '*');
return; return;
} }
if (this.routerParams.routerFlag == "applyGrant") { if (this.routerParams.routerFlag == "applyGrant") {
this.$router.push("/Home/folviteApply"); this.$router.push("/Home/folviteApply");
closedDetail('/inStock/addMaterialDistribution', '/Home/folviteApply'); closedDetail('/inStock/addMaterialDistribution', '/Home/folviteApply');
} else { } else {
this.$router.push("/Home/folviteDistribution"); this.$router.push("/Home/folviteDistribution");
closedDetail('/inStock/addMaterialDistribution', '/Home/folviteDistribution') closedDetail('/inStock/addMaterialDistribution', '/Home/folviteDistribution')
} }
}, },
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.title_img { .title_img {
display: inline-block; display: inline-block;
width: 24px; width: 24px;
height: 24px; height: 24px;
margin-top: -5px; margin-top: -5px;
margin-left: 10px; margin-left: 10px;
} }
.title_font { .title_font {
font-family: PingFang SC; font-family: PingFang SC;
color: #595959; color: #595959;
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
line-height: 22px; line-height: 22px;
margin: 16px 0px 16px 18px; margin: 16px 0px 16px 18px;
} }
</style> </style>
...@@ -799,44 +847,44 @@ export default { ...@@ -799,44 +847,44 @@ export default {
<style lang="less"> <style lang="less">
.book { .book {
.ant-card-head-title { .ant-card-head-title {
padding: 0px !important; padding: 0px !important;
} }
} }
.sign { .sign {
position: absolute; position: absolute;
background: #FFF1F0; background: #FFF1F0;
border-radius: 0px 0px 24px 0px; border-radius: 0px 0px 24px 0px;
width: 60px; width: 60px;
height: 40px; height: 40px;
padding: 0px 16px; padding: 0px 16px;
} }
.opt { .opt {
float: right; float: right;
margin-top: 10px; margin-top: 10px;
} }
.table_input { .table_input {
.ant-table-tbody > tr > td { .ant-table-tbody > tr > td {
padding: 5px !important; padding: 5px !important;
overflow-wrap: break-word; overflow-wrap: break-word;
} }
} }
.modal_table { .modal_table {
.ant-form-item { .ant-form-item {
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
} }
.ant-checkbox-group-item { .ant-checkbox-group-item {
display: block; display: block;
margin-top: 20px; margin-top: 20px;
} }
.ant-checkbox-group { .ant-checkbox-group {
width: 100%; width: 100%;
} }
</style> </style>
<template> <template>
<div> <div>
<a-spin tip="加载中..." :spinning="spinning"> <a-spin tip="加载中..." :spinning="spinning">
<a-card> <a-card>
<div> <div>
<div> <div>
<span style="font-size: 18px;font-weight: 600;color: #262626"> 叶酸发放登记</span> <span style="font-size: 18px;font-weight: 600;color: #262626"> 叶酸发放登记</span>
</div> </div>
<div style="margin: 30px 0px"> <div style="margin: 30px 0px">
<div class="divider_my"><span class="midText">居民信息</span></div> <div class="divider_my"><span class="midText">居民信息</span></div>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
<div style="margin-top: 16px"> <div style="margin-top: 16px">
<div class="detail_title"> <div class="detail_title">
<div class="divider_my_dashed"> <div class="divider_my_dashed">
<span class="midText" style="font-size: 14px;color: #FF4D80;">女方信息</span> <span class="midText" style="font-size: 14px;color: #FF4D80;">女方信息</span>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div> </div>
<a-descriptions bordered class="folvite_title"> <a-descriptions bordered class="folvite_title" :column="6">
<a-descriptions-item label="姓名"> <a-descriptions-item label="姓名" :span="2">
{{ detailInfo.womanName || '--' }} {{ detailInfo.womanName || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="证件类型"> <a-descriptions-item label="证件类型" :span="2">
{{ detailInfo.womenCertificateTypeName || '--' }} {{ detailInfo.womenCertificateTypeName || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="证件号码"> <a-descriptions-item label="证件号码" :span="2">
{{ detailInfo.womenIdCard || '--' }} {{ detailInfo.womenIdCard || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="出生日期"> <a-descriptions-item label="出生日期" :span="2">
{{ detailInfo.birthDate || '--' }} {{ detailInfo.birthDate || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="身高"> <a-descriptions-item label="联系电话" :span="2">
{{ detailInfo.height ? detailInfo.height + "cm" : '--' }} {{ detailInfo.telephone || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="体重"> <a-descriptions-item label="身高" :span="2">
{{ detailInfo.weight ? detailInfo.weight + "kg" : '--' }} {{ detailInfo.height ? detailInfo.height + "cm" : '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="BMI"> <a-descriptions-item label="体重" :span="2">
{{ detailInfo.bmi ? detailInfo.bmi: '--' }} {{ detailInfo.weight ? detailInfo.weight + "kg" : '--' }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> <a-descriptions-item label="BMI" :span="2">
<div class="detail_title" style="border-top: 0px"> {{ detailInfo.bmi ? detailInfo.bmi : '--' }}
<div class="divider_my_dashed"> </a-descriptions-item>
<span class="midText" style="font-size: 14px;color: #FF4D80;">其他信息</span> </a-descriptions>
</div> <div class="detail_title" style="border-top: 0px">
<div style="clear: both"></div> <div class="divider_my_dashed">
</div> <span class="midText" style="font-size: 14px;color: #FF4D80;">其他信息</span>
<a-descriptions bordered class="folvite_title"> </div>
<a-descriptions-item label="联系电话"> <div style="clear: both"></div>
{{ detailInfo.telephone || '--' }} </div>
</a-descriptions-item> <a-descriptions bordered class="folvite_title" :column="6">
<a-descriptions-item label="现在住址"> <a-descriptions-item label="户籍地址" :span="2">
{{ detailInfo.presentCodeName || '--' }} {{ detailInfo.registeredCodeName || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="户籍地址详细" :span="2">
{{ detailInfo.permanentAddress || '--' }}
</a-descriptions-item>
<a-descriptions-item label="现住址" :span="2">
{{ detailInfo.presentCodeName || '--' }}
</a-descriptions-item>
<a-descriptions-item label="详细地址"> <a-descriptions-item label="现住址详细" :span="2">
{{ detailInfo.nowAddress || '--' }} {{ detailInfo.nowAddress || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签署方式" :span="detailInfo.source == 2 ? 2: 1"> <a-descriptions-item label="签署方式" :span="2">
{{ detailInfo.signedModeName || '--' }} {{ detailInfo.signedModeName || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签署日期" :span="detailInfo.source == 2 ? 2: 1"> <a-descriptions-item label="签署日期" :span="2">
{{ detailInfo.parentDate || '--' }} {{ detailInfo.parentDate || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="上传照片" v-if="detailInfo.source != 2"> <a-descriptions-item label="上传照片" v-if="detailInfo.source != 2" :span="2">
<img style="cursor: pointer" width="120px" height="120px" :src="detailInfo.consentUrl" <img style="cursor: pointer" width="120px" height="120px" :src="detailInfo.consentUrl"
@click="showVisible=true"/> @click="showVisible=true"/>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签名" v-if="detailInfo.source == 2"> <a-descriptions-item label="签名" v-if="detailInfo.source == 2" :span="4">
<img style="margin-left: 30px;width: auto;height: 80px;transform: rotate(-90deg)" <img style="margin-left: 30px;width: auto;height: 80px;transform: rotate(-90deg)"
:src="detailInfo.applySignUrl"> :src="detailInfo.applySignUrl">
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<div style="margin: 30px 0px"> <div style="margin: 30px 0px">
<div class="divider_my"><span class="midText">问卷</span></div> <div class="divider_my"><span class="midText">问卷</span></div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div> </div>
<a-descriptions bordered class="folvite_title"> <a-descriptions bordered class="folvite_title" :column="4">
<a-descriptions-item label="结果" > <a-descriptions-item label="结果" :span="2">
<div v-if="checkedList&&checkedList.length>0"> <div v-if="checkedList&&checkedList.length>0">
<p v-for="item in checkedList ">{{item}}</p> <p v-for="item in checkedList ">{{ item }}</p>
</div> </div>
<p v-else>--</p> <p v-else>--</p>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="建议服用"> <a-descriptions-item label="建议服用" :span="2">
{{ detailInfo.recommendEat || '--' }} {{ detailInfo.recommendEat || '--' }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<!--发放信息--> <!--发放信息-->
<div style="margin: 30px 0px"> <div style="margin: 30px 0px">
<div class="divider_my"><span class="midText">发放信息</span></div> <div class="divider_my"><span class="midText">发放信息</span></div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div> </div>
<a-descriptions bordered :column="3" class="folvite_title"> <a-descriptions bordered :column="3" class="folvite_title">
<a-descriptions-item label="发放日期"> <a-descriptions-item label="发放日期">
{{ detailInfo.provideDate || '--' }} {{ detailInfo.provideDate || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="发放数量"> <a-descriptions-item label="发放数量">
{{ detailInfo.provideNumber ? detailInfo.provideNumber + "瓶" : '--' }} {{ detailInfo.provideNumber ? detailInfo.provideNumber + "瓶" : '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="发放医生"> <a-descriptions-item label="发放医生">
{{ detailInfo.provideDoctorName || '--' }} {{ detailInfo.provideDoctorName || '--' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="备注"> <a-descriptions-item label="备注">
{{ detailInfo.remarks || '--' }} {{ detailInfo.remarks || '--' }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
</div> </div>
<div style="text-align: center;margin-top: 40px"> <div style="text-align: center;margin-top: 40px">
<a-button class="ant-table-btn" @click="goBack">关闭</a-button> <a-button class="ant-table-btn" @click="goBack">关闭</a-button>
</div> </div>
</a-card> </a-card>
</a-spin> </a-spin>
<a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" @ok="showVisible=false" <a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" @ok="showVisible=false"
loading="true" loading="true"
:maskClosable="false" :maskClosable="false"
width="800px"> width="800px">
<div> <div>
<img style="width: 100%" :src="detailInfo.consentUrl" height="100%"/> <img style="width: 100%" :src="detailInfo.consentUrl" height="100%"/>
</div> </div>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import {getEnumByFlag} from "../../../utils/common"; import {getEnumByFlag} from "../../../utils/common";
export default { export default {
data() { data() {
return { return {
routerParams: {}, routerParams: {},
detailInfo: {}, detailInfo: {},
spinning: false, spinning: false,
bookHtmlContent: {content: undefined}, bookHtmlContent: {content: undefined},
showVisible: false, showVisible: false,
plainOptions: {}, plainOptions: {},
checkedList: [], checkedList: [],
}
},
created() {
let questionEnum = getEnumByFlag('folacin_resident_info_question');
questionEnum.forEach(enums => {
this.plainOptions["key" + enums.enumValue] = enums.enumName;
});
this.routerParams = this.$route.query;
this.getStockListDetail()
this.getBookHtmlContent()
},
methods: {
getBookHtmlContent() {//获取用户知情书模板
let par = {
menuId: this.routerParams.menuId
}
this.$api.common.fetchConsentInfo(par).then(({data}) => {
if (this.$api.utils.isBlank(data)) {
this.bookHtmlContent = {content: ""}
} else {
this.bookHtmlContent = data;
} }
})
}, },
created() { getStockListDetail() {
let questionEnum = getEnumByFlag('folacin_resident_info_question'); this.spinning = true
questionEnum.forEach(enums => { let par = {
this.plainOptions["key" + enums.enumValue] = enums.enumName; residentId: this.routerParams.id,
}); }
this.routerParams = this.$route.query; this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => {
this.getStockListDetail() this.spinning = false;
this.getBookHtmlContent() this.detailInfo = data;
if (data.question) {
let questionList = data.question.split(",");
questionList.forEach(x => {
this.checkedList.push(this.plainOptions["key" + x]);
})
}
}).catch(res => {
this.spinning = false;
})
}, },
methods: { goBack() {
getBookHtmlContent() {//获取用户知情书模板 if (process.env.NODE_ENV == "dev") {
let par = { this.$router.push("/Home/folviteDistribution");
menuId: this.routerParams.menuId } else {
} window.top.postMessage({
this.$api.common.fetchConsentInfo(par).then(({data}) => { messageType: 'THIRD_PAGECHANGE',
if (this.$api.utils.isBlank(data)) { name: `${this.routerParams.menuCode}`,
this.bookHtmlContent = {content: ""} source: "yesuan"
} else { }, '*')
this.bookHtmlContent = data; }
}
})
},
getStockListDetail() {
this.spinning = true
let par = {
residentId: this.routerParams.id,
}
this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => {
this.spinning = false;
this.detailInfo = data;
if (data.question) {
let questionList = data.question.split(",");
questionList.forEach(x => {
this.checkedList.push(this.plainOptions["key"+x]);
})
}
}).catch(res=>{
this.spinning = false;
})
},
goBack() {
if (process.env.NODE_ENV == "dev") {
this.$router.push("/Home/folviteDistribution");
} else {
window.top.postMessage({
messageType: 'THIRD_PAGECHANGE',
name: `${this.routerParams.menuCode}`,
source: "yesuan"
}, '*')
}
},
}, },
},
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
<template> <template>
<div class="inStockManage"> <div class="inStockManage">
<a-form layout="inline" class="search_form"> <a-form layout="inline" class="search_form">
<a-form-item label="姓名"> <a-form-item label="姓名">
<a-input v-model="searchForm.womanName" placeholder="请输入姓名" style="width: 250px"></a-input> <a-input v-model="searchForm.womanName" placeholder="请输入姓名" style="width: 250px"></a-input>
</a-form-item> </a-form-item>
<a-form-item label="证件号码"> <a-form-item label="证件号码">
<a-input v-model="searchForm.womenIdCard" placeholder="请输入证件号码" <a-input v-model="searchForm.womenIdCard" placeholder="请输入证件号码"
style="width: 250px;margin-right: 10px"></a-input> style="width: 250px;margin-right: 10px"></a-input>
<a-button class="search_btn ant-table-btn" @click="getIdCardInfo">读卡识别</a-button> <a-button class="search_btn ant-table-btn" @click="getIdCardInfo">读卡识别</a-button>
</a-form-item> </a-form-item>
<a-form-item label="联系电话"> <a-form-item label="联系电话">
<a-input v-model="searchForm.telephone" placeholder="请输入联系电话" style="width: 250px"></a-input> <a-input v-model="searchForm.telephone" placeholder="请输入联系电话" style="width: 250px"></a-input>
</a-form-item> </a-form-item>
<a-form-item label="发放日期"> <a-form-item label="发放日期">
<date-range-picker :date.sync="searchForm.date"></date-range-picker> <date-range-picker :date.sync="searchForm.date"></date-range-picker>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" icon="search" class="search_btn" style="margin-left: 10px" @click="searchList"> <a-button type="primary" icon="search" class="search_btn" style="margin-left: 10px" @click="searchList">
搜索 搜索
</a-button> </a-button>
<a-button class="search_btn ant-table-btn" icon="sync" style="margin-left: 10px" <a-button class="search_btn ant-table-btn" icon="sync" style="margin-left: 10px"
@click="restSearchForm">清空 @click="restSearchForm">清空
</a-button> </a-button>
</a-form-item> </a-form-item>
<a-button type="primary" class="search_btn" style="float: right" @click="share" v-if="showQrCode"> <a-button type="primary" class="search_btn" style="float: right" @click="share" v-if="showQrCode">
发放二维码 发放二维码
</a-button> </a-button>
<a-button type="primary" class="search_btn" style="float: right;margin-right: 20px" @click="toAdd">发放登记 <a-button type="primary" class="search_btn" style="float: right;margin-right: 20px" @click="toAdd">发放登记
</a-button> </a-button>
<div style="clear: both"></div> <div style="clear: both"></div>
</a-form> </a-form>
<div style="margin-top: 16px;margin-bottom: 10px"></div> <div style="margin-top: 16px;margin-bottom: 10px"></div>
<a-table :dataSource="tableData" <a-table :dataSource="tableData"
:columns="columns" :columns="columns"
rowKey="id" rowKey="id"
:loading="loading" :loading="loading"
:pagination="false" :pagination="false"
:scroll="{ x: 1}" :scroll="{ x: 1}"
> >
<template slot="expireDateS" slot-scope="record"> <template slot="expireDateS" slot-scope="record">
{{ record.expireDate | formatDate }} {{ record.expireDate | formatDate }}
</template> </template>
<template slot="nowAddress" slot-scope="text, record"> <template slot="nowAddress" slot-scope="text, record">
<a-tooltip placement="top"> <a-tooltip placement="top">
<template slot="title"> <template slot="title">
<span> {{ (record.presentCodeName || "") + record.nowAddress }}</span> <span> {{ (record.presentCodeName || "") + record.nowAddress }}</span>
</template> </template>
<span class="ellipsis">{{ (record.presentCodeName || "") + record.nowAddress }}</span> <span class="ellipsis">{{ (record.presentCodeName || "") + record.nowAddress }}</span>
</a-tooltip> </a-tooltip>
</template> </template>
<template slot="action" slot-scope="record"> <template slot="registeredCode" slot-scope="text, record">
<a-button class="ant-table-btn" size="small" @click="toDetail(record)">查看</a-button> <a-tooltip placement="top">
<a-button style="margin-left: 10px" class="ant-table-btn" size="small" @click="updateRecord(record)">修改 <template slot="title">
</a-button> <span> {{ (record.registeredCodeName || "") + record.permanentAddress }}</span>
<a-popconfirm placement="top" @confirm="deleteRecord(record)" cancelText="取消" okText="确认"> </template>
<template slot="title"> <span class="ellipsis">{{ (record.registeredCodeName || "") + record.permanentAddress }}</span>
<p>确认删除吗?</p> </a-tooltip>
</template> </template>
<a-button style="margin-left: 10px" class="ant-table-btn" size="small">删除</a-button> <template slot="action" slot-scope="record">
</a-popconfirm> <a-button class="ant-table-btn" size="small" @click="toDetail(record)">查看</a-button>
<a-button class="ant-table-btn" v-if="record.source===1&&record.isSigned===2" size="small" <a-button style="margin-left: 10px" class="ant-table-btn" size="small" @click="updateRecord(record)">修改
style="margin-left: 10px" </a-button>
@click="uploadConsentInfo(record)">签署同意书 <a-popconfirm placement="top" @confirm="deleteRecord(record)" cancelText="取消" okText="确认">
</a-button> <template slot="title">
<a-button class="ant-table-btn" v-else size="small" style="margin-left: 10px" <p>确认删除吗?</p>
@click="showConsentInfo(record)">已签同意书 </template>
</a-button> <a-button style="margin-left: 10px" class="ant-table-btn" size="small">删除</a-button>
</template> </a-popconfirm>
</a-table> <a-button class="ant-table-btn" v-if="record.source===1&&record.isSigned===2" size="small"
<a-modal title="上传知情同意书" :visible="visible" @cancel="onCancel" @ok="onsubmit" style="margin-left: 10px"
:maskClosable="false" @click="uploadConsentInfo(record)">签署同意书
width="600px"> </a-button>
<span>上传知情同意书:</span> <a-button class="ant-table-btn" v-else size="small" style="margin-left: 10px"
<a-upload @click="showConsentInfo(record)">已签同意书
style="display: inline" </a-button>
name="file" </template>
list-type="picture-card" </a-table>
accept=".jpg,.png" <a-modal title="上传知情同意书" :visible="visible" @cancel="onCancel" @ok="onsubmit"
:multiple="true" :maskClosable="false"
:action="uploadAction" width="600px">
:headers="headers" <span>上传知情同意书:</span>
@reject="handleReject" <a-upload
@preview="preview" style="display: inline"
@change="handleChange" name="file"
:file-list="fileList" list-type="picture-card"
> accept=".jpg,.png"
<div> :multiple="true"
<!--<a-icon type="plus"/>--> :action="uploadAction"
<div class="ant-upload-text"> :headers="headers"
上传本地文件 @reject="handleReject"
</div> @preview="preview"
</div> @change="handleChange"
</a-upload> :file-list="fileList"
<div> >
<br/> <div>
温馨提示:请上传JPG、PNG格式图片,图片大小不超过5M <!--<a-icon type="plus"/>-->
<br/> <div class="ant-upload-text">
上传本地文件
</div>
</div>
</a-upload>
<div>
<br/>
温馨提示:请上传JPG、PNG格式图片,图片大小不超过5M
<br/>
</div> </div>
</a-modal> </a-modal>
<!--:getContainer="getContainer"--> <!--:getContainer="getContainer"-->
<a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" cancelText="关闭" <a-modal title="查看知情同意书" :visible="showVisible" @cancel="showVisible = false" cancelText="关闭"
:footer="null" :footer="null"
loading="true" loading="true"
:maskClosable="false" :maskClosable="false"
width="600px"> width="600px">
<div v-if="currentRow.source==1"> <div v-if="currentRow.source==1">
<img style="width: 100%" :src="consentUrl" height="100%"/> <img style="width: 100%" :src="consentUrl" height="100%"/>
</div> </div>
<div v-else> <div v-else>
<div> <div>
<div v-html="consentInfo" style="width: 100%"> <div v-html="consentInfo" style="width: 100%">
</div> </div>
<div style="float: right;margin-right: 50px"> <div style="float: right;margin-right: 50px">
<div style="">签名: <img <div style="">签名: <img
style="width:50px;height: 120px;transform: rotate(-90deg);margin-left: 60px" style="width:50px;height: 120px;transform: rotate(-90deg);margin-left: 60px"
:src="applySignUrl"/></div> :src="applySignUrl"/></div>
<div>签署日期:<span style="margin-left: 8px">{{ currentRow.parentDate }}</span></div> <div>签署日期:<span style="margin-left: 8px">{{ currentRow.parentDate }}</span></div>
</div> </div>
<div style="clear: both"></div> <div style="clear: both"></div>
</div> </div>
</div> </div>
<br><br> <br><br>
<a-button style="margin-left:80%" type="danger" @click="showVisible = false">关闭</a-button> <a-button style="margin-left:80%" type="danger" @click="showVisible = false">关闭</a-button>
<br> <br>
</a-modal> </a-modal>
<a-pagination <a-pagination
v-if="pagination.total > 0" v-if="pagination.total > 0"
:total="pagination.total" :total="pagination.total"
show-size-changer show-size-changer
show-quick-jumper show-quick-jumper
v-model="pagination.pageIndex" v-model="pagination.pageIndex"
:page-size="pagination.pageSize" :page-size="pagination.pageSize"
:page-size-options="pagination.pageSizeOptions" :page-size-options="pagination.pageSizeOptions"
@showSizeChange="showSizeChange" @showSizeChange="showSizeChange"
@change="change" @change="change"
:showTotal="() => `共 ${pagination.total} 条`" :showTotal="() => `共 ${pagination.total} 条`"
/> />
<a-modal title="" :visible="qrCodeShow" @cancel="qrCodeShow = false" cancelText="关闭" <a-modal title="" :visible="qrCodeShow" @cancel="qrCodeShow = false" cancelText="关闭"
:footer="null" :footer="null"
loading="true" loading="true"
:maskClosable="false" :maskClosable="false"
width="600px"> width="600px">
<div ref="printContent" style="text-align: center;margin-top: 10%"> <div ref="printContent" style="text-align: center;margin-top: 10%">
<h2>叶酸手机申请领取二维码(使用医站到家APP扫码领取)</h2> <h2>叶酸手机申请领取二维码(使用医站到家APP扫码领取)</h2>
<img width="80%" :src="qrCodeUrl" style="margin-left: 20px"> <img width="80%" :src="qrCodeUrl" style="margin-left: 20px">
<br> <br>
<center style="font-size:18px ">{{ unitInfo.unitName }}</center> <center style="font-size:18px ">{{ unitInfo.unitName }}</center>
<br> <br> <br> <br>
</div> </div>
<center @click="qrCodePrint" style="cursor: pointer"> <center @click="qrCodePrint" style="cursor: pointer">
<a-button>打印</a-button> <a-button>打印</a-button>
</center> </center>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import QRCode from 'qrcode' import QRCode from 'qrcode'
...@@ -165,341 +173,349 @@ import {GetUserInfoByCardDevice, isEmptyParams} from "../../utils/common"; ...@@ -165,341 +173,349 @@ import {GetUserInfoByCardDevice, isEmptyParams} from "../../utils/common";
import dateRangePicker from "../../components/dateRangePicker.vue"; import dateRangePicker from "../../components/dateRangePicker.vue";
const columns = [ const columns = [
{ {
title: '发放日期', title: '发放日期',
dataIndex: 'provideDate', dataIndex: 'provideDate',
width: '140px' width: '140px'
},
{
title: '姓名',
dataIndex: 'womanName',
width: '100px', ellipsis: true,
},
{
title: '证件类型',
dataIndex: 'womenCertificateTypeName',
width: '100px'
},
{
title: '证件号码',
dataIndex: 'womenIdCard',
width: '180px'
},
{
title: '发放数量',
dataIndex: 'provideNumber',
width: '100px'
},
{
title: '联系电话',
dataIndex: 'telephone',
width: '140px'
},
{
title: '发放医生',
dataIndex: 'provideDoctorName',
width: '180px'
},
{
title: '类型',
dataIndex: 'sourceName',
width: '140px'
},
{
title: '户籍地址',
// dataIndex: 'nowAddress',
key: 'registeredCode',
ellipsis: true,
scopedSlots: {customRender: 'registeredCode'},
},
{
title: '现住址',
// dataIndex: 'nowAddress',
key: 'nowAddress',
ellipsis: true,
scopedSlots: {customRender: 'nowAddress'},
},
{
title: '操作',
fixed: 'right',
align: 'left',
width: "300px",
scopedSlots: {customRender: 'action'},
},
]
export default {
components: {dateRangePicker},
data() {
return {
// 搜索框对象
searchForm: {
date: [],
womenName: "",
womenIdCard: undefined,
telephone: ""
},
pagination: {
pageIndex: 1,
pageSize: 10,
total: 0,
pageSizeOptions: ['10', '20', '30', '40', '50'],
},
columns,
tableData: [],
loading: false,
visible: false,
showVisible: false,
previewVisible: false,
consentUrl: "",
applySignUrl: "",
consentInfo: "",
headers: {
Authorization: sessionStorage.getItem("token")
},
uploadAction: process.env.VUE_APP_BASE_URL + process.env.VUE_APP_SERVICE_API + "/v1/folacin-admin/sys-pictures-info/upload-img",
fileList: [],
formData: {
consentId: "",
id: ""
},
currentRow: {},
menuId: undefined,
qrCodeShow: false,
qrCodeUrl: "",
unitInfo: {unitName: ""},
printDisplay: 'none',
showQrCode: process.env.VUE_APP_SHOW_QR_CODE == 'true'
}
},
created() {
this.routerParams = this.$route.query;
if (this.routerParams.menuId) {
window.sessionStorage.setItem('menuId', this.routerParams.menuId);
this.menuId = this.routerParams.menuId;
}
this.getDataList();
},
methods: {
getIdCardInfo() {
GetUserInfoByCardDevice().then(res => {
let {cardno, name, address} = res;
this.searchForm.womenIdCard = cardno
})
}, },
{ searchList() {
title: '姓名', this.pagination.pageIndex = 1;
dataIndex: 'womanName', this.getDataList();
width: '100px', ellipsis: true,
}, },
{ getDataList() {
title: '证件类型', this.loading = true
dataIndex: 'womenCertificateTypeName', let pars = isEmptyParams(this.searchForm)
width: '100px' let par = {
...pars,
provideDateStart: this.searchForm.date[0],
provideDateEnd: this.searchForm.date[1],
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
menuId: this.menuId
}
this.$api.folviteDistributionManage.fetchFolviteDistributionList(par).then(({data = {}}) => {
const {dataList = [], total = 0} = data;
this.tableData = dataList
this.pagination.total = total
this.loading = false
}).catch(() => {
this.loading = false
})
}, },
{ // 分页
title: '证件号码', showSizeChange(pageNum, pageSize) {
dataIndex: 'womenIdCard', this.pagination.pageIndex = 1;
width: '180px' this.pagination.pageSize = pageSize;
this.getDataList()
}, },
{ change(pageNum, pageSize) {
title: '发放数量', this.pagination.pageIndex = pageNum;
dataIndex: 'provideNumber', this.pagination.pageSize = pageSize;
width: '100px' this.getDataList()
}, },
{ restSearchForm() {
title: '联系电话', this.searchForm = {
dataIndex: 'telephone', idCar: undefined,
width: '140px' date: []
}
this.searchList()
}, },
{ toAdd() {
title: '发放医生', if (process.env.NODE_ENV == "dev") {
dataIndex: 'provideDoctorName', this.$router.push({path: '/folviteDistribution/add', query: {routerFlag: 'add', menuId: this.menuId}})
width: '180px' } else {
let now_location = escape(process.env.VUE_APP_LOCATION + `folviteDistribution/add?menuId=${this.menuId}&menuCode=${this.routerParams.menuName}&routerFlag=add`)
window.top.postMessage({messageType: 'THIRD_PAGEADD', title: `发放登记`, url: now_location}, '*')
}
}, },
{ toDetail(record) {
title: '类型', if (process.env.NODE_ENV == "dev") {
dataIndex: 'sourceName', let par = {
width: '140px' menuId: this.menuId,
id: record.id
}
this.$router.push({path: '/folviteDistribution/detail', query: par})
} else {
let now_location = escape(process.env.VUE_APP_LOCATION + `folviteDistribution/detail?menuId=${this.menuId}&menuCode=${this.routerParams.menuName}&id=${record.id}&source=${record.source}`)
window.top.postMessage({messageType: 'THIRD_PAGEADD', title: `查看详情`, url: now_location}, '*')
}
}, },
{ updateRecord(record) {
title: '现住址', if (process.env.NODE_ENV == "dev") {
// dataIndex: 'nowAddress', let params = {
key: 'nowAddress', id: record.id,
ellipsis: true, routerFlag: 'updateRecord',
scopedSlots: {customRender: 'nowAddress'}, menuId: this.menuId
}
this.$router.push({path: '/folviteDistribution/add', query: params})
} else {
let now_location = escape(process.env.VUE_APP_LOCATION + `folviteDistribution/add?menuId=${this.menuId}&menuCode=${this.routerParams.menuName}&routerFlag=updateRecord&id=` + record.id)
window.top.postMessage({
messageType: 'THIRD_PAGEADD',
title: `叶酸发放登记修改-` + record.womanName,
url: now_location
}, '*')
}
}, },
{ deleteRecord(record) {
title: '操作', this.$api.folviteDistributionManage.fetchFolviteDelete(record.id).then(({data = [], code}) => {
fixed: 'right', if (code == 'SUCCESS') {
align: 'left', this.$message.success("删除成功!");
width: "300px", this.getDataList();
scopedSlots: {customRender: 'action'}, } else {
this.$message.error("删除失败!");
}
})
}, },
] uploadConsentInfo(row) {
export default { this.formData.id = row.id;
components: {dateRangePicker}, this.visible = true;
data() { },
return { showConsentInfo(row) {
// 搜索框对象 this.currentRow = row;
searchForm: { this.showVisible = true;
date: [], let par = {
womenName: "", menuId: this.menuId,
womenIdCard: undefined, residentId: row.id
telephone: "" }
}, this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => {
pagination: { this.consentUrl = data.consentUrl;
pageIndex: 1, this.applySignUrl = data.applySignUrl;
pageSize: 10, })
total: 0, if (row.source == 2) {
pageSizeOptions: ['10', '20', '30', '40', '50'], let par = {
}, menuId: this.menuId
columns,
tableData: [],
loading: false,
visible: false,
showVisible: false,
previewVisible: false,
consentUrl: "",
applySignUrl: "",
consentInfo: "",
headers: {
Authorization: sessionStorage.getItem("token")
},
uploadAction: process.env.VUE_APP_BASE_URL + process.env.VUE_APP_SERVICE_API + "/v1/folacin-admin/sys-pictures-info/upload-img",
fileList: [],
formData: {
consentId: "",
id: ""
},
currentRow: {},
menuId: undefined,
qrCodeShow: false,
qrCodeUrl: "",
unitInfo: {unitName: ""},
printDisplay: 'none',
showQrCode: process.env.VUE_APP_SHOW_QR_CODE == 'true'
} }
this.$api.common.fetchConsentInfoShow(par).then(({data}) => {
if (this.$api.utils.isNoBlank(data)) {
this.consentInfo = data.content;
}
})
}
}, },
created() { handleChange(info) {
this.routerParams = this.$route.query; let fileList = [...info.fileList];
if (this.routerParams.menuId) { fileList = fileList.slice(-1);
window.sessionStorage.setItem('menuId', this.routerParams.menuId); let isFail = false;
this.menuId = this.routerParams.menuId; fileList = fileList.map(file => {
if (file.response) {
if (file.response.code != 'SUCCESS') {
isFail = true;
return;
}
this.consentUrl = file.response.data.trueDownloadUrl;
this.formData.consentId = file.response.data.id;
} }
this.getDataList(); return file;
});
if (isFail) {
this.formData.consentId = "";
this.$message.warning("文件上传失败");
return;
}
if (fileList.length == 0) {
this.formData.consentId = "";
}
this.fileList = fileList;
}, },
methods: { handleReject(info) {
getIdCardInfo() { this.$message.warning('请上传JPG、PNG格式图片');
GetUserInfoByCardDevice().then(res => { return false;
let {cardno, name, address} = res; },
this.searchForm.womenIdCard = cardno preview(val) {
}) window.open(val.response.data.trueDownloadUrl)
}, },
searchList() { onCancel() {
this.pagination.pageIndex = 1; this.visible = false;
this.getDataList(); this.fileList = [];
}, this.formData.consentId = null;
getDataList() { },
this.loading = true onsubmit() {
let pars = isEmptyParams(this.searchForm) if (this.currentRow.source == 1) {
let par = { this.visible = false;
...pars, return;
provideDateStart: this.searchForm.date[0], }
provideDateEnd: this.searchForm.date[1], if (this.$api.utils.isBlank(this.formData.consentId)) {
pageIndex: this.pagination.pageIndex, this.$message.warning('请上传文件');
pageSize: this.pagination.pageSize, return;
menuId: this.menuId }
} let par = {
this.$api.folviteDistributionManage.fetchFolviteDistributionList(par).then(({data = {}}) => { ...this.formData,
const {dataList = [], total = 0} = data; menuId: this.menuId
this.tableData = dataList }
this.pagination.total = total this.$api.folviteDistributionManage.fetchFolviteUploadConsent(par).then(res => {
this.loading = false if (res.code === 'SUCCESS') {
}).catch(() => { this.fileList = [];
this.loading = false this.formData.consentId = "";
}) this.searchList();
}, this.visible = false;
// 分页
showSizeChange(pageNum, pageSize) {
this.pagination.pageIndex = 1;
this.pagination.pageSize = pageSize;
this.getDataList()
},
change(pageNum, pageSize) {
this.pagination.pageIndex = pageNum;
this.pagination.pageSize = pageSize;
this.getDataList()
},
restSearchForm() {
this.searchForm = {
idCar: undefined,
date: []
}
this.searchList()
},
toAdd() {
if (process.env.NODE_ENV == "dev") {
this.$router.push({path: '/folviteDistribution/add', query: {routerFlag: 'add', menuId: this.menuId}})
} else {
let now_location = escape(process.env.VUE_APP_LOCATION + `folviteDistribution/add?menuId=${this.menuId}&menuCode=${this.routerParams.menuName}&routerFlag=add`)
window.top.postMessage({messageType: 'THIRD_PAGEADD', title: `发放登记`, url: now_location}, '*')
}
},
toDetail(record) {
if (process.env.NODE_ENV == "dev") {
let par = {
menuId: this.menuId,
id: record.id
}
this.$router.push({path: '/folviteDistribution/detail', query: par})
} else {
let now_location = escape(process.env.VUE_APP_LOCATION + `folviteDistribution/detail?menuId=${this.menuId}&menuCode=${this.routerParams.menuName}&id=${record.id}&source=${record.source}`)
window.top.postMessage({messageType: 'THIRD_PAGEADD', title: `查看详情`, url: now_location}, '*')
}
},
updateRecord(record) {
if (process.env.NODE_ENV == "dev") {
let params = {
id: record.id,
routerFlag: 'updateRecord',
menuId: this.menuId
}
this.$router.push({path: '/folviteDistribution/add', query: params})
} else {
let now_location = escape(process.env.VUE_APP_LOCATION + `folviteDistribution/add?menuId=${this.menuId}&menuCode=${this.routerParams.menuName}&routerFlag=updateRecord&id=` + record.id)
window.top.postMessage({
messageType: 'THIRD_PAGEADD',
title: `叶酸发放登记修改-` + record.womanName,
url: now_location
}, '*')
}
},
deleteRecord(record) {
this.$api.folviteDistributionManage.fetchFolviteDelete(record.id).then(({data = [], code}) => {
if (code == 'SUCCESS') {
this.$message.success("删除成功!");
this.getDataList();
} else {
this.$message.error("删除失败!");
}
})
},
uploadConsentInfo(row) {
this.formData.id = row.id;
this.visible = true;
},
showConsentInfo(row) {
this.currentRow = row;
this.showVisible = true;
let par = {
menuId: this.menuId,
residentId: row.id
}
this.$api.folviteDistributionManage.fetchFolviteDistributionDetail(par).then(({data = [], code}) => {
this.consentUrl = data.consentUrl;
this.applySignUrl = data.applySignUrl;
})
if (row.source == 2) {
let par = {
menuId: this.menuId
}
this.$api.common.fetchConsentInfoShow(par).then(({data}) => {
if (this.$api.utils.isNoBlank(data)) {
this.consentInfo = data.content;
}
})
}
},
handleChange(info) {
let fileList = [...info.fileList];
fileList = fileList.slice(-1);
let isFail = false;
fileList = fileList.map(file => {
if (file.response) {
if (file.response.code != 'SUCCESS') {
isFail = true;
return;
}
this.consentUrl = file.response.data.trueDownloadUrl;
this.formData.consentId = file.response.data.id;
}
return file;
});
if (isFail) {
this.formData.consentId = "";
this.$message.warning("文件上传失败");
return;
}
if (fileList.length == 0) {
this.formData.consentId = "";
}
this.fileList = fileList;
},
handleReject(info) {
this.$message.warning('请上传JPG、PNG格式图片');
return false;
},
preview(val) {
window.open(val.response.data.trueDownloadUrl)
},
onCancel() {
this.visible = false;
this.fileList = [];
this.formData.consentId = null;
},
onsubmit() {
if (this.currentRow.source == 1) {
this.visible = false;
return;
}
if (this.$api.utils.isBlank(this.formData.consentId)) {
this.$message.warning('请上传文件');
return;
}
let par = {
...this.formData,
menuId: this.menuId
}
this.$api.folviteDistributionManage.fetchFolviteUploadConsent(par).then(res => {
if (res.code === 'SUCCESS') {
this.fileList = [];
this.formData.consentId = "";
this.searchList();
this.visible = false;
}
})
},
share() {
this.qrCodeShow = true;
//不是一个链接APP不给回调,就用一下公司域名吧
let url = "https://www.yiboshi.com?" + this.unitInfo.id;
QRCode.toDataURL(url, {width: 500, height: 400, margin: 2})
.then(qrCodeUrl => {
this.qrCodeUrl = qrCodeUrl;
}).catch(err => {
// console.error(err);
});
},
qrCodePrint() {
this.printDisplay = 'block';
this.$print(this.$refs.printContent);
// window.print("<H1>HAHA</H1>");
} }
})
},
share() {
this.qrCodeShow = true;
//不是一个链接APP不给回调,就用一下公司域名吧
let url = "https://www.yiboshi.com?" + this.unitInfo.id;
QRCode.toDataURL(url, {width: 500, height: 400, margin: 2})
.then(qrCodeUrl => {
this.qrCodeUrl = qrCodeUrl;
}).catch(err => {
// console.error(err);
});
}, },
mounted() { qrCodePrint() {
let that = this; this.printDisplay = 'block';
window.addEventListener("message", function (data) { this.$print(this.$refs.printContent);
that.getDataList(); // window.print("<H1>HAHA</H1>");
});
let timer = setInterval(res => {
let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo'));
if (unitInfo) {
that.unitInfo = unitInfo;
clearInterval(timer)
}
}, 500)
} }
},
mounted() {
let that = this;
window.addEventListener("message", function (data) {
that.getDataList();
});
let timer = setInterval(res => {
let unitInfo = JSON.parse(window.sessionStorage.getItem('unitInfo'));
if (unitInfo) {
that.unitInfo = unitInfo;
clearInterval(timer)
}
}, 500)
}
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
// 文件上传样式 // 文件上传样式
.ant-upload-select-picture-card i { .ant-upload-select-picture-card i {
font-size: 32px; font-size: 32px;
color: #999; color: #999;
} }
.ant-upload-select-picture-card .ant-upload-text { .ant-upload-select-picture-card .ant-upload-text {
margin-top: 6px; margin-top: 6px;
color: #666; color: #666;
} }
.btn_space { .btn_space {
margin-right: 5px; margin-right: 5px;
} }
/* .search_form { /* .search_form {
...@@ -509,11 +525,11 @@ export default { ...@@ -509,11 +525,11 @@ export default {
padding: 30px; padding: 30px;
}*/ }*/
.ellipsis { .ellipsis {
display: block; display: block;
width: 100%; width: 100%;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
///deep/ .ant-table-tbody{ ///deep/ .ant-table-tbody{
......
...@@ -105,30 +105,6 @@ export const timeFormat = (time, format = 'YYYY-MM-DD') => { ...@@ -105,30 +105,6 @@ export const timeFormat = (time, format = 'YYYY-MM-DD') => {
return atime return atime
} }
/**
* 非空判断 已挂载到原型上$isNot
* 解决Vue Template模板中无法使用可选链的问题
* eg:
* let ces = {
data: {
data1: {
name: '测试'
}
}
}
let b = this.$isNot(ces, 'data', 'data1', 'name') //测试
{{$isNot(ces, 'data', 'data1', 'name')}} //测试
*/
// export const optionalChaining = (obj, ...rest) => {
// let tmp = obj;
// for (let key in rest) {
// let name = rest[key];
// tmp = tmp?.[name]; //es11可选链
// }
// return tmp ?? "未知";
// };
// 校验手机号 // 校验手机号
export const checkPhone = (rule, value, callback) => { export const checkPhone = (rule, value, callback) => {
if (value == '' || value == undefined) { if (value == '' || value == undefined) {
...@@ -231,18 +207,22 @@ export function areCodeTrans(areaCode) { ...@@ -231,18 +207,22 @@ export function areCodeTrans(areaCode) {
//末尾填充0实现 //末尾填充0实现
return areCodeTrans2(areaCode); return areCodeTrans2(areaCode);
} }
areaCode = areaCode.replaceAll("0000000000", "");
areaCode = areaCode.replaceAll("00000000", "");
areaCode = areaCode.replaceAll("000000", "");
areaCode = areaCode.replaceAll("000", "");
//末尾不填充0实现 //末尾不填充0实现
if (areaCode.length >= 2) { if (areaCode.length >= 2) {
areaCodeList.push(areaCode.substring(0, 2)) areaCodeList.push(areaCode.substring(0, 2))
} }
if (areaCode.length >= 4) { if (areaCode.length >= 4) {
areaCodeList.push(areaCode.substring(0, 4)) areaCodeList.push(areaCode.substring(0, 4) + "00000000")
} }
if (areaCode.length >= 6) { if (areaCode.length >= 6) {
areaCodeList.push(areaCode.substring(0, 6)) areaCodeList.push(areaCode.substring(0, 6) + "000000")
} }
if (areaCode.length >= 9) { if (areaCode.length >= 9) {
areaCodeList.push(areaCode.substring(0, 9)) areaCodeList.push(areaCode.substring(0, 9) + "000")
} }
if (areaCode.length >= 12) { if (areaCode.length >= 12) {
areaCodeList.push(areaCode) areaCodeList.push(areaCode)
......
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