fix: 修复商品保存时数据为空的问题
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-04-01 14:45:39 +00:00
parent 10ebbd6b6f
commit 5af9b7c0ff

View File

@@ -196,6 +196,9 @@ export default {
unit: '', unit: '',
price: '', price: '',
categoryId: '', categoryId: '',
length: '',
width: '',
area: '',
remark: '', remark: '',
status: 1 status: 1
} }
@@ -236,11 +239,12 @@ export default {
} }
try { try {
const formData = JSON.parse(JSON.stringify(this.form))
if (this.isEdit) { if (this.isEdit) {
await productApi.updateProduct(this.form) await productApi.updateProduct(formData)
uni.showToast({ title: '更新成功', icon: 'success' }) uni.showToast({ title: '更新成功', icon: 'success' })
} else { } else {
await productApi.createProduct(this.form) await productApi.createProduct(formData)
uni.showToast({ title: '创建成功', icon: 'success' }) uni.showToast({ title: '创建成功', icon: 'success' })
} }
this.closeModal() this.closeModal()