提交 1cdca983 编写于 作者: yi.li's avatar yi.li

地区回显问题

上级 a44787b2
...@@ -32,200 +32,203 @@ ...@@ -32,200 +32,203 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" style="text-align: center;margin-top:15px;" v-if="!patientId"> <el-button plain size="small" @click="toggleClick">{{tipsText}}</el-button></el-col>
</el-row> </el-row>
<div class="has-header">数据记录</div> <div v-show="isShowAll || patientId">
<el-row> <div class="has-header">数据记录</div>
<el-col :span="12"> <el-row>
<el-form-item label="诊断" prop="diseaseIdList"> <el-col :span="12">
<el-select <el-form-item label="诊断" prop="diseaseIdList">
v-model="diseaseIdList" <el-select
multiple v-model="diseaseIdList"
@change="changeDiseases" multiple
placeholder="请选择居民疾病诊断"> @change="changeDiseases"
<el-option placeholder="请选择居民疾病诊断">
v-for="(item, index) in diseasesList" <el-option
:key="index" v-for="(item, index) in diseasesList"
:label="item.diseaseName" :key="index"
:value="item.diseaseId"> :label="item.diseaseName"
</el-option> :value="item.diseaseId">
</el-select> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="分组" prop="labelIdList"> <el-col :span="12">
<el-select <el-form-item label="分组" prop="labelIdList">
v-model="labelIdList" <el-select
multiple v-model="labelIdList"
@change="changeLabels" multiple
placeholder="请选择居民分组"> @change="changeLabels"
<el-option placeholder="请选择居民分组">
v-for="(item, index) in labelsList" <el-option
:key="index" v-for="(item, index) in labelsList"
:label="item.labelName" :key="index"
:value="item.labelId"> :label="item.labelName"
</el-option> :value="item.labelId">
</el-select> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
</el-row> </el-col>
<div class="has-header">基本信息</div> </el-row>
<el-row> <div class="has-header">基本信息</div>
<el-col :span="12"> <el-row>
<el-form-item label="身份证" prop="idNo"> <el-col :span="12">
<el-input <el-form-item label="身份证" prop="idNo">
v-model="patientInfoForm.idNo" <el-input
placeholder="请输入身份证" v-model="patientInfoForm.idNo"
clearable placeholder="请输入身份证"
maxlength="18" clearable
@blur="idNoBlurHandler" maxlength="18"
:disabled="hasIdNo"> @blur="idNoBlurHandler"
</el-input> :disabled="hasIdNo">
</el-form-item> </el-input>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="出生日期" prop="birthTime"> <el-col :span="12">
<el-date-picker <el-form-item label="出生日期" prop="birthTime">
type="date" <el-date-picker
v-model="patientInfoForm.birthTime" type="date"
placeholder="请选择出生日期" v-model="patientInfoForm.birthTime"
value-format="yyyy-MM-dd" placeholder="请选择出生日期"
value="yyyy-MM-dd" value-format="yyyy-MM-dd"
@change="getAge" value="yyyy-MM-dd"
style="width:250px" @change="getAge"
clearable> style="width:250px"
</el-date-picker> clearable>
</el-form-item> </el-date-picker>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row> </el-row>
<el-col :span="12"> <el-row>
<el-form-item label="年龄" prop="age"> <el-col :span="12">
<span>{{(patientInfoForm.age || patientInfoForm.age == 0) ? `${patientInfoForm.age}岁` : '-'}}</span> <el-form-item label="年龄" prop="age">
</el-form-item> <span>{{(patientInfoForm.age || patientInfoForm.age == 0) ? `${patientInfoForm.age}岁` : '-'}}</span>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="性别" prop="sex"> <el-col :span="12">
<el-radio-group v-model="patientInfoForm.sex"> <el-form-item label="性别" prop="sex">
<el-radio :label="1"></el-radio> <el-radio-group v-model="patientInfoForm.sex">
<el-radio :label="2"></el-radio> <el-radio :label="1"></el-radio>
</el-radio-group> <el-radio :label="2"></el-radio>
</el-form-item> </el-radio-group>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row> </el-row>
<el-col :span="12"> <el-row>
<el-form-item label="常驻类型" prop="permanentResidence"> <el-col :span="12">
<el-select <el-form-item label="常驻类型" prop="permanentResidence">
v-model="patientInfoForm.permanentResidence" <el-select
placeholder="请选择居民常驻类型" v-model="patientInfoForm.permanentResidence"
clearable> placeholder="请选择居民常驻类型"
<el-option clearable>
v-for="(item, index) in residenceList" <el-option
:key="index" v-for="(item, index) in residenceList"
:label="item.value" :key="index"
:value="item.noChar"> :label="item.value"
</el-option> :value="item.noChar">
</el-select> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="民族" prop="nationality"> <el-col :span="12">
<el-select <el-form-item label="民族" prop="nationality">
v-model="patientInfoForm.nationality" <el-select
placeholder="请选择民族" v-model="patientInfoForm.nationality"
clearable> placeholder="请选择民族"
<el-option clearable>
v-for="(item, index) in nationsList" <el-option
:key="index" v-for="(item, index) in nationsList"
:label="item.name" :key="index"
:value="item.code"> :label="item.name"
</el-option> :value="item.code">
</el-select> </el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row> </el-row>
<el-col :span="12"> <el-row>
<el-form-item label="医保号" prop="socialCard"> <el-col :span="12">
<el-input <el-form-item label="医保号" prop="socialCard">
v-model="patientInfoForm.socialCard" <el-input
placeholder="请输入居民医保卡号码" v-model="patientInfoForm.socialCard"
maxlength="30" placeholder="请输入居民医保卡号码"
clearable> maxlength="30"
</el-input> clearable>
</el-form-item> </el-input>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="健康档案编号" prop="fileLocator"> <el-col :span="12">
<el-input <el-form-item label="健康档案编号" prop="fileLocator">
v-model="patientInfoForm.fileLocator" <el-input
placeholder="请输入居民健康档案编号" v-model="patientInfoForm.fileLocator"
maxlength="30" placeholder="请输入居民健康档案编号"
clearable> maxlength="30"
</el-input> clearable>
</el-form-item> </el-input>
</el-col> </el-form-item>
</el-row> </el-col>
<div class="has-header">联系方式</div> </el-row>
<el-row> <div class="has-header">联系方式</div>
<el-col :span="12"> <el-row>
<el-form-item label="所在地区" prop="addressList"> <el-col :span="12">
<el-cascader <el-form-item label="所在地区" prop="addressList">
placeholder="请选择省市县乡" <el-cascader
:options="provinceList" placeholder="请选择省市县乡"
v-model="addressList" :options="provinceList"
@active-item-change="handleItemChange" v-model="addressList"
:props="optionProps"> @active-item-change="handleItemChange"
</el-cascader> :props="optionProps">
</el-form-item> </el-cascader>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="详细地址" prop="address"> <el-col :span="12">
<el-input <el-form-item label="详细地址" prop="address">
v-model="patientInfoForm.address" <el-input
placeholder="请输入居民的详细地址" v-model="patientInfoForm.address"
maxlength="50" placeholder="请输入居民的详细地址"
clearable> maxlength="50"
</el-input> clearable>
</el-form-item> </el-input>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row> </el-row>
<el-col :span="12"> <el-row>
<el-form-item label="工作单位" prop="workplace"> <el-col :span="12">
<el-input <el-form-item label="工作单位" prop="workplace">
v-model="patientInfoForm.workplace" <el-input
placeholder="请输入居民的工作单位" v-model="patientInfoForm.workplace"
maxlength="30" placeholder="请输入居民的工作单位"
clearable> maxlength="30"
</el-input> clearable>
</el-form-item> </el-input>
</el-col> </el-form-item>
<el-col :span="12" v-if="patientId"> </el-col>
<el-form-item label="微信" prop="address"> <el-col :span="12" v-if="patientId">
<p class="info" v-if="patientInfoForm.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfoForm.isRemind == '1'" style="color: #449284;">提醒绑定</el-button><span class="ml10" v-if="patientInfoForm.isRemind == '2'">已提醒</span></p> <el-form-item label="微信" prop="address">
<!--<p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfoForm.wechatNickname | emptyFilter}}</span></p>--> <p class="info" v-if="patientInfoForm.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfoForm.isRemind == '1'" style="color: #449284;">提醒绑定</el-button><span class="ml10" v-if="patientInfoForm.isRemind == '2'">已提醒</span></p>
<p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">{{patientInfoForm.wechatNickname | emptyFilter}}</p> <!--<p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfoForm.wechatNickname | emptyFilter}}</span></p>-->
</el-form-item> <p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">{{patientInfoForm.wechatNickname | emptyFilter}}</p>
</el-col> </el-form-item>
</el-row> </el-col>
<div class="has-header">其他</div> </el-row>
<el-row> <div class="has-header">其他</div>
<el-col :span="16"> <el-row>
<el-form-item label="备注" prop="remark"> <el-col :span="16">
<el-input <el-form-item label="备注" prop="remark">
type="textarea" <el-input
v-model="patientInfoForm.remark" type="textarea"
placeholder="请输入内容" v-model="patientInfoForm.remark"
clearable placeholder="请输入内容"
maxlength="200" clearable
:autosize="{ minRows: 3, maxRows: 7}" maxlength="200"
show-word-limit> :autosize="{ minRows: 3, maxRows: 7}"
</el-input> show-word-limit>
<span class="text-count">{{currentCount}} / 200</span> </el-input>
</el-form-item> <span class="text-count">{{currentCount}} / 200</span>
</el-col> </el-form-item>
</el-row> </el-col>
</el-row>
</div>
</el-form> </el-form>
</div> </div>
</template> </template>
...@@ -304,22 +307,23 @@ ...@@ -304,22 +307,23 @@
}, },
hasIdNo: false, hasIdNo: false,
validStatus: false, validStatus: false,
rules: {
nickname: [{required: true, message: '请输入居民姓名', trigger: ['change', 'blur'] }],
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }],
idNo: [{required: false,validator: checkCardNum, trigger: ['change'] }],
},
optionProps: {
value: "id",
label: "name",
children: "children"
},
provinceList: [], provinceList: [],
provinceLists: [], //省列表 provinceLists: [], //省列表
cityLists: [], //市列表 cityLists: [], //市列表
countyLists: [], //县列表 countyLists: [], //县列表
townLists: [],//乡镇列表 townLists: [],//乡镇列表
optionProps: {
value: "id",
label: "name",
children: "children"
},
tipsText: '展开录入完整信息',
isShowAll: false,
rules: {
nickname: [{required: true, message: '请输入居民姓名', trigger: ['change', 'blur'] }],
mobilePhone: [{required: true, message: '请输入手机号', trigger: ['change', 'blur'] },{ validator: checkMobile , trigger: ['blur','change'] }],
idNo: [{required: false,validator: checkCardNum, trigger: ['change'] }],
},
} }
}, },
props: { props: {
...@@ -328,72 +332,86 @@ ...@@ -328,72 +332,86 @@
patientId: String, patientId: String,
}, },
watch: { watch: {
patientInfoObj(val){ // const obj = await searchObj(id).then(res => res);
if(this.patientId){ patientInfoObj: {
this.patientInfoForm = val; async handler(val) {
this.baseInfoEdit = this.patientInfoForm.baseInfoEdit; if(this.patientId){
let customLabels = this.patientInfoForm.customLabels; this.patientInfoForm = val;
let diseases = this.patientInfoForm.diseases; this.baseInfoEdit = this.patientInfoForm.baseInfoEdit;
if(customLabels && customLabels.length > 0){ let customLabels = this.patientInfoForm.customLabels;
customLabels.forEach((kkk)=>{ let diseases = this.patientInfoForm.diseases;
this.labelIdList.push(Number(kkk.labelId)) if(customLabels && customLabels.length > 0){
}) customLabels.forEach((kkk)=>{
}else { this.labelIdList.push(Number(kkk.labelId))
this.labelIdList = []; })
} }else {
if(diseases && diseases.length > 0) { this.labelIdList = [];
diseases.forEach((dis)=>{ }
this.diseaseIdList.push(Number(dis.diseaseId)) if(diseases && diseases.length > 0) {
}) diseases.forEach((dis)=>{
}else { this.diseaseIdList.push(Number(dis.diseaseId))
this.diseaseIdList = []; })
} }else {
if(this.patientInfoForm.idNo) { this.diseaseIdList = [];
this.hasIdNo = true; }
}else { if(this.patientInfoForm.idNo) {
this.hasIdNo = false; this.hasIdNo = true;
} }else {
//对地区数据做处理 this.hasIdNo = false;
if(this.patientInfoForm.patientAddress) { }
this.addressList[0] = parseInt(this.patientInfoForm.provinceId); //对地区数据做处理
this.addressList[1] = parseInt(this.patientInfoForm.cityId); if(this.patientInfoForm.patientAddress) {
this.addressList[2] = parseInt(this.patientInfoForm.countyId); let provinceId = this.patientInfoForm.provinceId;
this.addressList[3] = parseInt(this.patientInfoForm.townId); let cityId = this.patientInfoForm.cityId;
// this.addressList = JSON.parse(this.addressList); let countyId = this.patientInfoForm.countyId;
let townId = this.patientInfoForm.townId;
await this.getCity(provinceId);
await this.getCounty(provinceId, cityId);
await this.getTown(provinceId, cityId, countyId);
await setTimeout(() => {
this.addressList[0] = parseInt(provinceId);
this.addressList[1] = parseInt(cityId);
this.addressList[2] = parseInt(countyId);
this.addressList[3] = parseInt(townId);
},10);
this.$forceUpdate();
}else {
this.addressList = [];
}
// this.$refs['patientInfoForm'].clearValidate();
}else { }else {
this.addressList = []; // 新增
} this.patientInfoForm = {
this.$refs['patientInfoForm'].clearValidate(); nickname: '',
this.$forceUpdate(); mobilePhone: '',
}else { diseases: [],
// 新增 patientDiseases: [],
this.patientInfoForm = { customLabels: [],
nickname: '', idNo: '',
mobilePhone: '', birthTime: '',
diseases: [], age: '',
patientDiseases: [], sex: null,
customLabels: [], permanentResidence: '',
idNo: '', nationality: '',
birthTime: '', socialCard: '',
age: '', fileLocator: '',
sex: null, isWechatBind: null,
permanentResidence: '', isRemind: null,
nationality: '', wechatNickname: '',
socialCard: '', remark: '',
fileLocator: '', patientAddress: '',
isWechatBind: null, address: '',
isRemind: null, workplace: '',
wechatNickname: '', provinceId: null,
remark: '', cityId: null,
patientAddress: '', countyId: null,
address: '', townId: null,
workplace: '', }
provinceId: null,
cityId: null,
countyId: null,
townId: null,
} }
} },
deep: true,
}, },
checkForm(val){ checkForm(val){
if(val){// 触发校验 if(val){// 触发校验
...@@ -597,8 +615,8 @@ ...@@ -597,8 +615,8 @@
} }
this.$forceUpdate(); this.$forceUpdate();
}, },
getProvinceLists() { async getProvinceLists() {
getProvinceList({}).then((data) => { await getProvinceList({}).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
this.provinceLists = data.data.provinceList; this.provinceLists = data.data.provinceList;
this.provinceLists.map(item => { this.provinceLists.map(item => {
...@@ -607,11 +625,12 @@ ...@@ -607,11 +625,12 @@
this.$set(item, "children", []); this.$set(item, "children", []);
}); });
this.provinceList = this.provinceLists; this.provinceList = this.provinceLists;
// this.$forceUpdate();
} }
}) })
}, },
getCity(provinceId) { async getCity(provinceId) {
getCityList({provinceId: provinceId}).then((data) => { await getCityList({provinceId: provinceId}).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
this.cityLists = data.data.cityList; this.cityLists = data.data.cityList;
this.cityLists.map(item => { this.cityLists.map(item => {
...@@ -624,11 +643,12 @@ ...@@ -624,11 +643,12 @@
item.children = this.cityLists; item.children = this.cityLists;
} }
}) })
// this.$forceUpdate();
} }
}) })
}, },
getCounty(provinceId, cityId) { async getCounty(provinceId, cityId) {
getCountyList({cityId: cityId}).then((data) => { await getCountyList({cityId: cityId}).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
this.countyLists = data.data.countyList; this.countyLists = data.data.countyList;
this.countyLists.map(item => { this.countyLists.map(item => {
...@@ -643,11 +663,12 @@ ...@@ -643,11 +663,12 @@
}) })
} }
}) })
// this.$forceUpdate();
} }
}) })
}, },
getTown(provinceId, cityId, countyId) { async getTown(provinceId, cityId, countyId) {
getTownList({countyId: countyId}).then((data) => { await getTownList({countyId: countyId}).then((data) => {
if(data.code == '000000') { if(data.code == '000000') {
this.townLists = data.data.townList; this.townLists = data.data.townList;
this.townLists.map(item => { this.townLists.map(item => {
...@@ -667,8 +688,18 @@ ...@@ -667,8 +688,18 @@
} }
}) })
} }
// this.$forceUpdate();
}) })
}, },
toggleClick() {
if(this.isShowAll) {
this.tipsText = '展开录入完整信息';
this.isShowAll = false;
}else {
this.tipsText = '收起录入完整信息';
this.isShowAll = true;
}
}
}, },
filters: { filters: {
emptyFilter: function(value) { emptyFilter: function(value) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册