From 18a8ce383f46356a42b7e1c906fb243db7cd6437 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期三, 12 三月 2025 13:42:05 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js               |   22 ++++++++++
 north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue |   50 +++++++++++++++----------
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml                     |   48 ++++++++++++++---------
 3 files changed, 80 insertions(+), 40 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js b/north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js
index e4cbf35..b5819da 100644
--- a/north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js
+++ b/north-glass-erp/northglass-erp/src/stores/sd/order/orderInfo.js
@@ -13,8 +13,24 @@
         workOrderDate:ref(["",""]),
         searchOrderListFilter:ref([]),//璁㈠崟棣栭〉绛涢�塢
         searchOrderFilter:{
-           list:ref([]),
+            list:ref([]),
             data:{}
+
+        },
+        //娴佺▼鍗$瓫閫夌紦瀛�
+        selectProcessCardFilter:{
+            list:ref([]),
+            data:{
+                order: {
+                    project: ''
+                },
+                orderDetail: {
+                    productId: '',
+                    productName: '',
+                    computeGrossArea: '',
+                    processingNote: '',
+                }
+            }
 
         }
 
@@ -45,6 +61,10 @@
                 list:[],
                 data:{}
             }
+            this.selectProcessCardFilter={
+                list:[],
+                data:{}
+            }
         }
     },
     persist: true
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
index f559196..bc9c82f 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -139,21 +139,29 @@
   dataTotal: 0,
   pageSize: 100
 })
+
+const getFlowCardList = async () => {
 //绗竴娆″姞杞芥暟鎹�
-request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => {
+  await request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => {
 
-  if (res.code == 200) {
-    total.dataTotal = res.data.total.total * 1
-    total.pageTotal = res.data.total.pageTotal
-    pageTotal.value = res.data.total
-    produceList = produceList.value.concat(deepClone(res.data.data))
-    xGrid.value.reloadData(produceList)
-    gridOptions.loading = false
-  } else {
-    ElMessage.warning(res.msg)
-  }
+    if (res.code == 200) {
+      total.dataTotal = res.data.total.total * 1
+      total.pageTotal = res.data.total.pageTotal
+      pageTotal.value = res.data.total
+      produceList.value = produceList.value.concat(deepClone(res.data.data))
+      xGrid.value.loadData(produceList.value)
+    } else {
+      ElMessage.warning(res.msg)
+    }
+  })
+}
+onMounted(async () => {
+  filterData.value = orderInfo.selectProcessCardFilter.data
+  await getFlowCardList()
+  orderInfo.selectProcessCardFilter.list.forEach(item =>{
+    xGrid.value.getColumnByField(item.field).filters = item.column.filters
+  })
 })
-
 //椤佃剼缈婚〉鏌ヨ
 const selectPageList = () => {
   let startTime = orderInfo.workOrderDate[0]
@@ -161,8 +169,8 @@
   request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => {
     if (res.code == 200) {
 
-      produceList = deepClone(res.data.data)
-      xGrid.value.reloadData(produceList)
+      produceList.value = deepClone(res.data.data)
+      xGrid.value.loadData(produceList.value)
     } else {
       ElMessage.warning(res.msg)
     }
@@ -224,9 +232,11 @@
       total.dataTotal = res.data.total.total*1
       total.pageTotal=parseInt(res.data.total)
       pageNum.value=1
-      produceList = deepClone(res.data.data)
-      xGrid.value.reloadData(produceList)
+      produceList.value = deepClone(res.data.data)
+      xGrid.value.loadData(produceList.value)
       gridOptions.loading=false
+      orderInfo.selectProcessCardFilter.list = xGrid.value.getCheckedFilters()
+      orderInfo.selectProcessCardFilter.data = filterData.value
     } else {
       ElMessage.warning(res.msg)
     }
@@ -242,7 +252,6 @@
 //瀛愮粍浠舵帴鏀跺弬鏁�
 const xGrid = ref()
 const gridOptions = reactive({
-  loading: true,
   border: "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
@@ -575,9 +584,10 @@
         <template #num1_filter="{ column, $panel }">
           <div>
             <div v-for="(option, index) in column.filters" :key="index">
-              <input v-model="option.data" type="text"
-                     @keyup.enter.native="$panel.confirmFilter()"
-                     @input="changeFilterEvent($event, option, $panel)"/>
+              <input
+                  v-model="option.data"
+                  @keyup.enter.native="$panel.confirmFilter()"
+                  @input="changeFilterEvent($event, option, $panel)"/>
             </div>
           </div>
         </template>
diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
index 6be0699..82a1be2 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -207,26 +207,36 @@
 
     <!--    鍒嗘灦鏄庣粏鏌ヨ-->
     <select id="detailsSelectMp">
-        select od.order_id,
-               ogd.production_id,
-               od.product_id,
-               od.product_name,
-               ROUND(SUM(DISTINCT od.quantity)-IFNULL(sum(fc.quantity)/fc.layers_number,0))            as quantity,
-               SUM(od.compute_gross_area)  as compute_gross_area,
-               round(sum(od.perimeter), 2) as perimeter
-        from sd.order_detail as od
-                 left join
-             (select order_id, order_number,technology_number, production_id, splitting_status
-              from sd.order_glass_detail
-              GROUP BY order_id, order_number) as ogd
-             on od.order_id = ogd.order_id and od.order_number = ogd.order_number
-                 left join flow_card as fc on fc.order_id = od.order_id and fc.order_number = od.order_number
-            and fc.technology_number=ogd.technology_number
-        where od.order_id = #{orderId}
-          and ogd.splitting_status = 0
+        SELECT
+            od.order_id,
+            ogd.production_id,
+            od.product_id,
+            od.product_name,
+            ROUND(SUM(od.quantity) - IFNULL(SUM(fc.quantity) / fc.layers_number, 0)) AS quantity,
+            SUM(od.compute_gross_area) AS compute_gross_area,
+            ROUND(SUM(od.perimeter), 2) AS perimeter
+        FROM sd.order_detail AS od
+                 LEFT JOIN (
+            SELECT order_id, order_number, production_id, splitting_status,
+                   technology_number
+            FROM sd.order_glass_detail
+            GROUP BY order_id, order_number, production_id, splitting_status
+        ) AS ogd
+                           ON od.order_id = ogd.order_id
+                               AND od.order_number = ogd.order_number
+                 LEFT JOIN (
+            SELECT order_id, order_number, technology_number, SUM(quantity) AS quantity, layers_number
+            FROM flow_card
+            GROUP BY order_id, order_number, technology_number
+        ) AS fc
+                           ON fc.order_id = od.order_id
+                               AND fc.order_number = od.order_number
+                               AND fc.technology_number = ogd.technology_number
+        WHERE od.order_id = #{orderId}
+          AND ogd.splitting_status = 0
+        GROUP BY od.order_id, ogd.production_id, od.product_id, od.product_name
+        ORDER BY od.order_id DESC;
 
-        group by od.order_id, ogd.production_id
-        order by od.id desc
     </select>
 
     <!--    鏇存柊鍒嗘灦鐘舵��-->

--
Gitblit v1.8.0