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

bug修改,量表

上级 3a9afebc
<template>
<div>
<!-- input -->
<el-input
v-if="item.formType === 'input'"
v-model="form[item.model]"
:type="item.type"
:class="item.className"
:disabled="item.disabled"
:maxlength="item.maxlength"
:minlength="item.minlength"
:placeholder="item.placeholder"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)">
<template
v-for="slot in item.slots || []"
:slot="slot.type">{{ slot.name }}</template>
</el-input>
<!-- radios -->
<el-radio-group
v-else-if="item.formType === 'radio'"
v-model="form[item.model]"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-radio
v-for="(opt, rad) in item.options"
:key="rad"
:label="opt.value">
{{ opt.label }}
</el-radio>
</el-radio-group>
</div>
</template>
<script>
export default {
props: {
dataSource: Object,
},
created(){
this.item = this.dataSource
},
data() {
return {
item: {},
form: {
symptomList: [],//checkbox 症状
inputVal: '',
radioVal: ''
},
}
},
methods: {
defaultFun() {},
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="form-box">
<el-row>
<el-col
v-for="(item, index) in dataSource"
:span="item.spanNum ? item.spanNum : spanNum"
:class="item.className"
:offset="item.offset"
:key="index" >
<el-form-item
v-if="isParent(item)"
:prop="item.prop"
:label="item.label"
:rules="item.rules"
:label-width="item.labelWidth"
:required="item.required"
:class="item.className"
:error="item.error">
<!-- div文本 -->
<div v-if="item.formType === 'div'" :class="item.className">{{ item.name }}</div>
<!-- input -->
<el-input
v-else-if="item.formType === 'input'"
v-model="form[item.model]"
:type="item.type"
:class="item.className"
:disabled="item.disabled"
:maxlength="item.maxlength"
:minlength="item.minlength"
:placeholder="item.placeholder"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)">
<template
v-for="slot in item.slots || []"
:slot="slot.type">{{ slot.name }}</template>
</el-input>
<!-- label -->
<label
v-else-if="item.formType === 'label'"
:class="item.className"
:disabled="item.disabled">{{ form[item.model]==''?'-':form[item.model] }}{{ item.suffix }}
</label>
<!-- select -->
<el-select
v-else-if="item.formType === 'select'"
v-model="form[item.model]"
:multiple="item.multiple"
:placeholder="item.placeholder"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)">
<el-option
v-for="(opt, index2) in item.options"
:key="index2"
:label="opt.label"
:value="opt.value"/>
</el-select>
<!-- checkbox -->
<el-checkbox-group
v-else-if="item.formType === 'checkbox'"
v-model="form[item.model]"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-checkbox
v-for="(opt, ck) in item.options"
:key="ck"
:label="opt.value"
>
{{ opt.label }}
</el-checkbox>
</el-checkbox-group>
<!-- radios -->
<el-radio-group
v-else-if="item.formType === 'radio'"
v-model="form[item.model]"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-radio
v-for="(opt, rad) in item.options"
:key="rad"
:label="opt.value">
{{ opt.label }}
</el-radio>
</el-radio-group>
<!-- switch-->
<el-switch
v-else-if="item.formType === 'switch'"
v-model="form[item.model]"/>
<!-- transfer-->
<el-transfer
v-else-if="item.formType === 'transfer'"
v-model="form[item.model]"
:data="item.data"/>
<!-- 时间 -->
<el-date-picker
v-else-if="item.formType === 'date-picker'"
v-model="form[item.model]"
:disabled="item.disabled"
:type="item.type || dateType"
:placeholder="item.placeholder"
:format="item.format || format"
:value-format="item.valueFormat || valueFormat"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"/>
<!-- 图片 -->
<img v-else-if="item.formType === 'img'" :src="item.src||''" :alt="item.alt||''" :width="item.width">
</el-form-item>
</el-col>
</el-row>
</div>
</template>
<script>
import _ from 'lodash'
export default {
props: {
dataSource: {
type: Array,
default: () => []
},
form: {
type: Object,
default: () => {}
}
},
data() {
return {
spanNum: 12,
valueFormat: 'timestamp',
format: 'yyyy-MM-dd HH:mm',
dateType: 'datetime'
}
},
methods: {
defaultFun() {},
isParent(item) {
if (!item.linkageRule) {
return true
} else {
let num = 0
item.linkageRule.forEach(t => {
if (this.form[t.name] == null) {
return false
}
if (typeof this.form[t.name] === 'string') {
if (t.value.includes(this.form[t.name])) {
num += 1
}
} else {
const nameVal = this.form[t.name]
const valType = _.isArray(nameVal) ? nameVal : Array.of(nameVal)
const bool = _.intersection(valType, t.value)
if (_.isArray(bool) && bool.length > 0) {
num += 1
}
}
})
if (num !== item.linkageRule.length) {
delete this.form[item.model]
}
return num === item.linkageRule.length
}
}
}
}
</script>
<style lang="scss">
.form-box {
padding: 20px 40px;
}
.h72 {
height: 92px;
}
.clear {
clear: left;
}
.m-title {
.el-form-item__label {
font-size: 16px;
color: rgba(74, 74, 74, 1);
}
}
</style>
<template>
<div>
<!-- input -->
<el-input
v-if="item.formType === 'input'"
v-model="form[item.model]"
:type="item.type"
:class="item.className"
:disabled="item.disabled"
:maxlength="item.maxlength"
:minlength="item.minlength"
:placeholder="item.placeholder"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)">
<template
v-for="slot in item.slots || []"
:slot="slot.type">{{ slot.name }}</template>
</el-input>
<!-- radios -->
<el-radio-group
v-else-if="item.formType === 'radio'"
v-model="form[item.model]"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-radio
v-for="(opt, rad) in item.options"
:key="rad"
:label="opt.value">
{{ opt.label }}
</el-radio>
</el-radio-group>
</div>
</template>
<script>
export default {
props: {
dataSource: Object,
},
created(){
this.item = this.dataSource
},
data() {
return {
item: {},
form: {
symptomList: [],//checkbox 症状
inputVal: '',
radioVal: ''
},
}
},
methods: {
defaultFun() {},
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div>
<!-- input -->
<el-input
v-if="item.formType === 'input'"
v-model="form[item.model]"
:type="item.type"
:class="item.className"
:disabled="item.disabled"
:maxlength="item.maxlength"
:minlength="item.minlength"
:placeholder="item.placeholder"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)">
<template
v-for="slot in item.slots || []"
:slot="slot.type">{{ slot.name }}</template>
</el-input>
<!-- radios -->
<el-radio-group
v-else-if="item.formType === 'radio'"
v-model="form[item.model]"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-radio
v-for="(opt, rad) in item.options"
:key="rad"
:label="opt.value">
{{ opt.label }}
</el-radio>
</el-radio-group>
</div>
</template>
<script>
export default {
props: {
dataSource: Object,
},
created(){
this.item = this.dataSource
},
data() {
return {
item: {},
form: {
symptomList: [],//checkbox 症状
inputVal: '',
radioVal: ''
},
}
},
methods: {
defaultFun() {},
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div>
<!-- checkbox -->
<el-checkbox-group
v-if="item.formType=='checkbox'"
v-model="form[item.model]"
@change="changeFun(item,form[item.model])"
>
<el-checkbox
v-for="(opt, ck) in item.options"
:key="ck"
:label="opt.value"
:disabled="opt.disabled"
>
{{ opt.label }}
</el-checkbox>
</el-checkbox-group>
<!-- input -->
<el-input
v-else-if="item.formType === 'input'"
v-model="form[item.model]"
:type="item.type"
:class="item.className"
:disabled="item.disabled"
:maxlength="item.maxlength"
:minlength="item.minlength"
:placeholder="item.placeholder"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)">
<template
v-for="slot in item.slots || []"
:slot="slot.type">{{ slot.name }}</template>
</el-input>
</div>
</template>
<script>
export default {
props: {
dataSource: Object,
},
created(){
this.item = this.dataSource
},
data() {
return {
item: {},
form: {
symptomList: [],//checkbox 症状
inputVal: ''
},
}
},
methods: {
// 改变checkbox的时候判断
changeFun(obj,val){
const len = val.length
const options = obj.options
if(len>0){
val.forEach((item)=>{
if(item=='1'){
options.forEach((item)=>{
if(item.value!='1'){
item.disabled = true
}else{
item.disabled = false
}
})
}else{
options.forEach((item)=>{
item.disabled = false
})
}
})
}else{
options.forEach((item)=>{
item.disabled = false
})
}
},
defaultFun() {},
}
}
</script>
<style scoped lang="scss">
</style>
<template> <!--<template>-->
<div> <!--<div>-->
<!--<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">--> <!--&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> <!--<el-form-item label="本次随访时间" required>-->
<div style="display: flex;"> <!--<div style="display: flex;">-->
<el-form-item prop="timeNo"> <!--<el-form-item prop="timeNo">-->
<el-input <!--<el-input-->
v-model="timeForm.timeNo" <!--v-model="timeForm.timeNo"-->
type="tel" <!--type="tel"-->
size="small" <!--size="small"-->
placeholder="请输入" <!--placeholder="请输入"-->
:disabled="isStandedTemplate" <!--:disabled="isStandedTemplate"-->
maxlength="2" <!--maxlength="2"-->
clearable /> <!--clearable />-->
</el-form-item> <!--</el-form-item>-->
<el-form-item prop="timeUnit" class="ml20"> <!--<el-form-item prop="timeUnit" class="ml20">-->
<el-select v-if="!isStandedTemplate && !planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="timeForm.isDisabled"> <!--<el-select v-if="!isStandedTemplate && !planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="timeForm.isDisabled">-->
<el-option <!--<el-option-->
v-for="(item,index) in markOptions" <!--v-for="(item,index) in markOptions"-->
:key="index" <!--:key="index"-->
:label="item.value" <!--:label="item.value"-->
:value="item.no"> <!--:value="item.no">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
<el-select v-if="isStandedTemplate || planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="isStandedTemplate"> <!--<el-select v-if="isStandedTemplate || planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="isStandedTemplate">-->
<el-option <!--<el-option-->
v-for="(item,index) in markOptions" <!--v-for="(item,index) in markOptions"-->
:key="index" <!--:key="index"-->
:label="item.value" <!--:label="item.value"-->
:value="item.no"> <!--:value="item.no">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
</el-form-item> <!--</el-form-item>-->
</div> <!--</div>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="随访方式" prop="type"> <!--<el-form-item label="随访方式" prop="type">-->
<el-radio-group v-model="timeForm.type" size="small"> <!--<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 v-for="(item,index) in followTypeList" :key="index" :label="item.no" :disabled="isStandedTemplate">{{item.value}}</el-radio>-->
</el-radio-group> <!--</el-radio-group>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="提醒医生预约居民"> <!--<el-form-item label="提醒医生预约居民">-->
<el-select <!--<el-select-->
v-if="!isStandedTemplate" <!--v-if="!isStandedTemplate"-->
v-model="timeForm.remindDay" <!--v-model="timeForm.remindDay"-->
multiple <!--multiple-->
:multiple-limit=3 <!--:multiple-limit=3-->
@change="changeRemindDay" <!--@change="changeRemindDay"-->
placeholder="请选择"> <!--placeholder="请选择">-->
<el-option <!--<el-option-->
v-for="(item,index) in remindOptions" <!--v-for="(item,index) in remindOptions"-->
:key="index" <!--:key="index"-->
:label="item.value" <!--:label="item.value"-->
:value="item.no"> <!--:value="item.no">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
<!--固定模板需要填充--> <!--&lt;!&ndash;固定模板需要填充&ndash;&gt;-->
<el-select <!--<el-select-->
v-if="isStandedTemplate" <!--v-if="isStandedTemplate"-->
v-model="timeForm.remindDay" <!--v-model="timeForm.remindDay"-->
multiple <!--multiple-->
:multiple-limit=3 <!--:multiple-limit=3-->
:disabled="isStandedTemplate" <!--:disabled="isStandedTemplate"-->
placeholder="请选择"> <!--placeholder="请选择">-->
<el-option <!--<el-option-->
v-for="(item,index) in remindOptionsCopy" <!--v-for="(item,index) in remindOptionsCopy"-->
:key="index" <!--:key="index"-->
:label="item.startDaysStr" <!--:label="item.startDaysStr"-->
:value="item.startDays"> <!--:value="item.startDays">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
</el-form-item> <!--</el-form-item>-->
<el-form-item label="推送患教"> <!--<el-form-item label="推送患教">-->
<div style="display: flex"> <!--<div style="display: flex">-->
<el-select <!--<el-select-->
v-if="!isStandedTemplate" <!--v-if="!isStandedTemplate"-->
v-model="timeForm.pushDay" <!--v-model="timeForm.pushDay"-->
placeholder="选择推送时间" <!--placeholder="选择推送时间"-->
clearable <!--clearable-->
> <!--&gt;-->
<el-option <!--<el-option-->
v-for="(item,index) in pushTimeOptions" <!--v-for="(item,index) in pushTimeOptions"-->
:key="index" <!--:key="index"-->
:label="item.value" <!--:label="item.value"-->
:value="item.no"> <!--:value="item.no">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
<!--固定模板需要填充--> <!--&lt;!&ndash;固定模板需要填充&ndash;&gt;-->
<el-select <!--<el-select-->
v-if="isStandedTemplate" <!--v-if="isStandedTemplate"-->
v-model="timeForm.pushDay" <!--v-model="timeForm.pushDay"-->
placeholder="选择推送时间" <!--placeholder="选择推送时间"-->
clearable <!--clearable-->
:disabled="isStandedTemplate" <!--:disabled="isStandedTemplate"-->
> <!--&gt;-->
<el-option <!--<el-option-->
:label="timeForm.startDaysStr" <!--:label="timeForm.startDaysStr"-->
:value="timeForm.pushDay"> <!--:value="timeForm.pushDay">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
<el-button plain class="ml20" @click="goSelectCartoon" v-if="!timeForm.hasSelected && !isStandedTemplate && !planId">选择健康漫画</el-button> <!--<el-button plain class="ml20" @click="goSelectCartoon" v-if="!timeForm.hasSelected && !isStandedTemplate && !planId">选择健康漫画</el-button>-->
<div class="selected-div ml20" v-if="timeForm.hasSelected"> <!--<div class="selected-div ml20" v-if="timeForm.hasSelected">-->
<span>{{timeForm.comentMsg.header_name}}</span> <!--<span>《{{timeForm.comentMsg.header_name}}》</span>-->
<el-button type="text" @click="goSelectCartoon" v-if="!isStandedTemplate && !planId">重选</el-button> <!--<el-button type="text" @click="goSelectCartoon" v-if="!isStandedTemplate && !planId">重选</el-button>-->
<el-button type="text" @click="deleteClick" v-if="!isStandedTemplate && !planId">删除</el-button> <!--<el-button type="text" @click="deleteClick" v-if="!isStandedTemplate && !planId">删除</el-button>-->
</div> <!--</div>-->
</div> <!--</div>-->
</el-form-item> <!--</el-form-item>-->
<div class="tips-contnt" v-if="timeForm.hasSelected"> <!--<div class="tips-contnt" v-if="timeForm.hasSelected">-->
<p class="yellow-font">当前计划中共{{timeForm.totalNumber}}位居民(微信:{{timeForm.wechatPatientNum}}位,短信:{{timeForm.messagePatientNum}}位),本次定时推送任务在发送当日预计需要{{timeForm.messagePatientNum}}条短信额度(微信推送不消耗额度,建议您让居民关注云鹊健康微信公众号),务必提前确保短信额度的充足。</p> <!--<p class="yellow-font">当前计划中共{{timeForm.totalNumber}}位居民(微信:{{timeForm.wechatPatientNum}}位,短信:{{timeForm.messagePatientNum}}位),本次定时推送任务在发送当日预计需要{{timeForm.messagePatientNum}}条短信额度(微信推送不消耗额度,建议您让居民关注云鹊健康微信公众号),务必提前确保短信额度的充足。</p>-->
<p>需要更多额度,请前往「云鹊医App-个人中心-啾啾币中心」兑换短信额度后再进行预约,您也可以联系云鹊医客服购买短信额度,客服电话:400-920-8877</p> <!--<p>需要更多额度,请前往「云鹊医App-个人中心-啾啾币中心」兑换短信额度后再进行预约,您也可以联系云鹊医客服购买短信额度,客服电话:400-920-8877</p>-->
</div> <!--</div>-->
<el-form-item label="随访登记表"> <!--<el-form-item label="随访登记表">-->
<el-select <!--<el-select-->
v-if="!isStandedTemplate" <!--v-if="!isStandedTemplate"-->
v-model="timeForm.followResourceId" <!--v-model="timeForm.followResourceId"-->
multiple <!--multiple-->
:multiple-limit=3 <!--:multiple-limit=3-->
@change="changeFollowId" <!--@change="changeFollowId"-->
placeholder="请选择"> <!--placeholder="请选择">-->
<el-option <!--<el-option-->
v-for="(item,index) in formOptions" <!--v-for="(item,index) in formOptions"-->
:key="index" <!--:key="index"-->
:label="item.name" <!--:label="item.name"-->
:value="item.scaleNo"> <!--:value="item.scaleNo">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
<!--固定模板需要填充--> <!--&lt;!&ndash;固定模板需要填充&ndash;&gt;-->
<el-select <!--<el-select-->
v-if="isStandedTemplate" <!--v-if="isStandedTemplate"-->
v-model="timeForm.followResourceId" <!--v-model="timeForm.followResourceId"-->
multiple <!--multiple-->
:multiple-limit=3 <!--:multiple-limit=3-->
@change="changeFollowId" <!--@change="changeFollowId"-->
:disabled="isStandedTemplate" <!--:disabled="isStandedTemplate"-->
placeholder="请选择"> <!--placeholder="请选择">-->
<el-option <!--<el-option-->
v-for="(item,index) in formOptionsCopy" <!--v-for="(item,index) in formOptionsCopy"-->
:key="index" <!--:key="index"-->
:label="item.sendContent" <!--:label="item.sendContent"-->
:value="item.resourceId"> <!--:value="item.resourceId">-->
</el-option> <!--</el-option>-->
</el-select> <!--</el-select>-->
</el-form-item> <!--</el-form-item>-->
<!--</el-form>--> <!--&lt;!&ndash;</el-form>&ndash;&gt;-->
<select-cartoon <!--<select-cartoon-->
:isSelectCartoon="isSelectCartoon" <!--:isSelectCartoon="isSelectCartoon"-->
@closeSelectCartoon="closeSelectCartoon" <!--@closeSelectCartoon="closeSelectCartoon"-->
@pushConmentMsg="pushConmentMsg" <!--@pushConmentMsg="pushConmentMsg"-->
/> <!--/>-->
</div> <!--</div>-->
</template> <!--</template>-->
<script> <!--<script>-->
import _ from 'lodash'; <!--import _ from 'lodash';-->
import SelectCartoon from '@/views/followup/plan-manage/dialog/select-cartoon'; <!--import SelectCartoon from '@/views/followup/plan-manage/dialog/select-cartoon';-->
import { getPatientNumber } from '@/utils/followup/followapis' <!--import { getPatientNumber } from '@/utils/followup/followapis'-->
export default { <!--export default {-->
components: { <!--components: {-->
SelectCartoon <!--SelectCartoon-->
}, <!--},-->
data() { <!--data() {-->
const checkDay = (rule, value, callback)=>{ <!--const checkDay = (rule, value, callback)=>{-->
const num = parseFloat(value) <!--const num = parseFloat(value)-->
if(num < 1 || num>99){ <!--if(num < 1 || num>99){-->
return callback(new Error('日期不能大于99天或小于0天')); <!--return callback(new Error('日期不能大于99天或小于0天'));-->
} <!--}-->
callback(); <!--callback();-->
} <!--}-->
return { <!--return {-->
formNoList: [],//存放量表 scaleNo 的数组,用于匹配所选项 <!--formNoList: [],//存放量表 scaleNo 的数组,用于匹配所选项-->
remindOptionsCopy: [],//提升医生预约居民 - 标准模板 <!--remindOptionsCopy: [],//提升医生预约居民 - 标准模板-->
formOptionsCopy: [], //量表 - 标准模板 <!--formOptionsCopy: [], //量表 - 标准模板-->
isSelectCartoon: false, <!--isSelectCartoon: false,-->
timeFormRules: { <!--timeFormRules: {-->
timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' },{ validator: checkDay, trigger: 'blur' }], <!--timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' },{ validator: checkDay, trigger: 'blur' }],-->
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }], <!--timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],-->
type: [{ required: true, message: '请选择随访方式', trigger: 'change' }], <!--type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],-->
}, <!--},-->
} <!--}-->
}, <!--},-->
props: { <!--props: {-->
timeForm: Object, <!--timeForm: Object,-->
valBegin: Boolean, // 设置新时间节点的校验开关 <!--valBegin: Boolean, // 设置新时间节点的校验开关-->
saveValiedBegin: Boolean, // 点击保存提交整个表单的校验开关 <!--saveValiedBegin: Boolean, // 点击保存提交整个表单的校验开关-->
markOptions:Array, <!--markOptions:Array,-->
followTypeList:Array, <!--followTypeList:Array,-->
remindOptions:Array, <!--remindOptions:Array,-->
pushTimeOptions:Array, <!--pushTimeOptions:Array,-->
formOptions: Array, <!--formOptions: Array,-->
patientIdList: Array, <!--patientIdList: Array,-->
isStandedTemplate: Boolean, <!--isStandedTemplate: Boolean,-->
planId: String <!--planId: String-->
}, <!--},-->
watch: { <!--watch: {-->
patientIdList(val){ <!--patientIdList(val){-->
}, <!--},-->
timeForm(val){ <!--timeForm(val){-->
this.timeForm = val <!--this.timeForm = val-->
if(this.isStandedTemplate || this.planId){ <!--if(this.isStandedTemplate || this.planId){-->
// console.log('表单子组件监听到的form数据',this.timeForm) <!--// console.log('表单子组件监听到的form数据',this.timeForm)-->
this.timeForm.isDisabled = true <!--this.timeForm.isDisabled = true-->
console.log(this.timeForm.remindList) <!--console.log(this.timeForm.remindList)-->
if(this.timeForm.remindList && this.timeForm.remindList.length > 0){// remindDay <!--if(this.timeForm.remindList && this.timeForm.remindList.length > 0){// remindDay-->
this.remindOptionsCopy = this.timeForm.remindList <!--this.remindOptionsCopy = this.timeForm.remindList-->
this.timeForm.remindDay = [] <!--this.timeForm.remindDay = []-->
this.timeForm.remindList.forEach((item)=>{ <!--this.timeForm.remindList.forEach((item)=>{-->
this.timeForm.remindDay.push(item.startDays) <!--this.timeForm.remindDay.push(item.startDays)-->
}) <!--})-->
} <!--}-->
if(this.timeForm.pushContentList && this.timeForm.pushContentList.length > 0){//pushDay <!--if(this.timeForm.pushContentList && this.timeForm.pushContentList.length > 0){//pushDay-->
let pushData = this.timeForm.pushContentList[0] <!--let pushData = this.timeForm.pushContentList[0]-->
this.timeForm.pushDay = pushData.startDays <!--this.timeForm.pushDay = pushData.startDays-->
this.timeForm.startDaysStr = pushData.startDaysStr <!--this.timeForm.startDaysStr = pushData.startDaysStr-->
this.timeForm.comentMsg = { <!--this.timeForm.comentMsg = {-->
id: pushData.resourceId, <!--id: pushData.resourceId,-->
header_name: pushData.sendContent <!--header_name: pushData.sendContent-->
} <!--}-->
this.closeSelectCartoon({ <!--this.closeSelectCartoon({-->
closeStatus: false, <!--closeStatus: false,-->
hasSelected: this.timeForm.comentMsg <!--hasSelected: this.timeForm.comentMsg-->
}) <!--})-->
} <!--}-->
if(this.timeForm.followupList && this.timeForm.followupList.length > 0){ //followResourceId <!--if(this.timeForm.followupList && this.timeForm.followupList.length > 0){ //followResourceId-->
this.formOptionsCopy = this.timeForm.followupList <!--this.formOptionsCopy = this.timeForm.followupList-->
this.timeForm.followResourceId = [] <!--this.timeForm.followResourceId = []-->
this.timeForm.followupList.forEach((item)=>{ <!--this.timeForm.followupList.forEach((item)=>{-->
this.timeForm.followResourceId.push(item.resourceId) <!--this.timeForm.followResourceId.push(item.resourceId)-->
}) <!--})-->
} <!--}-->
console.log(this.formOptionsCopy) <!--console.log(this.formOptionsCopy)-->
getPatientNumber({ <!--getPatientNumber({-->
patientIdList: this.patientIdList <!--patientIdList: this.patientIdList-->
}).then(res=>{ <!--}).then(res=>{-->
if(res.code=='000000'){ <!--if(res.code=='000000'){-->
this.timeForm.wechatPatientNum = res.data.wechatPatientNum; <!--this.timeForm.wechatPatientNum = res.data.wechatPatientNum;-->
this.timeForm.messagePatientNum = res.data.messagePatientNum; <!--this.timeForm.messagePatientNum = res.data.messagePatientNum;-->
this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum <!--this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum-->
}else{ <!--}else{-->
this.$notify.success({ <!--this.$notify.success({-->
title: '提交失败', <!--title: '提交失败',-->
message: res.message, <!--message: res.message,-->
showClose: false <!--showClose: false-->
}); <!--});-->
} <!--}-->
}) <!--})-->
// console.log(this.isStandedTemplate) <!--// console.log(this.isStandedTemplate)-->
// console.log(this.formOptions) <!--// console.log(this.formOptions)-->
// console.log(this.formOptionsCopy) <!--// console.log(this.formOptionsCopy)-->
} <!--}-->
}, <!--},-->
formOptions(val){ <!--formOptions(val){-->
val.forEach((item)=>{ <!--val.forEach((item)=>{-->
this.formNoList.push(item.scaleNo) <!--this.formNoList.push(item.scaleNo)-->
}) <!--})-->
}, <!--},-->
valBegin(val){ <!--valBegin(val){-->
if(val){ <!--if(val){-->
this.$refs[this.timeForm.formRef].validate((valid) => { <!--this.$refs[this.timeForm.formRef].validate((valid) => {-->
this.$emit('checkValid',{valid: valid, type: 'normal'}) <!--this.$emit('checkValid',{valid: valid, type: 'normal'})-->
}); <!--});-->
} <!--}-->
}, <!--},-->
saveValiedBegin(val){ <!--saveValiedBegin(val){-->
// console.log('保存按钮子组件的校验',val) <!--// console.log('保存按钮子组件的校验',val)-->
// console.log('++++',this.timeForm.formRef) <!--// console.log('++++',this.timeForm.formRef)-->
if(val && this.timeForm.formRef){ <!--if(val && this.timeForm.formRef){-->
this.$refs[this.timeForm.formRef].validate((valid) => { <!--this.$refs[this.timeForm.formRef].validate((valid) => {-->
// console.log('告诉父组件,校验结果' + valid) <!--// console.log('告诉父组件,校验结果' + valid)-->
this.$emit('checkValid',{valid: valid, type: 'save'}) <!--this.$emit('checkValid',{valid: valid, type: 'save'})-->
}); <!--});-->
} <!--}-->
} <!--}-->
}, <!--},-->
methods: { <!--methods: {-->
changeRemindDay(val){ <!--changeRemindDay(val){-->
console.log(val) <!--console.log(val)-->
}, <!--},-->
changeFollowId(val){ <!--changeFollowId(val){-->
console.log(val) <!--console.log(val)-->
this.timeForm.followResourceIdStr = [] <!--this.timeForm.followResourceIdStr = []-->
val.forEach((item)=>{ <!--val.forEach((item)=>{-->
if(this.formNoList.includes(item)){ <!--if(this.formNoList.includes(item)){-->
this.timeForm.followResourceIdStr.push(item) <!--this.timeForm.followResourceIdStr.push(item)-->
} <!--}-->
}) <!--})-->
}, <!--},-->
goSelectCartoon() { <!--goSelectCartoon() {-->
this.isSelectCartoon = true; <!--this.isSelectCartoon = true;-->
}, <!--},-->
closeSelectCartoon(val) { <!--closeSelectCartoon(val) {-->
this.isSelectCartoon = val.closeStatus; <!--this.isSelectCartoon = val.closeStatus;-->
this.timeForm.hasSelected = val.hasSelected; <!--this.timeForm.hasSelected = val.hasSelected;-->
}, <!--},-->
deleteClick() { <!--deleteClick() {-->
this.timeForm.hasSelected = ''; <!--this.timeForm.hasSelected = '';-->
}, <!--},-->
pushConmentMsg(val){ <!--pushConmentMsg(val){-->
this.timeForm.comentMsg = val <!--this.timeForm.comentMsg = val-->
getPatientNumber({ <!--getPatientNumber({-->
patientIdList: this.patientIdList <!--patientIdList: this.patientIdList-->
}).then(res=>{ <!--}).then(res=>{-->
if(res.code=='000000'){ <!--if(res.code=='000000'){-->
this.timeForm.wechatPatientNum = res.data.wechatPatientNum; <!--this.timeForm.wechatPatientNum = res.data.wechatPatientNum;-->
this.timeForm.messagePatientNum = res.data.messagePatientNum; <!--this.timeForm.messagePatientNum = res.data.messagePatientNum;-->
this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum <!--this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum-->
}else{ <!--}else{-->
this.$notify.success({ <!--this.$notify.success({-->
title: '提交失败', <!--title: '提交失败',-->
message: res.message, <!--message: res.message,-->
showClose: false <!--showClose: false-->
}); <!--});-->
} <!--}-->
}) <!--})-->
} <!--}-->
}, <!--},-->
} <!--}-->
</script> <!--</script>-->
<style scoped lang="scss"> <!--<style scoped lang="scss">-->
.form-div{ <!--.form-div{-->
padding-top: 30px; <!--padding-top: 30px;-->
.tips-contnt{ <!--.tips-contnt{-->
margin-top: -10px; <!--margin-top: -10px;-->
padding-left: 140px; <!--padding-left: 140px;-->
padding-bottom: 30px; <!--padding-bottom: 30px;-->
font-size: 12px; <!--font-size: 12px;-->
color: #9B9997; <!--color: #9B9997;-->
width: 55%; <!--width: 55%;-->
p{ <!--p{-->
line-height: 18px; <!--line-height: 18px;-->
&.yellow-font{ <!--&.yellow-font{-->
color: #e6a23c; <!--color: #e6a23c;-->
padding-bottom: 10px; <!--padding-bottom: 10px;-->
} <!--}-->
} <!--}-->
} <!--}-->
} <!--}-->
.ml20{ <!--.ml20{-->
margin-left: 20px; <!--margin-left: 20px;-->
} <!--}-->
</style> <!--</style>-->
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
v-show="index == activeTab" v-show="index == activeTab"
class="form-div" class="form-div"
> >
<el-form :ref="itemTimeForm.formRef" :model="itemTimeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small"> <el-form :ref="itemTimeForm.formRef" :model="itemTimeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="false" size="small">
<el-form-item label="本次随访时间" required> <el-form-item label="本次随访时间" required>
<div style="display: flex;"> <div style="display: flex;">
<el-form-item prop="timeNo"> <el-form-item prop="timeNo">
...@@ -180,6 +180,7 @@ ...@@ -180,6 +180,7 @@
messagePatientNum: 0, messagePatientNum: 0,
totalNumber: 0, totalNumber: 0,
activeResourceId: '', activeResourceId: '',
errMsg: '',
} }
}, },
props: { props: {
...@@ -269,6 +270,7 @@ ...@@ -269,6 +270,7 @@
this.setTimeNodeList[index].formRef = 'form' + index; this.setTimeNodeList[index].formRef = 'form' + index;
}); });
this.$forceUpdate(); this.$forceUpdate();
this.activeTab = this.setTimeNodeList.length - 1 + '';
} }
}, },
...@@ -368,8 +370,8 @@ ...@@ -368,8 +370,8 @@
// 如果直接点击保存,需要进行对当前填写的表单进行校验 // 如果直接点击保存,需要进行对当前填写的表单进行校验
this.checkStart(); this.checkStart();
if(this.isValied){ if(this.isValied){
let timeNo = this.setTimeNodeList[this.activeTab].timeNo; // let timeNo = this.setTimeNodeList[this.activeTab].timeNo;
this.checkIsRepeat(timeNo); // this.checkIsRepeat(timeNo);
// 保存 校验通过后,排序 + 发送请求 // 保存 校验通过后,排序 + 发送请求
// 新增成功之后 // 新增成功之后
this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo'); this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo');
...@@ -379,13 +381,13 @@ ...@@ -379,13 +381,13 @@
}) })
}else{ }else{
this.$message({ this.$message({
message: '请填写完整表单', message: this.errMsg,
type: 'error' type: 'error'
}); });
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: false, status: false,
setTimeNodeList: this.setTimeNodeList, setTimeNodeList: this.setTimeNodeList,
message: '请填写完整表单' message: this.errMsg
}) })
} }
} }
...@@ -398,8 +400,6 @@ ...@@ -398,8 +400,6 @@
//开始校验 //开始校验
this.checkStart(); this.checkStart();
if(this.isValied){ if(this.isValied){
let timeNo = this.setTimeNodeList[this.activeTab].timeNo;
this.checkIsRepeat(timeNo);
// 校验通过后,切换tab并且增加初始化list一个item // 校验通过后,切换tab并且增加初始化list一个item
let newTabName = ++this.activeTab + ''; let newTabName = ++this.activeTab + '';
this.initNewForm(); this.initNewForm();
...@@ -407,8 +407,9 @@ ...@@ -407,8 +407,9 @@
// 新增成功之后 // 新增成功之后
this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo'); this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo');
}else{ }else{
this.errMsg = '请填写完整表单';
this.$message({ this.$message({
message: '请填写完整表单', message: this.errMsg,
type: 'error' type: 'error'
}); });
} }
...@@ -417,9 +418,10 @@ ...@@ -417,9 +418,10 @@
deleteTimeNode(index) { deleteTimeNode(index) {
let listLen = this.setTimeNodeList.length; let listLen = this.setTimeNodeList.length;
if(listLen<=1){ if(listLen<=1){
this.errMsg = '至少选择一个时间节点';
this.$message({ this.$message({
message: '至少选择一个时间节点', message: this.errMsg,
type: 'warning' type: 'error'
}); });
return; return;
}else{ }else{
...@@ -443,29 +445,31 @@ ...@@ -443,29 +445,31 @@
console.log(pushData) console.log(pushData)
// 如果选了推送时间,没选漫画 // 如果选了推送时间,没选漫画
if(len && (startDays!==''&&startDays >= 0) && !resourceId){ if(len && (startDays!==''&&startDays >= 0) && !resourceId){
this.errMsg = '请选择推送的患教漫画';
this.$message({ this.$message({
message: '请选择推送的患教漫画', message: this.errMsg,
type: 'error' type: 'error'
}); });
if(type=='save'){ if(type=='save'){
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: false, status: false,
setTimeNodeList: this.setTimeNodeList, setTimeNodeList: this.setTimeNodeList,
message: '请选择推送的患教漫画' message: this.errMsg
}) })
} }
return false; return false;
}else if(len && startDays === '' && resourceId){ }else if(len && startDays === '' && resourceId){
//如果选了漫画,没选推送时间 //如果选了漫画,没选推送时间
this.errMsg = '请选择推送时间';
this.$message({ this.$message({
message: '请选择推送时间', message: this.errMsg,
type: 'error' type: 'error'
}); });
if(type=='save'){ if(type=='save'){
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: false, status: false,
setTimeNodeList: this.setTimeNodeList, setTimeNodeList: this.setTimeNodeList,
message: '请选择推送时间' message: this.errMsg
}) })
} }
return false; return false;
...@@ -482,11 +486,14 @@ ...@@ -482,11 +486,14 @@
if(!isValied){ if(!isValied){
this.activeTab = i + ''; this.activeTab = i + '';
this.isValied = false; this.isValied = false;
this.errMsg = '请填写完整表单';
return; return;
}else{ }else{
this.isValied = true this.isValied = true
} }
} }
let timeNo = this.setTimeNodeList[this.activeTab].timeNo;
this.checkIsRepeat(timeNo);
}, },
// 表单验证 // 表单验证
valiedForm(form){ valiedForm(form){
...@@ -510,17 +517,18 @@ ...@@ -510,17 +517,18 @@
}, },
// 检查是否重复 // 检查是否重复
checkIsRepeat(val){ checkIsRepeat(val){
this.setTimeNodeList.forEach((item,index)=>{ for(let i=0;i<this.setTimeNodeList.length;i++){
if(this.activeTab!=index && val==item.timeNo){ if(this.activeTab!=i && val==this.setTimeNodeList[i].timeNo){
this.isValied = false;
this.errMsg = '时间节点重复';
this.$message({ this.$message({
message: '时间节点重复', message: this.errMsg,
type: 'warning' type: 'error'
}); });
this.isValied = false;
this.setTimeNodeList[this.activeTab].timeNo = ''; this.setTimeNodeList[this.activeTab].timeNo = '';
return; return;
} }
}) }
}, },
// 是否禁用按钮 // 是否禁用按钮
itemIsDisabled(item){ itemIsDisabled(item){
...@@ -680,7 +688,7 @@ ...@@ -680,7 +688,7 @@
showTabLabel(item){ showTabLabel(item){
let str; let str;
if(this.isStandedTemplate || this.planId){ if(this.isStandedTemplate || this.planId){
str = item.timeStr; str = item.timeStr ? item.timeStr : '设置时间节点';
}else{ }else{
if(item.timeNo){ if(item.timeNo){
str = '开始后' + String(item.timeNo) + this.timeUnitStr str = '开始后' + String(item.timeNo) + this.timeUnitStr
...@@ -688,15 +696,6 @@ ...@@ -688,15 +696,6 @@
str = '设置时间节点' str = '设置时间节点'
} }
} }
// if(!this.isStandedTemplate && !this.planId){
// if(item.timeNo){
// str = '开始后' + String(item.timeNo) + this.timeUnitStr
// }else{
// str = '设置时间节点'
// }
// }else{
// str = '开始后' + String(item.timeNo) + this.timeUnitStr
// }
return str return str
}, },
}, },
......
...@@ -6,124 +6,58 @@ ...@@ -6,124 +6,58 @@
:curmbThird="'录入量表'" :curmbThird="'录入量表'"
/> />
<div class="resident-content f-main-content screenSet"> <div class="resident-content f-main-content screenSet">
<!--渲染不同的模块表单-->
<div v-for="(item, index) in addComponents"> <div>
<div class="content-box" > <el-row :gutter="24">
<div class="title">{{item.title}}</div> <el-col :span="20"><div class="grid-content bg-purple">脑卒中患者随访服务记录表</div></el-col>
<el-form ref="form" :model="form" label-width="120px"> <el-col :span="4">
<div class="form-box"> <div class="grid-content bg-purple">
<el-row> <el-button class="button-white" size="small" plain @click="">暂存</el-button>
<!--渲染不同的表单内部分类字段--> <el-button type="primary" size="small" @click="">提交</el-button>
<el-col v-for="(item2, index) in item.dataSource" </div>
:span="item2.spanNum ? item2.spanNum : spanNum"
:class="item2.className"
:offset="item2.offset"
:push="item2.push"
:key="index" >
<el-form-item
v-if="isParent(item2)"
:prop="item2.prop"
:label="item2.label"
:rules="item2.rules"
:label-width="item2.labelWidth"
:required="item2.required"
:class="item2.className"
:error="item2.error">
<component
:is="item.name"
:key="index"
:dataSource="item2"
/>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</el-form>
</div>
</div> <el-row :gutter="24">
<el-col :span="4"><div class="grid-content bg-purple">居民:戴家康</div></el-col>
<el-col :span="12"><div class="grid-content bg-purple">身份证号:31021212121212121212</div></el-col>
<el-col :span="8"><div class="grid-content bg-purple">随访计划名称:2018年河北省脑卒中随访</div></el-col>
</el-row>
<!--模板页面除了显示居民基本信息,将病种展示作为组件引入-->
<!--脑卒中-->
<stroke />
<!--高血压-->
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import BreadCrumb from '@/components/breadcrumb' import BreadCrumb from '@/components/breadcrumb'
import HelpChecking from '@/components/followup/form/helpChecking' // 糖尿病
import LifeStyleGuide from '@/components/followup/form/lifeStyleGuide' import stroke from './patient-scale/stroke'
import MedicalStateUsing from '@/components/followup/form/medicalStateUsing'
import Sign from '@/components/followup/form/sign'
import Symptom from '@/components/followup/form/symptom'
import dataSourceSymptom from '@/model/dataSourceSymptom'
import dataSourceSign from '@/model/dataSourceSign'
import dataSourceLifeStyleGuide from '@/model/dataSourceLifeStyleGuide'
import dataSourceHelpChecking from '@/model/dataSourceHelpChecking'
import dataSourceMedicalStateUsing from '@/model/dataSourceMedicalStateUsing'
export default { export default {
components: { components: {
Symptom,//症状 stroke,
Sign,//体征
LifeStyleGuide,//生活方式指导
HelpChecking,//辅助检查
MedicalStateUsing,//用药情况
//以下是非组件 //以下是非组件
BreadCrumb, BreadCrumb,
}, },
data(){ data(){
return { return {
spanNum: 12, // //量表结果集合
valueFormat: 'timestamp', // dataSource: {
format: 'yyyy-MM-dd HH:mm', // AcuteBrainVeinThrombolytic: {},
dateType: 'datetime', // Lifestyle: {}
form: {}, // },
addComponents: [
{name: 'Symptom',dataSource:dataSourceSymptom, title: '症状'},
{name: 'Sign',dataSource:dataSourceSign, title: '体征'},
{name: 'LifeStyleGuide',dataSource:dataSourceLifeStyleGuide, title: '生活方式指导'},
{name: 'HelpChecking',dataSource:dataSourceHelpChecking, title: '辅助检查'},
{name: 'MedicalStateUsing',dataSource:dataSourceMedicalStateUsing, title: '用药情况'},
],
//量表结果集合
dataSource: {
AcuteBrainVeinThrombolytic: {},
Lifestyle: {}
},
} }
}, },
created(){
},
methods: {
defaultFun() {},
isParent(item) {
if (!item.linkageRule) {
return true
} else {
let num = 0
item.linkageRule.forEach(t => {
if (this.form[t.name] == null) {
return false
}
if (typeof this.form[t.name] === 'string') {
if (t.value.includes(this.form[t.name])) {
num += 1
}
} else {
const nameVal = this.form[t.name]
const valType = _.isArray(nameVal) ? nameVal : Array.of(nameVal)
const bool = _.intersection(valType, t.value)
if (_.isArray(bool) && bool.length > 0) {
num += 1
}
}
})
if (num !== item.linkageRule.length) {
delete this.form[item.model]
}
return num === item.linkageRule.length
}
}
}
} }
</script> </script>
......
export default [
{
formType: 'radio',
// className: 'clear-left',
prop: 'm1',
model: 'm1',
spanNum: 24,
label: '调查时状态',
options: [
{ label: '接受', value: '1' },
{ label: '失访', value: '2' },
{ label: '死亡', value: '3' }
],
rules: [{ required: true, message: '请选择调查时状态', trigger: 'blur' }]
},
{
formType: 'radio',
// className: 'clear-left',
prop: 'm1',
model: 'm2',
spanNum: 24,
label: '失访原因',
linkageRule: [{ name: 'm1', value: ['2'] }],
options: [
{ label: '失去联系', value: '1' },
{ label: '拒绝参加调查', value: '2' },
{ label: '其他', value: '3' }
],
rules: [{ required: true, message: '请选择失访原因', trigger: 'blur' }]
},
{
formType: 'input',
linkageRule: [
{
name: 'm2',
value: ['3']
}
],
prop: 'm3',
model: 'm3',
label: '其他',
disabled: false,
placeholder: '请输入其他原因',
spanNum: 12,
type: 'number',
labmsg: '',
// slots: [{ name: 'mmol/L', type: 'append' }]
},
]
export default [
{
formType: 'date-picker',
prop: 'screeningTime',
model: 'screeningTime',
placeholder: '选择日期时间',
label: '随访日期',
format: 'yyyy-MM-dd',
type: 'date',
rules: [{ required: true, message: '请选择日期时间', trigger: 'blur' }]
},
{
formType: 'radio',
model: '111',
label: '随访方式',
disabled: false,
placeholder: '150',
spanNum: 24,
options: [
{ label: '门诊', value: '1', disabled: false },
{ label: '家庭', value: '2', disabled: false },
{ label: '电话', value: '3', disabled: false },
],
rules: [{ required: true, message: '请选择随访方式', trigger: 'blur' }]
},
]
export default [
{
formType: 'date-picker',
prop: 'screeningTime',
model: 'screeningTime',
placeholder: '选择日期时间',
label: '随访日期',
format: 'yyyy-MM-dd',
type: 'date',
rules: [{ required: true, message: '请选择日期时间', trigger: 'blur' }]
},
{
formType: 'radio',
model: 'radioVal',
label: '随访方式',
disabled: false,
placeholder: '150',
spanNum: 24,
options: [
{ label: '门诊', value: '1', disabled: false },
{ label: '家庭', value: '2', disabled: false },
{ label: '电话', value: '3', disabled: false },
],
rules: [{ required: true, message: '请选择随访方式', trigger: 'blur' }]
},
]
<template> <template>
<div> <div>
<h1>用药情况-组件</h1>
</div> </div>
</template> </template>
......
<template>
<div>
<!--渲染不同的模块表单-->
<div v-for="(item, index) in addComponents">
<div class="content-box" >
<div class="title">{{item.title}}</div>
<el-form ref="form" :model="form" label-width="120px">
<FormScale :dataSource="item.dataSource" :form="form" />
</el-form>
</div>
</div>
</div>
</template>
<script>
// 量表 template
import FormScale from '@/components/followup/form/index'
// 量表模块数据模型
import dataSourceBaseInfo from '../models/stroke/dataSourceBaseInfo'
import dataSourceDataType from '../models/stroke/dataSourceDataType'
import dataSourceSymptom from '../models/stroke/dataSourceSymptom'
import dataSourceSign from '../models/stroke/dataSourceSign'
import dataSourceLifeStyleGuide from '../models/stroke/dataSourceLifeStyleGuide'
import dataSourceHelpChecking from '../models/stroke/dataSourceHelpChecking'
import dataSourceMedicalStateUsing from '../models/stroke/dataSourceMedicalStateUsing'
export default {
components: {
FormScale,
},
data(){
return {
addComponents: [
{name: 'BaseInfo',dataSource:dataSourceBaseInfo, title: '基本信息'},
{name: 'DataType',dataSource:dataSourceDataType, title: '日期与方式'},
{name: 'Symptom',dataSource:dataSourceSymptom, title: '症状'},
{name: 'Sign',dataSource:dataSourceSign, title: '体征'},
{name: 'LifeStyleGuide',dataSource:dataSourceLifeStyleGuide, title: '生活方式指导'},
{name: 'HelpChecking',dataSource:dataSourceHelpChecking, title: '辅助检查'},
{name: 'MedicalStateUsing',dataSource:dataSourceMedicalStateUsing, title: '用药情况'},
],
form: {
symptomList: [],//checkbox 症状
inputVal: '',
radioVal: ''
},
}
},
}
</script>
<style scoped lang="scss">
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册