zhoushihao
2025-02-26 a8c1dd008f9a096cb01774f17a8bceda5aafed88
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -24,7 +24,7 @@
      @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.state)
      backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.status)
       }"  
    >
     <div  class="centered-text">
@@ -36,11 +36,11 @@
   </div>
      </el-scrollbar>
      <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose">
        <el-button :disabled="currentGlassRect?.state === 8 || currentGlassRect?.state === 9" type="warning"
        <el-button :disabled="currentGlassRect?.status === 8 || currentGlassRect?.status === 9" type="warning"
                   plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;">
          {{ $t('order.dilapidation') }}
        </el-button>
        <el-button :disabled="currentGlassRect?.state === 9 || currentGlassRect?.state === 8" type="danger"
        <el-button :disabled="currentGlassRect?.status === 9 || currentGlassRect?.status === 8" type="danger"
                   plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;">
          <el-icon class="el-icon--right">
            <Upload/>
@@ -95,7 +95,7 @@
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
      glassId: currentGlassId.value,
      line: 4001,
      state: 8,
      status: 8,
      workingProcedure: '钢化',
    })
    if (response.code == 200) {
@@ -117,7 +117,7 @@
  const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
      glassId: currentGlassId.value,
      line: 4001,
      state: 9,
      status: 9,
      workingProcedure: '钢化',
    })
    if (response.code == 200) {
@@ -193,6 +193,8 @@
};
const handleCurrentChange = async(val: number) => {  
  currentPage.value = val;
  console.log(currentPage.value);
    const response = await request.post('/temperingGlass/temperingGlassInfo/selectTemperingGlass', {
      engineerId: engineerId.value,
      temperingLayoutId: currentPage.value
@@ -232,30 +234,33 @@
  }
    }); 
    adjustedRects.value = adjustedRectsData;
       currentPage.value = 1;
    } 
};
function getRectColor(state: number): string {
  switch (state) {
function getRectColor(status: number): string {
  switch (status) {
    case -1:
      return '#CDAF95';
    case 0:
      return '#e1f3d8';
    case 100:
      return '#c8c9cc';
    case 110:
      return '#b3e19d';
    case 120:
      return '#f89898';
      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 '#f3d19e';
      return '#4682B4';
  }
}
// 更新矩形状态  
function updateRectStatus(glassId: string, status: number) {  
  adjustedRects.value.forEach(rect => {  
    if (rect.glassId === glassId) {  
      rect.state = status; // 更新矩形的状态
      rect.status = status; // 更新矩形的状态
    }  
  });  
}