Commit b7a1e182 by zhuzhequan

podus修改

parent 7f9a1976
...@@ -64,7 +64,6 @@ declare module 'vue' { ...@@ -64,7 +64,6 @@ declare module 'vue' {
ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default'] ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default'] SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
'Switch ': typeof import('./src/components/Form.vue/Switch .vue')['default'] 'Switch ': typeof import('./src/components/Form.vue/Switch .vue')['default']
TableRightMenu: typeof import('./src/components/TableRightMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default'] TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default'] UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
UploadImage: typeof import('./src/components/UploadImage.vue')['default'] UploadImage: typeof import('./src/components/UploadImage.vue')['default']
......
...@@ -18,7 +18,7 @@ export interface SearchForm { ...@@ -18,7 +18,7 @@ export interface SearchForm {
endTime: string | null endTime: string | null
exceptionHandling: number | undefined exceptionHandling: number | undefined
platform: string platform: string
productionClient:string productionClient: string
} }
export interface PodUsOrderListData { export interface PodUsOrderListData {
id: number id: number
...@@ -92,6 +92,7 @@ export interface ProductList { ...@@ -92,6 +92,7 @@ export interface ProductList {
tagIds?: string tagIds?: string
isProduction?: boolean isProduction?: boolean
createTime?: string createTime?: string
startStockingTime?: string | null
updateTime?: string updateTime?: string
remark?: string | null remark?: string | null
version?: number version?: number
......
...@@ -674,6 +674,15 @@ ...@@ -674,6 +674,15 @@
{{ row.lanshouAddress }} {{ row.lanshouAddress }}
</span> </span>
</div> </div>
<div
v-if="['TO_BE_CONFIRMED', 'STOCK_OUT'].includes(status)"
class="order-detail-item"
>
<span class="order-detail-item-label">订单延期时间:</span>
<span class="order-detail-item-value red-time">
{{ calculateDelayTime(row) }}
</span>
</div>
</div> </div>
</template> </template>
<template #price="{ row }"> <template #price="{ row }">
...@@ -1246,7 +1255,7 @@ import { useValue } from '@/utils/hooks/useValue' ...@@ -1246,7 +1255,7 @@ import { useValue } from '@/utils/hooks/useValue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
import { DocumentCopy, EditPen } from '@element-plus/icons-vue' import { DocumentCopy, EditPen } from '@element-plus/icons-vue'
import { Column, ElFormItem } from 'element-plus' import { Column, ElFormItem } from 'element-plus'
import { computed, onMounted, ref, nextTick } from 'vue' import { computed, onMounted, ref, nextTick, onBeforeUnmount } from 'vue'
import FastProduction from './FastProduction.vue' import FastProduction from './FastProduction.vue'
import { filePath } from '@/api/axios' import { filePath } from '@/api/axios'
import PodMakeOrder from './PodMakeOrder.vue' import PodMakeOrder from './PodMakeOrder.vue'
...@@ -2522,13 +2531,56 @@ const refreshMaterial = async () => { ...@@ -2522,13 +2531,56 @@ const refreshMaterial = async () => {
loading.close() loading.close()
} }
} }
// 当前时间响应式变量(每60秒更新一次)
const currentTime = ref(new Date())
// 定时器实例
let timer: number | null = null
onMounted(() => { onMounted(() => {
loadTabData() loadTabData()
getUserMark() getUserMark()
loadProductionClient() loadProductionClient()
loadWarehouseList() loadWarehouseList()
// 每60秒更新一次当前时间
timer = window.setInterval(() => {
currentTime.value = new Date()
}, 60000)
}) })
// 计算时间差(小时数)并向上取整
const calculateHoursDifference = (startDateString?: string): string => {
if (!startDateString) return '--'
try {
const startTime = new Date(startDateString)
const diffInMs = currentTime.value.getTime() - startTime.getTime()
// 转换为小时并取整:ceil向上或者round:四舍五入
const hours = Math.round(diffInMs / (1000 * 60 * 60))
return `${hours}小时`
} catch (error) {
console.error('日期解析错误:', error)
return '--'
}
}
// 根据订单状态计算延期时间
const calculateDelayTime = computed(() => (row: ProductList) => {
switch (status.value) {
case 'TO_BE_CONFIRMED':
return row.createTime ? calculateHoursDifference(row.createTime) : '--'
case 'STOCK_OUT':
return row.startStockingTime
? calculateHoursDifference(row.startStockingTime)
: '--'
default:
return '--'
}
})
onBeforeUnmount(() => {
// 组件卸载时清除定时器
if (timer) {
clearInterval(timer)
timer = null
}
})
const handleExceptionCommand = (command: number) => { const handleExceptionCommand = (command: number) => {
exceptionStatus.value = command exceptionStatus.value = command
search() search()
...@@ -2614,6 +2666,10 @@ const handleExceptionCommand = (command: number) => { ...@@ -2614,6 +2666,10 @@ const handleExceptionCommand = (command: number) => {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.red-time {
color: red;
font-weight: bold;
}
} }
.card-list { .card-list {
......
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