提交 425f450c 编写于 作者: chengxiang.li's avatar chengxiang.li

fix merge

......@@ -16,8 +16,43 @@ export const getConstants = (params) => {
description: '获取常量',
})
};
/*获取省市县乡列表*/
export const getProvinceList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/provinces`),
method: 'get',
params: params,
description: '获取省列表',
})
};
export const getCityList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/cities`),
method: 'get',
params: params,
description: '获取市列表',
})
};
export const getCountyList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/counties`),
method: 'get',
params: params,
description: '获取区县列表',
})
};
export const getTownList = (params) => {
return fetch({
headers,
url: getBaseUrl(`basic-data/position/towns`),
method: 'get',
params: params,
description: '获取乡镇列表',
})
};
/*居民管理*/
export const getPatientList = (data) => {
return fetch({
......@@ -116,6 +151,18 @@ export const deleteCurrentPatients = data => {
})
}
<<<<<<< HEAD
=======
export const saveLabelsForPatient = (labelId, data) => {
return fetch({
headers,
url: getBaseUrl(`healths/labels/${labelId}/patients`),
method: 'post',
data: data,
description: '分组中添加居民',
})
}
>>>>>>> 4f5afc8ed770a74179b192c64944c2c0c7273804
// 获取七牛上传token
export const getQiniuToken = (params) => {
......@@ -239,3 +286,13 @@ export const getHealthRecordList = (data) => {
description: '健康档案记录列表',
})
};
/*新的获取居民接口,搜索条件有变化*/
export const getPatientInfoList = (data) => {
return fetch({
headers,
url: getBaseUrl(`healths/patients/v2/infolist`),
method: 'post',
data: data,
description: '获取居民列表',
})
};
......@@ -7,7 +7,7 @@
:before-close="clickClose"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="950px"
width="1100px"
top="2%"
center>
<div class="finish-content">
......@@ -17,11 +17,16 @@
:inline="true"
class="select-width"
size="small">
<el-form-item>
<div style="display: flex;justify-content: flex-end;margin-bottom: 10px">
<el-button plain size="small" @click="goAddPatient">+ 新增居民</el-button>
</div>
<div style="display: flex;justify-content: space-between;">
<div>
<el-form-item style="width: 100px;" prop="sex">
<el-select
v-model="searchData.sex"
@change="changeSex"
placeholder="请选择性别">
placeholder="请选择性别"
clearable>
<el-option
v-for="(item,index) in sexOptions"
:key="index"
......@@ -30,13 +35,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item style="width: 140px;" prop="ageRange">
<el-select
v-model="searchData.ageRange"
@change="changeAge"
multiple
collapse-tags
placeholder="请选择年龄段">
placeholder="请选择年龄段"
clearable>
<el-option
v-for="(item,index) in ageOptions"
:key="index"
......@@ -45,13 +50,14 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item prop="diseaseId">
<el-select
v-model="searchData.diseaseId"
@change="changeDisease"
multiple
collapse-tags
placeholder="请选择诊断">
style="width: 200px;"
placeholder="请选择诊断"
clearable>
<el-option
v-for="(item,index) in diseaseOptions"
:key="index"
......@@ -60,14 +66,15 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item prop="labelId">
<el-select
v-model="searchData.labelId"
@change="changeLabel"
multiple
collapse-tags
filterable
placeholder="请选择或搜索分组">
style="width: 200px;"
placeholder="请选择或搜索分组"
clearable>
<el-option
v-for="(item,index) in labelOptions"
:key="index"
......@@ -76,21 +83,27 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item style="width:160px;">
<el-input v-model="searchData.searchCondition" placeholder="请输入姓名或手机号" >
<i slot="prefix" class="el-input__icon el-icon-search" @click="searchHandler" style="cursor: pointer"></i>
<el-form-item prop="searchCondition">
<el-input
v-model="searchData.searchCondition"
placeholder="请输入姓名,手机号,身份证"
clearable
style="width:200px;">
<!--<i slot="prefix" class="el-input__icon el-icon-search" @click="searchHandler" style="cursor: pointer"></i>-->
</el-input>
</el-form-item>
<el-form-item>
<el-button>查询</el-button>
<el-button>重置</el-button>
</el-form-item>
</div>
<div>
<el-button type="primary" @click="searchHandler" size="small">查询</el-button>
<el-button plain @click="resetData('searchData')" size="small">重置</el-button>
</div>
</div>
</el-form>
<el-table
:data="patientsData"
ref="multipleTable"
center
style="width: 100%;margin-top: 20px;"
style="width: 100%;margin-top: 10px;"
height="280"
:row-key="getRowKeys"
@selection-change="handleSelectionChange">
......@@ -108,35 +121,43 @@
<el-table-column
prop="sexStr"
label="性别"
min-width="50"
align="center">
</el-table-column>
<el-table-column
prop="age"
label="年龄"
min-width="50"
align="center">
</el-table-column>
<el-table-column
prop="mobilePhone"
label="手机"
align="center"
min-width="150px">
min-width="130">
</el-table-column>
<el-table-column
prop="idNo"
label="身份证"
align="center"
min-width="130">
</el-table-column>
<el-table-column
prop="showDiseaseNames"
label="基础疾病"
align="center"
width="200"
width="180"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="showLabelName"
label="分组"
align="center"
width="200"
width="180"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
<el-row type="flex" justify="end" class="margin-top20">
<el-row type="flex" justify="end" class="margin-top15">
<el-pagination
background
v-if="patientsData.length"
......@@ -160,7 +181,7 @@
<script>
import { mapState, mapActions } from 'vuex'
import { getBasicData, getPlanPatientsList, getAllDiseases, getAllLabels } from '@/utils/followup/followapis'
import { getConstants, getPatientInfoList, getDiseasesList, getLabelList } from '@/utils/patients/patientsapi'
export default {
components: {},
name: "select-patient",
......@@ -170,23 +191,12 @@
allSelects: [],
// eachSelects: [],//仅仅是操作选择的总人员
// totalSelect: [],// 当前所选的人
labelId: '',
diseaseId: '',
age: '',
sex: '',
ageBegin: '',
ageEnd: '',
srvPackageId: '',
searchCondition: '',
patientsData: [],
searchData: {
sex: null,
ageRange: [],
ageBegin: '',
ageEnd: '',
// diseaseId: '基础疾病',
diseaseId: [],
// labelId: '分组',
labelId: [],
searchCondition: ''
},
......@@ -200,26 +210,16 @@
value: '不限'
}],
ageOptions: [
// {
// no: '',
// value: '年龄范围'
// }
// {no: '', value: '年龄范围'}
],
diseaseOptions: [
// {
// diseaseId: '',
// diseaseName: '基础疾病'
// }
// {diseaseId: '', diseaseName: '基础疾病'}
],
labelOptions: [
// {
// labelId: '',
// labelName: '分组'
// }
// {labelId: '', labelName: '分组'}
],
newSelects: [], //新选中的人
getRowKeys(row) {
// console.log('sshkdhdk',row)
return row.patientId;
},
}
......@@ -234,7 +234,7 @@
if(val){
this.getPatientsList()
// 获取常量 性别、年龄
getBasicData({
getConstants({
numList: 'P057,P006'
}).then(res=>{
this.sexOptions = [{
......@@ -243,32 +243,23 @@
}];
this.sexOptions = this.sexOptions.concat(res.data.P006);//性别
this.ageOptions = [
// {
// no: '',
// value: '年龄范围'
// }
]
// {no: '', value: '年龄范围'}
];
this.ageOptions = this.ageOptions.concat(res.data.P057);//年龄段
})
// 获取所有疾病
getAllDiseases().then(res=>{
getDiseasesList().then(res=>{
this.diseaseOptions = [
// {
// diseaseId: '',
// diseaseName: '基础疾病'
// }
]
// {diseaseId: '', diseaseName: '基础疾病'}
];
this.diseaseOptions = this.diseaseOptions.concat(res.data);
})
// 获取所有分组
getAllLabels({type: 1}).then(res=>{
getLabelList({type: 1}).then(res=>{
this.labelOptions = [
// {
// labelId: '',
// labelName: '分组'
// }
// {labelId: '', labelName: '分组'}
]
this.labelOptions = this.labelOptions.concat(res.data.labelNameList);
})
......@@ -287,32 +278,33 @@
const data = {
pageSize: this.paginationSet.pageSize,
pageNo: this.paginationSet.pageNum,
labelId:this.labelId,
diseaseId: this.diseaseId,
age: this.age,
sex: this.sex,
ageBegin: this.ageBegin,
ageEnd: this.ageEnd,
labelIdList:this.searchData.labelId,
diseaseIdList: this.searchData.diseaseId,
ageList: this.searchData.ageRange,
sex: this.searchData.sex,
searchCondition:this.searchData.searchCondition,
srvPackageId:this.srvPackageId,
searchCondition:this.searchCondition,
addType: 1,
fuPlanIdList: [],
}
getPlanPatientsList(data).then(res=>{
getPatientInfoList(data).then(res=>{
if(res.data.patientList){
this.patientsData = res.data.patientList //接口获取的当页居民
this.getSex()
this.paginationSet.total = res.data.totalRows
// 设置所请求的当页人员是否成为选中状态
// console.log('传入的已选居民',this.patientIdList)
this.patientsData.forEach((item)=>{
item.disableNum = 1;
let diseaseNames = [];
let groupNames = []
if(!item.idNo) {
item.idNo = '-';
}
//转化分组
if(item.labelModels) {
item.labelModels.forEach(item => {
groupNames.push(item.label)
});
item.showLabelName = groupNames.join('、');
} else {
......@@ -396,40 +388,21 @@
},
handleSizeChangePre(val) {
// console.log('handleSizeChangePre')
this.paginationSet.pageSize = val
this.getPatientsList()
},
changeSex(val){
this.sex = val;
this.paginationSet.pageNum = 1;
this.getPatientsList()
},
changeAge(val){
if(val=='年龄范围'){
val = null
}
this.age = val;
this.ageBegin = this.ageDate(val).ageBegin;
this.ageEnd = this.ageDate(val).ageEnd;
this.paginationSet.pageNum = 1;
this.getPatientsList()
this.paginationSet.pageSize = val;
this.getPatientsList();
},
changeDisease(val){
this.diseaseId = val;
searchHandler() {
this.paginationSet.pageNum = 1;
this.getPatientsList()
this.getPatientsList();
},
changeLabel(val){
this.labelId = val;
this.paginationSet.pageNum = 1;
this.getPatientsList()
resetData(formName) {
this.$refs[formName].resetFields();
this.getPatientsList();
},
searchHandler() {
const searchCondition = this.searchData.searchCondition;
this.searchCondition = searchCondition;
this.paginationSet.pageNum = 1;
this.getPatientsList()
goAddPatient() {
this.$router.push({
path: '/patients-manage/new-manage/new-patient'
})
},
ageDate(val){
let ageObj;
......@@ -457,11 +430,15 @@
</script>
<style lang="scss">
@import '../../../../style/patients-style/element-reset.css';
.select-patient-dialog {
.el-dialog__wrapper {
overflow: hidden;
.el-dialog--center {
height: 580px;
.el-dialog__body{
padding: 10px 25px 15px;
}
.el-table--scrollable-y,.el-table__body-wrapper {
&::-webkit-scrollbar{
width:5px;
......@@ -489,13 +466,15 @@
}
.select-width .el-form-item{
width: 130px;
/*width: 130px;*/
}
.margin-top20{
margin-top: 20px;
.margin-top15{
margin-top: 15px;
}
.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{
margin-bottom: 8px;
}
}
</style>
......@@ -152,6 +152,7 @@
deleteCurrentLabel,
changeLabelName,
deleteCurrentPatients,
saveLabelsForPatient,
} from '@/utils/patients/patientsapi'
import SelectPatient from './dialog/select-patitents';
......@@ -216,6 +217,7 @@
console.log('获取分组详情>> ', data)
if(data.data){
this.searchData = data.data;
this.patientIdList = data.data.patientIdList;
let list = data.data.patientListsByLabelModels;
if(list && list.length > 0){
this.searchData.tableData = list;
......@@ -371,6 +373,7 @@
type: 'success'
});
this.showDeletePatientsDialog = false;
this.getDetail();
}else{
this.$message({
message: '请求接口失败,请重新再试',
......@@ -384,8 +387,30 @@
addPatientsHandler() {
this.isShowSelectPatient = true;
},
closeSelectPatient() {},
sureSelectPatient(arg) {
closeSelectPatient(val) {
this.isShowSelectPatient = val;
},
sureSelectPatient() {
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,
saveLists: selectPatients,
// token:
}).then((data) => {
if(data.code == '000000') {
setTimeout(() => {
this.$message.success(`已成功添加${patientLen}位居民`)
this.isShowSelectPatient = getArguments[0];
this.getDetail();
},500)
}else {
this.$message.error(data.message)
}
})
},
}
......
......@@ -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>
......@@ -26,8 +26,7 @@
<script>
import BreadCrumb from '@/components/breadcrumb'
import editInformation from './components/edit-information'
import { mapGetters } from 'vuex'
import { getPatientDetail, getRemindPatient, savePatientInfo } from '@/utils/patients/patientsapi'
import { getPatientDetail, savePatientInfo } from '@/utils/patients/patientsapi'
export default {
name: "basicInfo",
components: {
......@@ -50,11 +49,7 @@
this.patientId = String(this.$route.query.patientId);
this.init();
},
computed: {
...mapGetters([
'_token',
])
},
computed: {},
methods: {
init() {
getPatientDetail(this.patientId).then((data) => {
......@@ -72,10 +67,10 @@
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('保存备注成功')
this.$message.success('修改成功')
setTimeout(() => {
this.$router.go(-1);
},500)
......@@ -88,24 +83,6 @@
this.$message.error('请正确填写信息');
}
},
//提醒绑定
// remindBind() {
// let remindMobileWechatPara = {
// qrcodeType: 1,
// patientId: this.patientId,
// // deviceInfo: window.getDeviceInfo()
// }
// getRemindPatient({
// ...remindMobileWechatPara
// }).then( data => {
// if(data.code == '000000') {
// this.$message.success(data.data.respMsg);
// }else {
// this.$message.error(data.message);
// }
// })
// },
},
filters: {
emptyFilter: function(value) {
......
......@@ -32,7 +32,9 @@
</el-input>
</el-form-item>
</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>
<div v-show="isShowAll || patientId">
<div class="has-header">数据记录</div>
<el-row>
<el-col :span="12">
......@@ -43,8 +45,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>
......@@ -77,16 +79,17 @@
placeholder="请输入身份证"
clearable
maxlength="18"
@blur="idNoBlurHandler"
:disabled="hasIdNo">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出生年月" prop="birthTime">
<el-form-item label="出生日期" prop="birthTime">
<el-date-picker
type="date"
v-model="patientInfoForm.birthTime"
placeholder="请选择出生年月"
placeholder="请选择出生日期"
value-format="yyyy-MM-dd"
value="yyyy-MM-dd"
@change="getAge"
......@@ -99,7 +102,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="年龄" prop="age">
<span>{{patientInfoForm.age ? `${patientInfoForm.age}岁` : '-'}}</span>
<span>{{(patientInfoForm.age || patientInfoForm.age == 0) ? `${patientInfoForm.age}岁` : '-'}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -119,8 +122,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 +137,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,12 +171,14 @@
<div class="has-header">联系方式</div>
<el-row>
<el-col :span="12">
<el-form-item label="所在地区" prop="patientAddress">
<el-input
v-model="patientInfoForm.patientAddress"
placeholder="请输入居民医保卡号码"
clearable>
</el-input>
<el-form-item label="所在地区" prop="addressList">
<el-cascader
placeholder="请选择省市县乡"
:options="provinceList"
v-model="addressList"
@active-item-change="handleItemChange"
:props="optionProps">
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -200,8 +205,9 @@
</el-col>
<el-col :span="12" v-if="patientId">
<el-form-item label="微信" prop="address">
<p class="info" v-if="patientInfoForm.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfoForm.isRemind == '1'">提醒绑定</el-button><span class="ml10" v-if="patientInfoForm.isRemind == '2'">已提醒</span></p>
<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'">已绑定 <span class="ml10">(微信名:{{patientInfoForm.wechatNickname | emptyFilter}}</span></p>-->
<p class="info" v-else-if="patientInfoForm.isWechatBind == '2'">{{patientInfoForm.wechatNickname | emptyFilter}}</p>
</el-form-item>
</el-col>
</el-row>
......@@ -222,6 +228,7 @@
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
</div>
</template>
......@@ -229,7 +236,16 @@
import { mapGetters } from 'vuex';
import { checkMobile } from '@/utils/patients/checkValid';
import { isCardNo, checkProvince, checkBirthday, checkParity } from '@/utils/patients/checkCardNum';
import { getDiseasesList, getLabelList, getConstants, getNationsList, getRemindPatient,savePatientInfo } from '@/utils/patients/patientsapi';
import {
getDiseasesList,
getLabelList,
getConstants,
getNationsList,
getRemindPatient,
getProvinceList,
getCityList,
getCountyList,
getTownList } from '@/utils/patients/patientsapi';
export default {
name: "basicInfo",
components: {},
......@@ -242,29 +258,13 @@
51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",
63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"
};
//是否为空
// if(value === ''){
// callback(new Error('请输入正确的身份证'))
// }
if(value) {
//校验长度,类型
if(isCardNo(value) === false){
callback(new Error('请输入正确的身份证'))
}
//检查省份
if(checkProvince(value,vcity) === false){
callback(new Error('请输入正确的身份证'))
}
//校验生日
if(checkBirthday(value) === false){
callback(new Error('请输入正确的身份证'))
}
//检验位的检测
if(checkParity(value) === false){
if(isCardNo(value) && checkProvince(value,vcity) && checkBirthday(value) && checkParity(value)) {
this.isTrue = true;
callback()
}else {
callback(new Error('请输入正确的身份证'))
}
this.go(value.length);
callback()
}else {
callback()
}
......@@ -276,7 +276,9 @@
nationsList: [],
diseaseIdList: [],
labelIdList: [],
addressList: [],
baseInfoEdit: true,
isTrue: false,
patientInfoForm: {
nickname: '',
mobilePhone: '',
......@@ -295,9 +297,28 @@
isRemind: 1,
wechatNickname: '',
remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
},
hasIdNo: false,
validStatus: false,
provinceList: [],
provinceLists: [], //省列表
cityLists: [], //市列表
countyLists: [], //县列表
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'] }],
......@@ -311,8 +332,8 @@
patientId: String,
},
watch: {
patientInfoObj(val){
if(this.patientId){
async patientInfoObj(val) {
if(this.patientId){ //编辑居民信息,对拿到的数据做处理
this.patientInfoForm = val;
this.baseInfoEdit = this.patientInfoForm.baseInfoEdit;
let customLabels = this.patientInfoForm.customLabels;
......@@ -336,10 +357,21 @@
}else {
this.hasIdNo = false;
}
// this.$refs['patientInfoForm'].clearValidate();
//对地区数据做回显处理
if(this.patientInfoForm.patientAddress) {
let provinceId = this.patientInfoForm.provinceId;
let cityId = this.patientInfoForm.cityId;
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);
this.addressList = [Number(provinceId), Number(cityId), Number(countyId), Number(townId)];
this.$forceUpdate();
}else {
// 新增
this.addressList = [];
}
}else { // 新增
this.patientInfoForm = {
nickname: '',
mobilePhone: '',
......@@ -358,6 +390,13 @@
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}
}
},
......@@ -382,7 +421,6 @@
}else {
return 0;
}
},
},
methods: {
......@@ -411,7 +449,8 @@
if(data.code == '000000') {
this.nationsList = data.data;
}
})
});
this.getProvinceLists();
},
changeDiseases(val) {
let newDiseaseList = [];
......@@ -422,7 +461,6 @@
}
})
});
// this.patientInfoForm.diseases = newDiseaseList;
this.patientInfoForm.patientDiseases = newDiseaseList;
},
changeLabels(val){
......@@ -436,6 +474,11 @@
});
this.patientInfoForm.customLabels = newLabelsList;
},
idNoBlurHandler() {
if(this.isTrue) {
this.go(this.patientInfoForm.idNo.length);
}
},
//提醒绑定
remindBind() {
let remindMobileWechatPara = {
......@@ -456,8 +499,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: {
......@@ -521,11 +592,105 @@
this.patientInfoForm.age = null;
}
},
handleItemChange (val) {
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]);
}
this.$forceUpdate();
},
async getProvinceLists() {
await getProvinceList({}).then((data) => {
if(data.code == '000000') {
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 = this.provinceLists;
// this.$forceUpdate();
}
})
},
async getCity(provinceId) {
await getCityList({provinceId: provinceId}).then((data) => {
if(data.code == '000000') {
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 = this.cityLists;
}
})
// this.$forceUpdate();
}
})
},
async getCounty(provinceId, cityId) {
await 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;
})
}
})
// this.$forceUpdate();
}
})
},
async getTown(provinceId, cityId, countyId) {
await 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;
})
}
})
}
})
}
// this.$forceUpdate();
})
},
toggleClick() {
if(this.isShowAll) {
this.tipsText = '展开录入完整信息';
this.isShowAll = false;
}else {
this.tipsText = '收起录入完整信息';
this.isShowAll = true;
}
}
},
filters: {
emptyFilter: function(value) {
if (!value) {
if (!value && value != 0) {
return '-';
} else {
return value;
......
......@@ -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 == 0) ? `、${patientInfo.age}岁` : ''}}</p></div>
<div><p class="title">性别:</p><p class="info">{{patientInfo.sex | sexFileter}}</p></div>
</div>
<div class="item">
......@@ -53,8 +53,9 @@
<div><p class="title">工作单位:</p><p class="info">{{patientInfo.workplace | emptyFilter}}</p></div>
<div>
<p class="title">微信:</p>
<p class="info" v-if="patientInfo.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" v-if="patientInfo.isRemind == '1'">提醒绑定</el-button><span class="ml10" v-if="patientInfo.isRemind == '2'">已提醒</span></p>
<p class="info" v-else-if="patientInfo.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfo.wechatNickname | emptyFilter}}</span></p>
<p class="info" v-if="patientInfo.isWechatBind == '1'">未绑定 <el-button type="text" class="ml10" @click="remindBind" style="color: #449284;" v-if="patientInfo.isRemind == '1'">提醒绑定</el-button><span class="ml10" v-if="patientInfo.isRemind == '2'">已提醒</span></p>
<!--<p class="info" v-else-if="patientInfo.isWechatBind == '2'">已绑定 <span class="ml10">(微信名:{{patientInfo.wechatNickname | emptyFilter}}</span></p>-->
<p class="info" v-else-if="patientInfo.isWechatBind == '2'">{{patientInfo.wechatNickname | emptyFilter}}</p>
<p class="info" v-else>-</p>
</div>
</div>
......@@ -228,8 +229,8 @@
},
getRecordList() {
let reqPara = {
// patientId: this.patientId,
patientId: '99997701',
patientId: this.patientId,
// patientId: '99997701',
pageNo: this.pageNo,
pageSize: this.pageSize,
}
......@@ -257,11 +258,7 @@
}
})
},
tabChangeHandler(tab) {
// if(tab.name == 'second'){
// this.getRecordList(true);
// }
},
tabChangeHandler(tab) {},
deletePatient() {
// 把写的提示信息需要换行的地方分成数组 confirmText
const confirmText = ['您确定要删除此居民吗?', '删除后,您将无法对该居民发送患教和进行随访,重新添加该居民依旧可查看历史发送记录及随访记录'];
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册