提交 15fd3b6c 编写于 作者: yi.li's avatar yi.li

选择居民的调整及编辑个人信息的部分校验

上级 017736e1
......@@ -193,7 +193,7 @@
@current-change="handleCurrentChangePre"
layout="total, sizes, prev, pager, next, jumper"
:current-page="paginationSet.pageNum"
:page-sizes="[5,10,50,100]"
:page-sizes="[15,30,50,100]"
:page-size="paginationSet.pageSize"
:total="paginationSet.total">
</el-pagination>
......@@ -232,7 +232,7 @@
},
paginationSet: {
pageNum: 1,
pageSize: 5,
pageSize: 15,
total: 0
},
sexOptions: [{
......@@ -250,6 +250,7 @@
],
fuPlanOptions: [],
newSelects: [], //新选中的人
oldPatientList: [],
getRowKeys(row) {
return row.patientId;
},
......@@ -260,13 +261,6 @@
patientIdList: Array,// 确定已经选过的居民
oldPatientIdList: Array,// 确定已经选过的居民
selectPatientType: Number, //获取居民列表所需字段,随访是1,分组是2,患教是3
// fuPlanIdList: {
// required: false,
// type: Array,
// default: function () {
// return [];
// }
// }, //获取居民列表所需字段,若是随访,则需要传值
},
watch: {
isShowSelectPatient(val){
......@@ -378,9 +372,11 @@
}
}
if(this.oldPatientIdList!=undefined&&this.oldPatientIdList.length) {
this.oldPatientList = [];
this.patientsData.forEach((item)=>{
if(this.oldPatientIdList.includes(item.patientId)){// 如果已经选过居民
item.disableNum = 0
item.disableNum = 0;
this.oldPatientList.push(item);
} else {
item.disableNum = 1
}
......@@ -429,7 +425,7 @@
},
sureClick(){
if(this.newSelects.length) {
this.$emit('sureSelectPatient',false,this.newSelects)
this.$emit('sureSelectPatient',false,this.newSelects,this.oldPatientList)
} else {
this.$message.warning('请先选择!')
}
......
......@@ -140,6 +140,7 @@
<select-patient
:isShowSelectPatient="isShowSelectPatient"
:patientIdList="patientIdList"
:oldPatientIdList="patientIdList"
@closeSelectPatient="closeSelectPatient"
:selectPatientType="selectPatientType"
@sureSelectPatient="sureSelectPatient(arguments)"
......@@ -402,12 +403,14 @@
sureSelectPatient() {
let getArguments = arguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人
const oldPatients = getArguments[2]; // 该分组已经存在的居民
let labelId = this.$route.query.labelId;
let patientLen = selectPatients.length;
let savePatientsList = selectPatients.concat(oldPatients);
saveLabelsForPatient(labelId,{
newLablelName: this.$route.query.labelName,
oldLabelName: this.$route.query.labelName,
saveLists: selectPatients,
saveLists: savePatientsList,
// token:
}).then((data) => {
if(data.code == '000000') {
......
......@@ -68,6 +68,7 @@
this.checkForm = false;
if(val.status) {
// this.patientInfo = val.patientInfoForm
// console.log('保存的数据',val.patientInfoForm);
savePatientInfo(val.patientInfoForm).then(data => {
if(data.code == '000000'){
this.$message.success('修改成功')
......
......@@ -12,10 +12,8 @@
<el-col :span="12">
<el-form-item label="居民姓名" prop="nickname">
<el-input
v-model="patientInfoForm.nickname"
v-model.trim="patientInfoForm.nickname"
placeholder="请输入居民姓名"
minlength="2"
maxlength="15"
:disabled="!baseInfoEdit"
clearable>
</el-input>
......@@ -24,7 +22,7 @@
<el-col :span="12">
<el-form-item label="手机号" prop="mobilePhone">
<el-input
v-model="patientInfoForm.mobilePhone"
v-model.trim="patientInfoForm.mobilePhone"
maxlength="11"
placeholder="请输入手机号"
:disabled="!baseInfoEdit"
......@@ -46,7 +44,7 @@
placeholder="请选择居民疾病诊断">
<el-option
v-for="(item, index) in diseasesList"
:key="index"
:key="item.diseaseId"
:label="item.diseaseName"
:value="item.diseaseId">
</el-option>
......@@ -62,7 +60,7 @@
placeholder="请选择居民分组">
<el-option
v-for="(item, index) in labelsList"
:key="index"
:key="index.labelId"
:label="item.labelName"
:value="item.labelId">
</el-option>
......@@ -75,7 +73,7 @@
<el-col :span="12">
<el-form-item label="身份证" prop="idNo">
<el-input
v-model="patientInfoForm.idNo"
v-model.trim="patientInfoForm.idNo"
placeholder="请输入身份证"
clearable
maxlength="18"
......@@ -93,6 +91,7 @@
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
@change="getAge"
:picker-options="setPickerOption"
style="width:250px"
clearable>
</el-date-picker>
......@@ -150,7 +149,7 @@
<el-col :span="12">
<el-form-item label="医保号" prop="socialCard">
<el-input
v-model="patientInfoForm.socialCard"
v-model.trim="patientInfoForm.socialCard"
placeholder="请输入居民医保卡号码"
maxlength="30"
clearable>
......@@ -160,7 +159,7 @@
<el-col :span="12">
<el-form-item label="健康档案编号" prop="fileLocator">
<el-input
v-model="patientInfoForm.fileLocator"
v-model.trim="patientInfoForm.fileLocator"
placeholder="请输入居民健康档案编号"
maxlength="30"
clearable>
......@@ -250,6 +249,20 @@
name: "basicInfo",
components: {},
data() {
let validCode=(rule,value,callback)=>{
if(value) {
let reg=/^[0-9a-zA-Z]*$/g
if(!reg.test(value)){
callback(new Error('只可输入数字加英文'))
}else if(value.length >30) {
callback(new Error('只可输入30个以内的字符'))
}else{
callback()
}
}else {
callback()
}
};
let checkCardNum = (rule, value, callback) =>{
let vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",
21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",
......@@ -320,9 +333,21 @@
tipsText: '展开录入完整信息',
isShowAll: false,
rules: {
nickname: [{required: true, message: '请输入居民姓名', trigger: ['change', 'blur'] }],
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }],
nickname: [{required: true, message: '请输入居民姓名', trigger: ['change', 'blur'] },
{ min: 2, max: 15, message: '长度在2至15个字符之间', trigger: 'change' }],
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },
{ validator: checkMobile , trigger: ['blur','change'] }],
idNo: [{required: false,validator: checkCardNum, trigger: ['change'] }],
socialCard: [{required: false,validator: validCode, trigger: ['change'] }],
fileLocator: [{required: false,validator: validCode, trigger: ['change'] }],
},
setPickerOption: {
// disabledDate(time) {
// let curDate = (new Date()).getTime();
// let three = 90 * 24 * 3600 * 1000;
// let threeMonths = curDate - three;
// return time.getTime() > Date.now() || time.getTime() < threeMonths;;
// }
},
}
},
......@@ -516,41 +541,39 @@
})
},
saveInfoData() {
this.$refs['patientInfoForm'].validate((valid) => {
//对地区数据做处理
if(this.addressList.length > 0) {
this.patientInfoForm.provinceId = this.addressList[0];
this.patientInfoForm.cityId = this.addressList[1];
this.patientInfoForm.countyId = this.addressList[2];
this.patientInfoForm.townId = this.addressList[3];
this.provinceLists.forEach((item) => {
if(this.patientInfoForm.provinceId == item.provinceId) {
this.patientInfoForm.provinceName = item.provinceName;
}
});
this.cityLists.forEach((item) => {
if(this.patientInfoForm.cityId == item.cityId) {
this.patientInfoForm.cityName = item.cityName;
}
});
this.countyLists.forEach((item) => {
if(this.patientInfoForm.countyId == item.countyId) {
this.patientInfoForm.countyName = item.countyName;
}
})
this.townLists.forEach((item) => {
if(this.patientInfoForm.townId == item.townId) {
this.patientInfoForm.townName = item.townName;
}
})
if(this.patientInfoForm.provinceName && this.patientInfoForm.cityName && this.patientInfoForm.countyName && this.patientInfoForm.townName) {
this.patientInfoForm.patientAddress = `${this.patientInfoForm.provinceName}${this.patientInfoForm.cityName}${this.patientInfoForm.countyName}${this.patientInfoForm.townName}`
}else {
this.patientInfoForm.patientAddress = '';
// this.$message.warning('请选择正确的地区')
// return ;
//对地区数据做处理
if(this.addressList.length > 0) {
this.patientInfoForm.provinceId = this.addressList[0];
this.patientInfoForm.cityId = this.addressList[1];
this.patientInfoForm.countyId = this.addressList[2];
this.patientInfoForm.townId = this.addressList[3];
this.provinceLists.forEach((item) => {
if(this.patientInfoForm.provinceId == item.provinceId) {
this.patientInfoForm.provinceName = item.provinceName;
}
});
this.cityLists.forEach((item) => {
if(this.patientInfoForm.cityId == item.cityId) {
this.patientInfoForm.cityName = item.cityName;
}
});
this.countyLists.forEach((item) => {
if(this.patientInfoForm.countyId == item.countyId) {
this.patientInfoForm.countyName = item.countyName;
}
})
this.townLists.forEach((item) => {
if(this.patientInfoForm.townId == item.townId) {
this.patientInfoForm.townName = item.townName;
}
})
if(this.patientInfoForm.provinceName && this.patientInfoForm.cityName && this.patientInfoForm.countyName && this.patientInfoForm.townName) {
this.patientInfoForm.patientAddress = `${this.patientInfoForm.provinceName}${this.patientInfoForm.cityName}${this.patientInfoForm.countyName}${this.patientInfoForm.townName}`
}else {
this.patientInfoForm.patientAddress = '';
}
}
this.$refs['patientInfoForm'].validate((valid) => {
if(!this.patientInfoForm.idNo) {
this.patientInfoForm.idNo = null;
}
......
......@@ -272,6 +272,8 @@
message: h('div', null, newDatas),
confirmButtonText: '确认删除',
cancelButtonText: '取消',
closeOnClickModal: false,
closeOnPressEscape: false,
type: 'warning'
}).then(() => {
let reqParam = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册