UI-Project/src/assets/dpxsa.png
UI-Project/src/utils/constants.js
@@ -1,4 +1,4 @@ // export const WebSocketHost = "192.168.1.199"; // export const WebSocketHost = "192.168.1.199"; export const WebSocketHost = "10.153.19.150"; // export const WebSocketHost = "127.0.0.1"; export const host = "88"; UI-Project/src/views/Identify/identify.vue
@@ -85,7 +85,7 @@ // const response = await request.post(url) const response = await request.post('/cacheGlass/taskCache/identControls', { identId: currentGlassId.value, controlsId: 201, controlsId: 8, line: 1001, machine: '识别', }) @@ -93,7 +93,7 @@ ElMessage.success(response.message); // window.location.reload() blind.value = false; updateRectStatus(currentGlassId.value, 201); updateRectStatus(currentGlassId.value, 8); } else { // 请求失败,显示错误消息 ElMessage.error(response.msg); @@ -112,7 +112,7 @@ // const response = await request.post(url) const response = await request.post('/cacheGlass/taskCache/identControls', { identId: currentGlassId.value, controlsId: 200, controlsId: 9, line: 1001, machine: '识别', }) @@ -121,7 +121,7 @@ ElMessage.success(response.message); // window.location.reload() blind.value = false; updateRectStatus(currentGlassId.value, 200); updateRectStatus(currentGlassId.value, 9); } else { // 请求失败,显示错误消息 ElMessage.error(response.msg); @@ -188,12 +188,12 @@ return '#b3e19d'; case 120: return '#f89898'; case 200: return 'lightblue'; case 201: case 8: return '#911005'; case 9: return '#f3d19e'; default: return '#911005'; // 默认颜色 // default: // return '#911005'; // 默认颜色 } } // 更新矩形状态 UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -216,9 +216,14 @@ function updateRectColors() { adjustedRectsa.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 5; rect.state = 8; } }); adjustedRectsb.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 8; } }); } function getRectColora(state) { switch (state) { @@ -228,7 +233,7 @@ return '#95d475'; case -1: return '#CDAF95'; case 5: case 8: return '#911005'; } } @@ -238,7 +243,7 @@ return '#eebe77'; case 4: return '#CD6090'; case 5: case 8: return '#911005'; } } @@ -266,7 +271,7 @@ glassId: currentGlassId.value, // temperingFeedSequence: currenttemperingFeedSequence.value, line: 4001, status: 2, status: 8, workingProcedure: '钢化', }) if (response.code == 200) { @@ -311,7 +316,7 @@ left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }" backgroundColor: rect.state === 8 ? '#911005' : 'lightblue' }" > <div class="centered-text"> <div >{{ rect.glassId }}</div> @@ -339,7 +344,7 @@ left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }" backgroundColor: rect.state === 8 ? '#911005' : 'lightblue' }" > <div class="centered-text"> <div >{{ rect.glassId }}</div> UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -71,9 +71,9 @@ } }; function updateRectColors() { adjustedRectsa.value.forEach(rect => { adjustedRects.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 5; rect.state = 8; } }); } @@ -83,7 +83,7 @@ return '#eebe77'; case 4: return '#CD6090'; case 5: case 8: return '#911005'; } } @@ -99,7 +99,7 @@ glassId: currentGlassId.value, // temperingFeedSequence: currenttemperingFeedSequence.value, line: 4001, status: 2, status: 8, workingProcedure: '钢化', }) if (response.code == 200) { UI-Project/src/views/ReportWork/reportWork.vue
@@ -18,9 +18,9 @@ </el-select> <el-select v-model="report.workingProcedure" :placeholder="$t('reportmanage.cprocess')" style="margin-left: 10px;" > <el-option :label="$t('reportmanage.all')" value="0"></el-option> <el-option :label="$t('reportmanage.incise')" value="1"></el-option> <el-option :label="$t('reportmanage.edging')" value="2"></el-option> <el-option :label="$t('reportmanage.steel')" value="3"></el-option> <el-option :label="$t('reportmanage.incise')" value="切割"></el-option> <el-option :label="$t('reportmanage.edging')" value="磨边"></el-option> <el-option :label="$t('reportmanage.steel')" value="钢化"></el-option> </el-select> <el-button type="primary" style="margin-left: 10px;" @click="selectReportData()">{{ $t('reportmanage.inquire') }}</el-button> <el-button type="success" style="margin-left: 10px;" @click="handleConfirm">{{ $t('reportmanage.signingwork') }}</el-button> UI-Project/src/views/Slicecage/slicecage.vue
@@ -271,7 +271,7 @@ } ); if (confirmResult === 'confirm') { const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+0, row) const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+8, row) if (response.code === 200) { tableData.value = response.data; ElMessage.success(response.message); @@ -296,7 +296,7 @@ } ); if (confirmResult === 'confirm') { const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+1, row) const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/damageBigStorageCageDetails?status="+9, row) if (response.code === 200) { tableData.value = response.data; ElMessage.success(response.message); @@ -346,7 +346,7 @@ } ); if (confirmResult === 'confirm') { const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+0, row) const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+8, row) if (response.code === 200) { ElMessage.success(response.message); } else { @@ -397,7 +397,7 @@ } ); if (confirmResult === 'confirm') { const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+1, row) const response = await request.post("/cacheVerticalGlass/temperingGlassInfo/damageTemperingGlassInfo?status="+9, row) if (response.code === 200) { ElMessage.success(response.message); } else { @@ -601,6 +601,8 @@ if(data.bigStorageCageDetailsOutTask!=null){ tableDatac.value = data.bigStorageCageDetailsOutTask[0] adjusta.value = data.bigStorageCageDetailsOutTask[0].filter(rect => rect.slot !== null && rect.slot !== undefined); console.log(data.bigStorageCageDetailsOutTask[0]); } else { tableDatac.value = '', adjusta.value = '' @@ -776,7 +778,7 @@ <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;"> <el-table height="100px" ref="table" :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="bigStorageCageOutTask.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="120" /> <el-table-column prop="bigStorageCageOutTask.glassId" align="center" :label="$t('searchOrder.outputglassID')" min-width="140" /> <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" :label="$t('searchOrder.startposition')" min-width="120" /> <el-table-column prop="bigStorageCageOutTask.endSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> <el-table-column prop="bigStorageCageOutTask.trainNumber" align="center" :label="$t('searchOrder.trips')" min-width="120" /> @@ -789,7 +791,7 @@ <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> <el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/> <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="100"/> <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120"/> <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="140"/> <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="150"/> <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="140"/> <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="100"/> @@ -812,7 +814,7 @@ <el-table height="100px" ref="table" @selection-change="handleSelectionChange" :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="120" /> <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="140" /> <el-table-column prop="bigStorageCageFeedTask.targetSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> <!-- <el-table-column prop="task_type" align="center" label="任务类型" min-width="120" />没有返回字段 --> <el-table-column prop="bigStorageCageFeedTask.taskState" align="center" :label="$t('searchOrder.taskstatus')" min-width="120"> @@ -824,7 +826,7 @@ <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> <el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/> <el-table-column prop="slot" align="center" :label="$t('searchOrder.gridnumber')" min-width="100"/> <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120"/> <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="140"/> <el-table-column prop="sequence" align="center" :label="$t('searchOrder.pieceingrid')" min-width="150"/> <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.cardnumber')" min-width="140"/> <el-table-column prop="glassType" align="center" :label="$t('searchOrder.typeglass')" min-width="100"/> UI-Project/src/views/StockBasicData/stockBasicData.vue
@@ -50,7 +50,7 @@ // 用户点击了“是”,现在调用删除接口 const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { glassId: row.glass_id, controlsId: 300, controlsId: 8, line: 2001, machine: '冷加工', }) @@ -83,7 +83,7 @@ // 用户点击了“是”,现在调用删除接口 const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { glassId: row.glass_id, controlsId: 301, controlsId: 9, line: 2001, machine: '冷加工', }) UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
@@ -50,7 +50,7 @@ // 用户点击了“是”,现在调用删除接口 const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { glassId: row.glass_id, controlsId: 300, controlsId: 8, line: 2002, machine: '冷加工', }) @@ -83,7 +83,7 @@ // 用户点击了“是”,现在调用删除接口 const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", { glassId: row.glass_id, controlsId: 301, controlsId: 9, line: 2002, machine: '冷加工', }) UI-Project/src/views/UnLoadGlass/Landingindication.vue
@@ -123,7 +123,6 @@ const handleMessage = (data) => { // 更新 tableData 的数据 data.glassinfo[0].forEach((itemData, index) => { if (index < racks.value.length) { const rack = racks.value[index]; UI-Project/src/views/UnLoadGlass/PrintFlow.vue
New file @@ -0,0 +1,443 @@ <script setup> import { useI18n } from 'vue-i18n' const { t } = useI18n() let language = ref(localStorage.getItem('lang') || 'zh') import {Search} from "@element-plus/icons-vue"; import {useRouter} from "vue-router" const router = useRouter() import request from "@/utils/request" import { WebSocketHost ,host} from '@/utils/constants' import { ref, onMounted , onBeforeUnmount, reactive, computed,onUnmounted } from "vue"; import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; import { ElMessage, ElMessageBox } from 'element-plus' import companyInfo from "@/lang/companyInfo"; import QRCode from "qrcode"; const company = companyInfo() const printMerge = null let props = defineProps({ printFlowCardId: null, printLayer: null, }) let produceList = ref([]) const handleGetQRCode = async () => { for (let i = 0; i < produceList.value.length; i++) { const technologyNumber = produceList.value[i].detail[0].technologyNumber.toString(); // 转换为字符串以便处理每个字符 produceList.value[i].detail[0]["qrcodeList"] = []; // 初始化一个空数组用来存储 QR Code for (let j = 0; j < technologyNumber.length; j++) { const processId = produceList.value[i].detail[0].process_id; const url = `${processId}/${technologyNumber[j]}`; // 生成 QR Code 并存储到数组中 const qrcodeData = await QRCode.toDataURL(url); produceList.value[i].detail[0]["qrcodeList"].push({ qrcode: qrcodeData, technologyNumber: technologyNumber[j] }); } } }; //根据输入的数量重新汇总 const handleSummary = () => { for (let i = 0; i < produceList.value.length; i++) { //数量 let totalQuantity = 0; //面积 let totalArea = 0; //重量 let totalWeight = 0; // 对每个集合中的 detailList 进行计算 produceList.value[i].detailList.forEach(collection => { totalQuantity += collection.quantity * 1; //每个序号面积 collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) totalArea += collection.total_area * 1; totalWeight += collection.width * collection.height * collection.quantity / 1000000 * collection.separation * 2.5 * 1; //每个序号周长 collection.perimeter = parseFloat(((collection.width * 2 + collection.height * 2) * collection.quantity / 1000).toFixed(3)) }); // 输出每个集合中的总数量 produceList.value[i].detail[0].quantity = totalQuantity produceList.value[i].detail[0].gross_area = totalArea produceList.value[i].detail[0].weight = totalWeight } } const printFlowCard = () => { // 需要打印的局部区域赋予"print-wrap"的id let el = document.getElementById("printFlowCard"); let doc = document; let body = doc.body || doc.getElementsByTagName("body")[0]; let printId = "print-" + Date.now(); // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) let content = doc.createElement("div"); content.id = printId; // 样式控制与打印无关的元素隐藏 let style = doc.createElement("style"); style.innerHTML = "body>#" + printId + "{display:none}@media print{" + "@page {" + " size: auto; " + " margin: 0mm 0mm 0mm 0mm; " + " }body>:not(#" + printId + "){display:none !important}body>#" + printId + "{display:block;padding-top:1px}}"; // content.innerHTML = el.outerHTML; // // console.log("el.outerHTML", el.outerHTML); body.appendChild(style); // 与style元素设置的样式相配合 // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) body.appendChild(content); setTimeout(() => { window.print(); body.removeChild(content); body.removeChild(style); }, 20); } onMounted(async () => { try { const response = await request.post('/unLoadGlass/downGlassInfo/downGlassPrint',{ flowCardId:props.printFlowCardId, layer:props.printLayer }); if (response.code == 200) { // 绑定成功,处理逻辑 produceList.value = response.data; console.log(produceList.value); ElMessage.success(response.message); for (let j = 0; j < produceList.value.length; j++) { let sumWeight = 0 produceList.value[j].detailList.forEach((item, index) => { // 解析 separation 字段的 JSON 字符串 let separationObj = JSON.parse(item.separation); // 获取 thickness 的原始值 let thicknessValue = separationObj.thickness; // 去除 'mm' 单位 let thicknessWithoutUnit = thicknessValue.replace('mm', ''); item.separation = thicknessWithoutUnit sumWeight += item.width * item.height * item.quantity / 1000000 * item.separation * 2.5 * 1; }); produceList.value[j].detail[0].weight = sumWeight } handleGetQRCode() handleSummary() // printFlowCard(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 console.error(error); } }); </script> <template> <div id="printFlowCard"> <table v-for="(item,id) in produceList" id="contentTable" :key="id"> <thead> <tr v-for="(itemFlow,index) in item.detail" :key="index"> <td v-if="like='1'" colspan="26"> <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px;margin: 5px "/></div> <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> <div>{{ company.companyName }}</div> <div>生产流程卡</div> <div v-if="itemFlow.technologyNumber!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ itemFlow.process_id }}/{{ itemFlow.technologyNumber }} </div> <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ itemFlow.process_id }}/{{ itemFlow.technologyNumber }} </div> </td> <td v-else colspan="24"> <div style="float: left;"><input style="border: none;font-size: 28px;width: 70px "/></div> <div id="bj" style="float: right;font-size: 28px">{{ id + 1 }}</div> <div>{{ company.companyName }}</div> <div>生产流程卡</div> <div v-if="itemFlow.technologyNumber!=''" style="text-align: right;font-weight: bolder">流程卡号: {{ itemFlow.process_id }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 </div> <div v-else style="text-align: right;font-weight: bolder">流程卡号: {{ itemFlow.process_id }}/{{ itemFlow.technologyNumber }} 共 {{ flowCardCount }} 架 </div> </td> </tr> <tr v-for="(items,index) in item.detail" :key="index"> <td class="tdNowrap">客户名称:</td> <td colspan="2">{{ items.customer_name }}</td> <td class="tdNowrap">项目名称:</td> <td colspan="2">{{ items.project }}</td> <td class="tdNowrap">工艺流程:</td> <td colspan="19" v-if="like='1'" style="width: 500px">{{ items.process }}</td> <td colspan="17" v-else style="width: 500px">{{ items.process }}</td> </tr> <tr v-for="(itemTr,index) in item.detail" :key="index"> <td class="tdNowrap">磨边类型:</td> <td colspan="2">{{ itemTr.edging_type }}</td> <td class="tdNowrap">单片名称:</td> <td colspan="2">{{ itemTr.glass_child }}</td> <td class="tdNowrap">产品名称:</td> <td v-if="like=='1'" colspan="19">{{ itemTr.product_name }}</td> <td v-else colspan="17">{{ itemTr.product_name }}</td> </tr> <tr> <td rowspan='2'>序号</td> <td v-if="like!=null" rowspan="2">小片顺序</td> <td v-else style="display: none;" rowspan="2">小片顺序</td> <td rowspan='2'>宽*高</td> <td rowspan='2'>数量</td> <td rowspan='2'>落架数</td> <td rowspan='2'>面积</td> <td rowspan='2'>周长</td> <td rowspan='2'>半径</td> <td rowspan='2'>备注</td> <td v-for="(itemPr,index) in item.processList" :key="index" colspan="2">{{ itemPr.process }}</td> </tr> <tr> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> <td>{{ company.printLabel.printFlowCard.patch }}</td> <td>{{ company.printLabel.printFlowCard.lackOf }}</td> </tr> </thead> <tbody> <tr v-for="(itemDatile,index) in item.detailList" :key="index"> <td>{{ itemDatile.order_number }}</td> <!-- <td>{{ itemDatile.s01Value }}</td> --> <td v-if="like=='1'">{{ itemDatile.technology_number }}</td> <td v-else style="display: none"></td> <td>{{ itemDatile.child_width }}</td> <td class="item" style="width: 5%;height: 100%;"> <!-- <el-input v-model="itemDatile.quantity" style="border: none" @keyup="handleSummary()"></el-input> --> {{ itemDatile.quantity }} </td> <td class="item" style="width: 5%;height: 100%;"> <!-- <el-input v-model="itemDatile.quantity" style="border: none" @keyup="handleSummary()"></el-input> --> {{ itemDatile.quantity1 }} </td> <td>{{ itemDatile.total_area }}</td> <td>{{ itemDatile.perimeter }}</td> <td>{{ itemDatile.bend_radius }}</td> <td>{{ itemDatile.remarks }}</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> <tfoot> <tr style="height: 14px"> <td v-for="(itemsum,index) in item.detail" :key="index" colspan="26"> 数量: <label>{{ itemsum.quantity }}</label> 面积: <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> 重量: <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label> </td> </tr> <tr v-for="(itemtextarea,index) in item.detail" :key="index"> <td v-if="like='1'" colspan="4" rowspan="6" style="width: 480px;height: 100px "> <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{itemtextarea.otherRemarks}}</textarea> </div> </td> <td v-else colspan="6" rowspan="2" style="width: 480px;height: 100px "> <!-- <div style="width: 100%;height: 100%"><textarea style="height: 99%;width: 99%;font-size: 11px">{{ itemtextarea.processing_note }}</textarea>--> <!-- </div>--> <div style="width: 100%;height: 100%;"><textarea style="height: 99%;width: 99%;border: none;;font-size: 11px">{{itemtextarea.otherRemarks}}</textarea> </div> </td> <td colspan="2">完工签名</td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> </tr> <tr> <td colspan="2">生产日期</td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> </tr> <tr> <td colspan="2">质检签名</td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> <td colspan="2"></td> </tr> <tr v-for="(qrCodeItem,index) in item.detail" :key="index"> <td colspan="23"> <span style="display: flex;"> <span v-for="(qrCodeItems,index) in qrCodeItem.qrcodeList" :key="index" style="display: flex;width: 35%"> <div class='qrCode' style="width: 80px;height: 80px;"> <img :src=qrCodeItems.qrcode> </div> <span style="float: left;font-weight: bolder">{{ qrCodeItem.process_id + "/" + qrCodeItems.technologyNumber }}</span> </span> </span> </td> </tr> </tfoot> </table> </div> </template> <style scoped> * { margin: 0; padding: 0; text-align: center; } #printFlowCard { text-align: center; //font-weight: bolder; height: 600px; } #contentTable { border-collapse: collapse; border: 1px solid black; width: 100%; } #contentTable thead { font-size: 13px; font-weight: bolder; } #contentTable thead div { font-size: 15px; font-weight: bolder; } #contentTable tr td { border: 1px solid black; height: 18px; font-weight: bolder; } #contentTable tbody { white-space: nowrap; } .tdNowrap { white-space: nowrap; } #contentTable tfoot { font-size: 12px; font-weight: bolder; } input{ font-weight: bolder; } @page { size: auto; /* auto is the initial value */ margin: 2mm 2mm 0mm 1mm /* this affects the margin in the printer settings */ } @media print { table { page-break-before: always; page-break-inside: auto; } #contentTable thead { display: table-header-group; } tfoot { display: table-footer-group; page-break-inside: avoid; } } .qrCode img { width: 100%; height: 100%; } </style> UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -1,18 +1,19 @@ <script setup> import {Search} from "@element-plus/icons-vue"; import {reactive, onMounted, onBeforeUnmount,onUnmounted} from "vue"; import {useRouter} from "vue-router" import { Search } from "@element-plus/icons-vue"; import { reactive, onMounted, onBeforeUnmount, onUnmounted } from "vue"; import { useRouter } from "vue-router" const router = useRouter() import { useI18n } from 'vue-i18n' const { t } = useI18n() let language = ref(localStorage.getItem('lang') || 'zh') const { t } = useI18n() let language = ref(localStorage.getItem('lang') || 'zh') import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import Landingindication from "./Landingindication.vue"; import Landingindicationtwo from "./Landingindicationtwo.vue"; import request from "@/utils/request"; import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; import { WebSocketHost ,host} from '@/utils/constants' import { WebSocketHost, host } from '@/utils/constants' import PrintFlow from './PrintFlow.vue' const dialogFormVisiblea = ref(false) const dialogFormVisiblea2 = ref(false) const dialogFormVisibleaDownGlass = ref(false) @@ -26,17 +27,27 @@ const flowCardId = ref(''); const flowCardOptions = ref('[]'); const tableData = reactive([]); const downGlass= ref([]); const downGlass = ref([]); const timeRange = ref(["2022-01-01", "2025-01-01"]) const selectValuesa = reactive({}); const selectOptionsa = ref([]); const dialogTableVisible = ref(false) const printFlowCardId = ref('') const printLayer=ref('') const handleInputChangea = (value, rowId) => { // 更新对应行的 select 值 selectValuesa[rowId] = value; }; // 方法 const handleSelectionChange = () => { // 处理表格行选择事件 }; const handleBindRack = (row) => { workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 console.log(row.flowCardId); flowCardId.value = row.flowCardId; // 发起接口请求获取流程卡号 fetchFlowCardId(); fetchFlowCardId(); dialogFormVisiblea.value = true; // 打开绑定架子对话框 }; //获取流程卡号 @@ -45,12 +56,12 @@ const response = await request.get('unLoadGlass/downWorkStation/getflowCardId'); console.log(response) if (response.code === 200) { flowCardOptions.value = response.data.filter(item => item !== null) .map(item => ({ flowcard_id: item.flow_card_id })); console.log(flowCardOptions.value); } else { flowCardOptions.value = response.data.filter(item => item !== null) .map(item => ({ flowcard_id: item.flow_card_id })); console.log(flowCardOptions.value); } else { ElMessage.error(response.msg); } } catch (error) { @@ -61,17 +72,17 @@ const handleConfirm = async () => { try { const firstPart = flowCardId.value.split('|')[0].trim(); // const twoPart = flowCardId.value.split('|')[1].trim(); // const twoPart = flowCardId.value.split('|')[1].trim(); // const response = await request.post('unLoadGlass/downWorkStation/updateFlowCardId', { workstationId: workstationId.value, flowCardId: firstPart, layer:twoPart }); layer: twoPart }); console.log(response) if (response.code == 200) { // 绑定成功,处理逻辑 console.log('绑定成功'); ElMessage.success(response.message); updatePageData(); dialogFormVisiblea.value = false; @@ -96,30 +107,29 @@ }; //清除内容 const handleclear = async () => { try { const response = await request.post('unLoadGlass/downWorkStation/clear', { workstationId: workstationId.value, }); try { const response = await request.post('unLoadGlass/downWorkStation/clear', { workstationId: workstationId.value, }); console.log(response); if (response.code === 200) { // 清除成功的逻辑 console.log('清除成功'); ElMessage.success(response.message); dialogFormVisiblea2.value = false; } else if (response.code === 500) { // 清除失败的逻辑 console.log('清除失败'); console.log(response.message); // 打印服务器返回的错误信息 ElMessage.error(response.message); dialogFormVisiblea2.value = false; } } catch (error) { // console.log(error); ElMessage.error("清除失败"); dialogFormVisiblea2.value = false; if (response.code === 200) { // 清除成功的逻辑 console.log('清除成功'); ElMessage.success(response.message); dialogFormVisiblea2.value = false; } else if (response.code === 500) { // 清除失败的逻辑 console.log('清除失败'); console.log(response.message); // 打印服务器返回的错误信息 ElMessage.error(response.message); dialogFormVisiblea2.value = false; } } catch (error) { // console.log(error); ElMessage.error("清除失败"); dialogFormVisiblea2.value = false; } }; // 发送获取表格数据的请求 const fetchTableData = async () => { @@ -146,14 +156,16 @@ // 定义消息处理函数,更新 receivedData 变量 const handleMessage = (data) => { // 更新 tableData 的数据 if(data.sendDownGlass!=null){ downGlass.value=data.sendDownGlass[0][1]; console.log(downGlass.value); console.log(tableData.value); if (data.downGlassInfos != null) { downGlass.value = data.downGlassInfos[0][1]; } if (data.engineerIdList != null) { selectOptionsa.value = data.engineerIdList[0] } // tableData.splice(0, tableData.length, ...data.params[0]); // console.log("更新后数据", data.params[0]); // console.log("更新后数据", data.params[0]); }; // 初始化 WebSocket,并传递消息处理函数 onMounted(() => { @@ -161,40 +173,40 @@ fetchTableData(); // 获取数据 socket = initializeWebSocket(socketUrl, handleMessage); }); onUnmounted(() => { if (socket) { onUnmounted(() => { if (socket) { closeWebSocket(socket); } }); } }); onBeforeUnmount(() => { console.log("关闭了") closeWebSocket(); }); const getTagType =(status) => { return status === 1 ? 'success' : 'danger'; // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) } const toggleStatus = (row) => { // 切换料架状态的逻辑 row.enableState = 1 - row.enableState; // Toggle between 0 and 1 // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 updateRowStatus(row); }; const updateRowStatus = async (row) => { const getTagType = (status) => { return status === 1 ? 'success' : 'danger'; // 根据状态值决定标签类型,这里假设状态为1时为成功(绿色),否则为失败(红色) } const toggleStatus = (row) => { // 切换料架状态的逻辑 row.enableState = 1 - row.enableState; // Toggle between 0 and 1 // 此处可以添加保存状态的逻辑,比如调用 API 更新数据 updateRowStatus(row); }; const updateRowStatus = async (row) => { try { // 假设你的后端 API 接收 PUT 请求,并且需要传递 row.id 和 row.enableState 参数 const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', { enableState: row.enableState, id: row.id }); }); console.log('Updated row status:', response.data); // 可以根据后端返回的数据进行进一步处理,比如更新本地状态等 } catch (error) { @@ -202,11 +214,76 @@ // 处理错误情况,比如提示用户更新失败 } }; // 查询数据 const selectDownGlassData = async () => { const response = await request.post("/unLoadGlass/downGlassInfo/selectDownGlassInfo", { workStationId: selectValuesa[0], engineerId: selectValuesa[1], beginDate: timeRange.value[0], endDate: timeRange.value[1], }) if (response.code === 200) { sendDownGlass.value = response.data; ElMessage.success(response.message); } else { ElMessage.error(response.message); } } const open=async(row)=>{ printFlowCardId.value=row.flowCardId; printLayer.value=row.layer dialogTableVisible.value = true; setTimeout(() => { printFlowCard(); // 替换成你要执行的函数名 }, 1000); ; } const printFlowCard = () => { // 需要打印的局部区域赋予"print-wrap"的id let el = document.getElementById("child"); let doc = document; let body = doc.body || doc.getElementsByTagName("body")[0]; let printId = "print-" + Date.now(); // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式) let content = doc.createElement("div"); content.id = printId; // 样式控制与打印无关的元素隐藏 let style = doc.createElement("style"); style.innerHTML = "body>#" + printId + "{display:none}@media print{" + "@page {" + " size: auto; " + " margin: 2mm 2mm 0mm 1mm; " + " }body>:not(#" + printId + "){display:none !important}body>#" + printId + "{display:block;padding-top:1px}}"; // content.innerHTML = el.outerHTML; // // console.log("el.outerHTML", el.outerHTML); body.appendChild(style); // 与style元素设置的样式相配合 // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式) body.appendChild(content); setTimeout(() => { window.print(); body.removeChild(content); body.removeChild(style); }, 20); } // beforeUnmount(() => { @@ -216,94 +293,119 @@ </script> <template> <div> <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisibleaDownGlass = true">落架详情</el-button> <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisibleaDownGlass = true">落架详情</el-button> <el-card style="flex: 1;" v-loading="loading"> <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading"> <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" /> <el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')" min-width="120" /> <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" /> <el-table-column prop="totalQuantity" align="center" :label="$t('reportWork.totalquantity')" min-width="120" /> <el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" /> <el-table-column prop="layer" align="center" label="层数" min-width="120" /> <el-table-column prop="otherNumber" align="center" label="人工下片数" min-width="120" /> <!-- <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> --> <el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" /> <el-table-column align="center" :label="$t('reportWork.startstatus')" min-width="80" prop="enableState" > <template #default="scope"> <el-tag :type="getTagType(scope.row.enableState)" @click="toggleStatus(scope.row)"> {{ scope.row.enableState === 1 ? $t('reportWork.enable') : $t('reportWork.unenable') }} </el-tag> </template> </el-table-column> <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> <template #default="scope"> <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '已启用' " @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}</el-button> <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear') }}</el-button> </template> </el-table-column> </el-table> </div> <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" :title="$t('searchOrder.cageinformation')"> <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="workStationId" align="center" :label="$t('工位号')" min-width="80" /> <el-table-column prop="engineerId" align="center" :label="$t('工程号')" min-width="80" /> <el-table-column prop="flowCardId" align="center" :label="$t('流程卡号')" min-width="80" /> <el-table-column prop="layer" align="center" :label="$t('层')" min-width="120" /> <el-table-column prop="sequence" align="center" :label="$t('顺序')" min-width="150" /> <el-table-column prop="width" align="center" :label="$t('宽')" min-width="120" /> <el-table-column prop="height" align="center" :label="$t('高')" min-width="120" /> <el-table-column prop="Filmsid" align="center" :label="$t('膜系')" min-width="120" /> <el-table-column prop="thickness" align="center" label="厚度" min-width="120" /> <el-table-column prop="glassId" align="center" :label="$t('玻璃id')" min-width="120" /> </el-table> </el-dialog> </el-card> <!-- workstationId: '1', <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="tableData" :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" /> <el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')" min-width="120" /> <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" /> <el-table-column prop="totalQuantity" align="center" :label="$t('reportWork.totalquantity')" min-width="120" /> <el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" /> <el-table-column prop="layer" align="center" label="层数" min-width="120" /> <el-table-column prop="otherNumber" align="center" label="人工下片数" min-width="120" /> <!-- <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> --> <el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" /> <el-table-column align="center" :label="$t('reportWork.startstatus')" min-width="80" prop="enableState"> <template #default="scope"> <el-tag :type="getTagType(scope.row.enableState)" @click="toggleStatus(scope.row)"> {{ scope.row.enableState === 1 ? $t('reportWork.enable') : $t('reportWork.unenable') }} </el-tag> </template> </el-table-column> <el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="200"> <template #default="scope"> <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '已启用'" @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}</el-button> <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear') }}</el-button> <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId==null">打印</el-button> </template> </el-table-column> </el-table> </div> <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" :title="$t('searchOrder.cageinformation')"> <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('请选择工位')" clearable> <el-option label="全部" value="0"></el-option> <el-option label="1" value="1"></el-option> <el-option label="2" value="2"></el-option> <el-option label="3" value="3"></el-option> <el-option label="4" value="4"></el-option> <el-option label="5" value="5"></el-option> <el-option label="6" value="6"></el-option> <el-option label="7" value="7"></el-option> <el-option label="8" value="8"></el-option> <el-option label="9" value="9"></el-option> <el-option label="10" value="10"></el-option> </el-select> <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('basicData.plselectproject')" clearable @input="handleInputChangea($event, row.id)"> <el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item" /> </el-select> <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{ $t('reportmanage.inquire') }}</el-button> <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass" :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> <el-table-column prop="workStationId" align="center" :label="$t('工位号')" min-width="80" /> <el-table-column prop="engineerId" align="center" :label="$t('工程号')" min-width="80" /> <el-table-column prop="flowCardId" align="center" :label="$t('流程卡号')" min-width="80" /> <el-table-column prop="layer" align="center" :label="$t('层')" min-width="120" /> <el-table-column prop="sequence" align="center" :label="$t('顺序')" min-width="150" /> <el-table-column prop="width" align="center" :label="$t('宽')" min-width="120" /> <el-table-column prop="height" align="center" :label="$t('高')" min-width="120" /> <el-table-column prop="Filmsid" align="center" :label="$t('膜系')" min-width="120" /> <el-table-column prop="thickness" align="center" label="厚度" min-width="120" /> <el-table-column prop="glassId" align="center" :label="$t('玻璃id')" min-width="120" /> </el-table> </el-dialog> </el-card> <!-- workstationId: '1', workstationId: '1005', flowCardId: '183.6', totalquantity: '1991', racksnumber:"1", work_state: '待识别', --> <div style="display: flex;" class="awatch"> <div id="main-body"> <Landingindication></Landingindication> </div> <div id="main-bodya"> <Landingindicationtwo></Landingindicationtwo> </div> </div> <div style="display: flex;" class="awatch"> <div id="main-body"> <Landingindication></Landingindication> </div> <div id="main-bodya"> <Landingindicationtwo></Landingindicationtwo> </div> </div> </el-card> </div> <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> <el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')"> <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> <el-form size="mini" label-width="100px"> <el-form label-width="210px" label-position="right"> <el-form size="mini" label-width="100px"> <el-form label-width="210px" label-position="right"> <el-form-item :label="$t('reportWork.shelfnumbera')" :required="true" style="width: 25vw"> <el-input v-model="workstationId" autocomplete="off"/> <el-input v-model="workstationId" autocomplete="off" /> </el-form-item> <el-form-item :label="$t('reportWork.cardnumbera')" :required="true" style="width: 25vw;"> <el-select v-model="flowCardId" :placeholder="$t('reportWork.incardnumber')"> <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" :value="item.flowcard_id" /> </el-select> </el-form-item> </el-form> <el-select v-model="flowCardId" :placeholder="$t('reportWork.incardnumber')"> <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" :value="item.flowcard_id" /> </el-select> </el-form-item> </el-form> </el-form> </div> <template #footer> @@ -326,32 +428,70 @@ </div> </template> </el-dialog> <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close style="width: 75%;height:75% "> <!-- <template #header="{ close, titleId, titleClass }"> <el-button @click="printFlowCard" >打印</el-button> </template> --> <print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer" style="width: 100%;height: 100%"/> </el-dialog> </template> <style scoped> #dt { display:block; float:left;line-height: 20px;margin-left: 100px;} #dta { display:block; float:left;line-height: 20px;margin-left: 80%;} #dialog-footer{ #dt { display: block; float: left; line-height: 20px; margin-left: 100px; } #dta { display: block; float: left; line-height: 20px; margin-left: 80%; } #dialog-footer { text-align: center; margin-top: -15px; } #message{ #message { text-align: center; align-items: center; color: black; width: 200px; height: 100px; background-color: #337ecc; margin-left: 28%; width: 200px; height: 100px; background-color: #337ecc; margin-left: 28%; } .awatch{ .awatch { max-width: 100%; } #main-body{ #main-body { margin-top: -40px; margin-left: 150px; } #main-bodya{ #main-bodya { margin-top: -40px; margin-left: 100px; } :deep(#sizePrintCalrd .el-dialog__body) { height: 85%; width: 100%; overflow-y: auto; } </style> UI-Project/src/views/largescreen/largescreen.vue
@@ -26,11 +26,18 @@ </el-table> </div> <div id="parent" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 750px;"> <img src="../../assets/d1a.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> <img src="../../assets/dpxsa.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> <div id="lipiana" v-show="woshia"></div> <div id="lipianb" v-show="woshia"></div> <div id="lipianc" v-show="woshic"></div> <div id="lipiand" v-show="woshic"></div> <div id="overlay" v-show="flake"></div> <div id="overlayb" v-show="flakeb"></div> <div id="overlayc" v-show="flakec"></div> <div id="overlayd" v-show="flaked"></div> <div id="longa" v-show="dalipiana"></div> <div id="longb" v-show="dalipianb"></div> <div id="shangpianji" v-show="shangpian"></div> </div> <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;"> <el-table height="240" ref="table" width="340px" @@ -120,10 +127,16 @@ const tableDatac = ref([]) const adjustedRects = ref([]); const chartRefs = ref([]); const flake = ref(true) const flakeb = ref(true) const flakec = ref(true) const flaked = ref(true) const flake = ref(false) const flakeb = ref(false) const flakec = ref(false) const flaked = ref(false) const woshia = ref(false) const woshic = ref(false) const dalipiana = ref(false) const dalipianb = ref(false) const shangpian = ref(false) const thisProcess = ref(); // 用于存储process_id的响应式引用 // 定义一个响应式引用来存储图表实例 const chartDom = ref(null); @@ -132,9 +145,7 @@ const handleBinda = (row) => { blinda.value = true; }; const processesData = ref([ ]); const processesData = ref([]); function getStatusType(warehousing) { switch (warehousing) { case 0: @@ -156,33 +167,16 @@ } } let socket = null; let socket2 = null; let socket3 = null; let socket4 = null; let socket5 = null; const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; const handleMessage = (data) => { tableData.value = data.awaitingRepairs[0] tableDatab.value = data.DoingTask[0] tableDatac.value = data.orders[0] // adjustedRects.value = data.device[0].map(rect => ({ // ...rect, // completed: rect.completedQuantity, // breakage: rect.breakageQuantity, // thisProcess: rect.thisProcess, // })); }; // let socket; // 设置图表 DOM 引用 function setChartDom(index, el) { if (!chartRefs.value[index]) { chartRefs.value[index] = { dom: el, chart: null }; } else { chartRefs.value[index].dom = el; } } const socketUrl2 = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingIsRun`; onMounted(() => { socket = new WebSocket(socketUrl); socket = new WebSocket(socketUrl2); socket.onmessage = (event) => { socket.onmessage = (event) => { const data = JSON.parse(event.data); processesData.value = data.device[0].map(rect => ({ ...rect, @@ -191,12 +185,47 @@ thisProcess: rect.thisProcess, })); renderPieCharts(); console.log(processesData.value); // updateCharts(); } }; // }; }); function setChartDom(index, el) { if (!chartRefs.value[index]) { chartRefs.value[index] = { dom: el, chart: null }; } else { chartRefs.value[index].dom = el; } } const socketUrl2 = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingIsRun`; const handleMessage2 = (data) => { const tasks = data.temperingTaskType[0]; if (tasks && tasks.length >= 4) { flake.value = tasks[0].state === 1; flakeb.value = tasks[1].state === 2; flakec.value = tasks[2].state === 3; flaked.value = tasks[3].state === 4; } }; // 卧式理片 const socketUrl3 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlassIsRun`; const handleMessage3 = (data) => { const tasks = data.taskCaches[0]; woshia.value = tasks.some(task => task.endCell == 2001 && task.glassId == 0); woshic.value = tasks.some(task => task.endCell == 2002 && task.glassId == 0); }; // 大理片笼 const socketUrl4 = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/isRun`; const handleMessage4 = (data) => { const tasks = data.bigStorageCageDetailsOutTask[0]; const taskss = data.bigStorageCageDetailsFeedTask[0]; dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined); dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined); }; // 上片 const socketUrl5 = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlassIsRun`; const handleMessage5 = (data) => { if(data.engineering.length !==0 ){ shangpian.value = true; } }; const renderPieCharts = () => { processesData.value.forEach((data, index) => { const chart = echarts.init(document.getElementById('pieChart_' + index)); @@ -241,20 +270,63 @@ }; onUnmounted(() => { socket.close(); }); // onUnmounted(() => { // socket.close(); // socket2.close(); // }); // onMounted(() => { // socket = initializeWebSocket(socketUrl, handleMessage); // // socket = new WebSocket(socketUrl); // socket.onmessage = (event) => { // const data = JSON.parse(event.data); // processesData.value = data.device[0].map(rect => ({ // ...rect, // completedQuantity: rect.completedQuantity, // breakageQuantity: rect.breakageQuantity, // thisProcess: rect.thisProcess, // })); // renderPieCharts(); // console.log(processesData.value); // // updateCharts(); // socket2 = initializeWebSocket(socketUrl2, handleMessage2); // // socket2 = new WebSocket(socketUrl2); // // socket2.onmessage = (event) => { // // const data = JSON.parse(event.data); // // handleMessage2(data); // // }; // }; // }); onMounted(() => { socket = initializeWebSocket(socketUrl, handleMessage); socket2 = initializeWebSocket(socketUrl2, handleMessage2); socket3 = initializeWebSocket(socketUrl3, handleMessage3); socket4 = initializeWebSocket(socketUrl4, handleMessage4); socket5 = initializeWebSocket(socketUrl5, handleMessage5); }); onUnmounted(() => { if (socket) { closeWebSocket(socket); } if (socket2) { closeWebSocket2(socket2); } if (socket3) { closeWebSocket3(socket3); } if (socket4) { closeWebSocket4(socket4); } if (socket5) { closeWebSocket5(socket5); } }); onBeforeUnmount(() => { console.log("关闭了") closeWebSocket(); closeWebSocket2(); closeWebSocket3(); closeWebSocket4(); closeWebSocket5(); }); </script> @@ -281,29 +353,29 @@ #overlay{ position: absolute; z-index: 1; width: 30px; width: 29px; height: 10px; background-color: #529b2e; margin-top: -39px; margin-left: 4px; margin-top: -34px; margin-left: -8px; } #overlayb{ position: absolute; z-index: 1; width: 16px; width: 15px; height: 115px; background-color: #529b2e; margin-top: -197px; margin-left: 9px; margin-left: -3px; } #overlayc{ position: absolute; z-index: 1; width: 16px; width: 14px; height: 16px; background-color: #529b2e; margin-top: -238px; margin-left: 9px; margin-top: -243px; margin-left: -2px; } #overlayd{ position: absolute; @@ -311,7 +383,70 @@ width: 28px; height: 11px; background-color: #529b2e; margin-top: -234px; margin-left: 56px; margin-top: -239px; margin-left: 40px; } #lipiana{ position: absolute; z-index: 1; width: 65px; height: 10px; background-color: #529b2e; margin-top: -57px; margin-left: 240px; } #lipianb{ position: absolute; z-index: 1; width: 16px; height: 10px; background-color: #529b2e; margin-top: -72px; margin-left: 323px; } #lipianc{ position: absolute; z-index: 1; width: 65px; height: 10px; background-color: #529b2e; margin-top: -32px; margin-left: 270px; } #lipiand{ position: absolute; z-index: 1; width: 21px; height: 10px; background-color: #529b2e; margin-top: -48px; margin-left: 354px; } #longa{ position: absolute; z-index: 1; width: 29px; height: 5px; background-color: #529b2e; margin-top: -20px; margin-left: 80px; } #longb{ position: absolute; z-index: 1; width: 29px; height: 5px; background-color: #529b2e; margin-top: -20px; margin-left: 150px; } #shangpianji{ position: absolute; z-index: 1; width: 29px; height: 10px; background-color: #529b2e; margin-top: -90px; margin-left: 568px; } </style> hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/controller/FlowCardController.java
New file @@ -0,0 +1,21 @@ package com.mes.pp.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * <p> * 前端控制器 * </p> * * @author wu * @since 2024-08-07 */ @RestController @RequestMapping("/flow_card/flow-card") public class FlowCardController { } hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/entity/FlowCard.java
New file @@ -0,0 +1,163 @@ package com.mes.pp.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; /** * <p> * * </p> * * @author wu * @since 2024-08-07 */ @Data @EqualsAndHashCode(callSuper = false) public class FlowCard implements Serializable { private static final long serialVersionUID = 1L; /** * (工程号,2024.0302天机) */ @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 销售单号 */ private String orderId; /** * 生产订单号 */ private String productionId; /** * 流程卡号 */ private String processId; /** * 落架顺序 */ private String landingSequence; /** * 序号 */ private Integer orderNumber; /** * 工艺确认序号 */ private Integer technologyNumber; /** * 分架数量 */ private Integer quantity; /** * 以优化数量 */ private Integer optimizeQuantity; /** * 排版状态(默认0,1允许排版2优化占用) */ private Integer layoutStatus; /** * 补片数量 */ private Integer numberPatches; /** * 最后工序报工 库存数量 */ private Integer inventoryQuantity; /** * 已入数量 */ private Integer receivedQuantity; /** * 补片编号 */ private String patchId; /** * 工程占用状态,0为占用1占用 */ private Integer engineeringOccupancy; /** * 工程号(2024.0302添加) */ private String projectNo; /** * 包装前工序报工 库存数量 */ private Integer inventoryNumber; /** * 入库时间 */ private LocalDateTime storageTime; /** * 生产终止状态(默认0,1生产终止) */ private Integer terminationStatus; /** * 打印状态 */ private Integer printStatus; /** * 备用键 */ private Integer alternateKey; /** * 分架员 */ private String founder; /** * 分架时间 */ @TableField("splitFrame_time") private LocalDateTime splitframeTime; /** * 层数 */ private Integer layersNumber; /** * 流程卡打印排序 */ private Integer sort; /** * 建立时间 */ private LocalDateTime createTime; /** * 修改时间 */ private LocalDateTime updateTime; } hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/mapper/FlowCardMapper.java
New file @@ -0,0 +1,25 @@ package com.mes.pp.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.mes.pp.entity.FlowCard; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import feign.Param; import java.util.List; import java.util.Map; /** * <p> * Mapper 接口 * </p> * * @author wu * @since 2024-08-07 */ @DS("pp") public interface FlowCardMapper extends BaseMapper<FlowCard> { List<Map<String, Object>> selectProject(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); List<Map<String, Object>> selectFlowCard(@Param("processId") String processId,@Param("technologyNumber") Integer technologyNumber); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/service/FlowCardService.java
New file @@ -0,0 +1,22 @@ package com.mes.pp.service; import com.mes.pp.entity.FlowCard; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; import java.util.Map; /** * <p> * 服务类 * </p> * * @author wu * @since 2024-08-07 */ public interface FlowCardService extends IService<FlowCard> { List<Map<String, Object>> selectProject(String processId, Integer technologyNumber); List<Map<String, Object>> selectFlowCard(String processId, Integer technologyNumber); } hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/service/impl/DamageDetailsService.java
File was deleted hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/service/impl/FlowCardServiceImpl.java
New file @@ -0,0 +1,32 @@ package com.mes.pp.service.impl; import com.mes.pp.entity.FlowCard; import com.mes.pp.mapper.FlowCardMapper; import com.mes.pp.service.FlowCardService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; /** * <p> * 服务实现类 * </p> * * @author wu * @since 2024-08-07 */ @Service public class FlowCardServiceImpl extends ServiceImpl<FlowCardMapper, FlowCard> implements FlowCardService { @Override public List<Map<String, Object>> selectProject(String processId, Integer technologyNumber){ return baseMapper.selectProject(processId,technologyNumber); } @Override public List<Map<String, Object>> selectFlowCard(String processId, Integer technologyNumber){ return baseMapper.selectFlowCard(processId, technologyNumber); } } hangzhoumesParent/common/servicebase/src/main/java/com/mes/pp/service/impl/ReportingWorkDetailService.java
File was deleted hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
@@ -108,7 +108,7 @@ public Integer updateTemperingState(TemperingGlassInfo temperingGlassInfo) { UpdateWrapper<TemperingGlassInfo> wrapper = new UpdateWrapper<>(); wrapper.eq("glass_id",temperingGlassInfo.getGlassId()) .lt("state",5) .lt("state",6) .set("state", temperingGlassInfo.getState());; if (temperingMapper.update(null,wrapper) > 0) { return 200; hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/CodeGet.java
@@ -31,7 +31,7 @@ // 3、数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8"); dsc.setUrl("jdbc:mysql://localhost:3306/pp?serverTimezone=GMT%2b8"); dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("beibo.123/"); @@ -41,7 +41,7 @@ // 4、包配置 PackageConfig pc = new PackageConfig(); pc.setParent("com.mes"); pc.setModuleName("work_assignment"); //模块名 pc.setModuleName("flow_card"); //模块名 pc.setController("controller"); pc.setService("service"); pc.setMapper("mapper"); @@ -50,7 +50,7 @@ // 5、策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setInclude("work_assignment"); strategy.setInclude("flow_card"); strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 hangzhoumesParent/common/servicebase/src/main/resources/mapper/FlowCardMapper.xml
New file @@ -0,0 +1,73 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.mes.pp.mapper.FlowCardMapper"> <select id="selectFlowCard" resultType="java.util.Map"> select fc.order_number, concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, od.quantity, round(ogd.total_area, 2) as total_area, od.perimeter, od.bend_radius, concat(IFNULL(od.processing_note,''), IFNULL(od.remarks,'')) as remarks, od.other_columns, round(ogd.child_width) as width, round(ogd.child_height) as height, pd.separation, fc.technology_number from flow_card as fc left join sd.order_glass_detail as ogd on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and fc.technology_number = ogd.technology_number left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number left join sd.product_detail as pd on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number where fc.process_id = #{processId} and position(fc.technology_number in #{technologyNumber}) group by fc.process_id, fc.order_number, fc.technology_number order by IF(sort != NULL || sort != '', sort, fc.order_number) </select> <select id="selectProject" resultType="java.util.Map"> select o.customer_name, o.project, (select process from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as process , od.edging_type, (select glass_child from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as glass_child , od.product_name, o.processing_note, fc.process_id, SUM(od.quantity) as quantity, round(SUM(ogd.total_area), 2) as gross_area, sum(od.weight) as weight, 1 as technologyNumber, concat(fc.process_id, '/', 1) as processIdNumber, concat('对应我司单号',o.batch) AS otherRemarks from flow_card as fc left join sd.order_glass_detail as ogd on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and fc.technology_number = ogd.technology_number left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number left join sd.`order` as o on o.order_id = fc.order_id left join sd.product as p on p.id = od.product_id left join (select ogd.order_id, ogd.order_number, ogd.technology_number, ogd.glass_child, GROUP_CONCAT(glass_child SEPARATOR ' ') AS concatenated_glass_child from sd.order_glass_detail as ogd where ogd.order_id = left(#{processId}, 10) and position(ogd.technology_number in #{technologyNumber}) GROUP BY order_id, order_number) as ogdc on ogdc.order_id = ogd.order_id and ogdc.order_number = ogd.order_number and ogdc.technology_number = ogd.technology_number where fc.process_id = #{processId} and position(fc.technology_number in #{technologyNumber}) group by fc.process_id </select> </mapper> hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -43,7 +43,7 @@ * fixedDelay : 上一个调用结束后再次调用的延时 */ @Scheduled(fixedDelay = 30000) @Scheduled(fixedDelay = 300) public void plcLoadGlassTask() throws InterruptedException { try { //获取联机状态 @@ -87,7 +87,7 @@ } } @Scheduled(fixedDelay = 30000) @Scheduled(fixedDelay = 300) public void plcLoadGlassReport() { //获取是否有汇报 String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue(); @@ -152,8 +152,8 @@ public void loadGlassStatus() { JSONObject jsonObject = new JSONObject(); //正在进行的任务 // String inkageStatus =plcParameterObject.getPlcParameter("InkageStatus").getValue(); String inkageStatus ="1"; String inkageStatus =plcParameterObject.getPlcParameter("InkageStatus").getValue(); // String inkageStatus ="1"; jsonObject.append("InkageStatus", inkageStatus); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass"); if (sendwServer != null) { @@ -169,12 +169,12 @@ @Scheduled(fixedDelay = 1000) public void loadGlassIsRun() { JSONObject jsonObject = new JSONObject(); //是否开始工程 Engineering engineering = engineeringService.selectInitiate(1); if (engineering != null){ jsonObject.append("engineering", engineering); }else { jsonObject.append("engineering", "0"); } //工位信息 List<UpWorkstation> upWorkstations = upWorkstationService.list(); jsonObject.append("list", upWorkstations); ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun"); if (sendwServer != null) { for (WebSocketServer webserver : sendwServer) { hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
@@ -53,10 +53,7 @@ public Result <Integer> updateTemperingState(@RequestBody Damage damage) { damageService.insertDamage(damage); TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); if(damage.getStatus()==2){ temperingGlassInfo.setState(5); } temperingGlassInfo.setState(damage.getStatus()); temperingGlassInfo.setGlassId(damage.getGlassId()); int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); return Result.build(200, "破损成功", result); hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/entity/DownGlassInfo.java
@@ -85,5 +85,9 @@ */ private Date gmtCreate; /** * 玻璃类型 */ private Integer glassType; } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/entity/request/DownGlassInfoRequest.java
@@ -6,6 +6,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; /** @@ -33,15 +34,15 @@ /** * 开始时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") private Date beginDate; /** * 结束时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") private Date endDate; hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/DownGlassInfoService.java
@@ -7,6 +7,7 @@ import com.mes.downworkstation.entity.dto.DownGlassInfoDTO; import java.util.List; import java.util.Map; public interface DownGlassInfoService extends IService<DownGlassInfo> { @@ -59,8 +60,9 @@ */ String setDownGlassInfoRequest(DownGlassInfoRequest request); /** * 查询架子上绑定流程卡的玻璃是否到齐 */ List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo); List<DownWorkstation> queryWorkStationIsFull(); } hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java
@@ -1,7 +1,10 @@ package com.mes.downglassinfo.service.impl; import cn.smallbun.screw.core.util.CollectionUtils; import cn.smallbun.screw.core.util.CollectionUtils; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -18,12 +21,14 @@ import com.mes.downworkstation.service.DownWorkstationService; import com.mes.glassinfo.entity.GlassInfo; import com.mes.job.DownLoadCacheGlassTask; import com.mes.pp.service.FlowCardService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.HashMap;import java.util.Map; import java.util.stream.Collectors; @Service @@ -41,6 +46,9 @@ @Autowired RedisUtil redisUtil; @Autowired FlowCardService flowCardService; /** * 根据流程卡号查询最大序号 @@ -113,7 +121,6 @@ } return "success"; } @Override public List<DownWorkstation> queryWorkStationIsFull() { //查询可以落架的玻璃信息且已绑定流程卡的工位信息 @@ -137,5 +144,50 @@ } } return workstationFull; }@Override public List<Map<String, List<Map<String, Object>>>> downGlassPrint(DownGlassInfo downGlassInfo){ QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); queryWrapper.eq("flow_card_id", "NG24080012A001") .eq("layer", 1) .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness","glass_type","COUNT(*) AS quantity") .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness"); List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); List<Map<String, Object>> projectInfo=flowCardService.selectProject(downGlassInfo.getFlowCardId(),downGlassInfo.getLayer()); List<Map<String, Object>> flowCardInfo=flowCardService.selectFlowCard(downGlassInfo.getFlowCardId(),downGlassInfo.getLayer()); for (Map<String, Object> row : flowCardInfo) { int order_number = (int) row.get("order_number"); int technology_number = (int) row.get("technology_number"); for (Map<String, Object> row1 : resultList) { int glass_type = (int) row1.get("glass_type"); int layer = (int) row1.get("layer"); Long quantity=(Long) row1.get("quantity"); if(order_number==glass_type&&technology_number==layer){ row.put("quantity1",quantity); } } } List<Map<String, List<Map<String, Object>>>> listMap=new ArrayList<>(); Map<String, List<Map<String, Object>>> result = new HashMap<>(); result.put("detail", projectInfo); result.put("detailList", flowCardInfo); for (Map<String, Object> row : projectInfo) { String order_number = (String) row.get("process"); String[] processes=order_number.split("->"); List<Map<String, Object>> processList = new ArrayList<>(); for (int i = 0; i < processes.length; i++) { Map<String, Object> processMap = new JSONObject(); processMap.put("process", processes[i]); processMap.put("id", i); processList.add(processMap); } result.put("processList", processList); } listMap.add(result); return listMap; } } hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
@@ -1,6 +1,7 @@ package mes; import com.mes.UnLoadGlassApplication; import com.mes.downglassinfo.entity.DownGlassInfo; import com.mes.downglassinfo.service.DownGlassInfoService; import com.mes.downglassinfo.service.DownGlassTaskService; import com.mes.downglassinfo.service.impl.DownGlassInfoServiceImpl; @@ -224,7 +225,13 @@ }*/ @Test public void downGlassPrint() { DownGlassInfo downGlassInfo=new DownGlassInfo(); downGlassInfo.setFlowCardId("NG24070506A001"); downGlassInfo.setLayer(1); downGlassInfoService.downGlassPrint(downGlassInfo); }