diff --git a/ruoyi-ui/src/views/product/index.vue b/ruoyi-ui/src/views/product/index.vue
index 9694ca3..bef0e25 100644
--- a/ruoyi-ui/src/views/product/index.vue
+++ b/ruoyi-ui/src/views/product/index.vue
@@ -9,6 +9,14 @@
@keyup.enter.native="handleQuery"
/>
+
+
+
搜索
重置
@@ -56,16 +64,9 @@
-
-
- {{ (scope.row.originalPrice / 100).toFixed(2) }}
-
-
-
-
- {{ (scope.row.currentPrice / 100).toFixed(2) }}
-
-
+
+
+
-
+ /> -->
@@ -103,6 +104,9 @@
+
+
+
@@ -147,7 +151,8 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
- name: null
+ name: null,
+ typeName: null
},
// 表单参数
form: {},
@@ -183,6 +188,7 @@ export default {
id: null,
name: null,
description: null,
+ typeName: null,
originalPrice: null,
currentPrice: null
}
@@ -216,13 +222,6 @@ export default {
const id = row.id || this.ids
getProduct(id).then(response => {
this.form = response.data
- // 将分转换为元显示
- if (this.form.originalPrice) {
- this.form.originalPrice = (this.form.originalPrice / 100).toFixed(2)
- }
- if (this.form.currentPrice) {
- this.form.currentPrice = (this.form.currentPrice / 100).toFixed(2)
- }
this.open = true
this.title = "修改商品"
})
@@ -231,25 +230,14 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
- // 创建提交数据的副本
- const submitData = { ...this.form }
-
- // 将元转换为分发送到接口
- if (submitData.originalPrice) {
- submitData.originalPrice = Math.round(parseFloat(submitData.originalPrice) * 100)
- }
- if (submitData.currentPrice) {
- submitData.currentPrice = Math.round(parseFloat(submitData.currentPrice) * 100)
- }
-
if (this.form.id != null) {
- updateProduct(submitData).then(response => {
+ updateProduct(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
- addProduct(submitData).then(response => {
+ addProduct(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()