Merge remote-tracking branch 'origin/master'
This commit is contained in:
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="seq" width="50" fixed="left" />
|
||||
<vxe-column field="unit" title="单位" :edit-render="{}">
|
||||
<template #edit="{ row }">
|
||||
<el-select v-model="row.unitId">
|
||||
<div v-for="item in computedSmErpUnitEntityList">
|
||||
<template #edit="{ row, $rowIndex }">
|
||||
<el-select v-model="row.unitId" @change="handleUnitIdChange(row.unitId, $rowIndex)">
|
||||
<template v-for="item in computedSmErpUnitEntityList">
|
||||
<el-option :label="item.unit" :value="item.id" />
|
||||
</div>
|
||||
</template>
|
||||
</el-select>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
@@ -63,6 +63,7 @@ import { type rowVU } from "./package-unit.vue"
|
||||
export interface rowVC {
|
||||
id: string
|
||||
unitId: string
|
||||
unit: string
|
||||
barCode: string
|
||||
isNew?: boolean
|
||||
}
|
||||
@@ -72,6 +73,7 @@ const auxiliaryCodeList = defineModel("modelValue", {
|
||||
{
|
||||
id: nanoid(5),
|
||||
unitId: "",
|
||||
unit: "",
|
||||
barCode: "",
|
||||
},
|
||||
],
|
||||
@@ -100,6 +102,7 @@ const pushEvent = () => {
|
||||
const newRow: rowVC = {
|
||||
id: nanoid(5),
|
||||
unitId: "",
|
||||
unit: "",
|
||||
barCode: "",
|
||||
isNew: true,
|
||||
}
|
||||
@@ -125,6 +128,11 @@ watch(
|
||||
// 计算辅助条码中可选择的包装单位下拉菜单
|
||||
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 $table = editableTableRef.value
|
||||
|
||||
@@ -224,7 +224,7 @@ const usePackageUnitList = () => {
|
||||
item.retailPrice = storePrice(item.retailPrice)
|
||||
if (item.isNew) {
|
||||
item.id = ""
|
||||
// delete item.isNew
|
||||
delete item.isNew
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user