From 43e115a7de2c763c36d79e610a3abb1d833ea892 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期一, 05 八月 2024 10:21:52 +0800
Subject: [PATCH] 修改发货报表

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue |  100 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 74 insertions(+), 26 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
index 424b032..24adc3c 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue
@@ -90,7 +90,7 @@
 
 //鑾峰彇涓冨ぉ鍓嶅埌褰撳墠鏃堕棿
 function getNowTime() {
-  const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3)
+  const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 15)
       .toISOString()
       .replace('T', ' ')
       .slice(0, 10) //榛樿寮�濮嬫椂闂�3澶╁墠
@@ -127,9 +127,10 @@
     titleSelectJson.value.processType = res.data.process
 
     gridOptions.loading = false
-    //绂佺敤鍒犻櫎銆佷繚瀛樻寜閽�
+    //绂佺敤鍒犻櫎銆佸鏍告寜閽�
     gridOptions.toolbarConfig.buttons[0].disabled = true
     gridOptions.toolbarConfig.buttons[1].disabled = true
+    gridOptions.toolbarConfig.buttons[2].disabled = true
   } else {
     ElMessage.warning(res.msg)
   }
@@ -154,21 +155,23 @@
       total.dataTotal = res.data.total.total * 1
       total.pageTotal = res.data.total.pageTotal
       pageTotal.value = res.data.total
-      xGrid.value.loadData(res.data.data)
       console.log(res.data.data)
+      xGrid.value.loadData(res.data.data)
       gridOptions.loading = false
       if (selectState==1){
         //绂佺敤鍒犻櫎銆佸鏍告寜閽�
         gridOptions.toolbarConfig.buttons[0].disabled = true
         gridOptions.toolbarConfig.buttons[1].disabled = true
+        gridOptions.toolbarConfig.buttons[2].disabled = true
         //鍚敤淇濆瓨
-        gridOptions.toolbarConfig.buttons[2].disabled = false
+        gridOptions.toolbarConfig.buttons[3].disabled = false
       }else{
-        //绂佺敤鍒犻櫎銆佸鏍告寜閽�
+        //鍚敤鍒犻櫎銆佸鏍告寜閽�
         gridOptions.toolbarConfig.buttons[0].disabled = false
         gridOptions.toolbarConfig.buttons[1].disabled = false
-        //鍚敤淇濆瓨
         gridOptions.toolbarConfig.buttons[2].disabled = false
+        //绂佺敤淇濆瓨
+        gridOptions.toolbarConfig.buttons[3].disabled = true
 
       }
     } else {
@@ -240,8 +243,8 @@
   keepSource: true,//淇濇寔婧愭暟鎹�
   align: 'center',//鏂囧瓧灞呬腑
   stripe: true,//鏂戦┈绾�
-  rowConfig: {isCurrent: true, isHover: true, height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
-  id: 'CustomerList',
+  rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'productionScheduling',
   showFooter: true,//鏄剧ず鑴�
   printConfig: {},
   importConfig: {},
@@ -259,7 +262,7 @@
     storage: true
   },
   editConfig: {
-    trigger: 'click',
+    trigger: 'dblclick',
     mode: 'row',
     showStatus: true
   },
@@ -309,9 +312,18 @@
       editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}},
       title: t('processCard.planEndTime')
     },
+    {
+      field: 'schedulingQuantity',
+      width: 120,
+      editRender: {name: 'input', attrs: {placeholder: ''}},
+      title: t('processCard.productionSchedulingQuantity'),
+      sortable: true
+    },
+    {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
+
     // {field: '鎺掍骇缂栧彿', title: '鎺掍骇缂栧彿',  width: 120 },
     {
-      field: 'orderGlassDetail.orderId',
+      field: 'order.orderId',
       title: t('order.orderId'),
       filters: [{data: ''}],
       slots: {filter: 'num1_filter'},
@@ -357,13 +369,7 @@
     },
     {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 90},
     {field: 'orderGlassDetail.area', title: t('processCard.orderArea'), width: 90},
-    {
-      field: 'schedulingQuantity',
-      width: 120,
-      editRender: {name: 'input', attrs: {placeholder: ''}},
-      title: t('processCard.productionSchedulingQuantity'),
-      sortable: true
-    },
+
     {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 100},
     {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 100},
     {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 100},
@@ -372,7 +378,6 @@
     {field: 'reviewer', title: t('processCard.reviewed'), width: 80},
     {field: 'orderDetail.productName', title: t('order.product'), width: 140},
     {field: 'orderDetail.shape', title: t('order.shape'), width: 80},
-    {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
     {field: 'schedulingId', title: t('processCard.schedulingId'), width: 120},
   ],//琛ㄥご鎸夐挳
 
@@ -380,6 +385,7 @@
     buttons: [
       {code: 'delete', name: t('basicData.delete'), status: 'primary'},
       {code: 'review', name: t('basicData.review'), status: 'primary'},
+      {code: 'cancelReview', name: t('basicData.cancelReview'), status: 'primary'},
       {code: 'save', name: t('processCard.scheduling'), status: 'primary', icon: 'vxe-icon-save'},
     ],
     import: false,
@@ -477,6 +483,7 @@
               ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
               return;
             }
+
             const type = await VXETable.modal.confirm('鎮ㄧ‘瀹氳鍒犻櫎璇ユ暟鎹�?')
             if (type === 'confirm') {
               let schedulingData = ref({
@@ -499,6 +506,10 @@
         case 'review': {
           const $table = xGrid.value
           const selectRecords = $table.getCheckboxRecords()
+          let date = form.date1
+          let selectProcesses = processVal.value
+          let selectState = stateValue.value
+          let inputVal = form.orderId
           if ($table) {
             if (selectRecords.length == 0) {
               ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
@@ -511,6 +522,34 @@
             request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => {
               if (res.code == 200) {
                 ElMessage.success("瀹℃牳鎴愬姛")
+                router.push({
+                  path: '/main/processCard/ProductionScheduling',
+                  query: {random: Math.random()}
+                })
+              } else {
+                ElMessage.warning(res.msg)
+
+              }
+            })
+
+          }
+          return;
+        }
+        case 'cancelReview': {
+          const $table = xGrid.value
+          const selectRecords = $table.getCheckboxRecords()
+          if ($table) {
+            if (selectRecords.length == 0) {
+              ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+              return;
+            }
+            let schedulingData = ref({
+              scheduling: selectRecords,
+              userName: username//瀹℃牳浜�
+            })
+            request.post("/productionScheduling/cancelReviewScheduling", schedulingData.value).then((res) => {
+              if (res.code == 200) {
+                ElMessage.success("鍙嶅鎴愬姛")
                 location.reload();
               } else {
                 ElMessage.warning(res.msg)
@@ -583,17 +622,26 @@
   const table = $grid.getTableData().fullData
   const selectRecords = $grid.getCheckboxRecords()
   let selectState = stateValue.value
-  table.forEach((selectRecords) => {
-    if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity && selectState == 1) {
+  selectRecords.forEach((selectRecords) => {
+    if (selectRecords.schedulingQuantity > selectRecords.pendingProductionQuantity) {
       ElMessage.warning("鎺掍骇鏁伴噺涓嶈兘澶т簬寰呮帓浜ф暟閲�")
       //绂佺敤淇濆瓨鎸夐挳
       //gridOptions.toolbarConfig.buttons[2].disabled = true
     }
-
-
   })
 }
+const checkBoxConfig = {
+  checkMethod: ({ row }) => {
+    if (row['reviewStatus']==="宸插鏍�"){
+      return row.disable
+    }else{
+      return !row.disable
+    }
 
+  },
+  reserve:true
+
+}
 
 </script>
 
@@ -643,14 +691,14 @@
     <vxe-grid
         ref="xGrid"
         class="mytable-scrollbar"
-        height="500px"
-        max-height="100%"
+        height="95%"
         v-bind="gridOptions"
         v-on="gridEvents"
         @filter-change="filterChanged"
-        @checkbox-change="determineNum"
+
+
     >
-      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
+      <!--      :checkbox-config="checkBoxConfig"  @checkbox-change="determineNum"-->
       <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
       <template #content="{ row }">
         <ul class="expand-wrapper">

--
Gitblit v1.8.0