管理账号隐藏、解决日期偏移问题

parent d6a7546a
...@@ -44,10 +44,12 @@ ...@@ -44,10 +44,12 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 默认账号提示(上线后移除)
<div class="login-tips"> <div class="login-tips">
<p>默认管理员账号:admin@company.com</p> <p>默认管理员账号:admin@company.com</p>
<p>默认密码:password</p> <p>默认密码:password</p>
</div> </div>
-->
</div> </div>
</div> </div>
</template> </template>
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<el-table :data="list" stripe v-loading="loading"> <el-table :data="list" stripe v-loading="loading">
<el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" /> <el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" />
<el-table-column label="请假日期" width="110"> <el-table-column label="请假日期" width="110">
<template #default="{ row }">{{ row.leave_date?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.leave_date).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="days" label="天数" width="80" /> <el-table-column prop="days" label="天数" width="80" />
<el-table-column prop="description" label="说明" min-width="200" show-overflow-tooltip /> <el-table-column prop="description" label="说明" min-width="200" show-overflow-tooltip />
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="申请时间" width="110"> <el-table-column label="申请时间" width="110">
<template #default="{ row }">{{ row.created_at?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.created_at).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="190" fixed="right"> <el-table-column label="操作" width="190" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<el-table :data="list" stripe v-loading="loading"> <el-table :data="list" stripe v-loading="loading">
<el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" /> <el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" />
<el-table-column label="调休日期" width="110"> <el-table-column label="调休日期" width="110">
<template #default="{ row }">{{ row.leave_date?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.leave_date).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="hours" label="调休时长(h)" width="110" /> <el-table-column prop="hours" label="调休时长(h)" width="110" />
<el-table-column prop="description" label="说明" min-width="200" show-overflow-tooltip /> <el-table-column prop="description" label="说明" min-width="200" show-overflow-tooltip />
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="申请时间" width="110"> <el-table-column label="申请时间" width="110">
<template #default="{ row }">{{ row.created_at?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.created_at).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="190" fixed="right"> <el-table-column label="操作" width="190" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<el-table-column prop="content" label="描述" min-width="180" show-overflow-tooltip /> <el-table-column prop="content" label="描述" min-width="180" show-overflow-tooltip />
<el-table-column prop="uploader_name" label="上传人" width="90" /> <el-table-column prop="uploader_name" label="上传人" width="90" />
<el-table-column label="上传时间" width="110"> <el-table-column label="上传时间" width="110">
<template #default="{ row }">{{ row.created_at?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.created_at).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="140" fixed="right"> <el-table-column label="操作" width="140" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { getDocuments, createDocument, updateDocument, deleteDocument, getAllProjects } from '@/api' import { getDocuments, createDocument, updateDocument, deleteDocument, getAllProjects } from '@/api'
import dayjs from 'dayjs'
const docTypes = ['需求文档', '设计文档', '验收文档', '技术文档', '会议纪要', '其他'] const docTypes = ['需求文档', '设计文档', '验收文档', '技术文档', '会议纪要', '其他']
const loading = ref(false) const loading = ref(false)
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="department" label="部门" width="90" /> <el-table-column prop="department" label="部门" width="90" />
<el-table-column label="入职时间" width="110"> <el-table-column label="入职时间" width="110">
<template #default="{ row }">{{ row.entry_date?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.entry_date).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column label="年假" width="80"> <el-table-column label="年假" width="80">
<template #default="{ row }"> <template #default="{ row }">
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { getEmployees, createEmployee, updateEmployee, deleteEmployee, getAllRoles } from '@/api' import { getEmployees, createEmployee, updateEmployee, deleteEmployee, getAllRoles } from '@/api'
import dayjs from 'dayjs'
const roles = ref<string[]>([]) const roles = ref<string[]>([])
const loading = ref(false) const loading = ref(false)
...@@ -184,7 +185,7 @@ const openDialog = (row?: any) => { ...@@ -184,7 +185,7 @@ const openDialog = (row?: any) => {
Object.assign(form, { Object.assign(form, {
name: row.name, email: row.email, password: '', name: row.name, email: row.email, password: '',
phone: row.phone, role: row.role, department: row.department, phone: row.phone, role: row.role, department: row.department,
entry_date: row.entry_date?.slice(0, 10), status: row.status entry_date: dayjs(row.entry_date).format('YYYY-MM-DD'), status: row.status
}) })
} else { } else {
Object.assign(form, { name: '', email: '', password: '', phone: '', role: '开发', department: '', entry_date: '', status: '在职' }) Object.assign(form, { name: '', email: '', password: '', phone: '', role: '开发', department: '', entry_date: '', status: '在职' })
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" /> <el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" />
<el-table-column prop="project_name" label="项目" min-width="150" /> <el-table-column prop="project_name" label="项目" min-width="150" />
<el-table-column label="加班日期" width="110"> <el-table-column label="加班日期" width="110">
<template #default="{ row }">{{ row.overtime_date?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.overtime_date).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="hours" label="加班时长(h)" width="110" /> <el-table-column prop="hours" label="加班时长(h)" width="110" />
<el-table-column prop="status" label="状态" width="90"> <el-table-column prop="status" label="状态" width="90">
...@@ -181,7 +181,7 @@ const resetQuery = () => { ...@@ -181,7 +181,7 @@ const resetQuery = () => {
const openDialog = (row?: any) => { const openDialog = (row?: any) => {
editItem.value = row || null editItem.value = row || null
if (row) { if (row) {
Object.assign(form, { project_id: row.project_id, overtime_date: row.overtime_date?.slice(0, 10), hours: row.hours, description: row.description }) Object.assign(form, { project_id: row.project_id, overtime_date: dayjs(row.overtime_date).format('YYYY-MM-DD'), hours: row.hours, description: row.description })
} else { } else {
Object.assign(form, { project_id: '', overtime_date: dayjs().format('YYYY-MM-DD'), hours: 2, description: '' }) Object.assign(form, { project_id: '', overtime_date: dayjs().format('YYYY-MM-DD'), hours: 2, description: '' })
} }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<el-table-column label="计划时间" width="200"> <el-table-column label="计划时间" width="200">
<template #default="{ row }"> <template #default="{ row }">
<span v-if="row.plan_start_date"> <span v-if="row.plan_start_date">
{{ row.plan_start_date?.slice(0, 10) }} ~ {{ row.plan_end_date?.slice(0, 10) || '未设置' }} {{ dayjs(row.plan_start_date).format('YYYY-MM-DD') }} ~ {{ dayjs(row.plan_end_date).format('YYYY-MM-DD') || '未设置' }}
</span> </span>
<span v-else class="text-gray">未设置</span> <span v-else class="text-gray">未设置</span>
</template> </template>
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { getProjects, createProject, updateProject, deleteProject, getAllEmployees } from '@/api' import { getProjects, createProject, updateProject, deleteProject, getAllEmployees } from '@/api'
import dayjs from 'dayjs'
const stages = ['立项', '需求分析', '设计', '开发', '测试', '上线', '完成', '暂停'] const stages = ['立项', '需求分析', '设计', '开发', '测试', '上线', '完成', '暂停']
...@@ -186,8 +187,8 @@ const openDialog = (row?: any) => { ...@@ -186,8 +187,8 @@ const openDialog = (row?: any) => {
project_no: row.project_no, project_name: row.project_name, project_no: row.project_no, project_name: row.project_name,
manager_id: row.manager_id, project_type: row.project_type, manager_id: row.manager_id, project_type: row.project_type,
client: row.client, project_stage: row.project_stage, client: row.client, project_stage: row.project_stage,
plan_start_date: row.plan_start_date?.slice(0, 10), plan_start_date: dayjs(row.plan_start_date).format('YYYY-MM-DD'),
plan_end_date: row.plan_end_date?.slice(0, 10), description: row.description plan_end_date: dayjs(row.plan_end_date).format('YYYY-MM-DD'), description: row.description
}) })
} else { } else {
Object.assign(form, { Object.assign(form, {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" width="170"> <el-table-column label="创建时间" width="170">
<template #default="{ row }">{{ row.created_at?.slice(0, 19).replace('T', ' ') }}</template> <template #default="{ row }">{{ dayjs(row.created_at).format('YYYY-MM-DD HH:mm:ss') }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200" fixed="right"> <el-table-column label="操作" width="200" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
...@@ -98,6 +98,7 @@ import { ...@@ -98,6 +98,7 @@ import {
getRoles, getAllRoles, getRole, createRole, updateRole, deleteRole, getRoles, getAllRoles, getRole, createRole, updateRole, deleteRole,
getPermissionsList, getRolePermissions getPermissionsList, getRolePermissions
} from '@/api' } from '@/api'
import dayjs from 'dayjs'
const loading = ref(false) const loading = ref(false)
const saving = ref(false) const saving = ref(false)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" /> <el-table-column prop="employee_name" label="员工" width="90" v-if="isProjecter" />
<el-table-column prop="project_name" label="项目" min-width="150" /> <el-table-column prop="project_name" label="项目" min-width="150" />
<el-table-column label="工作日期" width="110"> <el-table-column label="工作日期" width="110">
<template #default="{ row }">{{ row.work_date?.slice(0, 10) }}</template> <template #default="{ row }">{{ dayjs(row.work_date).format('YYYY-MM-DD') }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="hours" label="工时(h)" width="90" /> <el-table-column prop="hours" label="工时(h)" width="90" />
<el-table-column prop="description" label="工作描述" min-width="200" show-overflow-tooltip /> <el-table-column prop="description" label="工作描述" min-width="200" show-overflow-tooltip />
...@@ -149,7 +149,7 @@ const openDialog = (row?: any) => { ...@@ -149,7 +149,7 @@ const openDialog = (row?: any) => {
editItem.value = row || null editItem.value = row || null
if (row) { if (row) {
Object.assign(form, { Object.assign(form, {
project_id: row.project_id, work_date: row.work_date?.slice(0, 10), project_id: row.project_id, work_date: dayjs(row.work_date).format('YYYY-MM-DD'),
hours: row.hours, description: row.description, is_outside: !!row.is_outside hours: row.hours, description: row.description, is_outside: !!row.is_outside
}) })
} else { } else {
...@@ -202,7 +202,7 @@ const handleExport = async () => { ...@@ -202,7 +202,7 @@ const handleExport = async () => {
const url = window.URL.createObjectURL(blob) const url = window.URL.createObjectURL(blob)
const a = document.createElement('a') const a = document.createElement('a')
a.href = url a.href = url
a.download = `工时记录_${new Date().toISOString().slice(0, 10)}.xlsx` a.download = `工时记录_${dayjs().format('YYYY-MM-DD')}.xlsx`
a.click() a.click()
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
ElMessage.success('导出成功') ElMessage.success('导出成功')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment