| | |
| | | size="mini" |
| | | > |
| | | <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"> |
| | |
| | | import { addProductCategory, updateProductCategory, deleteProductCategory } from "@/api/product/productCategory" |
| | | |
| | | import { getDataByType } from "@/api/data" |
| | | import {getProductList} from "@/api/product/product"; |
| | | export default { |
| | | name: "AddProductCategoryDialog", |
| | | props: { |
| | |
| | | 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 === "新建") { |