From a1a27eba473c476cade23f003d3ac1f1cc1ac27d Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 01 三月 2024 15:14:50 +0800
Subject: [PATCH] 报工明细表字段修改

---
 north-glass-erp/northglass-erp/src/views/pp/processCard/ProductionScheduling.vue |   76 ++++++++++++++++++++++++++------------
 1 files changed, 52 insertions(+), 24 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 698333c..49aa6e8 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
@@ -23,10 +23,7 @@
       router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}})
       break
     }
-    case 'delete': {
-      alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
-      break
-    }
+
     case  'setType': {
       alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鎺掔増鐘舵��')
       break
@@ -177,6 +174,7 @@
       }
     })
   } else if (inputVal != null && selectState == 1) {
+
     //鏍规嵁璁㈠崟鍙锋煡璇㈡湭鎺掍骇鏁版嵁
     request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => {
       if (res.code == 200) {
@@ -300,6 +298,7 @@
     {field: 'product_name', title: '浜у搧鍚嶇О', width: 140},
     {field: 'shape', title: '褰㈢姸', width: 80},
     {field: 'notes', title: '澶囨敞', editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120},
+    {field: 'scheduling_id', title: '鎺掍骇缂栧彿',width: 120},
   ],//琛ㄥご鎸夐挳
 
   toolbarConfig: {
@@ -316,26 +315,28 @@
   },
   data: [],//table body瀹為檯鏁版嵁
   //鑴氶儴姹傚拰
-  footerMethod({columns, data}) {//椤佃剼鍑芥暟
-    let footList = ['鏁伴噺', '闈㈢Н', '鎺掍骇鏁伴噺', '宸叉帓浜ф暟閲�', '宸叉帓浜ч潰绉�', '鏈帓浜ф暟閲�', '鏈帓浜ч潰绉�']
-    return [
-      columns.map((column, columnIndex) => {
-        if (columnIndex === 0) {
-          return '鍚堣:'
-        }
-        if (footList.includes(column.field)) {
-          return sumNum(data, column.field)
-        }
-        return ''
-      })
-    ]
-  }
+  // footerMethod({columns, data}) {//椤佃剼鍑芥暟
+  //   let footList = ['鏁伴噺', '闈㈢Н', '鎺掍骇鏁伴噺', '宸叉帓浜ф暟閲�', '宸叉帓浜ч潰绉�', '鏈帓浜ф暟閲�', '鏈帓浜ч潰绉�']
+  //   return [
+  //     columns.map((column, columnIndex) => {
+  //       if (columnIndex === 0) {
+  //         return '鍚堣:'
+  //       }
+  //       if (footList.includes(column.field)) {
+  //         return sumNum(data, column.field)
+  //       }
+  //       return ''
+  //     })
+  //   ]
+  // }
 
 })
 
+//鍒犻櫎
+
 
 const gridEvents = {
-  toolbarButtonClick({code}) {
+  async toolbarButtonClick({code}) {
     const $grid = xGrid.value
     if ($grid) {
       switch (code) {
@@ -368,7 +369,6 @@
               processes: selectProcesses,//宸ュ簭
               userName: username//瀹℃牳浜�
             })
-            console.log(schedulingData.value)
             //淇濆瓨鎺掍骇鏁版嵁
             request.post("/productionScheduling/addScheduling", schedulingData.value).then((res) => {
               if (res.code == 200) {
@@ -376,12 +376,37 @@
                 location.reload();
               } else {
                 ElMessage.warning(res.msg)
-                router.push("/login")
+
               }
             })
 
           }
           return;
+
+        }
+
+        case 'delete': {
+          const $table = xGrid.value
+          const selectRecords = $table.getCheckboxRecords()
+          if ($table) {
+            if (selectRecords.length == 0) {
+              ElMessage.warning("璇峰嬀閫夋帓浜ф暟鎹�")
+              return;
+            }
+            const type = await VXETable.modal.confirm('鎮ㄧ‘瀹氳鍒犻櫎璇ユ暟鎹�?')
+            if (type === 'confirm') {
+              //淇濆瓨鎺掍骇鏁版嵁
+              request.post("/productionScheduling/addScheduling").then((res) => {
+                if (res.code == 200) {
+                  ElMessage.success("淇濆瓨鎴愬姛")
+                  location.reload();
+                } else {
+                  ElMessage.warning(res.msg)
+
+                }
+              })
+            }
+          }
 
         }
 
@@ -395,7 +420,6 @@
   const $grid = xGrid.value
   const table = $grid.getTableData().fullData
   const selectRecords = $grid.getCheckboxRecords()
-  console.log(selectRecords)
   table.forEach((selectRecords) => {
     if (selectRecords.scheduling_quantity > selectRecords.pendingProductionQuantity) {
       ElMessage.warning("鎺掍骇鏁伴噺涓嶈兘澶т簬寰呮帓浜ф暟閲�")
@@ -406,6 +430,8 @@
 
   })
 }
+
+
 
 
 </script>
@@ -425,9 +451,9 @@
 
         />
         &nbsp;&nbsp;
-        <el-input v-model="form.orderId" placeholder="閿�鍞崟鍙�" style="width: 110px"></el-input>
+        <el-input v-model="form.orderId" placeholder="閿�鍞崟鍙�" clearable style="width: 110px"></el-input>
         &nbsp;
-        <el-select v-model="value" class="m-2" placeholder="宸ュ簭" style="width: 90px;">
+        <el-select v-model="value" class="m-2" placeholder="宸ュ簭" clearable style="width: 90px;">
           <el-option
               v-for="item in options"
               :key="item.value"
@@ -457,6 +483,7 @@
         ref="xGrid"
         class="mytable-scrollbar"
         max-height="100%"
+        height="100%"
         v-bind="gridOptions"
         v-on="gridEvents"
         @filter-change="filterChanged"
@@ -495,6 +522,7 @@
 
 #selectForm {
   width: 70%;
+  height: 6%;
   text-align: center;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0