廖井涛
2025-04-10 9425caa266245d82e7442f93cd47c5e263be2242
north-glass-erp/northglass-erp/src/views/pp/report/TeamOutput.vue
@@ -101,6 +101,9 @@
    produceList = produceList.value.concat(deepClone(res.data.data))
    titleSelectJson.value.processType = res.data.process
    titleSelectJson.value.processType.unshift(newItem.value)
    produceList.forEach(item => {
      item.mmTotal = sumMmValues(item.workProcessName);
    });
    xGrid.value.reloadData(produceList)
    gridOptions.loading = false
  } else {
@@ -122,6 +125,9 @@
      total.value = res.data.footSum
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
        item.mmTotal = sumMmValues(item.workProcessName);
      });
      xGrid.value.reloadData(produceList)
    } else {
      ElMessage.warning(res.msg)
@@ -146,14 +152,29 @@
      total.dataTotal = res.data.total.total * 1
      total.pageTotal = res.data.total.pageTotal
      pageTotal.value = res.data.total
      xGrid.value.loadData(res.data.data)
      produceList = res.data.data
      produceList.forEach(item => {
        item.mmTotal = sumMmValues(item.workProcessName);
      });
      console.log(produceList)
      xGrid.value.loadData(produceList)
      gridOptions.loading = false
    } else {
      ElMessage.warning(res.msg)
    }
  })
}
 const sumMmValues = (workProcessName) => {
  if (!workProcessName) return 0;
  return workProcessName
      .split('+') // 拆分每个部分
      .map(part => {
        const match = part.match(/^(\d+)(?=mm)/); // 提取 mm 前面的数字
        return match ? parseInt(match[1], 10) : 0;
      })
      .reduce((sum, num) => sum + num, 0); // 求和
}
//页脚跳转
const handlePageChange = ({currentPage, pageSize}) => {
  pageNum.value = currentPage
@@ -198,6 +219,9 @@
      pageNum.value=1
      total.value = res.data.footSum
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
        item.mmTotal = sumMmValues(item.workProcessName);
      });
      xGrid.value.reloadData(produceList)
      gridOptions.loading=false
    } else {
@@ -269,6 +293,7 @@
    {field: 'code', width: 100, title: t('reportingWorks.glassNumber')},
    {field: 'width', width: 90, title: t('order.width')},
    {field: 'height', width: 90, title: t('order.height')},
    {field: 'mmTotal', width: 90, title: t('order.totalThickness')},
    {field: 'workProcessName', width: 120, title: t('report.workProcessName')},
    {field: 'edgingType', width: 110, title: t('order.edgingType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'completedQuantity', width: 90, title: t('reportingWorks.completedQuantity')},