| | |
| | | const scanGlass = ref([]) |
| | | const {t} = useI18n() |
| | | let language = ref(localStorage.getItem('lang') || 'zh') |
| | | import { inject } from 'vue'; |
| | | const router = useRouter() |
| | | const timeRange = ref([]) |
| | | const dialogFormVisiblea = ref(false) |
| | | const dialogFormVisibleb = ref(false) |
| | | const dialogFormVisiblec = ref(false) |
| | | const dialogFormVisibled = ref(false) |
| | | const dialogFormVisiblee = ref(false) |
| | | const dialogFormVisiblef = ref(false) |
| | | const dialogFormVisibles = ref(false) |
| | | const blindb = ref(false) |
| | | const inkageEntity = ref('#911005'); |
| | | const requestEntity = ref('#911005'); |
| | | const mesReplyEntity = ref('#911005'); |
| | |
| | | const tableDatae = ref([]) |
| | | const tableDatas = ref([]) |
| | | const tableDatass = ref([]) |
| | | const tableDatax = ref([]); |
| | | const tableDatalack = ref([]) |
| | | const tableDataspecify = ref([]) |
| | | const tableDatacagedetails = ref([]) |
| | | const selectValuesa = reactive([]); |
| | | const carPosition = ref([]) |
| | | const ganghua = ref('') |
| | | const diaodu = ref('') |
| | | const flowCardId = ref('') |
| | | const filmsId = ref('') |
| | | const project = ref([]); |
| | | const adjust = ref([]); |
| | | const adjusta = ref([]); |
| | | const adjustedRects = ref([]); |
| | |
| | | const subRectsCountsc = ref([]); |
| | | const currentRow = reactive({}); // 当前行的数据 |
| | | const currentPage2 = ref(1) |
| | | const globalDate = inject('globalDate'); |
| | | const inputValuesa = reactive({}); |
| | | const add = ref(false) |
| | | const gap = ref(''); |
| | | const glassId = ref(''); |
| | | const glassType = ref(''); |
| | | const height = ref(''); |
| | | const sequence = ref(''); |
| | | const state = ref(''); |
| | | const temperingFeedSequence = ref(''); |
| | | const temperingLayoutId = ref(''); |
| | | const startSlot = ref(''); |
| | | const targetSlot = ref(''); |
| | | const taskStateList = ref(''); |
| | | const taskTypeList = ref(''); |
| | | const beginDate = ref(''); |
| | | const endDate = ref(''); |
| | | const thickness = ref(''); |
| | | const width = ref(''); |
| | | const cell1=ref(true); |
| | |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | // 历史任务 |
| | | // const handlehistorical = (row) => { |
| | | // blindb.value = true; |
| | | // historical() |
| | | // }; |
| | | // 历史任务 |
| | | const historical = async () => { |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageHistoryTask/queryBigStorageCageHistoryTask", { |
| | | glassId: glassId.value, |
| | | startSlot: 0, |
| | | targetSlot: 0, |
| | | taskStateList: [], |
| | | taskTypeList: [], |
| | | beginDate: startTime, |
| | | endDate: globalDate |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 历史查询 |
| | | const sethistorical = async () => { |
| | | try { |
| | | let startTime = window.localStorage.getItem('startTime') |
| | | let celllist=[] |
| | | let stateList=[] |
| | | let pstartSlot= '' |
| | | let ptargetSlot='' |
| | | if(selectValuesa[0]!=null&&selectValuesa[0]!='undefined'){ |
| | | if(selectValuesa[0]!=""){ |
| | | celllist=[selectValuesa[0]]; |
| | | } |
| | | } |
| | | if(selectValuesa[1]!=null&&selectValuesa[1]!='undefined'){ |
| | | if(selectValuesa[1]!=""){ |
| | | stateList=[selectValuesa[1]]; |
| | | } |
| | | } |
| | | if(startSlot.value != ""){ |
| | | pstartSlot = startSlot.value |
| | | }else{ |
| | | pstartSlot = '0' |
| | | } |
| | | if(targetSlot.value != ""){ |
| | | ptargetSlot = targetSlot.value |
| | | }else{ |
| | | ptargetSlot = '0' |
| | | } |
| | | const response = await request.post("/cacheVerticalGlass/bigStorageCageHistoryTask/queryBigStorageCageHistoryTask", { |
| | | glassId: glassId.value, |
| | | startSlot: pstartSlot, |
| | | targetSlot: ptargetSlot, |
| | | taskStateList: celllist, |
| | | taskTypeList: stateList, |
| | | beginDate: startTime, |
| | | endDate: globalDate |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | tableDatax.value = response.data; |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | console.error(error); |
| | | } |
| | | } |
| | | |
| | | // 拿走 |
| | | const brokec = async(row) => { |
| | | try { |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 任务重置 |
| | | const handleptask = async() => { |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('searchOrder.partasks'), |
| | | t('workOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('workOrder.yes'), |
| | | cancelButtonText: t('workOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | if (confirmResult === 'confirm') { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCage/resetCage') |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | console.error('发生错误:', error); |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`; |
| | | const handleMessage = (data) => { |
| | | if (cageInfo && cageInfo.createTime) { |
| | | cageInfo.formattedCreateTime = formatTimestamp(cageInfo.createTime); |
| | | } |
| | | if (cageInfo && cageInfo.updateTime) { |
| | | cageInfo.formattedupdateTime = formatTimestamp(cageInfo.updateTime); |
| | | } |
| | | if(data.bigStorageSummary!=null){ |
| | | tableDatass.value = data.bigStorageSummary[0] |
| | | }else{ |
| | |
| | | right, |
| | | }; |
| | | }; |
| | | // 格式化后端时间并计算一周前的时间 |
| | | const defaultTime = ref<[Date, Date]>([new Date(), new Date()]); |
| | | function parseAndSetTime() { |
| | | const backendTime = new Date(globalDate); |
| | | const oneWeekAgo = new Date(backendTime.getTime() - 7 * 24 * 60 * 60 * 1000); // 减去7天 |
| | | console.log(formatTimestamp(oneWeekAgo)); |
| | | console.log(oneWeekAgo); |
| | | timeRange.value = [formatTimestamp(oneWeekAgo), formatTimestamp(backendTime)]; |
| | | window.localStorage.setItem('startTime', formatTimestamp(oneWeekAgo)) |
| | | } |
| | | onMounted(() => { |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | parseAndSetTime(); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | |
| | | } |
| | | return ''; |
| | | } |
| | | // 格式化时间戳为年月日时间字符串的函数 |
| | | function formatTimestamp(timestamp) { |
| | | const date = new Date(timestamp); |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1,并补零 |
| | | const day = String(date.getDate()).padStart(2, '0'); // 补零 |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | onBeforeUnmount(() => { |
| | | closeWebSocket(); |
| | | }); |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <el-button style="margin-top: 7px;margin-left: 10px;" id="searchButton" type="primary" @click="handlexiang">{{ $t('searchOrder.cageinformation') }}</el-button> |
| | | <el-button style="margin-top: 7px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button> |
| | | <el-button style="margin-top: 7px;margin-left: 10px;" id="searchButton" type="success" @click="handlehistorical">{{ $t('searchOrder.historicaltasks') }}</el-button> |
| | | <el-button style="margin-top: 7px;margin-left: 10px;" id="searchButton" type="warning" @click="handleganghua">{{ $t('searchOrder.temperingqueries') }}</el-button> |
| | | <el-button style="margin-top: 7px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisibles=true;fetchFlows()">{{ $t('searchOrder.searchlayout') }}</el-button> |
| | | <el-button style="margin-top: 7px;margin-left: 10px;" id="searchButton" type="danger" @click="handleptask()">{{ $t('searchOrder.partask') }}</el-button> |
| | | <el-switch style="margin-top: 7px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" /> |
| | | <el-switch style="margin-top: 7px;margin-left: 10px;" v-model="diaodu" class="mb-2" :inactive-text="$t('searchOrder.Schedulingswitch')" @change="handlediaodu" /> |
| | | <div id="dotClass"> |
| | |
| | | <el-table height="300px" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :row-class-name="tableRowClassName" |
| | | :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | :data="tableDatax" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassId" align="center" :label="$t('searchOrder.intoglassid')" min-width="140" /> |
| | | <el-table-column prop="startSlot" align="center" :label="$t('searchOrder.startposition')" min-width="120" /> |
| | | <el-table-column prop="targetSlot" align="center" :label="$t('searchOrder.targetlocation')" min-width="120" /> |
| | |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleb" top="5vh" width="85%" :title="$t('searchOrder.productionqueue')"> |
| | | <el-table ref="table" style="margin-top: 20px;height: 700px;" |
| | | :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassId" fixed align="center" :label="$t('searchOrder.glassID')" min-width="150"/> |
| | | <el-table-column prop="flowCardId" fixed align="center" :label="$t('searchOrder.processcards')" min-width="120" /> |
| | | <el-table-column prop="width" align="center" :label="$t('searchOrder.width')" min-width="80" /> |
| | | <el-table-column prop="height" align="center" :label="$t('searchOrder.height')" min-width="80" /> |
| | | <el-table-column prop="thickness" align="center" :label="$t('searchOrder.thickness')" min-width="80" /> |
| | | <el-table-column prop="filmsid" align="center" :label="$t('searchOrder.coatingtypes')" min-width="80" /> |
| | | <!-- 历史任务 --> |
| | | <el-dialog v-model="blindb" top="10vh" width="90%"> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="glassId" style="margin-left: 10px;margin-bottom: 10px;width: 270px;" :placeholder="$t('searchOrder.inglassID')" /> |
| | | <el-input v-model="startSlot" style="margin-left: 10px;margin-bottom: 10px;width: 270px;" :placeholder="$t('film.originateslot')" /> |
| | | <el-input v-model="targetSlot" style="margin-left: 10px;margin-bottom: 10px;width: 270px;" :placeholder="$t('film.endslot')" /> |
| | | <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('searchOrder.taskstatus')" clearable |
| | | style="width: 270px;margin-left: 10px;"> |
| | | <el-option :label="$t('searchOrder.begin')" value="0"></el-option> |
| | | <el-option :label="$t('searchOrder.finish')" value="2"></el-option> |
| | | <el-option :label="$t('order.dilapidation')" value="3"></el-option> |
| | | <el-option :label="$t('searchOrder.uncar')" value="4"></el-option> |
| | | </el-select> |
| | | <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('film.enabletype')" clearable |
| | | style="width: 270px;margin-left: 10px;"> |
| | | <el-option :label="$t('searchOrder.inkage')" value="1"></el-option> |
| | | <el-option :label="$t('searchOrder.outfilm')" value="2"></el-option> |
| | | <el-option :label="$t('film.dispatch')" value="3"></el-option> |
| | | </el-select> |
| | | <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" :start-placeholder="$t('reportmanage.starttime')" |
| | | style="margin-left: 15px;" value-format = "YYYY-MM-DD hh:mm:ss" |
| | | :end-placeholder="$t('reportmanage.endtime')"> |
| | | </el-date-picker> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="sethistorical()">{{$t('reportmanage.inquire')}}</el-button> |
| | | </div> |
| | | <el-table ref="table" style="margin-top: 20px;height: 650px;" :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="glassIdIn" align="center" :label="$t('searchOrder.intoglassid')" min-width="80" /> |
| | | <el-table-column prop="glassIdOut" align="center" :label="$t('searchOrder.outputglassID')" min-width="80" /> |
| | | <el-table-column prop="currentCell" align="center" :label="$t('sorter.layernow')" min-width="80" /> |
| | | <el-table-column prop="startCell" align="center" :label="$t('processCard.layer')" min-width="120" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('searchOrder.acceptshorizontal')" |
| | | min-width="150" |
| | | prop="ishorizontal" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypea(scope.row.ishorizontal)"> |
| | | {{ getStatusTexta(scope.row.ishorizontal) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="temperingLayoutId" align="center" :label="$t('searchOrder.layoutID')" min-width="120" /> |
| | | <el-table-column prop="temperingFeedSequence" align="center" :label="$t('searchOrder.picturesequence')" min-width="120" /> |
| | | <el-table-column prop="xCoordinate" align="center" :label="$t('searchOrder.xcoordinates')" min-width="80" /> |
| | | <el-table-column prop="yCoordinate" align="center" :label="$t('searchOrder.ycoordinates')" min-width="80" /> |
| | | <el-table-column prop="angle" align="center" :label="$t('searchOrder.rotationangle')" min-width="150" /> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('searchOrder.state')" |
| | | :label="$t('film.taskstatus')" |
| | | min-width="80" |
| | | prop="state" |
| | | prop="taskState" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row.state)"> |
| | | {{ getStatusTextb(scope.row.state) }} |
| | | <el-tag :type="getStatusTypeb(scope.row.taskState)"> |
| | | {{ getStatusTextb(scope.row.taskState) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | align="center" |
| | | :label="$t('film.enabletype')" |
| | | min-width="80" |
| | | prop="taskType" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypea(scope.row.taskType)"> |
| | | {{ getStatusTexta(scope.row.taskType) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" align="center" :label="$t('film.createtime')" min-width="120" /> |
| | | <el-table-column prop="updateTime" align="center" :label="$t('sorter.updateTime')" min-width="120" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button @click="blindb = false">{{ $t('large.close') }}</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 钢化查询 --> |
| | | <el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')"> |