wangfei
2025-02-26 dc41f0ad53d0866c948e8bcb782613aea0015d09
钢化颜色变化显示字段、钢化前大理片笼小片显示
2个文件已修改
325 ■■■■■ 已修改文件
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Slicecage/slicecage.vue 309 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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) {
@@ -236,8 +236,8 @@
    adjustedRects.value = adjustedRectsData;
    } 
};
function getRectColor(state: number): string {
  switch (state) {
function getRectColor(status: number): string {
  switch (status) {
    case -1:
      return '#CDAF95';
    case 0:
@@ -260,7 +260,7 @@
function updateRectStatus(glassId: string, status: number) {  
  adjustedRects.value.forEach(rect => {  
    if (rect.glassId === glassId) {  
      rect.state = status; // 更新矩形的状态
      rect.status = status; // 更新矩形的状态
    }  
  });  
}
UI-Project/src/views/Slicecage/slicecage.vue
@@ -43,13 +43,17 @@
const diaodu = ref('')
const flowCardId = ref('')
const filmsId = ref('')
const adjustedRects = ref([]);
const project = ref([]);
const adjust = ref([]);
const adjusta = ref([]);
const adjustedRects = ref([]);
const adjustedRectsa = ref([]);
const adjustedRectsb = ref([]);
const adjustedRectsc = ref([]);
const subRectsCounts = ref([]);
const subRectsCountsa = ref([]);
const subRectsCountsb = ref([]);
const subRectsCountsc = ref([]);
const currentRow = reactive({}); // 当前行的数据 
const currentPage2 = ref(1)
const inputValuesa = reactive({});
@@ -840,31 +844,168 @@
  ganghua.value = ''
  }
  if(data.bigStorageCageInfos!=null){
    window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length)
  let length = window.localStorage.getItem('length')
  adjustedRects.value = data.bigStorageCageInfos[0][1].map(rect => ({
            ...rect,
            height: 20/length,
            top: 29/length
          }));
adjustedRectsa.value = data.bigStorageCageInfos[0][2].map(rect => ({
            ...rect,
            height: 20/length,
            top: 29/length
          }));
adjustedRectsb.value = data.bigStorageCageInfos[0][3].map(rect => ({
            ...rect,
            height: 20/length,
            top: 29/length
          }));
adjustedRectsc.value = data.bigStorageCageInfos[0][4].map(rect => ({
            ...rect,
            height: 20/length,
            top: 29/length
          }));
  adjustedRects.value = data.bigStorageCageInfos[0][1].map((rect, index) => ({
    id: index + 1,
    height: 20/55,
    top: 53/55,
  }));
subRectsCounts.value = data.bigStorageCageInfos[0][1].map(rect => rect.count);
adjustedRectsa.value = data.bigStorageCageInfos[0][2].map((rect, index) => ({
    id: index + 1,
    height: 20/55,
    top: 53/55,
  }));
subRectsCountsa.value = data.bigStorageCageInfos[0][2].map(rect => rect.count);
adjustedRectsb.value = data.bigStorageCageInfos[0][3].map((rect, index) => ({
    id: index + 1,
    height: 20/55,
    top: 53/55,
  }));
subRectsCountsb.value = data.bigStorageCageInfos[0][3].map(rect => rect.count);
adjustedRectsc.value = data.bigStorageCageInfos[0][4].map((rect, index) => ({
    id: index + 1,
    height: 20/55,
    top: 53/55,
  }));
subRectsCountsc.value = data.bigStorageCageInfos[0][4].map(rect => rect.count);
  }else{
    adjustedRects.value = ''
    adjustedRects.value = '',
    adjustedRectsa.value = '',
    adjustedRectsb.value = '',
    adjustedRectsc.value = ''
  }
};
// 计算每个大矩形的样式
const rectStyle = (rect, index) => ({
  position: 'absolute',
  width: '170px',
  left: '0px',
  top: `${index*rect.top}px`,
  height: `${rect.height}px`,
});
// 计算每个小矩形的样式和数量
const getSubRects = (rectIndex) => {
  const count = subRectsCounts.value[rectIndex];
  const subRects = [];
  for (let i = 0; i < count; i++) {
    subRects.push({});
  }
  return subRects;
};
// 计算每个小矩形的样式
const subRectStyle = (rectIndex, subIndex) => {
  const width = '18px';
  const marginLeft = '8px';
  const totalWidth = 6 * (parseInt(width) + parseInt(marginLeft));
  const left = `${(subIndex * (parseInt(width) + parseInt(marginLeft))) / totalWidth * 100}%`;
  return {
    position: 'absolute',
    width,
    height: '100%',
    marginLeft,
    top: '0px',
    backgroundColor: '#911005',
    left,
  };
};
// 计算每个大矩形的样式
const rectStylea = (rect, index) => ({
  position: 'absolute',
  width: '170px',
  left: '0px',
  top: `${index*rect.top}px`,
  height: `${rect.height}px`,
});
// 计算每个小矩形的样式和数量
const getSubRectsa = (rectIndex) => {
  const count = subRectsCountsa.value[rectIndex];
  const subRects = [];
  for (let i = 0; i < count; i++) {
    subRects.push({});
  }
  return subRects;
};
// 计算每个小矩形的样式
const subRectStylea = (rectIndex, subIndex) => {
  const width = '18px';
  const marginLeft = '8px';
  const totalWidth = 6 * (parseInt(width) + parseInt(marginLeft));
  const left = `${(subIndex * (parseInt(width) + parseInt(marginLeft))) / totalWidth * 100}%`;
  return {
    position: 'absolute',
    width,
    height: '100%',
    marginLeft,
    top: '0px',
    backgroundColor: '#911005',
    left,
  };
};
// 计算每个大矩形的样式
const rectStyleb = (rect, index) => ({
  position: 'absolute',
  width: '170px',
  left: '0px',
  top: `${index*rect.top}px`,
  height: `${rect.height}px`,
});
// 计算每个小矩形的样式和数量
const getSubRectsb = (rectIndex) => {
  const count = subRectsCountsb.value[rectIndex];
  const subRects = [];
  for (let i = 0; i < count; i++) {
    subRects.push({});
  }
  return subRects;
};
// 计算每个小矩形的样式
const subRectStyleb = (rectIndex, subIndex) => {
  const width = '18px';
  const marginLeft = '8px';
  const totalWidth = 6 * (parseInt(width) + parseInt(marginLeft));
  const left = `${(subIndex * (parseInt(width) + parseInt(marginLeft))) / totalWidth * 100}%`;
  return {
    position: 'absolute',
    width,
    height: '100%',
    marginLeft,
    top: '0px',
    backgroundColor: '#911005',
    left,
  };
};
// 计算每个大矩形的样式
const rectStylec = (rect, index) => ({
  position: 'absolute',
  width: '170px',
  left: '0px',
  top: `${index*rect.top}px`,
  height: `${rect.height}px`,
});
// 计算每个小矩形的样式和数量
const getSubRectsc = (rectIndex) => {
  const count = subRectsCountsc.value[rectIndex];
  const subRects = [];
  for (let i = 0; i < count; i++) {
    subRects.push({});
  }
  return subRects;
};
// 计算每个小矩形的样式
const subRectStylec = (rectIndex, subIndex) => {
  const width = '18px';
  const marginLeft = '8px';
  const totalWidth = 6 * (parseInt(width) + parseInt(marginLeft));
  const left = `${(subIndex * (parseInt(width) + parseInt(marginLeft))) / totalWidth * 100}%`;
  return {
    position: 'absolute',
    width,
    height: '100%',
    marginLeft,
    top: '0px',
    backgroundColor: '#911005',
    left,
  };
};
onMounted(() => {
  socket = initializeWebSocket(socketUrl, handleMessage);
@@ -1027,111 +1168,39 @@
    </div>
    <div style="position: relative;">
    <div v-show="cell1" style="width: 170px;height: 53px;position: relative;top:63px;left: 585px;">
      <div
      v-for="(rect, index) in adjustedRects"
      :key="rect"
      :style="{
       position: 'absolute',
       width: '200px',
       left: '0px',
       top: index*rect.top+`px`,
       height: `${rect.height}px`,
       }"
    >
    <div
      v-for="(rects, index) in rect.bigStorageCageDetails"
      :key="rects"
      :style="{
        float:'left',
       width: '18px',
       height: `${rect.height}px`,
       backgroundColor: '#911005',
       top: '0px',
       marginRight: rects.gap/5000*227+'px'
       }"
    >
      </div>
      <div v-for="(rect, rectIndex) in adjustedRects" :key="rect.id" :style="rectStyle(rect, rectIndex)">
    <div
      v-for="(subRect, subIndex) in getSubRects(rectIndex)"
      :key="subIndex"
      :style="subRectStyle(rectIndex, subIndex)"
    ></div>
    </div>
    </div>
 <div v-show="cell2" style="width: 170px;height: 53px;position: relative;top:67px;left: 585px;">
  <div
      v-for="(rect, index) in adjustedRectsa"
      :key="rect.id"
      :style="{
       position: 'absolute',
       width: '227px',
       left: '0px',
       top: index*rect.top+`px`,
       height: `${rect.height}px`,
       }"
    >
    <div
      v-for="(rects, index) in rect.bigStorageCageDetails"
      :key="rects"
      :style="{
        float:'left',
       width: '18px',
       height: `${rect.height}px`,
       backgroundColor: '#911005',
       top: '0px',
       marginRight: rects.gap/5000*227+'px'
       }"
    >
      </div>
    <div v-for="(rect, rectIndex) in adjustedRectsa" :key="rect.id" :style="rectStylea(rect, rectIndex)">
    <div
      v-for="(subRect, subIndex) in getSubRectsa(rectIndex)"
      :key="subIndex"
      :style="subRectStylea(rectIndex, subIndex)"
    ></div>
    </div>
    </div>
  <div v-show="cell3" style="width: 170px;height: 53px;position: relative;top:72px;left: 585px;">
    <div
      v-for="(rect, index) in adjustedRectsb"
      :key="rect.id"
      :style="{
       position: 'absolute',
       width: '227px',
       left: '0px',
       top: index*rect.top+`px`,
       height: `${rect.height}px`,
       }"
    >
    <div
      v-for="(rects, index) in rect.bigStorageCageDetails"
      :key="rects"
      :style="{
        float:'left',
       width: '18px',
       height: `${rect.height}px`,
       backgroundColor: '#911005',
       top: '0px',
       marginRight: rects.gap/5000*227+'px'
       }"
    >
      </div>
    <div v-for="(rect, rectIndex) in adjustedRectsb" :key="rect.id" :style="rectStyleb(rect, rectIndex)">
    <div
      v-for="(subRect, subIndex) in getSubRectsb(rectIndex)"
      :key="subIndex"
      :style="subRectStyleb(rectIndex, subIndex)"
    ></div>
    </div>
    </div>
  <div v-show="cell4" style="width: 170px;height: 53px;position: relative;top:77px;left: 585px;">
    <div
      v-for="(rect, index) in adjustedRectsc"
      :key="rect.id"
      :style="{
       position: 'absolute',
       width: '227px',
       left: '0px',
       top: index*rect.top+`px`,
       height: `${rect.height}px`,
       }"
    >
    <div
      v-for="(rects, index) in rect.bigStorageCageDetails"
      :key="rects"
      :style="{
        float:'left',
       width: '18px',
       height: `${rect.height}px`,
       backgroundColor: '#911005',
       top: '0px',
       marginRight: rects.gap/5000*227+'px'
       }"
    >
      </div>
    <div v-for="(rect, rectIndex) in adjustedRectsc" :key="rect.id" :style="rectStylec(rect, rectIndex)">
    <div
      v-for="(subRect, subIndex) in getSubRectsc(rectIndex)"
      :key="subIndex"
      :style="subRectStylec(rectIndex, subIndex)"
    ></div>
    </div>
    </div>
</div>