袁伟杰:V2.0.004 ERP日期渲染问题
This commit is contained in:
@@ -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) || '-'
|
||||
}
|
||||
|
||||
/** 打开请购单选择弹窗 */
|
||||
|
||||
Reference in New Issue
Block a user