提交 1a8593eb 编写于 作者: xinxu.wang's avatar xinxu.wang

Merge branch 'dev-scaleHype-20190428' into 'release_followup'

Dev scale hype 20190428



See merge request !24
<template> <template>
<div v-if="$route.name!='loginPage'"> <div v-if="$route.name!='loginPage'">
<v-header :userName="userName" :portrait="portrait" :idType="idType"></v-header> <v-header :userName="userName" :portrait="portrait" :idType="idType"></v-header>
<v-slidebar :authList="authList" :tokenValue="token"></v-slidebar> <v-slidebar :authList="authList" :tokenValue="token" :storageIdType="storageIdType"></v-slidebar>
<el-container> <el-container>
<div class="content" id="body-content"> <div class="content" id="body-content">
<transition name="router-fade" mode="out-in"> <transition name="router-fade" mode="out-in">
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
data() { data() {
return { return {
idType: 0, idType: 0,
storageIdType: 0,
token: '', token: '',
userName: '', userName: '',
portrait: '', portrait: '',
...@@ -131,6 +132,7 @@ export default { ...@@ -131,6 +132,7 @@ export default {
localStorage.setItem('storageIdType', res.data.idType) localStorage.setItem('storageIdType', res.data.idType)
localStorage.setItem('storageMaster', res.data.masterAdministratorFlag) localStorage.setItem('storageMaster', res.data.masterAdministratorFlag)
vm.idType = res.data.idType vm.idType = res.data.idType
vm.storageIdType = res.data.idType
vm.userName = res.data.name vm.userName = res.data.name
vm.portrait = res.data.imageUrl vm.portrait = res.data.imageUrl
vm.authList = res.data.auth vm.authList = res.data.auth
...@@ -146,7 +148,7 @@ export default { ...@@ -146,7 +148,7 @@ export default {
if(val!=undefined&&val!=null) { if(val!=undefined&&val!=null) {
vm.getUserAuth(val) vm.getUserAuth(val)
} }
} },
} }
} }
</script> </script>
......
...@@ -18,10 +18,18 @@ ...@@ -18,10 +18,18 @@
:error="item.error"> :error="item.error">
<!-- div文本 --> <!-- div文本 -->
<div v-if="item.formType === 'div'" :class="item.className">{{ item.name }}</div> <div v-if="item.formType === 'div'" :class="item.className">{{ item.name }}</div>
<!--button-->
<el-button
v-if="item.formType === 'button'"
type="primary"
@click="item.clickFunc ? item.clickFunc($event) : defaultClick($event)"
:icon="item.icon">{{ item.btnText }}
</el-button>
<!-- input --> <!-- input -->
<el-input <el-input
v-else-if="item.formType === 'input'" v-else-if="item.formType === 'input'"
v-model="form[item.model]" v-model.trim="form[item.model]"
:refs="item.refs"
:type="item.type" :type="item.type"
:class="item.className" :class="item.className"
:disabled="item.disabled" :disabled="item.disabled"
...@@ -102,6 +110,23 @@ ...@@ -102,6 +110,23 @@
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"/> @change="item.changeFun ? item.changeFun($event) : defaultFun($event)"/>
<!-- 图片 --> <!-- 图片 -->
<img v-else-if="item.formType === 'img'" :src="item.src||''" :alt="item.alt||''" :width="item.width"> <img v-else-if="item.formType === 'img'" :src="item.src||''" :alt="item.alt||''" :width="item.width">
<!--循环遍历-->
<el-row
v-else-if="item.formType === 'list'"
v-for="(itemChild, indexChild) in form[item.model]"
:key="indexChild"
style="width: 800px;margin-bottom: 15px;font-size:18px;color:#606266;">
<el-col :span="24">
<span>{{itemChild.medicinesName}}:</span>
<span>每日{{itemChild.dosageDay}}次,</span>
<span>每次{{itemChild.dosageNum}}</span>
<el-button
type="plain"
icon="el-icon-delete"
class="margin-left-20"
@click="clickDeleteFunc(form[item.model], indexChild)">删除</el-button>
</el-col>
</el-row>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -113,7 +138,7 @@ ...@@ -113,7 +138,7 @@
export default { export default {
props: { props: {
ruleNew: Boolean, ruleNew: Boolean,//用于关联跨模块交互
dataSource: { dataSource: {
type: Array, type: Array,
default: () => [] default: () => []
...@@ -139,6 +164,7 @@ ...@@ -139,6 +164,7 @@
} }
}, },
methods: { methods: {
defaultClick(){},
defaultFun() {}, defaultFun() {},
defaultBlur(){}, defaultBlur(){},
isParent(item) { isParent(item) {
...@@ -168,7 +194,10 @@ ...@@ -168,7 +194,10 @@
} }
return num === item.linkageRule.length return num === item.linkageRule.length
} }
} },
clickDeleteFunc(list, index) {
list.splice(index, 1);
},
} }
} }
</script> </script>
...@@ -188,6 +217,8 @@ ...@@ -188,6 +217,8 @@
float: none; float: none;
font-weight: bold; font-weight: bold;
margin-left: 0; margin-left: 0;
overflow: hidden;
height: auto;
} }
.color-gray{ .color-gray{
color: #a7a7a7; color: #a7a7a7;
......
import rangeJson from '@/utils/followup/followupUtils/range'; import rangeJson from './rangConfig';
// 这个方法,是用户在选择随访轮次(6个月,12个月)后续操作 // 这个方法,是用户在选择随访轮次(6个月,12个月)后续操作
let checkNeedRule = (val) => { let checkNeedRule = (val) => {
const needRule = localStorage.getItem('needRule'); const needRule = sessionStorage.getItem('needRule');
if(( (!val||val=='') && (!needRule || needRule=='true') )){ if( val!='0' && (!val||val=='') && (!needRule || needRule=='true') ){
return true; return true;
} }
return false; return false;
...@@ -12,14 +12,24 @@ let checkNeedRule = (val) => { ...@@ -12,14 +12,24 @@ let checkNeedRule = (val) => {
// 校验范围通用方法 // 校验范围通用方法
export const checkRange = (rule, value, callback) => { export const checkRange = (rule, value, callback) => {
let min,max; let min,max;
let val = Number(value); let val = parseFloat(value);
let res;
// 处理 诸如 01 这种情况
if(value && value.length>1 && value.indexOf('.')<0){
res = (new RegExp(/^[1-9]\d*$/g)).test(value);
}else{
res = true;
}
rangeJson.forEach((item)=>{ rangeJson.forEach((item)=>{
if(item.field == rule.field){ if(item.field == rule.field){
min = item.min; min = item.min;
max = item.max; max = item.max;
} }
}) })
if(((val >= min) && (val <= max)) || checkNeedRule(val)){ const ruless = ( (val >= min) && (val <= max) && res )
// if(ruless || checkNeedRule(val)){
if( !value || ruless ){
callback() callback()
}else{ }else{
callback(new Error(`输入范围${min}~${max}`)) callback(new Error(`输入范围${min}~${max}`))
...@@ -28,7 +38,7 @@ export const checkRange = (rule, value, callback) => { ...@@ -28,7 +38,7 @@ export const checkRange = (rule, value, callback) => {
// 校验手机号 // 校验手机号
export const checkMobile = (rule, value, callback) => { export const checkMobile = (rule, value, callback) => {
var reg = /^1[3|4|5|7|8][0-9]{9}$/; //验证规则 const reg = /^1[3|4|5|7|8|9][0-9]{9}$/; //验证规则
const flag = reg.test(value); const flag = reg.test(value);
if(flag){ if(flag){
callback() callback()
...@@ -39,9 +49,13 @@ export const checkMobile = (rule, value, callback) => { ...@@ -39,9 +49,13 @@ export const checkMobile = (rule, value, callback) => {
// 校验是否是整数 // 校验是否是整数
export const checkIsInteger = (rule, value, callback) => { export const checkIsInteger = (rule, value, callback) => {
const num = Number.isInteger(parseFloat(value));
const val = parseFloat(value); const val = parseFloat(value);
if(num || checkNeedRule(val)){ const num = Number.isInteger(val);
// const val = Number.parseInt(value);
// const num = /^[0-9]*[1-9][0-9]*$/.test(value);
// if(num || checkNeedRule(val)){
if( !value || num ){
callback() callback()
}else{ }else{
callback(new Error(`输入整数`)) callback(new Error(`输入整数`))
...@@ -52,7 +66,8 @@ export const checkIsInteger = (rule, value, callback) => { ...@@ -52,7 +66,8 @@ export const checkIsInteger = (rule, value, callback) => {
export const checkNumberIsToFixed = (rule, value, callback) => { export const checkNumberIsToFixed = (rule, value, callback) => {
const isNum = /^(([1-9][0-9]*)|(([0]\.\d{1,1}|[1-9][0-9]*\.\d{1,1})))$/; const isNum = /^(([1-9][0-9]*)|(([0]\.\d{1,1}|[1-9][0-9]*\.\d{1,1})))$/;
const val = Number(value); const val = Number(value);
if(isNum.test(val) || checkNeedRule(val)){ // if(isNum.test(val) || checkNeedRule(val)){
if( !value || isNum.test(val) ){
callback() callback()
}else{ }else{
callback(new Error(`最多输入1位小数`)) callback(new Error(`最多输入1位小数`))
...@@ -61,11 +76,24 @@ export const checkNumberIsToFixed = (rule, value, callback) => { ...@@ -61,11 +76,24 @@ export const checkNumberIsToFixed = (rule, value, callback) => {
// 大于0的正整数 // 大于0的正整数
export const checkNormalInt = (rule, value, callback) => { export const checkNormalInt = (rule, value, callback) => {
const isInteger = Number.isInteger(parseFloat(value));
const val = parseFloat(value); const val = parseFloat(value);
if((isInteger && val > 0) || checkNeedRule(val)){ const isInteger = Number.isInteger(val);
// if((isInteger && val > 0) || checkNeedRule(val)){
if( !value || (isInteger && val > 0) ){
callback() callback()
}else{ }else{
callback(new Error(`请输入大于0的正整数`)) callback(new Error(`请输入大于0的正整数`))
} }
} }
// 校验是否是两位小数
export const checkNumberIsToFixedTwo = (rule, value, callback) => {
const isNum = /^(-)?(0|[1-9]\d*)(\s|$|\.\d{1,2}\b)/;
const val = Number(value);
// if(isNum.test(val) || checkNeedRule(val)){
if( !value || isNum.test(val) ){
callback()
}else{
callback(new Error(`最多输入2位小数`))
}
}
import range from './range';
import rangeHype from './rangeHype';
import rangeDiabetes from './rangeDiabetes';
export default [
...range,
...rangeHype,
...rangeDiabetes
]
// 各个字段校验的配置文件 // 脑卒中字段校验的配置文件
export default [ export default [
{ {
field: 'fastingBloodGlucose', field: 'fastingBloodGlucose',
......
// 高血压字段校验的配置文件
export default [
{
field: 'systolicBloodPressure',
name: '收缩压SBP',
min: 70,
max: 240
},
{
field: 'diastolicBloodPressure',
name: '舒张压DBP',
min: 50,
max: 130
},
{
field: 'bodyHeight',
name: '身高',
min: 100,
max: 250
},
{
field: 'bodyWeight',
name: '体重',
min: 35,
max: 250
},
{
field: 'nextBodyWeight',
name: '体重',
min: 35,
max: 250
},
{
field: 'fastingBloodSugar',
name: '空腹血糖值',
min: 1,
max: 33.3
},
{
field: 'glycosylatedHemoglobinPercent',
name: '糖化血红蛋白值',
min: 3.00,
max: 20.00
},
{
field: 'smokingAmount',
name: '日吸烟量',
min: 0,
max: 99
},
{
field: 'nextSmokingAmount',
name: '日吸烟量',
min: 0,
max: 99
},
{
field: 'alcoholConsumption',
name: '日饮酒量',
min: 0,
max: 99
},
{
field: 'nextAlcoholConsumption',
name: '日饮酒量',
min: 0,
max: 99
},
{
field: 'workoutOfWeek',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'workoutDuration',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutOfWeek',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutDuration',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutDuration',
name: '运动情况',
min: 0,
max: 99
},
{
field: 'stapleFoodGram',
name: '主食摄入量',
min: 0,
max: 999
},
{
field: 'nextStapleFoodGram',
name: '主食摄入量',
min: 0,
max: 999
},
]
// 高血压字段校验的配置文件
export default [
{
field: 'systolicBloodPressure',
name: '收缩压SBP',
min: 70,
max: 240
},
{
field: 'diastolicBloodPressure',
name: '舒张压DBP',
min: 50,
max: 130
},
{
field: 'bodyHeight',
name: '身高',
min: 100,
max: 250
},
{
field: 'bodyWeight',
name: '体重',
min: 35,
max: 250
},
{
field: 'nextBodyWeight',
name: '下次随访体重',
min: 35,
max: 250
},
{
field: 'heartRate',
name: '心率',
min: 30,
max: 200
},
{
field: 'smokingAmount',
name: '本次日吸烟量',
min: 0,
max: 99
},
{
field: 'nextSmokingAmount',
name: '下次随访日吸烟量',
min: 0,
max: 99
},
{
field: 'alcoholConsumption',
name: '本次日饮酒量',
min: 0,
max: 99
},
{
field: 'nextAlcoholConsumption',
name: '下次随访日饮酒量',
min: 0,
max: 99
},
{
field: 'workoutOfWeek',
name: '本次运动情况',
min: 0,
max: 99
},
{
field: 'workoutDuration',
name: '本次运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutOfWeek',
name: '下次随访运动情况',
min: 0,
max: 99
},
{
field: 'nextWorkoutDuration',
name: '下次随访运动情况',
min: 0,
max: 99
},
{
field: 'dosageDay',
name: '用法',
min: 0,
max: 5
},
]
<!--<template>-->
<!--<div>-->
<!--&lt;!&ndash;<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">&ndash;&gt;-->
<!--<el-form-item label="本次随访时间" required>-->
<!--<div style="display: flex;">-->
<!--<el-form-item prop="timeNo">-->
<!--<el-input-->
<!--v-model="timeForm.timeNo"-->
<!--type="tel"-->
<!--size="small"-->
<!--placeholder="请输入"-->
<!--:disabled="isStandedTemplate"-->
<!--maxlength="2"-->
<!--clearable />-->
<!--</el-form-item>-->
<!--<el-form-item prop="timeUnit" class="ml20">-->
<!--<el-select v-if="!isStandedTemplate && !planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="timeForm.isDisabled">-->
<!--<el-option-->
<!--v-for="(item,index) in markOptions"-->
<!--:key="index"-->
<!--:label="item.value"-->
<!--:value="item.no">-->
<!--</el-option>-->
<!--</el-select>-->
<!--<el-select v-if="isStandedTemplate || planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="isStandedTemplate">-->
<!--<el-option-->
<!--v-for="(item,index) in markOptions"-->
<!--:key="index"-->
<!--:label="item.value"-->
<!--:value="item.no">-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--</div>-->
<!--</el-form-item>-->
<!--<el-form-item label="随访方式" prop="type">-->
<!--<el-radio-group v-model="timeForm.type" size="small">-->
<!--<el-radio v-for="(item,index) in followTypeList" :key="index" :label="item.no" :disabled="isStandedTemplate">{{item.value}}</el-radio>-->
<!--</el-radio-group>-->
<!--</el-form-item>-->
<!--<el-form-item label="提醒医生预约居民">-->
<!--<el-select-->
<!--v-if="!isStandedTemplate"-->
<!--v-model="timeForm.remindDay"-->
<!--multiple-->
<!--:multiple-limit=3-->
<!--@change="changeRemindDay"-->
<!--placeholder="请选择">-->
<!--<el-option-->
<!--v-for="(item,index) in remindOptions"-->
<!--:key="index"-->
<!--:label="item.value"-->
<!--:value="item.no">-->
<!--</el-option>-->
<!--</el-select>-->
<!--&lt;!&ndash;固定模板需要填充&ndash;&gt;-->
<!--<el-select-->
<!--v-if="isStandedTemplate"-->
<!--v-model="timeForm.remindDay"-->
<!--multiple-->
<!--:multiple-limit=3-->
<!--:disabled="isStandedTemplate"-->
<!--placeholder="请选择">-->
<!--<el-option-->
<!--v-for="(item,index) in remindOptionsCopy"-->
<!--:key="index"-->
<!--:label="item.startDaysStr"-->
<!--:value="item.startDays">-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--<el-form-item label="推送患教">-->
<!--<div style="display: flex">-->
<!--<el-select-->
<!--v-if="!isStandedTemplate"-->
<!--v-model="timeForm.pushDay"-->
<!--placeholder="选择推送时间"-->
<!--clearable-->
<!--&gt;-->
<!--<el-option-->
<!--v-for="(item,index) in pushTimeOptions"-->
<!--:key="index"-->
<!--:label="item.value"-->
<!--:value="item.no">-->
<!--</el-option>-->
<!--</el-select>-->
<!--&lt;!&ndash;固定模板需要填充&ndash;&gt;-->
<!--<el-select-->
<!--v-if="isStandedTemplate"-->
<!--v-model="timeForm.pushDay"-->
<!--placeholder="选择推送时间"-->
<!--clearable-->
<!--:disabled="isStandedTemplate"-->
<!--&gt;-->
<!--<el-option-->
<!--:label="timeForm.startDaysStr"-->
<!--:value="timeForm.pushDay">-->
<!--</el-option>-->
<!--</el-select>-->
<!--<el-button plain class="ml20" @click="goSelectCartoon" v-if="!timeForm.hasSelected && !isStandedTemplate && !planId">选择健康漫画</el-button>-->
<!--<div class="selected-div ml20" v-if="timeForm.hasSelected">-->
<!--<span>《{{timeForm.comentMsg.header_name}}》</span>-->
<!--<el-button type="text" @click="goSelectCartoon" v-if="!isStandedTemplate && !planId">重选</el-button>-->
<!--<el-button type="text" @click="deleteClick" v-if="!isStandedTemplate && !planId">删除</el-button>-->
<!--</div>-->
<!--</div>-->
<!--</el-form-item>-->
<!--<div class="tips-contnt" v-if="timeForm.hasSelected">-->
<!--<p class="yellow-font">当前计划中共{{timeForm.totalNumber}}位居民(微信:{{timeForm.wechatPatientNum}}位,短信:{{timeForm.messagePatientNum}}位),本次定时推送任务在发送当日预计需要{{timeForm.messagePatientNum}}条短信额度(微信推送不消耗额度,建议您让居民关注云鹊健康微信公众号),务必提前确保短信额度的充足。</p>-->
<!--<p>需要更多额度,请前往「云鹊医App-个人中心-啾啾币中心」兑换短信额度后再进行预约,您也可以联系云鹊医客服购买短信额度,客服电话:400-920-8877</p>-->
<!--</div>-->
<!--<el-form-item label="随访登记表">-->
<!--<el-select-->
<!--v-if="!isStandedTemplate"-->
<!--v-model="timeForm.followResourceId"-->
<!--multiple-->
<!--:multiple-limit=3-->
<!--@change="changeFollowId"-->
<!--placeholder="请选择">-->
<!--<el-option-->
<!--v-for="(item,index) in formOptions"-->
<!--:key="index"-->
<!--:label="item.name"-->
<!--:value="item.scaleNo">-->
<!--</el-option>-->
<!--</el-select>-->
<!--&lt;!&ndash;固定模板需要填充&ndash;&gt;-->
<!--<el-select-->
<!--v-if="isStandedTemplate"-->
<!--v-model="timeForm.followResourceId"-->
<!--multiple-->
<!--:multiple-limit=3-->
<!--@change="changeFollowId"-->
<!--:disabled="isStandedTemplate"-->
<!--placeholder="请选择">-->
<!--<el-option-->
<!--v-for="(item,index) in formOptionsCopy"-->
<!--:key="index"-->
<!--:label="item.sendContent"-->
<!--:value="item.resourceId">-->
<!--</el-option>-->
<!--</el-select>-->
<!--</el-form-item>-->
<!--&lt;!&ndash;</el-form>&ndash;&gt;-->
<!--<select-cartoon-->
<!--:isSelectCartoon="isSelectCartoon"-->
<!--@closeSelectCartoon="closeSelectCartoon"-->
<!--@pushConmentMsg="pushConmentMsg"-->
<!--/>-->
<!--</div>-->
<!--</template>-->
<!--<script>-->
<!--import _ from 'lodash';-->
<!--import SelectCartoon from '@/views/followup/plan-manage/dialog/select-cartoon';-->
<!--import { getPatientNumber } from '@/utils/followup/followapis'-->
<!--export default {-->
<!--components: {-->
<!--SelectCartoon-->
<!--},-->
<!--data() {-->
<!--const checkDay = (rule, value, callback)=>{-->
<!--const num = parseFloat(value)-->
<!--if(num < 1 || num>99){-->
<!--return callback(new Error('日期不能大于99天或小于0天'));-->
<!--}-->
<!--callback();-->
<!--}-->
<!--return {-->
<!--formNoList: [],//存放量表 scaleNo 的数组,用于匹配所选项-->
<!--remindOptionsCopy: [],//提升医生预约居民 - 标准模板-->
<!--formOptionsCopy: [], //量表 - 标准模板-->
<!--isSelectCartoon: false,-->
<!--timeFormRules: {-->
<!--timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' },{ validator: checkDay, trigger: 'blur' }],-->
<!--timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],-->
<!--type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],-->
<!--},-->
<!--}-->
<!--},-->
<!--props: {-->
<!--timeForm: Object,-->
<!--valBegin: Boolean, // 设置新时间节点的校验开关-->
<!--saveValiedBegin: Boolean, // 点击保存提交整个表单的校验开关-->
<!--markOptions:Array,-->
<!--followTypeList:Array,-->
<!--remindOptions:Array,-->
<!--pushTimeOptions:Array,-->
<!--formOptions: Array,-->
<!--patientIdList: Array,-->
<!--isStandedTemplate: Boolean,-->
<!--planId: String-->
<!--},-->
<!--watch: {-->
<!--patientIdList(val){-->
<!--},-->
<!--timeForm(val){-->
<!--this.timeForm = val-->
<!--if(this.isStandedTemplate || this.planId){-->
<!--// console.log('表单子组件监听到的form数据',this.timeForm)-->
<!--this.timeForm.isDisabled = true-->
<!--console.log(this.timeForm.remindList)-->
<!--if(this.timeForm.remindList && this.timeForm.remindList.length > 0){// remindDay-->
<!--this.remindOptionsCopy = this.timeForm.remindList-->
<!--this.timeForm.remindDay = []-->
<!--this.timeForm.remindList.forEach((item)=>{-->
<!--this.timeForm.remindDay.push(item.startDays)-->
<!--})-->
<!--}-->
<!--if(this.timeForm.pushContentList && this.timeForm.pushContentList.length > 0){//pushDay-->
<!--let pushData = this.timeForm.pushContentList[0]-->
<!--this.timeForm.pushDay = pushData.startDays-->
<!--this.timeForm.startDaysStr = pushData.startDaysStr-->
<!--this.timeForm.comentMsg = {-->
<!--id: pushData.resourceId,-->
<!--header_name: pushData.sendContent-->
<!--}-->
<!--this.closeSelectCartoon({-->
<!--closeStatus: false,-->
<!--hasSelected: this.timeForm.comentMsg-->
<!--})-->
<!--}-->
<!--if(this.timeForm.followupList && this.timeForm.followupList.length > 0){ //followResourceId-->
<!--this.formOptionsCopy = this.timeForm.followupList-->
<!--this.timeForm.followResourceId = []-->
<!--this.timeForm.followupList.forEach((item)=>{-->
<!--this.timeForm.followResourceId.push(item.resourceId)-->
<!--})-->
<!--}-->
<!--console.log(this.formOptionsCopy)-->
<!--getPatientNumber({-->
<!--patientIdList: this.patientIdList-->
<!--}).then(res=>{-->
<!--if(res.code=='000000'){-->
<!--this.timeForm.wechatPatientNum = res.data.wechatPatientNum;-->
<!--this.timeForm.messagePatientNum = res.data.messagePatientNum;-->
<!--this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum-->
<!--}else{-->
<!--this.$notify.success({-->
<!--title: '提交失败',-->
<!--message: res.message,-->
<!--showClose: false-->
<!--});-->
<!--}-->
<!--})-->
<!--// console.log(this.isStandedTemplate)-->
<!--// console.log(this.formOptions)-->
<!--// console.log(this.formOptionsCopy)-->
<!--}-->
<!--},-->
<!--formOptions(val){-->
<!--val.forEach((item)=>{-->
<!--this.formNoList.push(item.scaleNo)-->
<!--})-->
<!--},-->
<!--valBegin(val){-->
<!--if(val){-->
<!--this.$refs[this.timeForm.formRef].validate((valid) => {-->
<!--this.$emit('checkValid',{valid: valid, type: 'normal'})-->
<!--});-->
<!--}-->
<!--},-->
<!--saveValiedBegin(val){-->
<!--// console.log('保存按钮子组件的校验',val)-->
<!--// console.log('++++',this.timeForm.formRef)-->
<!--if(val && this.timeForm.formRef){-->
<!--this.$refs[this.timeForm.formRef].validate((valid) => {-->
<!--// console.log('告诉父组件,校验结果' + valid)-->
<!--this.$emit('checkValid',{valid: valid, type: 'save'})-->
<!--});-->
<!--}-->
<!--}-->
<!--},-->
<!--methods: {-->
<!--changeRemindDay(val){-->
<!--console.log(val)-->
<!--},-->
<!--changeFollowId(val){-->
<!--console.log(val)-->
<!--this.timeForm.followResourceIdStr = []-->
<!--val.forEach((item)=>{-->
<!--if(this.formNoList.includes(item)){-->
<!--this.timeForm.followResourceIdStr.push(item)-->
<!--}-->
<!--})-->
<!--},-->
<!--goSelectCartoon() {-->
<!--this.isSelectCartoon = true;-->
<!--},-->
<!--closeSelectCartoon(val) {-->
<!--this.isSelectCartoon = val.closeStatus;-->
<!--this.timeForm.hasSelected = val.hasSelected;-->
<!--},-->
<!--deleteClick() {-->
<!--this.timeForm.hasSelected = '';-->
<!--},-->
<!--pushConmentMsg(val){-->
<!--this.timeForm.comentMsg = val-->
<!--getPatientNumber({-->
<!--patientIdList: this.patientIdList-->
<!--}).then(res=>{-->
<!--if(res.code=='000000'){-->
<!--this.timeForm.wechatPatientNum = res.data.wechatPatientNum;-->
<!--this.timeForm.messagePatientNum = res.data.messagePatientNum;-->
<!--this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum-->
<!--}else{-->
<!--this.$notify.success({-->
<!--title: '提交失败',-->
<!--message: res.message,-->
<!--showClose: false-->
<!--});-->
<!--}-->
<!--})-->
<!--}-->
<!--},-->
<!--}-->
<!--</script>-->
<!--<style scoped lang="scss">-->
<!--.form-div{-->
<!--padding-top: 30px;-->
<!--.tips-contnt{-->
<!--margin-top: -10px;-->
<!--padding-left: 140px;-->
<!--padding-bottom: 30px;-->
<!--font-size: 12px;-->
<!--color: #9B9997;-->
<!--width: 55%;-->
<!--p{-->
<!--line-height: 18px;-->
<!--&.yellow-font{-->
<!--color: #e6a23c;-->
<!--padding-bottom: 10px;-->
<!--}-->
<!--}-->
<!--}-->
<!--}-->
<!--.ml20{-->
<!--margin-left: 20px;-->
<!--}-->
<!--</style>-->
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
}, },
goToScale(val) { goToScale(val) {
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: val.doctorId, scaleNo: val.resourceId, planPatientsTimesId: val.planPatientsTimesId, showBtn: 0}}); query: {doctorId: val.doctorId, scaleNo: val.resourceId, planPatientsTimesId: val.planPatientsTimesId,planTimesId : val.planTimesId, showBtn: 0}});
} }
}, },
watch: { watch: {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<div class="plan-btns-group"> <div class="plan-btns-group">
<el-button class="button-white" plain @click="cancelEdit" size="small">取 消</el-button> <el-button class="button-white" plain @click="cancelEdit" size="small">取 消</el-button>
<el-button class="button-green" type="primary" @click="saveModify" size="small">保 存</el-button> <el-button class="button-green" type="primary" @click="saveModify('baseInfo')" size="small">保 存</el-button>
</div> </div>
</div> </div>
<el-form ref="baseInfo" :model="planDetailData" :rules="rules" label-suffix=":" label-width="140px"> <el-form ref="baseInfo" :model="planDetailData" :rules="rules" label-suffix=":" label-width="140px">
...@@ -241,9 +241,18 @@ ...@@ -241,9 +241,18 @@
this.$router.back(-1) this.$router.back(-1)
}); });
}, },
saveModify() { saveModify(formName) {
this.$refs[formName].validate((valid) => {
if(valid){
// 点击保存,先进行校验,表单字段是否通过验证 // 点击保存,先进行校验,表单字段是否通过验证
this.checkForm = true this.checkForm = true
}else{
this.$message({
message: '请填写完整表单',
type: 'error'
});
}
});
}, },
// 监听保存校验结果 // 监听保存校验结果
addListenSave(val){ addListenSave(val){
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
}, },
goToScale(val) { goToScale(val) {
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.residentDetail.doctorId, scaleNo: val.resourceId, planPatientsTimesId: this.nodePlanPatientsTimesId[0].planPatientsTimesId, showBtn: 1}}); query: {doctorId: this.residentDetail.doctorId, scaleNo: val.resourceId, planPatientsTimesId: this.nodePlanPatientsTimesId[0].planPatientsTimesId,planTimesId : val.planTimesId, showBtn: 1}});
} }
}, },
watch: { watch: {
......
<template>
<div class="dialog-wrap">
<el-dialog title="用药情况" :visible.sync="showDialog">
<el-form :model="formChosedMedical" ref="choseMed" :rules="rules">
<el-form-item label="药物名称" :label-width="formLabelWidth" prop="medicinesName">
<el-input v-model="formChosedMedical.medicinesName" autocomplete="off" placeholder="请输入药物名称" maxlength="30"></el-input>
</el-form-item>
<el-form-item label="用法" :label-width="formLabelWidth" prop="dosageDay">
<el-input v-model="formChosedMedical.dosageDay" type="number" autocomplete="off" placeholder="请输入每日几次">
<template slot="append">次/日</template>
</el-input>
</el-form-item>
<el-form-item label="用量" :label-width="formLabelWidth" prop="dosageNum">
<el-input v-model="formChosedMedical.dosageNum" autocomplete="off" placeholder="请输入每次用量" maxlength="30">
<template slot="append">每次</template>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button type="primary" @click="confirmSubmit">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { checkIsInteger } from '@/utils/followup/followupUtils/checkField';
export default {
data(){
var checkRange = (rule, value, callback) => {
// let min,max;
let val = Number(value);
if((val >= 0) && (val <= 5)){
callback()
}else{
callback(new Error(`输入范围0~5`))
}
}
return {
showDialog: true,
formLabelWidth: '120px',
formChosedMedical: {
medicinesName: '', // 药物名称
dosageDay: '', // 每日次数
dosageNum: '', // 每次的剂量
},
rules: {
medicinesName: [{ required: true, message: '请输入药物名称', trigger: 'change' }],
dosageDay: [{ required: true, message: '请输入每日几次', trigger: ['change'] },{ validator: checkIsInteger, trigger: 'change' },{validator:checkRange,trigger: 'change'}],
dosageNum: [{ required: true, message: '请输入每次用量', trigger: 'change' }],
},
}
},
watch: {
showDialog(val){
this.$emit('closeDialog',val)
}
},
methods: {
closeDialog(){
this.$emit('closeDialog',false)
},
confirmSubmit(){
this.$refs['choseMed'].validate((valid) => {
if(valid){
this.$emit('closeDialog',false);
this.$emit('setMedication',this.formChosedMedical);
}
});
}
}
}
</script>
<style scoped lang="scss">
</style>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
}, },
goToScale(val) { goToScale(val) {
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.enteringInfo.doctorId, scaleNo: val.scaleNo, planPatientsTimesId: this.enteringInfo.planPatientsTimesId, showBtn: 1}}); query: {doctorId: this.enteringInfo.doctorId, scaleNo: val.scaleNo, planPatientsTimesId: this.enteringInfo.planPatientsTimesId,planTimesId : val.planTimesId, showBtn: 1}});
} }
}, },
filters: { filters: {
......
...@@ -10,25 +10,27 @@ ...@@ -10,25 +10,27 @@
<div class="resident-content f-main-content screenSet"> <div class="resident-content f-main-content screenSet">
<el-row :gutter="24" align="middle" type="flex" class="form-header"> <el-row :gutter="24" align="middle" type="flex" class="form-header">
<el-col :span="20">心脑血管病危险因素 <el-col :span="18">{{titleText}}</el-col>
社区、乡镇人群随访表 <el-col :span="6" v-if="showBtn=='1'">
</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 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> <el-button class="button-white formTempSave" size="small" plain @click="formSubmit(2)">暂存</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="title-box"> <div class="title-box">
<h1>心脑血管病危险因素社区、乡镇人群随访表</h1> <h1>{{titleText}}</h1>
<h2>(适用于社区、乡镇脑卒中高危人群满6个月、12个月时随访和中危人群满12个月时随访使用)</h2> <h2>{{titleSmText}}</h2>
</div> </div>
<!--模板页面除了显示居民基本信息,将病种展示作为组件引入--> <!--模板页面除了显示居民基本信息,将病种展示作为组件引入-->
<div class="form-container"> <div class="form-container">
<!--脑卒中--> <!--脑卒中-->
<stroke v-if="resourceId=='SCALE0003'" :showBtn="showBtn" :checkStart="checkStart" @checkEnd="checkEnd" :saveWay="saveWay" /> <stroke v-if="scaleNo=='SCALE0003'" :showBtn="showBtn" :scaleType="scaleNo" :checkStart="checkStart" @checkEnd="checkEnd" :saveWay="saveWay" />
<!--高血压-->
<hypertension v-if="scaleNo=='SCALE0001'" :showBtn="showBtn" :scaleType="scaleNo" :checkStart="checkStart" @checkEnd="checkEnd" :saveWay="saveWay" ></hypertension>
<!--糖尿病-->
<diabetes v-if="scaleNo=='SCALE0002'" :showBtn="showBtn" :scaleType="scaleNo" :checkStart="checkStart" @checkEnd="checkEnd" :saveWay="saveWay" ></diabetes>
</div> </div>
...@@ -40,23 +42,29 @@ ...@@ -40,23 +42,29 @@
<script> <script>
import BreadCrumb from '@/components/breadcrumb' import BreadCrumb from '@/components/breadcrumb'
// 脑卒中
// 糖尿病
import stroke from './patient-scale/stroke' import stroke from './patient-scale/stroke'
import hypertension from './patient-scale/hypertension'
import diabetes from './patient-scale/diabetes'
export default { export default {
data(){ data(){
return { return {
titleText: '',
titleSmText: '',
breadTxt: '录入管理', breadTxt: '录入管理',
jumPathThird: '/followup/record-manage/record-list', jumPathThird: '/followup/record-manage/record-list',
checkStart: false, checkStart: false,
showBtn: '1', showBtn: '1',
resourceId: '', // resourceId: '',
saveWay: 1, saveWay: 1,
scaleNo: ''
} }
}, },
components: { components: {
stroke, stroke,
hypertension,
BreadCrumb, BreadCrumb,
diabetes,
}, },
methods: { methods: {
formSubmit(val){ formSubmit(val){
...@@ -68,24 +76,23 @@ ...@@ -68,24 +76,23 @@
} }
}, },
created(){ created(){
this.resourceId = this.$route.query.resourceId; this.scaleNo = this.$route.query.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 = '高血压患者随访服务记录表';
this.titleSmText = '(本表为高血压患者在接受随访服务时由医生填写)';
}else if(this.scaleNo == 'SCALE0002'){
this.titleText = '2 型糖尿病患者随访服务记录表 ';
this.titleSmText = '(本表为2型糖尿病患者在接受随访服务时由医生填写)';
}
if(this.$route.query.showBtn=='0'){ if(this.$route.query.showBtn=='0'){
this.showBtn = String(this.$route.query.showBtn); this.showBtn = String(this.$route.query.showBtn);
} }
// 0003 脑卒中、0002 糖尿病、0001 高血压
}, },
// beforeRouteEnter (to, from, next) {
// next(vm=>{
// if(from.name=='planDetail'){
// vm.breadTxt = '计划管理';
// vm.jumPathThird = '/followup/plan-manage/plan-list'
// }else{
// vm.breadTxt = '录入管理';
// vm.jumPathThird = '/followup/record-manage/record-list'
// }
// })
// },
} }
</script> </script>
...@@ -118,7 +125,7 @@ ...@@ -118,7 +125,7 @@
} }
} }
.title-box{ .title-box{
padding: 60px; padding: 20px;
text-align: center; text-align: center;
h1{ h1{
font-size: 18px; font-size: 18px;
......
import { checkRange, checkIsInteger, checkNumberIsToFixed, checkNumberIsToFixedTwo } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseAuxiliary'){
const glycosylatedHemoglobinPercent = item.formObject.glycosylatedHemoglobinPercent
const glycosylatedHemoglobinDate = item.formObject.glycosylatedHemoglobinDate
item.dataSource.forEach((item2,index2)=>{
if((glycosylatedHemoglobinPercent||glycosylatedHemoglobinDate) && item2.refs){
$this.addComponents[index].dataSource[index2].rules[0].required = true;
$this.$refs['form' + index][0].validateField(['glycosylatedHemoglobinPercent','glycosylatedHemoglobinDate']);
}else{
if(item2.refs){
if(item2.refs == 'glycosylatedHemoglobinPercent'){
// $this.addComponents[index].dataSource[index2].rules[0].required = false;
$this.addComponents[index].dataSource[index2].rules = [{ required: false, message: '请输入糖化血红蛋白值', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkNumberIsToFixedTwo , trigger: ['submit','change'] }];
}else{
$this.addComponents[index].dataSource[index2].rules[0].required = false;
}
// $this.addComponents[index].dataSource[index2].rules[0].required = false;
$this.$nextTick(()=>{
$this.$refs['form'+index][0].validate((valid) => {
});
$this.$refs['form' + index][0].clearValidate(['fastingBloodSugar','glycosylatedHemoglobinPercent','glycosylatedHemoglobinDate']);
})
}
}
})
}
})
}
return [
{
formType: 'input',
className: 'float-none',
prop: 'fastingBloodSugar',
model: 'fastingBloodSugar',
disabled: false,
label: '空腹血糖值:',
placeholder: '请输入空腹血糖值',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: 'mmol/L', type: 'append'}],
rules: [{ required: true, message: '请输入空腹血糖值', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkNumberIsToFixed , trigger: ['submit','change'] }]
},
// {
// formType: 'div',
// name: '其他检查',
// className: 'sec-title',
// },
{
formType: 'input',
className: 'float-none',
prop: 'glycosylatedHemoglobinPercent',
model: 'glycosylatedHemoglobinPercent',
refs: 'glycosylatedHemoglobinPercent',
disabled: false,
label: '糖化血红蛋白值:',
placeholder: '请输入糖化血红蛋白值',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '%', type: 'append'}],
rules: [{ required: false, message: '请输入糖化血红蛋白值', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkNumberIsToFixedTwo , trigger: ['submit','change'] }],
changeFun: hanldeValue,
// blurFunc: hanldeValue
},
{
formType: 'date-picker',
className: 'float-none',
prop: 'glycosylatedHemoglobinDate',
model: 'glycosylatedHemoglobinDate',
refs: 'glycosylatedHemoglobinDate',
placeholder: '请选择',
label: '检查日期:',
format: 'MM 月 dd 日',
valueFormat: 'MM-dd',
dateType: 'date',
type: 'date',
rules: [{required: false, message: '请选择检查日期', trigger: ['submit','change','blur']}],
spanNum: 12,
changeFun: hanldeValue,
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'name',
model: 'name',
label: '姓名:',
disabled: false,
placeholder: '请输入姓名',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: true, message: '请输入姓名', trigger: ['submit','change']}],
},
{
formType: 'input',
className: 'float-none',
prop: 'no',
model: 'no',
label: '编号:',
disabled: false,
placeholder: '请输入编号',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: false, message: '请输入编号', trigger: ['submit','change']}],
},
{
formType: 'date-picker',
className: 'float-none',
prop: 'followupDate',
model: 'followupDate',
placeholder: '请选择',
label: '随访日期:',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
dateType: 'date',
type: 'date',
rules: [{required: true, message: '请选择随访日期', trigger: ['submit','change']}],
spanNum: 12,
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'followupType',
model: 'followupType',
spanNum: 24,
label: '随访方式:',
options: [
{ label: '门诊', value: '门诊' },
{ label: '家庭', value: '家庭' },
{ label: '电话', value: '电话' },
],
rules: [{ required: true, message: '请选择随访方式', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'smokingAmount',
model: 'smokingAmount',
disabled: false,
label: '本次日吸烟量:',
placeholder: '请输入本次日吸烟量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '支/日', type: 'append'}],
rules: [{ required: true, message: '请输入日吸烟量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextSmokingAmount',
model: 'nextSmokingAmount',
disabled: false,
label: '下次随访目标日吸烟量:',
placeholder: '请输入下次随访日吸烟量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '支/日', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访日吸烟量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'alcoholConsumption',
model: 'alcoholConsumption',
disabled: false,
label: '本次日饮酒量:',
placeholder: '请输入本次日饮酒量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '两/日', type: 'append'}],
rules: [{ required: true, message: '请输入本次日饮酒量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextAlcoholConsumption',
model: 'nextAlcoholConsumption',
disabled: false,
label: '下次随访目标日饮酒量:',
placeholder: '请输入下次随访日饮酒量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '两/日', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访日饮酒量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'workoutOfWeek',
model: 'workoutOfWeek',
disabled: false,
label: '本次运动情况:',
placeholder: '请输入本次运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '次/周', type: 'append'}],
rules: [{ required: true, message: '请输入本次运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'workoutDuration',
model: 'workoutDuration',
disabled: false,
placeholder: '请输入本次运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '分钟/次', type: 'append'}],
rules: [{ required: true, message: '请输入本次运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextWorkoutOfWeek',
model: 'nextWorkoutOfWeek',
disabled: false,
label: '下次随访目标运动情况:',
placeholder: '请输入下次随访运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '次/周', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextWorkoutDuration',
model: 'nextWorkoutDuration',
disabled: false,
placeholder: '请输入下次随访运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '分钟/次', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'stapleFoodGram',
model: 'stapleFoodGram',
disabled: false,
label: '实际主食摄入量:',
placeholder: '请输入每天摄入主食克数',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '克/天', type: 'append'}],
rules: [{ required: true, message: '请输入每天摄入主食克数', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextStapleFoodGram',
model: 'nextStapleFoodGram',
disabled: false,
label: '目标主食摄入量:',
placeholder: '请输入每天摄入主食克数',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '克/天', type: 'append'}],
rules: [{ required: true, message: '请输入每天摄入主食克数', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'psychologicalAdjustment',
model: 'psychologicalAdjustment',
spanNum: 24,
label: '心理调整:',
options: [
{ label: '良好', value: '良好' },
{ label: '一般', value: '一般' },
{ label: '差', value: '差' },
],
rules: [{ required: true, message: '请选择心理调整', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'followMedicalPractive',
model: 'followMedicalPractive',
spanNum: 24,
label: '遵医行为:',
options: [
{ label: '良好', value: '良好' },
{ label: '一般', value: '一般' },
{ label: '差', value: '差' },
],
rules: [{ required: true, message: '请选择遵医行为情况', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'list',
className: 'float-none',
// arrList: [
// {
// medicinesName: '吗丁啉',
// dosageDay: 3,
// dosageNum: 1,
// }
// ],
prop: 'arrList',
model: 'arrList',
label: '',
disabled: true,
spanNum: 24,
rules: [{required: false, message: '', trigger: ['submit','change']}],
clickDeleteFunc: () => {
}
},
{
formType: 'button',
className: 'float-none',
prop: 'followUpOrgName',
model: 'followUpOrgName',
icon: 'el-icon-circle-plus',
btnText: '点击添加',
disabled: false,
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
clickFunc: () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseMedicationUse'){
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: 30,
type: 'text',
labmsg: '次',
rules: [{required: true, message: '请输入胰岛素种类', trigger: ['submit','change']}],
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageDay',
model: 'dosageDay',
label: '用法:',
disabled: false,
placeholder: '请输入胰岛素用法',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: true, message: '请输入胰岛素用法', trigger: ['submit','change']}],
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageNum',
model: 'dosageNum',
label: '用量:',
disabled: false,
placeholder: '请输入胰岛素用量',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: true, message: '请输入胰岛素用量', trigger: ['submit','change']}],
},
]
}
import { checkMobile } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'radio',
className: 'obj-form-title',
prop: 'medicationObedience',
model: 'medicationObedience',
label: '服药依从性:',
disabled: false,
spanNum: 24,
options: [
{ label: '规律', value: '规律', disabled: false },
{ label: '间断', value: '间断', disabled: false },
{ label: '不服药', value: '不服药', disabled: false },
],
rules: [{ required: true, message: '请选择服药依从性', trigger: ['submit','change'] }],
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'medicalSideEffects',
model: 'medicalSideEffects',
label: '药物不良反应:',
disabled: false,
spanNum: 24,
options: [
{ label: '无', value: '无', disabled: false },
{ label: '有', value: '有', disabled: false },
],
rules: [{ required: true, message: '请选择有无不良反应', trigger: ['submit','change'] }],
},
{
formType: 'input',
className: 'obj-form-title2',
linkageRule: [{name: 'medicalSideEffects',value: ['有']}],
prop: 'remark',
model: 'remark',
disabled: false,
placeholder: '请输入不良反应',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: true, message: '请输入不良反应', trigger: ['submit','change'] }]
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'reactiveHypoglycemia',
model: 'reactiveHypoglycemia',
label: '低血糖反应:',
disabled: false,
spanNum: 24,
options: [
{ label: '无', value: '无', disabled: false },
{ label: '偶尔', value: '偶尔', disabled: false },
{ label: '频繁', value: '频繁', disabled: false },
],
rules: [{ required: true, message: '请选择低血糖反应', trigger: ['submit','change'] }],
},
{
formType: 'radio',
className: 'obj-form-title radio-block',
prop: 'followUpClassification',
model: 'followUpClassification',
spanNum: 24,
label: '此次随访分类:',
options: [
{ label: '控制满意(血压控制满意,无其他异常)', value: '控制满意(血压控制满意,无其他异常)' },
{ label: '控制不满意(血压控制不满意,无其他异常)', value: '控制不满意(血压控制不满意,无其他异常)' },
{ label: '不良反应(存在药物不良反应)', value: '不良反应(存在药物不良反应)' },
{ label: '并发症(出现新的并发症或并发症出现异常)', value: '并发症(出现新的并发症或并发症出现异常)' },
],
rules: [{ required: true, message: '请选择此次随访分类', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseReferral'){
const reason = item.formObject.reason
const mechanism = item.formObject.mechanism
const department = item.formObject.department
item.dataSource.forEach((item2,index2)=>{
if((reason||mechanism||department) && item2.rules){
$this.addComponents[index].dataSource[index2].rules[0].required = true;
}else{
$this.addComponents[index].dataSource[index2].rules[0].required = false;
$this.$nextTick(() => {
$this.$refs['form'+index][0].clearValidate(['reason','mechanism','department']);
})
}
})
}
// $this.$refs['form'+index][0].validate((valid) => {});
})
}
return [
{
formType: 'input',
className: 'float-none',
prop: 'reason',
model: 'reason',
label: '原因:',
disabled: false,
placeholder: '请输入原因',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入原因', trigger: ['submit','change','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'mechanism',
model: 'mechanism',
label: '机构:',
disabled: false,
placeholder: '请输入机构',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入机构', trigger: ['submit','change','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'department',
model: 'department',
label: '科室类别:',
disabled: false,
placeholder: '请输入科室类别',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入科室类别', trigger: ['submit','change','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'systolicBloodPressure',
model: 'systolicBloodPressure',
label: '收缩压SBP:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'mmHg', type: 'append'}],
rules: [{required: true, message: '请输入收缩压SBP', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }],
},
{
formType: 'input',
className: 'float-none',
prop: 'diastolicBloodPressure',
model: 'diastolicBloodPressure',
label: '舒张压DBP:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'mmHg', type: 'append'}],
rules: [{required: true, message: '请输入舒张压DBP', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }],
},
{
formType: 'input',
className: 'float-none',
prop: 'bodyHeight',
model: 'bodyHeight',
label: '身高:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'cm', type: 'append'}],
rules: [{required: true, message: '请输入身高', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] }, {validator: checkIsInteger , trigger: ['submit','change']}],
changeFun: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSign'){
$this.addComponents[index].formObject.bodyHeight = val;
}
})
},
blurFunc: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSign'){
let bodyWeight = $this.addComponents[index].formObject.bodyWeight
let bodyHeight = $this.addComponents[index].formObject.bodyHeight
if(bodyWeight && bodyHeight){
bodyWeight = parseFloat(bodyWeight);
bodyHeight = parseFloat(bodyHeight);
let bmi = (bodyWeight / Math.pow((bodyHeight/100),2)).toFixed(1);
$this.addComponents[index].formObject.bmi = bmi;
}
}
})
}
},
// 体质指数(BMI)=体重(kg)÷ 身高²(m)
{
formType: 'input',
className: 'float-none',
prop: 'bodyWeight',
model: 'bodyWeight',
label: '体重:',
disabled: false,
placeholder: '请输入(体重可以带1位小数点)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg', type: 'append'}],
rules: [{required: true, message: '请输入体重', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] }, {validator: checkNumberIsToFixed , trigger: ['submit','change']}],
changeFun: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSign'){
$this.addComponents[index].formObject.bodyWeight = val;
}
})
},
blurFunc: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSign'){
let bodyWeight = $this.addComponents[index].formObject.bodyWeight
let bodyHeight = $this.addComponents[index].formObject.bodyHeight
if(bodyWeight && bodyHeight){
bodyWeight = parseFloat(bodyWeight);
bodyHeight = parseFloat(bodyHeight);
let bmi = (bodyWeight / Math.pow((bodyHeight/100),2)).toFixed(1);
$this.addComponents[index].formObject.bmi = bmi;
}
}
})
}
},
{
formType: 'input',
className: 'float-none',
prop: 'bmi',
model: 'bmi',
label: 'BMI(系统自动生成):',
disabled: true,
placeholder: '(这里是自动计算所得)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg/m^2', type: 'append'}],
},
{
formType: 'input',
className: 'float-none',
prop: 'nextBodyWeight',
model: 'nextBodyWeight',
label: '下次随访目标体重:',
disabled: false,
placeholder: '请输入(体重可以带1位小数点)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg', type: 'append'}],
rules: [{required: true, message: '请输入下次随访体重', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] }, {validator: checkNumberIsToFixed , trigger: ['submit','change']}],
changeFun: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSign'){
$this.addComponents[index].formObject.nextBodyWeight = val;
}
})
},
blurFunc: ()=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSign'){
let nextBodyWeight = $this.addComponents[index].formObject.nextBodyWeight
let bodyHeight = $this.addComponents[index].formObject.bodyHeight
if(nextBodyWeight && bodyHeight){
nextBodyWeight = parseFloat(nextBodyWeight);
bodyHeight = parseFloat(bodyHeight);
let nextBmi = (nextBodyWeight / Math.pow((bodyHeight/100),2)).toFixed(1);
$this.addComponents[index].formObject.nextBmi = nextBmi;
}
}
})
}
},
{
formType: 'input',
className: 'float-none',
prop: 'nextBmi',
model: 'nextBmi',
label: '下次随访BMI(系统自动生成):',
disabled: true,
placeholder: '(这里是自动计算所得)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg/m^2', type: 'append'}],
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'dorsalisPedisArteryPulsation',
model: 'dorsalisPedisArteryPulsation',
label: '足背动脉搏动:',
disabled: false,
spanNum: 24,
options: [
{ label: '触及正常', value: '触及正常', disabled: false },
{ label: '双侧减弱', value: '双侧减弱', disabled: false },
{ label: '左侧减弱', value: '左侧减弱', disabled: false },
{ label: '右侧减弱', value: '右侧减弱', disabled: false },
{ label: '双侧消失', value: '双侧消失', disabled: false },
{ label: '左侧消失', value: '左侧消失', disabled: false },
{ label: '右侧消失', value: '右侧消失', disabled: false },
],
rules: [{ required: true, message: '请选择足背动脉搏动情况', trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'remark',
model: 'remark',
disabled: false,
label: '其他:',
placeholder: '请输入其他体征',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: false, message: '请输入其他体征', trigger: ['submit','change'] }]
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'date-picker',
className: 'float-none',
prop: 'nextFollowDay',
model: 'nextFollowDay',
placeholder: '请选择',
label: '下次随访日期:',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
dateType: 'date',
type: 'date',
rules: [{required: true, message: '请选择下次随访日期', trigger: ['submit','change']}],
spanNum: 12,
},
// {
// formType: 'input',
// className: 'float-none',
// prop: 'doctorSignature',
// model: 'doctorSignature',
// label: '随访医生签名:',
// disabled: false,
// placeholder: '请输入随访人员姓名',
// spanNum: 12,
// maxlength: 30,
// type: 'text',
// labmsg: '次',
// rules: [{required: true, message: '请输入随访医生签名', trigger: ['submit','change']}],
// },
]
}
import { checkMobile } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'radio',
className: 'obj-form-title',
prop: 'hasSymptom',
model: 'hasSymptom',
label: '是否有症状:',
disabled: false,
spanNum: 24,
options: [
{ label: '无', value: '无', disabled: false },
{ label: '有', value: '有', disabled: false },
],
rules: [{ required: true, message: '请选择随访期间有无症状', trigger: ['submit','change'] }],
changeFun: (e) => {
if(e == '有') {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseSymptom'){
$this.addComponents[index].formObject = {
...$this.addComponents[index].formObject,
symptom: []
}
}
})
}
}
},
{
formType: 'checkbox',
className: 'obj-form-title',
prop: 'symptom',
model: 'symptom',
label: '选择的症状:',
linkageRule: [{name: 'hasSymptom', value: ['有']}],
disabled: false,
changeFun: (val) => {
// console.log(val)
},
spanNum: 24,
options: [
{label: '多饮', value: '多饮', disabled: false},
{label: '多食', value: '多食', disabled: false},
{label: '多尿', value: '多尿', disabled: false},
{label: '视力模糊', value: '视力模糊', disabled: false},
{label: '感染', value: '感染', disabled: false},
{label: '手脚麻木', value: '手脚麻木', disabled: false},
{label: '下肢浮肿', value: '下肢浮肿', disabled: false},
{label: '体重明显下降', value: '体重明显下降', disabled: false},
{label: '其他', value: '其他', disabled: false},
],
rules: [{required: true, message: '选择的症状', trigger: ['submit']}]
},
{
formType: 'input',
className: 'obj-form-title2',
linkageRule: [{name: 'symptom',value: ['其他']}],
prop: 'remark',
model: 'remark',
disabled: false,
placeholder: '请输入其他症状',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: true, message: '请输入其他症状', trigger: ['submit','change'] }]
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'name',
model: 'name',
label: '姓名:',
disabled: false,
placeholder: '请输入姓名',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: true, message: '请输入姓名', trigger: ['submit','change']}],
},
{
formType: 'input',
className: 'float-none',
prop: 'no',
model: 'no',
label: '编号:',
disabled: false,
placeholder: '请输入编号',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: false, message: '请输入编号', trigger: ['submit','change']}],
},
{
formType: 'date-picker',
className: 'float-none',
prop: 'followupDate',
model: 'followupDate',
placeholder: '请选择',
label: '随访日期:',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
dateType: 'date',
type: 'date',
rules: [{required: true, message: '请选择随访日期', trigger: ['submit','change']}],
spanNum: 12,
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'followupType',
model: 'followupType',
spanNum: 24,
label: '随访方式:',
options: [
{ label: '门诊', value: '门诊' },
{ label: '家庭', value: '家庭' },
{ label: '电话', value: '电话' },
],
rules: [{ required: true, message: '请选择随访方式', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'helpCheck',
model: 'helpCheck',
disabled: false,
label: '辅助检查:',
placeholder: '请输入辅助检查',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: false, message: '请输入辅助检查', trigger: ['submit','change'] }]
},
{
formType: 'radio',
className: 'float-none',
prop: 'medicationObedience',
model: 'medicationObedience',
spanNum: 24,
label: '服药依从性:',
options: [
{ label: '规律', value: '规律' },
{ label: '间断', value: '间断' },
{ label: '不服药', value: '不服药' },
],
rules: [{ required: true, message: '请选择服药依从性', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
{
formType: 'radio',
className: 'float-none',
prop: 'medicalSideEffects',
model: 'medicalSideEffects',
spanNum: 24,
label: '药物不良反应:',
options: [
{ label: '无', value: '无' },
{ label: '有', value: '有' },
],
rules: [{ required: true, message: '请选择有无药物不良反应', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
{
formType: 'input',
className: 'float-none',
linkageRule: [{name: 'medicalSideEffects',value: ['有']}],
prop: 'adrsMark',
model: 'adrsMark',
disabled: false,
placeholder: '请输入药物不良反应',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: true, message: '请输入药物不良反应', trigger: ['submit','change'] }]
},
{
formType: 'radio',
className: 'float-none radio-block',
prop: 'followUpClassification',
model: 'followUpClassification',
spanNum: 24,
label: '此次随访分类:',
options: [
{ label: '控制满意(血压控制满意,无其他异常)', value: '控制满意(血压控制满意,无其他异常)' },
{ label: '控制不满意(血压控制不满意,无其他异常)', value: '控制不满意(血压控制不满意,无其他异常)' },
{ label: '不良反应(存在药物不良反应)', value: '不良反应(存在药物不良反应)' },
{ label: '并发症(出现新的并发症或并发症出现异常)', value: '并发症(出现新的并发症或并发症出现异常)' },
],
rules: [{ required: true, message: '请选择此次随访分类', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'smokingAmount',
model: 'smokingAmount',
disabled: false,
label: '本次日吸烟量:',
placeholder: '请输入本次日吸烟量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '支/日', type: 'append'}],
rules: [{ required: true, message: '请输入日吸烟量', trigger: ['submit','change','blur'] },{ validator: checkRange , trigger: ['submit','change','blur'] },{ validator: checkIsInteger , trigger: ['submit','change','blur'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextSmokingAmount',
model: 'nextSmokingAmount',
disabled: false,
label: '下次随访日吸烟量:',
placeholder: '请输入下次随访日吸烟量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '支/日', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访日吸烟量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'alcoholConsumption',
model: 'alcoholConsumption',
disabled: false,
label: '本次日饮酒量:',
placeholder: '请输入本次日饮酒量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '两/日', type: 'append'}],
rules: [{ required: true, message: '请输入本次日饮酒量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextAlcoholConsumption',
model: 'nextAlcoholConsumption',
disabled: false,
label: '下次随访日饮酒量:',
placeholder: '请输入下次随访日饮酒量',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '两/日', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访日饮酒量', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'workoutOfWeek',
model: 'workoutOfWeek',
disabled: false,
label: '本次运动情况:',
placeholder: '请输入本次运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '次/周', type: 'append'}],
rules: [{ required: true, message: '请输入本次运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'workoutDuration',
model: 'workoutDuration',
disabled: false,
placeholder: '请输入本次运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '分钟/次', type: 'append'}],
rules: [{ required: true, message: '请输入本次运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextWorkoutOfWeek',
model: 'nextWorkoutOfWeek',
disabled: false,
label: '下次随访运动情况:',
placeholder: '请输入下次随访运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '次/周', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'input',
className: 'float-none',
prop: 'nextWorkoutDuration',
model: 'nextWorkoutDuration',
disabled: false,
placeholder: '请输入下次随访运动情况',
spanNum: 8,
maxlength: 30,
type: 'number',
labmsg: '',
slots: [{name: '分钟/次', type: 'append'}],
rules: [{ required: true, message: '请输入下次随访运动情况', trigger: ['submit','change'] },{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }]
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'saltIntake',
model: 'saltIntake',
spanNum: 24,
label: '目前摄盐情况(咸淡):',
options: [
{ label: '轻', value: '轻' },
{ label: '中', value: '中' },
{ label: '重', value: '重' },
],
rules: [{ required: true, message: '请选择目前摄盐情况', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'nextSaltIntake',
model: 'nextSaltIntake',
spanNum: 24,
label: '下次随访摄盐情况(咸淡):',
options: [
{ label: '轻', value: '轻' },
{ label: '中', value: '中' },
{ label: '重', value: '重' },
],
rules: [{ required: true, message: '请选择下次随访摄盐情况', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'psychologicalAdjustment',
model: 'psychologicalAdjustment',
spanNum: 24,
label: '心理调整:',
options: [
{ label: '良好', value: '良好' },
{ label: '一般', value: '一般' },
{ label: '差', value: '差' },
],
rules: [{ required: true, message: '请选择心理调整', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
{
formType: 'radio',
className: 'obj-form-title',
prop: 'followMedicalPractive',
model: 'followMedicalPractive',
spanNum: 24,
label: '遵医行为:',
options: [
{ label: '良好', value: '良好' },
{ label: '一般', value: '一般' },
{ label: '差', value: '差' },
],
rules: [{ required: true, message: '请选择心里调整', trigger: ['submit','change'] }],
changeFun: (e)=>{
}
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
const medicinesName = item.formObject.medicinesName
const dosageDay = item.formObject.dosageDay
const dosageNum = item.formObject.dosageNum
item.dataSource.forEach((item2,index2)=>{
if((medicinesName||dosageDay||dosageNum) && item2.rules && item2.prop!='arrList' && item2.refs){
$this.addComponents[index].dataSource[index2].rules[0].required = true;
}else{
if(item2.refs){
$this.addComponents[index].dataSource[index2].rules[0].required = false;
$this.$nextTick(()=>{
$this.$refs['form' + index][0].clearValidate(['medicinesName','dosageDay','dosageNum']);
})
}
}
})
// $this.$refs['form'+index][0].validate((valid) => {
// });
}
})
}
return [
{
formType: 'list',
className: 'float-none',
arrList: [
],
prop: 'arrList',
model: 'arrList',
label: '',
disabled: true,
spanNum: 12,
rules: [{required: false, message: '', trigger: ['submit','change']}],
clickDeleteFunc: () => {
}
},
{
formType: 'button',
className: 'float-none',
prop: 'followUpOrgName',
model: 'followUpOrgName',
icon: 'el-icon-circle-plus',
btnText: '点击添加',
disabled: false,
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
clickFunc: () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
if($this.addComponents[index].formObject.arrList && $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',
refs:'medicinesName',
label: '其他药物名称:',
disabled: false,
placeholder: '请输入其他药物',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: false, message: '请输入其他药物', trigger: ['submit','change','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageDay',
model: 'dosageDay',
refs:'dosageDay',
label: '其他药物用法:',
disabled: false,
placeholder: '请输入其他药物用法每日几次',
spanNum: 12,
maxlength: 30,
type: 'text',
slots: [{name: '次/日', type: 'append'}],
rules: [{required: false, message: '请输入其他药物用法每日几次', trigger: ['submit','change','blur']},{ validator: checkRange , trigger: ['submit','change','blur'] },{ validator: checkIsInteger , trigger: ['submit','change','blur'] }],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageNum',
model: 'dosageNum',
refs:'dosageNum',
label: '其他药物用量:',
disabled: false,
placeholder: '请输入其他药物每次用量',
spanNum: 12,
maxlength: 30,
type: 'text',
slots: [{name: '每次', type: 'append'}],
rules: [{required: false, message: '请输入其他药物每次用量', trigger: ['submit','change','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
]
}
export default ($this) => {
return [
{
formType: 'date-picker',
className: 'float-none',
prop: 'nextFollowDay',
model: 'nextFollowDay',
placeholder: '请选择',
label: '下次随访日期:',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
dateType: 'date',
type: 'date',
rules: [{required: true, message: '请选择下次随访日期', trigger: ['submit','change']}],
spanNum: 12,
},
// {
// formType: 'input',
// className: 'float-none',
// prop: 'doctorSignature',
// model: 'doctorSignature',
// label: '随访医生签名:',
// disabled: false,
// placeholder: '请输入随访人员姓名',
// spanNum: 12,
// maxlength: 30,
// type: 'text',
// labmsg: '次',
// rules: [{required: true, message: '请输入随访医生签名', trigger: ['submit','change']}],
// },
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceReferral'){
const reason = item.formObject.reason
const mechanism = item.formObject.mechanism
const department = item.formObject.department
item.dataSource.forEach((item2,index2)=>{
if((reason||mechanism||department) && item2.rules){
$this.addComponents[index].dataSource[index2].rules[0].required = true;
}else{
$this.addComponents[index].dataSource[index2].rules[0].required = false;
$this.$nextTick(()=>{
$this.$refs['form' + index][0].clearValidate(['reason','mechanism','department']);
})
}
})
// $this.$refs['form'+index][0].validate((valid) => {
// });
}
})
}
return [
{
formType: 'input',
className: 'float-none',
prop: 'reason',
model: 'reason',
refs:'reason',
label: '原因:',
disabled: false,
placeholder: '请输入原因',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入原因', trigger: ['change','submit','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'mechanism',
model: 'mechanism',
refs:'mechanism',
label: '机构:',
disabled: false,
placeholder: '请输入机构',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入机构', trigger: ['change','submit','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'department',
model: 'department',
refs:'department',
label: '科室类别:',
disabled: false,
placeholder: '请输入科室类别',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入科室类别', trigger: ['change','submit','blur']}],
changeFun: hanldeValue,
blurFunc: hanldeValue
},
]
}
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'input',
className: 'float-none',
prop: 'systolicBloodPressure',
model: 'systolicBloodPressure',
label: '收缩压SBP:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'mmHg', type: 'append'}],
rules: [{required: true, message: '请输入收缩压SBP', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }],
},
{
formType: 'input',
className: 'float-none',
prop: 'diastolicBloodPressure',
model: 'diastolicBloodPressure',
label: '舒张压DBP:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'mmHg', type: 'append'}],
rules: [{required: true, message: '请输入舒张压DBP', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }],
},
{
formType: 'input',
className: 'float-none',
prop: 'bodyHeight',
model: 'bodyHeight',
label: '身高:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'cm', type: 'append'}],
rules: [{required: true, message: '请输入身高', trigger: ['submit','change','blur']},{ validator: checkRange , trigger: ['submit','change','blur'] }, {validator: checkIsInteger , trigger: ['submit','change','blur']}],
changeFun: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSign'){
$this.addComponents[index].formObject.bodyHeight = val;
}
})
},
blurFunc: ()=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSign'){
let bodyWeight = $this.addComponents[index].formObject.bodyWeight
let bodyHeight = $this.addComponents[index].formObject.bodyHeight
if(bodyWeight && bodyHeight){
bodyWeight = parseFloat(bodyWeight);
bodyHeight = parseFloat(bodyHeight);
let bmi = (bodyWeight / Math.pow((bodyHeight/100),2)).toFixed(1);
$this.addComponents[index].formObject.bmi = bmi;
}
}
})
}
},
// 体质指数(BMI)=体重(kg)÷ 身高²(m)
{
formType: 'input',
className: 'float-none',
prop: 'bodyWeight',
model: 'bodyWeight',
label: '体重:',
disabled: false,
placeholder: '请输入(体重可以带1位小数点)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg', type: 'append'}],
rules: [{required: true, message: '请输入体重', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] }, {validator: checkNumberIsToFixed , trigger: ['submit','change']}],
changeFun: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSign'){
$this.addComponents[index].formObject.bodyWeight = val;
}
})
},
blurFunc: ()=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSign'){
let bodyWeight = $this.addComponents[index].formObject.bodyWeight
let bodyHeight = $this.addComponents[index].formObject.bodyHeight
if(bodyWeight && bodyHeight){
bodyWeight = parseFloat(bodyWeight);
bodyHeight = parseFloat(bodyHeight);
let bmi = (bodyWeight / Math.pow((bodyHeight/100),2)).toFixed(1);
$this.addComponents[index].formObject.bmi = bmi;
}
}
})
}
},
{
formType: 'input',
className: 'float-none',
prop: 'bmi',
model: 'bmi',
label: 'BMI(系统自动生成):',
disabled: true,
placeholder: '(这里是自动计算所得)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg/m^2', type: 'append'}],
},
{
formType: 'input',
className: 'float-none',
prop: 'nextBodyWeight',
model: 'nextBodyWeight',
label: '下次随访体重:',
disabled: false,
placeholder: '请输入(体重可以带1位小数点)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg', type: 'append'}],
rules: [{required: true, message: '请输入下次随访体重', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] }, {validator: checkNumberIsToFixed , trigger: ['submit','change']}],
changeFun: (val)=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSign'){
$this.addComponents[index].formObject.nextBodyWeight = val;
}
})
},
blurFunc: ()=>{
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSign'){
let nextBodyWeight = $this.addComponents[index].formObject.nextBodyWeight
let bodyHeight = $this.addComponents[index].formObject.bodyHeight
if(nextBodyWeight && bodyHeight){
nextBodyWeight = parseFloat(nextBodyWeight);
bodyHeight = parseFloat(bodyHeight);
let nextBmi = (nextBodyWeight / Math.pow((bodyHeight/100),2)).toFixed(1);
$this.addComponents[index].formObject.nextBmi = nextBmi;
}
}
})
}
},
{
formType: 'input',
className: 'float-none',
prop: 'nextBmi',
model: 'nextBmi',
label: '下次随访BMI(系统自动生成):',
disabled: true,
placeholder: '(这里是自动计算所得)',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: 'kg/m^2', type: 'append'}],
},
{
formType: 'input',
className: 'float-none',
prop: 'heartRate',
model: 'heartRate',
label: '心率:',
disabled: false,
placeholder: '请输入',
spanNum: 8,
type: 'number',
labmsg: '次',
slots: [{name: '次/分钟', type: 'append'}],
rules: [{required: true, message: '请输入心率', trigger: ['submit','change']},{ validator: checkRange , trigger: ['submit','change'] },{ validator: checkIsInteger , trigger: ['submit','change'] }],
},
{
formType: 'input',
className: 'float-none',
prop: 'remark',
model: 'remark',
disabled: false,
label: '其他',
placeholder: '请输入其他体征',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: false, message: '请输入其他体征', trigger: ['submit','change'] }]
},
]
}
import { checkMobile } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
return [
{
formType: 'radio',
className: 'obj-form-title',
prop: 'hasSymptom',
model: 'hasSymptom',
label: '是否有症状:',
disabled: false,
spanNum: 24,
options: [
{ label: '无', value: '无', disabled: false },
{ label: '有', value: '有', disabled: false },
],
rules: [{ required: true, message: '请选择是否有症状', trigger: ['submit','change'] }],
changeFun: (e) => {
if(e == '有') {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceSymptom'){
$this.addComponents[index].formObject = {
...$this.addComponents[index].formObject,
symptom: []
}
}
})
}
}
},
{
formType: 'checkbox',
className: 'float-none obj-form-title2',
linkageRule: [{name: 'hasSymptom', value: ['有']}],
prop: 'symptom',
model: 'symptom',
label: '症状类型:',
disabled: false,
changeFun: (val) => {
},
spanNum: 24,
options: [
// {label: '无症状', value: '无症状', disabled: false},
{label: '头痛头晕', value: '头痛头晕', disabled: false},
{label: '恶心呕吐', value: '恶心呕吐', disabled: false},
{label: '眼花耳鸣', value: '眼花耳鸣', disabled: false},
{label: '呼吸困难', value: '呼吸困难', disabled: false},
{label: '心悸胸闷', value: '心悸胸闷', disabled: false},
{label: '鼻衄出血不止', value: '鼻衄出血不止', disabled: false},
{label: '四肢发麻', value: '四肢发麻', disabled: false},
{label: '下肢水肿', value: '下肢水肿', disabled: false},
{label: '其他', value: '其他', disabled: false},
],
rules: [{required: true, message: '选择的症状', trigger: ['submit']}]
},
{
formType: 'input',
className: 'float-none obj-form-title3',
linkageRule: [{name: 'symptom',value: ['其他']}],
prop: 'remark',
model: 'remark',
disabled: false,
placeholder: '请输入其他症状',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '',
rules: [{ required: true, message: '请输入其他症状', trigger: ['submit','change'] }]
},
]
}
...@@ -50,16 +50,35 @@ export default ($this) => { ...@@ -50,16 +50,35 @@ export default ($this) => {
rules: [{ required: true, message: '请选择随访轮次', trigger: ['submit','change'] }], rules: [{ required: true, message: '请选择随访轮次', trigger: ['submit','change'] }],
changeFun: (e)=>{ changeFun: (e)=>{
// console.log(e) // console.log(e)
// if(e == '12个月'){
// $this.needRule = false;
// sessionStorage.setItem('needRule',false);
// }else{
// $this.needRule = true;
// sessionStorage.setItem('needRule',true);
// }
$this.addComponents.forEach((item,index)=>{
if(item.name == 'CheckBody'){
item.dataSource.forEach((item2,index2)=>{
if(e == '12个月'){ if(e == '12个月'){
$this.needRule = false; $this.needRule = false;
localStorage.setItem('needRule',false);
}else{ }else{
$this.needRule = true; $this.needRule = true;
localStorage.setItem('needRule',true);
} }
sessionStorage.setItem('needRule',$this.needRule);
if(item2.rules){
$this.addComponents[index].dataSource[index2].rules[0].required = !$this.needRule;
}
})
} }
},
})
}
},
] ]
} }
<template>
<div class="form-wrap">
<!--渲染不同的模块表单-->
<div v-if="canRender" v-for="(item, index) in addComponents">
<div v-if="item.showModule" class="content-box" >
<div v-if="!item.hideTitle" class="title">{{item.title}}</div>
<el-form
:ref="'form' + index"
:id="'form' + index"
:model="item.formObject"
size="medium"
label-position="left"
class="form"
>
<FormScale
:dataSource="item.dataSource"
:form="item.formObject"
:ruleNew="item.ruleNew"
:class="item.className"
/>
</el-form>
<ChoseMedication
v-if="dialogFormVisible"
@closeDialog="closeDialog"
@setMedication="setMedication"
/>
</div>
</div>
</div>
</template>
<script>
import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale } from '@/utils/followup/followapis'
// 量表 template
import FormScale from '@/components/followup/form/index'
import ChoseMedication from '@/views/followup/record-manage/dialog/chose-medication'
// 量表模块数据模型
// 糖尿病
import diabetesSourseBaseInfo from '../models/diabetes/diabetesSourseBaseInfo'
import diabetesSourseSymptom from '../models/diabetes/diabetesSourseSymptom'
import diabetesSourseSign from '../models/diabetes/diabetesSourseSign'
import diabetesSourseLifeMode from '../models/diabetes/diabetesSourseLifeMode'
import diabetesSourseAuxiliary from '../models/diabetes/diabetesSourseAuxiliary'
import diabetesSourseOther from '../models/diabetes/diabetesSourseOther'
import diabetesSourseMedicationUse from '../models/diabetes/diabetesSourseMedicationUse'
import diabetesSourseReferral from '../models/diabetes/diabetesSourseReferral'
import diabetesSourseSignature from '../models/diabetes/diabetesSourseSignature'
export default {
data(){
return {
domain: '',//通过接口获取白名单域名
needRule: true, //是否动态开启验证
showModule: true, //是否隐藏表单模块
canRender: true,
valid: false,
validList: [],
moduleList: [],//模块列表
planPatientsTimesId: '',
scaleNo: '',
doctorId: '',
planTimesId: '',
addComponents: [],
addComponentsSourceList: [],
formData: {},//整个表单对象
dialogFormVisible: false,//是否显示添加用药情况dialog
medication: [],// 用药情况
type2Obj: {},
}
},
components: {
FormScale,
ChoseMedication,
},
props: {
scaleType: String,//病种类型
checkStart: Boolean,
saveWay: Number,
showBtn: String,
},
watch: {
checkStart(val){
if(val){
this.validList = [];
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
// 将每个模块的fornName对应后台的表名放到表单对象
this.formData[formName] = this.addComponents[i].formObject;
this.$nextTick(()=>{
// saveWay=1是提交,进行校验,2是暂存,不需要校验,直接发送请求
if(this.saveWay==1){
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].validate((valid) => {
this.validList.push(valid);
});
}
}
})
}
this.$nextTick(()=>{
// saveWay=1是提交,进行校验,2是暂存,不需要校验,直接发送请求
if(this.saveWay==1){
for(let k=0;k<this.validList.length;k++){
if(!this.validList[k]){
this.$emit('checkEnd',false);
this.valid = false;
this.$nextTick(() => {
// 如果表单未完善,跳转到该表单模块
document.querySelector(`#form${k}`).scrollIntoView(true);
})
return;
}else{
this.valid = true;
}
}
if(this.valid){
this.dataSubmit(()=>{
updateScalesStatus({
fuPlanPatientTimesId: this.planPatientsTimesId,
planTimesId: this.planTimesId,
resourceId: this.scaleNo
})
});
}
this.$emit('checkEnd',false);
}else{
this.dataSubmit();
}
})
}
},
showModule(val){
this.addComponents.forEach((item,index)=>{
if(index >= 3){
this.addComponents[index].showModule = val;
}
})
},
},
created(){
this.planPatientsTimesId = this.$route.query.planPatientsTimesId
this.scaleNo = this.$route.query.scaleNo
this.doctorId = this.$route.query.doctorId
this.planTimesId = this.$route.query.planTimesId;
// 获取量表类型
this.initScaleType();
// 获取白名单域名
this.getWhiteDomain();
},
methods: {
// 获取量表类型
initScaleType(){
this.addComponentsSourceList = [
{name: 'diabetesSourseBaseInfo',formObject: {},showModule: true,formName: 'h_s_001',className: 'obj-form-title',dataSource: diabetesSourseBaseInfo(this), hideTitle: true, title: '基本信息'},
{name: 'diabetesSourseSymptom',formObject: {},showModule: true,formName: 'diabetes_001',className: 'obj-form-title',dataSource: diabetesSourseSymptom(this), hideTitle: false, title: '症状'},
{name: 'diabetesSourseSign',formObject: {bmi: 0,nextBmi: 0,},showModule: true,formName: 'diabetes_002',className: 'obj-form-title',dataSource: diabetesSourseSign(this), hideTitle: false, title: '体征'},
{name: 'diabetesSourseLifeMode',formObject: {},showModule: true,formName: 'diabetes_003',className: 'obj-form-title',dataSource: diabetesSourseLifeMode(this), hideTitle: false, title: '生活方式指导'},
{name: 'diabetesSourseAuxiliary',formObject: {glycosylatedHemoglobinPercent:'',glycosylatedHemoglobinDate:''},showModule: true,formName: 'diabetes_004',className: 'obj-form-title',dataSource: diabetesSourseAuxiliary(this), hideTitle: false, title: '辅助检查'},
{name: 'diabetesSourseOther',formObject: {},showModule: true,formName: 'diabetes_005',className: 'obj-form-title',dataSource: diabetesSourseOther(this), hideTitle: true, title: '其他'},
{name: 'diabetesSourseMedicationUse',formObject: {arrList:this.medication},showModule: true,formName: 'h_s_002',className: 'obj-form-title',dataSource: diabetesSourseMedicationUse(this), hideTitle: false, title: '用药情况'},
{name: 'diabetesSourseReferral',formObject: {reason:'',mechanism:'',department:''},showModule: true,formName: 'h_s_003',className: 'obj-form-title',dataSource: diabetesSourseReferral(this), hideTitle: false, title: '转诊'},
{name: 'diabetesSourseSignature',formObject: {},showModule: true,formName: 'h_s_004',className: 'obj-form-title',dataSource: diabetesSourseSignature(this), hideTitle: true, title: '签名'},
]
},
// 获取白名单域名
getWhiteDomain(){
getDomain().then(res=>{
if(res.code=='000000'){
this.domain = res.data;
// 获取量表模块
this.getFormModules();
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{
this.$message({
message: res.message,
type: 'error'
});
}
})
},
// 动态开启验证开关
// 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=>{
if(res.code=='000000'){
this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){
if(this.moduleList[i]==this.addComponentsSourceList[j].formName){
this.addComponents.push(this.addComponentsSourceList[j])
}
}
}
}else{
this.$message({
message: res.message,
type: 'error'
});
}
})
},
// 处理获取用药情况详情数据
handleModuleMedicalUseData(obj){
if(obj.medicineType == '1'){
const { dosageDay,dosageNum,medicinesName,medicineType } = obj;
this.medication.push({ dosageDay,dosageNum,medicinesName,medicineType });
}else if(obj.medicineType == '2'){
const { dosageDay,dosageNum,medicinesName,medicineType } = obj;
this.type2Obj = { dosageDay,dosageNum,medicinesName,medicineType }
}
},
// 获取量表详情
getFormDetail(){
getScaleDetail(this.domain,this.planPatientsTimesId,this.scaleNo).then(res=>{
this.formData = res.data
let keysList = Object.keys(this.formData);
if(keysList.length > 0){
this.medication = [];
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
// let type2Obj = {};
if(this.formData[formName] && formName == 'h_s_002'){
let getDataHS002 = this.formData[formName];
if(Array.isArray(getDataHS002)){
getDataHS002.forEach((item,index)=>{
this.handleModuleMedicalUseData(item);
})
}else {
// 如果是对象,则为一条数据
this.handleModuleMedicalUseData(getDataHS002);
}
this.addComponents[i].formObject = {
arrList: this.medication,
...this.type2Obj
}
}else if(this.formData[formName] && formName == 'diabetes_001'){
this.addComponents[i].formObject = this.formData[formName];
let symptom = this.formData[formName].symptom;
this.addComponents[i].formObject.symptom = JSON.parse(symptom || '[]');
}else{
this.addComponents[i].formObject = this.formData[formName];
}
// 量表字段回显,会触发change校验,所以这里拿到数据渲染页面后,重置验证
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].resetFields();
}
}
this.canRender = true;
this.$forceUpdate();
}
})
},
// 提交量表
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.diabetes_001.symptom = JSON.stringify(this.formData.diabetes_001.symptom);
let arrNew = [];
arrNew.push({
medicineType: '2',
medicinesName:this.formData.h_s_002.medicinesName,
dosageDay: this.formData.h_s_002.dosageDay,
dosageNum:this.formData.h_s_002.dosageNum
});
this.medication = [...this.medication,...arrNew];
this.formData.h_s_002 = this.medication
postScale(this.domain,this.formData).then(res=>{
if(res.code=='000000'){
let doMsg = (this.saveWay==1) ? '提交成功' : '保存成功';
this.$message({
message: doMsg,
type: 'success'
});
if(callback){
callback();
}
setTimeout(()=>{
this.$router.push({
path: '/followup/record-manage/record-list'
})
},1000)
}else{
let doMsg = (this.saveWay==1) ? '提交失败' : '保存失败';
this.$message({
message: doMsg,
type: 'error'
});
}
});
// }
// this.$emit('checkEnd',false);
},
closeDialog(val){
this.dialogFormVisible = val;
},
setMedication(val){
this.medication.push({...val,medicineType:'1'});
}
},
}
</script>
<style scoped lang="scss">
.form-wrap{
.content-box{
.title{
line-height: 60px;
height: 60px;
font-weight: bold;
font-size: 18px;
border-bottom: 1px dashed #ccc;
}
}
}
</style>
<template> <template>
<div> <div class="form-wrap">
<!--渲染不同的模块表单-->
<div v-if="canRender" v-for="(item, index) in addComponents">
<div v-if="item.showModule" class="content-box" >
<div v-if="!item.hideTitle" class="title">{{item.title}}</div>
<el-form
:ref="'form' + index"
:id="'form' + index"
:model="item.formObject"
size="medium"
label-position="left"
class="form"
>
<FormScale
:dataSource="item.dataSource"
:form="item.formObject"
:ruleNew="item.ruleNew"
:class="item.className"
/>
</el-form>
<ChoseMedication
v-if="dialogFormVisible"
@closeDialog="closeDialog"
@setMedication="setMedication"
/>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
export default {} import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale } from '@/utils/followup/followapis'
// 量表 template
import FormScale from '@/components/followup/form/index'
import ChoseMedication from '@/views/followup/record-manage/dialog/chose-medication';
// 量表模块数据模型
// 高血压
import hypeDataSourceBaseInfo from '../models/hypertension/hypeDataSourceBaseInfo'
import hypeDataSourceSymptom from '../models/hypertension/hypeDataSourceSymptom'
import hypeDataSourceSign from '../models/hypertension/hypeDataSourceSign'
import hypeDataSourceLifeMode from '../models/hypertension/hypeDataSourceLifeMode'
import hypeDataSourceHelpChecking from '../models/hypertension/hypeDataSourceHelpChecking'
import hypeDataSourceMedicationUse from '../models/hypertension/hypeDataSourceMedicationUse'
import hypeDataSourceReferral from '../models/hypertension/hypeDataSourceReferral'
import hypeDataSourceNextFollowDay from '../models/hypertension/hypeDataSourceNextFollowDay'
export default {
data(){
return {
dialogFormVisible: false,//是否显示添加用药情况dialog
domain: '',//通过接口获取白名单域名
needRule: true, //是否动态开启验证
showModule: true, //是否隐藏表单模块
canRender: true,
valid: false,
validList: [],
moduleList: [],//模块列表
planPatientsTimesId: '',
scaleNo: '',
doctorId: '',
planTimesId: '',
addComponents: [],
addComponentsSourceList: [],
formData: {},//整个表单对象
medication: [],// 用药情况
type3Obj: {}
}
},
components: {
FormScale,
ChoseMedication,
},
props: {
scaleType: String,//病种类型
checkStart: Boolean,
saveWay: Number,
showBtn: String,
},
watch: {
checkStart(val){
if(val){
this.validList = [];
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
// 将每个模块的fornName对应后台的表名放到表单对象
this.formData[formName] = this.addComponents[i].formObject;
this.$nextTick(()=>{
// saveWay=1是提交,进行校验,2是暂存,不需要校验,直接发送请求
if(this.saveWay==1){
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].validate((valid) => {
this.validList.push(valid);
});
}
}
})
}
this.$nextTick(()=>{
// saveWay=1是提交,进行校验,2是暂存,不需要校验,直接发送请求
if(this.saveWay==1){
for(let k=0;k<this.validList.length;k++){
if(!this.validList[k]){
this.$emit('checkEnd',false);
this.valid = false;
this.$nextTick(() => {
// 如果表单未完善,跳转到该表单模块
document.querySelector(`#form${k}`).scrollIntoView(true);
})
return;
}else{
this.valid = true;
}
}
if(this.valid){
this.dataSubmit(()=>{
updateScalesStatus({
fuPlanPatientTimesId: this.planPatientsTimesId,
planTimesId: this.planTimesId,
resourceId: this.scaleNo
})
});
}
}else{
this.dataSubmit();
}
this.$emit('checkEnd',false);
})
}else{
this.$emit('checkEnd',false);
}
},
showModule(val){
this.addComponents.forEach((item,index)=>{
if(index >= 3){
this.addComponents[index].showModule = val;
}
})
},
},
created(){
this.planPatientsTimesId = this.$route.query.planPatientsTimesId
this.scaleNo = this.$route.query.scaleNo
this.doctorId = this.$route.query.doctorId
this.planTimesId = this.$route.query.planTimesId;
// 获取量表类型
this.initScaleType();
// 获取白名单域名
this.getWhiteDomain();
},
methods: {
// 获取量表类型
initScaleType(){
this.addComponentsSourceList = [
{name: 'hypeDataSourceBaseInfo',formObject: {},showModule: true,formName: 'h_s_001',className: 'obj-form-title',dataSource: hypeDataSourceBaseInfo(this), hideTitle: true, title: '基本信息'},
{name: 'hypeDataSourceSymptom',formObject: {},showModule: true,formName: 'hypertension_001',className: 'obj-form-title',dataSource: hypeDataSourceSymptom(this), hideTitle: false, title: '症状'},
{name: 'hypeDataSourceSign',formObject: {bmi: 0,nextBmi: 0},showModule: true,formName: 'hypertension_002',className: 'obj-form-title',dataSource: hypeDataSourceSign(this), hideTitle: false, title: '体征'},
{name: 'hypeDataSourceLifeMode',formObject: {},showModule: true,formName: 'hypertension_003',className: 'obj-form-title',dataSource: hypeDataSourceLifeMode(this), hideTitle: false, title: '生活方式指导'},
{name: 'hypeDataSourceHelpChecking',formObject: {},showModule: true,formName: 'hypertension_004',className: 'obj-form-title',dataSource: hypeDataSourceHelpChecking(this), hideTitle: false, title: '辅助检查'},
{name: 'hypeDataSourceMedicationUse',formObject: {arrList:this.medication,dosageDay:'',dosageNum:'',medicinesName:'',medicineType:''},showModule: true,formName: 'h_s_002',className: 'obj-form-title',dataSource: hypeDataSourceMedicationUse(this), hideTitle: false, title: '用药情况'},
{name: 'hypeDataSourceReferral',formObject: {reason:'',mechanism:'',department:''},showModule: true,formName: 'h_s_003',className: 'obj-form-title',dataSource: hypeDataSourceReferral(this), hideTitle: false, title: '转诊'},
{name: 'hypeDataSourceNextFollowDay',formObject: {nextFollowDay:''},showModule: true,formName: 'h_s_004',className: 'obj-form-title',dataSource: hypeDataSourceNextFollowDay(this), hideTitle: true, title: '下次随访日期'},
]
},
// 获取白名单域名
getWhiteDomain(){
getDomain().then(res=>{
if(res.code=='000000'){
this.domain = res.data;
// this.setFormData()
// 获取量表模块
this.getFormModules();
}else{
this.$message({
message: res.message,
type: 'error'
});
}
})
},
// 目前先默认写死
setFormData(){
this.addComponents = this.addComponentsSourceList
},
// 获取展示的模块
getFormModules(){
getScaleModels(this.domain,this.scaleNo).then(res=>{
if(res.code=='000000'){
this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){
if(this.moduleList[i]==this.addComponentsSourceList[j].formName){
this.addComponents.push(this.addComponentsSourceList[j])
}
}
}
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{
this.$message({
message: res.message,
type: 'error'
});
}
})
},
// 处理获取用药情况详情数据
handleModuleMedicalUseDetai(obj){
if(obj.medicineType=='1'){
const { dosageDay,dosageNum,medicinesName,medicineType } = obj;
this.medication.push({ dosageDay,dosageNum,medicinesName,medicineType });
}else if(obj.medicineType=='3'){
const { dosageDay,dosageNum,medicinesName,medicineType } = obj;
this.type3Obj = { dosageDay,dosageNum,medicinesName,medicineType }
}
},
// 获取量表详情
getFormDetail(){
getScaleDetail(this.domain,this.planPatientsTimesId,this.scaleNo).then(res=>{
this.formData = res.data
let keysList = Object.keys(this.formData);
if(keysList.length > 0){
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
if(this.formData[formName] && formName=='h_s_002'){
let h_s_002 = this.formData[formName];
let isArr = Array.isArray(h_s_002);
// 判断是否数组,数组是2条以上数据
if(isArr){
h_s_002.forEach((item,index)=>{
this.handleModuleMedicalUseDetai(item);
})
}else{
// 如果是对象,则为一条数据
this.handleModuleMedicalUseDetai(h_s_002);
}
this.addComponents[i].formObject = {
arrList: this.medication,
...this.type3Obj
}
// console.log(this.addComponents[i].formObject)
}else if(this.formData[formName] && formName=='hypertension_001'){
this.addComponents[i].formObject = this.formData[formName];
let symptom = this.formData[formName].symptom;
this.addComponents[i].formObject.symptom = JSON.parse(symptom || '[]');
}else{
// 判断是否有数据,没有就用初始化
if(this.formData[formName]){
this.addComponents[i].formObject = this.formData[formName];
}else{
this.addComponents[i] = this.addComponentsSourceList[i];
}
}
// 量表字段回显,会触发change校验,所以这里拿到数据渲染页面后,重置验证
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].resetFields();
}
}
}
})
},
// 处理提交用药情况数据
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'
})
}
this.medication = [...this.medication,...otherMed];
this.formData.h_s_002 = this.medication;
this.valid = true;
}
}
let flag = this.valid;
this.$emit('checkEnd',false);
return flag;
},
// 提交量表
dataSubmit(callback){
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;
// 检测用药情况数据是否填写
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) ? '提交成功' : '保存成功';
this.$message({
message: doMsg,
type: 'success'
});
if(callback){
callback();
}
setTimeout(()=>{
this.$router.push({
path: '/followup/record-manage/record-list'
})
},1000)
}else{
let doMsg = (this.saveWay==1) ? '提交失败' : '保存失败';
this.$message({
message: doMsg,
type: 'error'
});
}
});
},
closeDialog(val){
this.dialogFormVisible = val;
},
setMedication(val){
this.medication.push({...val,medicineType: '1'});
console.log('medication=>',this.medication)
}
},
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.form-wrap{
.content-box{
.title{
line-height: 60px;
height: 60px;
font-weight: bold;
font-size: 22px;
border-bottom: 1px dashed #ccc;
}
}
}
</style> </style>
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
</template> </template>
<script> <script>
import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus } from '@/utils/followup/followapis' import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale } from '@/utils/followup/followapis'
// 量表 template // 量表 template
import FormScale from '@/components/followup/form/index' import FormScale from '@/components/followup/form/index'
// 量表模块数据模型 // 量表模块数据模型
// 脑卒中
import dataSourceBaseInfo0 from '../models/stroke/dataSourceBaseInfo0' import dataSourceBaseInfo0 from '../models/stroke/dataSourceBaseInfo0'
import dataSourceBaseInfo from '../models/stroke/dataSourceBaseInfo' import dataSourceBaseInfo from '../models/stroke/dataSourceBaseInfo'
import dataSourceBaseInfo2 from '../models/stroke/dataSourceBaseInfo2' import dataSourceBaseInfo2 from '../models/stroke/dataSourceBaseInfo2'
...@@ -48,8 +50,6 @@ ...@@ -48,8 +50,6 @@
import dataSourceCheckBody from '../models/stroke/dataSourceCheckBody' import dataSourceCheckBody from '../models/stroke/dataSourceCheckBody'
import dataSourceCheckLab from '../models/stroke/dataSourceCheckLab' import dataSourceCheckLab from '../models/stroke/dataSourceCheckLab'
import axios from 'axios';
import { submitScale } from '@/utils/followup/followapis';
export default { export default {
data(){ data(){
...@@ -66,23 +66,7 @@ ...@@ -66,23 +66,7 @@
doctorId: '', doctorId: '',
planTimesId: '', planTimesId: '',
addComponents: [], addComponents: [],
addComponentsSourceList: [ addComponentsSourceList: [],
{name: 'BaseInfo0',formObject: {},showModule: true,formName: 'stroke_001',className: 'obj-form-title',dataSource: dataSourceBaseInfo0(this), hideTitle: true, title: '一、量表脑卒中随访人员信息表'},
{name: 'BaseInfo',formObject: {},showModule: true,formName: 'stroke_002',className: 'obj-form-title',dataSource: dataSourceBaseInfo(this), title: '一、基本信息'},
{name: 'BaseInfo2',formObject: {},showModule: true,formName: 'stroke_003',className: 'obj-form-title',dataSource: dataSourceBaseInfo2(this), hideTitle: true, title: '一、基本信息'},
{name: 'LifeStyleGuide',formObject: {},showModule: true,formName: 'stroke_004',className: 'obj-form-title',dataSource: dataSourceLifeStyleGuide(this), title: '二、随访期间生活方式'},
{name: 'MainSickControl',formObject: {},showModule: true,formName: 'stroke_005',className: 'obj-form-title',dataSource: dataSourceMainSickControl(this), title: '三、随访期间主要病史及控制情况-脑血管病'},
{name: 'MainSickControl2',formObject: {},showModule: true,formName: 'stroke_006',className: 'obj-form-title',dataSource: dataSourceMainSickControl2(this), hideTitle: true,ruleNew:true, title: '三、随访期间主要病史及控制情况-MRS评分(卒中患者12个月随访必填)'},
{name: 'MainSickControl3',formObject: {},showModule: true,formName: 'stroke_007',className: 'obj-form-title',dataSource: dataSourceMainSickControl3(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-心脏病'},
{name: 'MainSickControl4',formObject: {},showModule: true,formName: 'stroke_008',className: 'obj-form-title',dataSource: dataSourceMainSickControl4(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-高血压'},
{name: 'MainSickControl5',formObject: {},showModule: true,formName: 'stroke_009',className: 'obj-form-title',dataSource: dataSourceMainSickControl5(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-血脂异常'},
{name: 'MainSickControl6',formObject: {},showModule: true,formName: 'stroke_010',className: 'obj-form-title',dataSource: dataSourceMainSickControl6(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-糖尿病'},
{name: 'TreatmentSituation',formObject: {},showModule: true,formName: 'stroke_011',className: 'obj-form-title',dataSource: dataSourceTreatmentSituation(this), title: '四、本次随访期间血管病变的外科手术或介入治疗情况'},
{name: 'TreatmentSituation2',formObject: {},showModule: true,formName: 'stroke_012',className: 'obj-form-title',dataSource: dataSourceTreatmentSituation2(this), hideTitle: true, title: '四、本次随访期间血管病变的外科手术或介入治疗情况-冠状动脉'},
{name: 'TreatmentSituation3',formObject: {},showModule: true,formName: 'stroke_013',className: 'obj-form-title',dataSource: dataSourceTreatmentSituation3(this), hideTitle: true, title: '四、本次随访期间血管病变的外科手术或介入治疗情况-出血性卒中外科治疗'},
{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个月随访必填)'},
],
formData: {},//整个表单对象 formData: {},//整个表单对象
} }
}, },
...@@ -90,6 +74,7 @@ ...@@ -90,6 +74,7 @@
FormScale, FormScale,
}, },
props: { props: {
scaleType: String,//病种类型
checkStart: Boolean, checkStart: Boolean,
saveWay: Number, saveWay: Number,
showBtn: String, showBtn: String,
...@@ -143,11 +128,12 @@ ...@@ -143,11 +128,12 @@
}) })
}); });
} }
this.$emit('checkEnd',false);
}else{ }else{
this.dataSubmit(); this.dataSubmit();
} }
this.$emit('checkEnd',false);
}) })
...@@ -176,23 +162,47 @@ ...@@ -176,23 +162,47 @@
} }
}, },
created(){ created(){
this.planPatientsTimesId = this.$route.query.planPatientsTimesId this.planPatientsTimesId = this.$route.query.planPatientsTimesId
this.scaleNo = this.$route.query.scaleNo this.scaleNo = this.$route.query.scaleNo
this.doctorId = this.$route.query.doctorId this.doctorId = this.$route.query.doctorId
this.planTimesId = this.$route.query.planTimesId; this.planTimesId = this.$route.query.planTimesId;
// 获取量表类型
this.initScaleType();
// 获取白名单域名
this.getWhiteDomain(); this.getWhiteDomain();
localStorage.setItem('needRule',this.needRule); sessionStorage.setItem('needRule',this.needRule);
}, },
methods: { methods: {
// 获取量表类型
initScaleType(){
this.addComponentsSourceList = [
{name: 'BaseInfo0',formObject: {},showModule: true,formName: 'stroke_001',className: 'obj-form-title',dataSource: dataSourceBaseInfo0(this), hideTitle: true, title: '一、量表脑卒中随访人员信息表'},
{name: 'BaseInfo',formObject: {},showModule: true,formName: 'stroke_002',className: 'obj-form-title',dataSource: dataSourceBaseInfo(this), title: '一、基本信息'},
{name: 'BaseInfo2',formObject: {},showModule: true,formName: 'stroke_003',className: 'obj-form-title',dataSource: dataSourceBaseInfo2(this), hideTitle: true, title: '一、基本信息'},
{name: 'LifeStyleGuide',formObject: {},showModule: true,formName: 'stroke_004',className: 'obj-form-title',dataSource: dataSourceLifeStyleGuide(this), title: '二、随访期间生活方式'},
{name: 'MainSickControl',formObject: {},showModule: true,formName: 'stroke_005',className: 'obj-form-title',dataSource: dataSourceMainSickControl(this), title: '三、随访期间主要病史及控制情况-脑血管病'},
{name: 'MainSickControl2',formObject: {},showModule: true,formName: 'stroke_006',className: 'obj-form-title',dataSource: dataSourceMainSickControl2(this), hideTitle: true,ruleNew:true, title: '三、随访期间主要病史及控制情况-MRS评分(卒中患者12个月随访必填)'},
{name: 'MainSickControl3',formObject: {},showModule: true,formName: 'stroke_007',className: 'obj-form-title',dataSource: dataSourceMainSickControl3(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-心脏病'},
{name: 'MainSickControl4',formObject: {},showModule: true,formName: 'stroke_008',className: 'obj-form-title',dataSource: dataSourceMainSickControl4(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-高血压'},
{name: 'MainSickControl5',formObject: {},showModule: true,formName: 'stroke_009',className: 'obj-form-title',dataSource: dataSourceMainSickControl5(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-血脂异常'},
{name: 'MainSickControl6',formObject: {},showModule: true,formName: 'stroke_010',className: 'obj-form-title',dataSource: dataSourceMainSickControl6(this), hideTitle: true, title: '三、随访期间主要病史及控制情况-糖尿病'},
{name: 'TreatmentSituation',formObject: {},showModule: true,formName: 'stroke_011',className: 'obj-form-title',dataSource: dataSourceTreatmentSituation(this), title: '四、本次随访期间血管病变的外科手术或介入治疗情况'},
{name: 'TreatmentSituation2',formObject: {},showModule: true,formName: 'stroke_012',className: 'obj-form-title',dataSource: dataSourceTreatmentSituation2(this), hideTitle: true, title: '四、本次随访期间血管病变的外科手术或介入治疗情况-冠状动脉'},
{name: 'TreatmentSituation3',formObject: {},showModule: true,formName: 'stroke_013',className: 'obj-form-title',dataSource: dataSourceTreatmentSituation3(this), hideTitle: true, title: '四、本次随访期间血管病变的外科手术或介入治疗情况-出血性卒中外科治疗'},
{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(){ getWhiteDomain(){
getDomain().then(res=>{ getDomain().then(res=>{
if(res.code=='000000'){ if(res.code=='000000'){
this.domain = res.data this.domain = res.data;
// 获取量表模块
this.getFormModules(); this.getFormModules();
if(this.showBtn!='0'){ if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail(); this.getFormDetail();
} }
}else{ }else{
...@@ -312,10 +322,9 @@ ...@@ -312,10 +322,9 @@
line-height: 60px; line-height: 60px;
height: 60px; height: 60px;
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 22px;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
} }
} }
} }
</style> </style>
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
} }
}else if(this.formList.scalesList.length === 1){ }else if(this.formList.scalesList.length === 1){
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.formList.doctorId, scaleNo: this.formList.scalesList[0].resourceId, planPatientsTimesId: row.fuPlanPatientTimesId,planTimesId : row.fuPlanTimesId, showBtn: 1}}) query: {doctorId: this.formList.doctorId, scaleNo: this.formList.scalesList[0].resourceId, planPatientsTimesId: row.fuPlanPatientTimesId,planTimesId : row.planTimesId, showBtn: 1}})
}else { }else {
this.$message.warning('暂无量表!') this.$message.warning('暂无量表!')
} }
...@@ -263,9 +263,9 @@ ...@@ -263,9 +263,9 @@
// this.statusForm = getArguments[1]; // this.statusForm = getArguments[1];
}, },
goFormView(item) { goFormView(item) {
this.selectFormShow = false this.selectFormShow = false;
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.ScaleData.doctorId, scaleNo: item.resourceId, planPatientsTimesId: this.ScaleData.planPatientsTimesId, showBtn: 1}}); query: {doctorId: this.ScaleData.doctorId, scaleNo: item.resourceId, planPatientsTimesId: this.ScaleData.planPatientsTimesId,planTimesId : item.planTimesId, showBtn: 1}});
}, },
closeForm() { closeForm() {
this.selectFormShow = false; this.selectFormShow = false;
......
...@@ -206,7 +206,7 @@ export default { ...@@ -206,7 +206,7 @@ export default {
goFormView(item) { goFormView(item) {
this.selectFormShow = false this.selectFormShow = false
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.ScaleData.doctorId, scaleNo: item.resourceId, planPatientsTimesId: this.ScaleData.planPatientsTimesId, showBtn: 1}}); query: {doctorId: this.ScaleData.doctorId, scaleNo: item.resourceId, planPatientsTimesId: this.ScaleData.planPatientsTimesId,planTimesId : item.planTimesId, showBtn: 1}});
}, },
closeForm() { closeForm() {
this.selectFormShow = false; this.selectFormShow = false;
...@@ -222,7 +222,7 @@ export default { ...@@ -222,7 +222,7 @@ export default {
} }
}else if(this.formList.scalesList.length === 1){ }else if(this.formList.scalesList.length === 1){
this.$router.push({path: '/followup/record-manage/form-template', this.$router.push({path: '/followup/record-manage/form-template',
query: {doctorId: this.formList.doctorId, scaleNo: this.formList.scalesList[0].resourceId, planPatientsTimesId: row.planPatientTimesId, showBtn: 1}}) query: {doctorId: this.formList.doctorId, scaleNo: this.formList.scalesList[0].resourceId, planPatientsTimesId: row.planPatientTimesId,planTimesId : row.planTimesId, showBtn: 1}})
}else { }else {
this.$message.warning('暂无量表!') this.$message.warning('暂无量表!')
} }
......
...@@ -27,6 +27,10 @@ import { isNotEmptyUtils } from '../../utils/utils' ...@@ -27,6 +27,10 @@ import { isNotEmptyUtils } from '../../utils/utils'
let vm = null let vm = null
export default { export default {
props: { props: {
storageIdType: {
type: Number,
default: 0
},
tokenValue: { tokenValue: {
type: String type: String
}, },
...@@ -70,27 +74,6 @@ export default { ...@@ -70,27 +74,6 @@ export default {
index: 'role' index: 'role'
} }
] ]
}, {
title: '随访管理',
icon: 'el-icon-edit-outline',
index: 'followup',
subs: [
{
title: '计划管理',
icon: 'el-icon-setting',
index: 'followup/plan-manage/plan-list'
},
{
title: '预约管理',
icon: 'el-icon-setting',
index: 'followup/reservation-manage/reservation-list'
},
{
title: '录入管理',
icon: 'el-icon-setting',
index: 'followup/record-manage/record-list'
}
]
} }
] ]
} }
...@@ -101,7 +84,12 @@ export default { ...@@ -101,7 +84,12 @@ export default {
} }
}, },
created() { created() {
vm = this vm = this;
},
mounted(){
if(vm.storageIdType==2){
vm.setFollowSide()
}
}, },
watch: { watch: {
authList(newVal, oldVal){ authList(newVal, oldVal){
...@@ -114,10 +102,39 @@ export default { ...@@ -114,10 +102,39 @@ export default {
if(!newVal.P003) { // 角色管理 if(!newVal.P003) { // 角色管理
vm.items[2].subs[0].index = 'blank' vm.items[2].subs[0].index = 'blank'
} }
},
storageIdType(val,ov){
if(val==2){
vm.setFollowSide()
}
} }
}, },
methods: { methods: {
setFollowSide(){
const followSider = {
title: '随访管理',
icon: 'el-icon-edit-outline',
index: 'followup',
subs: [
{
title: '计划管理',
icon: 'el-icon-setting',
index: 'followup/plan-manage/plan-list'
},
{
title: '预约管理',
icon: 'el-icon-setting',
index: 'followup/reservation-manage/reservation-list'
},
{
title: '录入管理',
icon: 'el-icon-setting',
index: 'followup/record-manage/record-list'
}
]
}
vm.items.push(followSider);
}
} }
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册