This commit is contained in:
Air 2025-03-22 16:19:55 +08:00
parent 7c479bb32e
commit 4ebc8f1102
12 changed files with 736 additions and 360 deletions

View File

@ -263,19 +263,19 @@ export const getQuarterListUpdate= function(date: any) {
//当前月度管理tab
//当前年末管理tab
export const getGroupYear= function(date: any) {
return Http.post('/api/backend/Year/getGroupEvaluation', date)
}
//当前月度管理List
//当前年末管理List
export const getYearUserList= function(date: any) {
return Http.post('/api/backend/Year/getUserList', date)
}
//当前月度用户详情
//当前年末用户详情
export const getYearListFind= function(date: any) {
return Http.post('/api/backend/Year/getMonthlyListFind', date)
}
//当前月度用户科室评价
//当前年末用户科室评价
export const getYearListUpdate= function(date: any) {
return Http.post('/api/backend/Year/getMonthlyListUpdate', date)
}

View File

@ -108,14 +108,7 @@ export default [
name: 'dayEvaluationExamine',
component: () => import('../../views/day_evaluation/examine.vue'),
meta: { title: '加减分审核', requireAuth: true, closable: true },
}
]
}, {
path: '/month_evaluation',
redirect: '/month_evaluation/index',
component: BasicLayout,
meta: { title: '月度考评' },
children: [
},
{
path: '/month_evaluation/index',
name: 'monthEvaluationIndex',
@ -126,14 +119,7 @@ export default [
name: 'monthEvaluationExamine',
component: () => import('../../views/month_evaluation/examine.vue'),
meta: { title: '月度考评管理', closable: true },
}
]
}, {
path: '/season_evaluation',
redirect: '/season_evaluation/index',
component: BasicLayout,
meta: { title: '季度考评' },
children: [
},
{
path: '/season_evaluation/index',
name: 'seasonEvaluationIndex',
@ -146,7 +132,45 @@ export default [
meta: { title: '季度考评管理', closable: true },
}
]
}, {
},
// {
// path: '/month_evaluation',
// redirect: '/month_evaluation/index',
// component: BasicLayout,
// meta: { title: '月度考评' },
// children: [
// {
// path: '/month_evaluation/index',
// name: 'monthEvaluationIndex',
// component: () => import('../../views/month_evaluation/index.vue'),
// meta: { title: '月度考评填报', requireAuth: true, closable: true },
// }, {
// path: '/month_evaluation/examine/:id*',
// name: 'monthEvaluationExamine',
// component: () => import('../../views/month_evaluation/examine.vue'),
// meta: { title: '月度考评管理', closable: true },
// }
// ]
// }, {
// path: '/season_evaluation',
// redirect: '/season_evaluation/index',
// component: BasicLayout,
// meta: { title: '季度考评' },
// children: [
// {
// path: '/season_evaluation/index',
// name: 'seasonEvaluationIndex',
// component: () => import('../../views/season_evaluation/index.vue'),
// meta: { title: '季度考评', requireAuth: true, closable: true },
// }, {
// path: '/season_evaluation/examine/:id*',
// name: 'seasonEvaluationExamine',
// component: () => import('../../views/season_evaluation/examine.vue'),
// meta: { title: '季度考评管理', closable: true },
// }
// ]
// },
{
path: '/outside_evaluation',
redirect: '/outside_evaluation/index',
component: BasicLayout,

View File

@ -111,9 +111,9 @@ const getHierarchicalTwoList = () => {
layer.msg(res.msg, {icon: 2})
}
})
}
}
const getHierarchicalData = () => {
scoringGetHierarchicalData({}).then((res) => {
scoringGetHierarchicalData({page:1,size:1000}).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;

View File

@ -149,12 +149,11 @@ const addButton = ref([
console.log(addData);
if (addData.project_name == '') {
layer.msg('项目名称不能为空!', {icon: 2})
}
if (addData.project_code == '') {
layer.msg('项目代码不能为空!', {icon: 2})
return;
}
if (addData.base_score == '' || addData.base_score == 0) {
layer.msg('基础分值不能为空或为0', {icon: 2, time: 1000})
return;
}
if(addIsEdit.value==1){
var res = await homeGetHierarchicalDataCreate(addData);

View File

@ -281,7 +281,7 @@ const evaluationItems = ref<EvaluationItem[]>([])
const selectedItemTips = ref('')
const getHierarchicalData = () => {
scoringGetHierarchicalData({}).then((res) => {
scoringGetHierarchicalData({page:1,size:1000}).then((res) => {
console.log(res)
if (res.code == 1) {
evaluationItems.value = res.data;

View File

@ -29,7 +29,8 @@
<lay-col :md="6">
<lay-form-item label="考评对象" label-width="120">
<lay-select v-model="userId" :show-search="true" placeholder="请选择" :allowClear="true">
<lay-select-option v-for="item in dataSerSource" :value="item.id" :label="item.nickname"></lay-select-option>
<lay-select-option v-for="item in dataSerSource" :value="item.id"
:label="item.nickname"></lay-select-option>
</lay-select>
</lay-form-item>
</lay-col>
@ -69,16 +70,16 @@
<lay-tag v-if="row.scoringrecord_status == 1" type="primary">已自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 2">未自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 3" type="warm">科室已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 4" type="danger">医院已评</lay-tag>
<!-- <lay-tag v-if="row.scoringrecord_status == 4" type="danger">医院已评</lay-tag> -->
</template>
<template v-slot:nickname="{ row }">
<div style="color: #00A394;cursor: pointer" @click="openUserListShow(row)">{{ row.nickname }}</div>
</template>
<template v-slot:operator="{ row }">
<lay-space>
<span style="color: #00A394;cursor: pointer"
<!-- <span style="color: #00A394;cursor: pointer"
v-if="row.scoringrecord_status == 3 && userStore.userInfo.level == 3"
@click="getInfo(row, 3)">医院评分</span>
@click="getInfo(row, 3)">医院评分</span> -->
<span style="color: #00A394;cursor: pointer" v-if="row.scoringrecord_status == 1"
@click="getInfo(row, 2)">科室评分</span>
<span style="color: #00A394;cursor: pointer" v-if="row.scoringrecord_status != 2"
@ -94,26 +95,28 @@
<lay-container fluid="true" style="padding: 20px">
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6">
<template v-slot:input="{ data, rowIndex }">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.content_score" position="right"></lay-input-number>
<template v-slot:base_score="{ data }">
<div v-if="data.pid == 0">题目分{{ data.base_score }}</div>
<div v-if="data.pid != 0">{{ data.base_score }}</div>
</template>
<template v-slot:ksinput="{ data, rowIndex }">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="addIsInfo != 2" :min="0" :max="data.base_score"
v-model="data.department_score" position="right"></lay-input-number>
<template v-slot:content_score="{ row, column, rowIndex }">
<div v-if="row.pid == 0">已评分{{ row.avg_score ? row.avg_score : 0 }}</div>
<lay-input-number @change="inputChange(row)" v-if="row.pid != 0" :disabled="true" :min="0"
:max="row.base_score" v-model="row.content_score" position="right"></lay-input-number>
</template>
<template v-slot:yyinput="{ data, rowIndex }">
<template v-slot:department_score="{ row, rowIndex }">
<div v-if="row.pid == 0">已评分{{ row.department_score ? row.department_score : 0 }}</div>
<lay-input-number :disabled="addIsInfo==1" @change="inputKsChange(row)" v-if="row.pid != 0" :min="0" :max="row.base_score" v-model="row.department_score"
position="right"></lay-input-number>
</template>
<!-- <template v-slot:yyinput="{ data, rowIndex }">
<template v-if="userStore.userInfo.level == 3 || thisInfo.scoringrecord_status == 4">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="addIsInfo != 3" :min="0" :max="data.base_score"
v-model="data.hospital_score" position="right"></lay-input-number>
</template>
</template>
</template> -->
</lay-table>
</lay-container>
</lay-layer>
@ -151,7 +154,6 @@
<lay-tag v-if="row.scoringrecord_status == 1" type="primary">已自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 2">未自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 3" type="warm">科室已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 4" type="danger">医院已评</lay-tag>
</template>
<template v-slot:operator="{ row }">
<span v-if="row.if == 2" style="color: #00A394;cursor: pointer"
@ -183,11 +185,59 @@ const route = useRoute()
const userStore = useUserStore()
const userId = ref();
onMounted(() => {
if(route.params.id){
if (route.params.id) {
userId.value = parseInt(route.params.id);
}
getLeftList();
})
const inputChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.content_score);
});
//rowindex
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
}
//
const inputKsChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.department_score);
});
dataSource6.value[index].department_score = total;
}
//
const inputListKsShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.department_score);
});
dataSource6.value[index].department_score = total;
});
}
//
const inputListZpShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.content_score);
});
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
});
//rowindex
//dataSource6.value[index].avg_score = total;
//dataSource6.value[index].content_score = total;
}
const userShow = ref(false);
const userColumns = ref([
{ title: '月度', width: '80px', key: 'month', align: 'center' },
@ -195,7 +245,7 @@ const userColumns = ref([
{ title: '参评时间', width: '100px', key: 'createtime', align: 'center' },
{ title: '自评总分', width: '100px', key: 'self_score', align: 'center' },
{ title: '科室评分', width: '100px', key: 'department_score', align: 'center' },
{ title: '医院评分', width: '100px', key: 'hospital_score', align: 'center' },
// { title: '', width: '100px', key: 'hospital_score', align: 'center' },
{ title: '状态', width: '100px', key: 'scoringrecord_status', customSlot: 'scoringrecord_status', align: 'center' },
{ title: '操作', width: '100px', key: 'operator', customSlot: 'operator', align: 'center' },
])
@ -235,15 +285,15 @@ const getMonthlyInfo = (item, type) => {
item.time = item.month;
thisInfo.value = item;
getInfoMode(item);
if (item.scoringrecord_status == 4) {
columns6.push({
title: "医院评分",
width: "100px",
align: 'center',
customSlot: 'yyinput',
key: "yyinput"
});
}
// if (item.scoringrecord_status == 4) {
// columns6.push({
// title: "",
// width: "100px",
// align: 'center',
// customSlot: 'yyinput',
// key: "yyinput"
// });
// }
console.log(columns6);
}
@ -309,15 +359,15 @@ const getInfo = (row, type) => {
thisInfo.value = row;
getInfoMode(row);
if (row.scoringrecord_status == 4 && userStore.userInfo.level != 3) {
columns6.push({
title: "医院评分",
width: "100px",
align: 'center',
customSlot: 'yyinput',
key: "yyinput"
});
}
// if (row.scoringrecord_status == 4 && userStore.userInfo.level != 3) {
// columns6.push({
// title: "",
// width: "100px",
// align: 'center',
// customSlot: 'yyinput',
// key: "yyinput"
// });
// }
}
@ -330,6 +380,8 @@ const getInfoMode = (row) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
inputListZpShow();
inputListKsShow();
} else {
layer.msg(res.msg, { icon: 2 })
}
@ -393,10 +445,10 @@ const columns = ref([
{ title: '考评对象', width: '100px', key: 'nickname', customSlot: 'nickname', align: 'center' },
{ title: '工号', width: '100px', key: 'code', align: 'center' },
{ title: '部门', width: '120px', key: 'group_name', align: 'center' },
{ title: '医院评分', width: '100px', key: 'hospital_score_scoringrecord', align: 'center' },
{ title: '科室评分', width: '100px', key: 'department_score_scoringrecord', align: 'center' },
// { title: '', width: '100px', key: 'hospital_score_scoringrecord', align: 'center' },
{ title: '自评总分', width: '100px', key: 'user_scoringrecord', align: 'center' },
{ title: '自评状态', width: '100px', key: 'scoringrecord_status', customSlot: 'scoringrecord_status', align: 'center' },
{ title: '科室评分', width: '100px', key: 'department_score_scoringrecord', align: 'center' },
{ title: '状态', width: '100px', key: 'scoringrecord_status', customSlot: 'scoringrecord_status', align: 'center' },
{
title: '操作',
width: '180px',
@ -443,23 +495,27 @@ const columns6 = [
},
{
title: "分值",
width: "50px",
width: "80px",
align: 'center',
key: "base_score"
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'input',
key: "input"
customSlot: 'content_score',
key: "content_score",
totalRow: true
},
{
title: "科室评分",
width: "100px",
align: 'center',
customSlot: 'ksinput',
key: "ksinput"
customSlot: 'department_score',
key: "department_score",
totalRow: true
}
]

View File

@ -7,8 +7,7 @@
<lay-row>
<lay-col :md="5">
<lay-form-item label="年度:" label-width="50">
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
allow-clear></lay-date-picker>
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择" allow-clear></lay-date-picker>
</lay-form-item>
</lay-col>
<lay-col :md="4">
@ -27,20 +26,14 @@
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">月度自评列表</span>
<lay-button type="primary" size="sm">导出Excel</lay-button>
</div>
<lay-tab v-model="current1" @change="openTab">
<lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id">
<lay-table
:columns="columns"
:dataSource="dataSource"
:even="true"
height="500px"
size="md"
>
<lay-tab v-model="current1" @change="openTab">
<lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id">
<lay-table :columns="columns" :dataSource="dataSource" :even="true" height="500px" size="lg">
<template v-slot:id="{ data }">
{{ data.id }}
</template>
<template v-slot:department_score="{ data }">
{{ data.department_score==0?'-':data.department_score }}
{{ data.department_score == 0 ? '-' : data.department_score }}
</template>
<template v-slot:username="{ data }">
{{ data.username }}
@ -49,9 +42,9 @@
{{ data.password }}
</template>
<template v-slot:operator="{ data }">
<span style="color: #00A394;cursor: pointer" v-if="data.if_month==1" @click="getMonthlyInfo(data)">详情</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if_month==2"
@click="openZp(data)">开始自评</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if_month == 1"
@click="getMonthlyInfo(data)">详情</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if_month == 2" @click="openZp(data)">开始自评</span>
</template>
</lay-table>
</lay-tab-item>
@ -61,15 +54,19 @@
</lay-col>
</lay-row>
</lay-container>
<lay-layer v-model="visible11" title="月度自评详情" :type="4" :shade="true" :area="['950px','100%']" :btn="addIsInfo==1?addButton:''">
<lay-layer v-model="visible11" title="月度自评详情" :type="4" :shade="true" :area="['950px', '100%']"
:btn="addIsInfo == 1 ? addButton : ''">
<lay-container fluid="true" style="padding: 20px">
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6">
<template v-slot:input="{ data,rowIndex}">
<lay-input-number v-if="data.pid==0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid!=0" :disabled="addIsInfo==2" :min="0" :max="data.base_score" v-model="data.content_score"
position="right"></lay-input-number>
:data-source="dataSource6">
<template v-slot:base_score="{ data }">
<div v-if="data.pid == 0">题目总分{{ data.base_score }}</div>
<div v-if="data.pid != 0">{{ data.base_score }}</div>
</template>
<template v-slot:content_score="{ row, column, rowIndex }">
<div v-if="row.pid == 0">已评总分{{ row.avg_score?row.avg_score:0 }}</div>
<lay-input-number @change="inputChange(row, rowIndex, column)" v-if="row.pid != 0" :disabled="addIsInfo == 2"
:min="0" :max="row.base_score" v-model="row.content_score" position="right"></lay-input-number>
</template>
</lay-table>
</lay-container>
@ -77,40 +74,62 @@
</template>
<script setup lang="ts">
import {ref, onMounted} from 'vue'
import {layer} from '@layui/layer-vue'
import { ref, onMounted } from 'vue'
import { layer } from '@layui/layer-vue'
import {
MonthlyList,
MonthlyContent, MonthlyCreate,MonthlyInfo,userEvaluationData
MonthlyContent, MonthlyCreate, MonthlyInfo, userEvaluationData
} from '../../api/module/home'
import {useUserStore} from "@/store/user";
import { useUserStore } from "@/store/user";
import dayjs from "dayjs";
const current1=ref(1);
const tabList=ref([]);
const current1 = ref(1);
const tabList = ref([]);
const userStore = useUserStore()
const active = ref(-1);
const visible11 = ref(false);
const page = ref({total: 1, limit: 10, current: 1});
const dataSource = ref([]);
const addIsInfo=ref(1);
const addIsInfo = ref(1);
onMounted(() => {
//getMonthlyList();
//getMonthlyContent();
getUserEvaluationData();
})
const openZp = (item) => {
const inputChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.content_score);
});
//rowindex
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
}
//
const inputListZpShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.content_score);
});
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
});
}
const openZp = () => {
visible11.value = true;
addIsInfo.value=1
addIsInfo.value = 1
getMonthlyContent();
}
const openTab = (d) => {
console.log(d)
current1.value=d;
dataSource.value=[];
current1.value = d;
dataSource.value = [];
getMonthlyList();
}
const getUserEvaluationData = () => {
@ -118,22 +137,23 @@ const getUserEvaluationData = () => {
console.log(res)
if (res.code == 1) {
tabList.value = res.data;
current1.value=res.data[0].id;
current1.value = res.data[0].id;
getMonthlyList();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const getMonthlyInfo = (item) => {
visible11.value=true;
addIsInfo.value=2;
MonthlyInfo({'evaluation_schedule_id':current1.value,'user_id': userStore.userInfo.id, 'month': item.month}).then((res) => {
visible11.value = true;
addIsInfo.value = 2;
MonthlyInfo({ 'evaluation_schedule_id': current1.value, 'user_id': userStore.userInfo.id, 'month': item.month }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
inputListZpShow();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
@ -146,26 +166,26 @@ function toSearch() {
const searchAccount = ref(dayjs().year())
function toReset() {
searchAccount.value =dayjs().year()
searchAccount.value = dayjs().year()
}
const getMonthlyList = () => {
MonthlyList({'id': current1.value,time:searchAccount.value}).then((res) => {
MonthlyList({ 'id': current1.value, time: searchAccount.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource.value = res.data;
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const dataSource6 = ref([]);
const getMonthlyContent = () => {
MonthlyContent({'id': current1.value}).then((res) => {
MonthlyContent({ 'id': current1.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
@ -179,21 +199,24 @@ const columns6 = [
title: "分值",
width: "100px",
align: 'center',
key: "base_score"
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'input',
key: "input"
customSlot: 'content_score',
key: "content_score",
totalRow: true
}
]
const columns = [
{
title: '月度',
width: '100px',
width: '120px',
align: 'center',
key: 'month'
},
@ -205,7 +228,7 @@ const columns = [
},
{
title: '参评时间',
width: '180px',
width: '250px',
align: 'center',
key: 'createtime'
},
@ -219,11 +242,11 @@ const columns = [
customSlot: 'department_score',
align: 'center',
},
{
title: '医院评分',
key: 'hospital_score',
align: 'center',
},
// {
// title: '',
// key: 'hospital_score',
// align: 'center',
// },
{
title: '操作',
width: '180px',
@ -241,15 +264,15 @@ const addButton = ref([
text: "确认",
callback: async () => {
var json = JSON.stringify(dataSource6.value);
var res = await MonthlyCreate({'json': json,'user_id': userStore.userInfo.id,evaluation_schedule_id: current1.value});
var res = await MonthlyCreate({ 'json': json, 'user_id': userStore.userInfo.id, evaluation_schedule_id: current1.value });
console.log(res)
if (res.code == 1) {
layer.msg('提交成功!', {icon: 1})
layer.msg('提交成功!', { icon: 1 })
visible11.value = false;
getMonthlyList();
//getMonthlyContent();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
}
},

View File

@ -84,29 +84,23 @@
</div>
</div>
<lay-layer v-model="infoShow" title="自评详情" :type="4" :shade="true" :area="['950px', '100%']"
:btn="addIsInfo != 1 ? addButton : ''">
:btn="addIsInfo != 1 ? addButton : ''">
<lay-container fluid="true" style="padding: 20px">
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6">
<template v-slot:input="{ data, rowIndex }">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.content_score" position="right"></lay-input-number>
<template v-slot:base_score="{ data }">
<div v-if="data.pid == 0">题目分{{ data.base_score }}</div>
<div v-if="data.pid != 0">{{ data.base_score }}</div>
</template>
<template v-slot:ksinput="{ data, rowIndex }">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="addIsInfo != 2" :min="0" :max="data.base_score"
v-model="data.department_score" position="right"></lay-input-number>
<template v-slot:content_score="{ row, column, rowIndex }">
<div v-if="row.pid == 0">已评分{{ row.avg_score ? row.avg_score : 0 }}</div>
<lay-input-number @change="inputChange(row)" v-if="row.pid != 0" :disabled="true" :min="0"
:max="row.base_score" v-model="row.content_score" position="right"></lay-input-number>
</template>
<template v-slot:yyinput="{ data, rowIndex }">
<template v-if="userStore.userInfo.level == 3 || thisInfo.scoringrecord_status == 4">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="addIsInfo != 3" :min="0" :max="data.base_score"
v-model="data.hospital_score" position="right"></lay-input-number>
</template>
<template v-slot:department_score="{ row, rowIndex }">
<div v-if="row.pid == 0">已评分{{ row.department_score ? row.department_score : 0 }}</div>
<lay-input-number :disabled="addIsInfo==1" @change="inputKsChange(row)" v-if="row.pid != 0" :min="0" :max="row.base_score" v-model="row.department_score"
position="right"></lay-input-number>
</template>
</lay-table>
</lay-container>
@ -203,6 +197,51 @@ const openUserListShow = (row) => {
userShow.value = true;
getUserListInfo();
}
const inputChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.content_score);
});
//rowindex
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
}
//
const inputKsChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.department_score);
});
dataSource6.value[index].department_score = total;
}
//
const inputListKsShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.department_score);
});
dataSource6.value[index].department_score = total;
});
}
//
const inputListZpShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.content_score);
});
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
});
}
const getUserListInfo = () => {
getQuarterlyFindData({
'user_id': userInfo.value.id,
@ -298,15 +337,15 @@ const getInfo = (row, type) => {
console.log(row);
thisInfo.value = row;
getInfoMode(row);
if (row.scoringrecord_status == 4 && userStore.userInfo.level != 3) {
columns6.push({
title: "医院评分",
width: "100px",
align: 'center',
customSlot: 'yyinput',
key: "yyinput"
});
}
// if (row.scoringrecord_status == 4 && userStore.userInfo.level != 3) {
// columns6.push({
// title: "",
// width: "100px",
// align: 'center',
// customSlot: 'yyinput',
// key: "yyinput"
// });
// }
}
@ -319,6 +358,8 @@ const getInfoMode = (row) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
inputListZpShow();
inputListKsShow();
} else {
layer.msg(res.msg, { icon: 2 })
}
@ -441,35 +482,39 @@ const columns6 = [
},
{
title: "分值",
width: "100px",
width: "80px",
align: 'center',
key: "base_score"
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'input',
key: "input"
customSlot: 'content_score',
key: "content_score",
totalRow: true
},
{
title: "科室评分",
width: "100px",
align: 'center',
customSlot: 'ksinput',
key: "ksinput"
customSlot: 'department_score',
key: "department_score",
totalRow: true
}
]
//
if (userStore.userInfo.level == 3) {
columns6.push({
title: "医院评分",
width: "100px",
align: 'center',
customSlot: 'yyinput',
key: "yyinput"
});
}
// if (userStore.userInfo.level == 3) {
// columns6.push({
// title: "",
// width: "100px",
// align: 'center',
// customSlot: 'yyinput',
// key: "yyinput"
// });
// }
const dataSource6 = ref([])
</script>

View File

@ -7,8 +7,7 @@
<lay-row>
<lay-col :md="5">
<lay-form-item label="年度:" label-width="50">
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
allow-clear></lay-date-picker>
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择" allow-clear></lay-date-picker>
</lay-form-item>
</lay-col>
<lay-col :md="4">
@ -27,21 +26,15 @@
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">季度自评列表</span>
<lay-button type="primary" size="sm">导出Excel</lay-button>
</div>
<lay-tab v-model="current1" @change="openTab">
<lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id"></lay-tab-item>
<lay-tab v-model="current1" @change="openTab">
<lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id"></lay-tab-item>
</lay-tab>
<lay-table
:columns="columns"
:dataSource="dataSource"
:even="true"
height="500px"
size="md"
>
<lay-table :columns="columns" :dataSource="dataSource" :even="true" height="500px" size="lg">
<template v-slot:id="{ data }">
{{ data.id }}
</template>
<template v-slot:department_score="{ data }">
{{ data.department_score==0?'-':data.department_score }}
{{ data.department_score == 0 ? '-' : data.department_score }}
</template>
<template v-slot:username="{ data }">
{{ data.username }}
@ -50,24 +43,27 @@
{{ data.password }}
</template>
<template v-slot:operator="{ data }">
<span style="color: #00A394;cursor: pointer" v-if="data.if==2" @click="getMonthlyInfo(data)">详情</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if==1"
@click="insZp(data)">开始自评</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if == 2" @click="getMonthlyInfo(data)">详情</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if == 1" @click="insZp(data)">开始自评</span>
</template>
</lay-table>
</lay-card>
</lay-col>
</lay-row>
</lay-container>
<lay-layer v-model="visible11" title="季度自评" :type="4" :shade="true" :area="['950px','100%']" :btn="addIsInfo==1?addButton:''">
<lay-layer v-model="visible11" title="季度自评" :type="4" :shade="true" :area="['950px', '100%']"
:btn="addIsInfo == 1 ? addButton : ''">
<lay-container fluid="true" style="padding: 20px">
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6">
<template v-slot:input="{ data,rowIndex}">
<lay-input-number v-if="data.pid==0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid!=0" :disabled="addIsInfo==2" :min="0" :max="data.base_score" v-model="data.content_score"
position="right"></lay-input-number>
:data-source="dataSource6">
<template v-slot:base_score="{ data }">
<div v-if="data.pid == 0">题目总分{{ data.base_score }}</div>
<div v-if="data.pid != 0">{{ data.base_score }}</div>
</template>
<template v-slot:content_score="{ row, column, rowIndex }">
<div v-if="row.pid == 0">已评总分{{ row.avg_score ? row.avg_score : 0 }}</div>
<lay-input-number @change="inputChange(row, rowIndex, column)" v-if="row.pid != 0" :disabled="addIsInfo == 2"
:min="0" :max="row.base_score" v-model="row.content_score" position="right"></lay-input-number>
</template>
</lay-table>
</lay-container>
@ -75,36 +71,60 @@
</template>
<script setup lang="ts">
import {ref, onMounted} from 'vue'
import {layer} from '@layui/layer-vue'
import { ref, onMounted } from 'vue';
import { layer } from '@layui/layer-vue';
import {
QuarterList, QuarterContent, QuarterCreate, QuarterInfo, userEvaluationData, userQuarterData
} from '../../api/module/home'
import {useUserStore} from "@/store/user";
QuarterList, QuarterContent, QuarterCreate, QuarterInfo, userQuarterData
} from '../../api/module/home';
import { useUserStore } from "@/store/user";
import dayjs from "dayjs";
const current1=ref(1);
const tabList=ref([]);
const current1 = ref(1);
const tabList = ref([]);
const userStore = useUserStore()
const active = ref(-1);
const visible11 = ref(false);
const page = ref({total: 100, limit: 10, current: 2});
const page = ref({ total: 100, limit: 10, current: 2 });
const dataSource = ref([]);
const addIsInfo=ref(1);
const addIsInfo = ref(1);
const quarterName=ref('');
const quarterName = ref('');
onMounted(() => {
//getQuarterList();
//getQuarterContent();
getUserEvaluationData();
})
const inputChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.content_score);
});
//rowindex
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
}
//
const inputListZpShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.content_score);
});
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
});
}
const openTab = (d) => {
console.log(d)
current1.value=d;
dataSource.value=[];
current1.value = d;
dataSource.value = [];
getQuarterList();
}
const getUserEvaluationData = () => {
@ -112,49 +132,50 @@ const getUserEvaluationData = () => {
console.log(res)
if (res.code == 1) {
tabList.value = res.data;
current1.value=res.data[0].id;
current1.value = res.data[0].id;
getQuarterList();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const insZp = (item) => {
visible11.value = true;
addIsInfo.value=1;
quarterName.value=item.quarter;
addIsInfo.value = 1;
quarterName.value = item.quarter;
getQuarterContent();
}
const getMonthlyInfo = (item) => {
visible11.value=true;
addIsInfo.value=2;
QuarterInfo({'user_id': userStore.userInfo.id, 'quarter': item.quarter,'evaluation_schedule_id':current1.value}).then((res) => {
visible11.value = true;
addIsInfo.value = 2;
QuarterInfo({ 'user_id': userStore.userInfo.id, 'quarter': item.quarter, 'evaluation_schedule_id': current1.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
inputListZpShow();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const getQuarterList = () => {
QuarterList({'id': current1.value,time:searchAccount.value}).then((res) => {
QuarterList({ 'id': current1.value, time: searchAccount.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource.value = res.data;
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const dataSource6 = ref([]);
const getQuarterContent = () => {
QuarterContent({'id': current1.value}).then((res) => {
QuarterContent({ 'id': current1.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
@ -168,21 +189,23 @@ const columns6 = [
title: "分值",
width: "100px",
align: 'center',
key: "base_score"
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'input',
key: "input"
customSlot: 'content_score',
key: "content_score",
totalRow: true
}
]
const columns = [
{
title: '季度',
width: '100px',
width: '120px',
align: 'center',
key: 'quarter'
},
@ -194,7 +217,7 @@ const columns = [
},
{
title: '参评时间',
width: '180px',
width: '250px',
align: 'center',
key: 'createtime'
},
@ -207,11 +230,12 @@ const columns = [
key: 'department_score',
customSlot: 'department_score',
align: 'center',
}, {
title: '医院评分',
key: 'hospital_score',
align: 'center',
},
// {
// title: '',
// key: 'hospital_score',
// align: 'center',
// },
{
title: '操作',
width: '180px',
@ -231,22 +255,22 @@ function toSearch() {
const searchAccount = ref(dayjs().year())
function toReset() {
searchAccount.value =dayjs().year()
searchAccount.value = dayjs().year()
}
const addButton = ref([
{
text: "确认",
callback: async () => {
var json = JSON.stringify(dataSource6.value);
var res = await QuarterCreate({'evaluation_schedule_id':current1.value,'term':quarterName.value,'json': json,'user_id': userStore.userInfo.id});
var res = await QuarterCreate({ 'evaluation_schedule_id': current1.value, 'term': quarterName.value, 'json': json, 'user_id': userStore.userInfo.id });
console.log(res)
if (res.code == 1) {
layer.msg('提交成功!', {icon: 1})
layer.msg('提交成功!', { icon: 1 })
visible11.value = false;
getQuarterList();
//getQuarterContent();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
}
},

View File

@ -48,8 +48,8 @@
{{ data.password }}
</template>
<template v-slot:level="{ data }">
<span v-if="data.level == 1" style="color: #FF9933">
审核
<span v-if="data.level == 1" style="color: #FF0033">
审核
</span>
<span v-if="data.level == 2" style="color: #00A394">
普通员工
@ -57,6 +57,12 @@
<span v-if="data.level == 3" style="color: #FF0033">
院级审核
</span>
<span v-if="data.level == 4" style="color: #FF0033">
支部审核
</span>
<span v-if="data.level == 5" style="color: #FF0033">
总党支审核
</span>
</template>
<template v-slot:operator="{ data }">
<lay-space>
@ -85,8 +91,10 @@
<lay-form-item label="审核权限" prop="level">
<lay-radio-group v-model="addData.level">
<lay-radio value="2">普通员工</lay-radio>
<lay-radio value="1">审核</lay-radio>
<lay-radio value="1">审核</lay-radio>
<lay-radio value="3">院级审核</lay-radio>
<lay-radio value="4">支部审核</lay-radio>
<lay-radio value="5">总党支审核</lay-radio>
</lay-radio-group>
</lay-form-item>
<lay-form-item label="角色权限" prop="desc">

View File

@ -50,10 +50,13 @@
<lay-table :page="page" height="600px" :columns="columns" :loading="loading" :data-source="dataSource"
v-model:selected-keys="selectedKeys" @change="change">
<template v-slot:scoringrecord_status="{ row }">
<!-- 1.已自评 2.未自评 3.科室已评 4.医院已评 5.支部已评 6.总党支已评 -->
<lay-tag v-if="row.scoringrecord_status == 1" type="primary">已自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 2">未自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 3" type="warm">科室已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 4" type="danger">医院已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 2">未自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 3" type="warm">科室已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 4" type="normal">医院已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 5" color="blue">支部已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 6" color="#000033">总党支已评 </lay-tag>
</template>
<template v-slot:nickname="{ row }">
<div style="color: #00A394;cursor: pointer" @click="openUserListShow(row)">{{ row.nickname }}</div>
@ -61,8 +64,11 @@
<template v-slot:operator="{ row }">
<lay-space>
<span style="color: #00A394;cursor: pointer"
v-if="row.scoringrecord_status == 3 && userStore.userInfo.level == 3"
@click="getInfo(row, 3)">医院评分</span>
v-if="row.scoringrecord_status == 5 && userStore.userInfo.level == 5"
@click="getInfo(row, 4)">总党支评分</span>
<span style="color: #00A394;cursor: pointer"
v-if="row.scoringrecord_status == 3 && userStore.userInfo.level == 4"
@click="getInfo(row, 3)">支部评分</span>
<span style="color: #00A394;cursor: pointer" v-if="row.scoringrecord_status == 1 && userStore.userInfo.level == 1"
@click="getInfo(row, 2)">科室评分</span>
<span style="color: #00A394;cursor: pointer" v-if="row.scoringrecord_status != 2"
@ -73,30 +79,38 @@
</lay-table>
</div>
</div>
<lay-layer v-model="infoShow" title="自评详情" :type="4" :shade="true" :area="['950px', '100%']"
<lay-layer @close="layerEnd" v-model="infoShow" title="自评详情" :type="4" :shade="true" :area="['950px', '100%']"
:btn="addIsInfo != 1 ? addButton : ''">
<lay-container fluid="true" style="padding: 20px">
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6">
<template v-slot:input="{ data, rowIndex }">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.content_score" position="right"></lay-input-number>
<template v-slot:base_score="{ data }">
<div v-if="data.pid == 0">题目分{{ data.base_score }}</div>
<div v-if="data.pid != 0">{{ data.base_score }}</div>
</template>
<template v-slot:ksinput="{ data, rowIndex }">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="addIsInfo != 2" :min="0" :max="data.base_score"
v-model="data.department_score" position="right"></lay-input-number>
<!-- 自评评分 -->
<template v-slot:content_score="{ row}">
<div v-if="row.pid == 0">已评分{{ row.avg_score ? row.avg_score : 0 }}</div>
<lay-input-number @change="inputChange(row)" v-if="row.pid != 0" :disabled="true" :min="0"
:max="row.base_score" v-model="row.content_score" position="right"></lay-input-number>
</template>
<template v-slot:yyinput="{ data, rowIndex }">
<template v-if="userStore.userInfo.level == 3 || thisInfo.scoringrecord_status == 4">
<lay-input-number v-if="data.pid == 0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid != 0" :disabled="addIsInfo != 3" :min="0" :max="data.base_score"
v-model="data.hospital_score" position="right"></lay-input-number>
</template>
<!-- 科室评分 -->
<template v-slot:department_score="{ row }">
<div v-if="row.pid == 0">已评分{{ row.department_score ? row.department_score : 0 }}</div>
<lay-input-number :disabled="addIsInfo==1 || thisInfo.scoringrecord_status != 3" @change="inputKsChange(row)" v-if="row.pid != 0" :min="0" :max="row.base_score" v-model="row.department_score"
position="right"></lay-input-number>
</template>
<!-- 支部评分 -->
<template v-slot:party_branch_score="{ row }">
<div v-if="row.pid == 0">已评分{{ row.party_branch_score ? row.party_branch_score : 0 }}</div>
<lay-input-number :disabled="addIsInfo==1 || thisInfo.scoringrecord_status != 4" @change="inputZbChange(row)" v-if="row.pid != 0" :min="0" :max="row.base_score" v-model="row.party_branch_score"
position="right"></lay-input-number>
</template>
<!-- 党总支评分 -->
<template v-slot:overall_party_score="{ row }">
<div v-if="row.pid == 0">已评分{{ row.overall_party_score ? row.overall_party_score : 0 }}</div>
<lay-input-number :disabled="addIsInfo==1 || thisInfo.scoringrecord_status != 5" @change="inputZdzChange(row)" v-if="row.pid != 0" :min="0" :max="row.base_score" v-model="row.overall_party_score"
position="right"></lay-input-number>
</template>
</lay-table>
</lay-container>
@ -133,7 +147,9 @@
<lay-tag v-if="row.scoringrecord_status == 1" type="primary">已自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 2">未自评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 3" type="warm">科室已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 4" type="danger">医院已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 4" type="normal">医院已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 5" color="blue">支部已评</lay-tag>
<lay-tag v-if="row.scoringrecord_status == 6" color="#000033">总党支已评 </lay-tag>
</template>
<template v-slot:operator="{ row }">
<span v-if="row.if == 2" style="color: #00A394;cursor: pointer"
@ -169,7 +185,92 @@ onMounted(() => {
}
getLeftList();
})
const inputChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.content_score);
});
//rowindex
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
}
//
const inputKsChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.department_score);
});
dataSource6.value[index].department_score = total;
}
//
const inputZbChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.party_branch_score);
});
dataSource6.value[index].party_branch_score = total;
}
//
const inputListZbShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.party_branch_score);
});
dataSource6.value[index].party_branch_score = total;
});
}
//
const inputZdzChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.overall_party_score);
});
dataSource6.value[index].overall_party_score = total;
}
//
const inputListZdzShow = () => {
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.overall_party_score);
});
dataSource6.value[index].overall_party_score = total;
});
}
//
const inputListKsShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.department_score);
});
dataSource6.value[index].department_score = total;
});
}
//
const inputListZpShow = () => {
//dataSource6children
dataSource6.value.forEach((item, index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.content_score);
});
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
});
}
const userShow = ref(false);
const userColumns = ref([
{ title: '年度', width: '80px', key: 'year', align: 'center' },
@ -279,16 +380,52 @@ const getInfo = (row, type) => {
console.log(row);
thisInfo.value = row;
getInfoMode(row);
if (row.scoringrecord_status == 4 && userStore.userInfo.level !=3 ) {
columns6.push({
title: "医院评分",
if (row.scoringrecord_status == 3 && userStore.userInfo.level ==4 ) {
columns6.value.push({
title: "支部评分",
width: "100px",
align: 'center',
customSlot: 'yyinput',
key: "yyinput"
customSlot: 'party_branch_score',
key: "party_branch_score",
totalRow: true
});
}
if (row.scoringrecord_status == 5 && userStore.userInfo.level ==5 ) {
columns6.value.push({
title: "支部评分",
width: "100px",
align: 'center',
customSlot: 'party_branch_score',
key: "party_branch_score",
totalRow: true
});
columns6.value.push({
title: "总党支评分",
width: "100px",
align: 'center',
customSlot: 'overall_party_score',
key: "overall_party_score",
totalRow: true
});
}
if (row.scoringrecord_status == 6 ) {
columns6.value.push({
title: "支部评分",
width: "100px",
align: 'center',
customSlot: 'party_branch_score',
key: "party_branch_score",
totalRow: true
});
columns6.value.push({
title: "总党支评分",
width: "100px",
align: 'center',
customSlot: 'overall_party_score',
key: "overall_party_score",
totalRow: true
});
}
}
const getInfoMode = (row) => {
getYearListFind({
@ -299,6 +436,10 @@ const getInfoMode = (row) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
inputListZpShow();
inputListKsShow();
inputListZbShow();
inputListZdzShow();
} else {
layer.msg(res.msg, { icon: 2 })
}
@ -370,9 +511,11 @@ const columns = ref([
{ title: '考评对象', width: '100px', key: 'nickname', customSlot: 'nickname', align: 'center' },
{ title: '工号', width: '100px', key: 'code', align: 'center' },
{ title: '部门', width: '120px', key: 'group_name', align: 'center' },
{ title: '医院评分', width: '100px', key: 'hospital_score_scoringrecord', align: 'center' },
{ title: '科室评分', width: '100px', key: 'department_score_scoringrecord', align: 'center' },
{ title: '自评总分', width: '100px', key: 'user_scoringrecord', align: 'center' },
{ title: '科室评分', width: '100px', key: 'department_score_scoringrecord', align: 'center' },
{ title: '党支部评分', width: '100px', key: 'party_score_scoringrecord', align: 'center' },
{ title: '党总支评分', width: '100px', key: 'overall_score_scoringrecord', align: 'center' },
{ title: '医院评分', width: '100px', key: 'hospital_score_scoringrecord', align: 'center' },
{ title: '自评状态', width: '100px', key: 'scoringrecord_status', customSlot: 'scoringrecord_status', align: 'center' },
{
title: '操作',
@ -389,6 +532,7 @@ const addButton = ref([
callback: async () => {
var json = JSON.stringify(dataSource6.value);
var res = await getYearListUpdate({
'type': thisInfo.value.scoringrecord_status,
'term': thisInfo.value.time,
'json': json,
'user_id': thisInfo.value.id,
@ -412,44 +556,82 @@ const addButton = ref([
}
}
])
const columns6 = [
{
const columns6 = ref([
{
title: "考评项目",
width: "300px",
key: "project_name"
},
{
title: "分值",
width: "100px",
width: "80px",
align: 'center',
key: "base_score"
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'input',
key: "input"
customSlot: 'content_score',
key: "content_score",
totalRow: true
},
{
title: "科室评分",
width: "100px",
align: 'center',
customSlot: 'ksinput',
key: "ksinput"
customSlot: 'department_score',
key: "department_score",
totalRow: true
}
]
])
//
if (userStore.userInfo.level == 3) {
columns6.push({
title: "医院评分",
// if (userStore.userInfo.level == 4) {
// columns6.push({
// title: "",
// width: "100px",
// align: 'center',
// customSlot: 'yyinput',
// key: "yyinput"
// });
// }
const dataSource6 = ref([])
const layerEnd = () => {
console.log('layerEnd')
columns6.value = [
{
title: "考评项目",
width: "300px",
key: "project_name"
},
{
title: "分值",
width: "80px",
align: 'center',
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'yyinput',
key: "yyinput"
});
customSlot: 'content_score',
key: "content_score",
totalRow: true
},
{
title: "科室评分",
width: "100px",
align: 'center',
customSlot: 'department_score',
key: "department_score",
totalRow: true
}
];
}
const dataSource6 = ref([])
</script>
<style>

View File

@ -7,8 +7,7 @@
<lay-row>
<lay-col :md="5">
<lay-form-item label="年度:" label-width="50">
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
allow-clear></lay-date-picker>
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择" allow-clear></lay-date-picker>
</lay-form-item>
</lay-col>
<lay-col :md="4">
@ -27,20 +26,14 @@
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">年度自评列表</span>
<lay-button type="primary" size="sm">导出Excel</lay-button>
</div>
<lay-tab v-model="current1" @change="openTab">
<lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id">
<lay-table
:columns="columns"
:dataSource="dataSource"
:even="true"
height="500px"
size="md"
>
<lay-tab v-model="current1" @change="openTab">
<lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id">
<lay-table :columns="columns" :dataSource="dataSource" :even="true" height="500px" size="lg">
<template v-slot:id="{ data }">
{{ data.id }}
</template>
<template v-slot:department_score="{ data }">
{{ data.department_score==0?'-':data.department_score }}
{{ data.department_score == 0 ? '-' : data.department_score }}
</template>
<template v-slot:username="{ data }">
{{ data.username }}
@ -49,9 +42,10 @@
{{ data.password }}
</template>
<template v-slot:operator="{ data }">
<span style="color: #00A394;cursor: pointer" v-if="data.if_period==1" @click="getMonthlyInfo(data)">详情</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if_period==2"
@click="insZp(data)">开始自评</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if_period == 1"
@click="getMonthlyInfo(data)">详情</span>
<span style="color: #00A394;cursor: pointer" v-if="data.if_period == 2"
@click="insZp(data)">开始自评</span>
</template>
</lay-table>
</lay-tab-item>
@ -61,34 +55,19 @@
</lay-col>
</lay-row>
</lay-container>
<lay-layer v-model="visible11" title="月度自评详情" :type="4" :shade="true" :area="['950px','100%']" :btn="addIsInfo==1?addButton:''">
<lay-layer v-model="visible11" title="年末自评" :type="4" :shade="true" :area="['950px', '100%']"
:btn="addIsInfo == 1 ? addButton : ''">
<lay-container fluid="true" style="padding: 20px">
<lay-card shadow="always">
<div style="height: 70px;width: 100%;">
<lay-step current-status="primary" style="margin: 0 auto" direction="horizontal" :active="active" space="100%"
:center="true">
<lay-step-item>
<template v-slot:default>
<div style="font-size: 18px;font-weight: bold;color: #009688">个人自评</div>
<!-- <div style="color: #999999">2025-01-01 14:35:33</div>-->
</template>
</lay-step-item>
<lay-step-item>
<template v-slot:default>
<div style="font-size: 18px;font-weight: bold;color: #009688">科室考评</div>
<div style="color: #999999"></div>
</template>
</lay-step-item>
</lay-step>
</div>
</lay-card>
<lay-table :default-expand-all="true" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6">
<template v-slot:input="{ data,rowIndex}">
<lay-input-number v-if="data.pid==0" :disabled="true" :min="0" :max="data.base_score"
v-model="data.base_score" position="right"></lay-input-number>
<lay-input-number v-if="data.pid!=0" :disabled="addIsInfo==2" :min="0" :max="data.base_score" v-model="data.content_score"
position="right"></lay-input-number>
:data-source="dataSource6">
<template v-slot:base_score="{ data }">
<div v-if="data.pid == 0">题目总分{{ data.base_score }}</div>
<div v-if="data.pid != 0">{{ data.base_score }}</div>
</template>
<template v-slot:content_score="{ row, column, rowIndex }">
<div v-if="row.pid == 0">已评总分{{ row.avg_score?row.avg_score:0 }}</div>
<lay-input-number @change="inputChange(row, rowIndex, column)" v-if="row.pid != 0" :disabled="addIsInfo == 2"
:min="0" :max="row.base_score" v-model="row.content_score" position="right"></lay-input-number>
</template>
</lay-table>
</lay-container>
@ -96,88 +75,112 @@
</template>
<script setup lang="ts">
import {ref, onMounted} from 'vue'
import {layer} from '@layui/layer-vue'
import { ref, onMounted } from 'vue'
import { layer } from '@layui/layer-vue'
import {
YearList,
YearContent, YearCreate, YearInfo, userYearData
} from '../../api/module/home'
import {useUserStore} from "@/store/user";
import { useUserStore } from "@/store/user";
import dayjs from "dayjs";
const current1=ref(1);
const tabList=ref([]);
const current1 = ref(1);
const tabList = ref([]);
const userStore = useUserStore()
const active = ref(-1);
const visible11 = ref(false);
const page = ref({total: 100, limit: 10, current: 2});
const dataSource = ref([]);
const addIsInfo=ref(1);
const addIsInfo = ref(1);
const yearName=ref('');
const yearName = ref('');
onMounted(() => {
//getYearList();
//getYearContent();
getUserEvaluationData();
})
const inputChange = (row) => {
//dataSource6children
let total = 0;
const index = dataSource6.value.findIndex(item => item.id === row.pid);
dataSource6.value[index].children.forEach(item => {
total += parseInt(item.content_score);
});
//rowindex
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
}
const inputListShow = () => {
//dataSource6children
dataSource6.value.forEach((item,index) => {
let total = 0;
item.children.forEach(item2 => {
total += parseInt(item2.content_score);
});
dataSource6.value[index].avg_score = total;
dataSource6.value[index].content_score = total;
});
//rowindex
//dataSource6.value[index].avg_score = total;
//dataSource6.value[index].content_score = total;
}
const getUserEvaluationData = () => {
userYearData({}).then((res) => {
console.log(res)
if (res.code == 1) {
tabList.value = res.data;
current1.value=res.data[0].id;
current1.value = res.data[0].id;
getYearList();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const openTab = (d) => {
console.log(d)
current1.value=d;
dataSource.value=[];
current1.value = d;
dataSource.value = [];
getYearList();
}
const insZp = (item) => {
visible11.value = true;
addIsInfo.value=1;
yearName.value=item.year;
addIsInfo.value = 1;
yearName.value = item.year;
getYearContent();
}
const getMonthlyInfo = (item) => {
visible11.value=true;
addIsInfo.value=2;
visible11.value = true;
addIsInfo.value = 2;
console.log(item)
YearInfo({'evaluation_schedule_id':current1.value,'user_id': userStore.userInfo.id, 'year': item.year}).then((res) => {
YearInfo({ 'evaluation_schedule_id': current1.value, 'user_id': userStore.userInfo.id, 'year': item.year }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
inputListShow();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const getYearList = () => {
YearList({'id': current1.value,time:searchAccount.value}).then((res) => {
YearList({ 'id': current1.value, time: searchAccount.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource.value = res.data;
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
const dataSource6 = ref([]);
const getYearContent = () => {
YearContent({'id': current1.value}).then((res) => {
YearContent({ 'id': current1.value }).then((res) => {
console.log(res)
if (res.code == 1) {
dataSource6.value = res.data;
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
})
}
@ -191,17 +194,21 @@ const columns6 = [
title: "分值",
width: "100px",
align: 'center',
key: "base_score"
key: "base_score",
customSlot: 'base_score',
totalRow: true
},
{
title: "自评分",
width: "100px",
align: 'center',
customSlot: 'input',
key: "input"
customSlot: 'content_score',
key: "content_score",
totalRow: true
}
]
const columns = [
{
title: '年度',
@ -217,7 +224,7 @@ const columns = [
},
{
title: '参评时间',
width: '180px',
width: '250px',
align: 'center',
key: 'createtime'
},
@ -228,9 +235,17 @@ const columns = [
}, {
title: '科室评分',
key: 'department_score',
customSlot: 'department_score',
align: 'center',
}, {
title: '党支部评分',
key: 'department_score',
align: 'center',
}, {
title: '总党支评分',
key: 'department_score',
align: 'center',
}
, {
title: '医院评分',
key: 'hospital_score',
align: 'center',
@ -254,7 +269,7 @@ function toSearch() {
const searchAccount = ref(dayjs().year())
function toReset() {
searchAccount.value =dayjs().year()
searchAccount.value = dayjs().year()
}
const addButton = ref([
@ -262,14 +277,14 @@ const addButton = ref([
text: "确认",
callback: async () => {
var json = JSON.stringify(dataSource6.value);
var res = await YearCreate({'term': yearName.value,'json': json,'user_id': userStore.userInfo.id,evaluation_schedule_id: current1.value});
var res = await YearCreate({ 'term': yearName.value, 'json': json, 'user_id': userStore.userInfo.id, evaluation_schedule_id: current1.value });
console.log(res)
if (res.code == 1) {
layer.msg('提交成功!', {icon: 1})
layer.msg('提交成功!', { icon: 1 })
visible11.value = false;
getYearList();
} else {
layer.msg(res.msg, {icon: 2})
layer.msg(res.msg, { icon: 2 })
}
}
},