库存商品修改

This commit is contained in:
zjf committed 2025-08-21 17:34:18 +08:00
1 parent 6517d33d1c
commit 017cba3a05
4 files changed
+34 -22

No files matched your search

@@ -35,7 +35,7 @@
<template v-for="item in unitSelectOptions"> <template v-for="item in unitSelectOptions">
<el-option :label="item.unit" :value="item.id"> <el-option :label="item.unit" :value="item.id">
<span class="float-left">单位:{{ item.unit }}</span> <span class="float-left">单位:{{ item.unit }}</span>
<span class="float-right ml-4">口味:{{ item.taste }}</span> <span class="float-right ml-4">口味:{{ item.tasteName }}</span>
</el-option> </el-option>
</template> </template>
</el-select> </el-select>
@@ -45,9 +45,9 @@
<span v-else style="color: #c0c4cf">请选择</span> <span v-else style="color: #c0c4cf">请选择</span>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="taste" title="口味"> <vxe-column field="tasteName" title="口味">
<template #default="{ row }"> <template #default="{ row }">
{{ unitSelectOptions?.find((item: rowVU) => item.id === row.unitId)?.taste }} {{ unitSelectOptions?.find((item: rowVU) => item.id === row.unitId)?.tasteName }}
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="barCode" title="辅助条码" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }"> <vxe-column field="barCode" title="辅助条码" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
@@ -74,7 +74,7 @@ export interface rowVC {
id: string id: string
unitId: string unitId: string
unit: string unit: string
taste: string tasteName: string
barCode: string barCode: string
} }
@@ -96,7 +96,7 @@ const pushEvent = () => {
id: "tmp_" + nanoid(5), id: "tmp_" + nanoid(5),
unitId: "", unitId: "",
unit: "", unit: "",
taste: "", tasteName: "",
barCode: "", barCode: "",
} }
auxiliaryCodeList.value.push(newRow) auxiliaryCodeList.value.push(newRow)
@@ -132,7 +132,7 @@ watch(
const handleUnitIdChange = (unitId: string, rowIndex: number) => { const handleUnitIdChange = (unitId: string, rowIndex: number) => {
const unitItem = unitSelectOptions.value?.find((item: rowVU) => item.id == unitId) const unitItem = unitSelectOptions.value?.find((item: rowVU) => item.id == unitId)
;(auxiliaryCodeList.value[rowIndex] as any).unit = unitItem?.unit ;(auxiliaryCodeList.value[rowIndex] as any).unit = unitItem?.unit
;(auxiliaryCodeList.value[rowIndex] as any).taste = unitItem?.taste ;(auxiliaryCodeList.value[rowIndex] as any).tasteName = unitItem?.tasteName
} }
// 校验可编辑表格 成功返回 true 失败返回 false // 校验可编辑表格 成功返回 true 失败返回 false
@@ -1,18 +1,28 @@
<template> <template>
<el-row class="mb-2"> <el-row class="mb-2">
<el-button type="primary" @click="pushEvent()">新增</el-button> <el-button type="primary" @click="pushEvent()">新增</el-button>
<el-tooltip effect="light" placement="right"> <el-tooltip effect="light" placement="right">
<template #content> <template #content>
<el-alert class="w-[500px] h-24" type="warning" show-icon :closable="false"> <el-alert class="w-[500px] h-24" type="warning" show-icon :closable="false">
<p> <p>
注:内装数据必须为该商品的最小售卖的基本单位,否则无法完成库存数量转换,影响erp库存自动扣减操作。 注:内装数据必须为该商品的最小售卖的基本单位,否则无法完成库存数量转换,影响erp库存自动扣减操作。
例如:一瓶矿泉水内装填'1',为售卖的最小基础单位,如果想按箱卖,在继续添加包装单位为箱,内装为24 例如:一瓶矿泉水内装填'1',为售卖的最小基础单位,如果想按箱卖,在继续添加包装单位为箱,内装为24
</p> </p>
</el-alert> </el-alert>
</template> </template>
<el-icon class="text-xl my-auto mx-4 text-yellow-600"><WarningFilled /></el-icon> <el-icon class="text-xl my-auto mx-4 text-yellow-600"><WarningFilled /></el-icon>
</el-tooltip> </el-tooltip>
<el-button type="primary" @click="tasteFormRef.openDialog()">新增口味</el-button> <el-button type="success" @click="tasteFormRef.openDialog()">口味管理</el-button>
<el-tooltip effect="light" placement="right">
<template #content>
<el-alert class="w-[500px] h-24" type="warning" show-icon :closable="false">
<p>
注:口味管理则可以实现通过对该商品的口味划分+设置改口味的基础库存,以此实现对某个的口味商品进行不同包装形式售卖
</p>
</el-alert>
</template>
<el-icon class="text-xl my-auto mx-4 text-yellow-600"><WarningFilled /></el-icon>
</el-tooltip>
</el-row> </el-row>
<vxe-table <vxe-table
@@ -143,9 +153,8 @@ export interface rowVU {
costPrice: number costPrice: number
isBase?: boolean | null isBase?: boolean | null
flag?: string flag?: string
taste?: string
tasteId: string
tasteName?: string tasteName?: string
tasteId: string
} }
export interface TasteItem { export interface TasteItem {
id: string id: string
@@ -219,7 +228,7 @@ const pushEvent = (row?: rowVU | undefined) => {
retailPrice: 0.01, retailPrice: 0.01,
promotionPrice: 0, promotionPrice: 0,
costPrice: 0, costPrice: 0,
taste: "", tasteName: "",
tasteId: "", tasteId: "",
} }
Object.assign(newRow, row) Object.assign(newRow, row)
@@ -22,8 +22,11 @@
<span class="text-lg"> <span class="text-lg">
注:此处库存数应该填写最小售卖单位的总库存,否则无法换算成完整的库存扣减。每卖出一个包装形式的商品,都会进行总库存数 - 注:此处库存数应该填写最小售卖单位的总库存,否则无法换算成完整的库存扣减。每卖出一个包装形式的商品,都会进行总库存数 -
内装数,从而进行多种包装形式的售卖。 内装数,从而进行多种包装形式的售卖。
<br>
期初库存指的是该商品还未录入到本系统时所剩库存数,即初始库存
</span> </span>
</el-alert> </el-alert>
</el-row> </el-row>
</template> </template>
@@ -155,7 +155,7 @@
<upload-excel-update ref="excelUploadUpdateRef" title="覆盖导入库存商品" <upload-excel-update ref="excelUploadUpdateRef" title="覆盖导入库存商品"
url="/supermarket/supermarketSpu/importNewUpdate" @refreshDataList="refreshDataList" /> url="/supermarket/supermarketSpu/importNewUpdate" @refreshDataList="refreshDataList" />
<upload-excel ref="excelUploadPd" title="导入库存盘点" url="/supermarket/supermarketSpu/importPD" <upload-excel ref="excelUploadPd" title="导入库存盘点" url="/supermarket/supermarketSpu/importPDNew"
@refreshDataList="refreshDataList" /> @refreshDataList="refreshDataList" />
</div> </div>
</template> </template>