From bfb838d1c3aba72fe6b3de37f065902279a7d40c Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期四, 06 三月 2025 08:30:56 +0800 Subject: [PATCH] 需求新增 --- src/views/hazardousChemicals/warehouseManage/components/rawTable.vue | 90 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 87 insertions(+), 3 deletions(-) diff --git a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue b/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue index 8af5238..348c595 100644 --- a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue +++ b/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue @@ -16,6 +16,43 @@ <el-form-item label="产品编号:" > <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input> </el-form-item> + <el-form-item label="仓库:" prop="warehouseName" > + <el-select + clearable + v-model="data.queryParams.params.warehouseName" + filterable + remote + reserve-keyword + placeholder="请输入所入仓库" + remote-show-suffix + :remote-method="getWareHouseList" + style="width: 100%" + @change="selectWareValue" + > + <el-option + v-for="item in data.wareHouseList" + :key="item.id" + :label="item.name" + :value="item.name" + /> + </el-select> + </el-form-item> + <el-form-item label="存储柜:" prop="cupboardId" > + <el-select + clearable + v-model="data.queryParams.params.cupboardId" + placeholder="请选择存储柜" + style="width: 100%" + > + <el-option + + v-for="item in data.cupList" + :key="item.id" + :label="item.cupboardName" + :value="item.id" + /> + </el-select> + </el-form-item> <el-form-item > <el-button type="primary" @@ -89,6 +126,7 @@ import printcode from './printCode.vue' import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord"; import {useRoute, useRouter} from "vue-router"; +import {getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse"; const { proxy } = getCurrentInstance(); const loading = ref(false); const dialogRef = ref(); @@ -101,17 +139,23 @@ pageSize: 10, params :{ name: '', - productSn: '' + productSn: '', + cupboardId: null, + warehouseId: null } }, total: 0, - dataList: [] + dataList: [], + wareHouseList: [], + cupList: [] + }); const { queryParams, total, dataList } = toRefs(data); const classHourRef = ref(); onMounted(()=>{ getList() + getWareHouseList("") }) const getList = async () => { @@ -137,10 +181,14 @@ pageSize: 10, params :{ name: '', - productSn: '' + productSn: '', + cupboardId: null, + warehouseId: null } } + data.cupList = [] getList() + getWareHouseList("") } const handleDelete = (val) => { ElMessageBox.confirm( @@ -197,6 +245,42 @@ router.push({ path: "/whRawDetail", query: { val: v } }); } +const getWareHouseList = async (val) => { + let param = {} + if(val != ""){ + param = { + name: val + } + }else { + param = { + pageNum: 1, + pageSize: 10 + } + } + const res = await getWarehouse(param) + if(res.code == 200){ + data.wareHouseList = res.data.list + }else{ + ElMessage.warning(res.message) + } +} +const selectWareValue = (val) => { + data.queryParams.params.cupboardId = null + data.wareHouseList.forEach(item => { + if(item.name === val){ + data.queryParams.params.warehouseId = item.id + getCupList(item.id) + } + }) +} +const getCupList = async (val) => { + const res = await getCupById(val) + if(res.code == 200) { + data.cupList = res.data + }else { + ElMessage.warning(res.message) + } +} defineExpose({ getList -- Gitblit v1.9.2