From a11d38dff8d7beca6d33251557b7e370c155faf1 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 18 十月 2023 17:10:41 +0800 Subject: [PATCH] 新建调拨弹窗样式调整(5288) --- 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