From f88d2029c7b2c66fcf0a9dffdc55da75b939c2ea Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Tue, 12 Aug 2025 10:55:54 +0800
Subject: [PATCH] 修改
---
src/views/hazardousChemicals/warehouseManage/components/rawTable.vue | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 156 insertions(+), 20 deletions(-)
diff --git a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue b/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue
index c2a47f9..7c3d5b2 100644
--- a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue
+++ b/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue
@@ -11,10 +11,47 @@
>新增</el-button>
</el-form-item>
<el-form-item label="品名:" >
- <el-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
+ <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
</el-form-item>
<el-form-item label="产品编号:" >
- <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
+ <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
@@ -34,33 +71,37 @@
<el-table-column label="序号" type="index" align="center" width="80" />
<el-table-column label="品名" prop="hazmatBasic.name" align="center" />
<el-table-column label="产品编号" prop="hazmatBasic.productSn" align="center" />
- <el-table-column label="CAS号" prop="hazmatBasic.cas" align="center" />
- <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center" />
- <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" />
- <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" />
- <el-table-column label="最小包装" align="center" width="120">
- <template #default="scope">
- <span>
- {{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}} / {{scope.row.hazmatBasic.minPackage == 0 ? '瓶' :scope.row.hazmatBasic.minPackage == 1?'袋':scope.row.hazmatBasic.minPackage == 2?'桶 ':scope.row.hazmatBasic.minPackage == 3?'盒':scope.row.hazmatBasic.minPackage == 4?'箱':'其他'}}</span>
- </template>
- </el-table-column>
- <el-table-column label="批号" prop="batchNo" align="center" width="120" />
+<!-- <el-table-column label="CAS号" prop="hazmatBasic.cas" align="center" />-->
+<!-- <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center" />-->
+<!-- <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" />-->
+<!-- <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" />-->
+<!-- <el-table-column label="最小包装" align="center" width="120">-->
+<!-- <template #default="scope">-->
+<!-- <span>-->
+<!-- {{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}} / {{scope.row.hazmatBasic.minPackage == 0 ? '瓶' :scope.row.hazmatBasic.minPackage == 1?'袋':scope.row.hazmatBasic.minPackage == 2?'桶 ':scope.row.hazmatBasic.minPackage == 3?'盒':scope.row.hazmatBasic.minPackage == 4?'箱':'其他'}}</span>-->
+<!-- </template>-->
+<!-- </el-table-column>-->
+ <el-table-column label="数量" prop="num" align="center" width="120" />
<el-table-column label="所在仓库" prop="warehouseName" align="center" >
<template #default="scope">
<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">
<span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>
</template>
</el-table-column>
+ <el-table-column label="创建时间" prop="createTime" align="center" width="120" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >
<template #default="scope">
+ <el-button link type="primary" v-if="scope.row.state == 1" @click="toDetail(scope.row)">查看详情</el-button>
<el-button link type="primary" v-if="scope.row.state == 0" @click="doEntry(scope.row)">入库</el-button>
<el-button link type="primary" v-if="scope.row.state == 1" @click="printCode(scope.row)">打印二维码</el-button>
<el-button link type="primary" @click="openDialog('edit',scope.row)" v-if="scope.row.state == 0">编辑</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)" v-if="scope.row.state == 0">删除</el-button>
+ <el-button link type="danger" @click="handleDelete(scope.row)" v-if="scope.row.state == 0">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -75,6 +116,18 @@
<raw-dialog ref="dialogRef" @getList=getList></raw-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>
@@ -83,26 +136,41 @@
import {ElMessage, ElMessageBox} from "element-plus";
import rawDialog from "./addRawDialog.vue";
import printcode from './printCode.vue'
+import printMorecodeDialog from './printCodeMore.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();
const codeRef = ref();
+const codeMoreRef = ref();
+const router = useRouter()
+const route = useRoute()
+const dialogVisible =ref(false)
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
- name: '',
- productSn: ''
+ params :{
+ name: '',
+ 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 () => {
@@ -126,10 +194,16 @@
data.queryParams = {
pageNum: 1,
pageSize: 10,
- name: '',
- productSn: ''
+ params :{
+ name: '',
+ productSn: '',
+ cupboardId: null,
+ warehouseId: null
+ }
}
+ data.cupList = []
getList()
+ getWareHouseList("")
}
const handleDelete = (val) => {
ElMessageBox.confirm(
@@ -171,11 +245,73 @@
})
}
+const entryItem = ref()
const printCode = (val) => {
console.log("val",val)
- codeRef.value.openDialog('raw',val);
+ entryItem.value = val
+ dialogVisible.value = true
+
+ // codeRef.value.openDialog('raw',val);
}
+const openPrint = (type) => {
+ if(type === 'one'){
+ codeRef.value.openDialog('raw',entryItem.value);
+ }else {
+ codeMoreRef.value.openDialog('raw',entryItem.value);
+ }
+
+}
+const toDetail = (val) => {
+ const obj = {
+ pageNum: data.queryParams.pageNum,
+ pageSize: data.queryParams.pageSize,
+ entryId: val.id,
+ }
+ const v = JSON.stringify(obj)
+ 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)
+ }
+}
+const handlePrintClose = () => {
+ dialogVisible.value = false
+}
+
defineExpose({
getList
});
--
Gitblit v1.9.2