Commit b340eb76 by wusiyi
parents 0598cc2d 18ffa839
......@@ -323,6 +323,12 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="库位"
prop="locationCode"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价(¥)"
prop="costPrice"
/>
......
......@@ -335,6 +335,12 @@
<ElTableColumn
show-overflow-tooltip
align="center"
label="库位"
prop="locationCode"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="成本价(¥)"
prop="costPrice"
/>
......@@ -344,18 +350,6 @@
label="总成本(¥)"
prop="totalPrice"
/>
<!-- <ElTableColumn
show-overflow-tooltip
align="center"
label="不良品数量"
prop="rejectsAmount"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="不良品原因"
prop="rejectsAeason"
/> -->
<ElTableColumn
show-overflow-tooltip
align="center"
......@@ -377,7 +371,6 @@
/>
</ElTable>
</div>
<!-- <ElPagination
v-model:current-page="detailPager.page"
v-model:page-size="detailPager.rows"
......@@ -551,13 +544,8 @@
/>
<ElTableColumn align="center" label="库位" prop="locationCode">
<template #default="{ row }">
<!-- +后有就正常展示,没有则通过搜索接口自己添加 -->
<!-- remote
:remote-method="(query) => handleLocationSearch(query, row)"
:loading="locationLoading"-->
<span v-if="row.locationCode">{{ row.locationCode }}</span>
<!-- <span v-if="formId&&row.locationCode">{{ row.locationCode }}</span> -->
<ElSelect
v-else
v-model="row.locationId"
clearable
placeholder="请输入库位"
......@@ -1213,8 +1201,8 @@ const handleLocalImport = async ({
warehouseSku: skuItem.sku,
skuName: skuItem.skuName,
productNo: skuItem.productNo,
locationCode: skuItem.locationCode ?? '',
locationId: skuItem.locationId || target?.locationId,
locationCode: target?.locationCode ?? '',
locationId: target?.locationId,
costPrice: skuItem.factoryPrice,
buyStored: importedItem?.buyStored ?? null,
totalPrice: new BigNumber(
......@@ -1501,7 +1489,6 @@ watch(
},
{ immediate: true },
)
watch(
() => editForm.value.warehouseId,
(newVal: number | string | undefined) => {
......@@ -1718,6 +1705,27 @@ const fetchLocationList = async (query: string) => {
locationCode: item.locationCode,
}
})
if (otherPurchaseData.value?.length > 0) {
//const importedSkus = otherPurchaseData.value.map((item) => item.warehouseSku).join(',')
// // 3. 调用 batchAddCommodity 获取商品的完整信息并过滤掉已有的 SKU
// const filteredSkusList = await batchAddCommodity(importedSkus)
// console.log('filteredSkusList', otherPurchaseData.value)
// 新增时切换仓库将重新匹配表格库位,确保该商品的库位和仓库一一对应
otherPurchaseData.value = otherPurchaseData.value.map(
(item: InterProductList) => {
const foundItem = locationList.value.find(
(locationItem: ILocation) =>
locationItem.locationCode === item.locationCode,
)
// 创建新对象而不是修改原对象
return {
...item,
locationCode: foundItem ? foundItem.locationCode : '',
locationId: foundItem ? foundItem.locationId : null,
}
},
)
}
} catch (e) {
locationList.value = []
} finally {
......
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