diff --git a/src/components/mycomponent/dialog/productListAddDialog.vue b/src/components/mycomponent/dialog/productListAddDialog.vue
index 05ca97c..ad214c5 100644
--- a/src/components/mycomponent/dialog/productListAddDialog.vue
+++ b/src/components/mycomponent/dialog/productListAddDialog.vue
@@ -121,10 +121,11 @@
-
-
-
-
+
+
+ {{ param.paramName }}
+
+
@@ -147,8 +148,10 @@
import { SelectList } from '@/api/product/brand'
import { C_list, C_paramsList } from '@/api/product/category'
import { add, update } from '@/api/product/product'
+import RedStar from '@/components/mycomponent/redStar'
export default {
+ components: { RedStar },
props: {
title: {
type: String,
@@ -191,7 +194,7 @@
productNetworkMode: '1',
productPicture: ''
},
- paramForm: [
+ paramValueList: [
// { paramName: '名称', paramOrder: 1, paramRequire: 1, paramValue: '' },
// { paramName: '数量', paramOrder: 2, paramRequire: 1, paramValue: '' },
// { paramName: '单位', paramOrder: 3, paramRequire: 1, paramValue: '' }
@@ -225,6 +228,9 @@
productNetworkMode: row.productNetworkMode,
productPicture: row.productPicture
}
+ if (row.categoryId) {
+ this.fetchParams(row.categoryId)
+ }
} else {
this.resetForm()
}
@@ -249,11 +255,12 @@
this.categoryList = res.data
})
},
+ // 获取品类参数列表
fetchParams(categoryId) {
C_paramsList(categoryId).then(res => {
if (res.code === 200) {
- this.paramForm = res.data.map(item => {
- return { paramName: item.paramName, paramOrder: item.paramOrder, paramRequire: item.paramRequire, paramValue: '' }
+ this.paramValueList = res.data.map(item => {
+ return { paramId: item.id, paramName: item.paramName, paramOrder: item.paramOrder, paramRequire: item.paramRequire, paramValue: '' }
})
}
})
@@ -274,6 +281,7 @@
productMaterialQuality: '',
productPicture: ''
}
+ this.paramValueList = []
},
// 照片上传
handleAvatarSuccess(res, file) {
@@ -296,22 +304,27 @@
},
// 新增
save() {
+ this.addInfo.paramValueList = this.paramValueList.map(item => {
+ return {
+ paramId: item.paramId,
+ paramName: item.paramName,
+ paramValue: item.paramValue
+ }
+ })
if (this.title === '新增产品') {
add(this.addInfo).then(res => {
- console.log(res, 'add')
- if (!res.code) {
- this.close()
- this.$emit('refresh')
+ if (res.code === 200) {
Message.success('保存成功')
+ this.$emit('refresh')
+ this.close()
}
})
} else {
update(this.addInfo).then(res => {
- console.log(res, 'update')
- if (!res.code) {
- this.close()
- this.$emit('refresh')
+ if (res.code === 200) {
Message.success('更新成功')
+ this.$emit('refresh')
+ this.close()
}
})
}
diff --git a/public/config/project.config.json b/public/config/project.config.json
index 2e5e3c4..cd629df 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -1,5 +1,5 @@
{
- "title": "后台管理系统",
+ "title": "智慧型厨房AIOT物联管理平台",
"subtitle": "",
"theme": "blue",
"baseUrl": "http://111.198.10.15:21403/",
@@ -8,4 +8,4 @@
"provinceCode": "360000",
"cityCode": "361000",
"areaCode": "361024"
-}
\ No newline at end of file
+}
diff --git a/src/components/mycomponent/dialog/categoryAddDialog.vue b/src/components/mycomponent/dialog/categoryAddDialog.vue
index c48b9cf..4e547d4 100644
--- a/src/components/mycomponent/dialog/categoryAddDialog.vue
+++ b/src/components/mycomponent/dialog/categoryAddDialog.vue
@@ -29,9 +29,9 @@
>
@@ -84,7 +84,7 @@
添加产品参数