Browse Source

合计重量

zhangafei 1 week ago
parent
commit
95eff1d4b1

+ 20 - 2
src/views/billet/operator/components/orgData.vue

@@ -175,7 +175,7 @@
   import { render } from '/@/utils/common/renderUtils';
   import { isArray, isNumber } from '/@/utils/is';
   import Icon from '/@/components/Icon';
-  import { Input, Select } from 'ant-design-vue';
+  import { Input, Select, Tooltip } from 'ant-design-vue';
   import { throttle } from 'lodash-es';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { initDictOptions } from '/@/utils/dict';
@@ -447,7 +447,17 @@
           return '';
         }
         const allCount = handleTotalSum(record.orgData);
-        return h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '');
+        // return h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '');
+        return h(
+          Tooltip,
+          {
+            title: `【${record.heatNo}】 ${record.itemWeight} t`,
+            placement: 'right',
+            color: '#f50',
+            align: { offset: [-10, 0] },
+          },
+          h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '')
+        );
       },
     },
   ];
@@ -723,6 +733,7 @@
           // 棒一
           let rollOneNum = '';
           let rollOneSizesObj = {};
+          let itemWeight = 0;
           if (rollClubOneDetails) {
             const obj = JSON.parse(rollClubOneDetails);
             rollOneNum = obj.directRollingTotalCount || '';
@@ -732,6 +743,8 @@
               Object.keys(lengthGroupCount).forEach((key) => {
                 const column = key;
                 allSizeArr.push(Number(column) / 1000);
+                // 重量相加
+                itemWeight += steelPlateFormula(column, lengthGroupCount[key]);
                 const columnKey = column + 'rollOneColumn';
                 const findIndex = rollOneColumns.findIndex((item: any) => item.dataIndex === columnKey);
                 if (findIndex === -1) {
@@ -816,6 +829,8 @@
             hotChargeArr.forEach((k) => {
               const sizeFormat = Number(k.hotChargeLength) / 1000;
               allSizeArr.push(sizeFormat);
+              // 重量相加
+              itemWeight += steelPlateFormula(k.hotChargeLength, k.totalCount);
               const dataKey = sizeFormat + k.hotChargeDestination + k.hotChargeBtype;
               sizeArr[dataKey] = k.totalCount;
               // 热送统计
@@ -859,6 +874,8 @@
               // 初始化堆垛的定尺key
               const sSize = String(v.stackingLength);
               allSizeArr.push(Number(sSize) / 1000);
+              // 重量相加
+              itemWeight += steelPlateFormula(v.stackingLength, v.stackingCount);
               const stackKey = sSize + 'stackLength' + v.stackingBhtcId;
               // 查找某一个堆垛 dataIndex='stackLength' + stackingBhtcId
               const index = stackLengthColumn.findIndex((ele) => ele.dataIndex == 'stackLength' + v.stackingBhtcId);
@@ -960,6 +977,7 @@
             ...rollOneSizesObj,
             ...stackSizeData,
             orgData: newArr[index],
+            itemWeight: itemWeight > 0 ? itemWeight.toFixed(3) : 0,
           };
         });
 

+ 21 - 3
src/views/billet/operator/components/printOriginalRecords.vue

@@ -250,7 +250,7 @@
   import { render } from '/@/utils/common/renderUtils';
   import { isArray, isNumber } from '/@/utils/is';
   import Icon from '/@/components/Icon';
-  import { Input, Select } from 'ant-design-vue';
+  import { Input, Select, Tooltip } from 'ant-design-vue';
   import { throttle } from 'lodash-es';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { initDictOptions } from '/@/utils/dict';
@@ -596,7 +596,17 @@
           return '';
         }
         const allCount = handleTotalSum(record.orgData);
-        return h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '');
+        // return h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '');
+        return h(
+          Tooltip,
+          {
+            title: `【${record.heatNo}】 ${record.itemWeight} t`,
+            placement: 'right',
+            color: '#f50',
+            align: { offset: [-10, 0] },
+          },
+          h(Input, { class: 'total-input', size: 'small', bordered: false, value: allCount, onBlur: (e) => handleTotalChange(e, record) }, '')
+        );
       },
     },
   ];
@@ -879,6 +889,7 @@
           //   const obj = JSON.parse(hotSend);
           //   rollOneNum = obj.hotSendTotalCount || '';
           // }
+          let itemWeight = 0;
           if (rollClubOneDetails) {
             const obj = JSON.parse(rollClubOneDetails);
             rollOneNum = obj.directRollingTotalCount || '';
@@ -888,6 +899,8 @@
               Object.keys(lengthGroupCount).forEach((key) => {
                 const column = key;
                 allSizeArr.push(Number(column) / 1000);
+                // 重量相加
+                itemWeight += steelPlateFormula(column, lengthGroupCount[key]);
                 const columnKey = column + 'rollOneColumn';
                 const findIndex = rollOneColumns.findIndex((item: any) => item.dataIndex === columnKey);
                 if (findIndex === -1) {
@@ -968,6 +981,8 @@
             hotChargeArr.forEach((k) => {
               const sizeFormat = Number(k.hotChargeLength) / 1000;
               allSizeArr.push(sizeFormat);
+              // 重量相加
+              itemWeight += steelPlateFormula(k.hotChargeLength, k.totalCount);
               const dataKey = sizeFormat + k.hotChargeDestination + k.hotChargeBtype;
               sizeArr[dataKey] = k.totalCount;
               // 热送统计
@@ -1072,6 +1087,8 @@
               // 初始化堆垛的定尺key
               const sSize = String(v.stackingLength);
               allSizeArr.push(Number(sSize) / 1000);
+              // 重量相加
+              itemWeight += steelPlateFormula(v.stackingLength, v.stackingCount);
               const stackKey = sSize + 'stackLength' + v.stackingBhtcId;
               // 查找某一个堆垛 dataIndex='stackLength' + stackingBhtcId
               const index = stackLengthColumn.findIndex((ele) => ele.dataIndex == 'stackLength' + v.stackingBhtcId);
@@ -1173,6 +1190,7 @@
             ...rollOneSizesObj,
             ...stackSizeData,
             orgData: newArr[index],
+            itemWeight: itemWeight > 0 ? itemWeight.toFixed(3) : 0,
           };
         });
 
@@ -1756,7 +1774,7 @@
           };
         });
 
-      editSizeNumRecord.value.hotChargeLength = arr.length ? JSON.stringify(arr) : null;
+      editSizeNumRecord.value.hotChargeLength = JSON.stringify(arr);
 
       await editBilletRecord({
         ...editSizeNumRecord.value,