超市添加部分校验和默认值选择
This commit is contained in:
1 parent
658380c60d
commit
47d0d1e8bf
3 files changed
+12
-10
No files matched your search
@@ -367,6 +367,7 @@ const getSelectedRows = (selectionRows: any) => {
|
||||
return {
|
||||
...addItem,
|
||||
erpUnitVos: addItem.erpUnitVos.map((item: any) => ({ ...item, realPrice: displayPrice(item.purchasePrice, "") })),
|
||||
unitObj: addItem.erpUnitVos[0],
|
||||
isNew: true,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
size="mini"
|
||||
align="center"
|
||||
>
|
||||
<vxe-column type="seq" width="50" fixed="left" />
|
||||
<vxe-column type="checkbox" width="40" fixed="left" />
|
||||
<vxe-column type="radio" title="基础单位" fixed="left" />
|
||||
<vxe-column type="seq" width="50" fixed="left" />
|
||||
<vxe-column field="barCode" title="条码" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
<template #edit="{ row }">
|
||||
<el-input v-model.trim="row.barCode" />
|
||||
@@ -74,7 +74,7 @@
|
||||
</vxe-column>
|
||||
<vxe-column field="packageNum" title="内装数" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
<template #edit="{ row }">
|
||||
<el-input-number v-model="row.packageNum" controls-position="right" :min="0" :precision="0" />
|
||||
<el-input-number v-model="row.packageNum" controls-position="right" :min="1" :precision="0" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="purchasePrice" title="进价(元)" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
@@ -84,7 +84,7 @@
|
||||
</vxe-column>
|
||||
<vxe-column field="retailPrice" title="零售价(元)" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
<template #edit="{ row }">
|
||||
<el-input-number v-model="row.retailPrice" controls-position="right" :min="0" :precision="2" />
|
||||
<el-input-number v-model="row.retailPrice" controls-position="right" :min="0.01" :precision="2" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="promotionPrice" title="促销价(元)" :edit-render="{ autoFocus: 'input', placeholder: '请输入' }">
|
||||
@@ -128,9 +128,9 @@ const packageUnitList = defineModel<rowVU[]>("modelValue", {
|
||||
spec: "",
|
||||
unit: "",
|
||||
status: "",
|
||||
packageNum: 0,
|
||||
packageNum: 1,
|
||||
purchasePrice: 0,
|
||||
retailPrice: 0,
|
||||
retailPrice: 0.01,
|
||||
promotionPrice: null,
|
||||
costPrice: 0,
|
||||
},
|
||||
@@ -144,7 +144,7 @@ const validRules = {
|
||||
unit: [{ required: true, message: "单位不能为空", trigger: "blur" }],
|
||||
status: [{ required: true, message: "状态不能为空", trigger: "blur" }],
|
||||
packageNum: [{ required: true, message: "内装数不能为空", trigger: "blur" }],
|
||||
retailPrice: [{ required: true, message: "零售价不能为空", trigger: "blur" }],
|
||||
retailPrice: [{ required: true, type: "number", min: 0.01, message: "零售价不能为0" }],
|
||||
purchasePrice: [{ required: true, message: "进价不能为空", trigger: "blur" }],
|
||||
// promotionPrice: [{ required: true, message: "促销价不能为空", trigger: "blur" }],
|
||||
}
|
||||
@@ -161,9 +161,9 @@ const pushEvent = (row?: rowVU | undefined) => {
|
||||
spec: "",
|
||||
unit: "",
|
||||
status: "",
|
||||
packageNum: 0,
|
||||
packageNum: 1,
|
||||
purchasePrice: 0,
|
||||
retailPrice: 0,
|
||||
retailPrice: 0.01,
|
||||
promotionPrice: null,
|
||||
costPrice: 0,
|
||||
isNew: true,
|
||||
|
||||
@@ -80,9 +80,9 @@ const form = reactive<any>({
|
||||
spec: "",
|
||||
unit: "",
|
||||
unitStatus: "0",
|
||||
packageNum: 0,
|
||||
packageNum: 1,
|
||||
purchasePrice: 0,
|
||||
retailPrice: 0,
|
||||
retailPrice: 0.01,
|
||||
promotionPrice: 0,
|
||||
costPrice: 0,
|
||||
})
|
||||
@@ -203,6 +203,7 @@ const addPackageUnitNextStep = () => {
|
||||
const isFlagRowExist = form.smErpUnitEntityList.some((item: rowVU) => item.flag === "addPackageUnitNextStep")
|
||||
if (isFlagRowExist) return
|
||||
packageUnitRef.value.pushEvent(row)
|
||||
packageUnitRef.value.setRadioRow(0) // 设置基础包装单位的单选行
|
||||
}
|
||||
|
||||
// tab栏切换
|
||||
|
||||
Reference in new issue
Block a user