fix:修改商品价格单元
This commit is contained in:
@@ -171,8 +171,8 @@
|
||||
<el-form-item label="库存数量" prop="inventory">
|
||||
<el-input-number v-model="productForm.inventory" :min="0" placeholder="请输入库存" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品价格(分)" prop="price">
|
||||
<el-input-number v-model="productForm.price" :min="0" placeholder="请输入价格(分)" style="width: 100%" />
|
||||
<el-form-item label="商品价格(元)" prop="price">
|
||||
<el-input-number v-model="productForm.price" :min="0" :precision="2" :step="0.01" placeholder="请输入价格(元)" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单个商品数量" prop="pay_num">
|
||||
<el-input-number v-model="productForm.pay_num" :min="1" placeholder="请输入单个商品数量" style="width: 100%" />
|
||||
@@ -326,7 +326,7 @@
|
||||
<el-table-column prop="index" label="排序" width="80" />
|
||||
<el-table-column label="价格" width="100">
|
||||
<template #default="{ row }">
|
||||
¥{{ row.price }}
|
||||
¥{{ (row.price / 100).toFixed(2) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
@@ -593,7 +593,7 @@ const handleEdit = (row) => {
|
||||
good_group_id: row.goodGroupId,
|
||||
inventory_control: row.inventoryControl,
|
||||
inventory: row.inventory,
|
||||
price: row.price,
|
||||
price: row.price / 100, // 分转元
|
||||
pay_num: row.payNum,
|
||||
expire_time: row.expireTime,
|
||||
recommend: row.recommend,
|
||||
@@ -687,7 +687,7 @@ const submitForm = () => {
|
||||
good_group_id: Number(productForm.good_group_id), // 确保是数字类型
|
||||
cover_id: productForm.cover_id || 0,
|
||||
inventory: productForm.inventory || 0,
|
||||
price: productForm.price/100 || 0,
|
||||
price: Math.round(productForm.price * 100) || 0, // 元转分
|
||||
pay_num: productForm.pay_num || 1,
|
||||
expire_time: productForm.expire_time || 0,
|
||||
recommend_rebate: productForm.recommend_rebate || 0
|
||||
|
||||
Reference in New Issue
Block a user