|
@@ -135,31 +135,49 @@
|
|
|
<el-input v-model="ruleForm.source" type="textarea" placeholder="请描述指标数据来源条件,比如:诊断包含xxx, 诊断编码是xxx等等" />
|
|
|
</el-form-item>
|
|
|
<el-divider />
|
|
|
- <el-form ref="upFormRef" label-width="180px" :model="sqlForm" class="demo-ruleForm" :size="formSize">
|
|
|
+ <el-form ref="upFormRef" label-width="100px" :model="sqlForm" class="demo-ruleForm" :size="formSize">
|
|
|
<el-row>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="年度周期" prop="cycle">
|
|
|
+ <el-select v-model="cycle" placeholder="请选择年度周期" clearable style="width: 100%" @change="cycleFormat">
|
|
|
+ <el-option v-for="item in reportCycleList" :key="item.reportCycle"
|
|
|
+ :label="item.yearRange" :value="item.reportCycle" selected>
|
|
|
+ <span style="float: left">{{ item.yearRange }}</span>
|
|
|
+ <span
|
|
|
+ style="float: right; padding-left: 4px; color: var(--el-text-color-secondary); font-size: 13px;">{{
|
|
|
+ item.remark }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
<el-form-item label="开始年份">
|
|
|
<el-form-item prop="startTime">
|
|
|
- <el-date-picker v-model="sqlForm.startTime" type="year" aria-label="选择年份" placeholder="选择年份"
|
|
|
- format="YYYY" value-format="YYYY" :disabled="false" />
|
|
|
+ <el-input v-model="sqlForm.startTime" disabled />
|
|
|
</el-form-item>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="6">
|
|
|
<el-form-item label="结束年份">
|
|
|
<el-form-item prop="endTime">
|
|
|
- <el-date-picker v-model="sqlForm.endTime" type="year" aria-label="选择年份" placeholder="选择年份"
|
|
|
- format="YYYY" value-format="YYYY" :disabled="false" />
|
|
|
+ <el-input v-model="sqlForm.endTime" disabled />
|
|
|
</el-form-item>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="4">
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="sqlEdit(ruleFormRef)"> 指标sql编辑</el-button>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="得分填写">
|
|
|
+ <el-form-item prop="zbScore">
|
|
|
+ <el-input v-model="zbScore" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+<!-- <el-col :span="4">-->
|
|
|
+<!-- <el-form-item>-->
|
|
|
+<!-- <el-button type="primary" @click="sqlEdit(ruleFormRef)"> 指标sql编辑</el-button>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
<el-col :span="4">
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="sqlExecute(ruleFormRef)"> 指标运行结果</el-button>
|
|
@@ -180,6 +198,11 @@
|
|
|
<el-button type="primary" @click="queryTargetReportResult()"> 指标结果查询</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="saveTargetReportScore()"> 指标得分保存</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<el-form ref="upFormRef" label-width="180px" :model="sqlForm" class="demo-ruleForm" :size="formSize"
|
|
@@ -261,7 +284,15 @@ import type { FormInstance, FormRules } from 'element-plus'
|
|
|
import { clone } from '@/utils/clone'
|
|
|
import { formatDate } from '@/utils/date'
|
|
|
import { queryDept } from '@/api/public-api'
|
|
|
-import { selectTargetDictById, selectTargetDictTree, saveTargetDict } from '@/api/target-management/target-dict'
|
|
|
+import {
|
|
|
+ selectTargetDictById,
|
|
|
+ selectTargetDictTree,
|
|
|
+ saveTargetDict,
|
|
|
+ selectScoreCycle,
|
|
|
+ updateTargetReportScore,
|
|
|
+ selectTargetReportScore,
|
|
|
+ selectScoreCyclePermissions
|
|
|
+} from '@/api/target-management/target-dict'
|
|
|
import { selectTargetZbReportId } from '@/api/target-management/report-dict'
|
|
|
import { employeeList } from "@/api/zhu-yuan-yi-sheng/pat-info-query"
|
|
|
import {
|
|
@@ -290,6 +321,10 @@ const empList = ref([])
|
|
|
const deptInfoRef = ref()
|
|
|
const opInfoRef = ref()
|
|
|
const reportIdOptions = ref([{ code: '', name: '' }])
|
|
|
+// 年度周期
|
|
|
+const cycle = ref('')
|
|
|
+// 得分
|
|
|
+const zbScore = ref('')
|
|
|
|
|
|
const isSqlEdit = ref(false)
|
|
|
let sqlEditData = ref({
|
|
@@ -320,10 +355,12 @@ const queryParam = reactive({
|
|
|
|
|
|
onMounted(() => {
|
|
|
nextTick(() => {
|
|
|
- qeryTargetDictTree()
|
|
|
+ queryTargetDictTree()
|
|
|
queryTargetZbReportId()
|
|
|
deptMethod('')
|
|
|
empMethod('')
|
|
|
+ // 查询得分年度
|
|
|
+ queryScoreCycle()
|
|
|
})
|
|
|
})
|
|
|
|
|
@@ -346,7 +383,7 @@ const queryTargetZbReportId = () => {
|
|
|
}
|
|
|
|
|
|
// 查询指标字典树
|
|
|
-const qeryTargetDictTree = () => {
|
|
|
+const queryTargetDictTree = () => {
|
|
|
isShowTree.value == true ? false : true
|
|
|
queryParam.id = '';
|
|
|
queryParam.pid = '';
|
|
@@ -358,8 +395,6 @@ const qeryTargetDictTree = () => {
|
|
|
}
|
|
|
|
|
|
// ------ 指标字典新增,修改保存表单开始 ------
|
|
|
-// ruleForm.value.name = '123'
|
|
|
-// ruleForm.name = '21312'
|
|
|
let ruleForm = ref({
|
|
|
id: '', // 指标编码
|
|
|
name: '', // 指标名称
|
|
@@ -477,14 +512,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
saveTargetDict(ruleForm.value).then((res: any) => {
|
|
|
if (res) {
|
|
|
nextTick(() => {
|
|
|
- qeryTargetDictTree()
|
|
|
+ queryTargetDictTree()
|
|
|
|
|
|
if (!isShowForm.value) {
|
|
|
isShowForm.value = true
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- qeryTargetDictTree()
|
|
|
+ queryTargetDictTree()
|
|
|
return
|
|
|
}
|
|
|
});
|
|
@@ -531,6 +566,8 @@ const addForm = (formEl: FormInstance | undefined) => {
|
|
|
sqlForm.childResult = ''
|
|
|
sqlForm.momResult = ''
|
|
|
sqlForm.calcResult = ''
|
|
|
+ cycle.value = ''
|
|
|
+ zbScore.value = ''
|
|
|
}
|
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
@@ -555,6 +592,9 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
|
|
|
formEl.resetFields()
|
|
|
upFormRef.value?.resetFields()
|
|
|
+
|
|
|
+ cycle.value = ''
|
|
|
+ zbScore.value = ''
|
|
|
}
|
|
|
|
|
|
const changeNode = async (formEl: FormInstance | undefined) => {
|
|
@@ -601,8 +641,16 @@ const editForm = (formEl: FormInstance | undefined) => {
|
|
|
// ------ 接收树页面传来的数据 -------
|
|
|
const treeNodeClick = (data: any, node: any, obj: any) => {
|
|
|
if (node.data) {
|
|
|
- sqlForm.startTime = ''
|
|
|
- sqlForm.endTime = ''
|
|
|
+ sqlForm.startTime = '2021'
|
|
|
+ sqlForm.endTime = '2024'
|
|
|
+
|
|
|
+ cycle.value = 'Y1'
|
|
|
+ let params = {
|
|
|
+ id: node.data.id,
|
|
|
+ reportCycle: cycle.value
|
|
|
+ }
|
|
|
+ // 查询指标得分情况
|
|
|
+ queryTargetReportScore(params)
|
|
|
|
|
|
resultList.value = []
|
|
|
if (isShowTargetResult.value === false) {
|
|
@@ -872,9 +920,125 @@ const queryTargetReportResult = () => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+//------------------------------得分设置-------------------
|
|
|
+// 得分年份
|
|
|
+const reportCycleList = ref([])
|
|
|
+const queryScoreCycle = () => {
|
|
|
+ selectScoreCycle()
|
|
|
+ .then((res: any) => {
|
|
|
+ reportCycleList.value = res
|
|
|
+ });
|
|
|
+}
|
|
|
+// 计算得分data
|
|
|
+const scoreData = ref({
|
|
|
+ id: '', // 指标编码
|
|
|
+ pid: '', // 父级编码
|
|
|
+ reportCycle: '',
|
|
|
+ reportScore: '',
|
|
|
+ criterionScore: '',
|
|
|
+ authorId: '',
|
|
|
+ authorName: '',
|
|
|
+})
|
|
|
+// 年度周期变化
|
|
|
+const cycleFormat = () => {
|
|
|
+ let reportCycle = reportCycleList.value.filter((item) => {
|
|
|
+ return item.reportCycle === cycle.value
|
|
|
+ })
|
|
|
+ if(reportCycle){
|
|
|
+ sqlForm.startTime = reportCycle[0].startYear
|
|
|
+ sqlForm.endTime = reportCycle[0].endYear
|
|
|
+ let params = {
|
|
|
+ id: ruleForm.value.id,
|
|
|
+ reportCycle: cycle.value
|
|
|
+ }
|
|
|
+ queryTargetReportScore(params)
|
|
|
+ }
|
|
|
+}
|
|
|
+const saveTargetReportScore = () => {
|
|
|
+ selectScoreCyclePermissions()
|
|
|
+ .then((res: any) => {
|
|
|
+ let permissions = res.permissions
|
|
|
+ if(permissions === 2){
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: "没有权限保存指标周期得分,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ } else if(permissions === 0){
|
|
|
+ callSaveTargetReportScore()
|
|
|
+ } else {
|
|
|
+ callSaveTargetReportScore()
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const callSaveTargetReportScore = () => {
|
|
|
+ if (sqlForm.startTime === '' || sqlForm.endTime === '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "时间选择不全,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (zbScore.value === '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "指标得分为空,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (zbScore.value > ruleForm.value.score) {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "指标得分不能大于指标总分(" + ruleForm.value.score + "),请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 指标编码id
|
|
|
+ scoreData.value.id = ruleForm.value.id;
|
|
|
+ scoreData.value.pid = ruleForm.value.pid;
|
|
|
+ // 年度周期
|
|
|
+ scoreData.value.reportCycle = cycle.value
|
|
|
+ // 指标年度周期得分
|
|
|
+ scoreData.value.reportScore = zbScore.value
|
|
|
+ // 指标标准(得)分
|
|
|
+ scoreData.value.criterionScore = ruleForm.value.score
|
|
|
+
|
|
|
+ updateTargetReportScore(scoreData.value)
|
|
|
+ .then((res: any) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const queryTargetReportScore = (params) => {
|
|
|
+ zbScore.value = ''
|
|
|
+ selectTargetReportScore(params)
|
|
|
+ .then((res: any) => {
|
|
|
+ if(res){
|
|
|
+ zbScore.value = res.reportScore
|
|
|
+ } else {
|
|
|
+ zbScore.value = ''
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
</script>
|
|
|
-<style lang="scss" scoped deep>
|
|
|
-.hd-cl {
|
|
|
+<style lang="scss" scoped>
|
|
|
+:deep(.hd-cl) {
|
|
|
margin-bottom: 1px !important;
|
|
|
}
|
|
|
</style>
|