Commit 017d5a98 by wuqian

订单CN、US代码复原

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