From 39868da3de6192d19dfd316c8be1c080b2d3ebe7 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Fri, 18 Apr 2025 14:35:46 +0800
Subject: [PATCH] 修改
---
src/views/hazardousChemicals/warehouseManage/components/rawTable.vue | 91 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 88 insertions(+), 3 deletions(-)
diff --git a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue b/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue
index e5f89b4..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"
@@ -50,6 +87,7 @@
<span>{{scope.row.warehouse.name}}</span>
</template>
</el-table-column>
+ <el-table-column label="存储柜" prop="cupboard.cupboardName" align="center" width="120" />
<el-table-column label="批号" prop="batchNo" align="center" width="120" />
<el-table-column label="状态" prop="state" align="center">
<template #default="scope">
@@ -88,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();
@@ -100,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 () => {
@@ -136,10 +181,14 @@
pageSize: 10,
params :{
name: '',
- productSn: ''
+ productSn: '',
+ cupboardId: null,
+ warehouseId: null
}
}
+ data.cupList = []
getList()
+ getWareHouseList("")
}
const handleDelete = (val) => {
ElMessageBox.confirm(
@@ -196,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