| | |
| | | @current-change="handleCurrentChange" |
| | | style="margin-top: 10px;" |
| | | /> |
| | | <el-select |
| | | v-model="allDamagePatternSequence" |
| | | :placeholder="$t('workOrder.cway')" |
| | | clearable |
| | | style="width: 140px; margin-left: 35%; margin-top: 10px;" |
| | | > |
| | | <el-option |
| | | v-for="item in optionsb" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <!-- 修改一键破损按钮,添加禁用状态 --> |
| | | <el-button |
| | | type="warning" |
| | | style="margin-left: 10px; margin-top: 10px;" |
| | | @click="handleAllDamage" |
| | | :disabled="!allDamagePatternSequence" |
| | | > |
| | | {{$t('order.dilapidation')}} |
| | | </el-button> |
| | | </div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;"> |
| | | <!-- <el-button @click="handleAllDamage" style="margin-left: 90%;margin-top: -20px;margin-bottom: 5px;">{{$t('order.dilapidation')}}</el-button> --> |
| | | <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;"> |
| | | <div style="position: relative;"> |
| | | <div |
| | |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import {ElMessage} from 'element-plus' |
| | | import {avatarEmits, ElMessage, ElMessageBox } from 'element-plus' |
| | | import {computed, onMounted, onUnmounted, ref} from 'vue'; |
| | | import request from "@/utils/request" |
| | | import {host, WebSocketHost} from '@/utils/constants' |
| | |
| | | const currentPage = ref(''); |
| | | const realwidth = ref(''); |
| | | const realheight = ref(''); |
| | | const allDamagePatternSequence = ref(); |
| | | const disabled = false; |
| | | const size = 'small'; |
| | | const rawData = ref([]); |
| | |
| | | isActive: false |
| | | })); |
| | | } |
| | | // 一键破损所有玻璃 |
| | | const handleAllDamage = async () => { |
| | | if (!allDamagePatternSequence.value) { |
| | | ElMessage.warning(t('workOrder.cway')); // 提示需要选择线路 |
| | | return; |
| | | } |
| | | try { |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | t('order.dilapidationWhether'), |
| | | t('workOrder.prompt'), |
| | | { |
| | | confirmButtonText: t('workOrder.yes'), |
| | | cancelButtonText: t('workOrder.cancel'), |
| | | type: 'warning', |
| | | } |
| | | ); |
| | | // 筛选出state不是8和9的玻璃ID |
| | | const glassIdList = adjustedRects.value |
| | | .filter(rect => rect.state !== 8 && rect.state !== 9) |
| | | .map(rect => rect.glassId); |
| | | if (glassIdList.length === 0) { |
| | | ElMessage.warning(t('order.noGlassToDamage')); // 没有可破损的玻璃 |
| | | return; |
| | | } |
| | | const response = await request.post('/cacheGlass/taskCache/identControlsByPatternSequence', { |
| | | glassIdList: glassIdList, |
| | | state: 8, |
| | | line: allDamagePatternSequence.value, |
| | | workingProcedure: '切割', |
| | | remark: '掰片' |
| | | }); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | // 更新所有玻璃状态 |
| | | glassIdList.forEach(glassId => { |
| | | updateRectStatus(glassId, 8); |
| | | }); |
| | | allDamagePatternSequence.value = ''; |
| | | } else { |
| | | ElMessage.error(response.msg); |
| | | } |
| | | } catch (error) { |
| | | console.error(error); |
| | | ElMessage.error(t('')); |
| | | } |
| | | }; |
| | | // 破损 |
| | | const handleDamage = async () => { |
| | | try { |