Commit 017d5a98 by wuqian

订单CN、US代码复原

parent 75a40f4a
...@@ -139,6 +139,7 @@ export interface ProductList { ...@@ -139,6 +139,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
......
...@@ -138,6 +138,7 @@ export interface ProductList { ...@@ -138,6 +138,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
......
...@@ -1604,6 +1604,15 @@ ...@@ -1604,6 +1604,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 }">
...@@ -5463,7 +5472,10 @@ watch( ...@@ -5463,7 +5472,10 @@ watch(
}, },
{ deep: true, immediate: true }, // 添加immediate确保初始化时执行 { deep: true, immediate: true }, // 添加immediate确保初始化时执行
) )
// 当前时间响应式变量(每60秒更新一次)
const currentTime = ref(new Date())
// 定时器实例
let timer: number | null = null
onMounted(() => { onMounted(() => {
loadTabData() loadTabData()
getUserMark() getUserMark()
...@@ -5471,8 +5483,45 @@ onMounted(() => { ...@@ -5471,8 +5483,45 @@ onMounted(() => {
getCustomTagList() getCustomTagList()
loadCraftList() loadCraftList()
getlogisticsCompanyAllCodelist() getlogisticsCompanyAllCodelist()
// 每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 handleShipmentAreaCommand = (command: number) => { const handleShipmentAreaCommand = (command: number) => {
shipmentArea.value = command shipmentArea.value = command
search() search()
...@@ -5843,6 +5892,10 @@ useEnterKeyTrigger({ ...@@ -5843,6 +5892,10 @@ useEnterKeyTrigger({
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.red-time {
color: red;
font-weight: bold;
}
} }
.card-list { .card-list {
......
...@@ -11,121 +11,107 @@ ...@@ -11,121 +11,107 @@
inline inline
> >
<!-- 批量下载 --> <!-- 批量下载 -->
<ElFormItem label="创建时间" v-if=" <ElFormItem label="创建时间" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD' <el-date-picker
"> v-model="timeRange"
<el-date-picker :teleported="false"
v-model="timeRange" :default-time="[
:teleported="false" new Date(0, 0, 0, 0, 0, 0),
:default-time="[ new Date(0, 0, 0, 23, 59, 59),
new Date(0, 0, 0, 0, 0, 0), ]"
new Date(0, 0, 0, 23, 59, 59), value-format="YYYY-MM-DD HH:mm:ss"
]" type="datetimerange"
value-format="YYYY-MM-DD HH:mm:ss" style="width: 280px"
type="datetimerange" :shortcuts="pickerOptions.shortcuts"
style="width: 280px" start-placeholder="开始时间"
:shortcuts="pickerOptions.shortcuts" end-placeholder="结束时间"
start-placeholder="开始时间" clearable
end-placeholder="结束时间" >
clearable </el-date-picker>
> </ElFormItem>
</el-date-picker> <ElFormItem label="创建人" v-if="status === 'BATCH_DOWNLOAD'">
</ElFormItem> <ElSelect
<ElFormItem label="创建人" v-if=" v-model="searchForm.employeeId"
status === 'BATCH_DOWNLOAD' placeholder="请选择"
"> clearable
<ElSelect :teleported="false"
v-model="searchForm.employeeId" style="width: 150px"
placeholder="请选择" >
clearable <ElOption
:teleported="false" v-for="(item, index) in employeeList"
style="width: 150px" :key="index"
> :value="item.id"
<ElOption :label="item.account"
v-for="(item, index) in employeeList" ></ElOption>
:key="index" </ElSelect>
:value="item.id" </ElFormItem>
:label="item.account" <ElFormItem label="工艺类型" v-if="status === 'BATCH_DOWNLOAD'">
></ElOption> <ElSelect
</ElSelect> v-model="searchForm.craftType"
</ElFormItem> placeholder="请选择"
<ElFormItem label="工艺类型" v-if=" clearable
status === 'BATCH_DOWNLOAD' filterable
"> :teleported="false"
<ElSelect style="width: 150px"
v-model="searchForm.craftType" >
placeholder="请选择" <ElOption
clearable v-for="(item, index) in processType"
filterable :key="index"
:teleported="false" :value="item.value"
style="width: 150px" :label="item.label"
> ></ElOption>
<ElOption </ElSelect>
v-for="(item, index) in processType" </ElFormItem>
:key="index" <ElFormItem label="下载状态" v-if="status === 'BATCH_DOWNLOAD'">
:value="item.value" <ElSelect
:label="item.label" v-model="searchForm.downloadStatus"
></ElOption> placeholder="下载状态"
</ElSelect> clearable
</ElFormItem> :teleported="false"
<ElFormItem label="下载状态" v-if=" style="width: 150px"
status === 'BATCH_DOWNLOAD' >
"> <ElOption
<ElSelect v-for="(item, index) in ['未下载', '已下载']"
v-model="searchForm.downloadStatus" :key="index"
placeholder="下载状态" :value="index"
clearable :label="item"
:teleported="false" ></ElOption>
style="width: 150px" </ElSelect>
> </ElFormItem>
<ElOption <ElFormItem label="排版状态" v-if="status === 'BATCH_DOWNLOAD'">
v-for="(item, index) in ['未下载', '已下载']" <ElSelect
:key="index" v-model="searchForm.syntheticStatus"
:value="index" placeholder="排版状态"
:label="item" clearable
></ElOption> :teleported="false"
</ElSelect> style="width: 150px"
</ElFormItem> >
<ElFormItem label="排版状态" v-if=" <ElOption
status === 'BATCH_DOWNLOAD' v-for="(item, index) in ['否', '是']"
"> :key="index"
<ElSelect :value="index"
v-model="searchForm.syntheticStatus" :label="item"
placeholder="排版状态" ></ElOption>
clearable </ElSelect>
:teleported="false" </ElFormItem>
style="width: 150px" <ElFormItem label="自动排版" v-if="status === 'BATCH_DOWNLOAD'">
> <ElSelect
<ElOption v-model="searchForm.automaticComposing"
v-for="(item, index) in ['否', '是']" placeholder="自动排版"
:key="index" clearable
:value="index" :teleported="false"
:label="item" style="width: 150px"
></ElOption> >
</ElSelect> <ElOption
</ElFormItem> v-for="(item, index) in ['否', '是']"
<ElFormItem label="自动排版" v-if=" :key="index"
status === 'BATCH_DOWNLOAD' :value="index"
"> :label="item"
<ElSelect ></ElOption>
v-model="searchForm.automaticComposing" </ElSelect>
placeholder="自动排版" </ElFormItem>
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['否', '是']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<!-- <div> --> <!-- <div> -->
<ElFormItem label="仓库" v-if=" <ElFormItem label="仓库" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.warehouseId" v-model="searchForm.warehouseId"
clearable clearable
...@@ -142,9 +128,7 @@ ...@@ -142,9 +128,7 @@
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="工艺" v-if=" <ElFormItem label="工艺" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<LogisticsWaySelect <LogisticsWaySelect
v-model="searchForm.craftCode" v-model="searchForm.craftCode"
:company-list="craftList" :company-list="craftList"
...@@ -153,9 +137,7 @@ ...@@ -153,9 +137,7 @@
start-placeholder="请选择工艺名称" start-placeholder="请选择工艺名称"
></LogisticsWaySelect> ></LogisticsWaySelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="库存SKU" v-if=" <ElFormItem label="库存SKU" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model.trim="searchForm.thirdSkuCode" v-model.trim="searchForm.thirdSkuCode"
placeholder="库存SKU" placeholder="库存SKU"
...@@ -163,9 +145,7 @@ ...@@ -163,9 +145,7 @@
style="width: 150px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="款号" v-if=" <ElFormItem label="款号" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model="searchForm.supplierProductNo" v-model="searchForm.supplierProductNo"
placeholder="款号" placeholder="款号"
...@@ -181,9 +161,7 @@ ...@@ -181,9 +161,7 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="生产单号" v-if=" <ElFormItem label="生产单号" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model="searchForm.factorySubOrderNumber" v-model="searchForm.factorySubOrderNumber"
placeholder="生产单号" placeholder="生产单号"
...@@ -191,9 +169,7 @@ ...@@ -191,9 +169,7 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="店铺单号" v-if=" <ElFormItem label="店铺单号" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElInput <ElInput
v-model="searchForm.shopNumber" v-model="searchForm.shopNumber"
placeholder="店铺单号" placeholder="店铺单号"
...@@ -201,9 +177,7 @@ ...@@ -201,9 +177,7 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="尺码类型" v-if=" <ElFormItem label="尺码类型" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.sizeType" v-model="searchForm.sizeType"
clearable clearable
...@@ -219,9 +193,7 @@ ...@@ -219,9 +193,7 @@
></el-option> ></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="平台" v-if=" <ElFormItem label="平台" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.platform" v-model="searchForm.platform"
value-key="" value-key=""
...@@ -247,9 +219,7 @@ ...@@ -247,9 +219,7 @@
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<!-- </div> --> <!-- </div> -->
<ElFormItem label="类型" v-if=" <ElFormItem label="类型" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<el-radio-group <el-radio-group
v-model="searchForm.customizedQuantity" v-model="searchForm.customizedQuantity"
@click.stop="(e: Event) => handleRadioGroupClick(e)" @click.stop="(e: Event) => handleRadioGroupClick(e)"
...@@ -259,9 +229,7 @@ ...@@ -259,9 +229,7 @@
<el-radio-button label="normal">普品</el-radio-button> <el-radio-button label="normal">普品</el-radio-button>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem label="数量" v-if=" <ElFormItem label="数量" v-if="status !== 'BATCH_DOWNLOAD'">
status !== 'BATCH_DOWNLOAD'
">
<el-radio-group <el-radio-group
v-model="searchForm.multi" v-model="searchForm.multi"
@click.stop="(e: Event) => handleMultiRadioGroupClick(e)" @click.stop="(e: Event) => handleMultiRadioGroupClick(e)"
...@@ -271,9 +239,12 @@ ...@@ -271,9 +239,12 @@
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElPopover placement="bottom" width="600" trigger="click" v-if=" <ElPopover
status !== 'BATCH_DOWNLOAD' placement="bottom"
"> width="600"
trigger="click"
v-if="status !== 'BATCH_DOWNLOAD'"
>
<ElForm <ElForm
ref="searchFormPopoverRef" ref="searchFormPopoverRef"
:model="searchForm" :model="searchForm"
...@@ -899,12 +870,12 @@ ...@@ -899,12 +870,12 @@
<ElButton type="primary" @click="printNormal"> 普货拣货 </ElButton> <ElButton type="primary" @click="printNormal"> 普货拣货 </ElButton>
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem <ElFormItem v-if="status === 'WAIT_SHIPMENT'">
v-if="
status === 'WAIT_SHIPMENT'"
>
<span class="item"> <span class="item">
<ElButton type="success" @click="printNormalProductionOrder(2, null)"> <ElButton
type="success"
@click="printNormalProductionOrder(2, null)"
>
打印普胚生产单 打印普胚生产单
</ElButton> </ElButton>
</span> </span>
...@@ -1612,8 +1583,9 @@ ...@@ -1612,8 +1583,9 @@
</div> </div>
<div <div
v-if=" v-if="
status === 'WAIT_SHIPMENT' && (status === 'WAIT_SHIPMENT' &&
item.productMark === 'custom_normal' || item.productMark === 'normal' item.productMark === 'custom_normal') ||
item.productMark === 'normal'
" "
style=" style="
display: flex; display: flex;
...@@ -1828,6 +1800,15 @@ ...@@ -1828,6 +1800,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 }">
...@@ -3212,7 +3193,7 @@ import { ...@@ -3212,7 +3193,7 @@ import {
CircleCheckFilled, CircleCheckFilled,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { Column, ElFormItem, ElMessage } from 'element-plus' import { Column, ElFormItem, ElMessage } from 'element-plus'
import { computed, onMounted, ref, nextTick, reactive} from 'vue' import { computed, onMounted, ref, nextTick, reactive } 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'
...@@ -3724,7 +3705,7 @@ const handleReComposingDesign = async () => { ...@@ -3724,7 +3705,7 @@ const handleReComposingDesign = async () => {
} }
interface ProcessTypeData { interface ProcessTypeData {
label: string label: string
value:string value: string
} }
const processType = ref<ProcessTypeData[]>([ const processType = ref<ProcessTypeData[]>([
{ {
...@@ -3792,7 +3773,7 @@ const tableColumns = computed(() => { ...@@ -3792,7 +3773,7 @@ const tableColumns = computed(() => {
width: 150, width: 150,
prop: 'craftType', prop: 'craftType',
align: 'center', align: 'center',
render: (item:ProductList) => { render: (item: ProductList) => {
if (!item.craftType) { if (!item.craftType) {
return ( return (
<div> <div>
...@@ -3800,20 +3781,23 @@ const tableColumns = computed(() => { ...@@ -3800,20 +3781,23 @@ const tableColumns = computed(() => {
</div> </div>
) )
} }
// 分割字符串并查找对应的 label // 分割字符串并查找对应的 label
const labels = item.craftType const labels = item.craftType
.split(',') .split(',')
.map(type => type.trim()) .map((type) => type.trim())
.map(type => processType.value.find(e => e.value === type)?.label || type) .map(
(type) =>
processType.value.find((e) => e.value === type)?.label || type,
)
.filter(Boolean) .filter(Boolean)
return ( return (
<div> <div>
<span>{labels.join(',')}</span> <span>{labels.join(',')}</span>
</div> </div>
) )
} },
}, },
{ {
...@@ -4164,10 +4148,9 @@ const { ...@@ -4164,10 +4148,9 @@ const {
// 批量下载 // 批量下载
if (status.value === 'BATCH_DOWNLOAD') { if (status.value === 'BATCH_DOWNLOAD') {
const params = { const params = {
...baseparams ...baseparams,
} }
return batchDownloadApi(params, return batchDownloadApi(params, page, pageSize).then((res) => {
page, pageSize).then((res) => {
return res.data return res.data
}) as never }) as never
} else if ( } else if (
...@@ -4911,9 +4894,9 @@ const printNormalProductionOrder = async ( ...@@ -4911,9 +4894,9 @@ const printNormalProductionOrder = async (
} }
const orderIds: number[] = [] const orderIds: number[] = []
if(type === 1){ if (type === 1) {
orderIds.push(item!.id) orderIds.push(item!.id)
}else{ } else {
if (!selection.value.length) { if (!selection.value.length) {
return ElMessage.warning('请选择订单') return ElMessage.warning('请选择订单')
} }
...@@ -6270,6 +6253,11 @@ watch( ...@@ -6270,6 +6253,11 @@ watch(
}, },
{ immediate: true }, { immediate: true },
) )
// 当前时间响应式变量(每60秒更新一次)
const currentTime = ref(new Date())
// 定时器实例
let timer: number | null = null
onMounted(() => { onMounted(() => {
loadTabData() loadTabData()
...@@ -6278,6 +6266,44 @@ onMounted(() => { ...@@ -6278,6 +6266,44 @@ onMounted(() => {
loadWarehouseList() loadWarehouseList()
loadCraftList() loadCraftList()
getCustomTagList() getCustomTagList()
// 每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 expressSheetUpload = async (file: File) => { const expressSheetUpload = async (file: File) => {
...@@ -6750,7 +6776,6 @@ const getEmployeeList = async () => { ...@@ -6750,7 +6776,6 @@ const getEmployeeList = async () => {
employeeList.value = data employeeList.value = data
} }
getPermission() getPermission()
getLogisticsWay() getLogisticsWay()
getEmployeeList() getEmployeeList()
...@@ -6883,6 +6908,10 @@ const printNormal = async () => { ...@@ -6883,6 +6908,10 @@ const printNormal = async () => {
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