chenlu
2024-09-24 6ce327289aa6b4439f8d6cf7054869b3487107c0
报工修改界面改为可根据补片状态修改未补片数据
4个文件已修改
60 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWorkDetail.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -103,6 +103,10 @@
        titleSelectJson.value = res.data.basic
        layer= res.data.layer
        //添加补片状态列
        let column = {field: 'patchStatusOther', width: 90,title: res.data.title}
        gridOptions.columns.push(column)
        const s01Values = [];
        for (let i = 0; i < res.data.reportingWorkDetails.length; i++) {
          const s01Values = [];
@@ -145,7 +149,6 @@
})
const data = [{id:1,num:2},{id:1,num:3},{id:2,num:2},{id:1,num:2}];
//表尾求和
const sumNum = (list, field) => {
@@ -428,12 +431,12 @@
        }
        case 'update':  {
          //根据补片状态判断是否能修改
          request.post(`/reportingWork/getPatchCondition/${route.query.reportingWorkId}`).then(async (res) => {
            if (res.code == 200) {
              if (res.data > 0) {
                ElMessage.error("该报工包含已补片数据,不可修改!")
                return
              } else {
          // request.post(`/reportingWork/getPatchCondition/${route.query.reportingWorkId}`).then(async (res) => {
          //   if (res.code == 200) {
          //     if (res.data > 0) {
          //       ElMessage.error("该报工包含已补片数据,不可修改!")
          //       return
          //     } else {
                getQuantity()
                const errMap = await $grid.validate(true)
                if (errMap) {
@@ -441,11 +444,11 @@
                  return
                }
                saveReportingWork(0, 'update')
              }
            } else {
              ElMessage.warning(res.msg)
            }
          })
           //   }
          //   } else {
          //     ElMessage.warning(res.msg)
          //   }
          // })
          break
        }
@@ -463,7 +466,9 @@
    const { rows, column, cell } = params; // 解构获取行、列和单元格信息
    //点击次破数量时打开明细界面
    if(column.field=="breakageQuantity"){
      brokenVisible.value = true
      if (row.patchStatusOther!="已补片"){
        brokenVisible.value = true
      }
    }
  },
  menuClick({menu, row, column}) {
@@ -1295,7 +1300,24 @@
    return row?.rowClass
}
const editConfig = reactive({
  trigger: 'click',
  mode: 'cell',
  beforeEditMethod ({ row }) {
    if (row.patchStatusOther === '已补片') {
      return false
    }
    return true
  }
})
const editDisabledEvent = ({ row, column }) => {
  VxeUI.modal.message({
    content: '禁止编辑',
    status: 'error'
  })
  console.log('禁止编辑', column.field, row)
}
</script>
<template>
@@ -1472,6 +1494,8 @@
          v-on="gridEvents"
          @edit-closed="editClosedEvent"
          :cell-class-name="cellClassName"
          :edit-config="editConfig"
          @edit-disabled="editDisabledEvent"
      >
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWorkDetail.java
@@ -69,6 +69,10 @@
    //返工面积
   // private double reworkArea;
    //报工修改用补片状态
    @TableField(select = false,exist= false)
    private String patchStatusOther;
    //次破列表
    @TableField(select = false,exist= false)
    private List<DamageDetails>
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -392,7 +392,7 @@
        //根据报工编号获取层
        map.put("layer", reportingWorkMapper.selectLayerByReportingWorkId(reportingWorkId));
        map.put("numberList", flowCardMapper.getGlassNumber(reportingWorkMapper.selectLayerByReportingWorkId(reportingWorkId),reportingWork.getProcessId()));
        map.put("title", "补片状态");
        return map;
    }
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -424,6 +424,8 @@
            ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 本工序完工和
            if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
            e.other_columns,
        IF(count(pl.id)>0,'已补片','') as patchStatusOther,
            <if test="nextProcess != null and nextProcess != ''">  -- 非最后一道工序
                ifnull(g.completed_quantity,0) as nextQuantitySum,  -- 后工序已完成
                if((f.completed_quantity
@@ -463,6 +465,8 @@
                and d.technology_number = c.technology_number
            left join sd.order_detail as e
                on e.order_id = d.order_id and e.order_number = d.order_number
              left join patch_log as pl on pl.reporting_work_id=b.reporting_work_id
              and pl.order_sort=a.order_number and pl.technology_number=a.technology_number
            left join (select sum(completed_quantity) as completed_quantity ,
                              rw.process_id,