Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-06-13 12:11:16 +08:00
commit 57b0a77a46
2 files changed
+13 -5

No files matched your search

@@ -31,11 +31,11 @@
<vxe-column type="checkbox" width="40" fixed="left" /> <vxe-column type="checkbox" width="40" fixed="left" />
<vxe-column type="seq" width="50" fixed="left" /> <vxe-column type="seq" width="50" fixed="left" />
<vxe-column field="unit" title="单位" :edit-render="{}"> <vxe-column field="unit" title="单位" :edit-render="{}">
<template #edit="{ row }"> <template #edit="{ row, $rowIndex }">
<el-select v-model="row.unitId"> <el-select v-model="row.unitId" @change="handleUnitIdChange(row.unitId, $rowIndex)">
<div v-for="item in computedSmErpUnitEntityList"> <template v-for="item in computedSmErpUnitEntityList">
<el-option :label="item.unit" :value="item.id" /> <el-option :label="item.unit" :value="item.id" />
</div> </template>
</el-select> </el-select>
</template> </template>
<template #default="{ row }"> <template #default="{ row }">
@@ -63,6 +63,7 @@ import { type rowVU } from "./package-unit.vue"
export interface rowVC { export interface rowVC {
id: string id: string
unitId: string unitId: string
unit: string
barCode: string barCode: string
isNew?: boolean isNew?: boolean
} }
@@ -72,6 +73,7 @@ const auxiliaryCodeList = defineModel("modelValue", {
{ {
id: nanoid(5), id: nanoid(5),
unitId: "", unitId: "",
unit: "",
barCode: "", barCode: "",
}, },
], ],
@@ -100,6 +102,7 @@ const pushEvent = () => {
const newRow: rowVC = { const newRow: rowVC = {
id: nanoid(5), id: nanoid(5),
unitId: "", unitId: "",
unit: "",
barCode: "", barCode: "",
isNew: true, isNew: true,
} }
@@ -125,6 +128,11 @@ watch(
// 计算辅助条码中可选择的包装单位下拉菜单 // 计算辅助条码中可选择的包装单位下拉菜单
const computedSmErpUnitEntityList = computed(() => props.smErpUnitEntityList?.filter((item: rowVU) => item.unit)) const computedSmErpUnitEntityList = computed(() => props.smErpUnitEntityList?.filter((item: rowVU) => item.unit))
// 包装单位下拉选择变化
const handleUnitIdChange = (unitId: string, rowIndex: number) => {
;(auxiliaryCodeList.value[rowIndex] as any).unit = computedSmErpUnitEntityList.value?.find((item: rowVU) => item.id == unitId)?.unit
}
// 删除选中的行 // 删除选中的行
const removeSelectRowEvent = () => { const removeSelectRowEvent = () => {
const $table = editableTableRef.value const $table = editableTableRef.value
@@ -224,7 +224,7 @@ const usePackageUnitList = () => {
item.retailPrice = storePrice(item.retailPrice) item.retailPrice = storePrice(item.retailPrice)
if (item.isNew) { if (item.isNew) {
item.id = "" item.id = ""
// delete item.isNew delete item.isNew
} }
return item return item
}) })