Commit 8820c70f by qinjianhui

fix: 备货订单延误天数计算修改

parent 657f9775
......@@ -400,10 +400,17 @@ const tableColumns = computed(() => {
align: 'center',
render: (row: TableData) => {
if (!row.expectDeliveryTime) return <span>-</span>
const delayDays = dayjs()
.startOf('day')
.diff(dayjs(row.expectDeliveryTime).startOf('day'), 'day')
if (delayDays > 0) {
let delayDays: number
if (row.completeTime) {
delayDays = dayjs(row.completeTime)
.startOf('day')
.diff(dayjs(row.expectDeliveryTime).startOf('day'), 'day')
} else {
delayDays = dayjs()
.startOf('day')
.diff(dayjs(row.expectDeliveryTime).startOf('day'), 'day')
}
if (delayDays > 0 && row.status !== 'CANCELLED') {
return (
<span style="color: #f56c6c; font-weight: bold;">{delayDays}</span>
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment