From 31ab2edfa500364818d2cc2c30acc1f4ae5b8dac Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Tue, 20 Aug 2024 17:25:30 +0800
Subject: [PATCH] bug修改
---
src/views/hazardousChemicals/warehouseManage/components/printCode.vue | 49 ++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/src/views/hazardousChemicals/warehouseManage/components/printCode.vue b/src/views/hazardousChemicals/warehouseManage/components/printCode.vue
index b3ed378..d52ee4f 100644
--- a/src/views/hazardousChemicals/warehouseManage/components/printCode.vue
+++ b/src/views/hazardousChemicals/warehouseManage/components/printCode.vue
@@ -3,11 +3,29 @@
<el-dialog
v-model="dialogVisible"
:title="title == 'pro' ? '成品二维码打印' : '危化品二维码打印'"
- width="600px"
+ width="650px"
:before-close="handleClose"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
+ <div style="display: flex;justify-content: space-between">
+ <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
+ <el-form-item label="条码编号:" >
+ <el-input v-model="state.queryParams.code" placeholder="请输入条码编号" ></el-input>
+ </el-form-item>
+ <el-form-item >
+ <el-button
+ type="primary"
+ @click="getList"
+ >查询</el-button>
+ <el-button
+ type="primary"
+ plain
+ @click="reset"
+ >重置</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
<el-table v-loading="state.loading" :data="state.dataList" :border="true" :show-header="false" height="550" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" >
@@ -45,8 +63,8 @@
import {addWarehouse, checkName, editWarehouse} from "@/api/hazardousChemicals/warehouse";
import {verifyPhone} from "@/utils/validate";
import {checkBasicName} from "@/api/hazardousChemicals/basicInfo";
-import {getProDetail, getProductRecord} from "@/api/hazardousChemicals/productRecord";
-import {getRawDetail} from "@/api/hazardousChemicals/rawRecord";
+import {getProDetail, getProductRecord, getWhProDetail} from "@/api/hazardousChemicals/productRecord";
+import {getRawDetail, getWhRawDetail} from "@/api/hazardousChemicals/rawRecord";
const dialogVisible = ref(false);
const title = ref("");
@@ -61,8 +79,10 @@
queryParams:{
pageNum: 1,
pageSize: 5,
- warehouseId: null,
- basicId: null,
+ // warehouseId: null,
+ // basicId: null,
+ entryId: null,
+ code: ''
},
chooseList: []
@@ -70,8 +90,9 @@
const originalList = ref([])
const openDialog = async (type,value) => {
- state.queryParams.warehouseId =value.warehouseId
- state.queryParams.basicId =value.basicId
+ // state.queryParams.warehouseId =value.warehouseId
+ // state.queryParams.basicId =value.basicId
+ state.queryParams.entryId = value.id
title.value = type;
await getList()
@@ -101,15 +122,15 @@
state.queryParams = {
pageNum: 1,
pageSize: 5,
- warehouseId: null,
- basicId: null,
+ entryId: null,
+ code: ''
}
state.total = 0
state.chooseList = []
}
const getList = async () => {
if(title.value == 'pro'){
- const res = await getProDetail(state.queryParams)
+ const res = await getWhProDetail(state.queryParams)
if(res.code == 200){
state.dataList = res.data.list.map(item => {
return{
@@ -124,7 +145,7 @@
ElMessage.warning(res.message)
}
}else {
- const res = await getRawDetail(state.queryParams)
+ const res = await getWhRawDetail(state.queryParams)
if(res.code == 200){
state.dataList = res.data.list.map(item => {
return{
@@ -158,6 +179,7 @@
}
const printContent=document.createElement('div')
printContent.innerHTML=qrCodes
+
//创建一个新的隐藏的iframe元素
const printFrame =document.createElement('iframe')
printFrame.style.display='none'
@@ -182,6 +204,7 @@
`)
printDocument.close()
//在打印窗口中调用打印功能
+ console.log('printFrame.contentWindow.document.body.style',printFrame.contentWindow.document.body.style)
printFrame.contentWindow.print()
//移除隐藏的iframe元素
document.body.removeChild(printFrame)
@@ -200,6 +223,10 @@
:deep(.el-form .el-form-item__label) {
font-size: 15px;
}
+ :deep(.el-dialog__body) {
+ padding: 10px 20px 0 20px;
+ }
+
.file {
display: flex;
flex-direction: column;
--
Gitblit v1.9.2