| | |
| | | @click="showDialog(rect.glassId)" |
| | | :style="{ position: 'absolute', |
| | | top: `${rect.y}px`, left: `${rect.x}px`, width: `${rect.width}px`, height: `${rect.height}px`, |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.status) |
| | | backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.state) |
| | | }" |
| | | > |
| | | <div class="centered-text"> |
| | |
| | | </div> |
| | | </el-scrollbar> |
| | | <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose"> |
| | | <el-button :disabled="currentGlassRect?.status === 8 || currentGlassRect?.status === 9" type="warning" |
| | | <el-button :disabled="currentGlassRect?.state === 8 || currentGlassRect?.state === 9" type="warning" |
| | | plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;"> |
| | | {{ $t('order.dilapidation') }} |
| | | </el-button> |
| | | <el-button :disabled="currentGlassRect?.status === 9 || currentGlassRect?.status === 8" type="danger" |
| | | <el-button :disabled="currentGlassRect?.state === 9 || currentGlassRect?.state === 8" type="danger" |
| | | plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;"> |
| | | <el-icon class="el-icon--right"> |
| | | <Upload/> |
| | |
| | | const blind = ref(false) |
| | | const engineerId = ref(); |
| | | const currentGlassId = ref(null); |
| | | const currentstate = ref(null); |
| | | const temperingLayoutId = ref(null); |
| | | const adjustedRects = ref([]); |
| | | const raw = ref([]); |
| | | let webSocket: WebSocket | null = null; |
| | |
| | | const rawData = ref([]); |
| | | // 显示对话框并设置当前 glassId |
| | | const currentGlassRect = computed(() => { |
| | | return adjustedRects.value.find(rect => rect.glassId === currentGlassId.value); |
| | | return adjustedRects.value.find(rect => rect.glassId === currentGlassId.value); |
| | | }); |
| | | function showDialog(glassId: number) { |
| | | function showDialog(glassId: number) { |
| | | currentGlassId.value = glassId; |
| | | blind.value = true; |
| | | adjustedRects.value = adjustedRects.value.map(rect => |
| | |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | line: 4001, |
| | | status: 8, |
| | | state: 8, |
| | | workingProcedure: '钢化', |
| | | temperingLayoutId: currentPage.value, |
| | | engineerId: engineerId.value, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 8); |
| | | updateRectstate(currentGlassId.value, 8); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | |
| | | const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { |
| | | glassId: currentGlassId.value, |
| | | line: 4001, |
| | | status: 9, |
| | | state: 9, |
| | | workingProcedure: '钢化', |
| | | temperingLayoutId: currentPage.value, |
| | | engineerId: engineerId.value, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blind.value = false; |
| | | updateRectStatus(currentGlassId.value, 9); |
| | | updateRectstate(currentGlassId.value, 9); |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | |
| | | adjustedRects.value = adjustedRectsData; |
| | | } |
| | | }; |
| | | function getRectColor(status: number): string { |
| | | switch (status) { |
| | | case -1: |
| | | return '#CDAF95'; |
| | | case 0: |
| | | return '#7AC5CD'; |
| | | case 1: |
| | | return '#95d475'; |
| | | case 2: |
| | | return 'lightblue'; |
| | | case 3: |
| | | return '#eebe77'; |
| | | function getRectColor(state: number): string { |
| | | switch (state) { |
| | | // case -1: |
| | | // return '#CDAF95'; |
| | | // case 0: |
| | | // return '#7AC5CD'; |
| | | // case 1: |
| | | // return '#95d475'; |
| | | // case 2: |
| | | // return 'lightblue'; |
| | | // case 3: |
| | | // return '#eebe77'; |
| | | case 4: |
| | | return '#CD6090'; |
| | | case 8: |
| | | return '#911005'; |
| | | case 9: |
| | | return '#4682B4'; |
| | | default: |
| | | return '#CDAF95'; |
| | | } |
| | | } |
| | | // 更新矩形状态 |
| | | function updateRectStatus(glassId: string, status: number) { |
| | | function updateRectstate(glassId: string, state: number) { |
| | | adjustedRects.value.forEach(rect => { |
| | | if (rect.glassId === glassId) { |
| | | rect.status = status; // 更新矩形的状态 |
| | | rect.state = state; // 更新矩形的状态 |
| | | } |
| | | }); |
| | | } |