解决日期格式显示不正确问题
parent
52c9601609
commit
29efa7b985
|
|
@ -67,6 +67,7 @@
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.workTime"
|
v-model="formData.workTime"
|
||||||
type="date"
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择参加工作时间"
|
placeholder="选择参加工作时间"
|
||||||
/>
|
/>
|
||||||
|
|
@ -93,7 +94,7 @@
|
||||||
import {getStrDictOptions, DICT_TYPE} from '@/utils/dict'
|
import {getStrDictOptions, DICT_TYPE} from '@/utils/dict'
|
||||||
import {EmployeeApi, EmployeeVO} from '@/api/arcb/salary/employee'
|
import {EmployeeApi, EmployeeVO} from '@/api/arcb/salary/employee'
|
||||||
import {StationApi, StationVO} from '@/api/arcb/salary/station'
|
import {StationApi, StationVO} from '@/api/arcb/salary/station'
|
||||||
import {DeptVO, getDeptPage} from "@/api/system/dept";
|
import {getDeptPage} from "@/api/system/dept";
|
||||||
|
|
||||||
/** 员工花名册 表单 */
|
/** 员工花名册 表单 */
|
||||||
defineOptions({name: 'EmployeeForm'})
|
defineOptions({name: 'EmployeeForm'})
|
||||||
|
|
@ -156,7 +157,14 @@ const open = async (type: string, id?: number) => {
|
||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await EmployeeApi.getEmployee(id)
|
// formData.value = await EmployeeApi.getEmployee(id)
|
||||||
|
const employeeData = await EmployeeApi.getEmployee(id)
|
||||||
|
// 处理 workTime 数组
|
||||||
|
if (Array.isArray(employeeData.workTime)) {
|
||||||
|
const [year, month, day] = employeeData.workTime
|
||||||
|
employeeData.workTime = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
|
||||||
|
}
|
||||||
|
formData.value = employeeData
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
<el-table-column label="社保账号" align="center" prop="socialSecurityNo" />
|
<el-table-column label="社保账号" align="center" prop="socialSecurityNo" />
|
||||||
<el-table-column label="养老金帐号" align="center" prop="pensionNo" />
|
<el-table-column label="养老金帐号" align="center" prop="pensionNo" />
|
||||||
<el-table-column label="住房公积金账号" align="center" prop="housingFundNo" />
|
<el-table-column label="住房公积金账号" align="center" prop="housingFundNo" />
|
||||||
<el-table-column label="参加工作时间" align="center" prop="workTime" />
|
<el-table-column label="参加工作时间" align="center" prop="workTime" :formatter="dateFormatter2"/>
|
||||||
<el-table-column label="员工状态" align="center" prop="empStatus">
|
<el-table-column label="员工状态" align="center" prop="empStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.ARCB_EMP_STATUS" :value="scope.row.empStatus" />
|
<dict-tag :type="DICT_TYPE.ARCB_EMP_STATUS" :value="scope.row.empStatus" />
|
||||||
|
|
@ -182,6 +182,7 @@ import { EmployeeApi, EmployeeVO } from '@/api/arcb/salary/employee'
|
||||||
import EmployeeForm from './EmployeeForm.vue'
|
import EmployeeForm from './EmployeeForm.vue'
|
||||||
import EmpImportForm from './EmployeeImportForm.vue'
|
import EmpImportForm from './EmployeeImportForm.vue'
|
||||||
import {StationApi, StationVO} from "@/api/arcb/salary/station";
|
import {StationApi, StationVO} from "@/api/arcb/salary/station";
|
||||||
|
import {dateFormatter2} from "@/utils/formatTime";
|
||||||
|
|
||||||
/** 员工花名册 列表 */
|
/** 员工花名册 列表 */
|
||||||
defineOptions({ name: 'Employee' })
|
defineOptions({ name: 'Employee' })
|
||||||
|
|
@ -217,6 +218,7 @@ const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await EmployeeApi.getEmployeePage(queryParams)
|
const data = await EmployeeApi.getEmployeePage(queryParams)
|
||||||
|
console.log(data)
|
||||||
await getStationOptions()
|
await getStationOptions()
|
||||||
list.value = data.list
|
list.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue