From 5dcdca03971701e72066c27e59c0a518e33c7be7 Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 11 Jun 2025 17:22:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(smart-cabinet):=20=E6=B7=BB=E5=8A=A0belong?= =?UTF-8?q?Type=E5=8F=82=E6=95=B0=E6=94=AF=E6=8C=81=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在ShopConfigModal和CabinetGoodsConfigModal组件中新增belongType参数,用于根据商品所属类型进行筛选。同时移除商品配置模态框中多余的belongType选择器,直接从父组件传递参数。 --- src/views/cabinet/smart-cabinet-card/detail.vue | 4 ++-- .../cabinet/smart-cabinet/ShopConfigModal.vue | 4 +++- .../cabinet-goods/cabinet-goods-config-modal.vue | 16 +++++++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/views/cabinet/smart-cabinet-card/detail.vue b/src/views/cabinet/smart-cabinet-card/detail.vue index d296dd2..0a0c500 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -403,7 +403,7 @@ onMounted(() => { - + @@ -411,7 +411,7 @@ onMounted(() => { @refresh="fetchCabinetDetail" /> - + (); const emit = defineEmits(['update:modelValue', 'refresh']); @@ -47,7 +48,8 @@ const loadShops = async () => { loading.value = true; const { data } = await getShopList({ pageSize: pagination.value.pageSize, - pageNum: pagination.value.currentPage + pageNum: pagination.value.currentPage, + belongType: props.belongType }); shopList.value = data.rows; pagination.value.total = data.total; diff --git a/src/views/shop/cabinet-goods/cabinet-goods-config-modal.vue b/src/views/shop/cabinet-goods/cabinet-goods-config-modal.vue index e667953..deb9812 100644 --- a/src/views/shop/cabinet-goods/cabinet-goods-config-modal.vue +++ b/src/views/shop/cabinet-goods/cabinet-goods-config-modal.vue @@ -6,11 +6,16 @@ import { configureGoodsCellsStock } from "@/api/cabinet/cabinet-cell"; import Search from "@iconify-icons/ep/search"; import Refresh from "@iconify-icons/ep/refresh"; import { ElMessage, ElMessageBox } from "element-plus"; +import { useWxStore } from "@/store/modules/wx"; const props = defineProps({ cellId: { type: Number, required: true + }, + belongType: { + type: Number, + required: false } }); @@ -19,10 +24,13 @@ const closeModal = () => { emit('update:modelValue', false); }; +const wxStore = useWxStore(); + const searchFormParams = ref({ + corpid: wxStore.corpid, goodsName: "", status: null, - belongType: null + belongType: props.belongType }); const pagination = ref({ @@ -37,6 +45,8 @@ const dataList = ref([]); const getList = async () => { try { loading.value = true; + searchFormParams.value.corpid = wxStore.corpid; + searchFormParams.value.belongType = props.belongType; const { data } = await getGoodsListApi({ ...searchFormParams.value, pageSize: pagination.value.pageSize, @@ -104,13 +114,13 @@ defineExpose({ getList }); --> - + 搜索