1
This commit is contained in:
parent
c806a2aa83
commit
5c07d09a1d
@ -1,5 +1,7 @@
|
||||
import Http from '../http';
|
||||
|
||||
export const login = function(loginForm: any) {
|
||||
return Http.post('/api/backend/user/login', loginForm)
|
||||
}
|
||||
//基础评分项列表
|
||||
export const homeGetHierarchicalData = function(date: any) {
|
||||
return Http.post('/api/backend/basic_rating/getHierarchicalData', date)
|
||||
@ -55,6 +57,26 @@ export const scheduleUpdate= function(date: any) {
|
||||
export const scheduleDelete= function(date: any) {
|
||||
return Http.post('/api/backend/evaluation_schedule/delete', date)
|
||||
}
|
||||
//月度考评
|
||||
export const MonthlyList= function(date: any) {
|
||||
return Http.post('/api/backend/Monthly/getMonthlyData', date)
|
||||
}
|
||||
//月度考评(考评题目)
|
||||
export const MonthlyContent= function(date: any) {
|
||||
return Http.post('/api/backend/Monthly/getMonthly', date)
|
||||
}
|
||||
//月度考评(考评题目)
|
||||
export const MonthlyCreate= function(date: any) {
|
||||
return Http.post('/api/backend/Monthly/create', date)
|
||||
}
|
||||
//月度考评(详情)
|
||||
export const MonthlyInfo= function(date: any) {
|
||||
return Http.post('/api/backend/Monthly/getMonthlyFind', date)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +1,11 @@
|
||||
import Http from '../http';
|
||||
|
||||
export const login = function(loginForm: any) {
|
||||
return Http.post('/user/login', loginForm)
|
||||
}
|
||||
|
||||
|
||||
export const menu = function() {
|
||||
return Http.get('/user/menu')
|
||||
return Http.get('/user/menu')
|
||||
}
|
||||
|
||||
export const permission = function() {
|
||||
return Http.get('/user/permission')
|
||||
}
|
||||
return Http.get('/user/permission')
|
||||
}
|
||||
|
@ -2,10 +2,6 @@
|
||||
import Mock from'mockjs';
|
||||
import user from './user';
|
||||
|
||||
Mock.mock(/\/user\/login/,'post',(req: any,res: any) =>{
|
||||
return user.getLogin(req,res)
|
||||
});
|
||||
|
||||
Mock.mock(/\/user\/info/,'post',(req: any,res: any) =>{
|
||||
return user.getInfo(req,res)
|
||||
});
|
||||
@ -20,6 +16,6 @@ Mock.mock(/\/user\/permission/,'get',(req: any,res: any) =>{
|
||||
|
||||
Mock.mock(/\/file\/upload/,'post',(req: any,res: any) =>{
|
||||
return user.getUpload(req,res)
|
||||
});
|
||||
});
|
||||
|
||||
export default Mock;
|
||||
export default Mock;
|
||||
|
@ -294,5 +294,5 @@ const getUpload = (req: any, res: any) => {
|
||||
}
|
||||
|
||||
export default {
|
||||
getInfo, getMenu, getLogin, getPermission, getUpload
|
||||
getInfo, getMenu, getLogin, getPermission, getUpload,menus
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { menu, permission } from "../api/module/user";
|
||||
//import { menu, permission } from "../api/module/user";
|
||||
|
||||
import menu from "../mockjs/user";
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: 'user',
|
||||
@ -13,20 +15,18 @@ export const useUserStore = defineStore({
|
||||
},
|
||||
actions: {
|
||||
async loadMenus(){
|
||||
const { data, code } = await menu();
|
||||
if(code == 200) {
|
||||
this.menus = data;
|
||||
}
|
||||
this.menus = menu.menus;
|
||||
},
|
||||
async loadPermissions(){
|
||||
const { data, code } = await permission();
|
||||
if(code == 200) {
|
||||
this.permissions = data;
|
||||
}
|
||||
// const { data, code } = await permission();
|
||||
// if(code == 200) {
|
||||
//
|
||||
// }
|
||||
this.permissions = ['sys:user:add', 'sys:user:edit', 'sys:user:delete', 'sys:user:import', 'sys:user:export'];
|
||||
}
|
||||
},
|
||||
persist: {
|
||||
storage: localStorage,
|
||||
paths: ['token', 'userInfo', 'permissions', 'menus' ],
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -36,7 +36,7 @@
|
||||
<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" :disabled="true" placeholder="请选择">
|
||||
<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>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<lay-container style="padding: 20px">
|
||||
<lay-card>
|
||||
<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="addShowMsd()">新增</lay-button>
|
||||
</div>
|
||||
<lay-table size="lg" ref="tableRef6" children-column-name="children" :columns="columns6"
|
||||
|
@ -94,7 +94,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { login } from '../../api/module/user'
|
||||
import { login } from '../../api/module/home'
|
||||
import { verificationImg, loginQrcode } from '../../api/module/commone'
|
||||
import { defineComponent, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@ -118,12 +118,14 @@ export default defineComponent({
|
||||
|
||||
const loginSubmit = async () => {
|
||||
loging.value = true;
|
||||
login(loginForm).then(({ data, code, msg }) => {
|
||||
login(loginForm).then((res) => {
|
||||
console.log(res)
|
||||
setTimeout(() => {
|
||||
loging.value = false;
|
||||
if (code == 200) {
|
||||
layer.msg(msg, { icon: 1 }, async () => {
|
||||
userStore.token = data.token
|
||||
if (res.code == 1) {
|
||||
layer.msg('登陆成功!', { icon: 1 }, async () => {
|
||||
userStore.token = res.data.password;
|
||||
userStore.userInfo=res.data;
|
||||
await userStore.loadMenus()
|
||||
await userStore.loadPermissions()
|
||||
router.push('/home')
|
||||
|
@ -44,23 +44,26 @@
|
||||
<template v-slot:password="{ data }">
|
||||
{{ data.password }}
|
||||
</template>
|
||||
<template v-slot:operator="{}">
|
||||
<span style="color: #00A394;cursor: pointer" @click="visible11 = true">详情</span>
|
||||
<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-card>
|
||||
</lay-col>
|
||||
</lay-row>
|
||||
</lay-container>
|
||||
<lay-layer v-model="visible11" title="月度自评详情" :type="4" :shade="true" :area="['950px','100%']">
|
||||
<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 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>
|
||||
<!-- <div style="color: #999999">2025-01-01 14:35:33</div>-->
|
||||
</template>
|
||||
</lay-step-item>
|
||||
<lay-step-item>
|
||||
@ -72,172 +75,180 @@
|
||||
</lay-step>
|
||||
</div>
|
||||
</lay-card>
|
||||
<lay-table ref="tableRef6" children-column-name="children" :columns="columns6"
|
||||
:data-source="dataSource6"></lay-table>
|
||||
<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>
|
||||
</template>
|
||||
</lay-table>
|
||||
</lay-container>
|
||||
</lay-layer>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {ref, watch} from 'vue'
|
||||
<script setup lang="ts">
|
||||
import {ref, onMounted} from 'vue'
|
||||
import {layer} from '@layui/layer-vue'
|
||||
import {
|
||||
MonthlyList,
|
||||
MonthlyContent, MonthlyCreate,MonthlyInfo
|
||||
} from '../../api/module/home'
|
||||
import {useUserStore} from "@/store/user";
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const active = ref(1)
|
||||
const visible11 = ref(false)
|
||||
const selectedKeys = ref(['1'])
|
||||
const checkbox = ref(true)
|
||||
const defaultToolbar = ref(true)
|
||||
const page = ref({total: 100, limit: 10, current: 2})
|
||||
const columns6 = [
|
||||
{
|
||||
title: "考评项目",
|
||||
width: "100px",
|
||||
key: "id"
|
||||
},
|
||||
{
|
||||
title: "分值",
|
||||
width: "200px",
|
||||
key: "name"
|
||||
},
|
||||
{
|
||||
title: "自评分",
|
||||
width: "100px",
|
||||
key: "sex"
|
||||
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);
|
||||
|
||||
onMounted(() => {
|
||||
getMonthlyList();
|
||||
getMonthlyContent();
|
||||
})
|
||||
const getMonthlyInfo = (item) => {
|
||||
visible11.value=true;
|
||||
addIsInfo.value=2;
|
||||
MonthlyInfo({'user_id': userStore.userInfo.id, 'month': item.month}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource6.value = res.data;
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
})
|
||||
}
|
||||
const getMonthlyList = () => {
|
||||
MonthlyList({'user_id': userStore.userInfo.id}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource.value = res.data;
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
})
|
||||
}
|
||||
const dataSource6 = ref([]);
|
||||
const getMonthlyContent = () => {
|
||||
MonthlyContent({'type': 3}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
dataSource6.value = res.data;
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
})
|
||||
}
|
||||
const columns6 = [
|
||||
{
|
||||
title: "考评项目",
|
||||
width: "300px",
|
||||
key: "project_name"
|
||||
},
|
||||
{
|
||||
title: "分值",
|
||||
width: "100px",
|
||||
align: 'center',
|
||||
key: "base_score"
|
||||
},
|
||||
{
|
||||
title: "自评分",
|
||||
width: "100px",
|
||||
align: 'center',
|
||||
customSlot: 'input',
|
||||
key: "input"
|
||||
}
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '月度',
|
||||
width: '100px',
|
||||
align: 'center',
|
||||
key: 'month'
|
||||
},
|
||||
{
|
||||
title: '考评对象',
|
||||
width: '150px',
|
||||
align: 'center',
|
||||
key: 'user'
|
||||
},
|
||||
{
|
||||
title: '参评时间',
|
||||
width: '180px',
|
||||
align: 'center',
|
||||
key: 'currentMonth'
|
||||
},
|
||||
{
|
||||
title: '加分',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '扣分',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '自评总分',
|
||||
key: 'self_score',
|
||||
align: 'center',
|
||||
}, {
|
||||
title: '科室评分',
|
||||
key: 'department_score',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180px',
|
||||
customSlot: 'operator',
|
||||
key: 'operator',
|
||||
align: 'center',
|
||||
fixed: 'right'
|
||||
}
|
||||
]
|
||||
|
||||
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});
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
layer.msg('提交成功!', {icon: 1})
|
||||
visible11.value = false;
|
||||
getMonthlyList();
|
||||
getMonthlyContent();
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2})
|
||||
}
|
||||
]
|
||||
const dataSource6 = [
|
||||
{
|
||||
id:"10001", name:"张三 1", sex:"男", children: [
|
||||
{
|
||||
id:"10009", name:"张三 1-1", sex:"男"},
|
||||
{
|
||||
id:"10012", name:"张三 1-2", sex:"男", children: [
|
||||
{id:"10013", name:"张三 1-2-1", sex:"男"},
|
||||
{id:"10014", name:"张三 1-2-2", sex:"男"}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
width: '50px',
|
||||
customSlot: 'id',
|
||||
align: 'center',
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
title: '月度',
|
||||
width: '100px',
|
||||
align: 'center',
|
||||
customSlot: 'username',
|
||||
key: 'username'
|
||||
},
|
||||
{
|
||||
title: '考评对象',
|
||||
width: '150px',
|
||||
customSlot: 'password',
|
||||
align: 'center',
|
||||
key: 'password'
|
||||
},
|
||||
{
|
||||
title: '参评时间',
|
||||
width: '180px',
|
||||
align: 'center',
|
||||
key: 'age'
|
||||
},
|
||||
{
|
||||
title: '加分',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '扣分',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '自评总分',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
}, {
|
||||
title: '科室评分',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180px',
|
||||
customSlot: 'operator',
|
||||
key: 'operator',
|
||||
align: 'center',
|
||||
fixed: 'right'
|
||||
}
|
||||
]
|
||||
|
||||
const dataSource = [
|
||||
{
|
||||
id: '1',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '1',
|
||||
age: '2024-01'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
username: 'shana',
|
||||
password: '夏娜',
|
||||
remark: '2',
|
||||
age: '2024-01'
|
||||
}
|
||||
]
|
||||
|
||||
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})
|
||||
}
|
||||
|
||||
const searchAccount = ref('')
|
||||
const searchEmail = ref('')
|
||||
|
||||
function toReset() {
|
||||
searchAccount.value = ''
|
||||
searchEmail.value = ''
|
||||
}
|
||||
|
||||
return {
|
||||
active,
|
||||
dataSource6,
|
||||
columns6,
|
||||
visible11,
|
||||
columns,
|
||||
dataSource,
|
||||
selectedKeys,
|
||||
checkbox,
|
||||
defaultToolbar,
|
||||
page,
|
||||
rowClick,
|
||||
rowDoubleClick,
|
||||
change,
|
||||
toReset,
|
||||
toSearch,
|
||||
searchAccount,
|
||||
searchEmail
|
||||
},
|
||||
{
|
||||
text: "取消",
|
||||
callback: () => {
|
||||
visible11.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
</script>
|
||||
<style>
|
||||
.layui-table-header .layui-table-cell {
|
||||
|
Loading…
x
Reference in New Issue
Block a user