From 718a51c732a9e932447ccf1c70fc69f2af5d10e0 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 18 十月 2023 19:49:55 +0800
Subject: [PATCH] 位置类型,上级位置除添加可以编辑,其他时候多不可
---
src/views/productManage/productCategory/AddProductCategoryDialog.vue | 32 +++++++++++++++++++++++++++-----
1 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/src/views/productManage/productCategory/AddProductCategoryDialog.vue b/src/views/productManage/productCategory/AddProductCategoryDialog.vue
index 841d7b4..9de00eb 100644
--- a/src/views/productManage/productCategory/AddProductCategoryDialog.vue
+++ b/src/views/productManage/productCategory/AddProductCategoryDialog.vue
@@ -36,10 +36,9 @@
label-position="right"
label-width="110px"
size="mini"
- style="height: 290px; overflow-x: hidden"
>
<div class="basic-info">
- <FormBtnsView :showProduct="true" @productClick="productClick" />
+ <FormBtnsView :showProduct="true" :countObject="statisticsMap" @productClick="productClick" />
<div class="basic-info-view">
<!-- <el-row> -->
<!-- <el-col :span="24">
@@ -161,9 +160,9 @@
</div>
</el-form>
<!-- 灏� -->
- <div v-if="showFooter" slot="footer" class="dialog-footer">
+ <div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" size="small" @click="editConfig.visible = false">淇濆苟鎻愪氦瀹℃壒</el-button> -->
- <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
+ <el-button type="primary" size="small" @click="saveClick('form')" :disabled="!showFooter">淇濆瓨</el-button>
<el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
</div>
</el-dialog>
@@ -174,6 +173,7 @@
import { addProductCategory, updateProductCategory, deleteProductCategory } from "@/api/product/productCategory"
import { getDataByType } from "@/api/data"
+import {getProductList} from "@/api/product/product";
export default {
name: "AddProductCategoryDialog",
props: {
@@ -213,13 +213,35 @@
showButton: true,
showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑�
- showFooter: false // 鏄惁鏄剧ず鍙栨秷淇濆瓨
+ showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨,
+ statisticsMap:{
+ product: 0 // 浜у搧鏁伴噺
+ }
}
},
created() {
this.setBottonView()
+ this.getProductCount()
},
methods: {
+ // 鑾峰彇浜у搧鏁伴噺
+ getProductCount(){
+ getProductList({
+ keyWord: '',
+ categoryId: this.editConfig.title === "鏂板缓" ? null : this.editConfig.infomation.id,
+ page: 1,
+ pageSize: 1
+ }).then((res) => {
+ if (res.code === 200) {
+ this.statisticsMap.product = res?.total ?? 0
+ }else{
+ this.statisticsMap.product = 0
+ }
+ }).catch(err=>{
+ console.error(err)
+ this.statisticsMap.product = 0
+ })
+ },
// 璁剧疆鍒犻櫎/鎵撳嵃/缂栬緫鏄惁鏄剧ず
setBottonView() {
if (this.editConfig.title === "鏂板缓") {
--
Gitblit v1.8.0