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,9 +11,7 @@ ...@@ -11,9 +11,7 @@
inline inline
> >
<!-- 批量下载 --> <!-- 批量下载 -->
<ElFormItem label="创建时间" v-if=" <ElFormItem label="创建时间" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD'
">
<el-date-picker <el-date-picker
v-model="timeRange" v-model="timeRange"
:teleported="false" :teleported="false"
...@@ -31,9 +29,7 @@ ...@@ -31,9 +29,7 @@
> >
</el-date-picker> </el-date-picker>
</ElFormItem> </ElFormItem>
<ElFormItem label="创建人" v-if=" <ElFormItem label="创建人" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.employeeId" v-model="searchForm.employeeId"
placeholder="请选择" placeholder="请选择"
...@@ -49,9 +45,7 @@ ...@@ -49,9 +45,7 @@
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="工艺类型" v-if=" <ElFormItem label="工艺类型" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.craftType" v-model="searchForm.craftType"
placeholder="请选择" placeholder="请选择"
...@@ -68,9 +62,7 @@ ...@@ -68,9 +62,7 @@
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="下载状态" v-if=" <ElFormItem label="下载状态" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.downloadStatus" v-model="searchForm.downloadStatus"
placeholder="下载状态" placeholder="下载状态"
...@@ -86,9 +78,7 @@ ...@@ -86,9 +78,7 @@
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="排版状态" v-if=" <ElFormItem label="排版状态" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.syntheticStatus" v-model="searchForm.syntheticStatus"
placeholder="排版状态" placeholder="排版状态"
...@@ -104,9 +94,7 @@ ...@@ -104,9 +94,7 @@
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="自动排版" v-if=" <ElFormItem label="自动排版" v-if="status === 'BATCH_DOWNLOAD'">
status === 'BATCH_DOWNLOAD'
">
<ElSelect <ElSelect
v-model="searchForm.automaticComposing" v-model="searchForm.automaticComposing"
placeholder="自动排版" placeholder="自动排版"
...@@ -123,9 +111,7 @@ ...@@ -123,9 +111,7 @@
</ElSelect> </ElSelect>
</ElFormItem> </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>
...@@ -3804,8 +3785,11 @@ const tableColumns = computed(() => { ...@@ -3804,8 +3785,11 @@ const tableColumns = computed(() => {
// 分割字符串并查找对应的 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 (
...@@ -3813,7 +3797,7 @@ const tableColumns = computed(() => { ...@@ -3813,7 +3797,7 @@ const tableColumns = computed(() => {
<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