提交 ec89b7c4 编写于 作者: tao.wu's avatar tao.wu

no message

上级 7502e578
......@@ -84,5 +84,11 @@ export default [
min: 0,
max: 99
},
{
field: 'dosageDay',
name: '用法',
min: 0,
max: 5
},
]
......@@ -10,9 +10,7 @@
<div class="resident-content f-main-content screenSet">
<el-row :gutter="24" align="middle" type="flex" class="form-header">
<el-col :span="20">心脑血管病危险因素
社区、乡镇人群随访表
</el-col>
<el-col :span="20">{{titleText}}</el-col>
<el-col :span="4" v-if="showBtn=='1'">
<el-button type="primary" size="small" class="formSubmit" @click="formSubmit(1)">提交</el-button>
<el-button class="button-white formTempSave" size="small" plain @click="formSubmit(2)">暂存</el-button>
......@@ -20,8 +18,8 @@
</el-row>
<div class="title-box">
<h1>心脑血管病危险因素社区、乡镇人群随访表</h1>
<h2>(适用于社区、乡镇脑卒中高危人群满6个月、12个月时随访和中危人群满12个月时随访使用)</h2>
<h1>{{titleText}}</h1>
<h2>{{titleSmText}}</h2>
</div>
<!--模板页面除了显示居民基本信息,将病种展示作为组件引入-->
......@@ -51,6 +49,8 @@
export default {
data(){
return {
titleText: '',
titleSmText: '',
breadTxt: '录入管理',
jumPathThird: '/followup/record-manage/record-list',
checkStart: false,
......@@ -77,12 +77,19 @@
},
created(){
this.scaleNo = this.$route.query.scaleNo;
console.log(this.scaleNo)
// this.resourceId = 'SCALE0003'
console.log('scaleNo=>',this.scaleNo)
// 0003 脑卒中、0002 糖尿病、0001 高血压
if(this.scaleNo == 'SCALE0003'){
this.titleText = '心脑血管病危险因素社区、乡镇人群随访表';
this.titleSmText = '(适用于社区、乡镇脑卒中高危人群满6个月、12个月时随访和中危人群满12个月时随访使用)';
}else if(this.scaleNo == 'SCALE0001'){
this.titleText = '高血压患者随访服务记录表';
}else if(this.scaleNo == 'SCALE0002'){
this.titleText = '2 型糖尿病患者随访服务记录表 ';
}
if(this.$route.query.showBtn=='0'){
this.showBtn = String(this.$route.query.showBtn);
}
// 0003 脑卒中、0002 糖尿病、0001 高血压
},
}
</script>
......
......@@ -29,8 +29,99 @@ export default ($this) => {
type: 'text',
labmsg: '次',
clickFunc: () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
if($this.addComponents[index].formObject.arrList.length >= 3) {
$this.$message.warning('最多只可添加3种药物!')
}else {
$this.dialogFormVisible = true;
}
}
})
}
},
{
formType: 'div',
name: '其他药物',
className: 'sec-title',
},
{
formType: 'input',
className: 'float-none',
prop: 'medicinesName',
model: 'medicinesName',
label: '其他药物名称:',
disabled: false,
placeholder: '请输入其他药物',
spanNum: 12,
maxlength: 10,
type: 'text',
labmsg: '次',
rules: [{required: false, message: '请输入其他药物', trigger: ['submit','change','blur']}],
changeFun: (val)=>{
let flag = val ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageDay',
model: 'dosageDay',
label: '其他药物用法:',
disabled: false,
placeholder: '请输入其他药物用法每日几次',
spanNum: 12,
maxlength: 10,
type: 'text',
slots: [{name: '次/日', type: 'append'}],
rules: [{required: false, message: '请输入其他药物用法每日几次', trigger: ['submit','change','blur']},{ validator: checkRange , trigger: ['submit','change','blur'] }],
changeFun: (val)=>{
let flag = val ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageNum',
model: 'dosageNum',
label: '其他药物用量:',
disabled: false,
placeholder: '请输入其他药物每次用量',
spanNum: 12,
maxlength: 10,
type: 'text',
slots: [{name: '每次', type: 'append'}],
rules: [{required: false, message: '请输入其他药物每次用量', trigger: ['submit','change','blur']}],
changeFun: (val)=>{
let flag = (val!=='' && val>=0) ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
},
]
}
......
......@@ -19,7 +19,9 @@ export default ($this) => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceReferral'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
......@@ -42,7 +44,9 @@ export default ($this) => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceReferral'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
......
......@@ -194,15 +194,15 @@
getDomain().then(res=>{
if(res.code=='000000'){
this.domain = res.data;
this.setFormData()
// this.setFormData()
// 目前模块先写死!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// 获取量表模块
// this.getFormModules();
// if(this.showBtn!='0'){
// // 获取量表详情
// this.getFormDetail();
// }
this.getFormModules();
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{
this.$message({
message: res.message,
......@@ -230,18 +230,6 @@
this.$forceUpdate();
},
// 动态开启验证开关
// setRuleToTrue(index){
// this.addComponents[index].dataSource.forEach((item,k)=>{
// if(item.rules && item.rules.length > 0){
// if(!this.needRule){
// this.addComponents[index].dataSource[k].rules[0].required = true;
// }else{
// this.addComponents[index].dataSource[k].rules[0].required = false;
// }
// }
// })
// },
// 获取展示的模块
getFormModules(){
getScaleModels(this.domain,this.scaleNo).then(res=>{
......@@ -270,22 +258,38 @@
if(keysList.length > 0){
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
if(this.formData[formName]){
let investigationState = this.formData[formName].investigationState;
let inTurn = this.formData[formName].inTurn;
if( ( investigationState === '失访' || investigationState === '死亡' ) ){
this.showModule = false;
if(this.formData[formName] && formName=='h_s_002'){
this.medication = [];
let type3Obj = {};
this.formData.h_s_002.forEach((item,index)=>{
if(item.medicineType=='1'){
this.medication.push({
dosageDay: item.dosageDay,
dosageNum: item.dosageNum,
medicinesName: item.medicinesName,
medicineType: item.medicineType
})
}else if(item.medicineType=='3'){
type3Obj = {
dosageDay: item.dosageDay,
dosageNum: item.dosageNum,
medicinesName: item.medicinesName,
medicineType: item.medicineType
}
// if(inTurn == '12个月'){
// this.needRule = false;
// }
}
})
this.addComponents[i].formObject = {
arrList: this.medication,
dosageDay: type3Obj.dosageDay,
dosageNum: type3Obj.dosageNum,
medicinesName: type3Obj.medicinesName
}
console.log(this.addComponents[i].formObject)
}else{
this.addComponents[i].formObject = this.formData[formName];
// if(formName=='h_s_001'){
// this.addComponents[i].formObject.dyslipidemia = []
// }
}
// 量表字段回显,会触发change校验,所以这里拿到数据渲染页面后,重置验证
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].resetFields();
......@@ -296,18 +300,58 @@
}
})
},
// 处理用药情况数据
handleModuleMedicalUse(){
let otherMed = [];
for(let i=0;i<this.addComponents.length;i++){
if(this.addComponents[i].name == 'hypeDataSourceMedicationUse'){
const formObject = this.addComponents[i].formObject;
// 有填写其他药物的情况
if(formObject.dosageDay !=='' && formObject.dosageDay >=0 && formObject.medicinesName && formObject.dosageNum){
otherMed.push({
medicinesName: formObject.medicinesName,
dosageDay: formObject.dosageDay,
dosageNum: formObject.dosageNum,
medicineType: '3'
})
}
if(this.medication.length>0){
this.medication = [...this.medication,...otherMed];
this.formData.h_s_002 = this.medication;
this.valid = true;
}else{
this.$message.warning('最少需要添加1种用药情况!');
this.valid = false;
this.$nextTick(() => {
// 如果表单未完善,跳转到该表单模块
document.querySelector(`#form${i}`).scrollIntoView(true);
return
})
}
}
}
let flag = this.valid;
this.$emit('checkEnd',false);
console.log('checkEndcheckEndcheckEndcheckEnd')
return flag;
},
// 提交量表
dataSubmit(callback){
// if(this.valid){
// console.log(this.formData)
this.formData.doctorId = parseFloat(this.doctorId);
this.formData.saveWay = parseFloat(this.saveWay);
this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId);
this.formData.scaleNo = this.scaleNo;
this.formData.isLine = 2;
this.formData.h_s_002 = this.medication;
// this.formData.hypertension_001.symptom = JSON.stringify(this.formData.hypertension_001.symptom);
// console.log(JSON.stringify(this.formData))
// 检测用药情况数据是否填写
if(!this.handleModuleMedicalUse()){
return;
}
this.formData.hypertension_001.symptom = JSON.stringify(this.formData.hypertension_001.symptom);
// console.log(this.formData)
postScale(this.domain,this.formData).then(res=>{
if(res.code=='000000'){
let doMsg = (this.saveWay==1) ? '提交成功' : '保存成功';
......@@ -331,14 +375,12 @@
});
}
});
// }
// this.$emit('checkEnd',false);
},
closeDialog(val){
this.dialogFormVisible = val;
},
setMedication(val){
this.medication.push({...val,type: '1'});
this.medication.push({...val,medicineType: '1'});
console.log('medication=>',this.medication)
}
},
......
......@@ -193,7 +193,6 @@
{name: 'CheckBody',formObject: {bmi: 0,},showModule: true,formName: 'stroke_014',className: 'obj-form-title',dataSource: dataSourceCheckBody(this), ruleNew:true,title: '五、体格检查(高危人群12个月随访必做)'},
{name: 'CheckLab',formObject: {},showModule: true,formName: 'stroke_015',className: 'obj-form-title',dataSource: dataSourceCheckLab(this),ruleNew:true, title: '六、实验室检查(高危人群12个月随访必填)'},
]
},
// 获取白名单域名
getWhiteDomain(){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册