From 1ea0d85b0fe2e7e4427fd484a9342d964c831b3d Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期三, 06 八月 2025 15:15:00 +0800 Subject: [PATCH] 修改 --- src/views/hazardousChemicals/warehouseManage/components/productTable.vue | 122 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 116 insertions(+), 6 deletions(-) diff --git a/src/views/hazardousChemicals/warehouseManage/components/productTable.vue b/src/views/hazardousChemicals/warehouseManage/components/productTable.vue index 16bb840..86f3b77 100644 --- a/src/views/hazardousChemicals/warehouseManage/components/productTable.vue +++ b/src/views/hazardousChemicals/warehouseManage/components/productTable.vue @@ -16,6 +16,42 @@ <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" @@ -76,6 +112,18 @@ /> <pro-dialog ref="dialogRef" @getList=getList></pro-dialog> <printcode ref="codeRef" @getList=getList></printcode> + <printMorecodeDialog ref="codeMoreRef" @getList=getList></printMorecodeDialog> + <el-dialog + v-model="dialogVisible" + title="打印纸张" + width="350" + :before-close="handlePrintClose" + > + <div style="display: flex;align-items: center;justify-content: center;height: 60px"> + <el-button type="primary" @click="openPrint('one')">单张打印</el-button> + <el-button type="primary" @click="openPrint('more')">28张打印</el-button> + </div> + </el-dialog> </div> </template> @@ -84,7 +132,8 @@ import {ElMessage, ElMessageBox} from "element-plus"; import proDialog from "./addProDialog.vue"; import printcode from './printCode.vue' -import {delWarehouse, getWarehouse} from "@/api/hazardousChemicals/warehouse"; +import printMorecodeDialog from './printCodeMore.vue' +import {delWarehouse, getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse"; import { delProductRecord, doEntryPro, @@ -97,25 +146,32 @@ const loading = ref(false); const dialogRef = ref(); const codeRef = ref(); +const codeMoreRef = ref(); const router = useRouter() const route = useRoute() +const dialogVisible =ref(false) const data = reactive({ queryParams: { pageNum: 1, 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 () => { @@ -141,10 +197,14 @@ pageSize: 10, params :{ name: '', - productSn: '' + productSn: '', + cupboardId: null, + warehouseId: null } } + data.cupList = [] getList() + getWareHouseList("") } const handleDelete = (val) => { ElMessageBox.confirm( @@ -184,11 +244,14 @@ } }) } +const entryItem = ref() const printCode = (val) => { console.log("val",val) - codeRef.value.openDialog('pro',val); - + entryItem.value = val + dialogVisible.value = true + // codeRef.value.openDialog('pro',val); } + const toDetail = (val) => { const obj = { pageNum: data.queryParams.pageNum, @@ -198,6 +261,53 @@ const v = JSON.stringify(obj) router.push({ path: "/whProDetail", 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) + } +} +const handlePrintClose = () => { + dialogVisible.value = false +} +const openPrint = (type) => { + if(type === 'one'){ + codeRef.value.openDialog('pro',entryItem.value); + }else { + codeMoreRef.value.openDialog('pro',entryItem.value); + } + +} defineExpose({ getList -- Gitblit v1.9.2