|
@@ -5,13 +5,13 @@
|
|
|
<el-row :gutter="16">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="病历类型" prop="case_type">
|
|
|
- <el-select v-model="ruleForm.case_type" filterable clearable placeholder="请选择" style="width: 100%;">
|
|
|
- <el-option label="出院记录" value="出院记录" />
|
|
|
- <el-option label="入院记录" value="入院记录" />
|
|
|
- <el-option label="病程类" value="病程类" />
|
|
|
- <el-option label="手术类" value="手术类" />
|
|
|
- <el-option label="医嘱" value="医嘱" />
|
|
|
- <el-option label="费用" value="费用" />
|
|
|
+ <el-select v-model="ruleForm.case_type" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in caseTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -35,7 +35,24 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="质控科室">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.department"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in departments"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dep_name"
|
|
|
+ :value="item.dep_id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="单项否决">
|
|
|
<el-select v-model="ruleForm.is_not" filterable clearable placeholder="请选择" style="width: 100%;">
|
|
@@ -54,16 +71,13 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="质控类型" prop="type">
|
|
|
- <el-select v-model="ruleForm.type" filterable clearable placeholder="请选择" style="width: 100%;">
|
|
|
- <el-option label="时效性" value="时效性" />
|
|
|
- <el-option label="完整性" value="完整性" />
|
|
|
- <el-option label="逻辑性" value="逻辑性" />
|
|
|
- <el-option label="内涵性" value="内涵性" />
|
|
|
- <el-option label="专病规则" value="专病规则" />
|
|
|
- <el-option label="专科规则" value="专科规则" />
|
|
|
- <el-option label="检查规则" value="检查规则" />
|
|
|
- <el-option label="检验规则" value="检验规则" />
|
|
|
- <el-option label="其他规则" value="其他规则" />
|
|
|
+ <el-select v-model="ruleForm.type" placeholder="请选择" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in qualityTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -73,17 +87,15 @@
|
|
|
v-model="ruleForm.changjing"
|
|
|
multiple
|
|
|
collapse-tags
|
|
|
- filterable
|
|
|
- clearable
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%;"
|
|
|
>
|
|
|
- <el-option label="医生端" value="医生端" />
|
|
|
- <el-option label="编码员" value="编码员" />
|
|
|
- <el-option label="质控员" value="质控员" />
|
|
|
- <el-option label="国考" value="国考" />
|
|
|
- <el-option label="卫统" value="卫统" />
|
|
|
- <el-option label="医保" value="医保" />
|
|
|
+ <el-option
|
|
|
+ v-for="item in sceneOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -167,13 +179,13 @@
|
|
|
:value="getDisplayName(sItem.param1)"
|
|
|
placeholder="请选择"
|
|
|
size="small"
|
|
|
- style="width: calc(100% - 90px)"
|
|
|
+ style="width: calc(100% - 70px)"
|
|
|
readonly
|
|
|
@click="openCategoryDialog(index, sIndex, 'qztj')"
|
|
|
/>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
- style="width: 90px"
|
|
|
+ style="width: 70px"
|
|
|
class="category-select"
|
|
|
@click="openCategoryDialog(index, sIndex, 'qztj')"
|
|
|
>
|
|
@@ -211,7 +223,7 @@
|
|
|
/>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
- style="width: 90px; position: absolute; right: 0; top: 0; opacity: 0;"
|
|
|
+ style="width: 70px; position: absolute; right: 0; top: 0; opacity: 0;"
|
|
|
@click="openCategoryDialog(index, sIndex, 'sx_1')"
|
|
|
/>
|
|
|
</div>
|
|
@@ -230,7 +242,7 @@
|
|
|
/>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
- style="width: 90px; position: absolute; right: 0; top: 0; opacity: 0;"
|
|
|
+ style="width: 70px; position: absolute; right: 0; top: 0; opacity: 0;"
|
|
|
@click="openCategoryDialog(index, sIndex, 'sx_2')"
|
|
|
/>
|
|
|
</div>
|
|
@@ -259,32 +271,107 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
- <el-col v-else-if="['等于', '不等于', '包含', '不包含'].includes(sItem.condition)" :span="6">
|
|
|
+ <el-col v-else-if="['等于', '不等于', '包含', '不包含', '大于', '小于', '大于等于', '小于等于'].includes(sItem.condition)" :span="6">
|
|
|
<div class="input-with-category">
|
|
|
- <el-input
|
|
|
- v-model="sItem.param2"
|
|
|
- placeholder="请输入"
|
|
|
- size="small"
|
|
|
- style="width: calc(100% - 90px)"
|
|
|
- @input="(value) => handleInput(value, index, sIndex, 'qztj')"
|
|
|
- />
|
|
|
+ <template v-if="sItem.hasChildOptions">
|
|
|
+ <el-select
|
|
|
+ v-model="sItem.param2"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 90px)"
|
|
|
+ @change="(value) => handleInput(value, index, sIndex, 'qztj')"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in sItem.childOptions"
|
|
|
+ :key="option.field"
|
|
|
+ :label="option.field_name"
|
|
|
+ :value="option.field_name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-input
|
|
|
+ v-model="sItem.param2"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 90px)"
|
|
|
+ @input="(value) => handleInput(value, index, sIndex, 'qztj')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<el-select
|
|
|
v-model="sItem.categoryType"
|
|
|
size="small"
|
|
|
placeholder="文本"
|
|
|
- style="width: 90px"
|
|
|
+ style="width: 70px"
|
|
|
class="category-select"
|
|
|
>
|
|
|
<i slot="prefix" class="el-icon-s-operation" />
|
|
|
<el-option
|
|
|
- v-for="item in categories"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="sitem in categories"
|
|
|
+ :key="sitem.value"
|
|
|
+ :label="sitem.label"
|
|
|
+ :value="sitem.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
+ <el-col v-if="sItem.condition === '减'" :span="4">
|
|
|
+ <div class="rule-condition">
|
|
|
+ <el-input
|
|
|
+ :value="getDisplayName(sItem.subtract_param)"
|
|
|
+ placeholder="请选择"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 70px)"
|
|
|
+ readonly
|
|
|
+ @click="openCategoryDialog(index, sIndex, 'subtract')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ style="width: 70px"
|
|
|
+ class="category-select"
|
|
|
+ @click="openCategoryDialog(index, sIndex, 'subtract')"
|
|
|
+ >
|
|
|
+ <i class="el-icon-s-operation" style="margin-right: 5px" />
|
|
|
+ 选择
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="sItem.condition === '减'" :span="3">
|
|
|
+ <el-select
|
|
|
+ v-model="sItem.subtract_condition"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option label="大于" value="gt" />
|
|
|
+ <el-option label="小于" value="lt" />
|
|
|
+ <el-option label="等于" value="eq" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="sItem.condition === '减'" :span="3">
|
|
|
+ <div class="input-with-category">
|
|
|
+ <el-input
|
|
|
+ v-model="sItem.subtract_value"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 70px)"
|
|
|
+ />
|
|
|
+ <el-select
|
|
|
+ v-model="sItem.subtract_value_type"
|
|
|
+ size="small"
|
|
|
+ placeholder="类型"
|
|
|
+ style="width: 70px"
|
|
|
+ class="category-select"
|
|
|
+ >
|
|
|
+ <el-option label="小时" value="hour" />
|
|
|
+ <el-option label="分钟" value="minute" />
|
|
|
+ <el-option label="数值" value="number" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
<el-col :span="2">
|
|
|
<div class="button-group">
|
|
|
<el-button
|
|
@@ -337,13 +424,13 @@
|
|
|
:value="getDisplayName(sItem.param1)"
|
|
|
placeholder="请选择"
|
|
|
size="small"
|
|
|
- style="width: calc(100% - 90px)"
|
|
|
+ style="width: calc(100% - 70px)"
|
|
|
readonly
|
|
|
@click="openCategoryDialog(index, sIndex, 'rule')"
|
|
|
/>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
- style="width: 90px"
|
|
|
+ style="width: 70px"
|
|
|
class="category-select"
|
|
|
@click="openCategoryDialog(index, sIndex, 'rule')"
|
|
|
>
|
|
@@ -429,15 +516,35 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
- <el-col v-else-if="['等于', '不等于', '包含', '不包含'].includes(sItem.condition)" :span="6">
|
|
|
+ <el-col v-else-if="['等于', '不等于', '包含', '不包含', '大于', '小于', '大于等于', '小于等于'].includes(sItem.condition)" :span="6">
|
|
|
<div class="input-with-category">
|
|
|
- <el-input
|
|
|
- v-model="sItem.param2"
|
|
|
- placeholder="请输入"
|
|
|
- size="small"
|
|
|
- style="width: calc(100% - 90px)"
|
|
|
- @input="(value) => handleInput(value, index, sIndex, 'rule')"
|
|
|
- />
|
|
|
+ <template v-if="sItem.hasChildOptions">
|
|
|
+ <el-select
|
|
|
+ v-model="sItem.param2"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ placeholder="请选择"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 90px)"
|
|
|
+ @change="(value) => handleInput(value, index, sIndex, 'rule')"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in sItem.childOptions"
|
|
|
+ :key="option.field"
|
|
|
+ :label="option.field_name"
|
|
|
+ :value="option.field_name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-input
|
|
|
+ v-model="sItem.param2"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 90px)"
|
|
|
+ @input="(value) => handleInput(value, index, sIndex, 'rule')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<el-select
|
|
|
v-model="sItem.categoryType"
|
|
|
size="small"
|
|
@@ -447,14 +554,69 @@
|
|
|
>
|
|
|
<i slot="prefix" class="el-icon-s-operation" />
|
|
|
<el-option
|
|
|
- v-for="item in categories"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="sitem in categories"
|
|
|
+ :key="sitem.value"
|
|
|
+ :label="sitem.label"
|
|
|
+ :value="sitem.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
+ <el-col v-if="sItem.condition === '减'" :span="4">
|
|
|
+ <div class="rule-condition">
|
|
|
+ <el-input
|
|
|
+ :value="getDisplayName(sItem.subtract_param)"
|
|
|
+ placeholder="请选择"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 90px)"
|
|
|
+ readonly
|
|
|
+ @click="openCategoryDialog(index, sIndex, 'subtract')"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ style="width: 90px"
|
|
|
+ class="category-select"
|
|
|
+ @click="openCategoryDialog(index, sIndex, 'subtract')"
|
|
|
+ >
|
|
|
+ <i class="el-icon-s-operation" style="margin-right: 5px" />
|
|
|
+ 选择
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="sItem.condition === '减'" :span="3">
|
|
|
+ <el-select
|
|
|
+ v-model="sItem.subtract_condition"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option label="大于" value="gt" />
|
|
|
+ <el-option label="小于" value="lt" />
|
|
|
+ <el-option label="等于" value="eq" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="sItem.condition === '减'" :span="3">
|
|
|
+ <div class="input-with-category">
|
|
|
+ <el-input
|
|
|
+ v-model="sItem.subtract_value"
|
|
|
+ placeholder="请输入"
|
|
|
+ size="small"
|
|
|
+ style="width: calc(100% - 70px)"
|
|
|
+ />
|
|
|
+ <el-select
|
|
|
+ v-model="sItem.subtract_value_type"
|
|
|
+ size="small"
|
|
|
+ placeholder="类型"
|
|
|
+ style="width: 70px"
|
|
|
+ class="category-select"
|
|
|
+ >
|
|
|
+ <el-option label="小时" value="hour" />
|
|
|
+ <el-option label="分钟" value="minute" />
|
|
|
+ <el-option label="数值" value="number" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
<el-col :span="2">
|
|
|
<div class="button-group">
|
|
|
<el-button
|
|
@@ -768,6 +930,24 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 添加新的对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ title="选择子选项"
|
|
|
+ :visible.sync="childOptionsDialogVisible"
|
|
|
+ width="30%"
|
|
|
+ >
|
|
|
+ <div class="child-options-list">
|
|
|
+ <el-button
|
|
|
+ v-for="option in currentChildOptions"
|
|
|
+ :key="option.field"
|
|
|
+ size="small"
|
|
|
+ @click="handleChildOptionSelect(option)"
|
|
|
+ >
|
|
|
+ {{ option.field_name }}
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -776,6 +956,8 @@ import { add_rule } from '@/api/rule/config'
|
|
|
import { get_all_word_map } from '@/api/dict'
|
|
|
import { get_rule_detail, getSelectFormula } from '@/api/rule/config'
|
|
|
import { edit_word_map } from '@/api/dict'
|
|
|
+import { get_rule_setting_other } from '@/api/rule/config'
|
|
|
+import { get_dict_by_type } from '@/api/rule/config'
|
|
|
|
|
|
export default {
|
|
|
props: {
|
|
@@ -829,7 +1011,17 @@ export default {
|
|
|
{
|
|
|
param1: '',
|
|
|
param2: '',
|
|
|
- condition: '等于'
|
|
|
+ condition: '包含',
|
|
|
+ categoryType: '文本',
|
|
|
+ sx_1: '',
|
|
|
+ sx_2: '',
|
|
|
+ sx_3: '',
|
|
|
+ subtract_param: '',
|
|
|
+ subtract_condition: '',
|
|
|
+ subtract_value: '',
|
|
|
+ subtract_value_type: 'number',
|
|
|
+ hasChildOptions: false,
|
|
|
+ childOptions: []
|
|
|
}
|
|
|
],
|
|
|
custom_basis: [], // 质控依据
|
|
@@ -906,7 +1098,12 @@ export default {
|
|
|
inputVisible: {
|
|
|
bzmc: false,
|
|
|
keyword: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ caseTypeOptions: [], // 病历类型选项
|
|
|
+ qualityTypeOptions: [], // 质控类型选项
|
|
|
+ sceneOptions: [], // 质控场景选项
|
|
|
+ childOptionsDialogVisible: false,
|
|
|
+ currentChildOptions: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -944,6 +1141,7 @@ export default {
|
|
|
if (this.data.row.id) {
|
|
|
this.getDetail(this.data.row.id)
|
|
|
}
|
|
|
+ this.getDropdownData()
|
|
|
},
|
|
|
methods: {
|
|
|
onTest() {
|
|
@@ -965,9 +1163,12 @@ export default {
|
|
|
error_level,
|
|
|
status
|
|
|
} = p.rule
|
|
|
+
|
|
|
+ // 直接使用字符串数组,不需要转换为数字
|
|
|
+ this.ruleForm.department = department || []
|
|
|
+
|
|
|
this.ruleForm.case_type = case_type
|
|
|
this.ruleForm.changjing = changjing.split(',')
|
|
|
- this.ruleForm.department = this.toNumberArray(department)
|
|
|
this.ruleForm.is_not = is_not
|
|
|
this.ruleForm.status = status
|
|
|
this.ruleForm.type = type
|
|
@@ -975,8 +1176,30 @@ export default {
|
|
|
this.ruleForm.score = score
|
|
|
this.ruleForm.description = description
|
|
|
this.ruleForm.object = object.split(',')
|
|
|
- this.ruleForm.rule = this.getQcRule(p.rule_list)
|
|
|
- this.ruleForm.qztj = this.getPreRule(p.rule_list)
|
|
|
+
|
|
|
+ // 获取规则列表并处理 param2
|
|
|
+ const ruleList = this.getQcRule(p.rule_list)
|
|
|
+ ruleList.forEach(rule => {
|
|
|
+ rule.condition_content.forEach(item => {
|
|
|
+ // 如果是字典类型且 param2 是字符串,转换为数组
|
|
|
+ if (item.hasChildOptions && typeof item.param2 === 'string' && item.param2) {
|
|
|
+ item.param2 = item.param2.split(',')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.ruleForm.rule = ruleList
|
|
|
+
|
|
|
+ // 获取前置条件并处理 param2
|
|
|
+ const preRuleList = this.getPreRule(p.rule_list)
|
|
|
+ preRuleList.forEach(rule => {
|
|
|
+ rule.condition_content.forEach(item => {
|
|
|
+ // 如果是字典类型且 param2 是字符串,转换为数组
|
|
|
+ if (item.hasChildOptions && typeof item.param2 === 'string' && item.param2) {
|
|
|
+ item.param2 = item.param2.split(',')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.ruleForm.qztj = preRuleList
|
|
|
})
|
|
|
},
|
|
|
// 找到前置条件
|
|
@@ -988,14 +1211,6 @@ export default {
|
|
|
const rule = list.filter(item => !item.is_pre_condition)
|
|
|
return rule
|
|
|
},
|
|
|
- // string 数组 装 number 数组
|
|
|
- toNumberArray(slist) {
|
|
|
- const alist = []
|
|
|
- slist.map(item => {
|
|
|
- alist.push(Number(item))
|
|
|
- })
|
|
|
- return alist
|
|
|
- },
|
|
|
getSelectFormula() {
|
|
|
getSelectFormula({ lx: 0 }).then(res => {
|
|
|
const { p } = res
|
|
@@ -1037,10 +1252,16 @@ export default {
|
|
|
param1: '',
|
|
|
param2: '',
|
|
|
condition: '包含',
|
|
|
- categoryType: 'text',
|
|
|
+ categoryType: '文本',
|
|
|
sx_1: '',
|
|
|
sx_2: '',
|
|
|
- sx_3: '' // 确保初始化 sx_3
|
|
|
+ sx_3: '',
|
|
|
+ subtract_param: '',
|
|
|
+ subtract_condition: '',
|
|
|
+ subtract_value: '',
|
|
|
+ subtract_value_type: 'number',
|
|
|
+ hasChildOptions: false,
|
|
|
+ childOptions: []
|
|
|
}
|
|
|
]
|
|
|
})
|
|
@@ -1058,7 +1279,13 @@ export default {
|
|
|
categoryType: 'text',
|
|
|
sx_1: '',
|
|
|
sx_2: '',
|
|
|
- sx_3: '' // 确保初始化 sx_3
|
|
|
+ sx_3: '',
|
|
|
+ subtract_param: '',
|
|
|
+ subtract_condition: '',
|
|
|
+ subtract_value: '',
|
|
|
+ subtract_value_type: 'number',
|
|
|
+ hasChildOptions: false,
|
|
|
+ childOptions: []
|
|
|
})
|
|
|
},
|
|
|
// 删除前置条件大框中_条件
|
|
@@ -1070,7 +1297,13 @@ export default {
|
|
|
this.ruleForm.rule[index].condition_content.push({
|
|
|
param1: '',
|
|
|
param2: '',
|
|
|
- condition: '包含'
|
|
|
+ condition: '包含',
|
|
|
+ subtract_param: '',
|
|
|
+ subtract_condition: '',
|
|
|
+ subtract_value: '',
|
|
|
+ subtract_value_type: 'number',
|
|
|
+ hasChildOptions: false,
|
|
|
+ childOptions: []
|
|
|
})
|
|
|
},
|
|
|
// 删除质控逻辑大框中_逻辑
|
|
@@ -1116,7 +1349,14 @@ export default {
|
|
|
},
|
|
|
|
|
|
hasEmptyValues(obj) {
|
|
|
- return Object.values(obj).some(value => !value)
|
|
|
+ return Object.entries(obj).some(([key, value]) => {
|
|
|
+ // 如果是数组(多选的情况),检查数组长度
|
|
|
+ if (Array.isArray(value)) {
|
|
|
+ return value.length === 0
|
|
|
+ }
|
|
|
+ // 其他情况保持原有的空值判断
|
|
|
+ return !value
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 验证前置条件
|
|
@@ -1124,10 +1364,16 @@ export default {
|
|
|
const { qztj } = this.ruleForm
|
|
|
let result = true
|
|
|
const e_index = []
|
|
|
+
|
|
|
if (qztj.length) {
|
|
|
for (let i = 0; i < qztj.length; i++) {
|
|
|
- qztj[i].condition_content.map(item => {
|
|
|
- if (this.hasEmptyValues(item)) {
|
|
|
+ qztj[i].condition_content.forEach(item => {
|
|
|
+ // 检查必填项
|
|
|
+ const isEmpty = !item.param1 ||
|
|
|
+ (Array.isArray(item.param2) ? item.param2.length === 0 : !item.param2) ||
|
|
|
+ !item.condition
|
|
|
+
|
|
|
+ if (isEmpty) {
|
|
|
e_index.push(i + 1)
|
|
|
}
|
|
|
})
|
|
@@ -1154,51 +1400,50 @@ export default {
|
|
|
return result
|
|
|
},
|
|
|
submitForm(formName) {
|
|
|
- console.log(this.ruleForm.object)
|
|
|
this.$refs[formName].validate(async(valid) => {
|
|
|
- const {
|
|
|
- case_type,
|
|
|
- changjing,
|
|
|
- department,
|
|
|
- object,
|
|
|
- type,
|
|
|
- is_not,
|
|
|
- description,
|
|
|
- score,
|
|
|
- error_level,
|
|
|
- status,
|
|
|
- rule_type,
|
|
|
- rule,
|
|
|
- qztj
|
|
|
- } = this.ruleForm
|
|
|
- rule.forEach(ele => {
|
|
|
- ele.condition_content.forEach(i => {
|
|
|
- if (i.condition === '范围') {
|
|
|
- i.param2 = (i.fanwei_1 ? i.fanwei_1 : '') + '-' + (i.fanwei_2 ? i.fanwei_2 : '')
|
|
|
- }
|
|
|
- if (i.condition === '时效') {
|
|
|
- const sx_1 = i.sx_1 ? i.sx_1.join('.') : ''
|
|
|
- const sx_2 = i.sx_2 ? i.sx_2.join('.') : ''
|
|
|
- const sx_3 = i.sx_3
|
|
|
- i.param2 = sx_1 + '-' + (sx_2 + '+' + sx_3)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
if (valid) {
|
|
|
if (this.judgeQZTJ()) {
|
|
|
+ const processConditionContent = (content) => {
|
|
|
+ content.forEach(item => {
|
|
|
+ // 处理多选值
|
|
|
+ if (Array.isArray(item.param2)) {
|
|
|
+ item.param2 = item.param2.join(',')
|
|
|
+ }
|
|
|
+ if (item.condition === '减' && item.subtract_param) {
|
|
|
+ // 组合减法条件的完整表达式
|
|
|
+ const subtractValue = this.getDisplayName(item.subtract_param)
|
|
|
+ if (subtractValue) {
|
|
|
+ // 获取父级字段名
|
|
|
+ const [parentField] = item.subtract_param
|
|
|
+ // 构造 param2 格式: parentField.field
|
|
|
+ item.param2 = `${parentField}.${item.subtract_param[1]}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理前置条件和质控逻辑中的减法条件
|
|
|
+ this.ruleForm.qztj.forEach(item => {
|
|
|
+ processConditionContent(item.condition_content)
|
|
|
+ })
|
|
|
+ this.ruleForm.rule.forEach(item => {
|
|
|
+ processConditionContent(item.condition_content)
|
|
|
+ })
|
|
|
+
|
|
|
+ // 继续原有的提交逻辑
|
|
|
const params = {
|
|
|
- case_type,
|
|
|
- changjing,
|
|
|
- department,
|
|
|
- object,
|
|
|
- type,
|
|
|
- is_not,
|
|
|
- description,
|
|
|
- score,
|
|
|
- error_level,
|
|
|
- status,
|
|
|
- rule_type,
|
|
|
- rule: [...rule, ...qztj]
|
|
|
+ case_type: this.ruleForm.case_type,
|
|
|
+ changjing: this.ruleForm.changjing,
|
|
|
+ department: this.ruleForm.department,
|
|
|
+ object: this.ruleForm.object,
|
|
|
+ type: this.ruleForm.type,
|
|
|
+ is_not: this.ruleForm.is_not,
|
|
|
+ description: this.ruleForm.description,
|
|
|
+ score: this.ruleForm.score,
|
|
|
+ error_level: this.ruleForm.error_level,
|
|
|
+ status: this.ruleForm.status,
|
|
|
+ rule_type: this.ruleForm.rule_type,
|
|
|
+ rule: [...this.ruleForm.rule, ...this.ruleForm.qztj]
|
|
|
}
|
|
|
if (this.data.row.id) {
|
|
|
params.id = this.data.row.id
|
|
@@ -1264,32 +1509,56 @@ export default {
|
|
|
this.currentSubCategories = item.child || []
|
|
|
},
|
|
|
// 选择右侧子类目
|
|
|
- handleSubCategorySelect(category) {
|
|
|
+ handleSubCategorySelect(subItem) {
|
|
|
if (this.currentRuleIndex !== null && this.currentConditionIndex !== null) {
|
|
|
const parentObj = this.objects.find(obj => obj.field_name === this.activeCategory)
|
|
|
const parentField = parentObj ? parentObj.field : ''
|
|
|
|
|
|
if (this.currentSource === 'qztj') {
|
|
|
- // 前置条件
|
|
|
const condition = this.ruleForm.qztj[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
if (condition) {
|
|
|
- condition.param1 = [parentField, category.field]
|
|
|
- condition.field_name = category.field_name
|
|
|
+ condition.param1 = [parentField, subItem.field]
|
|
|
+ condition.field_name = subItem.field_name
|
|
|
+
|
|
|
+ // 检查子数据类型
|
|
|
+ if (subItem.type === 2 && subItem.child && subItem.child.length > 0) {
|
|
|
+ const dictData = subItem.child.find(item => item.type === 4)
|
|
|
+ if (dictData) {
|
|
|
+ condition.hasChildOptions = true
|
|
|
+ // type=4 的情况,获取字典数据
|
|
|
+ get_dict_by_type({
|
|
|
+ table: dictData.field,
|
|
|
+ field: dictData.field_name
|
|
|
+ }).then(res => {
|
|
|
+ if (res?.p) {
|
|
|
+ // 转换数据格式
|
|
|
+ condition.childOptions = res.p.map(item => ({
|
|
|
+ field: item.dep_name,
|
|
|
+ field_name: item.dep_name
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (subItem.child.some(item => item.type === 3)) {
|
|
|
+ // type=3 的情况,直接使用 child 数据
|
|
|
+ condition.hasChildOptions = true
|
|
|
+ condition.childOptions = subItem.child
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} else if (this.currentSource === 'sx_1') {
|
|
|
if (this.currentInputSource === 'qztj') {
|
|
|
// 前置条件的时效
|
|
|
const condition = this.ruleForm.qztj[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
if (condition) {
|
|
|
- condition.sx_1 = [parentField, category.field]
|
|
|
- condition.field_name = category.field_name
|
|
|
+ condition.sx_1 = [parentField, subItem.field]
|
|
|
+ condition.field_name = subItem.field_name
|
|
|
}
|
|
|
} else {
|
|
|
// 质控逻辑的时效
|
|
|
const condition = this.ruleForm.rule[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
if (condition) {
|
|
|
- condition.sx_1 = [parentField, category.field]
|
|
|
- condition.field_name = category.field_name
|
|
|
+ condition.sx_1 = [parentField, subItem.field]
|
|
|
+ condition.field_name = subItem.field_name
|
|
|
}
|
|
|
}
|
|
|
} else if (this.currentSource === 'sx_2') {
|
|
@@ -1297,16 +1566,16 @@ export default {
|
|
|
// 前置条件的时效
|
|
|
const condition = this.ruleForm.qztj[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
if (condition) {
|
|
|
- condition.sx_2 = [parentField, category.field]
|
|
|
- condition.field_name = category.field_name
|
|
|
+ condition.sx_2 = [parentField, subItem.field]
|
|
|
+ condition.field_name = subItem.field_name
|
|
|
this.$set(condition, 'sx_3', '') // 确保 sx_3 是响应式的
|
|
|
}
|
|
|
} else {
|
|
|
// 质控逻辑的时效
|
|
|
const condition = this.ruleForm.rule[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
if (condition) {
|
|
|
- condition.sx_2 = [parentField, category.field]
|
|
|
- condition.field_name = category.field_name
|
|
|
+ condition.sx_2 = [parentField, subItem.field]
|
|
|
+ condition.field_name = subItem.field_name
|
|
|
this.$set(condition, 'sx_3', '') // 确保 sx_3 是响应式的
|
|
|
}
|
|
|
}
|
|
@@ -1314,22 +1583,59 @@ export default {
|
|
|
// 质控逻辑
|
|
|
const condition = this.ruleForm.rule[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
if (condition) {
|
|
|
- condition.param1 = [parentField, category.field]
|
|
|
- condition.field_name = category.field_name
|
|
|
+ condition.param1 = [parentField, subItem.field]
|
|
|
+ condition.field_name = subItem.field_name
|
|
|
+ // 检查是否有 type=4 的子数据
|
|
|
+ if (subItem.type === 2 && subItem.child && subItem.child.length > 0) {
|
|
|
+ const dictData = subItem.child.find(item => item.type === 4)
|
|
|
+ if (dictData) {
|
|
|
+ condition.hasChildOptions = true
|
|
|
+ // type=4 的情况,获取字典数据
|
|
|
+ get_dict_by_type({
|
|
|
+ table: dictData.field,
|
|
|
+ field: dictData.field_name
|
|
|
+ }).then(res => {
|
|
|
+ if (res?.p) {
|
|
|
+ // 转换数据格式
|
|
|
+ condition.childOptions = res.p.map(item => ({
|
|
|
+ field: item.dep_name,
|
|
|
+ field_name: item.dep_name
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (subItem.child.some(item => item.type === 3)) {
|
|
|
+ // type=3 的情况,直接使用 child 数据
|
|
|
+ condition.hasChildOptions = true
|
|
|
+ condition.childOptions = subItem.child
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} else if (this.currentSource === 'custom_basis') {
|
|
|
// 质控依据
|
|
|
const basis = this.ruleForm.rule[this.currentRuleIndex].custom_basis[this.currentConditionIndex]
|
|
|
if (basis) {
|
|
|
- basis.param1 = [parentField, category.field]
|
|
|
- basis.field_name = category.field_name
|
|
|
+ basis.param1 = [parentField, subItem.field]
|
|
|
+ basis.field_name = subItem.field_name
|
|
|
}
|
|
|
} else if (this.currentSource === 'custom_msg') {
|
|
|
// 预警
|
|
|
const msg = this.ruleForm.rule[this.currentRuleIndex].custom_msg
|
|
|
if (msg) {
|
|
|
- msg.param1 = [parentField, category.field]
|
|
|
- msg.field_name = category.field_name
|
|
|
+ msg.param1 = [parentField, subItem.field]
|
|
|
+ msg.field_name = subItem.field_name
|
|
|
+ }
|
|
|
+ } else if (this.currentSource === 'subtract') {
|
|
|
+ // 处理减法时的第二个类目选择
|
|
|
+ if (this.currentInputSource === 'qztj') {
|
|
|
+ const condition = this.ruleForm.qztj[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
+ if (condition) {
|
|
|
+ condition.subtract_param = [parentField, subItem.field]
|
|
|
+ }
|
|
|
+ } else if (this.currentInputSource === 'rule') {
|
|
|
+ const condition = this.ruleForm.rule[this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
+ if (condition) {
|
|
|
+ condition.subtract_param = [parentField, subItem.field]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1405,8 +1711,17 @@ export default {
|
|
|
{
|
|
|
param1: '',
|
|
|
param2: '',
|
|
|
- condition: '等于',
|
|
|
- categoryType: 'text'
|
|
|
+ condition: '包含',
|
|
|
+ categoryType: 'text',
|
|
|
+ sx_1: '',
|
|
|
+ sx_2: '',
|
|
|
+ sx_3: '',
|
|
|
+ subtract_param: '',
|
|
|
+ subtract_condition: '',
|
|
|
+ subtract_value: '',
|
|
|
+ subtract_value_type: 'number',
|
|
|
+ hasChildOptions: false,
|
|
|
+ childOptions: []
|
|
|
}
|
|
|
],
|
|
|
custom_basis: [],
|
|
@@ -1553,6 +1868,61 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ // 获取下拉数据
|
|
|
+ async getDropdownData() {
|
|
|
+ try {
|
|
|
+ // 获取病历类型
|
|
|
+ const caseTypeRes = await get_rule_setting_other({ type: 1 })
|
|
|
+ if (caseTypeRes?.p) {
|
|
|
+ this.caseTypeOptions = caseTypeRes.p.map(item => ({
|
|
|
+ value: item.name, // 使用 name 作为 value
|
|
|
+ label: item.name // 使用 name 作为 label
|
|
|
+ }))
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取质控类型
|
|
|
+ const qualityTypeRes = await get_rule_setting_other({ type: 2 })
|
|
|
+ if (qualityTypeRes?.p) {
|
|
|
+ this.qualityTypeOptions = qualityTypeRes.p.map(item => ({
|
|
|
+ value: item.name,
|
|
|
+ label: item.name
|
|
|
+ }))
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取质控场景
|
|
|
+ const sceneRes = await get_rule_setting_other({ type: 3 })
|
|
|
+ if (sceneRes?.p) {
|
|
|
+ this.sceneOptions = sceneRes.p.map(item => ({
|
|
|
+ value: item.name,
|
|
|
+ label: item.name
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取下拉数据失败:', error)
|
|
|
+ this.$message.error('获取下拉数据失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openChildOptionsDialog(index, sIndex) {
|
|
|
+ const currentItem = this.ruleForm[this.currentInputSource][index].condition_content[sIndex]
|
|
|
+ if (currentItem.param1 && Array.isArray(currentItem.param1)) {
|
|
|
+ const [parentField, field] = currentItem.param1
|
|
|
+ const category = this.objects.find(item => item.field === parentField)
|
|
|
+ const subCategory = category?.child?.find(item => item.field === field)
|
|
|
+
|
|
|
+ if (subCategory?.child && subCategory.child.length > 0) {
|
|
|
+ this.currentChildOptions = subCategory.child
|
|
|
+ this.currentRuleIndex = index
|
|
|
+ this.currentConditionIndex = sIndex
|
|
|
+ // this.currentInputSource = source
|
|
|
+ this.childOptionsDialogVisible = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleChildOptionSelect(option) {
|
|
|
+ const condition = this.ruleForm[this.currentInputSource][this.currentRuleIndex].condition_content[this.currentConditionIndex]
|
|
|
+ condition.param2 = option.field_name
|
|
|
+ this.childOptionsDialogVisible = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1772,4 +2142,19 @@ export default {
|
|
|
.input-container {
|
|
|
width: 100%;
|
|
|
}
|
|
|
+
|
|
|
+.rule-condition {
|
|
|
+ .category-select {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.child-options-list {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 10px;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
</style>
|