|
@@ -6,7 +6,7 @@
|
|
|
<el-col :span="16">
|
|
|
<PageLayer>
|
|
|
<template #header class="hd-cl">
|
|
|
- <el-button type="primary" icon="Plus" @click="resetForm(ruleFormRef)"
|
|
|
+ <el-button type="primary" icon="Plus" @click="addForm(ruleFormRef)"
|
|
|
style="margin-left: 10px">新增</el-button>
|
|
|
<el-button type="primary" icon="Edit" @click="editForm(ruleFormRef)"
|
|
|
style="margin-left: 10px">编辑</el-button>
|
|
@@ -98,13 +98,14 @@
|
|
|
<el-input v-model="ruleForm.definition" type="textarea" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="评审方法" prop="method">
|
|
|
- <el-input v-model="ruleForm.method" type="textarea" />
|
|
|
+ <el-input v-model="ruleForm.method" type="textarea" :rows="4" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="计分细则" prop="scoreRule">
|
|
|
<el-input v-model="ruleForm.scoreRule" type="textarea" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="数据来源" prop="source">
|
|
|
- <el-input v-model="ruleForm.source" type="textarea" />
|
|
|
+ <el-form-item label="数据来源条件" prop="source">
|
|
|
+ <el-input v-model="ruleForm.source" type="textarea"
|
|
|
+ placeholder="请描述指标数据来源条件,比如:诊断包含xxx, 诊断编码是xxx等等" />
|
|
|
</el-form-item>
|
|
|
<el-divider />
|
|
|
<el-form ref="ruleFormRef" label-width="120px" :model="sqlForm" class="demo-ruleForm"
|
|
@@ -273,7 +274,7 @@ let ruleForm = $ref({
|
|
|
method: '', // 评审方法
|
|
|
scoreRule: '', // 计分细则
|
|
|
source: '', // 数据来源
|
|
|
- isLeaf: '0', // 是否叶子节点(0:否, 1:是)
|
|
|
+ isLeaf: '1', // 是否叶子节点(0:否, 1:是)
|
|
|
calcChild: '', // 计算-分子
|
|
|
calcMom: '', // 计算-分母
|
|
|
})
|
|
@@ -326,13 +327,13 @@ const rules = $ref<FormRules>({
|
|
|
{ min: 0, max: 48, message: '指标所占比例长度范围0-48个字符', trigger: 'blur' },
|
|
|
],
|
|
|
definition: [
|
|
|
- { required: false, message: '请填写指标定义', trigger: 'blur' },
|
|
|
+ { required: true, message: '请填写指标定义', trigger: 'blur' },
|
|
|
],
|
|
|
method: [
|
|
|
- { required: false, message: '请填写评审方法', trigger: 'blur' },
|
|
|
+ { required: true, message: '请填写评审方法', trigger: 'blur' },
|
|
|
],
|
|
|
scoreRule: [
|
|
|
- { required: false, message: '请填写计分细则', trigger: 'blur' },
|
|
|
+ { required: true, message: '请填写计分细则', trigger: 'blur' },
|
|
|
]
|
|
|
})
|
|
|
|
|
@@ -369,6 +370,44 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const addForm = (formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return
|
|
|
+
|
|
|
+ if (queryParam.id === '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "请选择一个指标!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (queryParam.isLeaf === '1') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "请选择一个父节点指标!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isShowForm.value) {
|
|
|
+ isShowForm.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ formEl.resetFields()
|
|
|
+
|
|
|
+ // 新增自动映射父指标id作为子指标的父id
|
|
|
+ ruleForm.pid = queryParam.id
|
|
|
+ sqlForm.startTime = ''
|
|
|
+ sqlForm.endTime = ''
|
|
|
+ sqlForm.childResult = ''
|
|
|
+ sqlForm.momResult = ''
|
|
|
+ sqlForm.calcResult = ''
|
|
|
+}
|
|
|
+
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return
|
|
|
|
|
@@ -427,7 +466,6 @@ const editForm = (formEl: FormInstance | undefined) => {
|
|
|
// ------ 接收树页面传来的数据 -------
|
|
|
const treeNodeClick = (data: any, node: any, obj: any) => {
|
|
|
if (node.data) {
|
|
|
-
|
|
|
sqlForm.startTime = ''
|
|
|
sqlForm.endTime = ''
|
|
|
sqlForm.childResult = ''
|
|
@@ -442,6 +480,8 @@ const treeNodeClick = (data: any, node: any, obj: any) => {
|
|
|
nextTick(() => {
|
|
|
isShowForm.value = true
|
|
|
ruleForm = clone(res[0])
|
|
|
+ // 获取点击树的是否叶子节点数据
|
|
|
+ queryParam.isLeaf = ruleForm.isLeaf
|
|
|
ruleFormRef.value?.resetFields()
|
|
|
ruleFormRef.value?.clearValidate()
|
|
|
leafRulesChange(ruleFormRef.value)
|
|
@@ -497,7 +537,7 @@ const sqlExecute = (formEl: FormInstance | undefined) => {
|
|
|
if (ruleForm.isLeaf === '0') {
|
|
|
ElMessage({
|
|
|
type: "info",
|
|
|
- message: "不是基础指标,不需要执行sql,请确认!",
|
|
|
+ message: "不是基础指标,不需要执行sql,请确认!",
|
|
|
duration: 2500,
|
|
|
showClose: true,
|
|
|
});
|