chenlu
2024-03-01 a1a27eba473c476cade23f003d3ac1f1cc1ac27d
报工明细表字段修改
8个文件已修改
167 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWorkDetail.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -23,10 +23,7 @@
      router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}})
      break
    }
    case 'delete': {
      alert('我接收到子组件传送的删除信息')
      break
    }
    case  'setType': {
      alert('我接收到子组件传送的排版状态')
      break
@@ -177,6 +174,7 @@
      }
    })
  } else if (inputVal != null && selectState == 1) {
    //根据订单号查询未排产数据
    request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
      if (res.code == 200) {
@@ -300,6 +298,7 @@
    {field: 'product_name', title: '产品名称', width: 140},
    {field: 'shape', title: '形状', width: 80},
    {field: 'notes', title: '备注', editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
    {field: 'scheduling_id', title: '排产编号',width: 120},
  ],//表头按钮
  toolbarConfig: {
@@ -316,26 +315,28 @@
  },
  data: [],//table body实际数据
  //脚部求和
  footerMethod({columns, data}) {//页脚函数
    let footList = ['数量', '面积', '排产数量', '已排产数量', '已排产面积', '未排产数量', '未排产面积']
    return [
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return '合计:'
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
        }
        return ''
      })
    ]
  }
  // footerMethod({columns, data}) {//页脚函数
  //   let footList = ['数量', '面积', '排产数量', '已排产数量', '已排产面积', '未排产数量', '未排产面积']
  //   return [
  //     columns.map((column, columnIndex) => {
  //       if (columnIndex === 0) {
  //         return '合计:'
  //       }
  //       if (footList.includes(column.field)) {
  //         return sumNum(data, column.field)
  //       }
  //       return ''
  //     })
  //   ]
  // }
})
//删除
const gridEvents = {
  toolbarButtonClick({code}) {
  async toolbarButtonClick({code}) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
@@ -368,7 +369,6 @@
              processes: selectProcesses,//工序
              userName: username//审核人
            })
            console.log(schedulingData.value)
            //保存排产数据
            request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
              if (res.code == 200) {
@@ -376,12 +376,37 @@
                location.reload();
              } else {
                ElMessage.warning(res.msg)
                router.push("/login")
              }
            })
          }
          return;
        }
        case 'delete': {
          const $table = xGrid.value
          const selectRecords = $table.getCheckboxRecords()
          if ($table) {
            if (selectRecords.length == 0) {
              ElMessage.warning("请勾选排产数据")
              return;
            }
            const type = await VXETable.modal.confirm('您确定要删除该数据?')
            if (type === 'confirm') {
              //保存排产数据
              request.post("/productionScheduling/addScheduling").then((res) => {
                if (res.code == 200) {
                  ElMessage.success("保存成功")
                  location.reload();
                } else {
                  ElMessage.warning(res.msg)
                }
              })
            }
          }
        }
@@ -395,7 +420,6 @@
  const $grid = xGrid.value
  const table = $grid.getTableData().fullData
  const selectRecords = $grid.getCheckboxRecords()
  console.log(selectRecords)
  table.forEach((selectRecords) => {
    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity) {
      ElMessage.warning("排产数量不能大于待排产数量")
@@ -406,6 +430,8 @@
  })
}
</script>
@@ -425,9 +451,9 @@
        />
        &nbsp;&nbsp;
        <el-input v-model="form.orderId" placeholder="销售单号" style="width: 110px"></el-input>
        <el-input v-model="form.orderId" placeholder="销售单号" clearable style="width: 110px"></el-input>
        &nbsp;
        <el-select v-model="value" class="m-2" placeholder="工序" style="width: 90px;">
        <el-select v-model="value" class="m-2" placeholder="工序" clearable style="width: 90px;">
          <el-option
              v-for="item in options"
              :key="item.value"
@@ -457,6 +483,7 @@
        ref="xGrid"
        class="mytable-scrollbar"
        max-height="100%"
        height="100%"
        v-bind="gridOptions"
        v-on="gridEvents"
        @filter-change="filterChanged"
@@ -495,6 +522,7 @@
#selectForm {
  width: 70%;
  height: 6%;
  text-align: center;
}
</style>
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
@@ -39,7 +39,7 @@
    }
    //点击查询排版数据
    //点击查询排版数据(带订单号查询)
    @PostMapping  ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}")
    public Result SelectSchedulingNot(
            @PathVariable String selectTime1,
north-glass-erp/src/main/java/com/example/erp/entity/pp/ReportingWorkDetail.java
@@ -51,6 +51,8 @@
    /*返工部分*/
    //返工班组
    private String reworkTeam;
    //待返工数量
    private Integer waitReworkQuantity;
    //返工审核状态
    private Integer reviewerState;
    //返工审核人
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
@@ -25,6 +25,13 @@
    //带时间查询
    public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
        if(orderId.equals("null")){
            orderId="";
        }
        if (processes.equals("null")){
            processes="";
        }
        if (state==2){//已排产
            map.put("data", productionSchedulingMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
@@ -7,6 +7,7 @@
        <result column="processes" property="processes"/>
        <result column="scheduling_quantity" property="schedulingQuantity"/>
        <result column="order_number" property="orderNumber"/>
        <result column="scheduling_id" property="schedulingId"/>
        <!--接收其他外键实体类数据-->
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result column="project" property="project"/>
@@ -47,21 +48,21 @@
               od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
        round(od.width*od.height*od.quantity/1000000,2) as area,
        ps.scheduling_quantity,
        (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
        round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
#         (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
#         round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
        IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
        round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
        IF(ps.review_status=0,"未审核","已审核") as review_status,
        ps.reviewer,
        od.product_name,od.shape
        od.product_name,od.shape,ps.scheduling_id
        from sd.order_detail as od
            left join sd.order as o on od.order_id=o.order_id
            left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where  ps.scheduling_id IS NOT NULL
           and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
          and position(#{processes} in ps.processes)
          and position(#{orderId} in ps.order_id)
    </select>
@@ -72,22 +73,19 @@
        od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
        round(od.width*od.height*od.quantity/1000000,2) as area,
        ps.scheduling_quantity,
        (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
        round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
#         (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
#         round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
        IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
        round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
        IF(ps.review_status=0,"未审核","已审核") as review_status,
        ps.reviewer,
        od.product_name,od.shape
        od.product_name,od.shape,ps.scheduling_id
        from sd.order_detail as od
        left join sd.order as o on od.order_id=o.order_id
        left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where  ps.scheduling_id IS NOT NULL
        and od.order_id regexp #{orderId}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
        where  (ps.scheduling_id IS NOT NULL )
          and position(#{processes} in ps.processes)
          and position(#{orderId} in ps.order_id)
    </select>
<!--    查询未排产数据-->
@@ -101,11 +99,9 @@
        od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
        left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where  isnull(ps.scheduling_id) and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="orderId!=null and orderId!=''">
            and od.order_id regexp #{orderId}
        where   od.quantity-IFNULL(ps.scheduling_quantity,0)>0 and od.create_time between #{selectTime1} and #{selectTime2}
        </if>
          and position(#{orderId} in ps.order_id)
    group by od.order_id,od.order_number
    </select>
<!--    首次查询排产数据-->
@@ -119,7 +115,7 @@
               od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where od.create_time between #{selectTime1} and #{selectTime2}
        where od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0
    </select>
    <select id="selectMaxId">
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -80,7 +80,7 @@
            ogd.child_width,
            ogd.child_height,
            od.shape,
            fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.breakage_quantity-rwd.rework_quantity),0)
            fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0)
                        as quantity
        FROM
            sd.order_detail AS od
@@ -109,7 +109,7 @@
               ogd.child_width,
               ogd.child_height,
               od.shape,
               reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.breakage_quantity-rwd.rework_quantity),0) as quantity
               reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity
        FROM sd.order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number
north-glass-erp/target/classes/mapper/pp/ProductionScheduling.xml
@@ -7,6 +7,7 @@
        <result column="processes" property="processes"/>
        <result column="scheduling_quantity" property="schedulingQuantity"/>
        <result column="order_number" property="orderNumber"/>
        <result column="scheduling_id" property="schedulingId"/>
        <!--接收其他外键实体类数据-->
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result column="project" property="project"/>
@@ -47,21 +48,21 @@
               od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
        round(od.width*od.height*od.quantity/1000000,2) as area,
        ps.scheduling_quantity,
        (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
        round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
#         (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
#         round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
        IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
        round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
        IF(ps.review_status=0,"未审核","已审核") as review_status,
        ps.reviewer,
        od.product_name,od.shape
        od.product_name,od.shape,ps.scheduling_id
        from sd.order_detail as od
            left join sd.order as o on od.order_id=o.order_id
            left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where  ps.scheduling_id IS NOT NULL
           and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
          and position(#{processes} in ps.processes)
          and position(#{orderId} in ps.order_id)
    </select>
@@ -72,22 +73,19 @@
        od.order_id,o.customer_name,o.project,od.order_number,od.width,od.height,od.quantity,
        round(od.width*od.height*od.quantity/1000000,2) as area,
        ps.scheduling_quantity,
        (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
        round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
#         (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity,
#         round(od.width*od.height*(od.quantity-IFNULL(ps.scheduling_quantity,0))/1000000,2) as pendingProductionArea,
        IFNULL(ps.scheduling_quantity,0) as productionScheduledQuantity,
        round(od.width*od.height*(IFNULL(ps.scheduling_quantity,0))/1000000,2) as productionScheduledArea,
        IF(ps.review_status=0,"未审核","已审核") as review_status,
        ps.reviewer,
        od.product_name,od.shape
        od.product_name,od.shape,ps.scheduling_id
        from sd.order_detail as od
        left join sd.order as o on od.order_id=o.order_id
        left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where  ps.scheduling_id IS NOT NULL
        and od.order_id regexp #{orderId}
        <if test="processes!=null and processes!=''">
            and ps.processes regexp #{processes}
        </if>
        where  (ps.scheduling_id IS NOT NULL )
          and position(#{processes} in ps.processes)
          and position(#{orderId} in ps.order_id)
    </select>
<!--    查询未排产数据-->
@@ -101,11 +99,9 @@
        od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
        left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where  isnull(ps.scheduling_id) and od.create_time between #{selectTime1} and #{selectTime2}
        <if test="orderId!=null and orderId!=''">
            and od.order_id regexp #{orderId}
        where   od.quantity-IFNULL(ps.scheduling_quantity,0)>0 and od.create_time between #{selectTime1} and #{selectTime2}
        </if>
          and position(#{orderId} in ps.order_id)
    group by od.order_id,od.order_number
    </select>
<!--    首次查询排产数据-->
@@ -119,7 +115,7 @@
               od.product_name,od.shape
        from sd.order_detail as od left join sd.order as o on od.order_id=o.order_id
                                   left join production_scheduling as ps on ps.order_id=od.order_id and ps.order_number=od.order_number
        where od.create_time between #{selectTime1} and #{selectTime2}
        where od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0
    </select>
    <select id="selectMaxId">
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
@@ -80,7 +80,7 @@
            ogd.child_width,
            ogd.child_height,
            od.shape,
            fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.breakage_quantity-rwd.rework_quantity),0)
            fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0)
                        as quantity
        FROM
            sd.order_detail AS od
@@ -109,7 +109,7 @@
               ogd.child_width,
               ogd.child_height,
               od.shape,
               reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.breakage_quantity-rwd.rework_quantity),0) as quantity
               reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity
        FROM sd.order_detail as od
                 left join sd.order_glass_detail as ogd
                           on od.order_id = ogd.order_id and od.order_number = ogd.order_number