feat(smart-cabinet): 添加belongType参数支持商品分类筛选
在ShopConfigModal和CabinetGoodsConfigModal组件中新增belongType参数,用于根据商品所属类型进行筛选。同时移除商品配置模态框中多余的belongType选择器,直接从父组件传递参数。
This commit is contained in:
parent
1d2cd48a7f
commit
5dcdca0397
|
@ -403,7 +403,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<GatewayConfigModal v-model="gatewayConfigVisible" :cabinet-id="cabinetId" @refresh="fetchCabinetDetail" />
|
<GatewayConfigModal v-model="gatewayConfigVisible" :cabinet-id="cabinetId" @refresh="fetchCabinetDetail" />
|
||||||
<ShopConfigModal v-model="shopConfigVisible" :cabinet-id="cabinetId" @refresh="fetchCabinetDetail" />
|
<ShopConfigModal v-model="shopConfigVisible" :cabinet-id="cabinetId" :belong-type="cabinetInfo.belongType" @refresh="fetchCabinetDetail" />
|
||||||
<MainCabinetConfigModal v-model="mainCabinetConfigVisible" :cabinet-id="cabinetId"
|
<MainCabinetConfigModal v-model="mainCabinetConfigVisible" :cabinet-id="cabinetId"
|
||||||
@refresh="fetchCabinetDetail" />
|
@refresh="fetchCabinetDetail" />
|
||||||
<el-drawer v-model="editCabinetDrawerVisible" title="编辑柜体" size="30%" direction="rtl">
|
<el-drawer v-model="editCabinetDrawerVisible" title="编辑柜体" size="30%" direction="rtl">
|
||||||
|
@ -411,7 +411,7 @@ onMounted(() => {
|
||||||
@refresh="fetchCabinetDetail" />
|
@refresh="fetchCabinetDetail" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<el-drawer v-model="goodsConfigVisible" title="配置商品" size="50%" direction="rtl">
|
<el-drawer v-model="goodsConfigVisible" title="配置商品" size="50%" direction="rtl">
|
||||||
<CabinetGoodsConfigModal v-model="goodsConfigVisible" :cell-id="currentCellId" @refresh="fetchCellList" />
|
<CabinetGoodsConfigModal v-model="goodsConfigVisible" :cell-id="currentCellId" :belong-type="cabinetInfo.belongType" @refresh="fetchCellList" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<el-drawer v-model="configuredGoodsVisible" title="管理商品" size="30%" direction="rtl">
|
<el-drawer v-model="configuredGoodsVisible" title="管理商品" size="30%" direction="rtl">
|
||||||
<ConfiguredGoodsModal v-model="configuredGoodsVisible" :cell-id="currentCell?.cellId"
|
<ConfiguredGoodsModal v-model="configuredGoodsVisible" :cell-id="currentCell?.cellId"
|
||||||
|
|
|
@ -25,6 +25,7 @@ import { updateSmartCabinet } from '@/api/cabinet/smart-cabinet';
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: boolean;
|
modelValue: boolean;
|
||||||
cabinetId: number;
|
cabinetId: number;
|
||||||
|
belongType?: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'refresh']);
|
const emit = defineEmits(['update:modelValue', 'refresh']);
|
||||||
|
@ -47,7 +48,8 @@ const loadShops = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const { data } = await getShopList({
|
const { data } = await getShopList({
|
||||||
pageSize: pagination.value.pageSize,
|
pageSize: pagination.value.pageSize,
|
||||||
pageNum: pagination.value.currentPage
|
pageNum: pagination.value.currentPage,
|
||||||
|
belongType: props.belongType
|
||||||
});
|
});
|
||||||
shopList.value = data.rows;
|
shopList.value = data.rows;
|
||||||
pagination.value.total = data.total;
|
pagination.value.total = data.total;
|
||||||
|
|
|
@ -6,11 +6,16 @@ import { configureGoodsCellsStock } from "@/api/cabinet/cabinet-cell";
|
||||||
import Search from "@iconify-icons/ep/search";
|
import Search from "@iconify-icons/ep/search";
|
||||||
import Refresh from "@iconify-icons/ep/refresh";
|
import Refresh from "@iconify-icons/ep/refresh";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import { useWxStore } from "@/store/modules/wx";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
cellId: {
|
cellId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
belongType: {
|
||||||
|
type: Number,
|
||||||
|
required: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -19,10 +24,13 @@ const closeModal = () => {
|
||||||
emit('update:modelValue', false);
|
emit('update:modelValue', false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const wxStore = useWxStore();
|
||||||
|
|
||||||
const searchFormParams = ref({
|
const searchFormParams = ref({
|
||||||
|
corpid: wxStore.corpid,
|
||||||
goodsName: "",
|
goodsName: "",
|
||||||
status: null,
|
status: null,
|
||||||
belongType: null
|
belongType: props.belongType
|
||||||
});
|
});
|
||||||
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
|
@ -37,6 +45,8 @@ const dataList = ref<GoodsDTO[]>([]);
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
searchFormParams.value.corpid = wxStore.corpid;
|
||||||
|
searchFormParams.value.belongType = props.belongType;
|
||||||
const { data } = await getGoodsListApi({
|
const { data } = await getGoodsListApi({
|
||||||
...searchFormParams.value,
|
...searchFormParams.value,
|
||||||
pageSize: pagination.value.pageSize,
|
pageSize: pagination.value.pageSize,
|
||||||
|
@ -104,13 +114,13 @@ defineExpose({ getList });
|
||||||
<el-option label="已下架" :value="2" />
|
<el-option label="已下架" :value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item prop="belongType">
|
<!-- <el-form-item prop="belongType">
|
||||||
<el-select v-model="searchFormParams.belongType" placeholder="请选择商品所属" clearable @change="getList"
|
<el-select v-model="searchFormParams.belongType" placeholder="请选择商品所属" clearable @change="getList"
|
||||||
class="!w-[180px]">
|
class="!w-[180px]">
|
||||||
<el-option label="智柜通" :value="0" />
|
<el-option label="智柜通" :value="0" />
|
||||||
<el-option label="固资通" :value="1" />
|
<el-option label="固资通" :value="1" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" :icon="useRenderIcon(Search)" @click="getList">
|
<el-button type="primary" :icon="useRenderIcon(Search)" @click="getList">
|
||||||
搜索
|
搜索
|
||||||
|
|
Loading…
Reference in New Issue