袁伟杰:V2.0.004 ERP日期渲染问题
This commit is contained in:
@@ -166,6 +166,7 @@ import { computed, onMounted, ref } from 'vue'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { createStockMove, getStockMove, updateStockMove } from '@/api/erp/stock-move'
|
||||
import { getWarehouseSimpleList } from '@/api/erp/warehouse'
|
||||
import { formatDate as formatDateValue } from '@/utils/date'
|
||||
import { navigateBackPlus } from '@/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -238,14 +239,8 @@ function formatPrice(price?: number) {
|
||||
}
|
||||
|
||||
/** 格式化日期 */
|
||||
function formatDate(dateStr?: string) {
|
||||
if (!dateStr) return '-'
|
||||
if (typeof dateStr === 'number') {
|
||||
const d = new Date(dateStr)
|
||||
const pad = (n: number) => n.toString().padStart(2, '0')
|
||||
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
|
||||
}
|
||||
return dateStr.substring(0, 10)
|
||||
function formatDate(dateStr?: string | number | Date) {
|
||||
return formatDateValue(dateStr) || '-'
|
||||
}
|
||||
|
||||
/** 返回上一页 */
|
||||
|
||||
Reference in New Issue
Block a user