From e5ea2c30e33f280ffc8a0ce78224ef99fb6679b1 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期二, 30 十二月 2025 08:16:06 +0800
Subject: [PATCH] 在制品报表导出修改

---
 north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgressCombination.vue |   16 ++++------------
 north-glass-erp/src/main/resources/mapper/pp/Report.xml                          |   21 +++++++++++++--------
 north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue            |   16 ++++------------
 3 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue b/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
index 556532d..7ffb671 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
@@ -138,9 +138,7 @@
     optionVal = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+
   request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
     if (res.code == 200) {
 
@@ -175,9 +173,7 @@
     optionVal = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+
   request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
 
     if (res.code == 200) {
@@ -241,9 +237,7 @@
     optionVal = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+
   request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
 
     if (res.code == 200) {
@@ -416,9 +410,7 @@
     inputProject = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+
   if(date===null){
     ElMessage.warning(t('report.pleaseSelectADateFirst'))
     return
diff --git a/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgressCombination.vue b/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgressCombination.vue
index 4235538..4702f69 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgressCombination.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgressCombination.vue
@@ -108,9 +108,7 @@
   optionVal = null
 }
 let terminationVals = terminationVal.value
-if (terminationVals == '') {
-  terminationVals = null
-}
+
 //绗竴娆″姞杞芥暟鎹�
 request.post(`/report/workInProgressCombinationProcess/1/${total.pageSize}/${selectProcesses}/${inputVal}/${inputProject}/${optionVal}`, filterData.value).then((res) => {
 
@@ -145,9 +143,7 @@
     optionVal = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+
   request.post(`/report/workInProgressCombination/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
     if (res.code == 200) {
       total.value = res.data.total
@@ -181,9 +177,7 @@
     optionVal = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+  console.log(terminationVals)
   request.post(`/report/workInProgressCombination/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
 
     if (res.code == 200) {
@@ -326,9 +320,7 @@
     inputProject = null
   }
   let terminationVals = terminationVal.value
-  if (terminationVals == '') {
-    terminationVals = null
-  }
+
   if(date===null){
     ElMessage.warning(t('report.pleaseSelectADateFirst'))
     return
diff --git a/north-glass-erp/src/main/resources/mapper/pp/Report.xml b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
index 0494867..64b23dc 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/Report.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -3651,10 +3651,12 @@
         SELECT g.*
         ,GROUP_CONCAT(g.glass_child SEPARATOR '+')  as childName
         from( SELECT f.*,
-        e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num as quantity,
-        (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num)*f.area as glassArea
+        if(e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity&lt;0,
+        0,e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity) as quantity,
+        round(if(e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity&lt;0,0,
+        e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num-f.termination_quantity)*f.area/1000000,2) as glassArea
         from (SELECT a.order_id,
-        a.project,
+        if(a.batch!="",CONCAT(a.project,'(',a.batch,')'),a.project) as project,
         C.product_id,
         b.order_number,
         b.process_id,
@@ -3663,9 +3665,10 @@
         d.`group` ,
         b.broken_num,
         b.id,
-        c.area,
+        d.child_width * d.child_height as area,
         d.glass_child,
-        ifnull(cb.patchNumSum,0) as patchNumSum
+        ifnull(cb.patchNumSum,0) as patchNumSum,
+        fc.termination_quantity
 
         FROM sd.`order` as a
         LEFT JOIN sd.order_process_detail as b
@@ -3698,17 +3701,18 @@
         and fc.technology_number = d.technology_number
         where a.processing_card>0
         and a.warehousing!=2
-        <if test="terminationVal != '1' and terminationVal != 1">
+        <if test=" terminationVal != '1' and terminationVal != 1">
             and termination_status !=1
         </if>
-        and (c.quantity-b.reporting_work_num_count)>0
         GROUP BY  b.process_id, b.order_number,
         b.technology_number) as f
         LEFT JOIN sd.order_process_detail as e
         on e.id=(f.id-1) and e.process_id = f.process_id and e.order_number = f.order_number and e.technology_number =f.technology_number
         where
         e.id is not null
-        and (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num)>0 ) as g
+        and (e.reporting_work_num_count+f.patchNumSum-f.reporting_work_num_count-f.broken_num)>0 group by f.process_id, f.order_number,
+        f.technology_number ORDER BY f.process_id, f.order_number,
+        f.technology_number) as g
         <choose>
             <when test="laminating == 'stepB'">
                 GROUP BY g.process_id, g.order_number, g.technology_number
@@ -3726,6 +3730,7 @@
 
 
         ) as h
+        where h.quantity >0
         <choose>
             <when test="inputVal == 1">
                 GROUP BY thisProcess

--
Gitblit v1.8.0