| | |
| | | <script lang="ts" setup> |
| | | import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import {useRouter} from "vue-router" |
| | | import {ElMessage} from 'element-plus' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import {useI18n} from 'vue-i18n' |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | | import request from "@/utils/request" |
| | |
| | | if (response.code === 200) { |
| | | tableData.splice(0, tableData.length, ...response.data); |
| | | ElMessage.error(response.message); |
| | | } |
| | | window.localStorage.setItem('engineeringId', tableData[0].engineeringId) |
| | | } |
| | | } catch (error) { |
| | | } |
| | | }; |
| | |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`; |
| | | const handleMessage = (data: any) => { |
| | | tableDataa.value = data.list[0].slice(0, 2); |
| | | if(data.loadTask1!=null){ |
| | | if(data.loadTask1.length !=0){ |
| | | tableData.value = data.loadTask1[0] |
| | | canSelectProjecta.value = false; |
| | | canSelectProjectb.value = false; |
| | | canSelectProjectc.value = true; |
| | | } |
| | | else { |
| | | canSelectProjecta.value = true; |
| | | canSelectProjectb.value = true; |
| | | canSelectProjectc.value = false; |
| | | tableData.value = ''; |
| | | } |
| | | }; |
| | | onBeforeUnmount(() => { |
| | |
| | | // 结束工程 |
| | | const handledelete = (row) => { |
| | | blindb.value = true; |
| | | deleteTask() |
| | | }; |
| | | const requestData = { |
| | | state: 100 |
| | |
| | | engineerId: selectedProjectNo.value, |
| | | filmRemove: parseInt(filmRemove.value, 10), |
| | | }) |
| | | window.localStorage.setItem('engineeringId', selectedProjectNo.value) |
| | | window.localStorage.setItem('engineeringIda', selectedProjectNo.value) |
| | | window.localStorage.setItem('filmRemove', filmRemove.value) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | // closeWebSocket(socket); |
| | | tableData.value = response.data; |
| | | dialogFormVisible.value = false; |
| | | selectedProjectNo.value = ''; |
| | |
| | | ElMessage.success(response.message); |
| | | tableDatad.value = response.data; |
| | | canSelectProjecta.value = true; |
| | | canSelectProjectb.value = true; |
| | | canSelectProjectc.value = false; |
| | | blindb.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | // 开始上片 |
| | | const handleon = async () => { |
| | | let filmRemove = window.localStorage.getItem('filmRemove') |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | | let engineeringIda = window.localStorage.getItem('engineeringIda') |
| | | if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') { |
| | | try { |
| | | const response = await request.post('/loadGlass/engineering/engineering/changeTask', { |
| | | stationCell: 5, |
| | | filmRemove: filmRemove, |
| | | engineerId: engineeringId, |
| | | engineerId: engineeringIda, |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | ElMessage.success(response.message); |
| | | canSelectProjecta.value = false; |
| | | canSelectProjectb.value = false; |
| | | canSelectProjectc.value = true; |
| | | |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | blind.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | ElMessage.error(t('basicData.glassnull')); |
| | | } |
| | | }; |
| | | // 破损 |
| | | const opena = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.broke'), |
| | | t('productStock.prompt'), |
| | | { |
| | | confirmButtonText: t('productStock.yes'), |
| | | cancelButtonText: t('productStock.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/insetDamage', { |
| | | glassId: row.glassId, |
| | | line: 5, |
| | | status: 1, |
| | | type: 8, |
| | | workingProcedure: '上片', |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 人工拿走 |
| | | const openb = async(row) => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('order.takeawaya'), |
| | | t('productStock.prompt'), |
| | | { |
| | | confirmButtonText: t('productStock.yes'), |
| | | cancelButtonText: t('productStock.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post('/loadGlass/engineering/engineering/insetDamage', { |
| | | glassId: row.glassId, |
| | | line: 5, |
| | | status: 1, |
| | | type: 9, |
| | | workingProcedure: '上片', |
| | | }) |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | function getStatusType2(filmRemove) { |
| | | switch (filmRemove) { |
| | | case 0: |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 结束工程 --> |
| | | <el-dialog v-model="blindb" top="10vh" width="50%"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="line" fixed align="center" :label="$t('basicData.line')"/> |
| | | <el-table-column prop="workProcesses" fixed align="center" :label="$t('basicData.process')"/> |
| | | <el-table-column prop="teamsGroupsName" align="center" :label="$t('basicData.team')"/> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('basicData.basic')"/> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('basicData.basic')"/> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('basicData.basic')"/> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('basicData.basic')"/> |
| | | <el-table-column prop="deviceName" align="center" :label="$t('basicData.basic')"/> |
| | | <el-dialog v-model="blindb" top="10vh" width="80%"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 450px;" :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="engineerId" fixed align="center" :label="$t('basicData.projectnumber')"/> |
| | | <el-table-column prop="glassId" fixed align="center" :label="$t('searchOrder.glassID')"/> |
| | | <el-table-column prop="temperingLayoutId" fixed align="center" :label="$t('searchOrder.layoutID')"/> |
| | | <el-table-column prop="temperingFeedSequence" align="center" :label="$t('searchOrder.picturesequence')"/> |
| | | <el-table-column prop="width" align="center" :label="$t('basicData.width')"/> |
| | | <el-table-column prop="height" align="center" :label="$t('basicData.height')"/> |
| | | <el-table-column prop="thickness" align="center" :label="$t('basicData.thickness')"/> |
| | | <el-table-column prop="filmsid" align="center" :label="$t('basicData.coatingtypes')"/> |
| | | <el-table-column prop="flowCardId" align="center" :label="$t('searchOrder.processcards')"/> |
| | | <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('order.dilapidation') }}</el-button> |
| | | <el-button size="mini" type="text" plain @click="openb(scope.row)">{{ $t('order.takeaway') }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="danger" @click="deleteTask()">{{ $t('searchOrder.deleteTask') }}</el-button> |
| | | <el-button @click="blindb = false">{{ $t('large.close') }}</el-button> |
| | | </div> |
| | | </template> |
| | | <!-- <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="deleteTask"> |
| | | {{ $t('basicData.confirm') }} |
| | | </el-button> |
| | | <el-button @click="blindb = false">{{ $t('basicData.cancel') }}</el-button> |
| | | </div> |
| | | </template> --> |
| | | </el-dialog> |
| | | <!-- 值班信息 --> |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |