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