This commit is contained in:
王创世 2025-02-18 18:07:57 +08:00
parent 6ee2cda0f1
commit 2485b8981a
10 changed files with 670 additions and 370 deletions

7
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#46260E",
"titleBar.activeBackground": "#613514",
"titleBar.activeForeground": "#FDF9F6"
}
}

View File

@ -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)
}

View File

@ -3,14 +3,15 @@
<lay-card> <lay-card>
<div style="padding: 10px"> <div style="padding: 10px">
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">基础评分列表</span> <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> </div>
<lay-table size="lg" ref="tableRef6" children-column-name="children" :columns="columns6" <lay-table size="lg" ref="tableRef6" children-column-name="children" :columns="columns6"
:data-source="dataSource6"> :data-source="dataSource6">
<template v-slot:scoring_type="{data}"> <!-- <template v-slot:scoring_type="{data}">-->
<span v-if="data.scoring_type==1">年度</span> <!-- <span v-if="data.scoring_type==1">年度</span>-->
<span v-if="data.scoring_type==2">季度</span> <!-- <span v-if="data.scoring_type==2">季度</span>-->
<span v-if="data.scoring_type==3">月度</span> <!-- <span v-if="data.scoring_type==3">月度</span>-->
</template> <!-- </template>-->
<template v-slot:operator="{data}"> <template v-slot:operator="{data}">
<lay-space size="lg"> <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.pid)">平级新增</span>
@ -26,22 +27,22 @@
<lay-layer v-model="addShow" :title="addIsEdit==1?'新增考评项目':'编辑考评项目'" :type="4" :shade="true" :area="['950px','100%']" :btn="addButton"> <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-container fluid="true" style="padding: 20px">
<lay-form :model="addData"> <lay-form :model="addData">
<lay-form-item required label="项目代码" prop="project_code"> <!-- <lay-form-item required label="项目代码" prop="project_code">-->
<lay-input v-model="addData.project_code" placeholder="请输入项目代码"></lay-input> <!-- <lay-input v-model="addData.project_code" placeholder="请输入项目代码"></lay-input>-->
</lay-form-item> <!-- </lay-form-item>-->
<lay-form-item required label="项目名称" prop="project_name"> <lay-form-item required label="项目名称" prop="project_name">
<lay-textarea placeholder="请输入项目名称" v-model="addData.project_name"></lay-textarea> <lay-textarea placeholder="请输入项目名称" v-model="addData.project_name"></lay-textarea>
</lay-form-item> </lay-form-item>
<lay-form-item required label="基础分值" prop="base_score"> <lay-form-item required label="基础分值" prop="base_score">
<lay-input-number v-model="addData.base_score" position="right"></lay-input-number> <lay-input-number v-model="addData.base_score" position="right"></lay-input-number>
</lay-form-item> </lay-form-item>
<lay-form-item required label="评分类型" prop="scoring_type"> <!-- <lay-form-item required label="评分类型" prop="scoring_type">-->
<lay-select v-model="addData.scoring_type" placeholder="请选择"> <!-- <lay-select v-model="addData.scoring_type" placeholder="请选择">-->
<lay-select-option :value="1" label="年度"></lay-select-option> <!-- <lay-select-option :value="1" label="年度"></lay-select-option>-->
<lay-select-option :value="2" label="季度"></lay-select-option> <!-- <lay-select-option :value="2" label="季度"></lay-select-option>-->
<lay-select-option :value="3" label="月度"></lay-select-option> <!-- <lay-select-option :value="3" label="月度"></lay-select-option>-->
</lay-select> <!-- </lay-select>-->
</lay-form-item> <!-- </lay-form-item>-->
</lay-form> </lay-form>
</lay-container> </lay-container>
</lay-layer> </lay-layer>
@ -121,17 +122,17 @@ const columns6 = [
width: "200px", width: "200px",
key: "base_score" key: "base_score"
}, },
{ // {
title: "项目代码", // title: "",
width: "100px", // width: "100px",
key: "project_code" // key: "project_code"
}, // },
{ // {
title: "评分类型", // title: "",
width: "100px", // width: "100px",
customSlot: 'scoring_type', // customSlot: 'scoring_type',
key: "scoring_type" // key: "scoring_type"
}, // },
{ {
title: '操作', title: '操作',
width: '180px', width: '180px',

View File

@ -12,9 +12,9 @@
<span v-if="data.evaluation_type==2">季度</span> <span v-if="data.evaluation_type==2">季度</span>
<span v-if="data.evaluation_type==3">月度</span> <span v-if="data.evaluation_type==3">月度</span>
</template> </template>
<template v-slot:evaluation_start_type="{data}"> <!-- <template v-slot:evaluation_start_type="{data}">-->
<span v-if="data.evaluation_start_type==1">结束后</span> <!-- <span v-if="data.evaluation_start_type==1">结束后</span>-->
</template> <!-- </template>-->
<template v-slot:operator="{data}"> <template v-slot:operator="{data}">
<lay-space size="lg"> <lay-space size="lg">
<span style="color: #00A394;cursor: pointer" @click="editShowMsd(data)">编辑</span> <span style="color: #00A394;cursor: pointer" @click="editShowMsd(data)">编辑</span>
@ -29,6 +29,9 @@
:area="['950px','100%']" :btn="addButton"> :area="['950px','100%']" :btn="addButton">
<lay-container fluid="true" style="padding: 20px"> <lay-container fluid="true" style="padding: 20px">
<lay-form :model="addData"> <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-form-item required label-width="150px" label="考评类型" prop="score_type">
<lay-select v-model="addData.evaluation_type" placeholder="请选择"> <lay-select v-model="addData.evaluation_type" placeholder="请选择">
<lay-select-option :value="1" label="年度"></lay-select-option> <lay-select-option :value="1" label="年度"></lay-select-option>
@ -36,14 +39,14 @@
<lay-select-option :value="3" label="月度"></lay-select-option> <lay-select-option :value="3" label="月度"></lay-select-option>
</lay-select> </lay-select>
</lay-form-item> </lay-form-item>
<lay-form-item required label-width="150px" label="考评开始类型" prop="single_score_max"> <!-- <lay-form-item required label-width="150px" label="考评开始类型" prop="single_score_max">-->
<lay-select v-model="addData.evaluation_start_type" placeholder="请选择"> <!-- <lay-select v-model="addData.evaluation_start_type" placeholder="请选择">-->
<lay-select-option :value="1" label="结束后"></lay-select-option> <!-- <lay-select-option :value="1" label="结束后"></lay-select-option>-->
</lay-select> <!-- </lay-select>-->
</lay-form-item> <!-- </lay-form-item>-->
<lay-form-item required label-width="150px" label="时间(天)" prop="single_score_min"> <!-- <lay-form-item required label-width="150px" label="时间(天)" prop="single_score_min">-->
<lay-input-number v-model="addData.time"></lay-input-number> <!-- <lay-input-number v-model="addData.time"></lay-input-number>-->
</lay-form-item> <!-- </lay-form-item>-->
<lay-form-item required label-width="150px" label="考评开始时间" prop="single_score_min"> <lay-form-item required label-width="150px" label="考评开始时间" prop="single_score_min">
<lay-date-picker type="datetime" v-model="addData.start_time" placeholder="考评开始时间" <lay-date-picker type="datetime" v-model="addData.start_time" placeholder="考评开始时间"
allow-clear></lay-date-picker> allow-clear></lay-date-picker>
@ -53,17 +56,21 @@
allow-clear></lay-date-picker> allow-clear></lay-date-picker>
</lay-form-item> </lay-form-item>
<lay-form-item required label-width="150px" label="考评范围" prop="score_type"> <lay-form-item required label-width="150px" label="考评范围" prop="score_type">
<lay-cascader :checkStrictly="false" size="lg" :options="groupList" search <lay-tree
:replaceFields="replaceFields" :tail-node-icon="false"
v-model="addData.group_id" :data="groupList"
placeholder="选择考评范围" allow-clear></lay-cascader> :showCheckbox="true"
v-model:checkedKeys="addData.user_group_id"
:replaceFields="replaceFields"
@check-change="getTreeKp">
</lay-tree>
</lay-form-item> </lay-form-item>
<lay-form-item required label-width="150px" label="考评内容" prop="score_type"> <lay-form-item required label-width="150px" label="考评内容" prop="score_type">
<lay-tree <lay-tree
:tail-node-icon="false" :tail-node-icon="false"
:data="contentList" :data="contentList"
:showCheckbox="true" :showCheckbox="true"
v-model:checkedKeys="addData.rules" v-model:checkedKeys="addData.basic_rating_id"
:replaceFields="contentFields" :replaceFields="contentFields"
@check-change="getTree"> @check-change="getTree">
</lay-tree> </lay-tree>
@ -87,6 +94,43 @@ import {ref, watch, onMounted, reactive} from 'vue'
import {layer} from '@layui/layer-vue' import {layer} from '@layui/layer-vue'
import {verificationImg} from "@/api/module/commone"; 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 selectedIds = ref([]);
// //
const getTree = (node) => { const getTree = (node) => {
@ -169,8 +213,9 @@ const addData = reactive({
end_time: null, end_time: null,
time: 0, time: 0,
rule_description: '', rule_description: '',
group_id: [], user_group_id: [],
rules: [] basic_rating_id: [],
title:'',
}) })
onMounted(() => { onMounted(() => {
getHierarchicalData() getHierarchicalData()
@ -194,8 +239,8 @@ const getContentList = () => {
}) })
} }
const replaceFields = { const replaceFields = {
label: 'name', title: 'name',
value: 'id', id: 'id',
children: 'children' children: 'children'
} }
const groupList = ref([]); const groupList = ref([]);
@ -203,7 +248,6 @@ const getGroupList = () => {
userGroupData({}).then((res) => { userGroupData({}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
res.data.unshift({name: '全部人员', id: 0, children: []});
groupList.value = res.data; groupList.value = res.data;
} else { } else {
layer.msg(res.msg, {icon: 2}) layer.msg(res.msg, {icon: 2})
@ -230,6 +274,9 @@ const addShowMsd = () => {
addData.start_time = null; addData.start_time = null;
addData.end_time = null; addData.end_time = null;
addData.rule_description = ''; addData.rule_description = '';
addData.user_group_id = [];
addData.basic_rating_id = [];
addData.title = '';
} }
const editShowMsd = (data) => { const editShowMsd = (data) => {
console.log(data); console.log(data);
@ -241,6 +288,16 @@ const editShowMsd = (data) => {
addData.start_time = data.start_time; addData.start_time = data.start_time;
addData.end_time = data.end_time; addData.end_time = data.end_time;
addData.rule_description = data.rule_description; 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; addIsEdit.value = 2;
} }
const delShowMsd = async (data) => { const delShowMsd = async (data) => {
@ -254,23 +311,28 @@ const delShowMsd = async (data) => {
} }
} }
const columns6 = [ const columns6 = [
{
title: "考评标题",
width: "150px",
key: "title"
},
{ {
title: "考评类型", title: "考评类型",
width: "90px", width: "90px",
customSlot: 'evaluation_type', customSlot: 'evaluation_type',
key: "evaluation_type" key: "evaluation_type"
}, },
{ // {
title: "考评开始类型", // title: "",
width: "90px", // width: "90px",
customSlot: 'evaluation_start_type', // customSlot: 'evaluation_start_type',
key: "evaluation_start_type" // key: "evaluation_start_type"
}, // },
{ // {
title: "时间(天)", // title: "",
width: "100px", // width: "100px",
key: "time", // key: "time",
}, // },
{ {
title: "规则描述", title: "规则描述",
width: "100px", width: "100px",
@ -303,25 +365,46 @@ const addButton = ref([
callback: async () => { callback: async () => {
console.log(addData); console.log(addData);
console.log(selectedIds.value) 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 == '') { if (addData.evaluation_type == null || addData.evaluation_type == '') {
layer.msg('请选择考评类型!', {icon: 2, time: 1000}) layer.msg('请选择考评类型!', {icon: 2, time: 1000})
return;
} }
if (addData.time <= 0) { if (addData.time <= 0) {
layer.msg('请填写时间(天)!', {icon: 2, time: 1000}) layer.msg('请填写时间(天)!', {icon: 2, time: 1000})
return;
} }
if (addData.evaluation_start_type == null) { if (addData.evaluation_start_type == null) {
layer.msg('请选择考评开始类型!', {icon: 2, time: 1000}) layer.msg('请选择考评开始类型!', {icon: 2, time: 1000})
return;
} }
if (addData.start_time == null) { if (addData.start_time == null) {
layer.msg('请选择考评开始时间!', {icon: 2, time: 1000}) layer.msg('请选择考评开始时间!', {icon: 2, time: 1000})
return;
} }
if (addData.end_time == null) { if (addData.end_time == null) {
layer.msg('请选择考评结束时间!', {icon: 2, time: 1000}) layer.msg('请选择考评结束时间!', {icon: 2, time: 1000})
return;
} }
if (addData.rule_description == '') { if (addData.rule_description == '') {
layer.msg('请填写规则描述!', {icon: 2, time: 1000}) 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) { if (addIsEdit.value == 1) {
var res = await scheduleCreate(addData); var res = await scheduleCreate(addData);
} else { } else {

View File

@ -1,232 +1,347 @@
<template> <template>
<lay-container fluid="true" style="padding: 10px"> <lay-container fluid="true" style="padding: 20px">
<!-- 搜索区域改为卡片式布局 -->
<lay-row :space="10"> <lay-row :space="10">
<lay-col :md="24"> <lay-col :md="24">
<lay-card> <lay-card>
<lay-form style="margin-top: 20px"> <lay-form style="margin-top: 20px">
<lay-row> <lay-row>
<lay-col :md="6"> <lay-col :md="5">
<lay-form-item label="账号:" label-width="50"> <lay-form-item label="记录状态:" label-width="80">
<lay-input <lay-select v-model="searchForm.status" placeholder="请选择状态">
v-model="searchAccount" <lay-select-option :value="1" label="待审核"></lay-select-option>
style="width: 90%" <lay-select-option :value="2" label="审核通过"></lay-select-option>
></lay-input> </lay-select>
</lay-form-item> </lay-form-item>
</lay-col> </lay-col>
<lay-col :md="6"> <lay-col :md="4">
<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-form-item label-width="0"> <lay-form-item label-width="0">
<lay-button type="primary" @click="toSearch">查询</lay-button> <lay-button type="primary" @click="search">查询</lay-button>
<lay-button @click="toReset">重置</lay-button> <lay-button @click="resetSearch" style="margin-left: 10px">重置</lay-button>
</lay-form-item> </lay-form-item>
</lay-col> </lay-col>
</lay-row> </lay-row>
</lay-form> </lay-form>
</lay-card> </lay-card>
</lay-col> </lay-col>
<!-- 列表区域 -->
<lay-col :md="24"> <lay-col :md="24">
<lay-card> <lay-card>
<lay-table <div style="padding: 10px">
:page="page" <span style="font-size: 18px;vertical-align: center;margin-right: 20px">个人记录列表</span>
:columns="columns" <lay-button type="primary" @click="openNew()" size="sm">新增记录</lay-button>
:dataSource="dataSource" </div>
:default-toolbar="defaultToolbar" <lay-table size="lg" :columns="columns" :data-source="dataSource" :page="page" @change="change">
v-model:selectedKeys="selectedKeys" <template v-slot:status="{ data }">
@row="rowClick" <span v-if="data.status == 1" style="color: #1E9FFF">待审核</span>
@change="change" <span v-if="data.status == 2" style="color: #009688">审核通过</span>
>
<template v-slot:toolbar>
<lay-button size="sm" type="primary">新增</lay-button>
<lay-button size="sm">删除</lay-button>
</template> </template>
<template v-slot:username="{ data }"> <template v-slot:operator="{ data }">
{{ data.username }} <lay-space size="lg">
</template> <span style="color: #00A394;cursor: pointer" @click="showDetail(data)">详情</span>
<template v-slot:password="{ data }"> <span style="color: #00A394;cursor: pointer" @click="editRecord(data)">编辑</span>
{{ data.password }} <lay-popconfirm trigger="click" content="确定要删除吗?" @confirm="deleteRecord(data)">
</template> <span style="color: #00A394;cursor: pointer">删除</span>
<template v-slot:operator="{}"> </lay-popconfirm>
<lay-button size="xs" type="primary">修改</lay-button> </lay-space>
<lay-button size="xs">删除</lay-button>
</template>
<template v-slot:footer>
{{ selectedKeys }}
</template> </template>
</lay-table> </lay-table>
</lay-card> </lay-card>
</lay-col> </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-row>
</lay-container> </lay-container>
</template> </template>
<script lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue' import { ref, reactive } from 'vue'
import { layer } from '@layui/layer-vue' import { layer } from '@layui/layer-vue'
export default { //
setup() { const dataSource = ref([
const selectedKeys = ref(['1']) {
const checkbox = ref(true) id: 1,
const defaultToolbar = ref(true) occurTime: '2024-03-15 14:30',
const page = ref({ total: 100, limit: 10, current: 2 }) 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 = [ //
{ const showForm = ref(false)
title: '复选', const isEdit = ref(false)
width: '50px',
type: 'checkbox', //
fixed: 'left' const formData = reactive({
}, id: 0,
{ targetPerson: '',
title: '账户', evaluationType: 1,
width: '200px', evaluationItem: '',
customSlot: 'username', score: 0,
key: 'username' occurTime: '',
}, witness: '',
{ attachment: [],
title: '密码', remark: ''
width: '180px', })
customSlot: 'password',
key: 'password' //
}, const evaluationItems = [
{ { value: 1, label: '工作表现优异' },
title: '年龄', { value: 2, label: '迟到' },
width: '180px', { value: 3, label: '加班' },
key: 'age' { value: 4, label: '工作失误' }
}, ]
{
title: '描述', //
key: 'remark', const witnessList = [
ellipsisTooltip: true { value: 1, label: '张主任' },
}, { value: 2, label: '王经理' },
{ { value: 3, label: '李组长' }
title: '操作', ]
width: '180px',
customSlot: 'operator', //
key: 'operator', const columns = [
fixed: 'right' {
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
} }
] // API
layer.msg('提交成功!', { icon: 1 })
const dataSource = [ showForm.value = false
{
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)
} }
function toSearch() { },
layer.load(2, { time: 3000 }) {
} text: "取消",
const searchAccount = ref('') callback: () => {
const searchEmail = ref('') showForm.value = false
function toReset() {
searchAccount.value = ''
searchEmail.value = ''
}
return {
columns,
dataSource,
selectedKeys,
checkbox,
defaultToolbar,
page,
rowClick,
rowDoubleClick,
change,
toReset,
toSearch,
searchAccount,
searchEmail
} }
} }
])
//
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> </script>
<style>
.layui-table-header .layui-table-cell {
background-color: #ECF8FA !important;
}
/* 移除之前的搜索区域样式 */
.layui-inline {
margin-right: 15px;
}
</style>

View File

@ -6,8 +6,8 @@
<lay-form style="margin-top: 20px"> <lay-form style="margin-top: 20px">
<lay-row> <lay-row>
<lay-col :md="5"> <lay-col :md="5">
<lay-form-item label="度:" label-width="50"> <lay-form-item label="度:" label-width="50">
<lay-date-picker type="yearmonth" v-model="searchAccount" placeholder="请选择" <lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
allow-clear></lay-date-picker> allow-clear></lay-date-picker>
</lay-form-item> </lay-form-item>
</lay-col> </lay-col>
@ -27,31 +27,36 @@
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">月度自评列表</span> <span style="font-size: 18px;vertical-align: center;margin-right: 20px">月度自评列表</span>
<lay-button type="primary" size="sm">导出Excel</lay-button> <lay-button type="primary" size="sm">导出Excel</lay-button>
</div> </div>
<lay-table <lay-tab v-model="current1" type="brief" @change="openTab">
:columns="columns" <lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id">
:dataSource="dataSource" <lay-table
:even="true" :columns="columns"
height="600px" :dataSource="dataSource"
size="md" :even="true"
> height="500px"
<template v-slot:id="{ data }"> size="md"
{{ data.id }} >
</template> <template v-slot:id="{ data }">
<template v-slot:department_score="{ data }"> {{ data.id }}
{{ data.department_score==0?'-':data.department_score }} </template>
</template> <template v-slot:department_score="{ data }">
<template v-slot:username="{ data }"> {{ data.department_score==0?'-':data.department_score }}
{{ data.username }} </template>
</template> <template v-slot:username="{ data }">
<template v-slot:password="{ data }"> {{ data.username }}
{{ data.password }} </template>
</template> <template v-slot:password="{ data }">
<template v-slot:operator="{ data }"> {{ data.password }}
<span style="color: #00A394;cursor: pointer" v-if="data.if_month==1" @click="getMonthlyInfo(data)">详情</span> </template>
<span style="color: #00A394;cursor: pointer" v-if="data.if_month==2" <template v-slot:operator="{ data }">
@click="visible11 = true;addIsInfo=1">开始自评</span> <span style="color: #00A394;cursor: pointer" v-if="data.if_month==1" @click="getMonthlyInfo(data)">详情</span>
</template> <span style="color: #00A394;cursor: pointer" v-if="data.if_month==2"
</lay-table> @click="openZp(data)">开始自评</span>
</template>
</lay-table>
</lay-tab-item>
</lay-tab>
</lay-card> </lay-card>
</lay-col> </lay-col>
</lay-row> </lay-row>
@ -95,10 +100,12 @@ import {ref, onMounted} from 'vue'
import {layer} from '@layui/layer-vue' import {layer} from '@layui/layer-vue'
import { import {
MonthlyList, MonthlyList,
MonthlyContent, MonthlyCreate,MonthlyInfo MonthlyContent, MonthlyCreate,MonthlyInfo,userEvaluationData
} from '../../api/module/home' } 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 userStore = useUserStore() const userStore = useUserStore()
const active = ref(-1); const active = ref(-1);
const visible11 = ref(false); const visible11 = ref(false);
@ -110,13 +117,37 @@ const dataSource = ref([]);
const addIsInfo=ref(1); const addIsInfo=ref(1);
onMounted(() => { onMounted(() => {
getMonthlyList(); //getMonthlyList();
getMonthlyContent(); //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) => { const getMonthlyInfo = (item) => {
visible11.value=true; visible11.value=true;
addIsInfo.value=2; 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) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource6.value = res.data; 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 = () => { const getMonthlyList = () => {
MonthlyList({'user_id': userStore.userInfo.id}).then((res) => { MonthlyList({'id': current1.value,time:searchAccount.value}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource.value = res.data; dataSource.value = res.data;
@ -137,7 +179,7 @@ const getMonthlyList = () => {
} }
const dataSource6 = ref([]); const dataSource6 = ref([]);
const getMonthlyContent = () => { const getMonthlyContent = () => {
MonthlyContent({'type': 3}).then((res) => { MonthlyContent({'id': current1.value}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource6.value = res.data; dataSource6.value = res.data;
@ -184,7 +226,7 @@ const columns = [
title: '参评时间', title: '参评时间',
width: '180px', width: '180px',
align: 'center', align: 'center',
key: 'currentMonth' key: 'createtime'
}, },
{ {
title: '加分', 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([ const addButton = ref([
{ {
text: "确认", text: "确认",
callback: async () => { callback: async () => {
var json = JSON.stringify(dataSource6.value); 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) console.log(res)
if (res.code == 1) { if (res.code == 1) {
layer.msg('提交成功!', {icon: 1}) layer.msg('提交成功!', {icon: 1})
visible11.value = false; visible11.value = false;
getMonthlyList(); getMonthlyList();
getMonthlyContent(); //getMonthlyContent();
} else { } else {
layer.msg(res.msg, {icon: 2}) layer.msg(res.msg, {icon: 2})
} }

View File

@ -6,7 +6,7 @@
<lay-form style="margin-top: 20px"> <lay-form style="margin-top: 20px">
<lay-row> <lay-row>
<lay-col :md="5"> <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="请选择" <lay-date-picker type="year" v-model="searchAccount" placeholder="请选择"
allow-clear></lay-date-picker> allow-clear></lay-date-picker>
</lay-form-item> </lay-form-item>
@ -27,11 +27,14 @@
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">季度自评列表</span> <span style="font-size: 18px;vertical-align: center;margin-right: 20px">季度自评列表</span>
<lay-button type="primary" size="sm">导出Excel</lay-button> <lay-button type="primary" size="sm">导出Excel</lay-button>
</div> </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 <lay-table
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:even="true" :even="true"
height="600px" height="500px"
size="md" size="md"
> >
<template v-slot:id="{ data }"> <template v-slot:id="{ data }">
@ -94,10 +97,12 @@
import {ref, onMounted} from 'vue' import {ref, onMounted} from 'vue'
import {layer} from '@layui/layer-vue' import {layer} from '@layui/layer-vue'
import { import {
QuarterList, QuarterContent, QuarterCreate, QuarterInfo QuarterList, QuarterContent, QuarterCreate, QuarterInfo, userEvaluationData, userQuarterData
} from '../../api/module/home' } 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 userStore = useUserStore() const userStore = useUserStore()
const active = ref(-1); const active = ref(-1);
const visible11 = ref(false); const visible11 = ref(false);
@ -111,13 +116,33 @@ const addIsInfo=ref(1);
const quarterName=ref(''); const quarterName=ref('');
onMounted(() => { onMounted(() => {
getQuarterList(); //getQuarterList();
getQuarterContent(); //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) => { const insZp = (item) => {
visible11.value = true; visible11.value = true;
addIsInfo.value=1; addIsInfo.value=1;
quarterName.value=item.quarter; quarterName.value=item.quarter;
getQuarterContent();
} }
const getMonthlyInfo = (item) => { const getMonthlyInfo = (item) => {
visible11.value=true; visible11.value=true;
@ -132,7 +157,7 @@ const getMonthlyInfo = (item) => {
}) })
} }
const getQuarterList = () => { const getQuarterList = () => {
QuarterList({'user_id': userStore.userInfo.id}).then((res) => { QuarterList({'id': current1.value,time:searchAccount.value}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource.value = res.data; dataSource.value = res.data;
@ -143,7 +168,7 @@ const getQuarterList = () => {
} }
const dataSource6 = ref([]); const dataSource6 = ref([]);
const getQuarterContent = () => { const getQuarterContent = () => {
QuarterContent({'type': 2}).then((res) => { QuarterContent({'id': current1.value}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource6.value = res.data; dataSource6.value = res.data;
@ -223,29 +248,28 @@ const columns = [
] ]
function toSearch() { function toSearch() {
layer.load(2, {time: 3000}) console.log(searchAccount.value)
//layer.load(2, {time: 3000})
getQuarterList();
} }
const searchAccount = ref('') const searchAccount = ref(dayjs().year())
const searchEmail = ref('')
function toReset() { function toReset() {
searchAccount.value = '' searchAccount.value =dayjs().year()
searchEmail.value = ''
} }
const addButton = ref([ const addButton = ref([
{ {
text: "确认", text: "确认",
callback: async () => { callback: async () => {
var json = JSON.stringify(dataSource6.value); 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) console.log(res)
if (res.code == 1) { if (res.code == 1) {
layer.msg('提交成功!', {icon: 1}) layer.msg('提交成功!', {icon: 1})
visible11.value = false; visible11.value = false;
getQuarterList(); getQuarterList();
getQuarterContent(); //getQuarterContent();
} else { } else {
layer.msg(res.msg, {icon: 2}) layer.msg(res.msg, {icon: 2})
} }

View File

@ -14,8 +14,7 @@
<template v-slot:operator="{ data }"> <template v-slot:operator="{ data }">
<lay-space size="lg"> <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.pid)">平级新增</span>
<span style="color: #00A394;cursor: pointer" <span style="color: #00A394;cursor: pointer" @click="addShowMsd(data, data.id)">子级新增</span>
@click="addShowMsd(data, data.id)">子级新增</span>
<span style="color: #00A394;cursor: pointer" @click="editShowMsd(data)">编辑</span> <span style="color: #00A394;cursor: pointer" @click="editShowMsd(data)">编辑</span>
<lay-popconfirm trigger="click" content="确定要删除吗?" @confirm="delShowMsd(data)"> <lay-popconfirm trigger="click" content="确定要删除吗?" @confirm="delShowMsd(data)">
<span style="color: #00A394;cursor: pointer">删除</span> <span style="color: #00A394;cursor: pointer">删除</span>
@ -76,15 +75,11 @@ const openNew = () => {
addData.status = 1; addData.status = 1;
addShow.value = true; addShow.value = true;
} }
const getHierarchicalData = () => { const getHierarchicalData = async () => {
userGroupData({}).then((res) => { //
console.log(res) // const res = await api.getList(page.current, page.limit)
if (res.code == 1) { // dataSource6.value = res.data.list
dataSource6.value = res.data; // page.total = res.data.total
} else {
layer.msg(res.msg, { icon: 2 })
}
})
} }
const addShowMsd = (data, pid) => { const addShowMsd = (data, pid) => {
console.log(data); console.log(data);

View File

@ -27,31 +27,36 @@
<span style="font-size: 18px;vertical-align: center;margin-right: 20px">年度自评列表</span> <span style="font-size: 18px;vertical-align: center;margin-right: 20px">年度自评列表</span>
<lay-button type="primary" size="sm">导出Excel</lay-button> <lay-button type="primary" size="sm">导出Excel</lay-button>
</div> </div>
<lay-table <lay-tab v-model="current1" type="brief" @change="openTab">
:columns="columns" <lay-tab-item v-for="item in tabList" :title="item.title" :id="item.id">
:dataSource="dataSource" <lay-table
:even="true" :columns="columns"
height="600px" :dataSource="dataSource"
size="md" :even="true"
> height="500px"
<template v-slot:id="{ data }"> size="md"
{{ data.id }} >
</template> <template v-slot:id="{ data }">
<template v-slot:department_score="{ data }"> {{ data.id }}
{{ data.department_score==0?'-':data.department_score }} </template>
</template> <template v-slot:department_score="{ data }">
<template v-slot:username="{ data }"> {{ data.department_score==0?'-':data.department_score }}
{{ data.username }} </template>
</template> <template v-slot:username="{ data }">
<template v-slot:password="{ data }"> {{ data.username }}
{{ data.password }} </template>
</template> <template v-slot:password="{ data }">
<template v-slot:operator="{ data }"> {{ data.password }}
<span style="color: #00A394;cursor: pointer" v-if="data.if_period==1" @click="getMonthlyInfo(data)">详情</span> </template>
<span style="color: #00A394;cursor: pointer" v-if="data.if_period==2" <template v-slot:operator="{ data }">
@click="insZp(data)">开始自评</span> <span style="color: #00A394;cursor: pointer" v-if="data.if_period==1" @click="getMonthlyInfo(data)">详情</span>
</template> <span style="color: #00A394;cursor: pointer" v-if="data.if_period==2"
</lay-table> @click="insZp(data)">开始自评</span>
</template>
</lay-table>
</lay-tab-item>
</lay-tab>
</lay-card> </lay-card>
</lay-col> </lay-col>
</lay-row> </lay-row>
@ -95,10 +100,12 @@ import {ref, onMounted} from 'vue'
import {layer} from '@layui/layer-vue' import {layer} from '@layui/layer-vue'
import { import {
YearList, YearList,
YearContent, YearCreate,YearInfo YearContent, YearCreate, YearInfo, userYearData
} from '../../api/module/home' } 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 userStore = useUserStore() const userStore = useUserStore()
const active = ref(-1); const active = ref(-1);
const visible11 = ref(false); const visible11 = ref(false);
@ -112,19 +119,39 @@ const addIsInfo=ref(1);
const yearName=ref(''); const yearName=ref('');
onMounted(() => { onMounted(() => {
getYearList(); //getYearList();
getYearContent(); //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) => { const insZp = (item) => {
visible11.value = true; visible11.value = true;
addIsInfo.value=1; addIsInfo.value=1;
yearName.value=item.year; yearName.value=item.year;
getYearContent();
} }
const getMonthlyInfo = (item) => { const getMonthlyInfo = (item) => {
visible11.value=true; visible11.value=true;
addIsInfo.value=2; addIsInfo.value=2;
console.log(item) 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) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource6.value = res.data; dataSource6.value = res.data;
@ -134,7 +161,7 @@ const getMonthlyInfo = (item) => {
}) })
} }
const getYearList = () => { const getYearList = () => {
YearList({'user_id': userStore.userInfo.id}).then((res) => { YearList({'id': current1.value,time:searchAccount.value}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource.value = res.data; dataSource.value = res.data;
@ -145,7 +172,7 @@ const getYearList = () => {
} }
const dataSource6 = ref([]); const dataSource6 = ref([]);
const getYearContent = () => { const getYearContent = () => {
YearContent({'type': 1}).then((res) => { YearContent({'id': current1.value}).then((res) => {
console.log(res) console.log(res)
if (res.code == 1) { if (res.code == 1) {
dataSource6.value = res.data; dataSource6.value = res.data;
@ -225,15 +252,15 @@ const columns = [
] ]
function toSearch() { function toSearch() {
layer.load(2, {time: 3000}) console.log(searchAccount.value)
//layer.load(2, {time: 3000})
getYearList();
} }
const searchAccount = ref('') const searchAccount = ref(dayjs().year())
const searchEmail = ref('')
function toReset() { function toReset() {
searchAccount.value = '' searchAccount.value =dayjs().year()
searchEmail.value = ''
} }
const addButton = ref([ const addButton = ref([
@ -241,13 +268,12 @@ const addButton = ref([
text: "确认", text: "确认",
callback: async () => { callback: async () => {
var json = JSON.stringify(dataSource6.value); 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) console.log(res)
if (res.code == 1) { if (res.code == 1) {
layer.msg('提交成功!', {icon: 1}) layer.msg('提交成功!', {icon: 1})
visible11.value = false; visible11.value = false;
getYearList(); getYearList();
getYearContent();
} else { } else {
layer.msg(res.msg, {icon: 2}) layer.msg(res.msg, {icon: 2})
} }

View File

@ -20,7 +20,7 @@ export default defineConfig({
server: { server: {
proxy: { proxy: {
'/api': { '/api': {
target: 'http://yfyd.hschool.com.cn', target: 'http://192.168.10.158/',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')
} }