Commit e6509862 by linjinhong

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

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