Commit e6509862 by linjinhong

修改podus样式 以及播种墙配货添加仓库本地缓存

parent 7f5fd591
......@@ -12,7 +12,7 @@
<ElTableColumn
v-if="selectionable"
type="selection"
width="50"
width="40"
fixed="left"
header-align="center"
align="center"
......@@ -21,7 +21,7 @@
v-if="serialNumberable"
label="序号"
type="index"
width="60"
width="55"
fixed="left"
header-align="center"
align="center"
......
......@@ -95,6 +95,7 @@ export interface ProductList {
craftCode?: string
platform?: string
imageAry?: string
previewImgs?: []
designImages?: string
categoryId?: number
categoryName?: string
......
......@@ -247,7 +247,12 @@ const props = defineProps<{
printOrder: (data: OrderData, callback: (status: boolean) => void) => void
warehouseList: WarehouseListData[]
}>()
const emit = defineEmits(['update:modelValue', 'set-printer', 'refresh'])
const emit = defineEmits([
'update:modelValue',
'set-printer',
'refresh',
'set-warehouseId',
])
const visible = computed({
get() {
return props.modelValue
......@@ -259,6 +264,7 @@ const visible = computed({
const printDeviceList = ref<string[]>([])
const sheetPrinter = ref<string>('')
const productionOrder = ref<string>('')
const podOrderDetailsData = ref<OrderData>()
const podOrderDetailsColumns = computed(() => [
......@@ -351,7 +357,9 @@ watch(visible, async (value: boolean) => {
initOrderDetailBox()
initPrintDevice()
const locaclPrinter = localStorage.getItem('sheetPrinter')
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
} else {
if (userStore.user?.factory.id) {
socket.send({
......@@ -927,6 +935,7 @@ const handleWarehouseChange = (value: string | number) => {
})
}
warehouseId.value = value
emit('set-warehouseId', value)
socket.send({
code: 'STARTORDER',
factoryNo: userStore.user?.factory.id,
......
......@@ -609,22 +609,31 @@
:key="item"
class="goods-item"
>
<div class="goods-item-img">
<img
:src="item.variantImage"
alt="商品图片"
style="cursor: pointer"
@click="handlePictureCardPreview(item?.variantImage)"
/>
<div
class="goods-item-img"
style="display: flex; flex-direction: column"
>
<div
v-if="item.customizedQuantity"
class="triangle-box"
:title="`类型:${getQuantityText(
item.customizedQuantity,
)}面`"
v-for="img in item.previewImgs"
:key="img"
style="text-align: center"
>
<div class="multi-text">
{{ getQuantityText(item.customizedQuantity) }}
<img
: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>
......@@ -715,7 +724,7 @@
</span>
<el-icon
class="icon"
@click="copy(item.factorySubOrderNumber || '')"
@click.stop="copy(item.factorySubOrderNumber || '')"
>
<DocumentCopy />
</el-icon>
......@@ -732,7 +741,7 @@
</span>
<el-icon
class="icon"
@click="copy(item.thirdSubOrderNumber || '')"
@click.stop="copy(item.thirdSubOrderNumber || '')"
>
<DocumentCopy />
</el-icon>
......@@ -770,12 +779,14 @@
</div>
<div class="goods-item-info">
<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">
{{ item.productPrice }}($)
{{ item.productPrice }}
</span>
</div>
<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-value">
{{ item.templatePrice }}($)
......@@ -792,7 +803,7 @@
<span class="goods-item-info-item-value">
{{ item.payAmount }}($)
</span>
</div>
</div> -->
<div class="goods-item-info-item">
<span class="goods-item-info-item-label">{{
......@@ -1061,10 +1072,10 @@
<template #price="{ row }">
<div class="order-price-box">
<div class="order-price-item">
<span class="order-price-item-label">商品总价:</span>
<span class="order-price-item-value">
{{ row.totalAmount }}($)
</span>
<div class="order-price-item-label">商品总价</div>
<div class="order-price-item-value">
{{ row.totalAmount }}
</div>
</div>
<div
......@@ -1074,15 +1085,15 @@
"
class="order-price-item"
>
<span class="order-price-item-label">物流运费:</span>
<span class="order-price-item-value">
{{ row.payFreight }}($)
</span>
<div class="order-price-item-label">物流运费</div>
<div class="order-price-item-value">
{{ row.payFreight }}
</div>
</div>
</div>
</template>
<template #time="{ row }">
<el-timeline style="max-width: 600px">
<el-timeline>
<el-timeline-item
:color="row.createTime ? '#409EFF' : ''"
:timestamp="row.createTime"
......@@ -1231,7 +1242,7 @@
class="operate-item"
>
<ElButton link type="primary" @click="showLogistics(row)">
更新物流信息
更新物流
</ElButton>
</span>
<span
......@@ -1514,7 +1525,7 @@
<div class="grid-item">
<div
:title="`第三方生产单号:${cardItem?.thirdSubOrderNumber}`"
:title="`单号:${cardItem?.thirdSubOrderNumber}`"
class="grid-item-value orderNumber"
>
{{ cardItem?.thirdSubOrderNumber }}
......@@ -1707,6 +1718,7 @@
:print-order="printOrder"
:warehouse-list="warehouseList"
@set-printer="handlePrinterChange"
@set-warehouseId="handleWarehouseIdChange"
@refresh="onFastRefresh"
/>
<ElDialog
......@@ -2469,7 +2481,7 @@ const tableColumns = computed(() => {
label: '商品',
prop: 'goods',
slot: 'goods',
minWidth: 920,
minWidth: 800,
},
{
label: '订单详情',
......@@ -2478,16 +2490,16 @@ const tableColumns = computed(() => {
width: 300,
},
{
label: '单价',
label: '订单金额($)',
slot: 'price',
width: 160,
width: 110,
prop: 'price',
align: 'left',
},
{
label: '时间',
slot: 'time',
width: 180,
width: 170,
prop: 'time',
align: 'left',
},
......@@ -2499,7 +2511,7 @@ const tableColumns = computed(() => {
// },
{
label: '异常原因',
width: 300,
width: 250,
prop: 'exceptionReason',
slot: 'exceptionReason',
align: 'left',
......@@ -2507,7 +2519,7 @@ const tableColumns = computed(() => {
{
label: '操作',
slot: 'operate',
width: 180,
width: 80,
align: 'center',
fixed: 'right',
prop: 'operate',
......@@ -2673,6 +2685,28 @@ const {
},
})
watch(
() => [...(tableData.value as PodUsOrderListData[])], // 创建新数组避免直接修改原始数据
(newData) => {
if (!newData?.length) return
newData.forEach((order) => {
// 使用可选链和空值合并简化判断
order.productList?.forEach((product) => {
if (!product.previewImgs && product.imageAry) {
try {
product.previewImgs = JSON.parse(product.imageAry)
} catch (error) {
console.error('JSON解析失败:', error)
product.previewImgs = []
}
}
})
})
},
{ deep: true, immediate: true }, // 添加immediate确保初始化时执行
)
const search = () => {
selection.value = []
cardSelection.value = []
......@@ -2808,8 +2842,12 @@ const handleConfirm = async () => {
await loadTabData()
}
const copy = (text: string) => {
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
try {
navigator.clipboard.writeText(text)
ElMessage.success('复制成功')
} catch (err) {
console.error('复制失败:', err)
}
}
const handleUpdateRemark = async (item: ProductList) => {
ElMessageBox.prompt('请输入备注', '提示', {
......@@ -3791,6 +3829,9 @@ const handlePrinterChange = (value: string) => {
sheetPrinter.value = value
localStorage.setItem('sheetPrinter', JSON.stringify(value))
}
const handleWarehouseIdChange = (value: string) => {
localStorage.setItem('locaclWarehouseId', JSON.stringify(value))
}
const { getCLodop } = useLodop()
const printOrder = async (
data: OrderData,
......@@ -4341,15 +4382,15 @@ useRouter().beforeEach((to, from, next) => {
.goods-item {
display: grid;
grid-template-columns: 100px 1fr minmax(180px, 1fr) 180px;
gap: 20px;
grid-template-columns: 100px 1fr minmax(150px, 1fr) 150px;
gap: 15px;
.goods-item-img {
width: 100px;
height: 100px;
// width: 100px;
// height: 65px;
position: relative;
img {
width: 100%;
width: 65%;
}
}
......@@ -4629,4 +4670,8 @@ useRouter().beforeEach((to, from, next) => {
align-items: center;
outline: none;
}
.el-timeline-item__wrapper {
padding-left: 15px;
top: -6px;
}
</style>
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