Commit 5cc0018a authored by miaojiale's avatar miaojiale

增加病理诊断独显

parent cfb85b08
...@@ -95,17 +95,12 @@ ...@@ -95,17 +95,12 @@
slot="append" slot="append"
class="toothBit" class="toothBit"
@click="openToothBit" @click="openToothBit"
>{{ item.append || "牙位" }}</el-button> >{{ item.append || "牙位" }}</el-button
<template
v-else-if="item.append"
slot="append"
> >
<template v-else-if="item.append" slot="append">
{{ item.append }} {{ item.append }}
</template> </template>
<template <template v-if="item.prepend" slot="prepend">
v-if="item.prepend"
slot="prepend"
>
{{ item.prepend }} {{ item.prepend }}
</template> </template>
</el-input> </el-input>
...@@ -130,16 +125,10 @@ ...@@ -130,16 +125,10 @@
" "
@blur="handleBlur" @blur="handleBlur"
> >
<template <template v-if="item.append" slot="append">
v-if="item.append"
slot="append"
>
{{ item.append }} {{ item.append }}
</template> </template>
<template <template v-if="item.prepend" slot="prepend">
v-if="item.prepend"
slot="prepend"
>
{{ item.prepend }} {{ item.prepend }}
</template> </template>
</el-input> </el-input>
...@@ -168,10 +157,7 @@ ...@@ -168,10 +157,7 @@
</template> </template>
<!-- 计数器 --> <!-- 计数器 -->
<div <div v-if="item.type === 'number'" style="display: inline-table">
v-if="item.type === 'number'"
style="display: inline-table"
>
<el-input-number <el-input-number
v-model="form[item.prop]" v-model="form[item.prop]"
:readonly="item.readonly" :readonly="item.readonly"
...@@ -190,7 +176,8 @@ ...@@ -190,7 +176,8 @@
v-if="item.append" v-if="item.append"
class="el-input-group__append" class="el-input-group__append"
style="line-height: 28px" style="line-height: 28px"
>{{ item.append }}</span> >{{ item.append }}</span
>
</div> </div>
<!-- 单选框 --> <!-- 单选框 -->
...@@ -204,7 +191,8 @@ ...@@ -204,7 +191,8 @@
v-for="(opt, optIndex) in item.dicData" v-for="(opt, optIndex) in item.dicData"
:key="optIndex" :key="optIndex"
:label="opt.value" :label="opt.value"
>{{ opt.label }}</el-radio> >{{ opt.label }}</el-radio
>
</el-radio-group> </el-radio-group>
<!-- 单选框只读 --> <!-- 单选框只读 -->
<!-- <div <!-- <div
...@@ -233,7 +221,8 @@ ...@@ -233,7 +221,8 @@
v-for="(opt, optIndex) in item.dicData" v-for="(opt, optIndex) in item.dicData"
:key="optIndex" :key="optIndex"
:label="opt.value" :label="opt.value"
>{{ opt.label }}</el-checkbox> >{{ opt.label }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
</template> </template>
...@@ -344,7 +333,8 @@ ...@@ -344,7 +333,8 @@
$route.path != '/followupresearch' $route.path != '/followupresearch'
" "
style="margin-left: 12px" style="margin-left: 12px"
>{{ form['age'] + (form['age'] ? "岁" : "") }}</span> >{{ age + (age ? "岁" : "") }}</span
>
</div> </div>
<!-- 年 --> <!-- 年 -->
<el-date-picker <el-date-picker
...@@ -443,7 +433,8 @@ ...@@ -443,7 +433,8 @@
<span <span
v-if="item.importantField && !getVwForm.detail" v-if="item.importantField && !getVwForm.detail"
class="important_field" class="important_field"
>{{ item.importantFieldDesc || "*" }}</span> >{{ item.importantFieldDesc || "*" }}</span
>
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -482,15 +473,15 @@ export default { ...@@ -482,15 +473,15 @@ export default {
}, },
getPatientId: { getPatientId: {
type: Function, type: Function,
default: () => { }, default: () => {},
}, },
getDefectsSet: { getDefectsSet: {
type: Function, type: Function,
default: () => { }, default: () => {},
}, },
configForms: { configForms: {
type: Function, type: Function,
default: () => { }, default: () => {},
}, },
}, },
props: { props: {
...@@ -509,7 +500,7 @@ export default { ...@@ -509,7 +500,7 @@ export default {
columnIndex: Number, columnIndex: Number,
group: Array, group: Array,
}, },
data () { data() {
return { return {
// age: "", // age: "",
pickerOptions, pickerOptions,
...@@ -522,11 +513,11 @@ export default { ...@@ -522,11 +513,11 @@ export default {
...mapGetters({ ...mapGetters({
age: ["table/age"], age: ["table/age"],
}), }),
getVwForm () { getVwForm() {
return this.vwForm() return this.vwForm()
}, },
//重要字段空数据且填写表单时添加重点 //重要字段空数据且填写表单时添加重点
isEmpty () { isEmpty() {
const { importantField, prop } = this.item const { importantField, prop } = this.item
if (!importantField || this.getVwForm.detail) return "" if (!importantField || this.getVwForm.detail) return ""
...@@ -538,14 +529,14 @@ export default { ...@@ -538,14 +529,14 @@ export default {
} }
return empty ? "empty-tip" : "" return empty ? "empty-tip" : ""
}, },
defectsSet () { defectsSet() {
return this.getDefectsSet ? this.getDefectsSet() : [] return this.getDefectsSet ? this.getDefectsSet() : []
}, },
patientId () { patientId() {
return this.getPatientId ? this.getPatientId() : "" return this.getPatientId ? this.getPatientId() : ""
}, },
}, },
created () { created() {
this.timerangeReset() this.timerangeReset()
this.numberReset() this.numberReset()
this.checkboxReset() this.checkboxReset()
...@@ -556,7 +547,6 @@ export default { ...@@ -556,7 +547,6 @@ export default {
// this.getMedicalunionList() // this.getMedicalunionList()
if ( if (
this.$route.path == "/screening/add" || this.$route.path == "/screening/add" ||
this.$route.path == "/screening/draft" ||
this.$route.path == "/screening/index" this.$route.path == "/screening/index"
) { ) {
this.getMedicalunionList() this.getMedicalunionList()
...@@ -572,19 +562,19 @@ export default { ...@@ -572,19 +562,19 @@ export default {
} }
} }
}, },
mounted () { mounted() {
this.showFormItem() this.showFormItem()
console.log(this.activeName) // console.log(this.activeName)
}, },
beforeDestroy () { beforeDestroy() {
this.$watch( this.$watch(
() => this.form[this.item.prop], () => this.form[this.item.prop],
(newVal, oldVal) => { } (newVal, oldVal) => {}
) )
}, },
methods: { methods: {
// 获取医联体列表 // 获取医联体列表
getMedicalunionList () { getMedicalunionList() {
getMedicalunionList().then((res) => { getMedicalunionList().then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.unionList = [...res.data] this.unionList = [...res.data]
...@@ -593,17 +583,17 @@ export default { ...@@ -593,17 +583,17 @@ export default {
} }
}) })
}, },
scrollToView () { scrollToView() {
if (this.$refs["JY_LCYY"]) { if (this.$refs["JY_LCYY"]) {
this.$refs["JY_LCYY"].$el.scrollIntoView({ behavior: "smooth" }) this.$refs["JY_LCYY"].$el.scrollIntoView({ behavior: "smooth" })
} }
}, },
openToothBit () { openToothBit() {
this.$refs.dialog.open() this.$refs.dialog.open()
}, },
// 处理timerange 重置后不能选择的问题 // 处理timerange 重置后不能选择的问题
timerangeReset () { timerangeReset() {
if (this.item.type === "timerange") { if (this.item.type === "timerange") {
this.$watch(`form.${this.item.prop}`, (val) => { this.$watch(`form.${this.item.prop}`, (val) => {
if (val && val.length === 1) { if (val && val.length === 1) {
...@@ -613,7 +603,7 @@ export default { ...@@ -613,7 +603,7 @@ export default {
} }
}, },
// 处理number 默认为0的问题 // 处理number 默认为0的问题
numberReset () { numberReset() {
if (this.item.type === "number") { if (this.item.type === "number") {
this.$watch( this.$watch(
`form.${this.item.prop}`, `form.${this.item.prop}`,
...@@ -628,7 +618,7 @@ export default { ...@@ -628,7 +618,7 @@ export default {
}, },
// 处理数组 默认值的问题 // 处理数组 默认值的问题
checkboxReset () { checkboxReset() {
const { type, multiple, value } = this.item const { type, multiple, value } = this.item
if ( if (
type === "checkbox" || type === "checkbox" ||
...@@ -651,7 +641,7 @@ export default { ...@@ -651,7 +641,7 @@ export default {
}, },
// 处理复选框排斥 // 处理复选框排斥
checkboxRepel (val) { checkboxRepel(val) {
const { repelValue, repel } = this.item const { repelValue, repel } = this.item
if (repel && repelValue) { if (repel && repelValue) {
const len = val.length const len = val.length
...@@ -668,7 +658,7 @@ export default { ...@@ -668,7 +658,7 @@ export default {
} }
}, },
// 处理运算规则 // 处理运算规则
handleAlgorithm () { handleAlgorithm() {
const { algorithm } = this.item const { algorithm } = this.item
if (algorithm) { if (algorithm) {
const algorithmArr = algorithm.split(";") //多个规则数组集合 const algorithmArr = algorithm.split(";") //多个规则数组集合
...@@ -685,13 +675,13 @@ export default { ...@@ -685,13 +675,13 @@ export default {
if (process.includes("stop")) return if (process.includes("stop")) return
try { try {
this.$set(this.form, target, eval(process)) this.$set(this.form, target, eval(process))
} catch { } } catch {}
} }
}) })
} }
}, },
// 自定义方法规则 // 自定义方法规则
handleSelfProcess (algorithmValue) { handleSelfProcess(algorithmValue) {
const type = algorithmValue[0] const type = algorithmValue[0]
const ruleTarget = algorithmValue[1] const ruleTarget = algorithmValue[1]
const ruleArgs = algorithmValue[2] const ruleArgs = algorithmValue[2]
...@@ -729,7 +719,7 @@ export default { ...@@ -729,7 +719,7 @@ export default {
val && this.$set(this.form, ruleTarget, val) val && this.$set(this.form, ruleTarget, val)
}, },
// 根据生日设置年龄回显 // 根据生日设置年龄回显
getAge () { getAge() {
if (this.form.birthday && this.form.survey_time) { if (this.form.birthday && this.form.survey_time) {
var birthday = new Date(this.form.birthday.replace(/-/g, "/")) var birthday = new Date(this.form.birthday.replace(/-/g, "/"))
let d = new Date(this.form.survey_time.replace(/-/g, "/")) let d = new Date(this.form.survey_time.replace(/-/g, "/"))
...@@ -737,37 +727,36 @@ export default { ...@@ -737,37 +727,36 @@ export default {
d.getFullYear() - d.getFullYear() -
birthday.getFullYear() - birthday.getFullYear() -
(d.getMonth() < birthday.getMonth() || (d.getMonth() < birthday.getMonth() ||
(d.getMonth() == birthday.getMonth() && (d.getMonth() == birthday.getMonth() &&
d.getDate() < birthday.getDate()) d.getDate() < birthday.getDate())
? 1 ? 1
: 0) : 0)
this.$store.commit("table/setAge", age) this.$store.commit("table/setAge", age)
this.form.age = this.age this.form.age = this.age
console.log('年龄有问题', this.form); // console.log(this.form.age, "---", age)
console.log(this.form.age, "---", age)
} else { } else {
let age = "" let age = ""
this.$store.commit("table/setAge", age) this.$store.commit("table/setAge", age)
this.form.age = this.age this.form.age = this.age
console.log(this.form.age, "---", age) // console.log(this.form.age, "---", age)
} }
}, },
// 获取prop prop 以{}包裹 // 获取prop prop 以{}包裹
getProp (value) { getProp(value) {
if (!value) return "" if (!value) return ""
return value.replace(/[{][\w]*[}]/g, (word) => { return value.replace(/[{][\w]*[}]/g, (word) => {
return word.replace(/{|}/g, "") return word.replace(/{|}/g, "")
}) })
}, },
// 获取运算过程 // 获取运算过程
getProcess (value) { getProcess(value) {
return value.replace(/[{][\w]*[}]/g, (word) => { return value.replace(/[{][\w]*[}]/g, (word) => {
const actualValue = this.form[word.replace(/{|}/g, "")] const actualValue = this.form[word.replace(/{|}/g, "")]
return actualValue ? actualValue : "stop" return actualValue ? actualValue : "stop"
}) })
}, },
// 表单子项控制显隐 // 表单子项控制显隐
showFormItem () { showFormItem() {
const { dynamicshSet, prop, noImmediate } = this.item const { dynamicshSet, prop, noImmediate } = this.item
if (dynamicshSet && dynamicshSet.length > 0) { if (dynamicshSet && dynamicshSet.length > 0) {
this.$watch( this.$watch(
...@@ -871,8 +860,8 @@ export default { ...@@ -871,8 +860,8 @@ export default {
const newVal = Array.isArray(this.form[targetItem.prop]) const newVal = Array.isArray(this.form[targetItem.prop])
? [] ? []
: targetItem.type === "number" : targetItem.type === "number"
? undefined ? undefined
: "" : ""
this.$set(this.form, targetItem.prop, newVal) this.$set(this.form, targetItem.prop, newVal)
} }
if (this.type === "form") { if (this.type === "form") {
...@@ -916,7 +905,7 @@ export default { ...@@ -916,7 +905,7 @@ export default {
// !设置大表单里的每个小表单rules // !设置大表单里的每个小表单rules
if (targetItem.prop == "1669874397313_56690") { if (targetItem.prop == "1669874397313_56690") {
console.log(display) // console.log(display)
// !只能写死,当前情况下,定义一个字段用来缓存是否回显,根据val // !只能写死,当前情况下,定义一个字段用来缓存是否回显,根据val
// if (val == 0) { // if (val == 0) {
// this.showChildren = false // this.showChildren = false
...@@ -962,7 +951,15 @@ export default { ...@@ -962,7 +951,15 @@ export default {
} }
}) })
} }
this.$set(targetItem, "display", Boolean(display)) if (
prop == "early_gastric_cancer" ||
prop == "period_gastric_cancer" ||
prop == "inogm_level"
) {
this.$set(targetItem, "display", true)
} else {
this.$set(targetItem, "display", Boolean(display))
}
} }
}) })
}, },
...@@ -973,11 +970,11 @@ export default { ...@@ -973,11 +970,11 @@ export default {
} }
}, },
// //
handleBlur () { handleBlur() {
this.handleAlgorithm() this.handleAlgorithm()
}, },
// 每个表单值改变的方法 // 每个表单值改变的方法
handleChange (val) { handleChange(val) {
this.checkboxRepel(val) this.checkboxRepel(val)
this.handleAlgorithm() this.handleAlgorithm()
// !设置年龄 // !设置年龄
...@@ -998,7 +995,7 @@ export default { ...@@ -998,7 +995,7 @@ export default {
this.$emit("formChange") this.$emit("formChange")
// ['is_one_year','is_subtotal_history','is_ppi','is_symptom','is_subtotal_history','is_disease','is_tumour'] // ['is_one_year','is_subtotal_history','is_ppi','is_symptom','is_subtotal_history','is_disease','is_tumour']
}, },
validUpload (prop) { validUpload(prop) {
this.$emit("validUpload", prop) this.$emit("validUpload", prop)
}, },
}, },
......
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