廖井涛
2025-09-26 dd3b22bca22373c77843d5ecb96eaa7e7a382461
Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
10个文件已修改
199 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/bom/MaterialBOM.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/bom/OrderBOM.vue 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BomDataMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/BomDataService.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js
@@ -12,6 +12,7 @@
        reportFormDate:ref(["",""]),
        workOrderDate:ref(["",""]),
        reportingWorkDate:ref(["",""]),
        qualityInspectionDate:ref(["",""]),
        searchOrderListFilter:ref([]),//订单首页筛选]
        searchOrderFilter:{
            list:ref([]),
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue
@@ -9,11 +9,13 @@
import { useI18n } from 'vue-i18n'
import useUserInfoStore from "@/stores/userInfo";
import footSum from "@/hook/footSum"
import useOrderInfoStore from "@/stores/sd/order/orderInfo";
//语言获取
const { t } = useI18n()
let router=useRouter()
const userStore = useUserInfoStore()
const username = userStore.user.userName
const orderInfo = useOrderInfoStore()
const getTableRow = (row,type) =>{
  switch (type) {
    case 'edit' :{
@@ -132,11 +134,12 @@
}
//第一次加载数据
request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => {
request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => {
  if (res.code == 200) {
    total.dataTotal = res.data.total.total*1
    total.pageTotal= res.data.total.pageTotal
    orderInfo.qualityInspectionDate = res.data.selectDate
    pageTotal.value = res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
@@ -150,9 +153,9 @@
const selectPageList = ()=>{
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => {
  request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`,filterData.value).then((res) => {
    if(res.code==200){
      orderInfo.qualityInspectionDate = res.data.selectDate
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
    }else{
@@ -170,10 +173,11 @@
  if (inputVal == '') {
    inputVal = null
  }
  request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => {
  request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
      orderInfo.qualityInspectionDate = res.data.selectDate
      pageTotal.value = res.data.total
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
@@ -232,10 +236,11 @@
    inputVal = null
  }
  request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => {
  request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total*1
      total.pageTotal=parseInt(res.data.total)
      orderInfo.qualityInspectionDate = res.data.selectDate
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.reloadData(produceList)
@@ -343,7 +348,7 @@
  <div  style="width: 100%;height: 100%">
    <div class="head">
        <el-date-picker
            v-model="form.date1"
            v-model="orderInfo.qualityInspectionDate"
            type="daterange"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
north-glass-erp/northglass-erp/src/views/sd/bom/MaterialBOM.vue
@@ -28,6 +28,7 @@
  type: '',
  consume: '',
  price: '',
  unit:'',
})
const validatePass = (rule, value, callback) => {
@@ -80,6 +81,7 @@
    case 'edit' :{
      ruleForm.MaterialId=row.id
      ruleForm.MaterialName=row.name
      ruleForm.unit=row.unit
      dialogTableVisible.value = true
      return
    }
north-glass-erp/northglass-erp/src/views/sd/bom/OrderBOM.vue
@@ -48,6 +48,10 @@
let orderBomData =ref({
  productName:[]
})
let bomSum = ref({
  sumData:[],
  sumDatilsData:[]
})
let orderBomDetails = ref(null)
@@ -482,15 +486,8 @@
        request.post(`/BomData/getOrderBomData/${row.orderId}`,).then((res) => {
          if (res.code == 200 ) {
            orderBomData.value.productName =res.data.data
            // orderBomData.value.productName = orderBomData.value.productName.map(item => {
            //   const parts = item.product_name.split(/[*+]/)
            //   parts.push("其它")
            //   return {
            //     ...item,
            //     product_parts: parts
            //   }
            // })
            bomSum.value.sumData = res.data.sumData
            bomSum.value.sumDatilsData  =res.data.sumDataDatils
            request.post(`/BomData/getBomDataProduct`,orderBomData.value).then((res) => {
              if (res.code == 200 ) {
                orderBomDetails.value=res.data.data
@@ -516,7 +513,6 @@
                dialogTableVisible.value = true
              }
            })
            console.log(orderBomData.value.productName)
          }
        })
@@ -585,6 +581,10 @@
  }
}
//总价
const totalPrice = computed(() => {
  return bomSum.value.sumDatilsData.reduce((sum, d) => sum + d.materialPrice, 0)
})
</script>
<template>
@@ -703,39 +703,34 @@
        :close-on-click-modal="false"
        :close-on-press-escape="false"
    >
      <el-card style="max-width: 480px;margin-left: 45px">
      <el-card style="max-width: 480px;margin-left: 45px;margin-top: 20px">
        <!-- header -->
        <template #header>
          <div class="card-header">
            <span style="font-weight: bold">成品合计</span>
            &nbsp &nbsp &nbsp
            <span>面积:1312.48㎡</span>
            &nbsp &nbsp &nbsp
            <span>数量:200</span>
            &nbsp &nbsp &nbsp
            <span>周长:5325.7m</span>
            &nbsp;&nbsp;&nbsp;
            <span>面积:{{ bomSum.sumData[0].area }}㎡</span>
            &nbsp;&nbsp;&nbsp;
            <span>数量:{{ bomSum.sumData[0].quantity }}</span>
            &nbsp;&nbsp;&nbsp;
            <span>周长:{{ bomSum.sumData[0].perimeter }}m</span>
          </div>
        </template>
        <el-row >
          <el-col :span="8">6mm超白:</el-col>
          <el-col :span="8">3149.72㎡</el-col>
        <!-- body -->
        <el-row
            v-for="(mat, idx) in bomSum.sumDatilsData"
            :key="idx"
            style="text-align: left; margin-bottom: 6px"
        >
          <el-col :span="8">{{ mat.material }}:</el-col>
          <el-col :span="8">{{ mat.consume }}㎡</el-col>
        </el-row>
        <el-row>
          <el-col :span="8">8mm超白:</el-col>
          <el-col :span="8">787.72㎡</el-col>
        </el-row>
        <el-row>
          <el-col :span="8">铝框:</el-col>
          <el-col :span="8">2662.85m</el-col>
        </el-row>
        <el-row>
          <el-col :span="8">0.76PVB:</el-col>
          <el-col :span="8">1706.22㎡</el-col>
        </el-row>
        <el-row>
          <el-col :span="8">其他:</el-col>
          <el-col :span="8">5</el-col>
        </el-row>
        <template #footer>合计xxx元</template>
        <!-- footer -->
        <template #footer>
          合计 ¥{{ totalPrice }}
        </template>
      </el-card>
      <el-card
@@ -757,13 +752,20 @@
        </template>
        <!-- body -->
        <el-row v-for="(part, index) in item.product_parts" :key="index" style="text-align: left">
          <el-col :span="8">{{ part.name }}:</el-col>
          <el-col :span="16">
            <div v-for="(d, j) in part.details" :key="j">
              {{ d.material }}  &nbsp; ¥{{ d.materialPric}}
            </div>
            <hr>
        <el-row
            v-for="(part, index) in item.product_parts"
            :key="index"
            style="text-align: left; margin-bottom: 6px"
        >
          <el-col :span="24">
              <el-row v-for="(d, j) in part.details"
                      :key="j"
                      style="text-align: left">
              <el-col :span="8">{{ d.material }}</el-col>
              <el-col :span="8">{{ d.consume }}{{d.unit}}</el-col>
              </el-row>
<!--            <hr v-if="part.details.length > 0" />-->
          </el-col>
        </el-row>
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
@@ -101,16 +101,15 @@
    @ApiOperation("质检审核查询接口")
    @SaCheckPermission("qualityInspectionReview.search")
    @PostMapping  ("/selectQualityTesting/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{state}/{processId}")
    @PostMapping  ("/selectQualityTesting/{pageNum}/{pageSize}/{selectDate}/{state}/{processId}")
    public Result selectQualityTesting(
            @PathVariable Integer pageNum,
            @PathVariable Integer pageSize,
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable List<String> selectDate,
            @PathVariable Integer state,
            @PathVariable String processId,
            @RequestBody ReportingWork reportingWork){
        return Result.seccess(reportingWorkService.selectQualityTestingSv(pageNum,pageSize,selectTime1,selectTime2,state,processId,reportingWork));
        return Result.seccess(reportingWorkService.selectQualityTestingSv(pageNum,pageSize,selectDate,state,processId,reportingWork));
    }
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
@@ -67,9 +67,9 @@
    List<ReportingWork> selectReportingWorkMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderId, ReportingWork reportingWork);
    List<ReportingWork> selectQualityTestingMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, Integer state, String processId, ReportingWork reportingWork);
    List<ReportingWork> selectQualityTestingMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, Integer state, String processId, ReportingWork reportingWork);
    Map<String, Integer> getQualityPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, Integer state, String processId, ReportingWork reportingWork);
    Map<String, Integer> getQualityPageTotal(Integer offset, Integer pageSize, String selectTime1, String selectTime2, Integer state, String processId, ReportingWork reportingWork);
    Boolean updateQualityStatusMp(String reportingWorkId,String username);
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BomDataMapper.java
@@ -11,15 +11,19 @@
public interface BomDataMapper extends BaseMapper<BasicData> {
    Boolean saveMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type);
    Boolean saveMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type, String unit);
    Integer getMaterialId(Integer id);
    Boolean updateMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type);
    Boolean updateMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type, String unit);
    Boolean saveProductBOMMp(Object produceId, Object tabId, Object layer);
    List<Map<String, String>> getOrderBomDataMp(String orderId);
    List<Map<String, String>> getBOMDetails(Integer productId);
    List<Map<String, String>> getOrderBomSumDataMp(String orderId);
    List<Map<String, String>> getOrderBomsumDataDatilsMp(String orderId);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -941,15 +941,28 @@
    }
    //查询质检审核
    public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, Integer state, String processId, ReportingWork reportingWork) {
    public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, List<String> selectDate, Integer state, String processId, ReportingWork reportingWork) {
        Integer offset = (pageNum - 1) * pageSize;
        if ("null".equals(processId)) {
            processId = "";
        }
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(3).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportingWorkMapper.selectQualityTestingMp(offset, pageSize, selectTime1, selectTime2, state, processId, reportingWork));
        map.put("total", reportingWorkMapper.getQualityPageTotal(offset, pageSize, selectTime1, selectTime2, state, processId, reportingWork));
        map.put("data", reportingWorkMapper.selectQualityTestingMp(offset, pageSize, startDate, endDate, state, processId, reportingWork));
        map.put("total", reportingWorkMapper.getQualityPageTotal(offset, pageSize, startDate, endDate, state, processId, reportingWork));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
north-glass-erp/src/main/java/com/example/erp/service/sd/BomDataService.java
@@ -34,14 +34,21 @@
        Object consume =  object.get("consume");
        Object price =  object.get("price");
        Integer type = (Integer) object.get("type");
        String unit="";
        if (type.equals(1)){
            unit = "㎡";
        } else if (type.equals(2)) {
            unit = "m";
        } else if (type.equals(3)) {
            unit = "片";
        }
        if (id!=null){
            //查询物料编号是否已存在
            Integer countId =  bomDataMapper.getMaterialId(id);
            if (countId == 0){
                bomDataMapper.saveMaterialBomDataMp(id,name,consume,price,type);
                bomDataMapper.saveMaterialBomDataMp(id,name,consume,price,type,unit);
            }else {
                bomDataMapper.updateMaterialBomDataMp(id,name,consume,price,type);
                bomDataMapper.updateMaterialBomDataMp(id,name,consume,price,type,unit);
            }
            return true;
@@ -76,6 +83,8 @@
    public Map<String, Object> getOrderBomDataSv(String orderId) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", bomDataMapper.getOrderBomDataMp(orderId));
        map.put("sumData", bomDataMapper.getOrderBomSumDataMp(orderId));
        map.put("sumDataDatils", bomDataMapper.getOrderBomsumDataDatilsMp(orderId));
        return map;
    }
north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml
@@ -6,9 +6,9 @@
    <insert id="saveMaterialBomDataMp">
        insert into sd.bom_base
            (material_id, material, status, type, consume, price,create_time)
            (material_id, material, status, type, consume, price,unit,create_time)
        values
            (#{id}, #{name}, 0, #{type}, #{consume},#{price}, now())
            (#{id}, #{name}, 0, #{type}, #{consume},#{price}, #{unit},now())
    </insert>
    <select id="getMaterialId">
@@ -17,7 +17,7 @@
    <update id="updateMaterialBomDataMp">
        update sd.bom_base
        set type=#{type},consume=#{consume},price=#{price},create_time=now()
        set type=#{type},consume=#{consume},price=#{price},unit=#{unit},create_time=now()
        where material_id = #{id}
    </update>
@@ -37,4 +37,32 @@
        select *,(consume*price) as materialPric from sd.bom_product as bp left join sd.bom_base as bb on bb.id=bp.base_id
            where bp.product_id = #{productId} ORDER BY product_layer
    </select>
    <select id="getOrderBomSumDataMp">
        SELECT  product_id,product_name,SUM(quantity) as quantity,SUM(gross_area) as area,SUM(perimeter) as perimeter
        from sd.order_detail where order_id=#{orderId}
    </select>
    <select id="getOrderBomsumDataDatilsMp">
        SELECT
            od.order_id,
            bp.product_id,
            bb.material_id,
            bb.material,
            bb.`status`,
            bb.type,
            sum(bb.consume) as consume,
            sum(bb.price) as price,
            sum(bb.consume * bb.price) AS materialPrice
        FROM
            sd.bom_product AS bp
                LEFT JOIN sd.bom_base AS bb ON bb.id = bp.base_id
                LEFT JOIN (
                select order_id,product_id from sd.order_detail GROUP BY product_id
            ) as od on od.product_id = bp.product_id
        WHERE od.order_id=#{orderId}
        GROUP BY bb.material_id
        ORDER BY bp.product_layer
    </select>
</mapper>