feat: 部分修改

This commit is contained in:
砂糖
2025-09-17 14:13:25 +08:00
parent 7915dca668
commit 61ddf4c53c
12 changed files with 924 additions and 473 deletions

View File

@@ -14,7 +14,7 @@ const isDark = useDark()
onMounted(() => {
nextTick(() => {
console.log(isDark.value)
if (!isDark.value) {
if (isDark.value) {
useSettingsStore().toggleTheme()
}
handleThemeStyle(useSettingsStore().theme)

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询考勤计件明细 - 记录具体工件的数量和单价信息列表
export function listAttendancePieceDetail(query) {
return request({
url: '/oa/attendancePieceDetail/list',
method: 'get',
params: query
})
}
// 查询考勤计件明细 - 记录具体工件的数量和单价信息详细
export function getAttendancePieceDetail(detailId) {
return request({
url: '/oa/attendancePieceDetail/' + detailId,
method: 'get'
})
}
// 新增考勤计件明细 - 记录具体工件的数量和单价信息
export function addAttendancePieceDetail(data) {
return request({
url: '/oa/attendancePieceDetail',
method: 'post',
data: data
})
}
// 修改考勤计件明细 - 记录具体工件的数量和单价信息
export function updateAttendancePieceDetail(data) {
return request({
url: '/oa/attendancePieceDetail',
method: 'put',
data: data
})
}
// 删除考勤计件明细 - 记录具体工件的数量和单价信息
export function delAttendancePieceDetail(detailId) {
return request({
url: '/oa/attendancePieceDetail/' + detailId,
method: 'delete'
})
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="applications-wrapper">
<div class="applications-wrapper" :class="{ 'dark': isDark }">
<!-- 业务功能区常用应用 -->
<div class="business-area">
<!-- 常用应用标题栏 -->
@@ -129,6 +129,7 @@
import { getRouters } from '@/api/menu'
import { More } from '@element-plus/icons-vue'
import { useStorage } from '@vueuse/core'
import { useDark } from '@vueuse/core'
export default {
name: 'AllApplications',
@@ -159,6 +160,12 @@ export default {
)
}
},
setup() {
const isDark = useDark()
return {
isDark
}
},
created() {
// 1. 初始化菜单数据
this.fetchMenus()
@@ -254,387 +261,418 @@ export default {
</script>
<style lang="scss" scoped>
/* 外层容器统一样式:色背景 */
/* 外层容器统一样式:色背景(默认) */
.applications-wrapper {
padding: 20px;
}
/* 亮色主题变量 */
--color-text-primary: #111827;
--color-text-secondary: #4b5563;
--color-text-tertiary: #6b7280;
--color-bg-primary: #ffffff;
--color-bg-secondary: #f8f9fa;
--color-bg-tertiary: #e9ecef;
--color-bg-card: #ffffff;
--color-bg-icon: #eee;
--color-border-primary: #dee2e6;
--shadow-card: 0 2px 12px 0 rgba(0, 0, 0, 0.08);
--shadow-card-hover: 0 4px 16px 0 rgba(0, 0, 0, 0.12);
--shadow-app-item: 0 2px 4px rgba(0, 0, 0, 0.08);
/* 一、常用应用区域样式 */
.business-area {
margin-bottom: 32px;
}
/* 一、常用应用区域样式 */
.business-area {
margin-bottom: 32px;
}
/* 常用应用标题栏 */
.business-area-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
/* 常用应用标题栏 */
.business-area-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
}
.business-area-title {
font-size: 18px;
font-weight: 600;
color: #E5E7EB;
margin: 0;
}
.business-area-title {
font-size: 18px;
font-weight: 600;
color: var(--color-text-primary);
margin: 0;
}
.edit-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: #2C2C3C;
border: none;
border-radius: 6px;
color: #E5E7EB;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
.edit-btn {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: var(--color-bg-primary);
border: none;
border-radius: 6px;
color: var(--color-text-primary);
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
&:hover {
background: #3A3A4A;
color: #F9FAFB;
&:hover {
background: var(--color-bg-secondary);
color: var(--color-text-primary);
}
}
/* 常用应用列表 */
.business-modules {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 24px;
}
.business-module {
display: flex;
align-items: center;
padding: 16px;
border-radius: 12px;
background: var(--color-bg-card);
box-shadow: var(--shadow-card);
transition: all 0.2s;
cursor: pointer;
&:hover {
box-shadow: var(--shadow-card-hover);
transform: translateY(-2px);
background: var(--color-bg-secondary);
}
}
.business-module-icon {
width: 40px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 12px;
background: var(--color-bg-icon);
:deep(svg) {
font-size: 20px;
color: var(--color-text-primary);
}
}
.business-module-title {
font-size: 16px;
font-weight: 500;
color: var(--color-text-primary);
margin: 0;
}
/* 二、全部应用区域样式 */
.all-applications-container {
padding: 20px;
border-radius: 8px;
background: var(--color-bg-card);
}
.title {
font-size: 18px;
font-weight: 600;
margin-bottom: 16px;
color: var(--color-text-primary);
}
/* 应用列表网格 */
.app-grid {
display: flex;
flex-wrap: wrap;
gap: 16px;
padding-top: 10px;
margin: 10px 0;
}
/* 应用卡片 */
.app-item {
display: flex;
flex-direction: row;
align-items: center;
cursor: pointer;
border-radius: 8px;
padding: 20px;
width: 160px;
transition: all 0.3s ease;
background-color: var(--color-bg-primary);
box-shadow: var(--shadow-app-item);
position: relative;
&:hover {
box-shadow: var(--shadow-card-hover);
transform: translateY(-2px);
background-color: var(--color-bg-secondary);
}
}
/* 应用图标容器 */
.app-icon-wrapper {
width: 40px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
background-color: var(--color-bg-icon);
transition: background-color 0.3s ease;
}
.app-icon {
font-size: 24px;
color: var(--color-text-primary);
}
/* 应用名称 */
.app-name {
font-size: 14px;
color: var(--color-text-primary);
flex: 1;
}
/* 三点菜单 */
.app-actions {
position: absolute;
top: 8px;
right: 8px;
opacity: 0;
transition: opacity 0.3s ease;
}
.app-item:hover .app-actions {
opacity: 1;
}
.actions-icon {
cursor: pointer;
display: inline-block;
width: 16px;
height: 16px;
display: flex;
align-items: center;
justify-content: center;
color: var(--color-text-primary);
}
/* 三、设置弹窗样式 */
.dialog-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.setting-dialog {
width: 500px;
border-radius: 12px;
background: var(--color-bg-card);
}
.dialog-header {
padding: 16px 24px;
border-bottom: 1px solid var(--color-border-primary);
display: flex;
justify-content: space-between;
align-items: center;
}
.dialog-header h3 {
margin: 0;
font-size: 18px;
color: var(--color-text-primary);
}
.close-btn {
background: none;
border: none;
cursor: pointer;
color: var(--color-text-tertiary);
font-size: 18px;
&:hover {
color: var(--color-text-primary);
}
}
.dialog-content {
padding: 24px;
max-height: 400px;
overflow-y: auto;
background: var(--color-bg-primary);
}
/* 空状态提示 */
.empty-tip {
text-align: center;
padding: 40px 0;
color: var(--color-text-tertiary);
font-size: 14px;
background: var(--color-bg-tertiary);
border-radius: 8px;
}
/* 常用应用编辑列表 */
.module-list {
list-style: none;
padding: 0;
margin: 0;
}
.module-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid var(--color-border-primary);
&:last-child {
border-bottom: none;
}
}
.module-info {
display: flex;
align-items: center;
gap: 12px;
}
.module-index {
width: 24px;
height: 24px;
border-radius: 50%;
background: var(--color-bg-tertiary);
color: var(--color-text-secondary);
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.module-name {
font-size: 16px;
color: var(--color-text-primary);
}
.module-actions {
display: flex;
gap: 8px;
}
/* 弹窗底部按钮 */
.dialog-footer {
padding: 16px 24px;
border-top: 1px solid var(--color-border-primary);
display: flex;
justify-content: flex-end;
gap: 12px;
}
.cancel-btn, .confirm-btn {
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
border: none;
}
.cancel-btn {
background: var(--color-bg-tertiary);
color: var(--color-text-secondary);
&:hover {
background: var(--color-bg-secondary);
color: var(--color-text-primary);
}
}
.confirm-btn {
background: #3b82f6;
color: #fff;
&:hover {
background: #2563eb;
}
}
/* 四、Element组件样式穿透调整 */
:deep(.el-tabs__header) {
margin-bottom: 12px;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
background-color: var(--color-border-primary);
}
:deep(.el-tabs__item) {
font-size: 15px;
color: var(--color-text-tertiary);
}
:deep(.el-tabs__item.is-active) {
color: var(--color-text-primary);
}
:deep(.el-dropdown-menu) {
min-width: 120px;
background-color: var(--color-bg-card);
border: 1px solid var(--color-border-primary);
}
:deep(.el-dropdown-item) {
padding: 6px 16px;
font-size: 14px;
color: var(--color-text-secondary);
&:hover {
background-color: var(--color-bg-secondary);
}
}
:deep(.el-button) {
padding: 6px 12px;
color: var(--color-text-secondary);
background-color: var(--color-bg-tertiary);
border: none;
&:hover {
background-color: var(--color-bg-secondary);
}
}
}
/* 常用应用列表 */
.business-modules {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 24px;
.applications-wrapper.dark {
/* 暗色主题变量 */
--color-text-primary: #e5e7eb;
--color-text-secondary: #e5e7eb;
--color-text-tertiary: #9ca3af;
--color-bg-primary: #1e1e2e;
--color-bg-secondary: #2c2c3c;
--color-bg-tertiary: #3a3a4a;
--color-bg-card: #2c2c3c;
--color-bg-icon: #4b5563;
--color-border-primary: #3a3a4a;
--shadow-card: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
--shadow-card-hover: 0 4px 16px 0 rgba(0, 0, 0, 0.4);
--shadow-app-item: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.business-module {
display: flex;
align-items: center;
padding: 16px;
border-radius: 12px;
background: #2C2C3C;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
transition: all 0.2s;
cursor: pointer;
&:hover {
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.3);
transform: translateY(-2px);
background: #3A3A4A;
}
}
.business-module-icon {
width: 40px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 12px;
background: #374151; /* 可根据图标色调整背景 */
:deep(svg) {
font-size: 20px;
color: #FFFFFF;
}
}
.business-module-title {
font-size: 16px;
font-weight: 500;
color: #E5E7EB;
margin: 0;
}
/* 二、全部应用区域样式 */
.all-applications-container {
padding: 20px;
border-radius: 8px;
background: #1E1E2E;
}
.title {
font-size: 18px;
font-weight: 600;
margin-bottom: 16px;
color: #E5E7EB;
}
/* 应用列表网格 */
.app-grid {
display: flex;
flex-wrap: wrap;
gap: 16px;
padding-top: 10px;
margin: 10px 0;
}
/* 应用卡片 */
.app-item {
display: flex;
flex-direction: row;
align-items: center;
cursor: pointer;
border-radius: 8px;
padding: 20px;
width: 160px;
transition: all 0.3s ease;
background-color: #2C2C3C;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
position: relative;
&:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
transform: translateY(-2px);
background-color: #3A3A4A;
}
}
/* 应用图标容器 */
.app-icon-wrapper {
width: 40px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
background-color: #374151;
transition: background-color 0.3s ease;
.app-item:hover & {
background-color: #4B5563;
}
}
.app-icon {
font-size: 24px;
color: #F3F4F6;
}
/* 应用名称 */
.app-name {
font-size: 14px;
color: #E5E7EB;
flex: 1;
}
/* 三点菜单 */
.app-actions {
position: absolute;
top: 8px;
right: 8px;
opacity: 0;
transition: opacity 0.3s ease;
}
.app-item:hover .app-actions {
opacity: 1;
}
.actions-icon {
cursor: pointer;
display: inline-block;
width: 16px;
height: 16px;
display: flex;
align-items: center;
justify-content: center;
color: #E5E7EB;
}
/* 三、设置弹窗样式 */
.dialog-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.setting-dialog {
width: 500px;
background: #2C2C3C;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.dialog-header {
padding: 16px 24px;
border-bottom: 1px solid #3A3A4A;
display: flex;
justify-content: space-between;
align-items: center;
}
.dialog-header h3 {
margin: 0;
font-size: 18px;
color: #E5E7EB;
}
.close-btn {
background: none;
border: none;
cursor: pointer;
color: #9CA3AF;
font-size: 18px;
&:hover {
color: #F9FAFB;
}
}
.dialog-content {
padding: 24px;
max-height: 400px;
overflow-y: auto;
background: #2C2C3C;
}
/* 空状态提示 */
.empty-tip {
text-align: center;
padding: 40px 0;
color: #9CA3AF;
font-size: 14px;
background: #374151;
border-radius: 8px;
}
/* 常用应用编辑列表 */
.module-list {
list-style: none;
padding: 0;
margin: 0;
}
.module-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid #3A3A4A;
&:last-child {
border-bottom: none;
}
}
.module-info {
display: flex;
align-items: center;
gap: 12px;
}
.module-index {
width: 24px;
height: 24px;
border-radius: 50%;
background: #374151;
color: #E5E7EB;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.module-name {
font-size: 16px;
color: #E5E7EB;
}
.module-actions {
display: flex;
gap: 8px;
}
/* 弹窗底部按钮 */
.dialog-footer {
padding: 16px 24px;
border-top: 1px solid #3A3A4A;
display: flex;
justify-content: flex-end;
gap: 12px;
background: #2C2C3C;
}
.cancel-btn, .confirm-btn {
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
border: none;
}
.cancel-btn {
background: #374151;
color: #E5E7EB;
&:hover {
background: #4B5563;
color: #F9FAFB;
}
}
.confirm-btn {
background: #3B82F6;
color: #fff;
&:hover {
background: #2563eb;
}
}
/* 四、Element组件样式穿透调整 */
:deep(.el-tabs__header) {
margin-bottom: 12px;
}
:deep(.el-tabs__nav-wrap::after) {
height: 1px;
background-color: #3A3A4A;
}
:deep(.el-tabs__item) {
font-size: 15px;
color: #9CA3AF;
}
:deep(.el-tabs__item.is-active) {
color: #E5E7EB;
}
:deep(.el-dropdown-menu) {
min-width: 120px;
background-color: #2C2C3C;
border: 1px solid #3A3A4A;
}
:deep(.el-dropdown-item) {
padding: 6px 16px;
font-size: 14px;
color: #E5E7EB;
&:hover {
background-color: #3A3A4A;
}
}
:deep(.el-button) {
padding: 6px 12px;
color: #E5E7EB;
background-color: #374151;
border: none;
&:hover {
background-color: #4B5563;
}
}
</style>

View File

@@ -40,7 +40,8 @@ const realSrc = computed(() => {
if (isExternal(real_src)) {
return real_src
}
return import.meta.env.VITE_APP_BASE_API + real_src
// return import.meta.env.VITE_APP_BASE_API + real_src
return realSrc
})
const realSrcList = computed(() => {
@@ -53,7 +54,7 @@ const realSrcList = computed(() => {
if (isExternal(item)) {
return srcList.push(item)
}
return srcList.push(import.meta.env.VITE_APP_BASE_API + item)
return srcList.push(item)
})
return srcList
})

View File

@@ -57,7 +57,7 @@ const props = defineProps({
// 上传接口地址
action: {
type: String,
default: "/common/upload"
default: "/system/oss/upload"
},
// 上传携带的参数
data: {
@@ -117,7 +117,7 @@ watch(() => props.modelValue, val => {
fileList.value = list.map(item => {
if (typeof item === "string") {
if (item.indexOf(baseUrl) === -1 && !isExternal(item)) {
item = { name: baseUrl + item, url: baseUrl + item }
item = { name: item, url: item }
} else {
item = { name: item, url: item }
}
@@ -173,7 +173,8 @@ function handleExceed() {
// 上传成功回调
function handleUploadSuccess(res, file) {
if (res.code === 200) {
uploadList.value.push({ name: res.fileName, url: res.fileName })
console.log(res, '上传成功')
uploadList.value.push({ name: res.data.fileName, url: res.data.url })
uploadedSuccessfully()
} else {
number.value--
@@ -223,7 +224,7 @@ function listToString(list, separator) {
separator = separator || ","
for (let i in list) {
if (undefined !== list[i].url && list[i].url.indexOf("blob:") !== 0) {
strs += list[i].url.replace(baseUrl, "") + separator
strs += list[i].url + separator
}
}
return strs != "" ? strs.substr(0, strs.length - 1) : ""

View File

@@ -7,7 +7,7 @@ export default {
/**
* 侧边栏主题 深色主题theme-dark浅色主题theme-light
*/
sideTheme: 'theme-dark',
sideTheme: 'theme-light',
/**
* 是否系统布局配置

View File

@@ -1,5 +1,5 @@
<template>
<div class="login">
<div class="login" :class="{ 'dark': isDark }">
<div class="login-container">
<div class="login-right">
<img :src="RightImage" alt="" class="right-img" />
@@ -55,7 +55,9 @@ import { encrypt, decrypt } from "@/utils/jsencrypt"
import useUserStore from '@/store/modules/user'
import useProductStore from '@/store/modules/product'
import RightImage from '@/assets/images/right.png'
import LogoImage from '@/assets/logo/logo.png'
import { useDark } from "@vueuse/core"
const isDark = useDark()
const title = import.meta.env.VITE_APP_TITLE
const userStore = useUserStore()
@@ -152,115 +154,168 @@ getCookie()
</script>
<style lang='scss' scoped>
// 亮色主题(默认)
.login {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-color: #1a1a1a;
background-size: cover;
}
/* 亮色主题变量 */
--color-bg-primary: #f5f7fa;
--color-bg-form: #ffffff;
--color-bg-input: #f0f2f5;
--color-border-input: #dcdfe6;
--color-text-primary: #303133;
--color-text-secondary: #606266;
--color-text-placeholder: #909399;
--color-btn-primary: #409eff;
--color-btn-primary-hover: #66b1ff;
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #ebebeb;
display: flex;
align-items: center;
justify-content: center;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
color: var(--color-text-primary);
display: flex;
align-items: center;
justify-content: center;
}
.right-img {
width: 100%;
height: 100%;
}
.right-img {
width: 100%;
height: 100%;
}
.logo-img {
width: 50px;
height: 50px;
}
.logo-img {
width: 50px;
height: 50px;
}
.login-container {
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
// height: 60%;
width: 60%;
padding: 25px 25px 5px 25px;
}
.login-container {
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
width: 60%;
padding: 25px 25px 5px 25px;
}
:deep(.el-input__wrapper) {
background: #333333;
border-radius: 6px;
border: 1px solid #444444;
}
.el-input {
color: #ebebeb;
}
.login-form {
z-index: 1;
flex: 3;
border-radius: 6px;
background: #292929;
padding: 25px;
:deep(.el-input__wrapper) {
background: var(--color-bg-input);
border-radius: 6px;
border: 1px solid var(--color-border-input);
}
.el-input {
height: 40px;
color: var(--color-text-primary);
}
input {
.login-form {
z-index: 1;
flex: 3;
border-radius: 6px;
background: var(--color-bg-form);
padding: 25px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
.el-input {
height: 40px;
input {
height: 40px;
color: var(--color-text-primary);
}
input::placeholder {
color: var(--color-text-placeholder);
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 0px;
color: var(--color-text-secondary);
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 0px;
.login-right {
display: flex;
padding: 30px;
flex: 4;
}
.login-tip {
font-size: 13px;
text-align: center;
color: var(--color-text-secondary);
}
.login-code {
width: 33%;
height: 40px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: var(--color-text-secondary);
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 40px;
padding-left: 12px;
}
/* Element组件样式调整 */
:deep(.el-checkbox__label) {
color: var(--color-text-primary);
}
:deep(.el-button--primary) {
background-color: var(--color-btn-primary);
border-color: var(--color-btn-primary);
}
:deep(.el-button--primary:hover) {
background-color: var(--color-btn-primary-hover);
border-color: var(--color-btn-primary-hover);
}
:deep(.link-type) {
color: var(--color-btn-primary);
}
}
.login-right {
display: flex;
padding: 30px;
// 暗色主题
.login.dark {
/* 暗色主题变量 - 覆盖亮色变量 */
--color-bg-primary: #1a1a1a;
--color-bg-form: #292929;
--color-bg-input: #333333;
--color-border-input: #444444;
--color-text-primary: #ebebeb;
--color-text-secondary: #bfbfbf;
--color-text-placeholder: #999999;
--color-btn-primary: #409eff;
--color-btn-primary-hover: #66b1ff;
flex: 4;
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 40px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
.login-form {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 40px;
padding-left: 12px;
}
</style>

View File

@@ -104,6 +104,7 @@
type="text"
icon="Money"
@click="handlePay(scope.row)"
v-if="scope.row.balanceAmount > 0"
>付款</el-button>
</template>
</el-table-column>

View File

@@ -104,6 +104,7 @@
type="text"
icon="Money"
@click="handleReceive(scope.row)"
v-if="scope.row.balanceAmount > 0"
>收款</el-button>
</template>
</el-table-column>

View File

@@ -1,7 +1,13 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="用户ID" prop="userId">
<el-form-item label="薪酬类型" prop="paymentType">
<el-radio-group v-model="queryParams.paymentType" @change="getList">
<el-radio-button label="hourly">计时</el-radio-button>
<el-radio-button label="piecework">计件</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="用户" prop="userId">
<user-select v-model="queryParams.userId" />
</el-form-item>
<el-form-item label="记录日期" prop="recordDate">
@@ -95,7 +101,13 @@
<span>{{ parseTime(scope.row.endTime, '{h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="时长(小时)" align="center" prop="durationHour" />
<el-table-column label="时长(小时)" align="center" prop="durationHour" v-if="queryParams.paymentType === 'hourly'"/>
<el-table-column label="计件数量" align="center" prop="pieceCount" v-if="queryParams.paymentType === 'piecework'">
<template #default="scope">
<span @click="handlePieceCount(scope.row)" style="color: #409EFF; cursor: pointer;">{{ scope.row.pieceCount }}</span>
</template>
</el-table-column>
<el-table-column label="薪酬" align="center" prop="wage" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
@@ -158,9 +170,21 @@
value-format="HH:mm:ss"
/>
</el-form-item>
<el-form-item label="时长(小时)" prop="durationHour">
<el-form-item label="薪酬类型" prop="paymentType" style="width: 100%;">
<el-radio-group v-model="form.paymentType" >
<el-radio-button label="hourly">计时</el-radio-button>
<el-radio-button label="piecework">计件</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="时长(小时)" prop="durationHour" style="width: 100%;" v-if="form.paymentType === 'hourly'">
<el-input-number v-model="form.durationHour" placeholder="请输入时长(小时)" />
</el-form-item>
<el-form-item label="计件数量" prop="pieceCount" style="width: 100%;" v-if="form.paymentType === 'piecework'">
<el-input-number v-model="form.pieceCount" placeholder="请输入计件数量" />
</el-form-item>
<el-form-item label="薪酬" prop="wage">
<el-input v-model="form.wage" placeholder="请输入薪酬" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
@@ -172,13 +196,20 @@
</div>
</template>
</el-dialog>
<!-- 计件详情 -->
<el-dialog title="计件详情" v-model="pieceDetailOpen" width="1000px" append-to-body>
<AttendancePieceDetail :recordId="form.recordId" />
</el-dialog>
</div>
</template>
<script setup name="AttendanceRecord">
import UserSelect from '@/components/UserSelect'
import AttendancePieceDetail from './detail.vue'
import { listAttendanceRecord, getAttendanceRecord, delAttendanceRecord, addAttendanceRecord, updateAttendanceRecord } from "@/api/oa/attendanceRecord";
const { proxy } = getCurrentInstance();
const props = defineProps({
@@ -198,10 +229,12 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const pieceDetailOpen = ref(false);
const data = reactive({
form: {},
queryParams: {
paymentType: 'hourly', // 薪酬类型: hourly(计时),piecework(计件)
pageNum: 1,
pageSize: 10,
userId: undefined,
@@ -268,7 +301,10 @@ function reset() {
updateTime: null,
updateBy: null,
delFlag: null,
remark: null
remark: null,
wage: null,
paymentType: queryParams.value.paymentType,
pieceCount: null
};
proxy.resetForm("attendanceRecordRef");
}
@@ -374,5 +410,12 @@ function handleExport() {
}, `attendanceRecord_${new Date().getTime()}.xlsx`)
}
function handlePieceCount(row) {
// 获取计件详情
console.log(row);
pieceDetailOpen.value = true;
form.value.recordId = row.recordId;
}
getList();
</script>

View File

@@ -0,0 +1,259 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="attendancePieceDetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工件编码" align="center" prop="workpieceCode" />
<el-table-column label="工件名称" align="center" prop="workpieceName" />
<el-table-column label="工件数量" align="center" prop="pieceQuantity" />
<el-table-column label="单位单价" align="center" prop="unitPrice" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改考勤计件明细 - 记录具体工件的数量和单价信息对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="attendancePieceDetailRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="工件编码" prop="workpieceCode">
<el-input v-model="form.workpieceCode" placeholder="请输入工件编码" />
</el-form-item>
<el-form-item label="工件名称" prop="workpieceName">
<el-input v-model="form.workpieceName" placeholder="请输入工件名称" />
</el-form-item>
<el-form-item label="工件数量" prop="pieceQuantity">
<el-input v-model="form.pieceQuantity" placeholder="请输入工件数量" />
</el-form-item>
<el-form-item label="单位单价" prop="unitPrice">
<el-input v-model="form.unitPrice" placeholder="请输入单位单价" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="AttendancePieceDetail">
import { listAttendancePieceDetail, getAttendancePieceDetail, delAttendancePieceDetail, addAttendancePieceDetail, updateAttendancePieceDetail } from "@/api/oa/attendancePieceDetail";
const { proxy } = getCurrentInstance();
const attendancePieceDetailList = ref([]);
const open = ref(false);
const buttonLoading = ref(false);
const loading = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const props = defineProps({
recordId: {
required: true,
type: [String, Number],
default: undefined
}
})
const formatterTime = (time) => {
return proxy.parseTime(time, '{y}-{m}-{d}')
}
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
recordId: props.recordId,
workpieceCode: undefined,
workpieceName: undefined,
pieceQuantity: undefined,
unitPrice: undefined,
},
rules: {
}
});
watch(props.recordId, (newVal) => {
if (newVal) {
queryParams.value.recordId = newVal;
getList();
}
}, { immediate: true });
const { queryParams, form, rules } = toRefs(data);
/** 查询考勤计件明细 - 记录具体工件的数量和单价信息列表 */
function getList() {
loading.value = true;
listAttendancePieceDetail(queryParams.value).then(response => {
attendancePieceDetailList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
// 取消按钮
function cancel() {
open.value = false;
reset();
}
// 表单重置
function reset() {
form.value = {
detailId: null,
recordId: props.recordId,
workpieceCode: null,
workpieceName: null,
pieceQuantity: null,
unitPrice: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null,
delFlag: null,
remark: null
};
proxy.resetForm("attendancePieceDetailRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
// 多选框选中数据
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.detailId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加考勤计件明细 - 记录具体工件的数量和单价信息";
}
/** 修改按钮操作 */
function handleUpdate(row) {
loading.value = true
reset();
const _detailId = row.detailId || ids.value
getAttendancePieceDetail(_detailId).then(response => {
loading.value = false;
form.value = response.data;
open.value = true;
title.value = "修改考勤计件明细 - 记录具体工件的数量和单价信息";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["attendancePieceDetailRef"].validate(valid => {
if (valid) {
buttonLoading.value = true;
if (form.value.detailId != null) {
updateAttendancePieceDetail(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
});
} else {
addAttendancePieceDetail(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
}).finally(() => {
buttonLoading.value = false;
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _detailIds = row.detailId || ids.value;
proxy.$modal.confirm('是否确认删除考勤计件明细 - 记录具体工件的数量和单价信息编号为"' + _detailIds + '"的数据项?').then(function() {
loading.value = true;
return delAttendancePieceDetail(_detailIds);
}).then(() => {
loading.value = true;
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
loading.value = false;
});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('oa/attendancePieceDetail/export', {
...queryParams.value
}, `attendancePieceDetail_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@@ -50,6 +50,11 @@
<el-table-column label="产品名称" align="center" prop="productName" />
<el-table-column label="负责人" align="center" prop="owner" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="样品图" align="center">
<template #default="scope">
<ImagePreview :src="scope.row.image" />
</template>
</el-table-column>
<el-table-column label="BOM" align="center">
<template #default="scope">
<BomInfoMini :bomId="scope.row.bomId" />
@@ -81,6 +86,9 @@
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="样品图" prop="">
<ImageUpload v-model="form.image" />
</el-form-item>
<el-form-item label="产品分类" prop="categoryId">
<!-- <el-tree-select v-model="form.categoryId" :data="categoryList" :props="defaultProps" /> -->
<el-select v-model="form.categoryId" placeholder="请选择产品分类">