From eb8fbf0c3736ef329f1844d7eb135a254740268b Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 08 四月 2024 11:11:26 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/CreateOutBound.vue |  162 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 104 insertions(+), 58 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/CreateOutBound.vue b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/CreateOutBound.vue
index 1076662..6aeb84f 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/CreateOutBound.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/CreateOutBound.vue
@@ -72,10 +72,13 @@
   warehouseManager:userStore.user.userName
 })
 
-//绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹�
 let filterData = ref({
 
 
+})
+
+let optimizeUse = ref({
+  id:0
 })
 
 let BasicData = ref([])
@@ -88,6 +91,7 @@
   {field: 'inventoryOrganization', width:'150', title: '搴撳瓨缁勭粐', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged },
   {field: 'materialCode', width: '150',title: '鐗╂枡缂栫爜', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
   {field: 'producer', width: '100',title: '浜у湴', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
+  {field: 'projectNo', width: '100',title: '宸ョ▼鍙�', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
   {field: 'inventoryQuantity',width: '100', title: '搴撳瓨鏁伴噺', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
   {field: 'availableQuantity', width: '100',title: '鍙敤搴撳瓨', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged},
   {field: 'outboundQuantity', width:'150', title: '鍑哄簱鏁伴噺', sortable: true,editRender: { name: 'input', attrs: { placeholder: '' } }},
@@ -102,7 +106,9 @@
 request.get(`/BasicWarehouse/BasicWarehouseTypes/鏉愭枡鍑哄簱绫诲瀷`).then((res) => {
 
   if(res.code==200){
+
     titleSelectJson.value=deepClone(res.data)
+    console.log(titleSelectJson.value)
     const today = new Date
     today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000))
     titleUploadData.value.materialRequisitionDate = today.getFullYear() +
@@ -149,81 +155,121 @@
   addListener(xGrid.value,gridOptions,cellArea.value)
   //鍑哄簱鏂板
   const id = route.query.id
+  const type = route.query.type
   if (typeof id !== 'undefined' && id !== null && id !== '' && id !== '\n' && id !== '\r'){
-    filterData.value.stockId=id
-    number.value=id
-    console.log(filterData.value)
-    //绗竴娆¤皟鐢�
-    request.post("/MaterialInventory/getSelectMaterialInventory/1/100",filterData.value).then((res) => {
 
-      if(res.code==200){
+    if(type==='搴撳瓨'){
+      filterData.value.stockId=id
+      number.value=id
+      console.log(filterData.value)
+      request.post("/MaterialInventory/getSelectMaterialInventory/1/100",filterData.value).then((res) => {
 
-        console.log(res.data.data)
-        titleUploadData.value.warehouseManager=userStore.user.userName
-        titleUploadData.value.outboundType = titleSelectJson.value.outboundType[0].operateTypeName
-        materialStore.value=[]
-        for (let i=0;i<res.data.data.length;i++){
-          materialStore.value[i]=(res.data.data[i])
-          materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
+        if(res.code==200){
 
+          console.log(res.data.data)
+          titleUploadData.value.warehouseManager=userStore.user.userName
+          titleUploadData.value.outboundType = titleSelectJson.value.outboundType[0].operateTypeName
+          materialStore.value=[]
+          for (let i=0;i<res.data.data.length;i++){
+            materialStore.value[i]=(res.data.data[i])
+            materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
+
+          }
+
+          produceList = deepClone(materialStore.value)
+          xGrid.value.loadData(produceList)
+
+
+          //绂佺敤鎸夐挳
+          gridOptions.toolbarConfig.buttons[1].disabled  = true
+          gridOptions.toolbarConfig.buttons[2].disabled = true
+          //鏄剧ず澶嶉�夋
+          xGrid.value.showColumn("select")
+          gridOptions.loading=false
+        }else{
+          ElMessage.warning(res.msg)
         }
+      })
+    }else{
+      optimizeUse.value.rawStockCode=id
+      console.log(optimizeUse.value)
+      number.value=id
+      request.post("/MaterialInventory/getSelectMaterialInventoryEngineering/1/100",optimizeUse.value).then((res) => {
 
-        produceList = deepClone(materialStore.value)
-        xGrid.value.loadData(produceList)
+        if(res.code==200){
+
+          console.log(res.data.data)
+          titleUploadData.value.warehouseManager=userStore.user.userName
+          titleUploadData.value.outboundType = titleSelectJson.value.outboundType[0].operateTypeName
+          materialStore.value=[]
+          for (let i=0;i<res.data.data.length;i++){
+            materialStore.value[i]=(res.data.data[i])
+            materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
+
+          }
+
+          produceList = deepClone(materialStore.value)
+          xGrid.value.loadData(produceList)
 
 
-        //绂佺敤鎸夐挳
-        gridOptions.toolbarConfig.buttons[1].disabled  = true
-        gridOptions.toolbarConfig.buttons[2].disabled = true
-        //鏄剧ず澶嶉�夋
-        xGrid.value.showColumn("select")
-        gridOptions.loading=false
-      }else{
-        ElMessage.warning(res.msg)
-      }
-    })
+          //绂佺敤鎸夐挳
+          gridOptions.toolbarConfig.buttons[1].disabled  = true
+          gridOptions.toolbarConfig.buttons[2].disabled = true
+          //鏄剧ず澶嶉�夋
+          xGrid.value.showColumn("select")
+          gridOptions.loading=false
+        }else{
+          ElMessage.warning(res.msg)
+        }
+      })
+    }
+
+
   }
 //鍑哄簱缂栬緫
   const str = route.query.materialOutboundId
 
   if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){
-    filterData.value.materialOutboundId=str
-    console.log(filterData.value)
-    //绗竴娆¤皟鐢�
-    request.post("/MaterialInventory/getSelectMaterialOutbound/1/100",filterData.value).then((res) => {
 
-      if(res.code==200){
-        titleUploadData.value=deepClone(res.data.materialOutbound)
-        //鏍规嵁瀹℃牳鐘舵�佹樉绀哄鏍告寜閽垨鑰呮槸鍙嶅鎸夐挳
-        console.log(res.data.data)
-        if(titleUploadData.value.reviewedState!==0){
-          gridOptions.toolbarConfig.buttons[1].disabled = true
-          gridOptions.toolbarConfig.buttons[0].disabled = true
+      filterData.value.materialOutboundId=str
+      console.log(filterData.value)
+      //绗竴娆¤皟鐢�
+      request.post("/MaterialInventory/getSelectMaterialOutbound/1/100",filterData.value).then((res) => {
+
+        if(res.code==200){
+          titleUploadData.value=deepClone(res.data.materialOutbound)
+          //鏍规嵁瀹℃牳鐘舵�佹樉绀哄鏍告寜閽垨鑰呮槸鍙嶅鎸夐挳
+          console.log(res.data.data)
+          if(titleUploadData.value.reviewedState!==0){
+            gridOptions.toolbarConfig.buttons[1].disabled = true
+            gridOptions.toolbarConfig.buttons[0].disabled = true
 
 
+          }
+          if(titleUploadData.value.reviewedState===0){
+            gridOptions.toolbarConfig.buttons[2].disabled = true
+          }
+
+          materialStore.value=[]
+          for (let i=0;i<res.data.data.length;i++){
+            materialStore.value[i]=(res.data.data[i])
+            materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
+
+          }
+          produceList = deepClone(materialStore.value)
+          xGrid.value.loadData(produceList)
+          //闅愯棌澶嶉�夋
+          /*xGrid.value.hideColumn("select")
+          gridOptions.loading=false*/
+          xGrid.value.showColumn("select")
+          gridOptions.loading=false
+
+        }else{
+          ElMessage.warning(res.msg)
         }
-        if(titleUploadData.value.reviewedState===0){
-          gridOptions.toolbarConfig.buttons[2].disabled = true
-        }
+      })
 
-        materialStore.value=[]
-        for (let i=0;i<res.data.data.length;i++){
-          materialStore.value[i]=(res.data.data[i])
-          materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
 
-        }
-        produceList = deepClone(materialStore.value)
-        xGrid.value.loadData(produceList)
-        //闅愯棌澶嶉�夋
-        /*xGrid.value.hideColumn("select")
-        gridOptions.loading=false*/
-        xGrid.value.showColumn("select")
-        gridOptions.loading=false
-
-      }else{
-        ElMessage.warning(res.msg)
-      }
-    })
   }
 
 
@@ -375,7 +421,7 @@
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
   stripe:true,//鏂戦┈绾�
-  rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
   id: 'CustomerList',
   showFooter: true,//鏄剧ず鑴�
   printConfig: {},

--
Gitblit v1.8.0