提交 148b9005 编写于 作者: yi.li's avatar yi.li

细节调节

上级 dcbcb6f3
......@@ -394,6 +394,7 @@
let getArguments = arguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人
let labelId = this.$route.query.labelId;
let patientLen = selectPatients.length;
saveLabelsForPatient(labelId,{
newLablelName: this.$route.query.labelName,
oldLabelName: this.$route.query.labelName,
......@@ -402,7 +403,7 @@
}).then((data) => {
if(data.code == '000000') {
setTimeout(() => {
this.$message.success(data.message)
this.$message.success(`已成功添加${patientLen}位居民`)
this.isShowSelectPatient = getArguments[0];
this.getDetail();
},500)
......
......@@ -8,7 +8,7 @@
</bread-crumb>
<div class="f-main-content screenSet">
<div class="header-title">
<span>基本信息</span>
<span>居民信息</span>
<p>
<el-button plain size="small" @click="cancelEdit">取消</el-button>
<el-button type="primary" size="small" @click="saveEdit">保存</el-button>
......@@ -72,8 +72,8 @@
addListenSave(val) {
this.checkForm = false;
if(val.status) {
this.patientInfo = val.patientInfoForm
savePatientInfo(this.patientInfo).then(data => {
// this.patientInfo = val.patientInfoForm
savePatientInfo(val.patientInfoForm).then(data => {
if(data.code == '000000'){
this.$message.success('保存备注成功')
setTimeout(() => {
......
......@@ -43,8 +43,8 @@
@change="changeDiseases"
placeholder="请选择居民疾病诊断">
<el-option
v-for="item in diseasesList"
:key="item.diseaseId"
v-for="(item, index) in diseasesList"
:key="index"
:label="item.diseaseName"
:value="item.diseaseId">
</el-option>
......@@ -119,8 +119,8 @@
placeholder="请选择居民常驻类型"
clearable>
<el-option
v-for="item in residenceList"
:key="item.no"
v-for="(item, index) in residenceList"
:key="index"
:label="item.value"
:value="item.noChar">
</el-option>
......@@ -134,8 +134,8 @@
placeholder="请选择民族"
clearable>
<el-option
v-for="item in nationsList"
:key="item.code"
v-for="(item, index) in nationsList"
:key="index"
:label="item.name"
:value="item.code">
</el-option>
......@@ -168,11 +168,11 @@
<div class="has-header">联系方式</div>
<el-row>
<el-col :span="12">
<el-form-item label="所在地区" prop="patientAddress">
<el-form-item label="所在地区" prop="addressList">
<el-cascader
placeholder="请选择省市县乡"
:options="provinceList"
v-model="patientInfoForm.patientAddress"
v-model="addressList"
@active-item-change="handleItemChange"
:props="optionProps">
</el-cascader>
......@@ -288,6 +288,7 @@
nationsList: [],
diseaseIdList: [],
labelIdList: [],
addressList: [],
baseInfoEdit: true,
patientInfoForm: {
nickname: '',
......@@ -307,9 +308,13 @@
isRemind: 1,
wechatNickname: '',
remark: '',
patientAddress: [],
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
},
hasIdNo: false,
validStatus: false,
......@@ -320,14 +325,15 @@
},
optionProps: {
// value: 'value',
// children: 'cities'
value: "id",
label: "name",
children: "children"
},
provinceList: [],
provinceLists: [], //省列表
cityLists: [], //市列表
countyLists: [], //县列表
townLists: [],//乡镇列表
}
},
props: {
......@@ -361,10 +367,17 @@
}else {
this.hasIdNo = false;
}
// this.$refs['patientInfoForm'].clearValidate();
this.patientInfoForm.patientAddress = []; // 特殊处理
//对地区数据做处理
if(this.patientInfoForm.patientAddress) {
this.addressList[0] = this.patientInfoForm.provinceId;
this.addressList[1] = this.patientInfoForm.cityId;
this.addressList[2] = this.patientInfoForm.countyId;
this.addressList[3] = this.patientInfoForm.townId;
// this.addressList = JSON.parse(this.addressList);
}else {
this.addressList = [];
}
this.$refs['patientInfoForm'].clearValidate();
this.$forceUpdate();
}else {
// 新增
......@@ -386,9 +399,13 @@
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: [],
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}
}
},
......@@ -397,8 +414,8 @@
this.saveInfoData();
}
},
idNo(newv, oldv) {
idNo(newVal, oldVal) {
console.log('>>>',newVal,oldVal)
}
},
created() {
......@@ -457,7 +474,6 @@
}
})
});
// this.patientInfoForm.diseases = newDiseaseList;
this.patientInfoForm.patientDiseases = newDiseaseList;
},
changeLabels(val){
......@@ -491,8 +507,36 @@
},
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;
}
})
this.patientInfoForm.patientAddress = `${this.patientInfoForm.provinceName}${this.patientInfoForm.cityName}${this.patientInfoForm.countyName}${this.patientInfoForm.townName}`
}
if (valid) {
console.log('对象',this.patientInfoForm)
// console.log('提交表单',this.patientInfoForm);
this.$emit('addListenSave',{
status: true,
patientInfoForm: {
......@@ -557,26 +601,24 @@
}
},
handleItemChange (val) {
console.log('地区选择',val);
if (val.length === 1) {
if (val.length === 1) { //获取市(二级)
this.getCity(val[0]);
// 获取地区 (三级)
} else if (val.length === 2) { //获取县区 (三级)
this.getCounty(val[0], val[1]);
} else if(val.length === 3) { //获取乡镇 (四级)
this.getTown(val[0], val[1], val[2]);
}
// else if (val.length === 2) {
// this.getAreaList(val[0], val[1]);
// }
},
getProvinceLists() {
getProvinceList({}).then((data) => {
if(data.code == '000000') {
let provinceLists = data.data.provinceList;
provinceLists.map(item => {
this.provinceLists = data.data.provinceList;
this.provinceLists.map(item => {
this.$set(item, "id", item.provinceId);
this.$set(item, "name", item.provinceName);
this.$set(item, "children", []);
});
this.provinceList = provinceLists;
this.provinceList = this.provinceLists;
}
})
// this.$forceUpdate();
......@@ -584,15 +626,57 @@
getCity(provinceId) {
getCityList({provinceId: provinceId}).then((data) => {
if(data.code == '000000') {
let cityLists = data.data.cityList;
cityLists.map(item => {
this.cityLists = data.data.cityList;
this.cityLists.map(item => {
this.$set(item, "id", item.cityId);
this.$set(item, "name", item.cityName);
this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children = cityLists;
item.children = this.cityLists;
}
})
}
})
},
getCounty(provinceId, cityId) {
getCountyList({cityId: cityId}).then((data) => {
if(data.code == '000000') {
this.countyLists = data.data.countyList;
this.countyLists.map(item => {
this.$set(item, "id", item.countyId);
this.$set(item, "name", item.countyName);
this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, idx) => {
city.children = this.countyLists;
})
}
})
}
})
},
getTown(provinceId, cityId, countyId) {
getTownList({countyId: countyId}).then((data) => {
if(data.code == '000000') {
this.townLists = data.data.townList;
this.townLists.map(item => {
this.$set(item, "id", item.townId);
this.$set(item, "name", item.townName);
// this.$set(item, "children", []);
});
this.provinceList.map((item, index) => {
if(item.id == provinceId) {
item.children.map((city, index2) => {
if(city.id == cityId) {
city.children.map((county, index3) => {
county.children = this.townLists;
})
}
})
}
})
}
......
......@@ -24,7 +24,7 @@
<div><p class="title">身份证:</p><p class="info">{{patientInfo.idNo | emptyFilter}}</p></div>
</div>
<div class="item">
<div><p class="title">出生年月:</p><p class="info">{{birthTimeDisplay | emptyFilter}}</p></div>
<div><p class="title">出生年月:</p><p class="info">{{birthTimeDisplay | emptyFilter}}{{patientInfo.age ? `、${patientInfo.age}岁` : ''}}</p></div>
<div><p class="title">性别:</p><p class="info">{{patientInfo.sex | sexFileter}}</p></div>
</div>
<div class="item">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册