Commit f409246a authored by miaojiale's avatar miaojiale

修改form

parent 348fd501
<template> <template>
<el-row :gutter="options.gutter" class="form-content"> <el-row :gutter="options.gutter" class="form-content">
<template v-for="(item, columnIndex) in columns.column || columns.children.column"> <template
v-for="(item, columnIndex) in columns.column || columns.children.column"
>
<div <div
v-if="item.type === 'dynamic'" v-if="item.type === 'dynamic'"
v-show="item.display" v-show="item.display"
...@@ -8,7 +10,11 @@ ...@@ -8,7 +10,11 @@
style="width: 100%" style="width: 100%"
class="dynamic-form-container" class="dynamic-form-container"
> >
<el-form-item :prop="item.prop" :label-width="'0px'" style="display: none"></el-form-item> <el-form-item
:prop="item.prop"
:label-width="'0px'"
style="display: none"
></el-form-item>
<div class="dynamic-form-container_lable">{{ item.label }}</div> <div class="dynamic-form-container_lable">{{ item.label }}</div>
<form-dynamic <form-dynamic
v-model="form[item.prop]" v-model="form[item.prop]"
...@@ -25,7 +31,11 @@ ...@@ -25,7 +31,11 @@
style="width: 100%" style="width: 100%"
> >
<el-collapse :value="item.collapse ? item.prop : ''"> <el-collapse :value="item.collapse ? item.prop : ''">
<el-collapse-item :title="item.label" :name="item.prop" :disabled="!item.arrow"> <el-collapse-item
:title="item.label"
:name="item.prop"
:disabled="!item.arrow"
>
<form-content <form-content
ref="form-content" ref="form-content"
:form="form" :form="form"
...@@ -43,7 +53,11 @@ ...@@ -43,7 +53,11 @@
:key="columnIndex" :key="columnIndex"
style="width: 100%" style="width: 100%"
> >
<el-form-item :prop="item.prop" :label-width="'0px'" style="display: none"></el-form-item> <el-form-item
:prop="item.prop"
:label-width="'0px'"
style="display: none"
></el-form-item>
<dental-tab-form <dental-tab-form
ref="dental" ref="dental"
v-model="form[item.prop]" v-model="form[item.prop]"
...@@ -59,7 +73,11 @@ ...@@ -59,7 +73,11 @@
:key="columnIndex" :key="columnIndex"
style="width: 100%" style="width: 100%"
> >
<el-form-item :prop="item.prop" :label-width="'0px'" style="display: none"></el-form-item> <el-form-item
:prop="item.prop"
:label-width="'0px'"
style="display: none"
></el-form-item>
<dental-tab-tj-form <dental-tab-tj-form
ref="dental" ref="dental"
v-model="form[item.prop]" v-model="form[item.prop]"
...@@ -168,7 +186,7 @@ export default { ...@@ -168,7 +186,7 @@ export default {
}, },
// 切换不符合筛查条件的显示 // 切换不符合筛查条件的显示
formChange() { formChange() {
// 入选,排除标准 // 入选,排除标准,一个填写是就不符合筛查条件
console.log(this.form) console.log(this.form)
let arr = [ let arr = [
"is_one_year", "is_one_year",
...@@ -181,7 +199,7 @@ export default { ...@@ -181,7 +199,7 @@ export default {
] ]
let flag = 0 let flag = 0
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
if (this.form[arr[i]] && this.form[arr[i]] == 0) { if (this.form[arr[i]] && this.form[arr[i]] == 1) {
flag++ flag++
} }
} }
......
...@@ -2,13 +2,35 @@ ...@@ -2,13 +2,35 @@
<div class="form-item-text"> <div class="form-item-text">
<template v-if="form[item.prop]"> <template v-if="form[item.prop]">
<span v-if="item.prepend">{{ item.prepend }}</span> <span v-if="item.prepend">{{ item.prepend }}</span>
<span style="margin: 0 5px">{{ <span>
<span
v-if="item.prop == 'risk_rank'"
:style="{
color:
form[item.prop] == '中危'
? '#FF9F33'
: form[item.prop] == '低危'
? 'green'
: '',
}"
>
{{ form[item.prop] }}
</span>
<span
v-else-if="item.prop == 'screening_advise'"
style="color: #4e68ff"
>
{{ form[item.prop] }}
</span>
<span v-else style="margin: 0 5px">{{
form[item.prop] | getItemText(item.dicData, item.type) form[item.prop] | getItemText(item.dicData, item.type)
}}</span> }}</span>
</span>
<span v-if="item.append && !item.toothBit" class="append">{{ <span v-if="item.append && !item.toothBit" class="append">{{
item.append item.append
}}</span> }}</span>
</template> </template>
<template v-else> -- </template>
</div> </div>
</template> </template>
......
This diff is collapsed.
...@@ -41,11 +41,13 @@ export default { ...@@ -41,11 +41,13 @@ export default {
}, },
handleTabClick({ index, name }) { handleTabClick({ index, name }) {
const { formId, id, silent } = this.formTabs[index] const { formId, id, silent } = this.formTabs[index]
console.log('表单项', this.formTabs) console.log("表单项", this.formTabs[index])
if (formId && silent) { if (formId && silent) {
this.formTabs[index]["silent"] = false //控制是否获取接口数据 this.formTabs[index]["silent"] = false //控制是否获取接口数据
return return
} }
if (this.formTabs[index].formName == "风险评估") {
}
this.formTabs.splice(index, 1, { this.formTabs.splice(index, 1, {
...this.formTabsList.find((_) => _.id === id), ...this.formTabsList.find((_) => _.id === id),
}) })
......
...@@ -200,7 +200,7 @@ export default { ...@@ -200,7 +200,7 @@ export default {
}, },
}, },
created() { created() {
this.handleFormSearch() // this.handleFormSearch()
}, },
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment