Commit a5e986f4 by wuqian

pod-cn完成

parent 9c8ec360
...@@ -77,6 +77,9 @@ export interface PodCnOrderListData { ...@@ -77,6 +77,9 @@ export interface PodCnOrderListData {
updateTime?: string updateTime?: string
remark?: string | null remark?: string | null
userMark?: string userMark?: string
serviceAmount?: number | null
prepaidAmount?: number | null
actualAmount?: number | null
version?: number version?: number
productList?: ProductList[] productList?: ProductList[]
orderNumber?: string orderNumber?: string
...@@ -100,6 +103,7 @@ export interface ProductList { ...@@ -100,6 +103,7 @@ export interface ProductList {
variantImage?: string variantImage?: string
craftPrice?: number craftPrice?: number
craftCode?: string craftCode?: string
previewImgs?: []
platform?: string platform?: string
imageAry?: string imageAry?: string
designImages?: string designImages?: string
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
</el-select> </el-select>
</ElFormItem> </ElFormItem>
<ElFormItem label="生产端"> <!-- <ElFormItem label="生产端">
<ElSelect <ElSelect
v-model="searchForm.productionClient" v-model="searchForm.productionClient"
placeholder="生产端" placeholder="生产端"
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
:label="`${item.remark}(${item.code})`" :label="`${item.remark}(${item.code})`"
></ElOption> ></ElOption>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem> -->
<ElFormItem label="Variant SKU"> <ElFormItem label="Variant SKU">
<ElInput <ElInput
v-model.trim="searchForm.sku" v-model.trim="searchForm.sku"
...@@ -306,7 +306,10 @@ ...@@ -306,7 +306,10 @@
转至待确认 转至待确认
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'EXCEPTION_ORDER'&&exceptionStatus === 3" class="item"> <span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 3"
class="item"
>
<ElButton type="warning" @click="asyncOrderAddress"> <ElButton type="warning" @click="asyncOrderAddress">
同步收货地址 同步收货地址
</ElButton> </ElButton>
...@@ -787,17 +790,31 @@ ...@@ -787,17 +790,31 @@
:key="item" :key="item"
class="goods-item" class="goods-item"
> >
<div class="goods-item-img"> <div
<img :src="item.variantImage" alt="商品图片" /> class="goods-item-img"
style="display: flex; flex-direction: column"
>
<div <div
v-if="item.customizedQuantity" v-for="img in item.previewImgs"
class="triangle-box" :key="img"
:title="`类型:${getQuantityText( style="text-align: center"
item.customizedQuantity,
)}面`"
> >
<div class="multi-text"> <img
{{ getQuantityText(item.customizedQuantity) }} :src="img.url"
alt="商品图片"
style="cursor: pointer"
@click="handlePictureCardPreview(img.url)"
/>
<div
v-if="item.customizedQuantity"
class="triangle-box"
:title="`类型:${getQuantityText(
item.customizedQuantity,
)}面`"
>
<div class="multi-text">
{{ getQuantityText(item.customizedQuantity) }}
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -934,15 +951,15 @@ ...@@ -934,15 +951,15 @@
</div> </div>
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
<div class="goods-item-info-item"> <!-- <div class="goods-item-info-item">
<span class="goods-item-info-item-label">价格¥:</span> <span class="goods-item-info-item-label">价格¥:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.productPrice }} {{ item.productPrice }}
</span> </span>
</div> </div> -->
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label" <span class="goods-item-info-item-label"
>模板金额¥:</span >模板单价¥:</span
> >
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.templatePrice }} {{ item.templatePrice }}
...@@ -950,7 +967,7 @@ ...@@ -950,7 +967,7 @@
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label" <span class="goods-item-info-item-label"
>工艺金额¥:</span >工艺单价¥:</span
> >
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.craftPrice }} {{ item.craftPrice }}
...@@ -958,10 +975,10 @@ ...@@ -958,10 +975,10 @@
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label" <span class="goods-item-info-item-label"
>付款金额¥:</span >单件价格¥:</span
> >
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.payAmount }} {{ calculatedPrice(item) }}
</span> </span>
</div> </div>
...@@ -1112,9 +1129,7 @@ ...@@ -1112,9 +1129,7 @@
</span> </span>
</div> </div>
<div <div
v-if=" v-if="row.status !== 'TO_BE_CONFIRMED'"
row.status !== 'TO_BE_CONFIRMED'
"
class="order-detail-item" class="order-detail-item"
> >
<span class="order-detail-item-label">发货仓库:</span> <span class="order-detail-item-label">发货仓库:</span>
...@@ -1171,17 +1186,56 @@ ...@@ -1171,17 +1186,56 @@
<div class="order-price-item"> <div class="order-price-item">
<span class="order-price-item-label">商品总价¥:</span> <span class="order-price-item-label">商品总价¥:</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.totalAmount }} {{ row.productAmount }}
</span> </span>
</div> </div>
<div v-if="row.serviceAmount" class="order-price-item">
<div <span class="order-price-item-label">操作费¥:</span>
v-if="row.status !== 'TO_BE_CONFIRMED'" <span class="order-price-item-value">
{{ row.serviceAmount }}
<el-tooltip
class="box-item"
effect="dark"
content="根据商品的数量计算首件2元,每多一件加价0.5元,上限5元"
placement="top"
>
<el-icon color="#E6A23C"><QuestionFilled /></el-icon>
</el-tooltip>
</span>
</div>
<!-- v-if="
[
'TO_BE_CONFIRMED',
'EXCEPTION_ORDER',
'STOCK_OUT',
'CREATE_LOGISTICS',
'WAIT_SHIPMENT',
'INTERCEPTED',
].includes(status)
" -->
<div class="order-price-item">
<span class="order-price-item-label">预收运费¥:</span>
<span class="order-price-item-value">
{{ row.prepaidAmount || 0 }}
</span>
</div>
<!-- <div
v-if="
['WAIT_TRACK', 'IN_TRANSIT', 'COMPLETE', 'CANCEL'].includes(
status,
)
"
class="order-price-item" class="order-price-item"
> >
<span class="order-price-item-label">物流运费¥:</span> <span class="order-price-item-label">物流运费¥:</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.payFreight || 0 }} {{ row.actualAmount || 0 }}
</span>
</div> -->
<div class="order-price-item">
<span class="order-price-item-label">合计¥:</span>
<span class="order-price-item-value">
{{ totalAmountPrice(row) }}
</span> </span>
</div> </div>
</div> </div>
...@@ -1435,26 +1489,9 @@ ...@@ -1435,26 +1489,9 @@
> >
{{ cardItem?.factorySubOrderNumber }} {{ cardItem?.factorySubOrderNumber }}
</span> </span>
<el-icon
class="icon"
style="margin-left: 3px"
size="14"
@click="copy(cardItem?.factorySubOrderNumber || '')"
>
<DocumentCopy />
</el-icon>
</template> </template>
<template #operations> <template #operations>
<div <div
style="position: absolute; top: -35px; right: 2px"
v-if="cardItem.platform"
>
<img
:src="`/images/icon/${getPlatformImg(cardItem.platform)}`"
style="height: 30px"
/>
</div>
<div
v-if="cardItem?.customizedQuantity" v-if="cardItem?.customizedQuantity"
class="customizedQuantity" class="customizedQuantity"
:title="`类型:${getQuantityText( :title="`类型:${getQuantityText(
...@@ -1517,21 +1554,11 @@ ...@@ -1517,21 +1554,11 @@
{{ cardItem?.userMark }} {{ cardItem?.userMark }}
</span> </span>
</el-tooltip> </el-tooltip>
<b <img
v-if="cardItem" v-if="cardItem.platform"
:style="{ :src="`/images/icon/${getPlatformImg(cardItem.platform)}`"
color: style="width: 30px; height: 30px"
(Number(cardItem.customizedQuantity) || 0) > 1 />
? 'red'
: '#67C23A',
}"
>
{{
(Number(cardItem.customizedQuantity) || 0) > 1
? '多'
: '单'
}}
</b>
</div> </div>
</div> </div>
</template> </template>
...@@ -1570,16 +1597,9 @@ ...@@ -1570,16 +1597,9 @@
<div <div
:title="`variant SKU: ${cardItem?.variantSku || ''}`" :title="`variant SKU: ${cardItem?.variantSku || ''}`"
class="grid-item-value orderNumber" class="grid-item-value orderNumber"
@click.stop="copy(cardItem?.variantSku || '')"
> >
{{ cardItem?.variantSku }} {{ cardItem?.variantSku }}
<el-icon
class="icon"
style="margin-left: 3px"
size="14"
@click="copy(cardItem?.variantSku || '')"
>
<DocumentCopy />
</el-icon>
</div> </div>
</div> </div>
<div v-if="status !== 'TO_BE_ARRANGE'" class="grid-item"> <div v-if="status !== 'TO_BE_ARRANGE'" class="grid-item">
...@@ -1607,16 +1627,9 @@ ...@@ -1607,16 +1627,9 @@
<div <div
:title="`库存SKU:${cardItem?.thirdSkuCode || ''}`" :title="`库存SKU:${cardItem?.thirdSkuCode || ''}`"
class="grid-item-value orderNumber" class="grid-item-value orderNumber"
@click.stop="copy(cardItem?.thirdSkuCode || '')"
> >
{{ cardItem?.thirdSkuCode }} {{ cardItem?.thirdSkuCode }}
<el-icon
class="icon"
style="margin-left: 3px"
size="14"
@click="copy(cardItem?.thirdSkuCode || '')"
>
<DocumentCopy />
</el-icon>
</div> </div>
</div> </div>
<div class="grid-item"> <div class="grid-item">
...@@ -1642,43 +1655,22 @@ ...@@ -1642,43 +1655,22 @@
class="grid-item" class="grid-item"
:title="`店铺单号:${cardItem?.shopNumber || ''}`" :title="`店铺单号:${cardItem?.shopNumber || ''}`"
> >
<div class="grid-item-value orderNumber"> <div
class="grid-item-value orderNumber"
@click.stop="copy(cardItem?.shopNumber || '')"
>
{{ cardItem?.shopNumber }} {{ cardItem?.shopNumber }}
<el-icon
class="icon"
style="margin-left: 3px"
size="14"
@click="copy(cardItem?.shopNumber || '')"
>
<DocumentCopy />
</el-icon>
</div> </div>
</div> </div>
<!-- <div class="grid-item" title="订单号">
<span
class="grid-item-value"
@click="copy(cardItem?.factoryOrderNumber || '')"
>
{{ cardItem?.factoryOrderNumber }}
</span>
</div> -->
<div class="grid-item"> <div class="grid-item">
<div <div
:title="`第三方生产单号:${cardItem?.thirdSubOrderNumber}`" :title="`第三方生产单号:${cardItem?.thirdSubOrderNumber}`"
class="grid-item-value orderNumber" class="grid-item-value orderNumber"
@click.stop="
copy(String(cardItem?.thirdSubOrderNumber || ''))
"
> >
{{ cardItem?.thirdSubOrderNumber }} {{ cardItem?.thirdSubOrderNumber }}
<el-icon
class="icon"
style="margin-left: 3px"
size="14"
@click.stop="
copy(String(cardItem?.thirdSubOrderNumber || ''))
"
>
<DocumentCopy />
</el-icon>
</div> </div>
</div> </div>
<div <div
...@@ -1686,16 +1678,11 @@ ...@@ -1686,16 +1678,11 @@
class="grid-item" class="grid-item"
:title="`批次号:${cardItem?.batchArrangeNumber || ''}`" :title="`批次号:${cardItem?.batchArrangeNumber || ''}`"
> >
<div class="grid-item-value orderNumber"> <div
class="grid-item-value orderNumber"
@click.stop="copy(cardItem?.batchArrangeNumber || '')"
>
{{ cardItem?.batchArrangeNumber }} {{ cardItem?.batchArrangeNumber }}
<el-icon
class="icon"
style="margin-left: 3px"
size="14"
@click="copy(cardItem?.batchArrangeNumber || '')"
>
<DocumentCopy />
</el-icon>
</div> </div>
</div> </div>
<div v-if="cardItem.isReplenishment" class="grid-item"> <div v-if="cardItem.isReplenishment" class="grid-item">
...@@ -2094,6 +2081,7 @@ import { ...@@ -2094,6 +2081,7 @@ import {
CaretTop, CaretTop,
ArrowDown, ArrowDown,
WarningFilled, WarningFilled,
QuestionFilled,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { import {
getCardOrderList, getCardOrderList,
...@@ -2182,6 +2170,7 @@ import RightClickMenu from '@/components/RightClickMenu.vue' ...@@ -2182,6 +2170,7 @@ import RightClickMenu from '@/components/RightClickMenu.vue'
import ResultInfo from './components/ResultInfo.vue' import ResultInfo from './components/ResultInfo.vue'
import { isArray, isString } from '@/utils/validate' import { isArray, isString } from '@/utils/validate'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
import BigNumber from 'bignumber.js'
import { import {
useRouter, useRouter,
type NavigationGuardNext, type NavigationGuardNext,
...@@ -2202,7 +2191,28 @@ declare global { ...@@ -2202,7 +2191,28 @@ declare global {
} }
} }
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const calculatedPrice = (item: ProductList) => {
const templatePrice = new BigNumber(item.templatePrice || 0)
const craftPrice = new BigNumber(item.craftPrice || 0)
return templatePrice.plus(craftPrice).toString()
}
// const PREPAID_STATUSES = [
// 'TO_BE_CONFIRMED',
// 'EXCEPTION_ORDER',
// 'STOCK_OUT',
// 'CREATE_LOGISTICS',
// 'WAIT_SHIPMENT',
// 'INTERCEPTED',
// ] as const
const totalAmountPrice = (item: PodCnOrderListData): string => {
// const usePrepaid = PREPAID_STATUSES.includes(status.value as typeof PREPAID_STATUSES[number])
const productAmount = new BigNumber(item?.productAmount ?? 0)
const serviceAmount = new BigNumber(item?.serviceAmount ?? 0)
// const freightAmount = usePrepaid ? item?.prepaidAmount : item?.actualAmount
const payFreight = new BigNumber(item?.prepaidAmount ?? 0)
return productAmount.plus(serviceAmount).plus(payFreight).toString()
}
const countryList = ref([]) const countryList = ref([])
const currentRow = ref<AddressInfo>({ const currentRow = ref<AddressInfo>({
receiverName: '', receiverName: '',
...@@ -3607,7 +3617,8 @@ const downloadMaterial = async () => { ...@@ -3607,7 +3617,8 @@ const downloadMaterial = async () => {
if ( if (
status.value === 'IN_PRODUCTION' || status.value === 'IN_PRODUCTION' ||
status.value === 'PICKING' || status.value === 'PICKING' ||
status.value === 'TO_BE_REPLENISHMENT' status.value === 'TO_BE_REPLENISHMENT' ||
status.value === 'TO_BE_ARRANGE'
) { ) {
selectedIds = cardSelection.value selectedIds = cardSelection.value
.map((item: ProductList) => item.id) .map((item: ProductList) => item.id)
...@@ -4222,14 +4233,36 @@ const logisticsSubmit = () => { ...@@ -4222,14 +4233,36 @@ const logisticsSubmit = () => {
}) })
} }
watch( watch(
() => status.value, // () => status.value,
(val) => { // (val) => {
const currentUrl = new URL(window.location.href) // const currentUrl = new URL(window.location.href)
currentUrl.searchParams.set('tab', val) // currentUrl.searchParams.set('tab', val)
window.history.pushState({}, '', currentUrl) // window.history.pushState({}, '', currentUrl)
// },
// { immediate: true },
() => [...(tableData.value as PodCnOrderListData[])], // 创建新数组避免直接修改原始数据
(newData) => {
if (!newData?.length) return
newData.forEach((order) => {
// 使用可选链和空值合并简化判断
order.productList?.forEach((product) => {
if (!product.previewImgs && product.imageAry) {
try {
product.previewImgs =
JSON.parse(product.imageAry)?.filter(
(el: { title: string }) => el.title,
) || []
} catch (error) {
console.error('JSON解析失败:', error)
product.previewImgs = []
}
}
})
})
console.log(tableData.value, '@@@@', newData)
}, },
{ immediate: true }, { deep: true, immediate: true }, // 添加immediate确保初始化时执行
) )
onMounted(() => { onMounted(() => {
...@@ -4470,15 +4503,15 @@ useRouter().beforeEach((to, from, next) => { ...@@ -4470,15 +4503,15 @@ useRouter().beforeEach((to, from, next) => {
.goods-item { .goods-item {
display: grid; display: grid;
grid-template-columns: 100px 1fr minmax(180px, 1fr) 180px; grid-template-columns: 100px 1fr minmax(150px, 1fr) 150px;
gap: 20px; gap: 15px;
.goods-item-img { .goods-item-img {
width: 100px; // width: 100px;
height: 100px; // height: 100px;
position: relative; position: relative;
img { img {
width: 100%; width: 65%;
} }
} }
...@@ -4565,7 +4598,6 @@ useRouter().beforeEach((to, from, next) => { ...@@ -4565,7 +4598,6 @@ useRouter().beforeEach((to, from, next) => {
display: flex; display: flex;
height: 30px; height: 30px;
gap: 10px; gap: 10px;
padding: 10px 6px 0;
.item-image { .item-image {
width: 30px; width: 30px;
height: 30px; height: 30px;
......
...@@ -547,7 +547,6 @@ ...@@ -547,7 +547,6 @@
<ElButton type="warning" @click="arrangeFinish">排单完成</ElButton> <ElButton type="warning" @click="arrangeFinish">排单完成</ElButton>
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem <ElFormItem
v-if="status !== 'BATCH_DOWNLOAD' && status !== 'WAIT_SHIPMENT'" v-if="status !== 'BATCH_DOWNLOAD' && status !== 'WAIT_SHIPMENT'"
> >
......
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