袁伟杰:V2.0.004 ERP日期渲染问题

This commit is contained in:
yuan
2026-05-15 15:00:41 +08:00
parent 7859af83b2
commit eac6df3207
25 changed files with 75 additions and 123 deletions

View File

@@ -261,6 +261,7 @@ import { createPurchaseOrder, getPurchaseOrder, updatePurchaseOrder } from '@/ap
import { getProductSimpleList } from '@/api/erp/product'
import { getSupplierSimpleList } from '@/api/erp/supplier'
import { getPurchaseRequisition, getPurchaseRequisitionPage } from '@/api/erp/purchase-requisition'
import { formatDate as formatDateValue } from '@/utils/date'
import { navigateBackPlus } from '@/utils'
const props = defineProps<{
@@ -318,14 +319,8 @@ function onSupplierConfirm({ value }: any) {
}
/** 格式化日期 */
function formatDate(dateVal?: string | number) {
if (!dateVal) return '-'
if (typeof dateVal === 'number') {
const d = new Date(dateVal)
const pad = (n: number) => n.toString().padStart(2, '0')
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
}
return String(dateVal).substring(0, 10)
function formatDate(dateVal?: string | number | Date) {
return formatDateValue(dateVal) || '-'
}
/** 打开请购单选择弹窗 */