| | |
| | | const printLayer = ref('') |
| | | const now = new Date(); |
| | | const timeRange = ref([]) |
| | | const browser=ref(false) |
| | | |
| | | const handleChange = async () => { |
| | | console.log("触发开关") |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | |
| | | const confirmBrowser = () =>{ |
| | | if (/chrome|chromium/i.test(navigator.userAgent) && !/edg/i.test(navigator.userAgent)) { |
| | | browser.value=true |
| | | } else if (/edg/i.test(navigator.userAgent)) { |
| | | browser.value=false |
| | | } else { |
| | | browser.value=false |
| | | } |
| | | } |
| | | |
| | | const handleInputChangea = (value, rowId) => { |
| | | // 更新对应行的 select 值 |
| | |
| | | autoPrint.value = data.autoPrint[0]; |
| | | } |
| | | |
| | | |
| | | if (fullFlowCard.value == ""&&autoPrint.value==true) { |
| | | //自动打印 |
| | | if (fullFlowCard.value == ""&&autoPrint.value==true&&browser.value==true) { |
| | | for (let i = 0; i < tableData.length; i++) { |
| | | if (tableData[i].totalQuantity != 0) { |
| | | if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber && fullFlowCard.value != tableData[i].flowCardId) { |
| | |
| | | }; |
| | | // 初始化 WebSocket,并传递消息处理函数 |
| | | onMounted(() => { |
| | | confirmBrowser();//获取浏览器 |
| | | fetchFlowCardId(); |
| | | fetchTableData(); // 获取数据 |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | |
| | | printLayer.value = row.layer |
| | | dialogTableVisible.value = true; |
| | | setTimeout(() => { |
| | | printFlowCard(); // 替换成你要执行的函数名 |
| | | //dialogTableVisible.value = false; |
| | | }, 1000); |
| | | printFlowCard(); |
| | | dialogTableVisible.value = false; |
| | | }, 2000); |
| | | } |
| | | const open1 = async (row) => { |
| | | |
| | |
| | | printLayer.value = row.layer |
| | | dialogTableVisible1.value = true; |
| | | setTimeout(() => { |
| | | printFlowCard1(); // 替换成你要执行的函数名 |
| | | printFlowCard1(); |
| | | //dialogTableVisible1.value = false; |
| | | }, 1000); |
| | | } |
| | |
| | | let content = doc.createElement("div"); |
| | | content.id = printId; |
| | | |
| | | alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent)); |
| | | // alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent)); |
| | | |
| | | // 样式控制与打印无关的元素隐藏 |
| | | let style = doc.createElement("style"); |