|
@@ -1421,13 +1421,17 @@ export default {
|
|
|
},
|
|
|
/* 产品分类名称 */
|
|
|
getCategoryTypeName(categoryId) {
|
|
|
- const category = this.productList.find((item) => item.id === categoryId);
|
|
|
- return category ? category.category.name : categoryId;
|
|
|
+ if (!categoryId) return "未分类";
|
|
|
+ const product = this.productList.find((item) => item.id === categoryId);
|
|
|
+ return product && product.category ? product.category.name : "未知分类";
|
|
|
},
|
|
|
+
|
|
|
getCategoryName(categoryId) {
|
|
|
- const category = this.productList.find((item) => item.id === categoryId);
|
|
|
- return category ? category.name : categoryId;
|
|
|
+ if (!categoryId) return "未知产品";
|
|
|
+ const product = this.productList.find((item) => item.id === categoryId);
|
|
|
+ return product ? product.name : "未知产品";
|
|
|
},
|
|
|
+
|
|
|
searchData() {
|
|
|
let _this = this;
|
|
|
_this.dialogVisible = false;
|