Browse Source

增加原始记录确认和送样卡确认功能

zhangafei 1 week ago
parent
commit
3765cf03e7

+ 20 - 2
src/views/billet/ShiftPerformance/index.vue

@@ -236,7 +236,9 @@
       </a-tab-pane>
     </a-tabs>
   </div>
-  <printBilletSampleCard @register="registerDetailModal" />
+  <!-- 使用新的送样卡,老的送样卡先隐藏 -->
+  <printBilletSampleCard @register="registerSampleCardModal" />
+  <printBilletSampleCardNew @register="registerSampleCardNewModal" />
   <!-- 打印原始数据 -->
   <printOriginalRecords @register="registerPrintOriginalRecordsModal" />
 </template>
@@ -258,11 +260,13 @@
   import { useModal } from '/@/components/Modal';
   import printOriginalRecords from '../operator/components/printOriginalRecords.vue';
   import printBilletSampleCard from '../operator/components/printBilletSampleCard.vue';
+  import printBilletSampleCardNew from '../operator/components/printBilletSampleCardNew.vue';
 
   const currentDate = ref<Dayjs>(dayjs());
 
   // 棒线堆垛明细
-  const [registerDetailModal, { openModal: openDetailModal }] = useModal();
+  const [registerSampleCardModal, { openModal: openDetailModal }] = useModal();
+  const [registerSampleCardNewModal, { openModal: openDetailNewModal }] = useModal();
   // 注册打印原始记录modal
   const [registerPrintOriginalRecordsModal, { openModal: openPrintOriginalRecordsModal }] = useModal();
 
@@ -494,6 +498,20 @@
         });
 
       currentShift.value = shiftPerformanceColumns.value.length > 0 ? shiftPerformanceColumns.value.length - 1 : 0;
+
+      // openDetailNewModal(true, {
+      //   shiftText: getTeamShift(
+      //     shiftPerformanceColumns.value[currentShift.value] ? shiftPerformanceColumns.value[currentShift.value].shift : '',
+      //     shiftPerformanceColumns.value[currentShift.value] ? shiftPerformanceColumns.value[currentShift.value].shiftGroup : ''
+      //   ),
+      //   curShiftInfo: {
+      //     shift: shiftPerformanceColumns.value[currentShift.value] ? shiftPerformanceColumns.value[currentShift.value].shift : '',
+      //     shiftGroup: shiftPerformanceColumns.value[currentShift.value] ? shiftPerformanceColumns.value[currentShift.value].shiftGroup : '',
+      //   },
+      //   queryType: '1',
+      //   ccmNo: machine,
+      //   changeShiftId: shiftPerformanceColumns.value[currentShift.value].id,
+      // });
     } catch (error) {
       console.error(error);
     } finally {

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

@@ -265,7 +265,7 @@
     }
   };
 
-  const { start, stop } = useTimeoutFn(getInfo, 10000);
+  const { start, stop } = useTimeoutFn(getInfo, 10000, true);
 
   // 获取堆垛机堆垛信息
   // 获取当前堆垛信息

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

@@ -289,7 +289,7 @@
     }
   };
 
-  const { start, stop } = useTimeoutFn(getInfo, 5000);
+  const { start, stop } = useTimeoutFn(getInfo, 5000, true);
 
   // 换炉
   const changeHeatLoading = ref(false);

+ 54 - 3
src/views/billet/operator/components/orgRecordTable.vue

@@ -1,5 +1,56 @@
 <template>
-  <div class="orgRecordTable"> </div>
+  <div class="orgRecordTable ticket next-ticket">
+    <!-- 顶部标题 -->
+    <div style="text-align: center; position: relative">
+      <div class="noprint" style="position: absolute; z-index: 100">
+        <a-button v-if="isEditAbled" type="primary" style="margin-right: 10px" @click="addHeatNo">添加炉号</a-button>
+        <a-button v-if="isShowSendSample" type="primary" @click="() => {}">送样卡</a-button>
+      </div>
+      <slot name="title">
+        <p style="font-size: 24px; font-weight: 800; display: inline-block; margin-bottom: 16px; line-height: 30px">
+          {{ title }}
+        </p>
+      </slot>
+    </div>
+  </div>
 </template>
-<script setup lang="ts"></script>
-<style lang="less" scoped></style>
+<script setup lang="ts">
+  import { ref } from 'vue';
+
+  const props = defineProps({
+    title: {
+      type: String,
+      default: '',
+    },
+    listFunc: {
+      type: Function,
+      default: () => {},
+    },
+    editFunc: {
+      type: Function,
+      default: () => {},
+    },
+    // 是否可编辑
+    isEditAbled: {
+      type: Boolean,
+      default: false,
+    },
+    // 是否显示送样卡按钮
+    isShowSendSample: {
+      type: Boolean,
+      default: false,
+    },
+  });
+
+  /*************************添加炉号操作开始*******************************/
+  const addHeatNo = () => {};
+  /*************************添加炉号操作结束*******************************/
+</script>
+<style scoped lang="less">
+  .ticket {
+    max-width: 1400px;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+  }
+</style>

+ 0 - 1
src/views/billet/operator/components/printBilletSampleCard.vue

@@ -244,7 +244,6 @@
 
   //表单赋值
   const [registerModal, { changeOkLoading }] = useModalInner(async (data) => {
-    console.log('11111111111111111', data);
     const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId } = data;
     hostNumber.value = ccmNo;
     shiftInfoTxt.value = shiftText.replace('-', '/');

+ 39 - 0
src/views/billet/operator/components/printBilletSampleCardNew.vue

@@ -0,0 +1,39 @@
+<template>
+  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose title="钢坯送样卡" :width="800" :height="930" ok-text="打印" @ok="onPrint">
+    <section
+      ref="print"
+      style="padding: 10px 10px 0; position: relative; border: 1px solid #c5c5c5; background: #fff; width: 100%"
+      id="printBilletSampleCard"
+    >
+      <orgRecordTable :listFunc="getSampleCardList" :editFunc="editSampleCard" title="钢 坯 送 样 卡">
+        <template #title>
+          <p style="font-size: 24px; font-weight: 800; display: inline-block; border-bottom: 2px solid #000; margin-bottom: 16px; line-height: 30px">
+            钢 坯 送 样 卡
+          </p>
+        </template>
+      </orgRecordTable>
+    </section>
+  </BasicModal>
+</template>
+<script setup lang="ts">
+  import { printJS } from '/@/hooks/web/usePrintJS';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { getSampleCardList, editSampleCard } from '../operator.api';
+  import orgRecordTable from './orgRecordTable.vue';
+
+  //表单赋值
+  const [registerModal, { changeOkLoading }] = useModalInner(async (data) => {
+    console.log('打印开始', data);
+  });
+
+  function onPrint() {
+    changeOkLoading(true);
+    printJS({
+      printable: '#printBilletSampleCard',
+      type: 'html',
+    });
+    setTimeout(() => {
+      changeOkLoading(false);
+    }, 1000);
+  }
+</script>

+ 57 - 10
src/views/billet/operator/components/printOriginalRecords.vue

@@ -18,7 +18,7 @@
       <div class="ticket next-ticket">
         <div style="text-align: center; position: relative">
           <div class="noprint" style="position: absolute; z-index: 100">
-            <a-button v-if="(isConfirmOrgData || !isEditAbled) && showAddHeatNo" type="primary" style="margin-right: 10px" @click="addHeatNo"
+            <a-button v-if="!(isConfirmOrgData && isEditAbled) && showAddHeatNo" type="primary" style="margin-right: 10px" @click="addHeatNo"
               >添加炉号</a-button
             >
             <a-button
@@ -144,7 +144,9 @@
 
     <template #appendFooter>
       <a-button @click="openJSModal = true" v-if="!isConfirmOrgData"> 重量计算 </a-button>
-      <a-button type="primary" v-if="isConfirmOrgData && !isEditAbled" @click="handlerConfirmOrgData"> 确认无误 </a-button>
+      <a-button type="primary" v-if="isConfirmOrgData && !isEditAbled" @click="handlerConfirmOrgData">
+        {{ Number(lastOrgDataStatus) >= 2 ? '确认送样卡' : '确认原始记录' }}
+      </a-button>
     </template>
   </BasicModal>
   <a-modal
@@ -246,7 +248,18 @@
   import dayjs from 'dayjs';
   import { printJS } from '/@/hooks/web/usePrintJS';
   import type { TableColumnsType } from 'ant-design-vue';
-  import { queryBilletRecordByCcmNo, editBilletRecord, addBilletNo, editOriginalProductRecord, deleteBilletRecord } from '../operator.api';
+  import {
+    queryBilletRecordByCcmNo,
+    editBilletRecord as editBilletOrgRecord,
+    addBilletNo,
+    editOriginalProductRecord,
+    deleteBilletRecord,
+    getSampleCardList, // 送样卡,原始记录列表(新)确认原始记录后,使用此接口
+    editSampleCard, // 编辑送样卡,原始记(新)确认原始记录后,编辑使用此接口
+    deleteSampleCard, // 删除送样卡,原始记录(新)确认原始记录后,删除使用此接口
+    editSampleCardRecord, // 编辑送样卡,原始记录(新)确认原始记录后,编辑使用此接口
+    addSampleCard, // 新增送样卡,原始记录(新)确认原始记录后,新增使用此接口
+  } from '../operator.api';
   import { render } from '/@/utils/common/renderUtils';
   import { isArray, isNumber } from '/@/utils/is';
   import Icon from '/@/components/Icon';
@@ -270,6 +283,12 @@
   const renderDictTag = (value: string, dictCode: string) => {
     return render.renderDict(value, dictCode);
   };
+
+  // 编辑接口
+  const editBilletRecord = (params: any) => {
+    return Number(lastOrgDataStatus.value) >= 2 ? editSampleCard(params) : editBilletOrgRecord(params);
+  };
+
   // 主机号
   const hostNumber = ref('5');
   const defaultColumns: TableColumnsType = [
@@ -300,7 +319,8 @@
                     title: '删除确认',
                     content: `确定删除【${record.heatNo}】吗?删除后无法恢复!`,
                     onOk: () => {
-                      return deleteBilletRecord({
+                      const fetchFunc = Number(lastOrgDataStatus.value) >= 2 ? deleteSampleCard : deleteBilletRecord;
+                      return fetchFunc({
                         id: orgData.id,
                       }).then(() => {
                         getHeatList({
@@ -618,6 +638,8 @@
   const curTime = ref(dayjs().format('YYYY-MM-DD'));
   // 确认上一个班次的原始数据
   const isConfirmOrgData = ref(false);
+  // 上一个班原始记录状态 1 原始记录 2 确认原始记录,这个时候显示的就是新表的数据 3 确认送样卡,界面无法编辑
+  const lastOrgDataStatus = ref(1);
   //表单赋值
   const fetchQueryType = ref(1);
   const fetchChangeShiftId = ref('');
@@ -655,8 +677,20 @@
   };
 
   const showAddHeatNo = ref(true);
+  const setStatusSuccessFunc = ref(() => {}); // 确认原始记录和送样卡成功
   const [registerModal, { changeOkLoading, changeLoading, closeModal }] = useModalInner(async (data) => {
-    const { ccmNo, shiftText, queryType, curShiftInfo, changeShiftId, time, confirmOrgData, isShowAddHeatNo } = data;
+    const {
+      ccmNo,
+      shiftText,
+      queryType,
+      curShiftInfo,
+      changeShiftId,
+      time,
+      confirmOrgData,
+      confirmOrgDataStatus,
+      isShowAddHeatNo,
+      setStatusSuccess,
+    } = data;
     printKey.value = dayjs().unix();
     // isShowAddHeatNo 是否显示添加炉号按钮 质检页面使用
     showAddHeatNo.value = isShowAddHeatNo !== false;
@@ -669,7 +703,11 @@
     fetchChangeShiftId.value = changeShiftId;
     shiftInfoTxt.value = shiftText.split('-');
     shiftInfo.value = curShiftInfo;
+    // 是否是确认原始记录弹框,如果是需要区分确认的状态,然后调用不同的接口
+    // 状态是2,就是已确认原始记录,这个时候需要使用新表送样卡的记录,状态是3 就无法编辑了
     isConfirmOrgData.value = confirmOrgData === true;
+    lastOrgDataStatus.value = confirmOrgDataStatus || 1;
+    setStatusSuccessFunc.value = setStatusSuccess;
     if (time) {
       curTime.value = time;
     }
@@ -724,13 +762,16 @@
   const getHeatList = async (params) => {
     try {
       changeLoading(true);
-      const { billetOriginalProductRecordList, content, sizeInfo, confirmStatus } = await queryBilletRecordByCcmNo(params);
+      console.log('11111111111111111111', lastOrgDataStatus.value);
+      const fetchFunc = Number(lastOrgDataStatus.value) >= 2 ? getSampleCardList : queryBilletRecordByCcmNo;
+      const { billetOriginalProductRecordList, content, sizeInfo, confirmStatus } = await fetchFunc(params);
       let newArr: any[] = [];
       mainOrgSize.value = sizeInfo || '';
       mainSize.value = sizeInfo || '';
       mainRemark.value = content || '';
       mainOrgRemark.value = content || '';
-      isEditAbled.value = confirmStatus === 2;
+      isEditAbled.value = confirmStatus === 3;
+      console.log('1111111111111111', isEditAbled.value);
       if (billetOriginalProductRecordList && Array.isArray(billetOriginalProductRecordList)) {
         // 根据时间排序
         newArr = billetOriginalProductRecordList.sort((a, b) => {
@@ -1799,6 +1840,7 @@
     handleEditShiftInfo({
       id: fetchChangeShiftId.value,
       sizeInfo: e.target.value,
+      ...(Number(lastOrgDataStatus.value) >= 2 ? { cardSizeInfo: e.target.value } : {}),
     });
   }, 500);
 
@@ -1808,6 +1850,7 @@
     handleEditShiftInfo({
       id: fetchChangeShiftId.value,
       content: e.target.value,
+      ...(Number(lastOrgDataStatus.value) >= 2 ? { cardContent: e.target.value } : {}),
     });
   }, 500);
 
@@ -1817,8 +1860,10 @@
       changeLoading(true);
       await handleEditShiftInfo({
         id: fetchChangeShiftId.value,
-        confirmStatus: 2,
+        confirmStatus: Number(lastOrgDataStatus.value) === 1 ? 2 : 3,
       });
+      lastOrgDataStatus.value = Number(lastOrgDataStatus.value) === 1 ? 2 : 3;
+      setStatusSuccessFunc.value();
       closeModal();
       changeLoading(false);
     } catch (e) {
@@ -1831,7 +1876,8 @@
   const handleEditShiftInfo = async (params) => {
     try {
       changeLoading(true);
-      await editOriginalProductRecord(params);
+      const fetchFunc = Number(lastOrgDataStatus.value) >= 2 ? editSampleCardRecord : editOriginalProductRecord;
+      await fetchFunc(params);
 
       await getHeatList({
         ccmNo: hostNumber.value,
@@ -1872,7 +1918,8 @@
       }
 
       changeLoading(true);
-      await addBilletNo({
+      const fetchFunc = Number(lastOrgDataStatus.value) >= 2 ? addSampleCard : addBilletNo;
+      await fetchFunc({
         ccmNo: hostNumber.value,
         heatNo: newHeatNo.value,
         changeShiftId: fetchChangeShiftId.value,

+ 2 - 0
src/views/billet/operator/index.vue

@@ -23,7 +23,9 @@
                   curShiftInfo: curShiftInfo.lastShiftInfo ? curShiftInfo.lastShiftInfo : curShiftInfo,
                   changeShiftId: curShiftInfo.lastShiftInfo ? curShiftInfo.lastShiftInfo.id : '',
                   time: curShiftInfo.lastShiftInfo ? curShiftInfo.lastShiftInfo.changeShiftTime : '',
+                  confirmOrgDataStatus: curShiftInfo.lastShiftInfo.confirmStatus || 1,
                   confirmOrgData: true,
+                  setStatusSuccess: () => headTopRef && headTopRef.reload(),
                 })
             "
           >

+ 28 - 0
src/views/billet/operator/operator.api.ts

@@ -44,6 +44,13 @@ enum Api {
   queryBilletStackInfoByCcmNo = '/billet/billetOriginalProductRecord/queryBilletStackInfoByCcmNo',
   // 快速创建装运单
   quickCreateStorageBill = '/billet/billetOriginalProductRecord/addStorageBill',
+
+  // 送样卡
+  querySampleCardRecordByCcmNo = '/billet/sampleCardDeliveryRecord/querySampleCardRecordByCcmNo',
+  querySampleCardRecordEdit = '/billet/sampleCardDeliveryRecord/edit',
+  querySampleCardRecordDelete = '/billet/sampleCardDeliveryRecord/delete',
+  editSampleCardRecord = '/billet/sampleCardDeliveryRecord/editSampleCardRecord',
+  querySampleCardRecordAdd = '/billet/sampleCardDeliveryRecord/add',
 }
 
 // 炉次信息
@@ -152,3 +159,24 @@ export const getStackInfoByCcmNo = (params: any) => {
 export const quickCreateStorageBill = (params: any) => {
   return defHttp.put({ url: Api.quickCreateStorageBill, params }, { joinParamsToUrl: true });
 };
+
+// 送样卡,原始记录列表(新)确认原始记录后,使用此接口
+export const getSampleCardList = (params: any) => {
+  return defHttp.get({ url: Api.querySampleCardRecordByCcmNo, params });
+};
+// 编辑送样卡,原始记(新)确认原始记录后,编辑使用此接口
+export const editSampleCard = (params: any) => {
+  return defHttp.post({ url: Api.querySampleCardRecordEdit, params });
+};
+// 送样卡,原始记录列表(新)确认原始记录后,删除使用此接口
+export const deleteSampleCard = (params: any) => {
+  return defHttp.delete({ url: Api.querySampleCardRecordDelete, params }, { joinParamsToUrl: true });
+};
+// 送样卡,原始记录列表(新)确认原始记录后,编辑备注,再次确认送样卡使用此接口
+export const editSampleCardRecord = (params: any) => {
+  return defHttp.post({ url: Api.editSampleCardRecord, params });
+};
+// 送样卡,原始记录列表(新)
+export const addSampleCard = (params: any) => {
+  return defHttp.post({ url: Api.querySampleCardRecordAdd, params });
+};

+ 244 - 106
src/views/billet/quality/index.vue

@@ -85,113 +85,114 @@
             >
               确认无误</a-button
             >
+            <a-button style="margin-left: 10px" size="large" type="primary" @click="onPrint"> 打印</a-button>
           </div>
         </template>
       </BasicForm>
     </div>
 
-    <BasicTable @register="registerTable">
-      <template #tableTitle>
-        <div class="flex table-title-info">
-          <div class="table-title-info-item flex">
-            <span class="line_b">{{ ccmNo }}</span>
-            <span>#机</span>
+    <section ref="print" class="printBilletQuality" id="printBilletQuality">
+      <BasicTable @register="registerTable">
+        <template #tableTitle>
+          <div class="flex table-title-info">
+            <div class="table-title-info-item flex">
+              <span class="line_b">{{ ccmNo }}</span>
+              <span>#机</span>
+            </div>
+            <div class="table-title-info-item flex"><span>质检员</span><span class="line_b"></span></div>
+            <div class="table-title-info-item flex flex-1 align-center justify-center">
+              <span class="line_b">{{ getSelectedDate[0] }}</span>
+              <span>年</span>
+              <span class="line_b">{{ getSelectedDate[1] }}</span>
+              <span>月</span>
+              <span class="line_b">{{ getSelectedDate[2] }}</span>
+              <span>日</span>
+              <span class="line_b">{{
+                shiftPerformanceColumns[currentShift]
+                  ? getTeamShift(shiftPerformanceColumns[currentShift].shift, shiftPerformanceColumns[currentShift].shiftGroup)
+                  : ''
+              }}</span>
+            </div>
+
+            <div class="table-title-info-item flex"><span>zj/R19</span></div>
           </div>
-          <div class="table-title-info-item flex"><span>质检员</span><span class="line_b"></span></div>
-          <div class="table-title-info-item flex flex-1 align-center justify-center">
-            <span class="line_b">{{ getSelectedDate[0] }}</span>
-            <span>年</span>
-            <span class="line_b">{{ getSelectedDate[1] }}</span>
-            <span>月</span>
-            <span class="line_b">{{ getSelectedDate[2] }}</span>
-            <span>日</span>
-            <span class="line_b">{{
-              shiftPerformanceColumns[currentShift]
-                ? getTeamShift(shiftPerformanceColumns[currentShift].shift, shiftPerformanceColumns[currentShift].shiftGroup)
-                : ''
-            }}</span>
+        </template>
+        <template #footer>
+          <div class="flex footer-tj">
+            <a-descriptions
+              size="small"
+              bordered
+              class="remark"
+              :column="1"
+              :labelStyle="labelStyle"
+              :contentStyle="{
+                padding: 0,
+              }"
+            >
+              <a-descriptions-item label="备注:">
+                <a-textarea :bordered="false" @blur="onTotalNoteBlur" v-model:value="statisticsInfo.remark" placeholder="备注" />
+              </a-descriptions-item>
+              <a-descriptions-item>
+                <div class="total-price"> 新区冶炼 (5 + 6 铸机) </div>
+              </a-descriptions-item>
+            </a-descriptions>
+            <a-descriptions size="small" bordered class="produce" :labelStyle="labelStyle">
+              <a-descriptions-item label="本班日冶炼">
+                {{ statisticsInfo.classHeatNum || 0 }} 炉 / {{ statisticsInfo.classTotalWeight ? statisticsInfo.classTotalWeight.toFixed(3) : 0 }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止上班日累计">
+                {{ statisticsInfo.dayStartHeatCount || 0 }} 炉 / {{ statisticsInfo.dayStartWeight ? statisticsInfo.dayStartWeight.toFixed(3) : 0 }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止本班日累计">
+                {{ statisticsInfo.dayEndHeatCount || 0 }} 炉 / {{ statisticsInfo.dayEndWeight ? statisticsInfo.dayEndWeight.toFixed(3) : 0 }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="本班月冶炼">
+                {{ statisticsInfo.monthEndHeatCount || 0 }} 炉 / {{ statisticsInfo.monthEndWeight ? statisticsInfo.monthEndWeight.toFixed(3) : 0 }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止上班月累计">
+                {{ statisticsInfo.monthStartHeatCount || 0 }} 炉 /
+                {{ statisticsInfo.monthStartWeight ? statisticsInfo.monthStartWeight.toFixed(3) : 0 }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止本班月累计">
+                {{ statisticsInfo.monthEndHeatCount || 0 }} 炉 / {{ statisticsInfo.monthEndWeight ? statisticsInfo.monthEndWeight.toFixed(3) : 0 }} 吨
+              </a-descriptions-item>
+
+              <!-- <a-descriptions-item label="日产:">
+                {{ statisticsInfo.dayHeatCount || 0 }} 炉 / {{ statisticsInfo.dayEndWeight || 0 }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item> </a-descriptions-item>
+              <a-descriptions-item></a-descriptions-item> -->
+
+              <a-descriptions-item label="日统计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
+                {{ (statisticsInfo.dayHeatCount || 0) + (otherStatisticsInfo.dayHeatCount || 0) }} 炉 /
+                {{ sumWeight(statisticsInfo.dayEndWeight, otherStatisticsInfo.dayEndWeight) }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止上班日累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
+                {{ (statisticsInfo.dayStartHeatCount || 0) + (otherStatisticsInfo.dayStartHeatCount || 0) }} 炉 /
+                {{ sumWeight(statisticsInfo.dayStartWeight, otherStatisticsInfo.dayStartWeight) }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止本班日累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
+                {{ (statisticsInfo.dayEndHeatCount || 0) + (otherStatisticsInfo.dayEndHeatCount || 0) }} 炉 /
+                {{ sumWeight(statisticsInfo.dayEndWeight, otherStatisticsInfo.dayEndWeight) }} 吨
+              </a-descriptions-item>
+
+              <a-descriptions-item label="月统计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
+                {{ (statisticsInfo.monthEndHeatCount || 0) + (otherStatisticsInfo.monthEndHeatCount || 0) }} 炉 /
+                {{ sumWeight(statisticsInfo.monthEndWeight, otherStatisticsInfo.monthEndWeight) }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止上班月累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
+                {{ (statisticsInfo.monthStartHeatCount || 0) + (otherStatisticsInfo.monthStartHeatCount || 0) }} 炉 /
+                {{ sumWeight(statisticsInfo.monthStartWeight, otherStatisticsInfo.monthStartWeight) }} 吨
+              </a-descriptions-item>
+              <a-descriptions-item label="止本班月累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
+                {{ (statisticsInfo.monthEndHeatCount || 0) + (otherStatisticsInfo.monthEndHeatCount || 0) }} 炉 /
+                {{ sumWeight(statisticsInfo.monthEndWeight, otherStatisticsInfo.monthEndWeight) }} 吨
+              </a-descriptions-item>
+            </a-descriptions>
           </div>
-
-          <div class="table-title-info-item flex"><span>zj/R19</span></div>
-        </div>
-      </template>
-      <template #footer>
-        <div class="flex footer-tj">
-          <a-descriptions
-            size="small"
-            bordered
-            class="remark"
-            :column="1"
-            :labelStyle="labelStyle"
-            :contentStyle="{
-              padding: 0,
-            }"
-          >
-            <a-descriptions-item label="备注:">
-              <a-textarea :bordered="false" @blur="onTotalNoteBlur" v-model:value="statisticsInfo.remark" style="height: 77px" placeholder="备注" />
-            </a-descriptions-item>
-            <a-descriptions-item>
-              <div style="height: 77px; line-height: 78px; font-size: 24px; font-weight: 600; text-align: right; padding-right: 10px; color: #f50">
-                新区冶炼 (5 + 6 铸机)
-              </div>
-            </a-descriptions-item>
-          </a-descriptions>
-          <a-descriptions size="small" bordered class="produce" :labelStyle="labelStyle">
-            <a-descriptions-item label="本班日冶炼">
-              {{ statisticsInfo.classHeatNum || 0 }} 炉 / {{ statisticsInfo.classTotalWeight ? statisticsInfo.classTotalWeight.toFixed(3) : 0 }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止上班日累计">
-              {{ statisticsInfo.dayStartHeatCount || 0 }} 炉 / {{ statisticsInfo.dayStartWeight ? statisticsInfo.dayStartWeight.toFixed(3) : 0 }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止本班日累计">
-              {{ statisticsInfo.dayEndHeatCount || 0 }} 炉 / {{ statisticsInfo.dayEndWeight ? statisticsInfo.dayEndWeight.toFixed(3) : 0 }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="本班月冶炼">
-              {{ statisticsInfo.monthEndHeatCount || 0 }} 炉 / {{ statisticsInfo.monthEndWeight ? statisticsInfo.monthEndWeight.toFixed(3) : 0 }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止上班月累计">
-              {{ statisticsInfo.monthStartHeatCount || 0 }} 炉 /
-              {{ statisticsInfo.monthStartWeight ? statisticsInfo.monthStartWeight.toFixed(3) : 0 }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止本班月累计">
-              {{ statisticsInfo.monthEndHeatCount || 0 }} 炉 / {{ statisticsInfo.monthEndWeight ? statisticsInfo.monthEndWeight.toFixed(3) : 0 }} 吨
-            </a-descriptions-item>
-
-            <!-- <a-descriptions-item label="日产:">
-              {{ statisticsInfo.dayHeatCount || 0 }} 炉 / {{ statisticsInfo.dayEndWeight || 0 }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item> </a-descriptions-item>
-            <a-descriptions-item></a-descriptions-item> -->
-
-            <a-descriptions-item label="日统计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
-              {{ (statisticsInfo.dayHeatCount || 0) + (otherStatisticsInfo.dayHeatCount || 0) }} 炉 /
-              {{ sumWeight(statisticsInfo.dayEndWeight, otherStatisticsInfo.dayEndWeight) }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止上班日累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
-              {{ (statisticsInfo.dayStartHeatCount || 0) + (otherStatisticsInfo.dayStartHeatCount || 0) }} 炉 /
-              {{ sumWeight(statisticsInfo.dayStartWeight, otherStatisticsInfo.dayStartWeight) }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止本班日累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
-              {{ (statisticsInfo.dayEndHeatCount || 0) + (otherStatisticsInfo.dayEndHeatCount || 0) }} 炉 /
-              {{ sumWeight(statisticsInfo.dayEndWeight, otherStatisticsInfo.dayEndWeight) }} 吨
-            </a-descriptions-item>
-
-            <a-descriptions-item label="月统计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
-              {{ (statisticsInfo.monthEndHeatCount || 0) + (otherStatisticsInfo.monthEndHeatCount || 0) }} 炉 /
-              {{ sumWeight(statisticsInfo.monthEndWeight, otherStatisticsInfo.monthEndWeight) }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止上班月累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
-              {{ (statisticsInfo.monthStartHeatCount || 0) + (otherStatisticsInfo.monthStartHeatCount || 0) }} 炉 /
-              {{ sumWeight(statisticsInfo.monthStartWeight, otherStatisticsInfo.monthStartWeight) }} 吨
-            </a-descriptions-item>
-            <a-descriptions-item label="止本班月累计" :labelStyle="newLabelStyle" :contentStyle="newContentStyle">
-              {{ (statisticsInfo.monthEndHeatCount || 0) + (otherStatisticsInfo.monthEndHeatCount || 0) }} 炉 /
-              {{ sumWeight(statisticsInfo.monthEndWeight, otherStatisticsInfo.monthEndWeight) }} 吨
-            </a-descriptions-item>
-          </a-descriptions>
-        </div>
-      </template>
-    </BasicTable>
+        </template>
+      </BasicTable>
+    </section>
   </div>
   <!-- 打印原始数据 -->
   <printOriginalRecords @register="registerPrintOriginalRecordsModal" />
@@ -228,6 +229,7 @@
   import { useModal } from '/@/components/Modal';
   import printOriginalRecords from '../operator/components/printOriginalRecords.vue';
   import { useMessage } from '/@/hooks/web/useMessage';
+  import { printJS } from '/@/hooks/web/usePrintJS';
 
   const { createMessage } = useMessage();
 
@@ -244,14 +246,12 @@
   const currentShift = ref(-1);
   const ccmNo = ref('5');
   const labelStyle = {
-    width: '100px',
     paddingRight: 0,
     paddingLeft: 0,
     textAlign: 'center',
   };
 
   const newLabelStyle = {
-    width: '100px',
     paddingRight: 0,
     paddingLeft: 0,
     textAlign: 'center',
@@ -360,7 +360,7 @@
 
       const { records, statistics, meterWeight } = res;
       switchMiNum.value = meterWeight;
-      statisticsInfo.value = { ...statistics, orgRemark: statistics.remark };
+      statisticsInfo.value = { ...statistics, orgRemark: statistics.remark || '' };
 
       let sizeArr: string[] = [];
       records.forEach((item: any) => {
@@ -402,9 +402,9 @@
       let sizeArrChildren: any[] = [];
       [...new Set(sizeArr)].forEach((item) => {
         sizeArrChildren.push({
-          title: item + 'm',
+          title: item,
           dataIndex: ['lengthCountMap', item],
-          width: 60,
+          width: 39,
           align: 'center',
           customRender({ text }) {
             return text || '';
@@ -574,6 +574,18 @@
     }
   };
 
+  const printLoading = ref(false);
+  function onPrint() {
+    printLoading.value = true;
+    printJS({
+      printable: '#printBilletQuality',
+      type: 'html',
+    });
+    setTimeout(() => {
+      printLoading.value = false;
+    }, 1000);
+  }
+
   onMounted(() => {
     getShiftInfo(3, dayjs());
   });
@@ -641,7 +653,9 @@
         }
       }
     }
+  }
 
+  .printBilletQuality {
     .table-title-info {
       width: 100%;
       font-size: 16px;
@@ -663,6 +677,12 @@
     }
 
     .jeecg-basic-table {
+      :deep(.ant-table) {
+        .ant-table-content > table > tbody > tr > td {
+          padding: 2px;
+        }
+      }
+
       :deep(.ant-table-footer) {
         padding: 0;
       }
@@ -678,11 +698,19 @@
         input {
           color: var(--fn-color);
         }
+
+        .ant-picker-suffix {
+          display: none;
+        }
       }
 
       :deep(.ant-select) {
+        .ant-select-selector {
+          padding: 0;
+        }
         .ant-select-selection-item {
           color: var(--fn-color);
+          padding-inline-end: 0;
         }
       }
     }
@@ -692,7 +720,15 @@
       color: var(--fn-color);
 
       .remark {
-        width: 400px;
+        width: 30%;
+
+        :deep(.ant-descriptions-item-label) {
+          width: 70px;
+        }
+
+        :deep(.ant-input) {
+          height: 62px;
+        }
       }
 
       .produce {
@@ -706,12 +742,114 @@
 
       :deep(.ant-descriptions-item-content),
       :deep(.ant-descriptions-item-label) {
+        width: 90px;
         border-inline-end: 1px solid var(--fn-color);
+        border-right: 1px solid #dbdbdb;
+        padding: 4px 0;
       }
 
+      // ant-descriptions-item-label
+
       :deep(.ant-descriptions-row) {
         border-bottom: 1px solid var(--fn-color);
+        border-bottom-color: #dbdbdb;
+      }
+
+      .total-price {
+        height: 60px;
+        font-size: 18px;
+        font-weight: 600;
+        text-align: right;
+        color: #f50;
+      }
+    }
+  }
+</style>
+<style lang="less">
+  @media print {
+    header,
+    footer,
+    .noprint,
+    .ant-picker .ant-picker-suffix,
+    .ant-select .ant-select-arrow {
+      display: none;
+    }
+
+    td,
+    th,
+    .ant-picker-input > input,
+    .ant-select-selection-item {
+      font-size: 10px;
+      padding: 0;
+    }
+
+    .ant-table .ant-table-content > table > tbody > tr > td {
+      padding: 0;
+    }
+
+    .ant-picker .ant-picker-input > input {
+      font-size: 10px;
+    }
+
+    .footer-tj .remark .ant-descriptions-view {
+      .ant-descriptions-item-label {
+        width: 20px !important;
+        font-size: 10px;
       }
+
+      .ant-input {
+        font-size: 10px;
+        height: 48px !important;
+      }
+
+      .total-price {
+        height: 48px !important;
+      }
+    }
+
+    .footer-tj .produce .ant-descriptions-view {
+      .ant-descriptions-item-label {
+        width: 60px !important;
+        font-size: 10px;
+      }
+
+      .ant-descriptions-item-content {
+        font-size: 10px;
+      }
+    }
+
+    // .footer-tj .remark .ant-descriptions-view > table > tbody > tr > th {
+    //   font-size: 12px;
+    //   width: 10px;
+    // }
+
+    // .footer-tj .produce .ant-descriptions-item-label,
+    // .footer-tj .produce .ant-descriptions-item-content {
+    //   font-size: 10px;
+    //   padding: 0;
+    // }
+
+    // .footer-tj .produce .ant-descriptions-item-label {
+    //   width: 70px;
+    // }
+
+    // .footer-tj .remark .ant-descriptions-item-label {
+    //   width: 30px;
+
+    //   .total-price {
+    //     height: auto;
+    //     font-size: 12px;
+    //     color: blue;
+    //   }
+    // }
+
+    // .footer-tj > tr > td {
+    //   padding: 0;
+    // }
+
+    @page {
+      margin-top: 10px; /* 第一页的页眉距离顶部为0 */
+      margin-bottom: 0; /* 第一页的页脚距离底部为0 */
     }
   }
 </style>

+ 23 - 14
src/views/billet/quality/quality.data.ts

@@ -18,20 +18,23 @@ export const getTableColumns = ({ onTimeChange, onClickRemark, onBrandNumChange
     title: '炉号',
     dataIndex: 'heatNo',
     key: 'heatNo',
-    width: 100,
+    width: 60,
     align: 'center',
   },
   {
     title: '送样时间',
     dataIndex: 'deliveryTime',
     key: 'deliveryTime',
-    width: 120,
+    width: 104,
     align: 'center',
     customRender({ text, record }) {
       if (!record.heatNo) return '';
       return h(DatePicker, {
         bordered: false,
         showTime: true,
+        size: 'small',
+        allowClear: false,
+        suffixIcon: '',
         defaultValue: dayjs(text),
         onChange(date) {
           onTimeChange && onTimeChange(date, record);
@@ -43,15 +46,17 @@ export const getTableColumns = ({ onTimeChange, onClickRemark, onBrandNumChange
     title: '牌号',
     dataIndex: 'brandNum',
     key: 'brandNum',
-    width: 90,
+    width: 57,
     align: 'center',
     customRender(opt) {
       if (!opt.record.heatNo) return '';
       return h(JSearchSelect, {
         value: opt.text,
         dict: 'billet_spec',
+        size: 'small',
         bordered: false,
         dropdownStyle: {},
+        allowClear: false,
         onChange(value) {
           onBrandNumChange && onBrandNumChange(value, opt.record);
         },
@@ -71,12 +76,14 @@ export const getTableColumns = ({ onTimeChange, onClickRemark, onBrandNumChange
     key: 'workLength',
     width: 150,
     align: 'left',
-    customRender({ text, record }) {
-      if (!record.heatNo) return '';
+    customRender({ text }) {
+      if (!text) return '';
       return h('div', {}, [
-        h('span', { style: { display: 'inline-block', width: '60px', color: '#f50' } }, text.size),
-        h('span', { style: { display: 'inline-block', width: '60px', color: '#108ee9' } }, text.num ? text.num + ' 支' : ''),
-        h('span', { style: { display: 'inline-block', color: '#87d068' } }, text.weight ? text.weight + ' 吨' : ''),
+        h('span', { style: { display: 'inline', width: '50px', color: '#f50' } }, text.size),
+        h('span', {},' / '),
+        h('span', { style: { display: 'inline', width: '50px', color: '#108ee9' } }, text.num ? text.num + ' 支' : ''),
+        h('span', {},' / '),
+        h('span', { style: { display: 'inline', color: '#87d068' } }, text.weight ? text.weight + ' 吨' : ''),
       ]);
     },
   },
@@ -86,12 +93,14 @@ export const getTableColumns = ({ onTimeChange, onClickRemark, onBrandNumChange
     key: 'dayLength',
     width: 150,
     align: 'left',
-    customRender({ text, record }) {
-      if (!record.heatNo) return '';
+    customRender({ text }) {
+      if (!text) return '';
       return h('div', {}, [
-        h('span', { style: { display: 'inline-block', width: '60px', color: '#f50' } }, text.size),
-        h('span', { style: { display: 'inline-block', width: '60px', color: '#108ee9' } }, text.num ? text.num + ' 支' : ''),
-        h('span', { style: { display: 'inline-block', color: '#87d068' } }, text.weight ? text.weight + ' 吨' : ''),
+        h('span', { style: { display: 'inline', width: '50px', color: '#f50' } }, text.size),
+        h('span', {},' / '),
+        h('span', { style: { display: 'inline', width: '50px', color: '#108ee9' } }, text.num ? text.num + ' 支' : ''),
+        h('span', {},' / '),
+        h('span', { style: { display: 'inline', color: '#87d068' } }, text.weight ? text.weight + ' 吨' : ''),
       ]);
     },
   },
@@ -99,7 +108,7 @@ export const getTableColumns = ({ onTimeChange, onClickRemark, onBrandNumChange
     title: '备注',
     dataIndex: 'notes',
     key: 'notes',
-    width: 100,
+    width: 95,
     align: 'center',
     customRender(opt) {
       if (!opt.record.heatNo) return '';