ZengTao
2025-09-11 924ce82faeec6d896fcdc360b279215e84b69fb9
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -29,6 +29,7 @@
const cantakea = ref(true);
const cantakeb = ref(true);
const canona = ref(true);
const canons = ref(true);
const cantakeall = ref(true);
const canonb = ref(true);
const canSelectProjectb = ref(true);
@@ -42,6 +43,7 @@
const engineerId = ref('')
const router = useRouter()
const currentGlassId = ref(null);
const currentstartSlot = ref(null);
const currentengineerId = ref(null);
const currenttemperingLayoutId = ref(null);
const currenttemperingFeedSequence = ref(null);
@@ -85,8 +87,8 @@
    const existingRects = adjustedRects2.value.filter(rect => newGlassIds.has(rect.glassId));  
    // 计算新的矩形  
    const newRects = data.intoGlass2[0].map(rect => {  
      const scaleFactor =  845/5000;
      const scaleFactorY =  430/2750;
      const scaleFactor =  800/5000;
      const scaleFactorY =  407/2750;
        let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;
        let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -137,8 +139,8 @@
    const newGlassIds = new Set(data.intoGlass1[0].map(rect => rect.glassId));
    const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId));
    const newRects = data.intoGlass1[0].map(rect => {
      const scaleFactor =  845/5000;
      const scaleFactorY =  430/2750;
      const scaleFactor =  800/5000;
      const scaleFactorY =  407/2750;
      // const scaleFactor =  600/5087;
      // const scaleFactorY =  200/2800;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;
@@ -191,8 +193,8 @@
    const newGlassIds = new Set(data.intoGlass3[0].map(rect => rect.glassId));
    const existingRects = adjustedRects3.value.filter(rect => newGlassIds.has(rect.glassId));
    const newRects = data.intoGlass3[0].map(rect => {
      const scaleFactor =  845/5000;
      const scaleFactorY =  430/2750;
      const scaleFactor =  800/5000;
      const scaleFactorY =  407/2750;
      let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;
      let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -245,8 +247,8 @@
    const existingRects = adjustedRects4.value.filter(rect => newGlassIds.has(rect.glassId));  
    // 计算新的矩形  
    const newRects = data.intoGlass4[0].map(rect => { 
      const scaleFactor =  845/5000;
      const scaleFactorY =  430/2750;
      const scaleFactor =  800/5000;
      const scaleFactorY =  407/2750;
        let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;
        let newX = rect.yCoordinate; 
      if (rect.width < rect.height) {
@@ -613,6 +615,7 @@
    adjustedRects1.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currentstartSlot.value = rect.slot;
  currentengineerId.value = rect.engineerId;  
  currenttemperingLayoutId.value = rect.temperingLayoutId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
@@ -640,6 +643,7 @@
    adjustedRects3.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currentstartSlot.value = rect.slot;
  currentengineerId.value = rect.engineerId;  
  currenttemperingLayoutId.value = rect.temperingLayoutId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
@@ -667,6 +671,7 @@
    adjustedRects2.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currentstartSlot.value = rect.slot;
  currentengineerId.value = rect.engineerId;  
  currenttemperingLayoutId.value = rect.temperingLayoutId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
@@ -694,6 +699,7 @@
    adjustedRects4.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currentstartSlot.value = rect.slot;
  currentengineerId.value = rect.engineerId;  
  currenttemperingLayoutId.value = rect.temperingLayoutId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
@@ -721,6 +727,7 @@
    adjustedRectsa.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;  
  currentstartSlot.value = rect.slot;
  currentengineerId.value = rect.engineerId;  
  currenttemperingLayoutId.value = rect.temperingLayoutId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
@@ -738,9 +745,15 @@
  } 
  if (currentRect.value.state == 1) {
    canona.value = false;
  } else if (currentRect.value.state == 0) {
  } else if (currentRect.value.state == 0||currentRect.value.state == -1) {
    canona.value = true;
  } 
  if (currentRect.value.state == 1) {
    canons.value = false;
  } else if (currentRect.value.state == -1) {
    canons.value = true;
  }
  if (currentRect.value.state > 5) {
    cantakeall.value = false;
  } else{
@@ -752,7 +765,8 @@
  if (index !== -1) {  
    adjustedRectsb.value[index].isActive = true;  
  }  
  currentGlassId.value = rect.glassId;
  currentGlassId.value = rect.glassId;
  currentstartSlot.value = rect.slot;
  currentengineerId.value = rect.engineerId;  
  currenttemperingLayoutId.value = rect.temperingLayoutId;  
  currenttemperingFeedSequence.value = rect.temperingFeedSequence;  
@@ -949,6 +963,26 @@
    console.error(error);
  }
}
// 钢化炉
const handleal11 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 2,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blinda.value = false;
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
// 进炉前人工拿走
const takeouta = async () => {
  try  {
@@ -960,6 +994,28 @@
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blinda.value = false;
      updateoutColorsa();
    } else {
      // 请求失败,显示错误消息
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
// 进炉前出片
const outTask = async (line) => {
  try  {
  const response = await request.post('/cacheVerticalGlass/bigStorageCageOutTask/temperingOut', {
    glassId: currentGlassId.value,
    endSlot: line,
    startSlot: currentstartSlot.value,
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      blinda.value = false;
      updateoutColorsa();
    } else {
@@ -1014,12 +1070,50 @@
    console.error(error);
  }
}
const handleall1 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 3,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blind1.value = false;
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handletakeall33 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 9,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blind3.value = false;
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handleall3 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 3,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
@@ -1052,6 +1146,25 @@
    console.error(error);
  }
}
const handleall2 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 3,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blind2.value = false;
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handletakeall44 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
@@ -1071,12 +1184,51 @@
    console.error(error);
  }
}
const handleall4 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 3,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blind4.value = false;
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
const handletakeall4 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 9,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
      blind4.value = false;
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
// 出片
const handleall14 = async () => {
  try  {
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingStateAll', {
    temperingLayoutId: currenttemperingLayoutId.value,
    engineerId: currentengineerId.value,
    state: 4,
    })
    if (response.code == 200) {
      ElMessage.success('成功!');
@@ -1279,11 +1431,11 @@
        <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 1000px;"
                 v-loading="loading">
                 
   <div style="width: 845px;float: right;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
   <div style="width: 800px;float: right;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
     <div v-if="adjustedRects3.length > 0">
       <!-- <div style="text-align: center;">炉号3:{{ engineerIdDisplay }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
       <div style="text-align: center;"> {{ $t('processCard.temperinglayout') }}:{{ adjustedRects3[0].engineerId }}-{{ adjustedRects3[0].temperingLayoutId }} </div>
    <el-scrollbar height="430px" style="background-color: #e9e9eb;">
    <el-scrollbar height="417px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRects3"
@@ -1306,11 +1458,11 @@
   </el-scrollbar>
   </div>
          </div>
        <div style="width: 845px;float: left;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
        <div style="width: 800px;float: left;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
    <div v-if="adjustedRects4.length > 0">
    <div style="text-align: center;"> {{ $t('processCard.temperinglayout') }}:{{ adjustedRects4[0].engineerId }}-{{ adjustedRects4[0].temperingLayoutId }} </div>
    <!-- <div style="text-align: center;">炉号4:{{ engineerIdDisplay2 }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
    <el-scrollbar height="430px" style="background-color: #e9e9eb;">
    <el-scrollbar height="417px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRects4"
@@ -1333,11 +1485,11 @@
   </el-scrollbar>
   </div>
        </div>
 <div style="width: 845px;float: right;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
 <div style="width: 800px;float: right;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
   <div v-if="adjustedRects1.length > 0">
              <!-- <div style="text-align: center;">炉号1:{{ engineerIdDisplay }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
     <div style="text-align: center;"> {{ $t('processCard.temperinglayout') }}:{{ adjustedRects1[0].engineerId }}-{{ adjustedRects1[0].temperingLayoutId }} </div>
    <el-scrollbar height="430px" style="background-color: #e9e9eb;">
    <el-scrollbar height="417px" style="background-color: #e9e9eb;">
    <div  style="position: relative;">  
      <div  
      v-for="(rect, index) in adjustedRects1"
@@ -1360,11 +1512,11 @@
   </el-scrollbar>
   </div>
    </div>
     <div style="width: 845px;float: left;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
     <div style="width: 800px;float: left;background-color: #f4f4f5;height: 430px;margin-top: 20px;">
    <div v-if="adjustedRects2.length > 0">
    <div style="text-align: center;"> {{ $t('processCard.temperinglayout') }}:{{ adjustedRects2[0].engineerId }}-{{ adjustedRects2[0].temperingLayoutId }} </div>
    <!-- <div style="text-align: center;">炉号2:{{ engineerIdDisplay2 }}-{{ adjustedRects[0].temperingLayoutId }}</div>   -->
    <el-scrollbar height="430px" style="background-color: #e9e9eb;">
    <el-scrollbar height="417px" style="background-color: #e9e9eb;">
    <div  style="position: relative;max-width: 1400px;">  
      <div  
      v-for="(rect, index) in adjustedRects2"
@@ -1484,6 +1636,9 @@
        <el-button type="info" plain @click="handletakeall1" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeall') }}
        </el-button>
        <el-button type="info" plain @click="handleall1" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('processCard.outfurnace') }}
        </el-button>
  </el-dialog>  
<el-dialog v-model="blind2" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose2">
        <el-button :disabled="!canSelectProject2" type="warning" plain :icon="Delete" @click="handleDamage2"  style="width: 150px;margin-left: 10px;">
@@ -1495,6 +1650,9 @@
        </el-button>
        <el-button type="info" plain @click="handletakeall2" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeall') }}
        </el-button>
        <el-button type="info" plain @click="handleall2" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('processCard.outfurnace') }}
        </el-button>
  </el-dialog>  
<el-dialog v-model="blind3" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose3">
@@ -1508,6 +1666,9 @@
        <el-button type="info" plain @click="handletakeall33" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeall') }}
        </el-button>
        <el-button type="info" plain @click="handleall3" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('processCard.outfurnace') }}
        </el-button>
  </el-dialog>  
<el-dialog v-model="blind4" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose4">
        <el-button :disabled="!canSelectProject4" type="warning" plain :icon="Delete" @click="handleDamage4"  style="width: 150px;margin-left: 10px;">
@@ -1519,6 +1680,9 @@
        </el-button>
        <el-button type="info" plain @click="handletakeall44" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeall') }}
        </el-button>
        <el-button type="info" plain @click="handleall4" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('processCard.outfurnace') }}
        </el-button>
  </el-dialog>  
  <!-- 进炉前 -->
@@ -1536,6 +1700,15 @@
        <el-button type="info" plain @click="handletakeall3" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeall') }}
        </el-button>
        <el-button type="info" plain @click="handleal11" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('processCard.intofurnace') }}
        </el-button>
        <el-button type="success" plain :icon="Edit" @click="outTask(3002)" :disabled="!canons" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('searchOrder.specifyout') }}
        </el-button>
        <el-button type="success" plain :icon="Edit" @click="outTask(3001)" :disabled="!canons" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('searchOrder.outfilm') }}
        </el-button>
  </el-dialog>  
  <!-- 已出炉 -->
<el-dialog v-model="blindb" top="30vh" width="15%" style="text-align: center;" @close="handleDialogCloseb">
@@ -1549,6 +1722,10 @@
        <el-button type="info" plain @click="handletakeall4" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeall') }}
        </el-button>
        <el-button type="info" plain @click="handleall14" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('searchOrder.outfilm') }}
        </el-button>
        <!-- <el-button type="success" plain :icon="Edit" @click="takeonb" :disabled="!canonb" style="width: 150px;margin-left: 10px;margin-top: 10px;">
          {{ $t('order.takeon') }}
        </el-button> -->