huang
2025-05-12 cf9e6eb7bfe620184ada5594dabb2734b34bb7cb
添加 比对数据,不同变红警告
1个文件已修改
72 ■■■■ 已修改文件
UI-Project/src/views/Returns/upreturns3.vue 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Returns/upreturns3.vue
@@ -36,7 +36,7 @@
})
request.post("/loadGlass/up-patten-usage/setUpPattenRequest", {
  state: null,
  stationCell: 6
  stationCell: 5
}).then((response) => {
  if (response.code == 200) {
  } else {
@@ -182,7 +182,7 @@
// const handlesure = async () => {
//   try {
//     const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', {
//       stationCell: 6,
//       stationCell: 5,
//       engineerId: selectedProjectNo.value,
//       filmRemove: parseInt(filmRemove.value, 10),
//     })
@@ -287,7 +287,7 @@
    let engineeringId = window.localStorage.getItem('engineeringIda')
    if (engineeringId !== '') {
      const response = await request.post('/loadGlass/engineering/engineering/pause', {
        stationCell: 6,
        stationCell: 5,
        filmRemove: filmRemove,
        engineerId: engineeringId,
        state: 0,
@@ -318,7 +318,7 @@
  }
  const response = await request.post("/loadGlass/up-patten-usage/setUpPattenRequest", {
    state: selectValuesa[0],
    stationCell: 6
    stationCell: 5
  })
  if (response.code === 200) {
    tableData.value = response.data;
@@ -448,18 +448,55 @@
  }
};
// 架子数据对比
// 架子数据对比 (每一行都进行比对,不同都显示红色)
// const tableRowClassName = ({
//   row,
//   rowIndex: number
// }) => {
//   // 获取第一条数据
//   const firstData = tableData.value[0];
//   // 如果第一条数据存在且状态不是100
//   if (firstData && firstData.state !== 100) {
//     // 获取当前行与第一条数据
//     const previousRow = tableDataa.value.slice(0, rowIndex).reverse().find(item =>
//       item && item.patternWidth && item.patternHeight && item.patternThickness && item.filmsId
//     );
//     // 如果当前行有数据,进行比对
//     if (row && row.patternWidth) {
//       const isMatch =
//         row.patternWidth === firstData.width &&
//         row.patternHeight === firstData.height &&
//         row.patternThickness === firstData.thickness &&
//         row.filmsId === firstData.filmsId;
//       return !isMatch ? 'danger-row' : '';
//     }
//   }
//   return '';
// }
// 架子数据对比 (料架1第一行有数据,进行比对,料架2第一行没有数据,进行比对)
const tableRowClassName = ({
  row,
  rowIndex
}: {
  row: any;
  rowIndex: number
  rowIndex: number;
}) => {
  // 直接获取第一条数据,然后判断状态
  // 获取第一条数据
  const firstData = tableData.value[0];
  
  // 如果第一条数据存在且状态不是100,进行比对
  if (firstData && firstData.state !== 100 && row && row.patternWidth) {
  // 如果第一条数据存在且状态不是100
  if (firstData && firstData.state !== 100) {
    // 料架1
    if (rowIndex === 0) {
      // 料架1第一行有数据,进行比对
      if (row && row.patternWidth) {
    const isMatch = 
      row.patternWidth === firstData.width &&
      row.patternHeight === firstData.height &&
@@ -468,6 +505,23 @@
    
    return !isMatch ? 'danger-row' : '';
  }
    }
    // 料架2
    else if (rowIndex === 1) {
      const firstRow = tableDataa.value[0];
      if (!firstRow || !firstRow.patternWidth) {
        if (row && row.patternWidth) {
          const isMatch =
            row.patternWidth === firstData.width &&
            row.patternHeight === firstData.height &&
            row.patternThickness === firstData.thickness &&
            row.filmsId === firstData.filmsId;
          return !isMatch ? 'danger-row' : '';
        }
      }
    }
  }
  
  return '';
}