| | |
| | | <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" |
| | |
| | | const blinda = ref(false) |
| | | const blindb = ref(false) |
| | | const dialoglea = ref(false) |
| | | const canSelectProjecta = ref(true); |
| | | const canSelectProjectb = ref(true); |
| | | const canSelectProjectc = ref(false); |
| | | const tableDatax = ref([]) |
| | | const tableDatad = ref([]) |
| | | const upstatus = ref(t('basicData.machineaa')); |
| | | const cuttingMachineStatusColor = ref('#911005'); |
| | | const tableDataa = ref<any[]>([]); |
| | |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/uploadGlass`; |
| | | 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.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; |
| | | } |
| | | }; |
| | | onBeforeUnmount(() => { |
| | | closeWebSocket(); |
| | | }); |
| | | // 删除 |
| | | // 结束工程 |
| | | const handledelete = (row) => { |
| | | blindb.value = true; |
| | | deleteTask() |
| | | }; |
| | | const requestData = { |
| | | state: 100 |
| | |
| | | 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 = ''; |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 删除 |
| | | // 结束工程 |
| | | const deleteTask = async () => { |
| | | try { |
| | | let engineeringId = window.localStorage.getItem('engineeringId') |
| | |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blindb.value = false; |
| | | tableDatad.value = response.data; |
| | | canSelectProjecta.value = true; |
| | | canSelectProjectb.value = true; |
| | | canSelectProjectc.value = false; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | |
| | | state: 1, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | 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: |
| | |
| | | }} |
| | | </el-button> |
| | | </div> |
| | | <el-button style="margin-top: 5px;margin-left: 15px;" type="primary" @click="selectproject">{{ $t('Mounting.previewproject') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" type="success" @click="handleBind">{{ $t('basicData.startloading') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handledelete">{{ $t('searchOrder.deleteTask') }}</el-button> |
| | | <el-button :disabled="!canSelectProjecta" style="margin-top: 5px;margin-left: 15px;" type="primary" @click="selectproject">{{ $t('Mounting.previewproject') }}</el-button> |
| | | <el-button :disabled="!canSelectProjectb" style="margin-top: 5px;margin-left: 20px;" type="success" @click="handleBind">{{ $t('basicData.startloading') }}</el-button> |
| | | <el-button :disabled="!canSelectProjectc" style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">{{ $t('basicData.stop') }}</el-button> |
| | | <el-button :disabled="!canSelectProjectc" style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handledelete">{{ $t('searchOrder.deleteTask') }}</el-button> |
| | | <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button> |
| | | <el-select disabled v-model="selectValuesa[1]" clearable :placeholder="$t('Mounting.oneloadingline')" |
| | | style="margin-top: 5px;margin-left: 20px;"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-model="blindb" top="30vh" width="25%" :title="$t('searchOrder.pdeleteTask')"> |
| | | <template #footer> |
| | | <!-- 结束工程 --> |
| | | <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 @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> |
| | | </template> --> |
| | | </el-dialog> |
| | | <!-- 值班信息 --> |
| | | <el-dialog v-model="dialoglea" top="15vh" width="70%" :title="$t('searchOrder.dutyinformation')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 300px;" |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |