1
This commit is contained in:
parent
6ee2cda0f1
commit
2485b8981a
7
.vscode/settings.json
vendored
Normal file
7
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"workbench.colorCustomizations": {
|
||||
"activityBar.background": "#46260E",
|
||||
"titleBar.activeBackground": "#613514",
|
||||
"titleBar.activeForeground": "#FDF9F6"
|
||||
}
|
||||
}
|
@ -205,6 +205,23 @@ export const userDataDel= function(date: any) {
|
||||
}
|
||||
|
||||
|
||||
//考评时间tab (月)
|
||||
export const userEvaluationData= function(date: any) {
|
||||
return Http.post('/api/backend/Monthly/getEvaluation', date)
|
||||
}
|
||||
//考评时间tab (季)
|
||||
export const userQuarterData= function(date: any) {
|
||||
return Http.post('/api/backend/Quarter/getEvaluation', date)
|
||||
}
|
||||
//考评时间tab (年)
|
||||
export const userYearData= function(date: any) {
|
||||
return Http.post('/api/backend/Year/getEvaluation', date)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,14 +3,15 @@
|
||||
<lay-card>
|
||||
<div style="padding: 10px">
|
||||
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">基础评分列表</span>
|
||||
<lay-button size="sm" border="green" @click="addShow=true;addData.pid=0;addData.id=0;addIsEdit=1;">新增</lay-button>
|
||||
</div>
|
||||
<lay-table size="lg" ref="tableRef6" children-column-name="children" :columns="columns6"
|
||||
:data-source="dataSource6">
|
||||
<template v-slot:scoring_type="{data}">
|
||||
<span v-if="data.scoring_type==1">年度</span>
|
||||
<span v-if="data.scoring_type==2">季度</span>
|
||||
<span v-if="data.scoring_type==3">月度</span>
|
||||
</template>
|
||||
<!-- <template v-slot:scoring_type="{data}">-->
|
||||
<!-- <span v-if="data.scoring_type==1">年度</span>-->
|
||||
<!-- <span v-if="data.scoring_type==2">季度</span>-->
|
||||
<!-- <span v-if="data.scoring_type==3">月度</span>-->
|
||||
<!-- </template>-->
|
||||
<template v-slot:operator="{data}">
|
||||
<lay-space size="lg">
|
||||
<span style="color: #00A394;cursor: pointer" @click="addShowMsd(data,data.pid)">平级新增</span>
|
||||
@ -26,22 +27,22 @@
|
||||
<lay-layer v-model="addShow" :title="addIsEdit==1?'新增考评项目':'编辑考评项目'" :type="4" :shade="true" :area="['950px','100%']" :btn="addButton">
|
||||
<lay-container fluid="true" style="padding: 20px">
|
||||
<lay-form :model="addData">
|
||||
<lay-form-item required label="项目代码" prop="project_code">
|
||||
<lay-input v-model="addData.project_code" placeholder="请输入项目代码"></lay-input>
|
||||
</lay-form-item>
|
||||
<!-- <lay-form-item required label="项目代码" prop="project_code">-->
|
||||
<!-- <lay-input v-model="addData.project_code" placeholder="请输入项目代码"></lay-input>-->
|
||||
<!-- </lay-form-item>-->
|
||||
<lay-form-item required label="项目名称" prop="project_name">
|
||||
<lay-textarea placeholder="请输入项目名称" v-model="addData.project_name"></lay-textarea>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="基础分值" prop="base_score">
|
||||
<lay-input-number v-model="addData.base_score" position="right"></lay-input-number>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="评分类型" prop="scoring_type">
|
||||
<lay-select v-model="addData.scoring_type" placeholder="请选择">
|
||||
<lay-select-option :value="1" label="年度"></lay-select-option>
|
||||
<lay-select-option :value="2" label="季度"></lay-select-option>
|
||||
<lay-select-option :value="3" label="月度"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
<!-- <lay-form-item required label="评分类型" prop="scoring_type">-->
|
||||
<!-- <lay-select v-model="addData.scoring_type" placeholder="请选择">-->
|
||||
<!-- <lay-select-option :value="1" label="年度"></lay-select-option>-->
|
||||
<!-- <lay-select-option :value="2" label="季度"></lay-select-option>-->
|
||||
<!-- <lay-select-option :value="3" label="月度"></lay-select-option>-->
|
||||
<!-- </lay-select>-->
|
||||
<!-- </lay-form-item>-->
|
||||
</lay-form>
|
||||
</lay-container>
|
||||
</lay-layer>
|
||||
@ -121,17 +122,17 @@ const columns6 = [
|
||||
width: "200px",
|
||||
key: "base_score"
|
||||
},
|
||||
{
|
||||
title: "项目代码",
|
||||
width: "100px",
|
||||
key: "project_code"
|
||||
},
|
||||
{
|
||||
title: "评分类型",
|
||||
width: "100px",
|
||||
customSlot: 'scoring_type',
|
||||
key: "scoring_type"
|
||||
},
|
||||
// {
|
||||
// title: "项目代码",
|
||||
// width: "100px",
|
||||
// key: "project_code"
|
||||
// },
|
||||
// {
|
||||
// title: "评分类型",
|
||||
// width: "100px",
|
||||
// customSlot: 'scoring_type',
|
||||
// key: "scoring_type"
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
width: '180px',
|
||||
|
@ -12,9 +12,9 @@
|
||||
<span v-if="data.evaluation_type==2">季度</span>
|
||||
<span v-if="data.evaluation_type==3">月度</span>
|
||||
</template>
|
||||
<template v-slot:evaluation_start_type="{data}">
|
||||
<span v-if="data.evaluation_start_type==1">结束后</span>
|
||||
</template>
|
||||
<!-- <template v-slot:evaluation_start_type="{data}">-->
|
||||
<!-- <span v-if="data.evaluation_start_type==1">结束后</span>-->
|
||||
<!-- </template>-->
|
||||
<template v-slot:operator="{data}">
|
||||
<lay-space size="lg">
|
||||
<span style="color: #00A394;cursor: pointer" @click="editShowMsd(data)">编辑</span>
|
||||
@ -29,6 +29,9 @@
|
||||
:area="['950px','100%']" :btn="addButton">
|
||||
<lay-container fluid="true" style="padding: 20px">
|
||||
<lay-form :model="addData">
|
||||
<lay-form-item required label-width="150px" label="考评标题" prop="single_score_min">
|
||||
<lay-input placeholder="请输入标题" v-model="addData.title"></lay-input>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label-width="150px" label="考评类型" prop="score_type">
|
||||
<lay-select v-model="addData.evaluation_type" placeholder="请选择">
|
||||
<lay-select-option :value="1" label="年度"></lay-select-option>
|
||||
@ -36,14 +39,14 @@
|
||||
<lay-select-option :value="3" label="月度"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label-width="150px" label="考评开始类型" prop="single_score_max">
|
||||
<lay-select v-model="addData.evaluation_start_type" placeholder="请选择">
|
||||
<lay-select-option :value="1" label="结束后"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label-width="150px" label="时间(天)" prop="single_score_min">
|
||||
<lay-input-number v-model="addData.time"></lay-input-number>
|
||||
</lay-form-item>
|
||||
<!-- <lay-form-item required label-width="150px" label="考评开始类型" prop="single_score_max">-->
|
||||
<!-- <lay-select v-model="addData.evaluation_start_type" placeholder="请选择">-->
|
||||
<!-- <lay-select-option :value="1" label="结束后"></lay-select-option>-->
|
||||
<!-- </lay-select>-->
|
||||
<!-- </lay-form-item>-->
|
||||
<!-- <lay-form-item required label-width="150px" label="时间(天)" prop="single_score_min">-->
|
||||
<!-- <lay-input-number v-model="addData.time"></lay-input-number>-->
|
||||
<!-- </lay-form-item>-->
|
||||
<lay-form-item required label-width="150px" label="考评开始时间" prop="single_score_min">
|
||||
<lay-date-picker type="datetime" v-model="addData.start_time" placeholder="考评开始时间"
|
||||
allow-clear></lay-date-picker>
|
||||
@ -53,17 +56,21 @@
|
||||
allow-clear></lay-date-picker>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label-width="150px" label="考评范围" prop="score_type">
|
||||
<lay-cascader :checkStrictly="false" size="lg" :options="groupList" search
|
||||
:replaceFields="replaceFields"
|
||||
v-model="addData.group_id"
|
||||
placeholder="选择考评范围" allow-clear></lay-cascader>
|
||||
<lay-tree
|
||||
:tail-node-icon="false"
|
||||
:data="groupList"
|
||||
:showCheckbox="true"
|
||||
v-model:checkedKeys="addData.user_group_id"
|
||||
:replaceFields="replaceFields"
|
||||
@check-change="getTreeKp">
|
||||
</lay-tree>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label-width="150px" label="考评内容" prop="score_type">
|
||||
<lay-tree
|
||||
:tail-node-icon="false"
|
||||
:data="contentList"
|
||||
:showCheckbox="true"
|
||||
v-model:checkedKeys="addData.rules"
|
||||
v-model:checkedKeys="addData.basic_rating_id"
|
||||
:replaceFields="contentFields"
|
||||
@check-change="getTree">
|
||||
</lay-tree>
|
||||
@ -87,6 +94,43 @@ import {ref, watch, onMounted, reactive} from 'vue'
|
||||
import {layer} from '@layui/layer-vue'
|
||||
import {verificationImg} from "@/api/module/commone";
|
||||
|
||||
|
||||
const getCascader = (node) => {
|
||||
console.log(node)
|
||||
}
|
||||
const selectedKpIds = ref([]);
|
||||
const getTreeKp = (node) => {
|
||||
if (node.isChecked) {
|
||||
// 选中逻辑:合并父链和子节点ID(原有逻辑)
|
||||
const relatedIds = collectRelatedIds(node);
|
||||
selectedKpIds.value = [...new Set([...selectedKpIds.value, ...relatedIds])];
|
||||
} else {
|
||||
// 取消选中逻辑分两步处理 --------------------------
|
||||
|
||||
// 第一步:移除当前节点及其所有子节点的ID
|
||||
const childIds = collectChildIds(node);
|
||||
selectedKpIds.value = selectedKpIds.value.filter(id => !childIds.includes(id));
|
||||
|
||||
// 第二步:检查父节点是否需要移除(逐级向上)
|
||||
let parent = node.parentNode;
|
||||
while (parent) {
|
||||
// 判断父节点是否还有被选中的子节点
|
||||
const hasOtherCheckedChild = parent.children.some(
|
||||
child => child.id !== node.id && selectedKpIds.value.includes(child.id)
|
||||
);
|
||||
|
||||
if (!hasOtherCheckedChild) {
|
||||
// 无其他选中子节点,移除父节点ID
|
||||
selectedKpIds.value = selectedKpIds.value.filter(id => id !== parent.id);
|
||||
} else {
|
||||
// 有其他选中子节点,终止向上检查
|
||||
break;
|
||||
}
|
||||
|
||||
parent = parent.parentNode; // 继续检查更上层父节点
|
||||
}
|
||||
}
|
||||
}
|
||||
const selectedIds = ref([]);
|
||||
// 处理取消选中时的逻辑优化
|
||||
const getTree = (node) => {
|
||||
@ -169,8 +213,9 @@ const addData = reactive({
|
||||
end_time: null,
|
||||
time: 0,
|
||||
rule_description: '',
|
||||
group_id: [],
|
||||
rules: []
|
||||
user_group_id: [],
|
||||
basic_rating_id: [],
|
||||
title:'',
|
||||
})
|
||||
onMounted(() => {
|
||||
getHierarchicalData()
|
||||
@ -194,8 +239,8 @@ const getContentList = () => {
|
||||
})
|
||||
}
|
||||
const replaceFields = {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
title: 'name',
|
||||
id: 'id',
|
||||
children: 'children'
|
||||
}
|
||||
const groupList = ref([]);
|
||||
@ -203,7 +248,6 @@ const getGroupList = () => {
|
||||
userGroupData({}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
res.data.unshift({name: '全部人员', id: 0, children: []});
|
||||
groupList.value = res.data;
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
@ -230,6 +274,9 @@ const addShowMsd = () => {
|
||||
addData.start_time = null;
|
||||
addData.end_time = null;
|
||||
addData.rule_description = '';
|
||||
addData.user_group_id = [];
|
||||
addData.basic_rating_id = [];
|
||||
addData.title = '';
|
||||
}
|
||||
const editShowMsd = (data) => {
|
||||
console.log(data);
|
||||
@ -241,6 +288,16 @@ const editShowMsd = (data) => {
|
||||
addData.start_time = data.start_time;
|
||||
addData.end_time = data.end_time;
|
||||
addData.rule_description = data.rule_description;
|
||||
addData.title = data.title;
|
||||
|
||||
addData.user_group_id = data.user_group_id.split(',').map(Number);
|
||||
addData.basic_rating_id = data.basic_rating_id.split(',').map(Number);
|
||||
|
||||
selectedIds.value = addData.basic_rating_id;
|
||||
selectedKpIds.value = addData.user_group_id;
|
||||
|
||||
|
||||
console.log(addData)
|
||||
addIsEdit.value = 2;
|
||||
}
|
||||
const delShowMsd = async (data) => {
|
||||
@ -254,23 +311,28 @@ const delShowMsd = async (data) => {
|
||||
}
|
||||
}
|
||||
const columns6 = [
|
||||
{
|
||||
title: "考评标题",
|
||||
width: "150px",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "考评类型",
|
||||
width: "90px",
|
||||
customSlot: 'evaluation_type',
|
||||
key: "evaluation_type"
|
||||
},
|
||||
{
|
||||
title: "考评开始类型",
|
||||
width: "90px",
|
||||
customSlot: 'evaluation_start_type',
|
||||
key: "evaluation_start_type"
|
||||
},
|
||||
{
|
||||
title: "时间(天)",
|
||||
width: "100px",
|
||||
key: "time",
|
||||
},
|
||||
// {
|
||||
// title: "考评开始类型",
|
||||
// width: "90px",
|
||||
// customSlot: 'evaluation_start_type',
|
||||
// key: "evaluation_start_type"
|
||||
// },
|
||||
// {
|
||||
// title: "时间(天)",
|
||||
// width: "100px",
|
||||
// key: "time",
|
||||
// },
|
||||
{
|
||||
title: "规则描述",
|
||||
width: "100px",
|
||||
@ -303,25 +365,46 @@ const addButton = ref([
|
||||
callback: async () => {
|
||||
console.log(addData);
|
||||
console.log(selectedIds.value)
|
||||
return;
|
||||
console.log(selectedKpIds.value)
|
||||
if (addData.title=='') {
|
||||
layer.msg('请输入标题!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.evaluation_type == null || addData.evaluation_type == '') {
|
||||
layer.msg('请选择考评类型!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.time <= 0) {
|
||||
layer.msg('请填写时间(天)!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.evaluation_start_type == null) {
|
||||
layer.msg('请选择考评开始类型!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.start_time == null) {
|
||||
layer.msg('请选择考评开始时间!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.end_time == null) {
|
||||
layer.msg('请选择考评结束时间!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.rule_description == '') {
|
||||
layer.msg('请填写规则描述!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
addData.user_group_id = selectedKpIds.value.join(',');
|
||||
addData.basic_rating_id = selectedIds.value.join(',');
|
||||
if (addData.user_group_id == '') {
|
||||
layer.msg('请选择考评范围!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
if (addData.basic_rating_id == '') {
|
||||
layer.msg('请选择考评内容!', {icon: 2, time: 1000})
|
||||
return;
|
||||
}
|
||||
console.log(addData);
|
||||
if (addIsEdit.value == 1) {
|
||||
var res = await scheduleCreate(addData);
|
||||
} else {
|
||||
|
@ -1,232 +1,347 @@
|
||||
<template>
|
||||
<lay-container fluid="true" style="padding: 10px">
|
||||
<lay-container fluid="true" style="padding: 20px">
|
||||
<!-- 搜索区域改为卡片式布局 -->
|
||||
<lay-row :space="10">
|
||||
<lay-col :md="24">
|
||||
<lay-card>
|
||||
<lay-form style="margin-top: 20px">
|
||||
<lay-row>
|
||||
<lay-col :md="6">
|
||||
<lay-form-item label="账号:" label-width="50">
|
||||
<lay-input
|
||||
v-model="searchAccount"
|
||||
style="width: 90%"
|
||||
></lay-input>
|
||||
<lay-col :md="5">
|
||||
<lay-form-item label="记录状态:" label-width="80">
|
||||
<lay-select v-model="searchForm.status" placeholder="请选择状态">
|
||||
<lay-select-option :value="1" label="待审核"></lay-select-option>
|
||||
<lay-select-option :value="2" label="审核通过"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
</lay-col>
|
||||
<lay-col :md="6">
|
||||
<lay-form-item label="邮箱:" label-width="50">
|
||||
<lay-input
|
||||
v-model="searchEmail"
|
||||
style="width: 90%"
|
||||
></lay-input>
|
||||
</lay-form-item>
|
||||
</lay-col>
|
||||
<lay-col :md="6">
|
||||
<lay-col :md="4">
|
||||
<lay-form-item label-width="0">
|
||||
<lay-button type="primary" @click="toSearch">查询</lay-button>
|
||||
<lay-button @click="toReset">重置</lay-button>
|
||||
<lay-button type="primary" @click="search">查询</lay-button>
|
||||
<lay-button @click="resetSearch" style="margin-left: 10px">重置</lay-button>
|
||||
</lay-form-item>
|
||||
</lay-col>
|
||||
</lay-row>
|
||||
</lay-form>
|
||||
</lay-card>
|
||||
</lay-col>
|
||||
<!-- 列表区域 -->
|
||||
<lay-col :md="24">
|
||||
<lay-card>
|
||||
<lay-table
|
||||
:page="page"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:default-toolbar="defaultToolbar"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
@row="rowClick"
|
||||
@change="change"
|
||||
>
|
||||
<template v-slot:toolbar>
|
||||
<lay-button size="sm" type="primary">新增</lay-button>
|
||||
<lay-button size="sm">删除</lay-button>
|
||||
<div style="padding: 10px">
|
||||
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">个人记录列表</span>
|
||||
<lay-button type="primary" @click="openNew()" size="sm">新增记录</lay-button>
|
||||
</div>
|
||||
<lay-table size="lg" :columns="columns" :data-source="dataSource" :page="page" @change="change">
|
||||
<template v-slot:status="{ data }">
|
||||
<span v-if="data.status == 1" style="color: #1E9FFF">待审核</span>
|
||||
<span v-if="data.status == 2" style="color: #009688">审核通过</span>
|
||||
</template>
|
||||
<template v-slot:username="{ data }">
|
||||
{{ data.username }}
|
||||
</template>
|
||||
<template v-slot:password="{ data }">
|
||||
{{ data.password }}
|
||||
</template>
|
||||
<template v-slot:operator="{}">
|
||||
<lay-button size="xs" type="primary">修改</lay-button>
|
||||
<lay-button size="xs">删除</lay-button>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
{{ selectedKeys }}
|
||||
<template v-slot:operator="{ data }">
|
||||
<lay-space size="lg">
|
||||
<span style="color: #00A394;cursor: pointer" @click="showDetail(data)">详情</span>
|
||||
<span style="color: #00A394;cursor: pointer" @click="editRecord(data)">编辑</span>
|
||||
<lay-popconfirm trigger="click" content="确定要删除吗?" @confirm="deleteRecord(data)">
|
||||
<span style="color: #00A394;cursor: pointer">删除</span>
|
||||
</lay-popconfirm>
|
||||
</lay-space>
|
||||
</template>
|
||||
</lay-table>
|
||||
</lay-card>
|
||||
</lay-col>
|
||||
<lay-layer v-model="showForm" :title="isEdit ? '编辑记录' : '新增记录'" :type="4" :shade="true" :area="['950px', '100%']"
|
||||
:btn="formButtons">
|
||||
<lay-container fluid="true" style="padding: 20px">
|
||||
<lay-form :model="formData">
|
||||
<lay-form-item required label="考评对象" prop="targetPerson">
|
||||
<lay-input v-model="formData.targetPerson" placeholder="请输入考评对象"></lay-input>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="考评类型" prop="evaluationType">
|
||||
<lay-select v-model="formData.evaluationType" placeholder="请选择">
|
||||
<lay-select-option :value="1" label="加分"></lay-select-option>
|
||||
<lay-select-option :value="2" label="减分"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="考评项目" prop="evaluationItem">
|
||||
<lay-select v-model="formData.evaluationItem" placeholder="请选择">
|
||||
<lay-select-option v-for="item in evaluationItems" :key="item.value" :value="item.value"
|
||||
:label="item.label"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="分值" prop="score">
|
||||
<lay-input-number v-model="formData.score" placeholder="请输入分值"></lay-input-number>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="发生时间" prop="occurTime">
|
||||
<lay-date-picker v-model="formData.occurTime" type="datetime"></lay-date-picker>
|
||||
</lay-form-item>
|
||||
<lay-form-item required label="证明人" prop="witness">
|
||||
<lay-select v-model="formData.witness" placeholder="请选择">
|
||||
<lay-select-option v-for="person in witnessList" :key="person.value" :value="person.value"
|
||||
:label="person.label"></lay-select-option>
|
||||
</lay-select>
|
||||
</lay-form-item>
|
||||
<lay-form-item label="附件" prop="attachment">
|
||||
<lay-upload v-model="formData.attachment" :auto="true"></lay-upload>
|
||||
</lay-form-item>
|
||||
<lay-form-item label="备注" prop="remark">
|
||||
<lay-textarea v-model="formData.remark" placeholder="请输入备注"></lay-textarea>
|
||||
</lay-form-item>
|
||||
</lay-form>
|
||||
</lay-container>
|
||||
</lay-layer>
|
||||
</lay-row>
|
||||
</lay-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { layer } from '@layui/layer-vue'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const selectedKeys = ref(['1'])
|
||||
const checkbox = ref(true)
|
||||
const defaultToolbar = ref(true)
|
||||
const page = ref({ total: 100, limit: 10, current: 2 })
|
||||
// 列表数据
|
||||
const dataSource = ref([
|
||||
{
|
||||
id: 1,
|
||||
occurTime: '2024-03-15 14:30',
|
||||
targetPerson: '张三',
|
||||
evaluationType: 1,
|
||||
evaluationItem: '工作表现优异',
|
||||
score: 5,
|
||||
reporter: '李四',
|
||||
status: 1
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
occurTime: '2024-03-14 09:15',
|
||||
targetPerson: '王五',
|
||||
evaluationType: 2,
|
||||
evaluationItem: '迟到',
|
||||
score: -2,
|
||||
reporter: '李四',
|
||||
status: 2
|
||||
}
|
||||
])
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '复选',
|
||||
width: '50px',
|
||||
type: 'checkbox',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
title: '账户',
|
||||
width: '200px',
|
||||
customSlot: 'username',
|
||||
key: 'username'
|
||||
},
|
||||
{
|
||||
title: '密码',
|
||||
width: '180px',
|
||||
customSlot: 'password',
|
||||
key: 'password'
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
width: '180px',
|
||||
key: 'age'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
key: 'remark',
|
||||
ellipsisTooltip: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180px',
|
||||
customSlot: 'operator',
|
||||
key: 'operator',
|
||||
fixed: 'right'
|
||||
// 表单显示控制
|
||||
const showForm = ref(false)
|
||||
const isEdit = ref(false)
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
targetPerson: '',
|
||||
evaluationType: 1,
|
||||
evaluationItem: '',
|
||||
score: 0,
|
||||
occurTime: '',
|
||||
witness: '',
|
||||
attachment: [],
|
||||
remark: ''
|
||||
})
|
||||
|
||||
// 考评项目列表
|
||||
const evaluationItems = [
|
||||
{ value: 1, label: '工作表现优异' },
|
||||
{ value: 2, label: '迟到' },
|
||||
{ value: 3, label: '加班' },
|
||||
{ value: 4, label: '工作失误' }
|
||||
]
|
||||
|
||||
// 证明人列表
|
||||
const witnessList = [
|
||||
{ value: 1, label: '张主任' },
|
||||
{ value: 2, label: '王经理' },
|
||||
{ value: 3, label: '李组长' }
|
||||
]
|
||||
|
||||
// 表格列定义
|
||||
const columns = [
|
||||
{
|
||||
title: "序号",
|
||||
width: "80px",
|
||||
key: "id"
|
||||
},
|
||||
{
|
||||
title: "发生时间",
|
||||
width: "160px",
|
||||
key: "occurTime"
|
||||
},
|
||||
{
|
||||
title: "考评对象",
|
||||
width: "120px",
|
||||
key: "targetPerson"
|
||||
},
|
||||
{
|
||||
title: "考评类型",
|
||||
width: "100px",
|
||||
key: "evaluationType",
|
||||
render: (data: any) => data.evaluationType === 1 ? '加分' : '减分'
|
||||
},
|
||||
{
|
||||
title: "考评项",
|
||||
width: "150px",
|
||||
key: "evaluationItem"
|
||||
},
|
||||
{
|
||||
title: "分值",
|
||||
width: "80px",
|
||||
key: "score"
|
||||
},
|
||||
{
|
||||
title: "填报人",
|
||||
width: "100px",
|
||||
key: "reporter"
|
||||
},
|
||||
{
|
||||
title: "记录状态",
|
||||
width: "100px",
|
||||
customSlot: 'status',
|
||||
key: "status"
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180px',
|
||||
customSlot: 'operator',
|
||||
key: 'operator',
|
||||
align: 'center',
|
||||
fixed: 'right'
|
||||
}
|
||||
]
|
||||
|
||||
// 按钮事件处理
|
||||
const openNew = () => {
|
||||
isEdit.value = false
|
||||
resetForm()
|
||||
showForm.value = true
|
||||
}
|
||||
|
||||
const editRecord = (data: any) => {
|
||||
isEdit.value = true
|
||||
Object.assign(formData, data)
|
||||
showForm.value = true
|
||||
}
|
||||
|
||||
const showDetail = (data: any) => {
|
||||
layer.msg('查看详情:' + JSON.stringify(data))
|
||||
}
|
||||
|
||||
const deleteRecord = async (data: any) => {
|
||||
layer.msg('删除成功!', { icon: 1 })
|
||||
// 实际项目中这里需要调用删除API
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
formData.id = 0
|
||||
formData.targetPerson = ''
|
||||
formData.evaluationType = 1
|
||||
formData.evaluationItem = ''
|
||||
formData.score = 0
|
||||
formData.occurTime = ''
|
||||
formData.witness = ''
|
||||
formData.attachment = []
|
||||
formData.remark = ''
|
||||
}
|
||||
|
||||
// 表单按钮定义
|
||||
const formButtons = ref([
|
||||
{
|
||||
text: "确认",
|
||||
callback: async () => {
|
||||
if (!formData.targetPerson) {
|
||||
layer.msg('考评对象不能为空!', { icon: 2 })
|
||||
return
|
||||
}
|
||||
]
|
||||
|
||||
const dataSource = [
|
||||
{
|
||||
id: '1',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '9',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '10',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
},
|
||||
{
|
||||
id: '11',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '花开堪折直须折,莫待无花空折枝',
|
||||
age: '22'
|
||||
}
|
||||
]
|
||||
|
||||
const rowClick = function (data: any) {}
|
||||
|
||||
const rowDoubleClick = function (data: any) {}
|
||||
|
||||
const change = function ({ current, limit }: any) {
|
||||
layer.msg('current:' + current + ' limit:' + limit)
|
||||
// 实际项目中这里需要调用保存API
|
||||
layer.msg('提交成功!', { icon: 1 })
|
||||
showForm.value = false
|
||||
}
|
||||
function toSearch() {
|
||||
layer.load(2, { time: 3000 })
|
||||
}
|
||||
const searchAccount = ref('')
|
||||
const searchEmail = ref('')
|
||||
function toReset() {
|
||||
searchAccount.value = ''
|
||||
searchEmail.value = ''
|
||||
}
|
||||
|
||||
return {
|
||||
columns,
|
||||
dataSource,
|
||||
selectedKeys,
|
||||
checkbox,
|
||||
defaultToolbar,
|
||||
page,
|
||||
rowClick,
|
||||
rowDoubleClick,
|
||||
change,
|
||||
toReset,
|
||||
toSearch,
|
||||
searchAccount,
|
||||
searchEmail
|
||||
},
|
||||
{
|
||||
text: "取消",
|
||||
callback: () => {
|
||||
showForm.value = false
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
// 添加搜索表单数据
|
||||
const searchForm = reactive({
|
||||
status: undefined as number | undefined
|
||||
})
|
||||
|
||||
// 添加搜索方法
|
||||
const search = () => {
|
||||
// 实际项目中这里需要调用搜索API
|
||||
console.log('搜索条件:', searchForm)
|
||||
// 模拟搜索效果
|
||||
if (searchForm.status) {
|
||||
dataSource.value = dataSource.value.filter(item => item.status === searchForm.status)
|
||||
} else {
|
||||
// 重新获取所有数据
|
||||
getListData()
|
||||
}
|
||||
}
|
||||
|
||||
// 重置搜索
|
||||
const resetSearch = () => {
|
||||
searchForm.status = undefined
|
||||
// 重新获取所有数据
|
||||
getListData()
|
||||
}
|
||||
|
||||
// 分页配置
|
||||
const page = reactive({
|
||||
total: 100, // 总条数
|
||||
current: 1, // 当前页
|
||||
limit: 10, // 每页条数
|
||||
showRefresh: true, // 显示刷新按钮
|
||||
showLimit: true // 显示条数选择器
|
||||
})
|
||||
|
||||
// 分页变化处理
|
||||
const change = ({ current, limit }: { current: number, limit: number }) => {
|
||||
page.current = current
|
||||
page.limit = limit
|
||||
getListData() // 重新获取数据
|
||||
}
|
||||
|
||||
// 修改 getListData 方法
|
||||
const getListData = () => {
|
||||
// 实际项目中这里需要调用API并传入分页参数
|
||||
// 例如: { page: page.current, limit: page.limit }
|
||||
|
||||
// 模拟数据
|
||||
dataSource.value = [
|
||||
{
|
||||
id: 1,
|
||||
occurTime: '2024-03-15 14:30',
|
||||
targetPerson: '张三',
|
||||
evaluationType: 1,
|
||||
evaluationItem: '工作表现优异',
|
||||
score: 5,
|
||||
reporter: '李四',
|
||||
status: 1
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
occurTime: '2024-03-14 09:15',
|
||||
targetPerson: '王五',
|
||||
evaluationType: 2,
|
||||
evaluationItem: '迟到',
|
||||
score: -2,
|
||||
reporter: '李四',
|
||||
status: 2
|
||||
}
|
||||
]
|
||||
page.total = 100 // 设置总条数
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.layui-table-header .layui-table-cell {
|
||||
background-color: #ECF8FA !important;
|
||||
}
|
||||
|
||||
/* 移除之前的搜索区域样式 */
|
||||
.layui-inline {
|
||||
margin-right: 15px;
|
||||
}
|
||||
</style>
|
||||
|
@ -6,8 +6,8 @@
|
||||
<lay-form style="margin-top: 20px">
|
||||
<lay-row>
|
||||
<lay-col :md="5">
|
||||
<lay-form-item label="月度:" label-width="50">
|
||||
<lay-date-picker type="yearmonth" v-model="searchAccount" placeholder="请选择"
|
||||
<lay-form-item label="年度:" label-width="50">
|
||||
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
|
||||
allow-clear></lay-date-picker>
|
||||
</lay-form-item>
|
||||
</lay-col>
|
||||
@ -27,31 +27,36 @@
|
||||
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">月度自评列表</span>
|
||||
<lay-button type="primary" size="sm">导出Excel</lay-button>
|
||||
</div>
|
||||
<lay-table
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:even="true"
|
||||
height="600px"
|
||||
size="md"
|
||||
>
|
||||
<template v-slot:id="{ data }">
|
||||
{{ data.id }}
|
||||
</template>
|
||||
<template v-slot:department_score="{ data }">
|
||||
{{ data.department_score==0?'-':data.department_score }}
|
||||
</template>
|
||||
<template v-slot:username="{ data }">
|
||||
{{ data.username }}
|
||||
</template>
|
||||
<template v-slot:password="{ data }">
|
||||
{{ 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="visible11 = true;addIsInfo=1">开始自评</span>
|
||||
</template>
|
||||
</lay-table>
|
||||
<lay-tab v-model="current1" type="brief" @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"
|
||||
>
|
||||
<template v-slot:id="{ data }">
|
||||
{{ data.id }}
|
||||
</template>
|
||||
<template v-slot:department_score="{ data }">
|
||||
{{ data.department_score==0?'-':data.department_score }}
|
||||
</template>
|
||||
<template v-slot:username="{ data }">
|
||||
{{ data.username }}
|
||||
</template>
|
||||
<template v-slot:password="{ data }">
|
||||
{{ 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>
|
||||
</template>
|
||||
</lay-table>
|
||||
</lay-tab-item>
|
||||
</lay-tab>
|
||||
|
||||
</lay-card>
|
||||
</lay-col>
|
||||
</lay-row>
|
||||
@ -95,10 +100,12 @@ import {ref, onMounted} from 'vue'
|
||||
import {layer} from '@layui/layer-vue'
|
||||
import {
|
||||
MonthlyList,
|
||||
MonthlyContent, MonthlyCreate,MonthlyInfo
|
||||
MonthlyContent, MonthlyCreate,MonthlyInfo,userEvaluationData
|
||||
} from '../../api/module/home'
|
||||
import {useUserStore} from "@/store/user";
|
||||
|
||||
import dayjs from "dayjs";
|
||||
const current1=ref(1);
|
||||
const tabList=ref([]);
|
||||
const userStore = useUserStore()
|
||||
const active = ref(-1);
|
||||
const visible11 = ref(false);
|
||||
@ -110,13 +117,37 @@ const dataSource = ref([]);
|
||||
const addIsInfo=ref(1);
|
||||
|
||||
onMounted(() => {
|
||||
getMonthlyList();
|
||||
getMonthlyContent();
|
||||
//getMonthlyList();
|
||||
//getMonthlyContent();
|
||||
getUserEvaluationData();
|
||||
})
|
||||
const openZp = (item) => {
|
||||
visible11.value = true;
|
||||
addIsInfo.value=1
|
||||
getMonthlyContent();
|
||||
}
|
||||
const openTab = (d) => {
|
||||
console.log(d)
|
||||
current1.value=d;
|
||||
dataSource.value=[];
|
||||
getMonthlyList();
|
||||
}
|
||||
const getUserEvaluationData = () => {
|
||||
userEvaluationData({}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
tabList.value = res.data;
|
||||
current1.value=res.data[0].id;
|
||||
getMonthlyList();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
})
|
||||
}
|
||||
const getMonthlyInfo = (item) => {
|
||||
visible11.value=true;
|
||||
addIsInfo.value=2;
|
||||
MonthlyInfo({'user_id': userStore.userInfo.id, 'month': item.month}).then((res) => {
|
||||
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;
|
||||
@ -125,8 +156,19 @@ const getMonthlyInfo = (item) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
function toSearch() {
|
||||
console.log(searchAccount.value)
|
||||
//layer.load(2, {time: 3000})
|
||||
getMonthlyList();
|
||||
}
|
||||
|
||||
const searchAccount = ref(dayjs().year())
|
||||
|
||||
function toReset() {
|
||||
searchAccount.value =dayjs().year()
|
||||
}
|
||||
const getMonthlyList = () => {
|
||||
MonthlyList({'user_id': userStore.userInfo.id}).then((res) => {
|
||||
MonthlyList({'id': current1.value,time:searchAccount.value}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource.value = res.data;
|
||||
@ -137,7 +179,7 @@ const getMonthlyList = () => {
|
||||
}
|
||||
const dataSource6 = ref([]);
|
||||
const getMonthlyContent = () => {
|
||||
MonthlyContent({'type': 3}).then((res) => {
|
||||
MonthlyContent({'id': current1.value}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource6.value = res.data;
|
||||
@ -184,7 +226,7 @@ const columns = [
|
||||
title: '参评时间',
|
||||
width: '180px',
|
||||
align: 'center',
|
||||
key: 'currentMonth'
|
||||
key: 'createtime'
|
||||
},
|
||||
{
|
||||
title: '加分',
|
||||
@ -216,30 +258,20 @@ const columns = [
|
||||
}
|
||||
]
|
||||
|
||||
function toSearch() {
|
||||
layer.load(2, {time: 3000})
|
||||
}
|
||||
|
||||
const searchAccount = ref('')
|
||||
const searchEmail = ref('')
|
||||
|
||||
function toReset() {
|
||||
searchAccount.value = ''
|
||||
searchEmail.value = ''
|
||||
}
|
||||
|
||||
const addButton = ref([
|
||||
{
|
||||
text: "确认",
|
||||
callback: async () => {
|
||||
var json = JSON.stringify(dataSource6.value);
|
||||
var res = await MonthlyCreate({'json': json,'user_id': userStore.userInfo.id});
|
||||
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})
|
||||
visible11.value = false;
|
||||
getMonthlyList();
|
||||
getMonthlyContent();
|
||||
//getMonthlyContent();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
<lay-form style="margin-top: 20px">
|
||||
<lay-row>
|
||||
<lay-col :md="5">
|
||||
<lay-form-item label="季度:" label-width="50">
|
||||
<lay-form-item label="年度:" label-width="50">
|
||||
<lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
|
||||
allow-clear></lay-date-picker>
|
||||
</lay-form-item>
|
||||
@ -27,11 +27,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" type="brief" @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="600px"
|
||||
height="500px"
|
||||
size="md"
|
||||
>
|
||||
<template v-slot:id="{ data }">
|
||||
@ -94,10 +97,12 @@
|
||||
import {ref, onMounted} from 'vue'
|
||||
import {layer} from '@layui/layer-vue'
|
||||
import {
|
||||
QuarterList, QuarterContent, QuarterCreate, QuarterInfo
|
||||
QuarterList, QuarterContent, QuarterCreate, QuarterInfo, userEvaluationData, userQuarterData
|
||||
} from '../../api/module/home'
|
||||
import {useUserStore} from "@/store/user";
|
||||
|
||||
import dayjs from "dayjs";
|
||||
const current1=ref(1);
|
||||
const tabList=ref([]);
|
||||
const userStore = useUserStore()
|
||||
const active = ref(-1);
|
||||
const visible11 = ref(false);
|
||||
@ -111,13 +116,33 @@ const addIsInfo=ref(1);
|
||||
const quarterName=ref('');
|
||||
|
||||
onMounted(() => {
|
||||
getQuarterList();
|
||||
getQuarterContent();
|
||||
//getQuarterList();
|
||||
//getQuarterContent();
|
||||
getUserEvaluationData();
|
||||
})
|
||||
const openTab = (d) => {
|
||||
console.log(d)
|
||||
current1.value=d;
|
||||
dataSource.value=[];
|
||||
getQuarterList();
|
||||
}
|
||||
const getUserEvaluationData = () => {
|
||||
userQuarterData({}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
tabList.value = res.data;
|
||||
current1.value=res.data[0].id;
|
||||
getQuarterList();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
})
|
||||
}
|
||||
const insZp = (item) => {
|
||||
visible11.value = true;
|
||||
addIsInfo.value=1;
|
||||
quarterName.value=item.quarter;
|
||||
getQuarterContent();
|
||||
}
|
||||
const getMonthlyInfo = (item) => {
|
||||
visible11.value=true;
|
||||
@ -132,7 +157,7 @@ const getMonthlyInfo = (item) => {
|
||||
})
|
||||
}
|
||||
const getQuarterList = () => {
|
||||
QuarterList({'user_id': userStore.userInfo.id}).then((res) => {
|
||||
QuarterList({'id': current1.value,time:searchAccount.value}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource.value = res.data;
|
||||
@ -143,7 +168,7 @@ const getQuarterList = () => {
|
||||
}
|
||||
const dataSource6 = ref([]);
|
||||
const getQuarterContent = () => {
|
||||
QuarterContent({'type': 2}).then((res) => {
|
||||
QuarterContent({'id': current1.value}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource6.value = res.data;
|
||||
@ -223,29 +248,28 @@ const columns = [
|
||||
]
|
||||
|
||||
function toSearch() {
|
||||
layer.load(2, {time: 3000})
|
||||
console.log(searchAccount.value)
|
||||
//layer.load(2, {time: 3000})
|
||||
getQuarterList();
|
||||
}
|
||||
|
||||
const searchAccount = ref('')
|
||||
const searchEmail = ref('')
|
||||
const searchAccount = ref(dayjs().year())
|
||||
|
||||
function toReset() {
|
||||
searchAccount.value = ''
|
||||
searchEmail.value = ''
|
||||
searchAccount.value =dayjs().year()
|
||||
}
|
||||
|
||||
const addButton = ref([
|
||||
{
|
||||
text: "确认",
|
||||
callback: async () => {
|
||||
var json = JSON.stringify(dataSource6.value);
|
||||
var res = await QuarterCreate({'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})
|
||||
visible11.value = false;
|
||||
getQuarterList();
|
||||
getQuarterContent();
|
||||
//getQuarterContent();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
|
@ -14,8 +14,7 @@
|
||||
<template v-slot:operator="{ data }">
|
||||
<lay-space size="lg">
|
||||
<span style="color: #00A394;cursor: pointer" @click="addShowMsd(data, data.pid)">平级新增</span>
|
||||
<span style="color: #00A394;cursor: pointer"
|
||||
@click="addShowMsd(data, data.id)">子级新增</span>
|
||||
<span style="color: #00A394;cursor: pointer" @click="addShowMsd(data, data.id)">子级新增</span>
|
||||
<span style="color: #00A394;cursor: pointer" @click="editShowMsd(data)">编辑</span>
|
||||
<lay-popconfirm trigger="click" content="确定要删除吗?" @confirm="delShowMsd(data)">
|
||||
<span style="color: #00A394;cursor: pointer">删除</span>
|
||||
@ -76,15 +75,11 @@ const openNew = () => {
|
||||
addData.status = 1;
|
||||
addShow.value = true;
|
||||
}
|
||||
const getHierarchicalData = () => {
|
||||
userGroupData({}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource6.value = res.data;
|
||||
} else {
|
||||
layer.msg(res.msg, { icon: 2 })
|
||||
}
|
||||
})
|
||||
const getHierarchicalData = async () => {
|
||||
// 调用接口获取数据
|
||||
// const res = await api.getList(page.current, page.limit)
|
||||
// dataSource6.value = res.data.list
|
||||
// page.total = res.data.total
|
||||
}
|
||||
const addShowMsd = (data, pid) => {
|
||||
console.log(data);
|
||||
|
@ -27,31 +27,36 @@
|
||||
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">年度自评列表</span>
|
||||
<lay-button type="primary" size="sm">导出Excel</lay-button>
|
||||
</div>
|
||||
<lay-table
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:even="true"
|
||||
height="600px"
|
||||
size="md"
|
||||
>
|
||||
<template v-slot:id="{ data }">
|
||||
{{ data.id }}
|
||||
</template>
|
||||
<template v-slot:department_score="{ data }">
|
||||
{{ data.department_score==0?'-':data.department_score }}
|
||||
</template>
|
||||
<template v-slot:username="{ data }">
|
||||
{{ data.username }}
|
||||
</template>
|
||||
<template v-slot:password="{ data }">
|
||||
{{ 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>
|
||||
</template>
|
||||
</lay-table>
|
||||
<lay-tab v-model="current1" type="brief" @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"
|
||||
>
|
||||
<template v-slot:id="{ data }">
|
||||
{{ data.id }}
|
||||
</template>
|
||||
<template v-slot:department_score="{ data }">
|
||||
{{ data.department_score==0?'-':data.department_score }}
|
||||
</template>
|
||||
<template v-slot:username="{ data }">
|
||||
{{ data.username }}
|
||||
</template>
|
||||
<template v-slot:password="{ data }">
|
||||
{{ 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>
|
||||
</template>
|
||||
</lay-table>
|
||||
</lay-tab-item>
|
||||
</lay-tab>
|
||||
|
||||
</lay-card>
|
||||
</lay-col>
|
||||
</lay-row>
|
||||
@ -95,10 +100,12 @@ import {ref, onMounted} from 'vue'
|
||||
import {layer} from '@layui/layer-vue'
|
||||
import {
|
||||
YearList,
|
||||
YearContent, YearCreate,YearInfo
|
||||
YearContent, YearCreate, YearInfo, userYearData
|
||||
} from '../../api/module/home'
|
||||
import {useUserStore} from "@/store/user";
|
||||
|
||||
import dayjs from "dayjs";
|
||||
const current1=ref(1);
|
||||
const tabList=ref([]);
|
||||
const userStore = useUserStore()
|
||||
const active = ref(-1);
|
||||
const visible11 = ref(false);
|
||||
@ -112,19 +119,39 @@ const addIsInfo=ref(1);
|
||||
const yearName=ref('');
|
||||
|
||||
onMounted(() => {
|
||||
getYearList();
|
||||
getYearContent();
|
||||
//getYearList();
|
||||
//getYearContent();
|
||||
getUserEvaluationData();
|
||||
})
|
||||
const getUserEvaluationData = () => {
|
||||
userYearData({}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
tabList.value = res.data;
|
||||
current1.value=res.data[0].id;
|
||||
getYearList();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
})
|
||||
}
|
||||
const openTab = (d) => {
|
||||
console.log(d)
|
||||
current1.value=d;
|
||||
dataSource.value=[];
|
||||
getYearList();
|
||||
}
|
||||
const insZp = (item) => {
|
||||
visible11.value = true;
|
||||
addIsInfo.value=1;
|
||||
yearName.value=item.year;
|
||||
getYearContent();
|
||||
}
|
||||
const getMonthlyInfo = (item) => {
|
||||
visible11.value=true;
|
||||
addIsInfo.value=2;
|
||||
console.log(item)
|
||||
YearInfo({'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;
|
||||
@ -134,7 +161,7 @@ const getMonthlyInfo = (item) => {
|
||||
})
|
||||
}
|
||||
const getYearList = () => {
|
||||
YearList({'user_id': userStore.userInfo.id}).then((res) => {
|
||||
YearList({'id': current1.value,time:searchAccount.value}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource.value = res.data;
|
||||
@ -145,7 +172,7 @@ const getYearList = () => {
|
||||
}
|
||||
const dataSource6 = ref([]);
|
||||
const getYearContent = () => {
|
||||
YearContent({'type': 1}).then((res) => {
|
||||
YearContent({'id': current1.value}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource6.value = res.data;
|
||||
@ -225,15 +252,15 @@ const columns = [
|
||||
]
|
||||
|
||||
function toSearch() {
|
||||
layer.load(2, {time: 3000})
|
||||
console.log(searchAccount.value)
|
||||
//layer.load(2, {time: 3000})
|
||||
getYearList();
|
||||
}
|
||||
|
||||
const searchAccount = ref('')
|
||||
const searchEmail = ref('')
|
||||
const searchAccount = ref(dayjs().year())
|
||||
|
||||
function toReset() {
|
||||
searchAccount.value = ''
|
||||
searchEmail.value = ''
|
||||
searchAccount.value =dayjs().year()
|
||||
}
|
||||
|
||||
const addButton = ref([
|
||||
@ -241,13 +268,12 @@ 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});
|
||||
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})
|
||||
visible11.value = false;
|
||||
getYearList();
|
||||
getYearContent();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://yfyd.hschool.com.cn',
|
||||
target: 'http://192.168.10.158/',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user