Commit 790a6e55 by zhuzhequan

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

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