Commit 790a6e55 by zhuzhequan

fix:订单-筛选项“排序”文案调整,延期时间逻辑更改

parent 87593839
......@@ -149,8 +149,8 @@
style="width: 125px"
placeholder="排序类型"
>
<el-option value="asc" label="正序"></el-option>
<el-option value="desc" label="倒序"></el-option>
<el-option value="desc" label="按创建时间从新到旧"></el-option>
<el-option value="asc" label="按创建时间从旧到新"></el-option>
</el-select>
</ElFormItem>
<ElFormItem>
......@@ -1053,7 +1053,7 @@ const [searchForm] = useValue<SearchForm>({
orderNumber: '',
internalMemo: '',
subOrderNumber: '',
order: 'desc',
order: 'asc',
})
const tabsNav = ref<Tab[]>([])
const splitRef = ref<InstanceType<typeof SplitDiv>>()
......
......@@ -113,8 +113,8 @@
style="width: 150px"
placeholder="排序类型"
>
<el-option value="asc" label="正序"></el-option>
<el-option value="desc" label="倒序"></el-option>
<el-option value="desc" label="按创建时间从新到旧"></el-option>
<el-option value="asc" label="按创建时间从旧到新"></el-option>
</el-select>
</ElFormItem>
<ElFormItem label="定制类型">
......@@ -1881,7 +1881,7 @@ const [searchForm] = useValue<SearchForm>({
shopNumber: '',
userMark: '',
customizedQuantity: '',
order: 'desc',
order: 'asc',
platform: '',
})
const tableColumns = computed<CustomColumn<CardOrderData[]>>(() => {
......
......@@ -225,8 +225,8 @@
style="width: 150px"
placeholder="排序类型"
>
<el-option value="asc" label="正序"></el-option>
<el-option value="desc" label="倒序"></el-option>
<el-option value="desc" label="按创建时间从新到旧"></el-option>
<el-option value="asc" label="按创建时间从旧到新"></el-option>
</el-select>
</ElFormItem>
<ElFormItem label="类型" v-if="status !== 'BATCH_DOWNLOAD'">
......@@ -1605,7 +1605,7 @@
</span>
</div>
<div
v-if="['TO_BE_CONFIRMED', 'STOCK_OUT'].includes(status)"
v-if="['TO_BE_CONFIRMED','EXCEPTION_ORDER', 'STOCK_OUT', 'CREATE_LOGISTICS', 'TO_BE_ARRANGE', 'WAIT_SHIPMENT', 'WAIT_WEIGHING'].includes(status)"
class="order-detail-item"
>
<span class="order-detail-item-label">订单延期时间:</span>
......@@ -2125,6 +2125,9 @@
? cardItem.num || 0
: cardItem?.notPassNum || 0
}}
<span title="订单延期时间" class="delayTime red-time">
{{ calculateDelayTime(cardItem) }}
</span>
</span>
</div>
<div class="grid-item">
......@@ -2140,6 +2143,9 @@
<span class="grid-item-label">补胚数量:</span>
<span class="grid-item-value">
{{ cardItem?.replenishmentNum || 0 }}
<span v-if="!['IN_PRODUCTION','PICKING','TO_BE_ARRANGE'].includes(status)" title="订单延期时间" class="delayTime red-time">
{{ calculateDelayTime(cardItem) }}
</span>
</span>
</div>
......@@ -3019,6 +3025,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
shipmentArea: undefined,
platform: '',
productionClient: '',
order: 'asc',
warehouseId: '',
thirdSkuCode: '',
supplierProductNo: '',
......@@ -5496,7 +5503,7 @@ const calculateHoursDifference = (startDateString?: string): string => {
const diffInMs = currentTime.value.getTime() - startTime.getTime()
// 转换为小时并取整:ceil向上或者round:四舍五入
const hours = Math.round(diffInMs / (1000 * 60 * 60))
return `${hours}小时`
return `${hours}h`
} catch (error) {
console.error('日期解析错误:', error)
return '--'
......@@ -5504,16 +5511,7 @@ const calculateHoursDifference = (startDateString?: string): string => {
}
// 根据订单状态计算延期时间
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 '--'
}
return row.createTime ? calculateHoursDifference(row.createTime) : '--'
})
onBeforeUnmount(() => {
// 组件卸载时清除定时器
......@@ -5892,12 +5890,21 @@ useEnterKeyTrigger({
text-overflow: ellipsis;
white-space: nowrap;
}
.red-time {
color: red;
font-weight: bold;
}
}
}
.grid-item-value{
position: relative;
}
.delayTime{
position: absolute;
right: 0;
font-size: 14px;
top: -2px;
}
.red-time {
color: red;
font-weight: bold;
}
.card-list {
display: grid;
grid-template-columns: repeat(6, 1fr);
......
......@@ -1801,7 +1801,7 @@
</span>
</div> -->
<div
v-if="['TO_BE_CONFIRMED', 'STOCK_OUT'].includes(status)"
v-if="['TO_BE_CONFIRMED','EXCEPTION_ORDER', 'STOCK_OUT', 'CREATE_LOGISTICS', 'TO_BE_ARRANGE', 'WAIT_SHIPMENT'].includes(status)"
class="order-detail-item"
>
<span class="order-detail-item-label">订单延期时间:</span>
......@@ -2362,6 +2362,9 @@
? cardItem.num || 0
: cardItem?.notPassNum || 0
}}
<span title="订单延期时间" class="delayTime red-time">
{{ calculateDelayTime(cardItem) }}
</span>
</span>
</div>
<div
......@@ -2379,6 +2382,9 @@
<span class="grid-item-label">补胚数量:</span>
<span class="grid-item-value">
{{ cardItem?.replenishmentNum || 0 }}
<span v-if="!['IN_PRODUCTION','PICKING','TO_BE_ARRANGE'].includes(status)" title="订单延期时间" class="delayTime red-time">
{{ calculateDelayTime(cardItem) }}
</span>
</span>
</div>
<div
......@@ -6279,7 +6285,7 @@ const calculateHoursDifference = (startDateString?: string): string => {
const diffInMs = currentTime.value.getTime() - startTime.getTime()
// 转换为小时并取整:ceil向上或者round:四舍五入
const hours = Math.round(diffInMs / (1000 * 60 * 60))
return `${hours}小时`
return `${hours}h`
} catch (error) {
console.error('日期解析错误:', error)
return '--'
......@@ -6287,16 +6293,7 @@ const calculateHoursDifference = (startDateString?: string): string => {
}
// 根据订单状态计算延期时间
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 '--'
}
return row.createTime ? calculateHoursDifference(row.createTime) : '--'
})
onBeforeUnmount(() => {
// 组件卸载时清除定时器
......@@ -6908,12 +6905,21 @@ const printNormal = async () => {
text-overflow: ellipsis;
white-space: nowrap;
}
.red-time {
color: red;
font-weight: bold;
}
}
}
.grid-item-value{
position: relative;
}
.delayTime{
position: absolute;
right: 0;
font-size: 14px;
top: -2px;
}
.red-time {
color: red;
font-weight: bold;
}
.card-list {
display: grid;
grid-template-columns: repeat(6, 1fr);
......
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