Browse Source

修改卡片样式

zhangafei 1 month ago
parent
commit
8628a99247

+ 7 - 0
src/views/billet/ShiftPerformance/index.vue

@@ -716,4 +716,11 @@
       }
     }
   }
+
+  @media (max-width: 1800px) {
+    .shift-performance-tags {
+      display: flex;
+      flex-direction: column;
+    }
+  }
 </style>

+ 136 - 91
src/views/billet/operator/components/headTop.vue

@@ -28,8 +28,23 @@
           <span class="type-title">{{ ele.size }}:</span> {{ ele.nums }} 支 / {{ ele.weight }} t
         </div>
       </div>
+      <!-- 冷床 -->
+      <template v-if="item.title == '堆垛'">
+        <template v-for="lc in coldBed">
+          <div class="type-item" style="border-top: 1px solid #108ee9;">
+            <span class="type-title" :style="{ color: lc.titleColor }">{{ lc.title }}:</span> {{ lc.amount }} 支 / {{ lc.weight }} t
+          </div>
+          <div class="type-item" v-for="lele of lc.dtlList">
+            <div class="type-item-dtl">
+              <span class="type-title">{{ lele.size }}:</span> {{ lele.nums }} 支 / {{ lele.weight }} t
+            </div>
+          </div>
+        </template>
+      </template>
     </a-col>
-    <a-col :span="2" class="paihao flex items-center justify-center">当前牌号:<component :is="renderDictTag(info.brandNum, 'billet_spec')" /></a-col>
+    <a-col :span="2" class="paihao flex flex-col items-center justify-center"
+      >当前牌号:<br /><component :is="renderDictTag(info.brandNum, 'billet_spec')"
+    /></a-col>
     <a-col :span="2" class="current-shift flex items-center justify-center">
       <a-button type="primary" danger @click="openPaihaoModal = true">切换牌号</a-button>
     </a-col>
@@ -105,6 +120,8 @@
     { title: '热装', titleColor: '#f50', amount: 0, weight: 0, dtlList: [] },
     { title: '堆垛', titleColor: '#b8ceff', amount: 0, weight: 0, dtlList: [] },
   ]);
+  // 冷床
+  const coldBed = ref<any>([{ title: '冷床', titleColor: '#b8ceff', amount: 0, weight: 0, dtlList: [] }]);
   // 渲染字典标签
   const renderDictTag = (value: string, dictCode: string) => {
     return render.renderDict(value, dictCode);
@@ -136,100 +153,128 @@
       }
 
       // 获取明细
-      const dtlRes = await getSteelPileBaseInfo({ ccmNo: props.ccmNo });
-      // 按照目的地分组
-      if (dtlRes) {
-        const destinationArr = dtlRes.reduce((acc, cur) => {
-          acc[cur.belongTable] = acc[cur.belongTable] || [];
-          acc[cur.belongTable].push(cur);
-          return acc;
-        }, {});
-
-        // roll_club_one 棒一
-        // roll_club_two 棒二
-        // roll_club_three 棒三
-        // roll_out_shipp 上若
-        // roll_height 高线
-        // stacking_and_loading_vehicles 堆垛
-        let hotsendData: any = [],
-          hotSendSum = 0,
-          hotSendTotalWeight = 0,
-          hotchargeData: any = [],
-          hotChargeSum = 0,
-          hotChargeTotalWeight = 0,
-          stackingData: any = [],
-          stackingSum = 0,
-          stackingTotalWeight = 0;
-        // 计算棒一
-        if (destinationArr['roll_club_one']) {
-          hotsendData = Object.values(groupBy(destinationArr['roll_club_one'] || [], 'length')).map((one: any) => {
-            hotSendSum += one.nums;
-            hotSendTotalWeight += one.weight;
-            return {
-              ...one,
-              weight: one.weight.toFixed(3),
-              size: one.size / 1000,
-            };
-          });
-        }
+      getSteelPileBaseInfo({ ccmNo: props.ccmNo }).then((dtlRes) => {
+        // 按照目的地分组
+        if (dtlRes) {
+          const destinationArr = dtlRes.reduce((acc, cur) => {
+            const bt = cur.belongTable || 'lc';
+            acc[bt] = acc[bt] || [];
+            acc[bt].push(cur);
+            return acc;
+          }, {});
+
+          // roll_club_one 棒一
+          // roll_club_two 棒二
+          // roll_club_three 棒三
+          // roll_out_shipp 上若
+          // roll_height 高线
+          // stacking_and_loading_vehicles 堆垛
+          let hotsendData: any = [],
+            hotSendSum = 0,
+            hotSendTotalWeight = 0,
+            hotchargeData: any = [],
+            hotChargeSum = 0,
+            hotChargeTotalWeight = 0,
+            stackingData: any = [],
+            stackingSum = 0,
+            stackingTotalWeight = 0;
+          // 计算棒一
+          if (destinationArr['roll_club_one']) {
+            hotsendData = Object.values(groupBy(destinationArr['roll_club_one'] || [], 'length')).map((one: any) => {
+              hotSendSum += one.nums;
+              hotSendTotalWeight += one.weight;
+              return {
+                ...one,
+                weight: one.weight.toFixed(3),
+                size: one.size / 1000,
+              };
+            });
+          }
+
+          // 计算热装
+          if (destinationArr['roll_club_two'] || destinationArr['roll_club_three'] || destinationArr['roll_out_shipp']) {
+            const concatArr = [
+              ...(destinationArr['roll_club_two'] || []),
+              ...(destinationArr['roll_club_three'] || []),
+              ...(destinationArr['roll_out_shipp'] || []),
+            ];
+            hotchargeData = Object.values(groupBy(concatArr, 'length')).map((one: any) => {
+              hotChargeSum += one.nums;
+              hotChargeTotalWeight += one.weight;
+              return {
+                ...one,
+                weight: one.weight.toFixed(3),
+                size: one.size / 1000,
+              };
+            });
+          }
+
+          // 计算堆垛
+          if (destinationArr['stacking_and_loading_vehicles']) {
+            stackingData = Object.values(groupBy(destinationArr['stacking_and_loading_vehicles'] || [], 'length')).map((one: any) => {
+              stackingSum += one.nums;
+              stackingTotalWeight += one.weight;
+              return {
+                ...one,
+                weight: one.weight.toFixed(3),
+                size: one.size / 1000,
+              };
+            });
+          }
+
+          // 计算冷床
+          let lcSum = 0;
+          let lcTotalWeight = 0;
+          let lcData: any = [];
+          if (destinationArr['lc']) {
+            lcData = Object.values(groupBy(destinationArr['lc'] || [], 'length')).map((one: any) => {
+              lcSum += one.nums;
+              lcTotalWeight += one.weight;
+              return {
+                ...one,
+                weight: one.weight.toFixed(3),
+                size: one.size / 1000,
+              };
+            });
+          }
+
+          typeList.value = [
+            {
+              title: '棒一',
+              titleColor: '#f50',
+              amount: hotSendSum || 0,
+              weight: hotSendTotalWeight ? hotSendTotalWeight.toFixed(3) : 0,
+              dtlList: hotsendData,
+            },
+            {
+              title: '热装',
+              titleColor: '#f50',
+              amount: hotChargeSum || 0,
+              weight: hotChargeTotalWeight ? hotChargeTotalWeight.toFixed(3) : 0,
+              dtlList: hotchargeData,
+            },
+            {
+              title: '堆垛',
+              titleColor: '#b8ceff',
+              amount: stackingSum || 0,
+              weight: stackingTotalWeight ? stackingTotalWeight.toFixed(3) : 0,
+              dtlList: stackingData,
+            },
+          ];
 
-        // 计算热装
-        if (destinationArr['roll_club_two'] || destinationArr['roll_club_three'] || destinationArr['roll_out_shipp']) {
-          const concatArr = [
-            ...(destinationArr['roll_club_two'] || []),
-            ...(destinationArr['roll_club_three'] || []),
-            ...(destinationArr['roll_out_shipp'] || []),
+          coldBed.value = [
+            {
+              title: '冷床',
+              titleColor: '#108ee9',
+              amount: lcSum || 0,
+              weight: lcTotalWeight ? lcTotalWeight.toFixed(3) : 0,
+              dtlList: lcData,
+            },
           ];
-          hotchargeData = Object.values(groupBy(concatArr, 'length')).map((one: any) => {
-            hotChargeSum += one.nums;
-            hotChargeTotalWeight += one.weight;
-            return {
-              ...one,
-              weight: one.weight.toFixed(3),
-              size: one.size / 1000,
-            };
-          });
-        }
 
-        // 计算堆垛
-        if (destinationArr['stacking_and_loading_vehicles']) {
-          stackingData = Object.values(groupBy(destinationArr['stacking_and_loading_vehicles'] || [], 'length')).map((one: any) => {
-            stackingSum += one.nums;
-            stackingTotalWeight += one.weight;
-            return {
-              ...one,
-              weight: one.weight.toFixed(3),
-              size: one.size / 1000,
-            };
-          });
+          getShiftInfo();
         }
-
-        typeList.value = [
-          {
-            title: '棒一',
-            titleColor: '#f50',
-            amount: hotSendSum || 0,
-            weight: hotSendTotalWeight ? hotSendTotalWeight.toFixed(3) : 0,
-            dtlList: hotsendData,
-          },
-          {
-            title: '热装',
-            titleColor: '#f50',
-            amount: hotChargeSum || 0,
-            weight: hotChargeTotalWeight ? hotChargeTotalWeight.toFixed(3) : 0,
-            dtlList: hotchargeData,
-          },
-          {
-            title: '堆垛',
-            titleColor: '#b8ceff',
-            amount: stackingSum || 0,
-            weight: stackingTotalWeight ? stackingTotalWeight.toFixed(3) : 0,
-            dtlList: stackingData,
-          },
-        ];
-
-        getShiftInfo();
-      }
+      });
     } catch (error) {
     } finally {
       start();

+ 1 - 1
src/views/billet/operator/components/heatList.vue

@@ -227,7 +227,7 @@
     },
     cuttolength: {
       // 1 手动定尺 2 自动定尺
-      type: Number,
+      type: [Number, String],
       default: 2,
     },
   });

+ 49 - 13
src/views/billet/operator/components/printBilletSampleCard.vue

@@ -21,7 +21,7 @@
           </div>
           <div class="flex-1" style="text-align: right; font-size: 12px"> zj / R177 </div>
         </div>
-        <a-descriptions style="margin-top: 6px; margin-bottom: 4px" bordered :column="6" size="small">
+        <a-descriptions style="margin-top: 6px; margin-bottom: 4px" bordered :column="8" size="small">
           <a-descriptions-item label="序号" :labelStyle="labelStyle" :contentStyle="contentStyle">炉号</a-descriptions-item>
           <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
             <div class="size-items-title">
@@ -41,12 +41,21 @@
               支数 <span class="s-txt">{{ sizeArrs[1] ? Number(sizeArrs[1]) / 1000 + 'm' : '' }}</span>
             </div>
           </a-descriptions-item>
-          <a-descriptions-item label="序号" :labelStyle="labelStyle" :contentStyle="contentStyle">
+          <!-- <a-descriptions-item label="序号" :labelStyle="labelStyle" :contentStyle="contentStyle">
             炉号
             <div class="two-num-wrapper">
               <span class="s-txt">{{ sizeArrs[2] ? '170' : '' }}</span>
               <span class="s-txt">{{ sizeArrs[2] ? Number(sizeArrs[2]) / 1000 + 'm' : '' }}</span>
             </div>
+          </a-descriptions-item> -->
+          <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
+            <div class="size-items-title">
+              定尺&nbsp;&nbsp;&nbsp;&nbsp;
+              <span class="s-txt">{{ sizeArrs[2] ? '170' : '' }}</span>
+            </div>
+            <div class="size-num-title">
+              支数 <span class="s-txt">{{ sizeArrs[2] ? Number(sizeArrs[1]) / 1000 + 'm' : '' }}</span>
+            </div>
           </a-descriptions-item>
           <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
             <div class="size-items-title">
@@ -68,10 +77,25 @@
               支数 <span class="s-txt">{{ sizeArrs[4] ? Number(sizeArrs[4]) / 1000 + 'm' : '' }}</span>
             </div>
           </a-descriptions-item>
+          <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
+            <div class="size-items-title">
+              定尺&nbsp;&nbsp;&nbsp;&nbsp;
+              <span class="s-txt">
+                {{ sizeArrs[5] ? '170' : '' }}
+              </span>
+            </div>
+            <div class="size-num-title">
+              支数 <span class="s-txt">{{ sizeArrs[5] ? Number(sizeArrs[5]) / 1000 + 'm' : '' }}</span>
+            </div>
+          </a-descriptions-item>
+          <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
+            <div class="size-items-title"> </div>
+            <div class="size-num-title"> </div>
+          </a-descriptions-item>
 
-          <template v-for="i in 20">
+          <template v-for="i in 22">
             <!-- 第一组 -->
-            <a-descriptions-item :label="i - 1" :labelStyle="labelStyle" :contentStyle="contentStyle">{{
+            <a-descriptions-item :label="i" :labelStyle="labelStyle" :contentStyle="contentStyle">{{
               heatList[i - 1] ? heatList[i - 1].heatNo : ''
             }}</a-descriptions-item>
             <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
@@ -90,12 +114,14 @@
             </a-descriptions-item>
 
             <!-- 第二组 -->
-            <a-descriptions-item :label="19 + i" :labelStyle="labelStyle" :contentStyle="contentStyle">
-              {{
-                heatList[i - 1] && heatList[i - 1].sizeInfo && heatList[i - 1].sizeInfo[sizeArrs[2]]
-                  ? heatList[i - 1].sizeInfo[sizeArrs[2]].lengthTotalCount
-                  : ''
-              }}
+            <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
+              <div class="size-items-content">
+                {{
+                  heatList[i - 1] && heatList[i - 1].sizeInfo && heatList[i - 1].sizeInfo[sizeArrs[2]]
+                    ? heatList[i - 1].sizeInfo[sizeArrs[2]].lengthTotalCount
+                    : ''
+                }}
+              </div>
             </a-descriptions-item>
             <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
               <div class="size-items-content">{{
@@ -111,9 +137,19 @@
                   : ''
               }}</div>
             </a-descriptions-item>
+            <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
+              <div class="size-items-content">{{
+                heatList[i - 1] && heatList[i - 1].sizeInfo && heatList[i - 1].sizeInfo[sizeArrs[4]]
+                  ? heatList[i - 1].sizeInfo[sizeArrs[5]].lengthTotalCount
+                  : ''
+              }}</div>
+            </a-descriptions-item>
+            <a-descriptions-item :labelStyle="sizeLabelStyle" :contentStyle="sizeContentStyle">
+              <div class="size-items-content"></div>
+            </a-descriptions-item>
           </template>
         </a-descriptions>
-        <a-descriptions style="padding: 0" size="small" :column="6">
+        <a-descriptions style="padding: 0" size="small" :column="7">
           <a-descriptions-item label="备注" :span="1">
             <div class="size-items-remark flex">
               <!-- <div class="size-remark-item" v-for="(ele, size) in sizeObjs">
@@ -259,7 +295,7 @@
       line-height: 32px;
       border-bottom: 1px solid #bfbfbf;
       padding-left: 10px;
-      min-width: 100px;
+      min-width: 90px;
     }
 
     .size-num-title {
@@ -327,7 +363,7 @@
       display: none;
     }
 
-    @page :first {
+    @page {
       margin-top: 10px; /* 第一页的页眉距离顶部为0 */
       margin-bottom: 0; /* 第一页的页脚距离底部为0 */
     }

+ 210 - 55
src/views/billet/operator/components/printOriginalRecords.vue

@@ -35,7 +35,7 @@
               <a-table-summary-cell :col-span="8" style="text-align: center">备注</a-table-summary-cell>
               <a-table-summary-cell :col-span="2" style="text-align: center"> 定尺 </a-table-summary-cell>
               <a-table-summary-cell :col-span="2" style="text-align: center"> 支数(支) </a-table-summary-cell>
-              <a-table-summary-cell :col-span="3" style="text-align: center"> 产量(吨) </a-table-summary-cell>
+              <a-table-summary-cell :col-span="8" style="text-align: center"> 产量(吨) </a-table-summary-cell>
             </a-table-summary-row>
             <a-table-summary-row class="summary-row-no-border">
               <a-table-summary-cell :col-span="8">
@@ -44,7 +44,7 @@
               <a-table-summary-cell :row-span="1"> 热送 </a-table-summary-cell>
               <a-table-summary-cell :row-span="1"> </a-table-summary-cell>
               <a-table-summary-cell :col-span="2"></a-table-summary-cell>
-              <a-table-summary-cell :col-span="3"> </a-table-summary-cell>
+              <a-table-summary-cell :col-span="8"> </a-table-summary-cell>
             </a-table-summary-row>
             <a-table-summary-row>
               <a-table-summary-cell :col-span="8">
@@ -53,22 +53,65 @@
               <a-table-summary-cell :row-span="1"> 堆垛 </a-table-summary-cell>
               <a-table-summary-cell :row-span="1"> </a-table-summary-cell>
               <a-table-summary-cell :col-span="2"></a-table-summary-cell>
-              <a-table-summary-cell :col-span="3"> </a-table-summary-cell>
+              <a-table-summary-cell :col-span="8"> </a-table-summary-cell>
             </a-table-summary-row>
           </template>
         </a-table>
       </div>
     </section>
+
+    <template #appendFooter>
+      <a-button @click="openJSModal = true"> 重量计算 </a-button>
+    </template>
   </BasicModal>
+  <a-modal
+    v-model:open="openJSModal"
+    title="重量计算"
+    centered
+    width="600px"
+    :zIndex="9999"
+    @ok="
+      () => {
+        openJSModal = false;
+      }
+    "
+    @cancel="
+      () => {
+        openJSModal = false;
+      }
+    "
+  >
+    <div class="flex justify-center items-center" style="margin: 20px; line-height: 40px">
+      <a-input-group size="large">
+        <a-row :gutter="8">
+          <a-col :span="5">
+            <a-input type="number" v-model:value="weightNum" placeholder="请输入支数" />
+          </a-col>
+          <a-col :span="1" style="line-height: 40px; text-align: center">*</a-col>
+          <a-col :span="5">
+            <a-input type="number" v-model:value="sizeNum" placeholder="请输入定尺" />
+          </a-col>
+          <a-col :span="1" style="line-height: 40px; text-align: center">*</a-col>
+          <a-col :span="5">
+            <a-input type="number" v-model:value="xiShu" placeholder="请输入比例" />
+          </a-col>
+          <a-col :span="1" style="line-height: 40px; text-align: center">=</a-col>
+
+          <a-col :span="6" style="line-height: 40px; text-align: center">{{ weightCalc }}</a-col>
+        </a-row>
+      </a-input-group>
+    </div>
+  </a-modal>
 </template>
 <script lang="ts" setup>
-  import { ref } from 'vue';
+  import { ref, computed, h } from 'vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import dayjs from 'dayjs';
   import { printJS } from '/@/hooks/web/usePrintJS';
   import type { TableColumnsType } from 'ant-design-vue';
   import { queryHeatsActualsByCcmNo } from '../operator.api';
   import { render } from '/@/utils/common/renderUtils';
+  import { isNumber } from '/@/utils/is';
 
   // 渲染字典标签
   const renderDictTag = (value: string, dictCode: string) => {
@@ -76,7 +119,7 @@
   };
   // 主机号
   const hostNumber = ref('5');
-  const columns: TableColumnsType = [
+  const defaultColumns: TableColumnsType = [
     {
       title: '序号',
       width: 40,
@@ -111,89 +154,76 @@
           dataIndex: 'oneFlow',
           key: 'oneFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'II流',
           dataIndex: 'twoFlow',
           key: 'twoFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'III流',
           dataIndex: 'threeFlow',
           key: 'threeFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'IV流',
           dataIndex: 'fourFlow',
           key: 'fourFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'V流',
           dataIndex: 'fiveFlow',
           key: 'fiveFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'VI流',
           dataIndex: 'sixFlow',
           key: 'sixFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'VII流',
           dataIndex: 'sevenFlow',
           key: 'sevenFlow',
           align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: 'VIII流',
           dataIndex: 'eightFlow',
           key: 'eightFlow',
           align: 'center',
-          width: 50,
-        },
-        {
-          title: '热送',
-          dataIndex: 'hotSend',
-          key: 'hotSend',
-          align: 'center',
-          width: 50,
-        },
-        {
-          title: '堆垛',
-          dataIndex: 'stack',
-          key: 'stack',
-          align: 'center',
-          width: 50,
+          width: 40,
         },
         {
           title: '合计',
           dataIndex: 'total',
           key: 'total',
           align: 'center',
-          width: 50,
-        },
-        {
-          title: '备注',
-          dataIndex: 'remark',
-          key: 'remark',
-          align: 'center',
-          width: 60,
+          width: 40,
         },
       ],
     },
+    {
+      title: '棒一',
+      width: 40,
+      align: 'center',
+      dataIndex: 'rollOne',
+      key: 'rollOne',
+    },
   ];
 
+  const columns = ref<TableColumnsType>(defaultColumns);
   const dataSource = ref<any[]>([]);
   const shiftInfoTxt = ref(['', '']);
   const shiftInfo = ref({ shift: '', shiftGroup: '' });
@@ -201,7 +231,6 @@
   //表单赋值
   const [registerModal, { changeOkLoading }] = useModalInner(async (data) => {
     const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId, time } = data;
-    console.log('data', data);
 
     hostNumber.value = ccmNo;
     shiftInfoTxt.value = shiftText.split('-');
@@ -224,10 +253,7 @@
         sixFlow: '',
         sevenFlow: '',
         eightFlow: '',
-        hotSend: '',
-        stack: '',
         total: '',
-        remark: '',
       });
     }
 
@@ -239,6 +265,12 @@
     });
   });
 
+  // 字段映射
+  const headText = {
+    rollClubTwoCount: '二',
+    rollClubThreeCount: '三',
+  };
+
   const getHeatList = async (params) => {
     try {
       const res = await queryHeatsActualsByCcmNo(params);
@@ -252,28 +284,56 @@
           }
         }
 
+        let sizeColumn: string[] = [];
+        let sizeHeadContent = {};
+
         dataSource.value = dataSource.value.map((item, index) => {
           if (!newArr[index]) return item;
-          let hotSendNum = 0;
-          let stackingNum = 0;
           let totalNum = 0;
-          const { hotSend, directRolling, stacking, totalInfo } = newArr[index];
+          const { totalInfo, length, hotSend, directRolling } = newArr[index];
+          if (totalInfo) {
+            const obj = JSON.parse(totalInfo);
+            totalNum = obj.totalCount;
+          }
+
+          // 棒一
+          let rollOneNum = '';
           if (hotSend) {
             const obj = JSON.parse(hotSend);
-            hotSendNum = obj.hotSendTotalCount;
+            rollOneNum = obj.hotSendTotalCount || '';
           }
           if (directRolling) {
             const obj = JSON.parse(directRolling);
-            hotSendNum = obj.directRollingTotalCount;
+            rollOneNum = obj.directRollingTotalCount || '';
           }
-          if (stacking) {
-            const obj = JSON.parse(stacking);
-            stackingNum = obj.stackingTotalCount;
-          }
-          if (totalInfo) {
-            const obj = JSON.parse(totalInfo);
-            totalNum = obj.totalCount;
+
+          // 定尺
+          let sizeArr = {};
+          if (length) {
+            const obj = JSON.parse(length);
+            Object.keys(obj).forEach((k) => {
+              const sizeFormat = Number(k) / 1000 + 'm';
+              sizeArr[sizeFormat] = obj[k].lengthTotalCount;
+              sizeArr[sizeFormat + 'Arr'] = {
+                rollClubTwoCount: obj[k].rollClubTwoCount,
+                rollClubThreeCount: obj[k].rollClubThreeCount,
+              };
+              sizeColumn.push(sizeFormat);
+
+              // 判断是否有该字段,列头显示
+              if (!sizeHeadContent[sizeFormat]) {
+                sizeHeadContent[sizeFormat] = [];
+              }
+
+              if (obj[k].rollClubTwoCount && !sizeHeadContent[sizeFormat].includes('rollClubTwoCount')) {
+                sizeHeadContent[sizeFormat].push('rollClubTwoCount');
+              }
+              if (obj[k].rollClubThreeCount && !sizeHeadContent[sizeFormat].includes('rollClubThreeCount')) {
+                sizeHeadContent[sizeFormat].push('rollClubThreeCount');
+              }
+            });
           }
+
           return {
             ...item,
             heatNo: newArr[index].heatNo,
@@ -286,18 +346,71 @@
             sixFlow: newArr[index].sixStrandNo || '',
             sevenFlow: newArr[index].sevenStrandNo || '',
             eightFlow: newArr[index].eightStrandNo || '',
-            hotSend: hotSendNum || '',
-            stack: stackingNum || '',
             total: totalNum || '',
-            remark: '',
+            rollOne: rollOneNum,
+            ...sizeArr,
+          };
+        });
+
+        const otherColumn: TableColumnsType = [...new Set(sizeColumn)].map((item) => {
+          return {
+            title: () => {
+              const subHead = Object.keys(headText)
+                .filter((key) => sizeHeadContent[item].includes(key))
+                .map((key) => headText[key]);
+
+              return h('div', {}, [h('div', { style: { fontSize: '12px' } }, subHead.join(' / ')), h('div', {}, item)]);
+            },
+            dataIndex: item,
+            key: item,
+            align: 'center',
+            width: 50,
+            customRender: ({ text, record }) => {
+              if (!text) return '';
+              const sizeArr = [h('div', { class: 'line' }, ''), h('div', { class: 'size-st-item' }, text)];
+              if (record[item + 'Arr']) {
+                const subHead = Object.keys(headText)
+                  .filter((key) => sizeHeadContent[item].includes(key))
+                  .map((key) => record[item + 'Arr'][key] || '~');
+                sizeArr.push(h('div', { class: ' size-st-num' }, subHead.join('/')));
+              }
+              return h('div', { class: 'size-st-wrapper' }, sizeArr);
+            },
           };
         });
+
+        // 添加空白列
+        otherColumn.push({
+          title: '',
+          dataIndex: '',
+          key: '',
+          align: 'center',
+          width: 40,
+        });
+        columns.value = [...defaultColumns, ...otherColumn];
       }
     } catch (error) {
       console.log(error);
     }
   };
 
+  const openJSModal = ref(false);
+  const xiShu = ref(0.2265);
+  const sizeNum = ref();
+  const weightNum = ref();
+  // 重量计算按钮
+  const weightCalc = computed(() => {
+    const w = Number(weightNum.value);
+    const x = Number(xiShu.value);
+    const s = Number(sizeNum.value);
+    if (isNumber(w) && isNumber(x) && isNumber(s)) {
+      const r = w * x * s;
+
+      return !isNaN(r) ? r.toFixed(6) : '';
+    }
+    return '';
+  });
+
   function onPrint() {
     changeOkLoading(true);
     printJS({
@@ -410,6 +523,48 @@
             border-inline-end: 1px solid rgba(0, 0, 0, 0.6);
             border-bottom: 1px solid rgba(0, 0, 0, 0.6);
             text-align: center;
+            position: relative;
+          }
+
+          .size-st-wrapper {
+            position: absolute;
+            top: 1px;
+            left: 1px;
+            right: 1px;
+            bottom: 1px;
+
+            .line {
+              content: '';
+              position: absolute;
+              top: 0;
+              left: 0;
+              width: 100%; /* 等于长方形宽度 */
+              height: 100%; /* 等于长方形高度 */
+
+              /* 创建斜线:线性渐变从左上到右下 */
+              background: linear-gradient(
+                to bottom right,
+                transparent 0%,
+                transparent calc(50% - 0.5px),
+                /* 斜线上方透明 */ rgba(0, 0, 0, 0.6) calc(50% - 0.5px),
+                /* 斜线颜色 */ rgba(0, 0, 0, 0.6) calc(50% + 0.5px),
+                /* 斜线厚度 */ transparent calc(50% + 0.5px) /* 斜线下方透明 */
+              );
+            }
+
+            .size-st-item {
+              position: absolute;
+              top: -4px;
+              left: 2px;
+              color: #108ee9;
+            }
+
+            .size-st-num {
+              position: absolute;
+              bottom: -4px;
+              right: 2px;
+              color: #f50;
+            }
           }
         }
       }
@@ -434,7 +589,7 @@
       display: none;
     }
 
-    @page :first {
+    @page {
       margin-top: 10px; /* 第一页的页眉距离顶部为0 */
       margin-bottom: 0; /* 第一页的页脚距离底部为0 */
     }

+ 32 - 8
src/views/billet/shippingBill/components/printModal.vue

@@ -71,7 +71,10 @@
           >
             <div class="heatNo-item" v-for="(item, sindex) in headDtl" :key="item.id">
               {{ item.heatNo }} - {{ item.heatNum ? item.heatNum : item.billetNos.length }}
-              <div class="op jian" @click="deleteHeatDtl(sindex)">-</div>
+              <div class="op jian" @click="deleteHeatDtl(sindex)"><Icon icon="ant-design:delete-outlined" /></div>
+              <div class="op add" @click="editHeatDtl(sindex)">
+                <Icon icon="ant-design:edit-outlined" />
+              </div>
             </div>
             <div class="add-heatNo" @click="addHeatDtl">+</div>
           </a-descriptions-item>
@@ -138,7 +141,7 @@
   import dayjs from 'dayjs';
   // import { render } from '/@/utils/common/renderUtils';
   import { printJS } from '/@/hooks/web/usePrintJS';
-  import { listShippingBill, saveBeforePrint, getByStorageBillId } from '../shippingBill.api';
+  import { listShippingBill, saveBeforePrint, getByStorageBillId, edit } from '../shippingBill.api';
   import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
   // import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
   import { useMessage } from '/@/hooks/web/useMessage';
@@ -182,6 +185,7 @@
       if (type === 'offline') {
         getOfflineBill();
       }
+      editDtl.value = {};
     } else {
       info.value = {};
     }
@@ -279,9 +283,18 @@
     headDtl.value.splice(index, 1);
   };
 
+  const editHeatDtl = (index: number) => {
+    const { heatNo, heatNum: orgHeatNum, billetNos } = headDtl.value[index];
+    headValue.value = heatNo;
+    heatNum.value = orgHeatNum ? orgHeatNum : billetNos.length;
+    showAddHeat.value = true;
+    editDtl.value = headDtl.value[index];
+  };
+
   const headValue = ref<number | null>();
   const heatNum = ref<number | null>();
   const showAddHeat = ref(false);
+  const editDtl = ref();
   const addHeatDtl = () => {
     headValue.value = null;
     heatNum.value = null;
@@ -289,11 +302,22 @@
   };
   const confirmAddHeatDtl = () => {
     if (headValue.value && heatNum.value) {
-      headDtl.value.push({
-        id: headValue.value + '-' + heatNum.value,
-        heatNo: headValue.value,
-        heatNum: heatNum.value,
-      });
+      if (editDtl.value && editDtl.value.heatNo) {
+        const index = headDtl.value.findIndex((item) => item.heatNo === editDtl.value.heatNo);
+        headDtl.value[index] = {
+          ...headDtl.value[index],
+          heatNo: headValue.value,
+          heatNum: heatNum.value,
+        };
+
+        editDtl.value = {};
+      } else {
+        headDtl.value.push({
+          id: headValue.value + '-' + heatNum.value,
+          heatNo: headValue.value,
+          heatNum: heatNum.value,
+        });
+      }
       showAddHeat.value = false;
     } else {
       createMessage.warning('请填写炉号和支数');
@@ -398,7 +422,7 @@
       }
 
       .jian {
-        right: 0;
+        right: 25px;
         background-color: rgb(255, 205, 205);
         border: 1 solid #fa5d5d;
       }