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

居民单个录入部分添加

上级 6dcfe169
......@@ -228,6 +228,14 @@
isShowSelectPatient: Boolean, //是否显示model,
patientIdList: Array,// 确定已经选过的居民
oldPatientIdList: Array,// 确定已经选过的居民
selectPatientType: Number, //获取居民列表所需字段,随访是1,分组是2,患教是3
fuPlanIdList: {
required: false,
type: Array,
default: function () {
return [];
}
}, //获取居民列表所需字段,若是随访,则需要传值
},
watch: {
isShowSelectPatient(val){
......@@ -284,8 +292,8 @@
sex: this.searchData.sex,
searchCondition:this.searchData.searchCondition,
srvPackageId:this.srvPackageId,
addType: 1,
fuPlanIdList: [],
addType: this.selectPatientType, //随访是1,分组是2,患教是3
fuPlanIdList: this.fuPlanIdList,
}
getPatientInfoList(data).then(res=>{
if(res.data.patientList){
......
......@@ -139,6 +139,7 @@
:isShowSelectPatient="isShowSelectPatient"
:patientIdList="patientIdList"
@closeSelectPatient="closeSelectPatient"
:selectPatientType="selectPatientType"
@sureSelectPatient="sureSelectPatient(arguments)"
/>
</div>
......@@ -182,6 +183,7 @@
newLabelName: '', // 修改后的分组名
},
multipleSelection: [],
selectPatientType: 2, //选择居民时需要的type类型
}
},
components: {
......
......@@ -102,7 +102,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="年龄" prop="age">
<span>{{(patientInfoForm.age || patientInfoForm.age == 0) ? `${patientInfoForm.age}岁` : '-'}}</span>
<span>{{(patientInfoForm.age || patientInfoForm.age == 0 ) ? `${patientInfoForm.age}岁` : '-'}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -246,6 +246,32 @@
getCityList,
getCountyList,
getTownList } from '@/utils/patients/patientsapi';
const initForm = {
nickname: '',
mobilePhone: '',
diseases: [],
patientDiseases: [],
customLabels: [],
idNo: '',
birthTime: '',
age: '',
sex: null,
permanentResidence: '',
nationality: '',
socialCard: '',
fileLocator: '',
isWechatBind: null,
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
};
export default {
name: "basicInfo",
components: {},
......@@ -372,32 +398,7 @@
this.addressList = [];
}
}else { // 新增
this.patientInfoForm = {
nickname: '',
mobilePhone: '',
diseases: [],
patientDiseases: [],
customLabels: [],
idNo: '',
birthTime: '',
age: '',
sex: null,
permanentResidence: '',
nationality: '',
socialCard: '',
fileLocator: '',
isWechatBind: null,
isRemind: null,
wechatNickname: '',
remark: '',
patientAddress: '',
address: '',
workplace: '',
provinceId: null,
cityId: null,
countyId: null,
townId: null,
}
this.patientInfoForm = JSON.stringify(JSON.parse(initForm));
}
},
checkForm(val){
......@@ -527,6 +528,9 @@
})
this.patientInfoForm.patientAddress = `${this.patientInfoForm.provinceName}${this.patientInfoForm.cityName}${this.patientInfoForm.countyName}${this.patientInfoForm.townName}`
}
if(!this.patientInfoForm.idNo) {
this.patientInfoForm.idNo = null;
}
if (valid) {
// console.log('提交表单',this.patientInfoForm);
this.$emit('addListenSave',{
......
......@@ -9,7 +9,7 @@
<div class="f-main-content screenSet">
<div>
<div class="right-btn-group" v-if="activeName == 'first'">
<el-button plain size="small" @click="deletePatient">删除</el-button>
<el-button plain size="small" @click="deleteCurrentPatient">删除</el-button>
<el-button type="primary" size="small" @click="editPatient">编辑</el-button>
</div>
<el-tabs v-model="activeName" @tab-click="tabChangeHandler">
......@@ -259,7 +259,7 @@
})
},
tabChangeHandler(tab) {},
deletePatient() {
deleteCurrentPatient() {
// 把写的提示信息需要换行的地方分成数组 confirmText
const confirmText = ['您确定要删除此居民吗?', '删除后,您将无法对该居民发送患教和进行随访,重新添加该居民依旧可查看历史发送记录及随访记录'];
const newDatas = [];
......
......@@ -5,8 +5,15 @@
<el-tabs v-model="activeName2" @tab-click="handleTabClick" class="tab-list">
<el-tab-pane label="单个录入" name="first" class="single-input">
<el-row class="save-and-add">
<el-button type="primary">保存并新增</el-button>
<el-button type="primary" @click="saveEdit">保存并新增</el-button>
</el-row>
<edit-information
ref="newForm"
:patientInfoObj="patientInfo"
:checkForm="checkForm"
@addListenSave="addListenSave"
:patientId="patientId">
</edit-information>
</el-tab-pane>
<el-tab-pane label="二维码录入" name="second">
<div class="qr-code-wrap">
......@@ -182,9 +189,11 @@
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
import EditInformation from '../mypatients-manage/components/edit-information'
import * as commonUtil from "@/utils/utils";
import {
getUploadHistory
getUploadHistory,
savePatientInfo
} from "@/utils/patients/patientsapi";
import { getSaasDomain } from '@/utils/index';
......@@ -194,7 +203,10 @@ import { getSaasDomain } from '@/utils/index';
return {
curmbFirst: "居民管理",
curmbSecond: "新增居民",
activeName2: 'second',
activeName2: 'first',
patientInfo: {},
checkForm: false,
patientId: '',
searchData: {
pageNo: 1, // 第几页
pageSize: 10, // 每页条数
......@@ -212,7 +224,7 @@ import { getSaasDomain } from '@/utils/index';
},
components: {
BreadCrumb,
EditInformation,
},
created() {
this.goToGetUploadHistory();
......@@ -300,6 +312,30 @@ import { getSaasDomain } from '@/utils/index';
this.error = response.message;
}
},
saveEdit() {
this.checkForm = true;
},
addListenSave(val) {
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('新增成功')
setTimeout(() => {
this.$refs.newForm.$refs.patientInfoForm.resetFields()
// this.$router.go(0);//体验不好
},500)
}else {
this.$message.error(data.message);
}
})
// 调用保存接口
}else {
this.$message.error('请正确填写信息');
}
},
}
}
......@@ -329,6 +365,7 @@ import { getSaasDomain } from '@/utils/index';
border-bottom: 1px solid #efefef;
}
.single-input{
background-color: #ffffff!important;
.save-and-add{
text-align: right;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册