修复
This commit is contained in:
1 parent
9904fa9cdc
commit
84f92965a2
1 file changed
+19
@@ -86,6 +86,18 @@ const form = reactive<any>({
|
|||||||
promotionPrice: 0,
|
promotionPrice: 0,
|
||||||
costPrice: 0,
|
costPrice: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 表单金额转为单位分
|
||||||
|
const formatedMoney = computed(() => {
|
||||||
|
return {
|
||||||
|
grossMargin: storePrice(form.grossMargin),
|
||||||
|
purchasePrice: storePrice(form.purchasePrice),
|
||||||
|
retailPrice: storePrice(form.retailPrice),
|
||||||
|
promotionPrice: storePrice(form.promotionPrice),
|
||||||
|
costPrice: storePrice(form.costPrice),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = {
|
const dataRules = {
|
||||||
productNature: [{ required: true, message: "请选择商品性质", trigger: "blur" }],
|
productNature: [{ required: true, message: "请选择商品性质", trigger: "blur" }],
|
||||||
@@ -149,6 +161,10 @@ const getsupermarketSpuData = async (id: string) => {
|
|||||||
Object.assign(form, {
|
Object.assign(form, {
|
||||||
...res.data,
|
...res.data,
|
||||||
grossMargin: parseFloat(displayPrice(res.data.grossMargin, "")),
|
grossMargin: parseFloat(displayPrice(res.data.grossMargin, "")),
|
||||||
|
retailPrice: parseFloat(displayPrice(res.data.retailPrice, "")),
|
||||||
|
promotionPrice: parseFloat(displayPrice(res.data.promotionPrice, "")),
|
||||||
|
purchasePrice: parseFloat(displayPrice(res.data.purchasePrice, "")),
|
||||||
|
costPrice: parseFloat(displayPrice(res.data.costPrice, "")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@@ -168,6 +184,8 @@ const resetForm = () => {
|
|||||||
// 第一步的下一步
|
// 第一步的下一步
|
||||||
const addPackageUnitNextStep = () => {
|
const addPackageUnitNextStep = () => {
|
||||||
currentTabPaneIndex.value++
|
currentTabPaneIndex.value++
|
||||||
|
if (form.id) return
|
||||||
|
|
||||||
const row = {
|
const row = {
|
||||||
id: nanoid(5),
|
id: nanoid(5),
|
||||||
barCode: form.barCode,
|
barCode: form.barCode,
|
||||||
@@ -250,6 +268,7 @@ const onSubmit = async () => {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
const _pa = {
|
const _pa = {
|
||||||
...form,
|
...form,
|
||||||
|
...formatedMoney.value,
|
||||||
grossMargin: storePrice(form.grossMargin),
|
grossMargin: storePrice(form.grossMargin),
|
||||||
smErpAuxiliaryCodeEntityList,
|
smErpAuxiliaryCodeEntityList,
|
||||||
smErpUnitEntityList,
|
smErpUnitEntityList,
|
||||||
|
|||||||
Reference in new issue
Block a user