| | |
| | | import request from "@/utils/request"; |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { WebSocketHost ,host} from '@/utils/constants' |
| | | import PrintFlow from './PrintFlow.vue' |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisiblea2 = ref(false) |
| | | const dialogFormVisibleaDownGlass = ref(false) |
| | |
| | | const flowCardOptions = ref('[]'); |
| | | const tableData = reactive([]); |
| | | 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(); |
| | |
| | | workstationId: workstationId.value, |
| | | }); |
| | | |
| | | console.log(response); |
| | | |
| | | if (response.code === 200) { |
| | | // 清除成功的逻辑 |
| | |
| | | // 定义消息处理函数,更新 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]); |
| | |
| | | } |
| | | }; |
| | | |
| | | // 查询数据 |
| | | 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(() => { |
| | |
| | | </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 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="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="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" |
| | | > |
| | | <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-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 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-table height="200px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="downGlass" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <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-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-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> |
| | |
| | | </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%;} |
| | | #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{ |
| | | text-align: center; |
| | | align-items: center; |
| | |
| | | background-color: #337ecc; |
| | | margin-left: 28%; |
| | | } |
| | | |
| | | .awatch{ |
| | | max-width: 100%; |
| | | } |
| | | |
| | | #main-body{ |
| | | margin-top: -40px; |
| | | margin-left: 150px; |
| | | } |
| | | |
| | | #main-bodya{ |
| | | margin-top: -40px; |
| | | margin-left: 100px; |
| | | } |
| | | |
| | | :deep(#sizePrintCalrd .el-dialog__body) { |
| | | height: 85%; |
| | | width: 100%; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |