From 926a1e8b90381c7aa085d5462d78de9d2cc6034d Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期二, 27 二月 2024 08:58:15 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/target/classes/mapper/pp/WordOrder.xml                                 |   23 
 north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue           |   44 
 north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java     |    6 
 north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue             |  339 ++++++++---
 north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java       |    1 
 north-glass-erp/target/classes/mapper/pp/FolwCard.xml                                  |  232 +++++--
 north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue           |   20 
 north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java           |   91 +++
 north-glass-erp/target/classes/mapper/sd/ProductDetail.xml                             |   19 
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java            |   21 
 north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java                  |    4 
 north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java |   33 +
 north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml                              |  233 +++++--
 north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java             |    3 
 north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml                         |   19 
 north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml                             |   23 
 north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue                  |  374 +++++++++++-
 north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java         |   14 
 north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue          |   38 
 north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java             |    7 
 north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java          |   96 +++
 21 files changed, 1,247 insertions(+), 393 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
index c9978b9..83deb13 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -11,9 +11,12 @@
 import Sortable from 'sortablejs'
 import BasicTable from '@/components/basic/BasicTable.vue'
 import {VXETable} from "vxe-table";
+import useUserInfoStore from "@/stores/userInfo";
 
 let productGlassTypeStore = useProductGlassTypeStore()
 let router = useRouter()
+const userStore = useUserInfoStore()
+const username = userStore.user.userName
 const getTableRow = (row, type) => {
   switch (type) {
     case 'edit' : {
@@ -39,6 +42,15 @@
   }
 }
 
+let flag = $ref(true)
+function intoCreateProduct(){
+  if(flag){
+    router.push(`/main/processCard/SplittingDetails?orderId=${orderId}`)
+  }else {
+    router.push('/main/processCard/SplittingDetails?orderId=${orderId}')
+  }
+  flag=!flag
+}
 
 //瀹氫箟鏃堕棿
 const form = reactive({
@@ -68,16 +80,16 @@
 let filterData = ref({
   product: {
     thickness: '',
-    totalThickness:''
+    totalThickness: ''
   },
   orderDetail: {
     orderNumber: '',
     height: '',
     computeGrossArea: '',
-    quantity: '',
-    shape:'',
-    width:'',
-    weight:''
+    binningQuantity: '',
+    shape: '',
+    width: '',
+    weight: ''
   }
 
 })
@@ -99,7 +111,7 @@
 request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
 
   if (res.code == 200) {
-    //console.log(res.data)
+    console.log(res.data)
     pageTotal.value = res.data.total
     produceList = produceList.value.concat(deepClone(res.data.data))
     xGrid.value.reloadData(produceList)
@@ -114,9 +126,11 @@
   // 鎵嬪姩瑙﹀彂绛涢��
   $panel.changeOption(event, !!option.data, option)
 }
+
 function padLeftZero(str) {
   return ('00' + str).substr(str.length)
 }
+
 function filterChanged(column) {
   gridOptions.loading = true
   //绛涢�夋潯浠跺彂鐢熷彉鍖栨潯浠跺彂鐢熷彉鍖�
@@ -134,12 +148,13 @@
 
 
   request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => {
-    if(res.code==200){
-      pageTotal.value=res.data.total
+    if (res.code == 200) {
+
+      pageTotal.value = res.data.total
       produceList = deepClone(res.data.data)
       xGrid.value.loadData(produceList)
-      gridOptions.loading=false
-    }else{
+      gridOptions.loading = false
+    } else {
       ElMessage.warning(res.msg)
     }
   })
@@ -154,18 +169,18 @@
 //鍙充晶瀛愮粍浠舵帴鏀跺弬鏁�
 const xGrid = ref()
 const gridOptions = reactive({
-  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  border: "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
-  stripe:true,//鏂戦┈绾�
-  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  stripe: true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
   id: 'CustomerList',
   showFooter: true,//鏄剧ず鑴�
   printConfig: {},
   importConfig: {},
   exportConfig: {},
-  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
-  showOverflow:true,
+  scrollY: {enabled: true},//寮�鍚櫄鎷熸粴鍔�
+  showOverflow: true,
   columnConfig: {
     resizable: true,
     useKey: true
@@ -181,14 +196,14 @@
     mode: 'row',
     showStatus: true
   },//琛ㄥご鍙傛暟
-  columns:[
+  columns: [
     {type: 'checkbox', fixed: "left", title: '閫夋嫨'},
-    {field: 'orderNumber', title: '璁㈠簭',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
-    {field: 'shape',  title: '褰㈢姸', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'width', title: '瀹�', filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'height', title: '楂�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'baiscQuantity', title: '鏁伴噺', showOverflow:"ellipsis"},
-    {field: 'computeGrossArea', title: '闈㈢Н'},
+    {field: 'orderNumber', title: '璁㈠簭', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+    {field: 'shape', title: '褰㈢姸', showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+    {field: 'width', title: '瀹�', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+    {field: 'height', title: '楂�', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+    {field: 'baiscQuantity', title: '寰呭垎鏁伴噺', showOverflow: "ellipsis"},
+    {field: 'computeGrossArea', title: '寰呭垎闈㈢Н'},
     {field: 'totalThickness', title: '鎬诲帤搴�'},
     {field: 'thickness', title: '鐜荤拑鍘氬害'},
     {field: 'weight', title: '閲嶉噺'}
@@ -204,13 +219,11 @@
     zoom: true,
     custom: true
   },
-  data:  [
-
-  ],//table body瀹為檯鏁版嵁
+  data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    let footList=['鎬绘暟閲�','鎬婚潰绉�','鍒嗙鏁�']
-    return[
+  footerMethod({columns, data}) {//椤佃剼鍑芥暟
+    let footList = ['baiscQuantity', 'computeGrossArea', 'totalThickness','thickness', 'weight']
+    return [
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return '鍚堣:'
@@ -229,18 +242,18 @@
 //宸︿晶瀛愮粍浠舵帴鏀跺弬鏁�
 const xGridLeft = ref()
 const gridLeftOptions = reactive({
-  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  border: "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
-  stripe:true,//鏂戦┈绾�
-  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  stripe: true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
   id: 'CustomerList',
   showFooter: true,//鏄剧ず鑴�
   printConfig: {},
   importConfig: {},
   exportConfig: {},
-  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
-  showOverflow:true,
+  scrollY: {enabled: true},//寮�鍚櫄鎷熸粴鍔�
+  showOverflow: true,
   columnConfig: {
     resizable: true,
     useKey: true
@@ -256,35 +269,39 @@
     mode: 'row',
     showStatus: true
   },//琛ㄥご鍙傛暟
-  columns:[
+  columns: [
     {type: 'checkbox', fixed: "left", title: '閫夋嫨'},
-    {field: 'processId', title: '娴佺▼鍗″彿',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width:130 },
-    {field: 'orderNumber',  title: '璁㈠簭', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'landingSequence', title: '钀芥灦椤哄簭', filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'shape', title: '褰㈢姸',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'width', title: '瀹�', showOverflow:"ellipsis"},
+    {field: 'processId', title: '娴佺▼鍗″彿', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 130},
+    {
+      field: 'orderNumber',
+      title: '璁㈠簭',
+      showOverflow: "ellipsis",
+      filters: [{data: ''}],
+      slots: {filter: 'num1_filter'}
+    },
+    {field: 'landingSequence', title: '钀芥灦椤哄簭', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+    {field: 'shape', title: '褰㈢姸', filters: [{data: ''}], slots: {filter: 'num1_filter'}},
+    {field: 'width', title: '瀹�', showOverflow: "ellipsis"},
     {field: 'height', title: '楂�'},
     {field: 'quantity', title: '鎬绘暟閲�'},
     {field: 'totalThickness', title: '鎬诲帤搴�'},
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
-    // buttons: [{
-    //
-    // }],
+    buttons: [
+      {code: 'saveFlowCard', name: '淇濆瓨', status: 'primary', icon: 'vxe-icon-save'},
+    ],
     import: false,
     export: true,
     print: true,
     zoom: true,
     custom: true
   },
-  data:  [
-
-  ],//table body瀹為檯鏁版嵁
+  data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    let footList=['鎬绘暟閲�','鎬婚潰绉�','鍒嗙鏁�']
-    return[
+  footerMethod({columns, data}) {//椤佃剼鍑芥暟
+    let footList = ['鎬绘暟閲�', '鎬婚潰绉�', '鍒嗙鏁�']
+    return [
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
           return '鍚堣:'
@@ -302,7 +319,7 @@
 const createProcessCard = () => {
   const $grid = xGrid.value
   const checkedList = $grid.getCheckboxRecords()
-  if(checkedList.length===0){
+  if (checkedList.length === 0) {
     ElMessage.warning("璇峰厛閫夋嫨鍙充晶鏁版嵁")
     return
   }
@@ -310,8 +327,8 @@
   const $gridLeft = xGridLeft.value
   const leftData = $gridLeft.getTableData().fullData
   let index = 1
-  if(leftData.length!==0){
-    index =  leftData[0].landingSequence + 1
+  if (leftData.length !== 0) {
+    index = leftData[0].landingSequence + 1
     //index = index.toString().padStart(2, '0')
   }
   const processId = productionId + index.toString().padStart(2, '0')
@@ -323,11 +340,11 @@
   $grid.remove(checkedList)
 }
 
-let checkedNum =  ref('')
+let checkedNum = ref('')
 
 //鍚戝彸杈硅〃鏍兼坊鍔犳暟鎹�
-const addRight =   () => {
-  try{
+const addRight = () => {
+  try {
     //宸﹁竟琛ㄦ牸瀹氫箟
     const $gridLeft = xGridLeft.value
     //鍙宠竟琛ㄦ牸瀹氫箟
@@ -335,49 +352,49 @@
     //鑾峰彇宸﹁竟琛ㄦ牸checkbox閫変腑鐨勬暟鎹�
     const checkedList = $gridLeft.getCheckboxRecords()
     //鍒ゆ柇宸﹁竟琛ㄦ牸鏄惁鏈夐�変腑鐨勬暟鎹�
-    if(checkedList.length===0){
+    if (checkedList.length === 0) {
       ElMessage.warning("璇峰厛閫夋嫨宸︿晶鏁版嵁")
       return
     }
-    const  regex = /^(\d+|)$/;
-    if(!regex.test(checkedNum.value)){
+    const regex = /^(\d+|)$/;
+    if (!regex.test(checkedNum.value)) {
       ElMessage.warning("璇疯緭鍏ユ鏁存暟")
       return
     }
     //鍒ゆ柇姝f暣鏁�
-    if(/^[1-9]\d*$/.test(checkedNum.value)){
+    if (/^[1-9]\d*$/.test(checkedNum.value)) {
       //瀵归�変腑鐨勫乏杈硅〃鏍兼暟鎹繘琛屽惊鐜�
-      checkedList.forEach((item)=> {
+      checkedList.forEach((item) => {
         //鍒ゆ柇鍙敤鏁伴噺鏄惁澶т簬绛変簬杈撳叆鐨勬暟閲�,涓嶆弧瓒冲垯鎶涘嚭寮傚父
-        if(item.quantity <checkedNum.value) throw new Error("璇疯緭鍏ュ皬浜庣瓑浜庡彲鐢ㄦ暟閲忕殑鏁板瓧");
+        if (item.quantity < checkedNum.value) throw new Error("璇疯緭鍏ュ皬浜庣瓑浜庡彲鐢ㄦ暟閲忕殑鏁板瓧");
         //宸﹁竟琛ㄦ牸鍙敤鏁伴噺鍑忓幓杈撳叆鐨勬暟閲�
-        item.quantity = item.quantity-checkedNum.value
+        item.quantity = item.quantity - checkedNum.value
         //鍙宠竟琛ㄦ牸鏁版嵁
         let rightData = $grid.getTableData().fullData
         //鍙宠竟琛ㄦ牸鏁版嵁涓煡鎵惧綋鍓嶆暟鎹笅鏍�
         let filterIndex = rightData.findIndex(item1 => item1.orderNumber === item.orderNumber)
         //濡傛灉鍙宠竟琛ㄦ牸鏁版嵁涓瓨鍦ㄥ綋鍓嶆暟鎹垯鏁伴噺鐩稿姞
-        if (filterIndex>=0){
-          rightData[filterIndex].baiscQuantity =rightData[filterIndex].baiscQuantity*1+ checkedNum.value*1
+        if (filterIndex >= 0) {
+          rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + checkedNum.value * 1
           //濡傛灉宸﹁竟鏁伴噺涓�0鏃跺垹闄ゆ鏉℃暟鎹�
-          if(item.quantity=== 0){
+          if (item.quantity === 0) {
             $gridLeft.remove(item)
           }
-        }else {
+        } else {
           //鍙宠竟琛ㄦ牸娌℃湁姝ゆ潯鏁版嵁鍒欏線鍙宠竟琛ㄦ牸鎻掑叆鏁版嵁
           item.baiscQuantity = checkedNum.value
           $grid.insert(item)
         }
       })
-    }else if(checkedNum.value===''){//鍒ゆ柇鏁伴噺杈撳叆妗嗘湁鏃犺緭鍏ユ暟瀛�
+    } else if (checkedNum.value === '') {//鍒ゆ柇鏁伴噺杈撳叆妗嗘湁鏃犺緭鍏ユ暟瀛�
 
-      checkedList.forEach((item)=> {
+      checkedList.forEach((item) => {
         let rightData = $grid.getTableData().fullData
         let filterIndex = rightData.findIndex(item1 => item1.orderNumber === item.orderNumber)
         //鏃犺緭鍏ュ苟涓斿鏋滃彸杈硅〃鏍兼暟鎹腑瀛樺湪褰撳墠鏁版嵁鍒欐暟閲忕浉鍔�
-        if(filterIndex>-1){
-          rightData[filterIndex].baiscQuantity =rightData[filterIndex].baiscQuantity*1+ item.quantity*1
-        }else{
+        if (filterIndex > -1) {
+          rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + item.quantity * 1
+        } else {
           $grid.insert(item)
         }
 
@@ -385,46 +402,153 @@
       })
     }
 
-  }
-  catch (e){
+  } catch (e) {
     ElMessage.warning(e.message)
   }
 }
 //鍚戝乏杈硅〃鏍兼坊鍔犳暟鎹�
-const addLeft =   () => {
+const addLeft = () => {
+  try {
+    //宸﹁竟琛ㄦ牸瀹氫箟
+    const $gridLeft = xGridLeft.value
+    //鍙宠竟琛ㄦ牸瀹氫箟
+    const $grid = xGrid.value
+    //鑾峰彇鍙宠竟琛ㄦ牸checkbox閫変腑鐨勬暟鎹�
+    const checkedList = $grid.getCheckboxRecords()
+    //鑾峰彇宸﹁竟琛ㄦ牸checkbox閫変腑鐨勬暟鎹�
+    const checkedListLeft = $gridLeft.getCheckboxRecords()
+    //鍒ゆ柇鍙宠竟琛ㄦ牸鏄惁鏈夐�変腑鐨勬暟鎹�
+    if (checkedList.length === 0) {
+      ElMessage.warning("璇峰厛閫夋嫨鍙充晶鏁版嵁")
+      return
+    }
+    if (checkedListLeft.length !== 1) {
+      ElMessage.warning("璇峰厛閫夋嫨宸︿晶涓�鏉℃暟鎹�")
+      return
+    }
+    const regex = /^(\d+|)$/;
+    if (!regex.test(checkedNum.value)) {
+      ElMessage.warning("璇疯緭鍏ユ鏁存暟")
+      return
+    }
+    //鍒ゆ柇姝f暣鏁�
+    if (/^[1-9]\d*$/.test(checkedNum.value)) {
+      checkedList.forEach((item) => {
+        //鍒ゆ柇鍙敤鏁伴噺鏄惁澶т簬绛変簬杈撳叆鐨勬暟閲�,涓嶆弧瓒冲垯鎶涘嚭寮傚父
+        if (item.baiscQuantity < checkedNum.value) throw new Error("璇疯緭鍏ュ皬浜庣瓑浜庡彲鐢ㄦ暟閲忕殑鏁板瓧");
+        item.baiscQuantity = item.baiscQuantity - checkedNum.value
+        //宸﹁竟琛ㄦ牸鏁版嵁
+        let leftData = $gridLeft.getTableData().fullData
+        //宸﹁竟琛ㄦ牸鏁版嵁涓煡鎵惧綋鍓嶆暟鎹笅鏍�
+        let filterIndex = leftData.findIndex(item1 => item1.orderNumber === item.orderNumber)
+        //濡傛灉鍙宠竟琛ㄦ牸鏁版嵁涓瓨鍦ㄥ綋鍓嶆暟鎹垯鏁伴噺鐩稿姞
+        if (filterIndex >= 0) {
+          leftData[filterIndex].quantity = leftData[filterIndex].quantity * 1 + checkedNum.value * 1
 
+          if (item.baiscQuantity === 0) {
+            $grid.remove(checkedList)
+          }
+        } else {
+          item.quantity = checkedNum.value
+          item.processId = checkedListLeft[0].processId
+          item.landingSequence = checkedListLeft[0].landingSequence
+          $gridLeft.insert(item)
+        }
+
+      })
+    } else if (checkedNum.value === '') {//鍒ゆ柇鏁伴噺杈撳叆妗嗘湁鏃犺緭鍏ユ暟瀛�
+      checkedList.forEach((item) => {
+        item.processId = checkedListLeft[0].processId
+        item.landingSequence = checkedListLeft[0].landingSequence
+      })
+      $gridLeft.insertAt(checkedList)
+      $grid.remove(checkedList)
+    }
+  } catch (e) {
+    ElMessage.warning(e.message)
+  }
 }
 
+//淇濆瓨娴佺▼鍗℃暟鎹�
+const gridEvents = {
+  toolbarButtonClick({code}) {
+    const $grid = xGridLeft.value
+    if ($grid) {
+      switch (code) {
+        case 'saveFlowCard': {
+          const $table = xGridLeft.value
+          const $tableRight = xGrid.value
+          if ($table) {
+            const selectRecords = $table.getCheckboxRecords()
+            const selectRight = $tableRight.getCheckboxRecords()
+            if (selectRecords.length === 0){
+              ElMessage.warning("璇峰厛閫夋嫨淇濆瓨鐨勬暟鎹�")
+              return
+            }
+            if (selectRight.length > 0){
+              ElMessage.warning("璇峰厛灏嗗彸渚ф暟鎹叏閮ㄥ缓绔嬫祦绋嬪崱鍚庝繚瀛�")
+              return;
+            }
+            //console.log(selectRecords[0].quantity)
+            let flowCardData = ref({
+              flowCard: selectRecords,
+              userName:username,
+              productionId:productionId
+            })
 
+           console.log(flowCardData.value)
+            request.post("/processCard/addFlowCard", flowCardData.value).then((res) => {
+              if (res.code == 200) {
+                ElMessage.success("淇濆瓨鎴愬姛")
+                location.reload();
+              } else {
+                ElMessage.warning(res.msg)
+                router.push("/login")
+              }
+            })
+
+          }
+          return;
+
+        }
+
+      }
+    }
+  },
+
+}
 </script>
 
 <template>
   <div>
-    <div class="header">
 
-      <el-button
-          style="float: left"
-          @click="intoCreateProduct"
-          id="searchButton1"
-          type="primary"
-          :icon="ArrowLeftBold"
-          round >
-        {{flag?'杩斿洖':'杩斿洖'}}
-      </el-button>
-      <el-button type="primary">淇濆瓨鍒嗘灦</el-button>
-      <el-button type="primary">鍒嗘灦姹囨��</el-button>
-      <el-button type="primary">宸︿晶鍏ㄩ��</el-button>
-      <el-button type="primary">鍙充晶鍏ㄩ��</el-button>
-    </div>
-    <div class="common-layout">
-      <el-container height="100%">
-        <el-aside width="44%" style="">
+    <div class="common-layout" style="height: 100%">
+      <div class="header">
+
+        <el-button
+            style="float: left"
+            @click="intoCreateProduct"
+            id="searchButton1"
+            type="primary"
+            :icon="ArrowLeftBold"
+            round>
+          {{ flag ? '杩斿洖' : '杩斿洖' }}
+        </el-button>
+        <!--      <el-button  type="primary">淇濆瓨鍒嗘灦</el-button>-->
+<!--              <el-button type="primary" :hidden="true">鍒嗘灦姹囨��</el-button>-->
+        <div style="width: 100px;">
+
+        </div>
+      </div>
+      <el-container height="600px">
+        <el-aside width="44%" >
           <vxe-grid
               max-height="100%"
               @filter-change="filterChanged"
               class="mytable-scrollbar"
               ref="xGridLeft"
               v-bind="gridLeftOptions"
+              v-on="gridEvents"
           >
             <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
             <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
@@ -432,7 +556,9 @@
               <ul class="expand-wrapper">
                 <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
                   <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
-                  <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
+                  <span v-if="hasDecimal(item.field)">{{
+                      row[item.field.split('.')[0]][item.field.split('.')[1]]
+                    }}</span>
                   <span v-else>{{ row[item.field] }}</span>
                 </li>
               </ul>
@@ -457,22 +583,20 @@
         </el-aside>
 
         <el-main width="12%" style="">
-          <span>鏈垎鏁伴噺:45</span><br>
-          <span>鏈垎閲嶉噺:333</span><br>
           <span>閫変腑鏁伴噺:<el-input type="number" v-model="checkedNum"></el-input></span><br>
-          <el-button type="primary" @click="addRight"> 鈫� </el-button>
+          <el-button type="primary" @click="addRight"> 鈫�</el-button>
           <br>
           <br>
-          <el-button type="primary" @click="addLeft">  鈫� </el-button>
+          <el-button type="primary" @click="addLeft"> 鈫�</el-button>
           <br>
           <br>
           <el-button @click="createProcessCard" type="primary">寤虹珛娴佺▼鍗�</el-button>
         </el-main>
 
-        <el-aside width="44%" style="">
-
+        <el-aside width="45%" height="500px" style="">
           <vxe-grid
-              max-height="100%"
+
+              max-height="97%"
               @filter-change="filterChanged"
               class="mytable-scrollbar"
               ref="xGrid"
@@ -484,7 +608,9 @@
               <ul class="expand-wrapper">
                 <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
                   <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
-                  <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
+                  <span v-if="hasDecimal(item.field)">{{
+                      row[item.field.split('.')[0]][item.field.split('.')[1]]
+                    }}</span>
                   <span v-else>{{ row[item.field] }}</span>
                 </li>
               </ul>
@@ -512,19 +638,24 @@
 </template>
 
 <style scoped>
-.common-layout{
+.common-layout {
   height: 100%;
 }
 
-.el-aside{
+.header{
+  width: 100%;
+  height: 35px;
+  margin-top: -20px;
+}
+
+.el-aside {
   height: 100%;
 }
 
-.el-main{
+.el-main {
   height: 100%;
   text-align: center;
 }
-
 
 
 </style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
index c5b29b8..2c22f9f 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue
@@ -205,16 +205,16 @@
     {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
     {title: '鎿嶄綔', width: 80, slots: { default: 'button_slot' },fixed:"left"},
     { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
-    {field: 'order.orderId',  title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
-    {field: 'order.customerName', title: '瀹㈡埛鍚嶇О', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'order.project', title: '椤圭洰鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'order.batch', title: '鎵规',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
-    {field: 'order.otherRemarks', title: '鍘熺墖瑕佹眰', sortable: true,showOverflow:"ellipsis"},
-    {field: 'order.icon', title: '鍟嗘爣閫夐」', sortable: true},
-    {field: 'order.orderType', title: '璁㈠崟绫诲瀷', sortable: true},
-    {field: 'order.salesman', title: '涓氬姟鍛�', sortable: true},
-    {field: 'order.processingNote', title: '鍔犲伐瑕佹眰', sortable: true,showOverflow:"ellipsis"},
-    {field: 'order.deliveryAddress', title: '閫佽揣鍦板潃', sortable: true},
+    {field: 'order.orderId',  title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' } , },
+    {field: 'order.customerName', title: '瀹㈡埛鍚嶇О',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'order.project', title: '椤圭洰鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'order.batch', title: '鎵规',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
+    {field: 'order.otherRemarks', title: '鍘熺墖瑕佹眰' ,showOverflow:"ellipsis",filters:[{ data: '' },],slots: { filter: 'num1_filter' }},
+    {field: 'order.icon', title: '鍟嗘爣閫夐」',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
+    {field: 'order.orderType', title: '璁㈠崟绫诲瀷',filters:[{ data: '' }],slots: { filter: 'num1_filter' } },
+    {field: 'order.salesman', title: '涓氬姟鍛�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'order.processingNote', title: '鍔犲伐瑕佹眰',showOverflow:"ellipsis"},
+    {field: 'order.deliveryAddress', title: '閫佽揣鍦板潃',},
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
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 891ff5e..c257ddc 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
@@ -21,7 +21,15 @@
       break
     }
     case 'setType': {
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
+      request.post(`/processCard/updateLayoutStatus/${row.processId}`).then((res) => {
+        if (res.code == 200) {
+          ElMessage.success("鎺掔増鎴愬姛")
+          location.reload();
+        } else {
+
+          ElMessage.warning(res.msg)
+        }
+      })
       break
     }
     case 'delete': {
@@ -222,15 +230,15 @@
     {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
     {title: '鎿嶄綔', width: 140, slots: { default: 'button_slot' },fixed:"left"},
     { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
-    {field: 'orderId', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
-    {field: 'processId', width: 130, title: '娴佺▼鍗″彿', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'orderDetail.productId', title: '浜у搧缂栧彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'orderDetail.productName', title: '浜у搧鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
-    {field: 'order.project', title: '椤圭洰鍚嶇О', sortable: true,showOverflow:"ellipsis"},
-    {field: 'binningQuantity', title: '鏁伴噺', sortable: true},
-    {field: 'orderDetail.computeGrossArea', title: '闈㈢Н', sortable: true},
-    {field: 'founder', title: '鍒嗘灦鍛�', sortable: true},
-    {field: 'orderDetail.processingNote', title: '鍔犲伐瑕佹眰', sortable: true}
+    {field: 'orderId', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
+    {field: 'processId', width: 130, title: '娴佺▼鍗″彿' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'orderDetail.productId', title: '浜у搧缂栧彿' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'orderDetail.productName', title: '浜у搧鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, },
+    {field: 'order.project', title: '椤圭洰鍚嶇О' ,showOverflow:"ellipsis"},
+    {field: 'binningQuantity', title: '鏁伴噺', },
+    {field: 'orderDetail.computeGrossArea', title: '闈㈢Н', },
+    {field: 'founder', title: '鍒嗘灦鍛�', },
+    {field: 'orderDetail.processingNote', title: '鍔犲伐瑕佹眰', }
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
@@ -238,8 +246,8 @@
     //
     // }],
     import: false,
-    export: true,
-    print: true,
+    // export: true,
+    // print: true,
     zoom: true,
     custom: true
   },
@@ -283,7 +291,11 @@
 
         />
         &nbsp;&nbsp;
-        <el-button type="primary">鏌ヨ</el-button>
+        <el-button
+            @click="getWorkOrder"
+            id="select"
+            type="primary" :icon="Search">鏌ヨ
+        </el-button>
       </el-row>
 
     </div>
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
index 6994581..9306803 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue
@@ -45,17 +45,14 @@
 let filterData = ref({
 
   orderGlassDetail: {
-    productName: '',
-    computeArea: '',
-    quantity: '',
-    computeGrossArea: '',
-    perimeter: '',
-    bendRadius: '',
-    processingNote: ''
+    productionId: '',
   },
-  orderDetail:{
-    orderDetail:''
+    orderDetail:{
+    orderId:'',
+    productId:'',
+    productName:'',
   }
+
 
 })
 //瀹氫箟椤甸潰鎬婚〉鏁�
@@ -115,11 +112,9 @@
     filterData.value[column.property] = value
   }
 
-//鑾峰彇閫変腑鏃堕棿
-  let startTime = form.date1[0]
-  let endTime = form.date1[1]
 
-  request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => {
+console.log(filterData.value)
+  request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => {
     if (res.code == 200) {
       pageTotal.value = res.data.total
 
@@ -172,29 +167,30 @@
     {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
     {title: '鎿嶄綔', width: 80, slots: { default: 'button_slot' },fixed:"left"},
     { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
-    {field: 'orderId',  title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
-    {field: 'orderGlassDetail.productionId', title: '鐢熶骇璁㈠崟鍙�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'orderDetail.productId', title: '浜у搧缂栧彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
-    {field: 'orderDetail.productName', title: '浜у搧鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
-    {field: 'orderDetail.quantity', title: '鎬绘暟閲�', sortable: true,showOverflow:"ellipsis"},
-    {field: 'orderDetail.computeGrossArea', title: '鎬婚潰绉�', sortable: true},
-    {field: 'orderDetail.perimeter', title: '鍛ㄩ暱', sortable: true},
+    {field: 'orderId',  title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' },  },
+    {field: 'orderGlassDetail.productionId', title: '鐢熶骇璁㈠崟鍙�', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'orderDetail.productId', title: '浜у搧缂栧彿',filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+    {field: 'orderDetail.productName', title: '浜у搧鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' },},
+    {field: 'orderDetail.quantity', title: '鎬绘暟閲�',showOverflow:"ellipsis"},
+    {field: 'orderDetail.computeGrossArea', title: '鎬婚潰绉�', },
+    {field: 'orderDetail.perimeter', title: '鍛ㄩ暱',},
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
     // buttons: [{
     //
     // }],
-    import: false,
-    export: true,
-    print: true,
+    // import: false,
+    // export: true,
+    // print: true,
     zoom: true,
     custom: true
   },
   data: null,//琛ㄦ牸鏁版嵁
   //鑴氶儴姹傚拰
   footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    let footList=['鎬绘暟閲�','鎬婚潰绉�']
+    console.log(columns,data)
+    let footList=['data.orderDetail.quantity','data.orderDetail.computeGrossArea']
     return[
       columns.map((column, columnIndex) => {
         if (columnIndex === 0) {
diff --git a/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue b/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
index 5aa506f..9b3b751 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
@@ -1,8 +1,10 @@
 <script setup>
 import request from "@/utils/request"
-import deepClone from "@/utils/deepClone";
-import {ElMessage} from "element-plus";
-import {ref} from "vue";
+import deepClone from "@/utils/deepClone"
+import {ElMessage} from "element-plus"
+import {computed, ref} from "vue"
+import  useUserInfo from "@/stores/userInfo"
+let  userInfo = useUserInfo()
 const disposeList = $ref([
   '褰╅噳',
   '钂欑爞',
@@ -10,22 +12,6 @@
   '璐磋啘',
   '鍠风爞',
   '纾ㄨ竟'
-])
-let processList = $ref([
-    '纾ㄨ竟',
-    '闀�鑶�',
-    '鍊掕',
-    '娓呮礂',
-    '鎵撳瓟',
-    '鎸栫己',
-    '鎸栨Ы',
-    '姘村垏鍓�',
-    '涓濆嵃',
-    '鍗婇挗鍖�',
-    '閽㈠寲',
-    '澶瑰眰',
-    '涓┖',
-    '鍖呰'
 ])
 let BasicData = ref({
   stuffColor:null,
@@ -56,15 +42,66 @@
   lowE:''
 })
 let processChecked = ref([])
-
+let hollowBasic = ref({
+  thickness:"",
+  gasType:"",
+  Type:"",
+  GlueDepth:""
+})
+let InterlayerBasic = ref({
+  thickness:"",
+  color:"",
+  type:""
+})
+let productDetailList = ref([])
+let productTotal = ref({
+  productName:'',
+  creator:userInfo.user.userName
+})
+//椤甸潰鍔犺浇璇锋眰
 request.get(`/basicData/BasicDataByType/product`).then((res) => {
   if(res.code==200){
-    console.log(res.data)
     BasicData.value = res.data
   }else{
     ElMessage.warning(res.msg)
   }
 })
+
+const saveProduct = () => {
+  if(productDetailList.value.length===0){
+    ElMessage.warning("璇锋坊鍔犱骇鍝佽鎯�")
+    return
+  }else if(productDetailList.value[productDetailList.value.length-1].detailType!=='glass'){
+    ElMessage.warning("浜у搧璇︽儏鏈�鍚庝竴鏉′笉鏄幓鐠冿紝璇峰畬鍠�")
+    return
+  }
+  let productName = ""
+  productDetailList.value.forEach(item =>{
+    switch(item.detailType){
+      case 'glass' :{
+        productName+=item.detail
+        break
+      }
+      case 'Interlayer' :{
+        productName+='+'+item.detail
+      }
+      case 'hollow' :{
+        productName+='*'+item.detail
+      }
+    }
+  })
+  productTotal.value.productName=productName
+  let product = {
+    title: productTotal.value,
+    detail:productDetailList.value
+  }
+  request.post(`/product/saveProduct`,product).then((res) =>{
+    if(res.code==200){
+      ElMessage.success(res.msg)
+    }
+  })
+}
+
 
 const reset = () => {
   processChecked.value=[]
@@ -72,6 +109,211 @@
     stuff.value[item]=''
   })
 }
+
+
+
+const glassSure =  () => {
+  let childName = ''
+  Object.keys(stuff.value).forEach((item,index)=>{
+    childName+=stuff.value[item]
+  })
+  let rege = /^\s*$/
+  if(rege.test(childName) || processChecked.value.length===0){
+    ElMessage.warning('璇疯緭鍏ヤ骇鍝佹潗鏂欏睘鎬т笌宸ヨ壓灞炴��')
+    return
+  }
+  let productDetail = {
+    detailType:'glass',
+    detail:childName,
+    process:processChecked.value.join('->'),
+    separation:Object.assign({}, stuff.value)
+  }
+  if(glassFlag.value.flag){
+    if(productDetailList.value.length ===0 ){
+      productDetailList.value.push(productDetail)
+    }else{
+      if (productDetailList.value[productDetailList.value.length-1].detailType === 'glass') {
+        ElMessage.warning('璇峰厛閫夋嫨闂撮殧鐗�')
+        return
+      }
+      productDetailList.value.push(productDetail)
+    }
+  }else{
+    productDetailList.value[glassFlag.value.index] = productDetail
+  }
+  reset()
+
+
+}
+
+//娣诲姞涓┖闂撮殧鐗�
+const addHollow = () => {
+  let childName = ''
+  try {
+    Object.keys(hollowBasic.value).forEach((item, index) => {
+      if (hollowBasic.value[item] === '') {
+        throw new Error("璇烽�夋嫨鍏ㄩ儴涓┖闂撮殧鐗╀笅鎷夋")
+      }
+      childName += hollowBasic.value[item]
+    })
+  }catch (e){
+    ElMessage.warning(e.message)
+    return
+  }
+
+  let hollowDetail = {
+    detailType:'hollow',
+    detail:childName,
+    separation:Object.assign({}, hollowBasic.value)
+  }
+  if(hollowFlag.value.flag){
+    if (productDetailList.value.length ===0) {
+      ElMessage.warning('璇峰厛閫夋嫨浜у搧')
+      return
+    }else if(productDetailList.value[productDetailList.value.length-1].detailType !== 'glass'){
+      ElMessage.warning('璇峰厛閫夋嫨浜у搧')
+      return
+    }
+    productDetailList.value.push(Object.assign({},hollowDetail))
+  }else {
+    productDetailList.value[hollowFlag.value.index] = hollowDetail
+  }
+  Object.keys(hollowBasic.value).forEach((item,index)=>{
+    hollowBasic.value[item]=''
+  })
+
+}
+//娣诲姞澶瑰眰闂撮殧鐗�
+const addInterlayer = () => {
+  let childName = ''
+  try {
+    Object.keys(InterlayerBasic.value).forEach((item, index) => {
+      if (InterlayerBasic.value[item] === '') {
+        throw new Error("璇烽�夋嫨鍏ㄩ儴涓┖闂撮殧鐗╀笅鎷夋")
+      }
+      childName += InterlayerBasic.value[item]
+    })
+  }catch (e){
+    ElMessage.warning(e.message)
+    return
+  }
+  let InterlayerDetail = {
+    detailType:'Interlayer',
+    detail:childName,
+    separation:Object.assign({}, InterlayerBasic.value)
+  }
+  if(InterlayerFlag.value.flag){
+    if (productDetailList.value.length ===0) {
+      ElMessage.warning('璇峰厛閫夋嫨浜у搧')
+      return
+    }else if(productDetailList.value[productDetailList.value.length-1].detailType !== 'glass'){
+      ElMessage.warning('璇峰厛閫夋嫨浜у搧')
+      return
+    }
+    productDetailList.value.push(Object.assign({},InterlayerDetail))
+  }else{
+    productDetailList.value[InterlayerFlag.value.index] = InterlayerDetail
+  }
+  Object.keys(InterlayerBasic.value).forEach((item,index)=>{
+    InterlayerBasic.value[item]=''
+  })
+}
+
+
+const deleteProductDetail =  (index) => {
+  const detailType = productDetailList.value[index].detailType
+  switch (detailType) {
+    case 'glass':{
+      glassFlag.value = {
+        flag:true,
+        index:null
+      }
+      break
+    }
+    case 'Interlayer':{
+      InterlayerFlag.value = {
+        flag:true,
+        index:null
+      }
+      break
+    }
+    case 'hollow':{
+      hollowFlag.value = {
+        flag:true,
+        index:null
+      }
+    }
+  }
+  productDetailList.value.splice(index,1)
+}
+
+let glassFlag = ref({
+  flag:true,
+  index:null
+})
+const updateGlass = (index) => {
+  stuff.value = productDetailList.value[index].separation
+  processChecked.value = productDetailList.value[index].process.split("->")
+  glassFlag.value.flag=false
+  glassFlag.value.index=index
+}
+const updateGlassSure = ()=> {
+  glassSure()
+  glassFlag.value.flag=true
+  glassFlag.value.index=null
+}
+
+
+let InterlayerFlag = ref({
+  flag:true,
+  index:null
+})
+const updateInterlayer  = (index) => {
+  InterlayerBasic.value = productDetailList.value[index].separation
+  InterlayerFlag.value.flag=false
+  InterlayerFlag.value.index=index
+}
+
+const updateInterlayerSure = () => {
+  addInterlayer()
+  InterlayerFlag.value.flag=true
+  InterlayerFlag.value.index=null
+}
+
+let  hollowFlag = ref({
+  flag:true,
+  index:null
+})
+const updateHollow = (index) => {
+  hollowBasic.value = productDetailList.value[index].separation
+  hollowFlag.value.flag=false
+  hollowFlag.value.index=index
+}
+
+const updateHollowSure = () => {
+  addHollow()
+  hollowFlag.value.flag=true
+  hollowFlag.value.index=null
+}
+const productName = computed(() =>{
+  let productName = ""
+  productDetailList.value.forEach(item =>{
+    switch(item.detailType){
+      case 'glass' :{
+        productName+=item.detail
+        break
+      }
+      case 'Interlayer' :{
+        productName+='+'+item.detail
+      }
+      case 'hollow' :{
+        productName+='*'+item.detail
+      }
+    }
+  })
+  return productName
+})
+
 </script>
 
 <template>
@@ -180,6 +422,7 @@
       <div class="glass-spacer">
         <div class="glass-spacer-jc">
           <el-select
+              v-model="hollowBasic.thickness"
               size="small"
               style="width: 100px"
               clearable placeholder="*涓┖鍘氬害:" >
@@ -190,6 +433,7 @@
             />
           </el-select>
           <el-select
+              v-model="hollowBasic.gasType"
               size="small"
               style="width: 100px"
               clearable placeholder="*鍏呮皵鏂瑰紡:" >
@@ -200,6 +444,7 @@
             />
           </el-select>
           <el-select
+              v-model="hollowBasic.Type"
               size="small"
               style="width: 100px"
               clearable placeholder="*灏佽兌:" >
@@ -210,6 +455,7 @@
             />
           </el-select>
           <el-select
+              v-model="hollowBasic.GlueDepth"
               size="small"
               style="width: 100px"
               clearable placeholder="*榛樿鑳舵繁:" >
@@ -220,13 +466,21 @@
             />
           </el-select>
           <el-button
+              v-if="hollowFlag.flag"
+              @click="addHollow"
               size="small"
               type="primary"
               round>涓┖闂撮殧鐗�</el-button>
-
+          <el-button
+              v-else
+              @click="updateHollowSure"
+              size="small"
+              type="primary"
+              round>澶瑰眰闂撮殧鐗╀慨鏀�</el-button>
         </div>
         <div class="glass-spacer-zk">
           <el-select
+              v-model="InterlayerBasic.thickness"
               size="small"
               style="width: 100px"
               clearable placeholder="*澶瑰眰鍘氬害:" >
@@ -237,6 +491,7 @@
             />
           </el-select>
           <el-select
+              v-model="InterlayerBasic.type"
               size="small"
               style="width: 100px"
               clearable placeholder="*绫诲瀷:" >
@@ -247,6 +502,7 @@
             />
           </el-select>
           <el-select
+              v-model="InterlayerBasic.color"
               size="small"
               style="width: 100px"
               clearable placeholder="*棰滆壊:" >
@@ -257,10 +513,19 @@
             />
           </el-select>
           <el-button
+              v-if="InterlayerFlag.flag"
+              @click="addInterlayer"
               size="small"
               type="primary"
               style="margin-left: 100px"
               round>澶瑰眰闂撮殧鐗�</el-button>
+          <el-button
+              v-else
+              @click="updateInterlayerSure"
+              size="small"
+              type="primary"
+              style="margin-left: 100px"
+              round>澶瑰眰闂撮殧鐗╀慨鏀�</el-button>
         </div>
       </div>
       <div class="line"/>
@@ -302,10 +567,16 @@
             </el-col>
             <el-col :span="3">
               <div class="grid-content ep-bg-purple" >
-                <el-button
+                <el-button v-if="glassFlag.flag"
+                    @click="glassSure"
                     size="small"
                     type="primary"
                     round>纭</el-button>
+                <el-button v-else
+                           @click="updateGlassSure"
+                           size="small"
+                           type="primary"
+                           round>淇敼</el-button>
               </div>
             </el-col>
           </el-row>
@@ -368,64 +639,57 @@
           </el-col>
           <el-col :span="20">
             <div class="grid-content ep-bg-purple" >
-              <el-input size="large" disabled  />
+              <el-input :value="productName" size="large" disabled  />
             </div>
           </el-col>
         </el-row>
       </div>
 
       <div class="glass-part-detail">
-        <el-row style="width: 90%" >
-          <el-col :span="4">
+        <el-row style="width: 90%"  v-for="(item,index) in productDetailList">
+          <el-col :span="4" v-show="item.detailType === 'glass'">
             <el-button
+                @click = "updateGlass(index)"
                 size="small"
-                type="primary"
-                round>淇敼鐜荤拑</el-button>
+                type="primary">淇敼鐜荤拑</el-button>
+          </el-col>
+          <el-col :span="4" v-show="item.detailType === 'Interlayer'">
+            <el-button
+                @click = "updateInterlayer(index)"
+                size="small"
+                type="primary">淇敼澶瑰眰</el-button>
+          </el-col>
+          <el-col :span="4" v-show="item.detailType === 'hollow'">
+            <el-button
+                @click = "updateHollow(index)"
+                size="small"
+                type="primary">淇敼涓┖</el-button>
           </el-col>
           <el-col :span="16">
             <el-input
+                :value="item.detail"
                 value="5mm鐧界幓"
                 size="small"
                 disabled  />
           </el-col>
-        </el-row>
-        <el-row style="width: 90%" >
-          <el-col :span="4">
+          <el-col
+              v-show="index+1 === productDetailList.length"
+              :span="4">
             <el-button
+                @click="deleteProductDetail(index)"
                 size="small"
-                type="primary"
-                round>淇敼澶瑰眰</el-button>
-          </el-col>
-          <el-col :span="16">
-            <el-input
-                value="5mmPVB閫忔槑"
-                size="small"
-                disabled  />
-          </el-col>
-        </el-row>
-        <el-row style="width: 90%" >
-          <el-col :span="4">
-            <el-button
-                size="small"
-                type="primary"
-                round>淇敼鐜荤拑</el-button>
-          </el-col>
-          <el-col :span="16">
-            <el-input
-                value="5mm鐧界幓"
-                size="small"
-                disabled  />
+                type="primary">鍒犻櫎</el-button>
           </el-col>
         </el-row>
 
       </div>
       <el-button
+          @click="saveProduct"
           style="float: right;
           margin-right: 0.5rem;"
-
           size="large"
           type="primary"
-          round>閲嶇疆</el-button>
+          round>鍒涘缓</el-button>
     </div>
   </div>
 </template>
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
index 8b1bd26..a4ac0ee 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -12,6 +12,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import java.sql.Date;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/processCard")
@@ -45,7 +46,7 @@
 
     public Result DetailsSelect(
             @PathVariable String orderId,
-            @RequestBody FlowCard  flowCard){
+            @RequestBody FlowCard flowCard){
         return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard));
 
     }
@@ -65,15 +66,41 @@
         }
     }
 
-    //鍒嗘灦鏄庣粏鏌ヨ
+    //淇敼鎺掔増鐘舵��
+    @PostMapping("/updateLayoutStatus/{processId}")
+    public Result updateLayoutStatus(
+            @PathVariable String processId
+    ){
+        System.out.println(flowCardService.UpdateLayoutStatusSv(processId));
+        if(flowCardService.UpdateLayoutStatusSv(processId)){
+            return Result.seccess();
+        }else {
+            throw new ServiceException(Constants.Code_500,"淇敼澶辫触");
+
+        }
+    }
+
+    //鍒嗘灦鏂板鏄庣粏鏌ヨ
     @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
 
     public Result SelectNoCard(
             @PathVariable String orderId,
             @PathVariable String productionId,
-            @RequestBody FlowCard  flowCard){
+            @RequestBody FlowCard flowCard){
         return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard));
 
     }
 
+    //娣诲姞娴佺▼鍗�
+    @PostMapping("/addFlowCard")
+    public Result AddOrderWork( @RequestBody Map<String,Object> object){
+        System.out.println("obj:"+object);
+        if(flowCardService.AddFlowCardSv(object)){
+            return Result.seccess();
+        }else {
+            throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触");
+
+        }
+    }
+
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
index 9674f9b..420402c 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -8,6 +8,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/product")
@@ -19,4 +20,9 @@
     public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){
         return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product));
     }
+
+    @PostMapping("/saveProduct")
+    public Result saveProduct(@RequestBody Map<String,Object> product){
+        return Result.seccess(productService.saveProduct(product));
+    }
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java b/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java
index 93f5d95..ae44e31 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java
@@ -20,12 +20,14 @@
     private String productionId;
     //娴佺▼鍗″彿
     private String processId;
+    //钀芥灦椤哄簭
+    private Integer landingSequence;
     //搴忓彿
     private Integer orderNumber;
     //宸ヨ壓纭搴忓彿
     private Integer technologyNumber;
     //鍒嗘灦鏁伴噺
-    private Integer binningQuantity;
+    private Integer quantity;
     //宸蹭紭鍖栨暟閲�
     private Integer optimizeQuantity;
     //鎺掔増鐘舵��
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java
index 7e8fd71..5f2c59f 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/ProductDetail.java
@@ -6,15 +6,16 @@
 
 
 import java.time.LocalDate;
+import java.util.Map;
 
 
 @Data
 public class ProductDetail    {
     @TableId(type = IdType.AUTO)
     private Long id;
-    private String prodId;
-    private String sortNum;
-    private String glassSort;
+    private Long prodId;
+    private Integer sortNum;
+    private Integer glassSort;
     private String detailType;
     private String detail;
     private Integer glassGroup;
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
index 41bb073..0c1003d 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -21,8 +21,27 @@
     //鍒嗘灦鏄庣粏鏌ヨ
     List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard);
 
+    //鍒犻櫎宸ュ崟
     Boolean DeleteFlowCardMp(String orderId, String processId);
 
-    
+    //鍒嗘灦鏂板鏄庣粏鏌ヨ
     List<Map<String,String>> SelectNoCardMp(String orderId, String productionId, FlowCard flowCard);
+
+    //淇敼鎺掔増鐘舵��
+    Boolean UpdateLayoutStatusMp(String processId);
+
+    Integer SelectLayoutStatus(String processId);
+
+    Integer ReportingWorkCount(String processId);
+
+    Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName);
+
+    Boolean UpdateFlowState(String productionId, Integer orderNumber);
+
+    Integer SelectFlowCount(String productionId);
+
+
+    Boolean UpdateProcessingCard(String productionId, int state);
+
+    Boolean UpdateDeleteState(String orderId, String processId);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java
index 8411012..d8b8444 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java
@@ -9,4 +9,5 @@
 public interface ProductDetailMapper {
     List<ProductDetail> getGlassDetailList();
 
+    boolean insertList(List<ProductDetail> getProductDetails);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java
index f06dbb8..b3d2ca5 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductMapper.java
@@ -1,5 +1,6 @@
 package com.example.erp.mapper.sd;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.example.erp.entity.sd.Product;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -7,7 +8,7 @@
 import java.util.List;
 
 @Mapper
-public interface ProductMapper {
+public interface ProductMapper extends BaseMapper<Product> {
     List<Product> defaultProduct(@Param("offset") Integer offset,
                                  @Param("pageSize") Integer pageSiz,
                                  @Param("glassTypeId") String glassTypeId,
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
index 0066131..93efb63 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -1,6 +1,8 @@
 
 package com.example.erp.service.pp;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.example.erp.entity.pp.FlowCard;
 import com.example.erp.entity.sd.Order;
@@ -12,47 +14,117 @@
 
 import java.sql.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 @Service
 @DS("pp")
 public class FlowCardService {
     @Autowired
-     FlowCardMapper flowCardMapper;
+    FlowCardMapper flowCardMapper;
 
-    public Map<String, Object>  selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) {
+    //娴佺▼鍗$鐞嗘煡璇�
+    public Map<String, Object> selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
         //System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
-        map.put("data", flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard));
+        map.put("data", flowCardMapper.selectFlowCard(selectTime1, selectTime2, flowCard));
         return map;
     }
 
-
+    //鍒嗘灦鏌ヨ
     public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
-        map.put("data", flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, flowCard));
+        map.put("data", flowCardMapper.selectFlowCardMp(selectTime1, selectTime2, flowCard));
         return map;
     }
 
+    //鍒嗘灦鏄庣粏鏌ヨ
     public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
-        map.put("data", flowCardMapper.DetailsSelectMp( orderId, flowCard));
+        map.put("data", flowCardMapper.DetailsSelectMp(orderId, flowCard));
         return map;
     }
 
+    //鍒犻櫎宸ュ崟
     public Boolean DeleteFlowCardSv(String orderId, String processId) {
-        if (!orderId.isEmpty()&&!processId.isEmpty()){
-            flowCardMapper.DeleteFlowCardMp(orderId, processId);
-            return true;
-        }
-        else {
+        if (!orderId.isEmpty() && !processId.isEmpty()) {
+            Integer count=flowCardMapper.ReportingWorkCount(processId);
+            if (count==0){
+                //淇敼鍒嗘灦鐘舵��
+                flowCardMapper.UpdateDeleteState(orderId, processId);
+                //鍒犻櫎鍒嗘灦鏄庣粏
+                flowCardMapper.DeleteFlowCardMp(orderId, processId);
+                return true;
+            }
+            else {
+                return false;
+            }
+
+        } else {
             return false;
         }
     }
 
+    //鍒嗘灦鏂板鏄庣粏鏌ヨ
     public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) {
         Map<String, Object> map = new HashMap<>();
-        map.put("data", flowCardMapper.SelectNoCardMp( orderId,productionId, flowCard));
+        map.put("data", flowCardMapper.SelectNoCardMp(orderId, productionId, flowCard));
         return map;
     }
+
+
+    //淇敼鎺掔増鐘舵��
+    public Boolean UpdateLayoutStatusSv(String processId) {
+
+        if (!processId.isEmpty()) {
+            Integer Status = flowCardMapper.SelectLayoutStatus(processId);
+            if (Status == 1) {
+                flowCardMapper.UpdateLayoutStatusMp(processId);
+            } else {
+                return false;
+            }
+
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public Boolean AddFlowCardSv(Map<String, Object> object) {
+        String userName = "";
+        if (object.get("userName") != null) {
+            userName = object.get("userName").toString();
+        }
+
+        String productionId = "";
+        if (object.get("productionId") != null) {
+            productionId = object.get("productionId").toString();
+        }
+
+        List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
+        if (!FlowCardList.isEmpty()) {
+            for (FlowCard flowCard : FlowCardList) {
+                //娣诲姞娴佺▼鍗℃暟鎹�
+                flowCardMapper.AddFlowCardMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getLandingSequence(),flowCard.getQuantity(),productionId,userName);
+                //淇敼鍒嗘灦鐘舵�侊紝灏嗙姸鎬佹敼涓�1
+                flowCardMapper.UpdateFlowState(productionId,flowCard.getOrderNumber());
+                //鏌ヨ璇ヨ鍗曟湭鍒嗘灦鏁伴噺
+               Integer FlowCount= flowCardMapper.SelectFlowCount(productionId);
+
+               if (FlowCount==0){
+                   //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负2
+                   System.out.println("鎴戞潵璇曡瘯1");
+                   flowCardMapper.UpdateProcessingCard(productionId,2);
+               }
+               else{
+                   //淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬佷负1,鏈叏閮ㄥ垎鏋跺畬鎴�
+                   System.out.println("鎴戞潵璇曡瘯2");
+                   flowCardMapper.UpdateProcessingCard(productionId,1);
+               }
+            }
+            return  true;
+        } else {
+            return  false;
+        }
+    }
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
index c917a79..a469aca 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java
@@ -36,6 +36,7 @@
 
     public Map<String, Object> AddDateWork(String orderId, OrderDetail orderDetail) {
         Map<String, Object> map = new HashMap<>();
+
         map.put("data", workOrderMapper.addWordOrder(orderId, orderDetail));
         return map;
     }
@@ -57,22 +58,29 @@
 
         if (!orderDetaillist.isEmpty()) {
             for (OrderDetail orderDetail : orderDetaillist) {
+                //鐢熸垚鐢熶骇璁㈠崟鍙�
+
                 for (int i = 0; i < count; i++) {
                     letters = lettr++;
                     productIdVl = orderID + letters;
+                    //鏌ヨ鐢熸垚鐨勭敓浜ц鍗曞彿鏄惁瀛樺湪
+
                     Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl);
-                    if (workCount < 1) {
+                    System.out.println("鐢熶骇璁㈠崟鍙凤細" + productIdVl + " 鏌ヨ缁撴灉锛�" + workCount);
+                    if (workCount < 1 ) {
                         break;
                     }
 
                 }
-                System.out.println(productIdVl);
+
+                //娣诲姞鐢熶骇璁㈠崟
                 workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName);
                 Integer State = 2;
                 Integer States = 1;
+                //鏌ヨ璇ヨ鍗曟湭杞敓浜ц鍗曠殑鏉℃暟
                 Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderDetail.getOrderId());
-                System.out.println(NoWorkCount);
                 if (NoWorkCount == 0) {
+                    //鏉℃暟涓�0淇敼杞敓浜ц鍗曠姸鎬佷负2锛屽惁鍒欎负1
                     workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), State);
                 } else {
                     workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), States);
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
index 15f2563..b048dae 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
@@ -1,20 +1,36 @@
 package com.example.erp.service.sd;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.example.erp.entity.sd.Product;
+import com.example.erp.entity.sd.ProductDetail;
+import com.example.erp.mapper.sd.ProductDetailMapper;
 import com.example.erp.mapper.sd.ProductMapper;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.text.DecimalFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 @Service
 @DS("sd")
+@Transactional
 public class ProductService {
-    @Autowired
+    private final
     ProductMapper productMapper;
+    private final
+    ProductDetailMapper productDetailMapper;
+
+    public ProductService(ProductMapper productMapper, ProductDetailMapper productDetailMapper) {
+        this.productMapper = productMapper;
+        this.productDetailMapper = productDetailMapper;
+    }
+//浜у搧鏌ヨ鏂规硶
     public Map<String,Object> defaultDateProduct(Integer pageNum, Integer pageSize, List<String> glassType, Product product) {
         Integer offset = (pageNum-1)*pageSize;
         String glassTypeId = null;
@@ -27,5 +43,76 @@
         return map;
     }
 
+//浜у搧淇濆瓨鏂规硶
+    public boolean saveProduct(Map<String,Object>  productObject) {
+        //鎶婁紶鍏ヤ富闄勮〃鐨刼bject绫诲瀷杞崲鎴愬疄浣撶被绫诲瀷
+        JSONObject productJson = new JSONObject(productObject);
+        Product product = JSONObject.parseObject(JSONObject.toJSONString(productJson.get("title")), Product.class);
+        List<ProductDetail> productDetails = JSONArray.parseArray(JSONObject.toJSONString(productJson.get("detail")), ProductDetail.class);
 
+        //瀹屽杽涓婚檮琛ㄤ俊鎭苟杩斿洖
+        Map<String,Object> getProductJson = updateProduct(productDetails,product);
+        Product getProduct = JSONObject.parseObject(JSONObject.toJSONString(getProductJson.get("title")), Product.class);
+        List<ProductDetail> getProductDetails = JSONArray.parseArray(JSONObject.toJSONString(getProductJson.get("detail")), ProductDetail.class);
+
+        //鎻掑叆涓昏〃鏁版嵁
+        productMapper.insert(getProduct);
+        //缁欏壇琛ㄦ坊鍔犱骇鍝乮d
+        for (ProductDetail getProductDetail : getProductDetails) {
+            getProductDetail.setProdId(getProduct.getId());
+        }
+        //鎻掑叆鍓〃
+        productDetailMapper.insertList(getProductDetails);
+
+        return false;
+
+    }
+
+    private Map<String,Object> updateProduct(List<ProductDetail> productDetailList,Product product) {
+        Map<String,Object> map = new HashMap<>();
+        //瀹氫箟浜у搧鐜荤拑鍘氬害绱姞
+        double thickness1 = 0;
+        //瀹氫箟浜у搧鎬诲帤搴︾疮鍔�
+        double totalThickness = 0;
+        //瀹氫箟蹇�熸煡璇�
+        StringBuilder query = new StringBuilder();
+
+        //瀹氫箟鍓〃鐜荤拑涓庨棿闅旂墿鎺掑簭
+        int sortNum = 0;
+        //瀹氫箟鍓〃鐜荤拑鎺掑簭
+        int glassSort = 0;
+        //瀹氫箟鍓〃涓┖鍒嗙粍
+        int glassGroup = 1;
+
+        for (ProductDetail productDetail : productDetailList) {
+            sortNum+=1;
+            productDetail.setSortNum(sortNum);
+
+            JSONObject separation = JSONObject.parseObject( productDetail.getSeparation());
+            String  getThickness = (String) separation.get("thickness");
+            double thicknessDetail = Double.parseDouble(getThickness.replace("mm",""));
+            totalThickness += thicknessDetail;
+
+            if(Objects.equals(productDetail.getDetailType(), "glass")){
+                glassSort+=1;
+                productDetail.setGlassSort(glassSort);
+                productDetail.setGlassGroup(glassGroup);
+                thickness1 += thicknessDetail;
+                DecimalFormat decimalFormat = new DecimalFormat("###");
+                query.append(decimalFormat.format(thicknessDetail));
+            }
+            else if (Objects.equals(productDetail.getDetailType(), "Interlayer")) {
+                query.append("+");
+            }else if(Objects.equals(productDetail.getDetailType(), "hollow")){
+                glassGroup+=1;
+                query.append("*");
+            }
+        }
+        product.setThickness(thickness1);
+        product.setTotalThickness(totalThickness);
+        product.setQuery(String.valueOf(query));
+        map.put("title",product);
+        map.put("detail",productDetailList);
+        return map;
+    }
 }
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 c5a9831..9383dd5 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -6,7 +6,7 @@
     <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard">
         <result column="order_id" property="orderId"/>
         <result column="process_Id" property="processId"/>
-        <result column="binning_quantity" property="binningQuantity"/>
+        <result column="quantity" property="quantity"/>
         <result column="founder" property="founder"/>
         <result column="create_time" property="createTime"/>
         <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
@@ -48,6 +48,7 @@
         <result column="g_type" property="glassTypes.type"/>-->
 
     </resultMap>
+    <!--    娴佺▼鍗$鐞嗘煡璇�-->
     <select id="selectFlowCard" resultMap="flowCardMap">
         select
         a.order_Id,
@@ -55,41 +56,35 @@
         c.product_id,
         c.product_name,
         b.project,
-        a.binning_quantity,
+        a.quantity,
         c.compute_gross_area,
         a.founder,
         c.processing_note
         from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
         left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
         where a.create_time between #{selectTime1} and #{selectTime2}
-        <!--        <where>-->
-        <!--            <if test="flowCard.orderId != null and flowCard.orderId != ''">-->
-        <!--                and a.order_id regexp #{flowCard.orderId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.productionId != null and flowCard.productionId != ''">-->
-        <!--                and a.process_Id regexp #{flowCard.productionId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">-->
-        <!--                and c.product_id regexp #{flowCard.orderDetail.productId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">-->
-        <!--                and c.product_name regexp #{flowCard.orderDetail.productName}-->
-        <!--            </if>-->
+                    <if test="flowCard.orderId != null and flowCard.orderId != ''">
+                        and a.order_id regexp #{flowCard.orderId}
+                    </if>
+                    <if test="flowCard.productionId != null and flowCard.productionId != ''">
+                        and a.process_Id regexp #{flowCard.productionId}
+                    </if>
+                    <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
+                        and c.product_id regexp #{flowCard.orderDetail.productId}
+                    </if>
+                    <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
+                        and c.product_name regexp #{flowCard.orderDetail.productName}
+                    </if>
 
-        <!--            <if test="flowCard.order.project != null and flowCard.order.project!= ''">-->
-        <!--                and b.project regexp #{flowCard.order.project}-->
-        <!--            </if>-->
+                    <if test="flowCard.order.project != null and flowCard.order.project!= ''">
+                        and b.project regexp #{flowCard.order.project}
+                    </if>
 
 
-        <!--            <if test="flowCard.createTime != null and flowCard.createTime != ''">-->
-        <!--                and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }-->
-        <!--            </if>-->
-
-        <!--        </where>-->
         group by a.process_Id;
     </select>
 
-
+    <!--鍒嗘灦鏌ヨ-->
     <select id="selectFlowCardMp" resultMap="flowCardMap">
         select o.order_id,
         o.customer_name,
@@ -102,46 +97,77 @@
         o.processing_note,
         o.delivery_address
         from sd.`order` as o
-        where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2}
-        <!--        <where>-->
-        <!--            <if test="flowCard.orderId != null and flowCard.orderId != ''">-->
-        <!--                and a.order_id regexp #{flowCard.orderId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.productionId != null and flowCard.productionId != ''">-->
-        <!--                and a.process_Id regexp #{flowCard.productionId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">-->
-        <!--                and c.product_id regexp #{flowCard.orderDetail.productId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">-->
-        <!--                and c.product_name regexp #{flowCard.orderDetail.productName}-->
-        <!--            </if>-->
+        left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
+        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
 
-        <!--            <if test="flowCard.order.project != null and flowCard.order.project!= ''">-->
-        <!--                and b.project regexp #{flowCard.order.project}-->
-        <!--            </if>-->
+        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
+            and o.order_id, regexp #{flowCard.order.orderId}
+        </if>
+        <if test="flowCard.order.customerName != null and flowCard.order.customerName != ''">
+            and o.customer_name regexp #{flowCard.order.customerName}
+        </if>
+        <if test="flowCard.order.project != null and flowCard.order.project != ''">
+            and o.project regexp #{flowCard.order.project}
+        </if>
+        <if test="flowCard.order.batch != null and flowCard.order.batch!= ''">
+            and o.batch regexp #{flowCard.order.batch}
+        </if>
 
+        <if test="flowCard.order.otherRemarks != null and flowCard.order.otherRemarks!= ''">
+            and o.other_remarks regexp #{flowCard.order.otherRemarks}
+        </if>
 
-        <!--        </where>-->
+        <if test="flowCard.order.icon != null and flowCard.order.icon!= ''">
+            and o.icon regexp #{flowCard.order.icon}
+        </if>
+        <if test="flowCard.order.orderType != null and flowCard.order.orderType!= ''">
+            and o.order_type regexp #{flowCard.order.orderType}
+        </if>
+        <if test="flowCard.order.salesman != null and flowCard.order.salesman!= ''">
+            and o.salesman regexp #{flowCard.order.salesman}
+        </if>
+        group by o.order_id
+
         ;
     </select>
 
+<!--    鍒嗘灦鏄庣粏鏌ヨ-->
     <select id="DetailsSelectMp" resultMap="flowCardMap">
         select od.order_id,
-               ogd.production_id,
-               od.product_id,
-               od.product_name,
-               od.quantity,
-               od.compute_gross_area,
-               od.perimeter
-        from sd.order_detail as od
-                 left join sd.order_glass_detail as ogd
-                           on od.order_id = ogd.order_id
-        where od.order_id = #{orderId}
+        ogd.production_id,
+        od.product_id,
+        od.product_name,
+        SUM( od.quantity) as quantity,
+        SUM(od.compute_gross_area) as compute_gross_area,
+        od.perimeter
+        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
+        where od.order_id = #{orderId} and ogd.splitting_status=0
+        <if test="flowCard.orderDetail.orderId != null and flowCard.orderDetail.orderId != ''">
+            and od.order_id regexp #{flowCard.orderDetail.orderId}
+        </if>
+        <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''">
+            and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}
+        </if>
+        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
+            and od.product_id regexp #{flowCard.orderDetail.productId}
+        </if>
+        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
+            and od.product_name regexp #{flowCard.orderDetail.productName}
+        </if>
         group by od.order_id, ogd.production_id
     </select>
 
+    <update id="UpdateDeleteState">
+        update sd.order_glass_detail as ogd
+        set ogd.production_id=null,
+            ogd.production_time=null,
+            ogd.founder=null
+        where ogd.production_id = #{processId}
 
+    </update>
+
+    <!--    鍒犻櫎娴佺▼鍗�-->
     <update id="DeleteFlowCardMp">
         update 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
@@ -149,43 +175,110 @@
             ogd.production_time=null,
             ogd.founder=null
         where od.order_id = #{orderId}
-          and od.product_name = #{productName}
+          and ogd.production_id = #{processId}
     </update>
-<!--resultMap="flowCardMap"-->
+
+    <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
+
+    <!--resultMap="flowCardMap"-->
     <select id="SelectNoCardMp" >
+
         select
+        od.order_number,
         od.order_number AS 'orderNumber',
         od.width,
         od.height,
         od.shape,
         od.quantity,
+        od.compute_gross_area,
+        p.total_thickness,
         od.quantity as baiscQuantity,
         od.compute_gross_area as 'computeGrossArea',
         p.total_thickness AS 'totalThickness',
         p.thickness,
         od.weight
         from
-
         sd.order_detail as od
-        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id
+        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
         left join sd.product as p on od.product_name=p.product_name
-        where od.order_id=#{orderId}and ogd.production_id=#{productionId}
-        <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''">
-            and od.order_number regexp #{flowCard.orderDetail.orderNumber}
-        </if>
-        <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
-            and od.width regexp #{flowCard.orderDetail.width}
-        </if>
-        <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
-            and od.height regexp #{flowCard.orderDetail.height}
-        </if>
-        <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''">
-            and od.shape regexp #{flowCard.orderDetail.shape}
-
-        </if>
+        where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
         GROUP BY od.order_number;
 
 
     </select>
 
+    <!--淇敼鎺掔増鐘舵��-->
+    <update id="UpdateLayoutStatusMp">
+        update flow_card as fc
+        set fc.layout_status=2
+        where fc.process_id = #{processId}
+    </update>
+
+<!--    鏌ヨ瀵瑰簲娴佺▼鍗″彿鎺掔増鐘舵��-->
+    <select id="SelectLayoutStatus">
+        select fc.layout_status
+        from flow_card as fc
+        where fc.process_id = #{processId}
+        LIMIT 1
+    </select>
+
+<!--    鏌ヨ鎶ュ伐琛ㄥ唴鏄惁鏈夊搴旀祦绋嬪崱-->
+    <select id="ReportingWorkCount">
+        select COUNT(rw.process_id)
+        from reporting_work as rw
+        where rw.process_id = #{processId}
+    </select>
+<!--    鎻掑叆Flow_card琛�-->
+    <insert id="AddFlowCardMp">
+        insert into
+            flow_card (
+            order_id,
+            production_id,
+            process_id,
+            landing_sequence,
+            order_number,
+            technology_number,
+            quantity,
+            founder,
+            splitFrame_time,
+            create_time
+        )
+        select
+            ogd.order_id,
+            ogd.production_id,
+            #{processId},
+            #{landingSequence},
+            ogd.order_number,
+            ogd.technology_number,
+            #{quantity},
+            #{userName},
+            NOW(),
+            NOW()
+
+
+
+        from sd.order_glass_detail as ogd
+        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
+        GROUP BY ogd.technology_number
+    </insert>
+
+<!--    鏇存柊鍒嗘灦鐘舵��-->
+    <update id="UpdateFlowState">
+        update sd.order_glass_detail as ogd
+        set ogd.splitting_status=1
+        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
+    </update>
+<!--    鏌ヨ鏈垎鏋剁殑鏉℃暟-->
+    <select id="SelectFlowCount">
+        select COUNT(*)
+        from sd.order_glass_detail as ogd
+        where ogd.order_id = left(#{productionId},10)
+          and ogd.splitting_status = 0
+    </select>
+<!--   淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬�-->
+    <update id="UpdateProcessingCard">
+        update sd.`order` as o
+        set o.processing_card=#{state}
+        where o.order_id=left(#{productionId},10)
+    </update>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
index 3eebdef..ab55593 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -110,15 +110,15 @@
 
     <select id="addWordOrder" >
         select od.order_id,
-               od.product_id,
-               od.product_name,
-               od.quantity,
-               od.compute_gross_area,
-               od.perimeter
-        from order_detail as od
-                 left join sd.order_glass_detail as ogd
-                           on od.order_id = ogd.order_id
-        where od.order_id = #{orderId}  and ISNULL(ogd.production_id)
+        od.product_id,
+        od.product_name,
+        sum( od.quantity) as quantity,
+        od.compute_gross_area,
+        od.perimeter
+        from sd.order_detail as od
+        left join sd.order as o
+        on od.order_id =o.order_id
+        where od.order_id = #{orderId}  and  o.production_order!=2
         <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
             and od.order_id regexp #{orderDetail.orderId}
         </if>
@@ -132,8 +132,8 @@
         ;
     </select>
 
-    <select id="SelectOrderNumber" resultMap="wordOrderMap">
-        select count(ogd.production_id)
+    <select id="SelectOrderNumber" >
+        select ifnull(count(ogd.production_id),0)
         from sd.order_glass_detail as ogd
         where ogd.production_id = #{productIdVl}
     </select>
@@ -151,6 +151,7 @@
           and od.product_name = #{productName}
     </update>
 
+<!--    鍒犻櫎宸ュ崟-->
     <update id="DeleteOrderWorkMp">
         update 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
diff --git a/north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml b/north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml
index 77dd64b..042d336 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/ProductDetail.xml
@@ -6,4 +6,23 @@
     <select id="getGlassDetailList">
         select * from product_detail where prod_id = #{productId} and detail_type = 'glass'
     </select>
+    
+    <insert id="insertList">
+        insert into product_detail (
+            prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation
+        )
+        values
+        <foreach collection ="getProductDetails" item="ProductDetail" separator =",">
+            (
+                #{ProductDetail.prodId},
+                #{ProductDetail.sortNum},
+                #{ProductDetail.glassSort},
+                #{ProductDetail.detailType},
+                #{ProductDetail.detail},
+                #{ProductDetail.glassGroup},
+                #{ProductDetail.process},
+               #{ProductDetail.separation}
+                )
+        </foreach>
+    </insert>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/pp/FolwCard.xml b/north-glass-erp/target/classes/mapper/pp/FolwCard.xml
index c5a9831..39f6e48 100644
--- a/north-glass-erp/target/classes/mapper/pp/FolwCard.xml
+++ b/north-glass-erp/target/classes/mapper/pp/FolwCard.xml
@@ -6,7 +6,7 @@
     <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard">
         <result column="order_id" property="orderId"/>
         <result column="process_Id" property="processId"/>
-        <result column="binning_quantity" property="binningQuantity"/>
+        <result column="quantity" property="quantity"/>
         <result column="founder" property="founder"/>
         <result column="create_time" property="createTime"/>
         <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
@@ -48,6 +48,7 @@
         <result column="g_type" property="glassTypes.type"/>-->
 
     </resultMap>
+    <!--    娴佺▼鍗$鐞嗘煡璇�-->
     <select id="selectFlowCard" resultMap="flowCardMap">
         select
         a.order_Id,
@@ -55,41 +56,35 @@
         c.product_id,
         c.product_name,
         b.project,
-        a.binning_quantity,
+        a.quantity,
         c.compute_gross_area,
         a.founder,
         c.processing_note
         from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
         left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
         where a.create_time between #{selectTime1} and #{selectTime2}
-        <!--        <where>-->
-        <!--            <if test="flowCard.orderId != null and flowCard.orderId != ''">-->
-        <!--                and a.order_id regexp #{flowCard.orderId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.productionId != null and flowCard.productionId != ''">-->
-        <!--                and a.process_Id regexp #{flowCard.productionId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">-->
-        <!--                and c.product_id regexp #{flowCard.orderDetail.productId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">-->
-        <!--                and c.product_name regexp #{flowCard.orderDetail.productName}-->
-        <!--            </if>-->
+                    <if test="flowCard.orderId != null and flowCard.orderId != ''">
+                        and a.order_id regexp #{flowCard.orderId}
+                    </if>
+                    <if test="flowCard.productionId != null and flowCard.productionId != ''">
+                        and a.process_Id regexp #{flowCard.productionId}
+                    </if>
+                    <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
+                        and c.product_id regexp #{flowCard.orderDetail.productId}
+                    </if>
+                    <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">
+                        and c.product_name regexp #{flowCard.orderDetail.productName}
+                    </if>
 
-        <!--            <if test="flowCard.order.project != null and flowCard.order.project!= ''">-->
-        <!--                and b.project regexp #{flowCard.order.project}-->
-        <!--            </if>-->
+                    <if test="flowCard.order.project != null and flowCard.order.project!= ''">
+                        and b.project regexp #{flowCard.order.project}
+                    </if>
 
 
-        <!--            <if test="flowCard.createTime != null and flowCard.createTime != ''">-->
-        <!--                and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }-->
-        <!--            </if>-->
-
-        <!--        </where>-->
         group by a.process_Id;
     </select>
 
-
+    <!--鍒嗘灦鏌ヨ-->
     <select id="selectFlowCardMp" resultMap="flowCardMap">
         select o.order_id,
         o.customer_name,
@@ -102,46 +97,77 @@
         o.processing_note,
         o.delivery_address
         from sd.`order` as o
-        where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2}
-        <!--        <where>-->
-        <!--            <if test="flowCard.orderId != null and flowCard.orderId != ''">-->
-        <!--                and a.order_id regexp #{flowCard.orderId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.productionId != null and flowCard.productionId != ''">-->
-        <!--                and a.process_Id regexp #{flowCard.productionId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">-->
-        <!--                and c.product_id regexp #{flowCard.orderDetail.productId}-->
-        <!--            </if>-->
-        <!--            <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">-->
-        <!--                and c.product_name regexp #{flowCard.orderDetail.productName}-->
-        <!--            </if>-->
+        left join sd.order_glass_detail ogd on o.order_id = ogd.order_id
+        where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2}
 
-        <!--            <if test="flowCard.order.project != null and flowCard.order.project!= ''">-->
-        <!--                and b.project regexp #{flowCard.order.project}-->
-        <!--            </if>-->
+        <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
+            and o.order_id, regexp #{flowCard.order.orderId}
+        </if>
+        <if test="flowCard.order.customerName != null and flowCard.order.customerName != ''">
+            and o.customer_name regexp #{flowCard.order.customerName}
+        </if>
+        <if test="flowCard.order.project != null and flowCard.order.project != ''">
+            and o.project regexp #{flowCard.order.project}
+        </if>
+        <if test="flowCard.order.batch != null and flowCard.order.batch!= ''">
+            and o.batch regexp #{flowCard.order.batch}
+        </if>
 
+        <if test="flowCard.order.otherRemarks != null and flowCard.order.otherRemarks!= ''">
+            and o.other_remarks regexp #{flowCard.order.otherRemarks}
+        </if>
 
-        <!--        </where>-->
+        <if test="flowCard.order.icon != null and flowCard.order.icon!= ''">
+            and o.icon regexp #{flowCard.order.icon}
+        </if>
+        <if test="flowCard.order.orderType != null and flowCard.order.orderType!= ''">
+            and o.order_type regexp #{flowCard.order.orderType}
+        </if>
+        <if test="flowCard.order.salesman != null and flowCard.order.salesman!= ''">
+            and o.salesman regexp #{flowCard.order.salesman}
+        </if>
+        group by o.order_id
+
         ;
     </select>
 
+<!--    鍒嗘灦鏄庣粏鏌ヨ-->
     <select id="DetailsSelectMp" resultMap="flowCardMap">
         select od.order_id,
-               ogd.production_id,
-               od.product_id,
-               od.product_name,
-               od.quantity,
-               od.compute_gross_area,
-               od.perimeter
-        from sd.order_detail as od
-                 left join sd.order_glass_detail as ogd
-                           on od.order_id = ogd.order_id
-        where od.order_id = #{orderId}
+        ogd.production_id,
+        od.product_id,
+        od.product_name,
+        SUM( od.quantity) as quantity,
+        SUM(od.compute_gross_area) as compute_gross_area,
+        od.perimeter
+        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
+        where od.order_id = #{orderId} and ogd.splitting_status=0
+        <if test="flowCard.orderDetail.orderId != null and flowCard.orderDetail.orderId != ''">
+            and od.order_id regexp #{flowCard.orderDetail.orderId}
+        </if>
+        <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''">
+            and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}
+        </if>
+        <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
+            and od.product_id regexp #{flowCard.orderDetail.productId}
+        </if>
+        <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
+            and od.product_name regexp #{flowCard.orderDetail.productName}
+        </if>
         group by od.order_id, ogd.production_id
     </select>
 
+    <update id="UpdateDeleteState">
+        update sd.order_glass_detail as ogd
+        set ogd.production_id=null,
+            ogd.production_time=null,
+            ogd.founder=null
+        where ogd.production_id = #{processId}
 
+    </update>
+
+    <!--    鍒犻櫎娴佺▼鍗�-->
     <update id="DeleteFlowCardMp">
         update 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
@@ -149,16 +175,23 @@
             ogd.production_time=null,
             ogd.founder=null
         where od.order_id = #{orderId}
-          and od.product_name = #{productName}
+          and ogd.production_id = #{processId}
     </update>
-<!--resultMap="flowCardMap"-->
+
+    <!--    鍒嗘灦鏂板鏄庣粏鏌ヨ-->
+
+    <!--resultMap="flowCardMap"-->
     <select id="SelectNoCardMp" >
+
         select
+        od.order_number,
         od.order_number AS 'orderNumber',
         od.width,
         od.height,
         od.shape,
         od.quantity,
+        od.compute_gross_area,
+        p.total_thickness,
         od.quantity as baiscQuantity,
         od.compute_gross_area as 'computeGrossArea',
         p.total_thickness AS 'totalThickness',
@@ -167,25 +200,86 @@
         from
 
         sd.order_detail as od
-        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id
+        left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number
         left join sd.product as p on od.product_name=p.product_name
-        where od.order_id=#{orderId}and ogd.production_id=#{productionId}
-        <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''">
-            and od.order_number regexp #{flowCard.orderDetail.orderNumber}
-        </if>
-        <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
-            and od.width regexp #{flowCard.orderDetail.width}
-        </if>
-        <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
-            and od.height regexp #{flowCard.orderDetail.height}
-        </if>
-        <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''">
-            and od.shape regexp #{flowCard.orderDetail.shape}
-
-        </if>
+        where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0
         GROUP BY od.order_number;
 
 
     </select>
 
+    <!--淇敼鎺掔増鐘舵��-->
+    <update id="UpdateLayoutStatusMp">
+        update flow_card as fc
+        set fc.layout_status=2
+        where fc.process_id = #{processId}
+    </update>
+
+<!--    鏌ヨ瀵瑰簲娴佺▼鍗″彿鎺掔増鐘舵��-->
+    <select id="SelectLayoutStatus">
+        select fc.layout_status
+        from flow_card as fc
+        where fc.process_id = #{processId}
+        LIMIT 1
+    </select>
+
+<!--    鏌ヨ鎶ュ伐琛ㄥ唴鏄惁鏈夊搴旀祦绋嬪崱-->
+    <select id="ReportingWorkCount">
+        select COUNT(rw.process_id)
+        from reporting_work as rw
+        where rw.process_id = #{processId}
+    </select>
+<!--    鎻掑叆Flow_card琛�-->
+    <insert id="AddFlowCardMp">
+        insert into
+            flow_card (
+            order_id,
+            production_id,
+            process_id,
+            landing_sequence,
+            order_number,
+            technology_number,
+            quantity,
+            founder,
+            splitFrame_time,
+            create_time
+        )
+        select
+            ogd.order_id,
+            ogd.production_id,
+            #{processId},
+            #{landingSequence},
+            ogd.order_number,
+            ogd.technology_number,
+            #{quantity},
+            #{userName},
+            NOW(),
+            NOW()
+
+
+
+        from sd.order_glass_detail as ogd
+        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
+        GROUP BY ogd.technology_number
+    </insert>
+
+<!--    鏇存柊鍒嗘灦鐘舵��-->
+    <update id="UpdateFlowState">
+        update sd.order_glass_detail as ogd
+        set ogd.splitting_status=1
+        where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber}
+    </update>
+<!--    鏌ヨ鏈垎鏋剁殑鏉℃暟-->
+    <select id="SelectFlowCount">
+        select COUNT(*)
+        from sd.order_glass_detail as ogd
+        where ogd.order_id = left(#{productionId},10)
+          and ogd.splitting_status = 0
+    </select>
+<!--   淇敼璁㈠崟琛ㄥ垎鏋剁姸鎬�-->
+    <update id="UpdateProcessingCard">
+        update sd.`order` as o
+        set o.processing_card=#{state}
+        where o.order_id=left(#{productionId},10)
+    </update>
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/pp/WordOrder.xml b/north-glass-erp/target/classes/mapper/pp/WordOrder.xml
index 3eebdef..ab55593 100644
--- a/north-glass-erp/target/classes/mapper/pp/WordOrder.xml
+++ b/north-glass-erp/target/classes/mapper/pp/WordOrder.xml
@@ -110,15 +110,15 @@
 
     <select id="addWordOrder" >
         select od.order_id,
-               od.product_id,
-               od.product_name,
-               od.quantity,
-               od.compute_gross_area,
-               od.perimeter
-        from order_detail as od
-                 left join sd.order_glass_detail as ogd
-                           on od.order_id = ogd.order_id
-        where od.order_id = #{orderId}  and ISNULL(ogd.production_id)
+        od.product_id,
+        od.product_name,
+        sum( od.quantity) as quantity,
+        od.compute_gross_area,
+        od.perimeter
+        from sd.order_detail as od
+        left join sd.order as o
+        on od.order_id =o.order_id
+        where od.order_id = #{orderId}  and  o.production_order!=2
         <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
             and od.order_id regexp #{orderDetail.orderId}
         </if>
@@ -132,8 +132,8 @@
         ;
     </select>
 
-    <select id="SelectOrderNumber" resultMap="wordOrderMap">
-        select count(ogd.production_id)
+    <select id="SelectOrderNumber" >
+        select ifnull(count(ogd.production_id),0)
         from sd.order_glass_detail as ogd
         where ogd.production_id = #{productIdVl}
     </select>
@@ -151,6 +151,7 @@
           and od.product_name = #{productName}
     </update>
 
+<!--    鍒犻櫎宸ュ崟-->
     <update id="DeleteOrderWorkMp">
         update 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
diff --git a/north-glass-erp/target/classes/mapper/sd/ProductDetail.xml b/north-glass-erp/target/classes/mapper/sd/ProductDetail.xml
index 77dd64b..042d336 100644
--- a/north-glass-erp/target/classes/mapper/sd/ProductDetail.xml
+++ b/north-glass-erp/target/classes/mapper/sd/ProductDetail.xml
@@ -6,4 +6,23 @@
     <select id="getGlassDetailList">
         select * from product_detail where prod_id = #{productId} and detail_type = 'glass'
     </select>
+    
+    <insert id="insertList">
+        insert into product_detail (
+            prod_id, sort_num, glass_sort, detail_type, detail, glass_group, process,separation
+        )
+        values
+        <foreach collection ="getProductDetails" item="ProductDetail" separator =",">
+            (
+                #{ProductDetail.prodId},
+                #{ProductDetail.sortNum},
+                #{ProductDetail.glassSort},
+                #{ProductDetail.detailType},
+                #{ProductDetail.detail},
+                #{ProductDetail.glassGroup},
+                #{ProductDetail.process},
+               #{ProductDetail.separation}
+                )
+        </foreach>
+    </insert>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0