zhangafei 1 week ago
parent
commit
b2dde0529a

+ 9 - 4
src/views/billet/Dashboard/rollingThree.vue

@@ -85,7 +85,7 @@
           <a-col class="gutter-row" v-for="item in threeList" :key="item.id">
             <div class="ticket next-ticket" :class="{ disabled: !!item.confirmTime, 'back-disabled': item.withdrawStatus === 1 }">
               <!-- 如果是棒三 就只有 gp 账号 和bangsan3 账号 有权限编辑 -->
-              <div class="ticket-op-w flex" v-if="machineNum != '3' || (isAuthGpAndBangsan && machineNum == '3')">
+              <div class="ticket-op-w flex" v-if="isAuthGpAndBangsan">
                 <div class="ticket-op flex-1">
                   <a-button
                     :disabled="!!item.confirmTime || item.withdrawStatus === 1"
@@ -243,12 +243,17 @@
   const userStore = useUserStore();
   const { createMessage } = useMessage();
 
-  const isAuth = userStore.userInfo && userStore.userInfo.username === '5';
-  const isAuthGpAndBangsan = userStore.userInfo && (userStore.userInfo.username === 'gp' || userStore.userInfo.username === 'bangsan3');
-
   const threeList = ref<any[]>([]);
   const machineNum = getMachineNum(true) || '3';
 
+  const isAuth = userStore.userInfo && userStore.userInfo.username === '5';
+  // 是否有权限编辑
+  const isAuthGpAndBangsan =
+    userStore.userInfo &&
+    (userStore.userInfo.username === 'gp' ||
+      (userStore.userInfo.username === 'banger01' && machineNum === '2') ||
+      (userStore.userInfo.username === 'bangsan3' && machineNum === '3') ||
+      (userStore.userInfo.username === 'shangruo01' && machineNum === '4'));
   // 判断是不是5 6 账号
   const getCcmNo = computed(() => {
     const userInfo = userStore.userInfo;

+ 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);

+ 227 - 173
src/views/billet/operator/components/orgData.vue

@@ -4,6 +4,7 @@
       <div style="text-align: center; position: relative">
         <div class="noprint" style="position: absolute">
           <a-button type="primary" @click="addHeatNo">添加炉号</a-button>
+          <a-button type="primary" style="margin-left: 20px" @click="addRollLine">添加棒线</a-button>
         </div>
         <p style="font-size: 24px; font-weight: 800; display: inline-block; margin-bottom: 16px; line-height: 30px">
           <span class="ccmno">{{ hostNumber }}</span> #机推钢室生产原始记录
@@ -154,6 +155,17 @@
       <a-input size="large" v-model:value="newHeatNo"></a-input>
     </div>
   </a-modal>
+
+  <!-- 添加棒线 -->
+  <a-modal v-model:open="opeBanLine" title="添加棒线" centered width="500px" :zIndex="1000" @ok="confirmAddBanLine">
+    <div style="padding: 30px; font-size: 16px">
+      <div class="flex" style="margin-bottom: 30px">
+        <a-select size="large" class="flex-1" v-model:value="banLineVal" allowClear :options="getAddBanLine" />
+      </div>
+
+      <a-input-number size="large" placeholder="请输入定尺" style="width: 100%" v-model:value="banLineSizeVal" :min="1" :controls="false" />
+    </div>
+  </a-modal>
 </template>
 <script setup lang="ts">
   import { ref, computed, h, onMounted } from 'vue';
@@ -169,11 +181,12 @@
   import { initDictOptions } from '/@/utils/dict';
   import { useTimeoutFn } from '/@/hooks/core/useTimeout';
   import { getMachineConfig, MachineConfigType } from '../../hotDelivery/common.data';
-  import { steelPlateFormula } from '../operator.data';
+  import { steelPlateFormula, getBandBaseData, getHotColumns } from '../operator.data';
+  import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
 
   const emits = defineEmits(['statistics']);
 
-  const { createMessage } = useMessage();
+  const { createMessage, createConfirm } = useMessage();
   const printKey = ref(dayjs().unix());
 
   const props = defineProps({
@@ -186,6 +199,8 @@
   const renderDictTag = (value: string, dictCode: string) => {
     return render.renderDict(value, dictCode);
   };
+
+  const paiHao = ref('5');
   // 主机号
   const hostNumber = ref('5');
   const defaultColumns: TableColumnsType = [
@@ -209,8 +224,47 @@
       align: 'center',
       dataIndex: 'brandNum',
       key: 'brandNum',
-      customRender: ({ text }) => {
-        return render.renderDict(text, 'billet_spec');
+      customRender: ({ text, index, record }) => {
+        if (!record.heatNo) return '';
+        const { orgData } = record;
+        return h(
+          JSearchSelect,
+          {
+            key: orgData.heatNo + record.keyDate,
+            type: 'list',
+            bordered: false,
+            value: text,
+            dict: 'billet_spec',
+            onChange: (v) => {
+              createConfirm({
+                iconType: 'warning',
+                title: '交班确认',
+                content: `确定修改【${record.heatNo}】的牌号吗?`,
+                onOk: () => {
+                  return editBilletRecord({
+                    ...orgData,
+                    grade: v,
+                  }).then(() => {
+                    getHeatList({
+                      ccmNo: hostNumber.value,
+                      queryType: fetchQueryType.value,
+                      changeShiftId: fetchChangeShiftId.value,
+                    });
+                  });
+                },
+                onCancel: () => {
+                  getHeatList({
+                    ccmNo: hostNumber.value,
+                    queryType: fetchQueryType.value,
+                    changeShiftId: fetchChangeShiftId.value,
+                  });
+                },
+              });
+            },
+            placeholder: '请选择',
+          },
+          ''
+        );
       },
     },
     {
@@ -228,7 +282,6 @@
               },
               class: 'noprint',
               onClick: () => {
-                console.log('点击了');
                 const rollOnrColumn: any = columns.value.find((item: any) => item.dataIndex === 'rollOne');
                 let newSize: string | number = '';
                 rollOnrColumn.children.push({
@@ -339,12 +392,10 @@
   const isSpinning = ref(false);
   // 字段映射
   const headText = {
-    rollClubTwoCount: '二',
-    rollClubThreeCount: '三',
-    rollClubShippCount: '上',
     roll_club_two: '棒二',
     roll_club_three: '棒三',
     roll_out_shipp: '上若',
+    roll_deputy_cross: '付跨',
   };
   const changeLoading = (b) => {
     isSpinning.value = b;
@@ -465,16 +516,21 @@
         // 棒一
         const rollOneColumns: TableColumnsType = [];
         const rollOneSize = {};
-        // 棒二
-        const rollTwoSize = {};
-        // 棒三
-        const rollThreeSize = {};
-        // 上若
-        const rollShippSize = {};
-        // 冷装
-        const rollTwoColdSize = {};
-        const rollThreeColdSize = {};
-        const rollShippColdSize = {};
+        // 棒线热装和冷装
+        const rollOneHotAndColdSize = {
+          '1': {
+            roll_club_two: {},
+            roll_club_three: {},
+            roll_out_shipp: {},
+            roll_deputy_cross: {},
+          },
+          '0': {
+            roll_club_two: {},
+            roll_club_three: {},
+            roll_out_shipp: {},
+            roll_deputy_cross: {},
+          },
+        };
         // 装车按热装和冷装分组
         const rollChargeSizeType = {
           '0': {},
@@ -572,39 +628,10 @@
           };
         });
 
-        const hotChargeColumns: any = {
-          // 棒二字段
-          roll_club_two: {
-            title: '棒二',
-            dataIndex: 'roll_club_two',
-            key: 'roll_club_two',
-            // width: 100,
-            children: [],
-          },
-          // 棒三字段
-          roll_club_three: {
-            title: '棒三',
-            dataIndex: 'roll_club_three',
-            key: 'roll_club_three',
-            // width: 100,
-            children: [],
-          },
-          // 上若字段
-          roll_out_shipp: {
-            title: '上若',
-            dataIndex: 'roll_out_shipp',
-            key: 'roll_out_shipp',
-            // width: 100,
-            children: [],
-          },
-        };
+        const hotChargeColumns: any = getBandBaseData();
 
         // 热装字段
-        let columnsHotCharge: any = {
-          roll_club_two: [],
-          roll_club_three: [],
-          roll_out_shipp: [],
-        };
+        let columnsHotCharge: any = getHotColumns();
 
         const dataOrgSource = defaultSourceData.map((item, index) => {
           if (!newArr[index]) return item;
@@ -613,10 +640,6 @@
           // 棒一
           let rollOneNum = '';
           let rollOneSizesObj = {};
-          // if (hotSend) {
-          //   const obj = JSON.parse(hotSend);
-          //   rollOneNum = obj.hotSendTotalCount || '';
-          // }
           if (rollClubOneDetails) {
             const obj = JSON.parse(rollClubOneDetails);
             rollOneNum = obj.directRollingTotalCount || '';
@@ -710,99 +733,23 @@
               const dataKey = sizeFormat + k.hotChargeDestination + k.hotChargeBtype;
               sizeArr[dataKey] = k.totalCount;
               // 热送统计
-              // 棒二
-              if (k.hotChargeDestination === 'roll_club_two' && k.totalCount > 0) {
-                // 添加定尺
-                columnsHotCharge.roll_club_two.push(sizeFormat);
-
-                if (k.hotChargeBtype === '0') {
-                  if (!rollTwoSize[k.hotChargeLength]) {
-                    rollTwoSize[k.hotChargeLength] = {
-                      type: k.hotChargeBtype,
-                      size: Number(k.hotChargeLength) / 1000 + 'm',
-                      amount: k.totalCount,
-                      weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
-                    };
-                  } else {
-                    rollTwoSize[k.hotChargeLength].amount += k.totalCount;
-                    rollTwoSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
-                  }
-                } else {
-                  if (!rollTwoColdSize[k.hotChargeLength]) {
-                    rollTwoColdSize[k.hotChargeLength] = {
-                      type: k.hotChargeBtype,
-                      size: Number(k.hotChargeLength) / 1000 + 'm',
-                      amount: k.totalCount,
-                      weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
-                    };
-                  } else {
-                    rollTwoColdSize[k.hotChargeLength].amount += k.totalCount;
-                    rollTwoColdSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
-                  }
-                }
-              }
-              // 棒三
-              if (k.hotChargeDestination === 'roll_club_three' && k.totalCount > 0) {
-                // 添加定尺
-                columnsHotCharge.roll_club_three.push(sizeFormat);
-
-                if (k.hotChargeBtype === '0') {
-                  if (!rollThreeSize[k.hotChargeLength]) {
-                    rollThreeSize[k.hotChargeLength] = {
-                      type: k.hotChargeBtype,
-                      size: Number(k.hotChargeLength) / 1000 + 'm',
-                      amount: k.totalCount,
-                      weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
-                    };
-                  } else {
-                    rollThreeSize[k.hotChargeLength].amount += k.totalCount;
-                    rollThreeSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
-                  }
-                } else {
-                  if (!rollThreeColdSize[k.hotChargeLength]) {
-                    rollThreeColdSize[k.hotChargeLength] = {
-                      type: k.hotChargeBtype,
-                      size: Number(k.hotChargeLength) / 1000 + 'm',
-                      amount: k.totalCount,
-                      weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
-                    };
-                  } else {
-                    rollThreeColdSize[k.hotChargeLength].amount += k.totalCount;
-                    rollThreeColdSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
-                  }
-                }
-              }
-              // 上若
-              if (k.hotChargeDestination === 'roll_out_shipp' && k.totalCount > 0) {
-                // 添加定尺
-                columnsHotCharge.roll_out_shipp.push(sizeFormat);
-
-                if (k.hotChargeBtype === '0') {
-                  if (!rollShippSize[k.hotChargeLength]) {
-                    rollShippSize[k.hotChargeLength] = {
-                      type: k.hotChargeBtype,
-                      size: Number(k.hotChargeLength) / 1000 + 'm',
-                      amount: k.totalCount,
-                      weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
-                    };
-                  } else {
-                    rollShippSize[k.hotChargeLength].amount += k.totalCount;
-                    rollShippSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
-                  }
-                } else {
-                  if (!rollShippColdSize[k.hotChargeLength]) {
-                    rollShippColdSize[k.hotChargeLength] = {
-                      type: k.hotChargeBtype,
-                      size: Number(k.hotChargeLength) / 1000 + 'm',
-                      amount: k.totalCount,
-                      weight: steelPlateFormula(k.hotChargeLength, k.totalCount),
-                    };
-                  } else {
-                    rollShippColdSize[k.hotChargeLength].amount += k.totalCount;
-                    rollShippColdSize[k.hotChargeLength].weight += steelPlateFormula(k.hotChargeLength, k.totalCount);
-                  }
+              if (k.totalCount > 0) {
+                if (!rollOneHotAndColdSize[k.hotChargeBtype][k.hotChargeDestination][k.hotChargeLength]) {
+                  rollOneHotAndColdSize[k.hotChargeBtype][k.hotChargeDestination][k.hotChargeLength] = {
+                    type: k.hotChargeBtype,
+                    size: Number(k.hotChargeLength) / 1000 + 'm',
+                    amount: 0,
+                    weight: 0,
+                  };
                 }
+
+                rollOneHotAndColdSize[k.hotChargeBtype][k.hotChargeDestination][k.hotChargeLength].amount += k.totalCount;
+                rollOneHotAndColdSize[k.hotChargeBtype][k.hotChargeDestination][k.hotChargeLength].weight += steelPlateFormula(
+                  k.hotChargeLength,
+                  k.totalCount
+                );
               }
+              columnsHotCharge[k.hotChargeDestination].push(sizeFormat);
 
               // 热装按类型分组,分热装和冷装
               if (!rollChargeSizeType[k.hotChargeBtype][k.hotChargeLength]) {
@@ -906,6 +853,7 @@
           return {
             ...item,
             heatNo: newArr[index].heatNo,
+            keyDate: new Date().getTime(),
             brandNum: newArr[index].grade,
             oneFlow: newArr[index].oneStrandSum || '',
             twoFlow: newArr[index].twoStrandSum || '',
@@ -996,6 +944,7 @@
                 },
               };
             });
+
             otherColumnsNums = otherColumnsNums + (childSizesColumn.length ? childSizesColumn.length : 1);
             return {
               ...hotChargeColumns[item],
@@ -1026,36 +975,45 @@
           hotSendList.value['一'] = Object.values(rollOneSize);
           hotSendList.value['一'].forEach((ele) => (allWeight += ele.weight));
         }
-        if (Object.values(rollTwoSize).length) {
-          hotSendList.value['二'] = Object.values(rollTwoSize);
+        if (Object.values(rollOneHotAndColdSize['0']['roll_club_two']).length) {
+          hotSendList.value['二'] = Object.values(rollOneHotAndColdSize['0']['roll_club_two']);
           hotSendList.value['二'].forEach((ele) => (allWeight += ele.weight));
         }
-        if (Object.values(rollThreeSize).length) {
-          hotSendList.value['三'] = Object.values(rollThreeSize);
+        if (Object.values(rollOneHotAndColdSize['0'].roll_club_three).length) {
+          hotSendList.value['三'] = Object.values(rollOneHotAndColdSize['0'].roll_club_three);
           hotSendList.value['三'].forEach((ele) => (allWeight += ele.weight));
         }
-        if (Object.values(rollShippSize).length) {
-          hotSendList.value['上'] = Object.values(rollShippSize);
+        if (Object.values(rollOneHotAndColdSize['0'].roll_out_shipp).length) {
+          hotSendList.value['上'] = Object.values(rollOneHotAndColdSize['0'].roll_out_shipp);
           hotSendList.value['上'].forEach((ele) => (allWeight += ele.weight));
         }
+        if (Object.values(rollOneHotAndColdSize['0'].roll_deputy_cross).length) {
+          hotSendList.value['付'] = Object.values(rollOneHotAndColdSize['0'].roll_deputy_cross);
+          hotSendList.value['付'].forEach((ele) => (allWeight += ele.weight));
+        }
+
         if (Object.values(stackingSize)) {
           stackingList.value = Object.values(stackingSize);
           stackingList.value.forEach((ele) => (allWeight += ele.weight));
         }
 
         // 冷装统计
-        if (Object.values(rollTwoColdSize).length) {
-          coldSendList.value['二'] = Object.values(rollTwoColdSize);
+        if (Object.values(rollOneHotAndColdSize['1'].roll_club_two).length) {
+          coldSendList.value['二'] = Object.values(rollOneHotAndColdSize['1'].roll_club_two);
           coldSendList.value['二'].forEach((ele) => (allWeight += ele.weight));
         }
-        if (Object.values(rollThreeColdSize).length) {
-          coldSendList.value['三'] = Object.values(rollThreeColdSize);
+        if (Object.values(rollOneHotAndColdSize['1'].roll_club_three).length) {
+          coldSendList.value['三'] = Object.values(rollOneHotAndColdSize['1'].roll_club_three);
           coldSendList.value['三'].forEach((ele) => (allWeight += ele.weight));
         }
-        if (Object.values(rollShippColdSize).length) {
-          coldSendList.value['上'] = Object.values(rollShippColdSize);
+        if (Object.values(rollOneHotAndColdSize['1'].roll_out_shipp).length) {
+          coldSendList.value['上'] = Object.values(rollOneHotAndColdSize['1'].roll_out_shipp);
           coldSendList.value['上'].forEach((ele) => (allWeight += ele.weight));
         }
+        if (Object.values(rollOneHotAndColdSize['1'].roll_deputy_cross).length) {
+          coldSendList.value['付'] = Object.values(rollOneHotAndColdSize['1'].roll_deputy_cross);
+          coldSendList.value['付'].forEach((ele) => (allWeight += ele.weight));
+        }
 
         emits('statistics', {
           chargeList: rollChargeSizeType,
@@ -1075,23 +1033,6 @@
     }
   };
 
-  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 '';
-  });
-
   // 修改合计
   const handleTotalChange = throttle((e: any, record) => {
     const val = Number(e.target.value);
@@ -1589,6 +1530,116 @@
       changeLoading(false);
     }
   };
+
+  // 添加棒线
+  const opeBanLine = ref(false);
+  const banLineVal = ref(undefined);
+  const banLineSizeVal = ref<number>();
+  const getAddBanLine = computed(() => {
+    const options = Object.values(getBandBaseData()).map((item) => {
+      return {
+        label: item.title,
+        value: item.key,
+      };
+    });
+    return options;
+  });
+  const addRollLine = async () => {
+    opeBanLine.value = true;
+  };
+  const confirmAddBanLine = async () => {
+    if (!banLineVal.value) {
+      createMessage.warning('请选择棒线');
+      return;
+    }
+
+    if (!banLineSizeVal.value) {
+      createMessage.warning('请选择定尺');
+      return;
+    }
+
+    const size = banLineSizeVal.value <= 20 ? banLineSizeVal.value : banLineSizeVal.value / 1000;
+    const getSizeChild = (sizes) => {
+      const niubiGls: any[] = [];
+      sizes.forEach((ele) => {
+        niubiGls.push(
+          {
+            hotChargeLength: Number(ele) * 1000,
+            hotChargeDestination: banLineVal.value,
+            totalWeight: 0,
+            hotChargeBtype: '0',
+            totalCount: 0,
+          },
+          {
+            hotChargeLength: Number(ele) * 1000,
+            hotChargeDestination: banLineVal.value,
+            totalWeight: 0,
+            hotChargeBtype: '1',
+            totalCount: 0,
+          }
+        );
+      });
+
+      return {
+        title: size,
+        dataIndex: `${banLineVal.value}.${size}`,
+        key: `${banLineVal.value}.${size}`,
+        width: 80,
+        align: 'center',
+        customRender: ({ record }) => {
+          return h(
+            'div',
+            {
+              class: 'size-st-wrapper',
+              onClick: () => {
+                // if (!record[hotKey] && !record[coldKey]) return;
+                const { orgData } = record;
+                if (!orgData) return;
+                const { hotChargeLength } = orgData;
+
+                const hotChargeInfoArr = hotChargeLength ? JSON.parse(hotChargeLength) : [];
+
+                const itemsHotArr = niubiGls.map((v) => {
+                  const hasVal = hotChargeInfoArr.find((j) => j.hotChargeLength == v.hotChargeLength && j.hotChargeBtype == v.hotChargeBtype);
+                  return {
+                    ...v,
+                    totalCount: hasVal ? hasVal.totalCount : 0,
+                  };
+                });
+
+                editSizeNumRecord.value = {
+                  ...orgData,
+                  hotChargeLengthArr: itemsHotArr,
+                };
+                openSetSizeNumModal.value = true;
+              },
+            },
+            ''
+          );
+        },
+      };
+    };
+    // 判断是否有该棒线
+    const hasRoll: any = (columns.value as TableColumnsType[]).find((col: any) => col.dataIndex === banLineVal.value);
+    if (hasRoll) {
+      const hasSize = hasRoll.children.find((k) => k.dataIndex === `${banLineVal.value}.${size}`);
+
+      if (hasSize) {
+        createMessage.error('该棒线定尺已存在!');
+        return;
+      }
+      const sizesArr = hasRoll.children.map((j) => j.title);
+      const sizeColums = getSizeChild([...sizesArr, size]);
+      hasRoll.children.push(sizeColums);
+    } else {
+      const newsColumn: any = getBandBaseData()[banLineVal.value];
+      const sizeColums = getSizeChild([size]);
+      newsColumn.children.push(sizeColums);
+      columns.value.splice(4, 0, newsColumn);
+    }
+
+    opeBanLine.value = false;
+  };
 </script>
 <style lang="less" scoped>
   .orgData-info-spin {
@@ -1776,10 +1827,13 @@
 
             .ant-select-selector {
               padding: 0;
+              color: rgba(255, 255, 255, 0.8);
+              font-size: 20px;
 
               .ant-select-selection-item,
               .ant-select-selection-placeholder {
                 padding-inline-end: 0;
+                color: rgba(255, 255, 255, 0.8);
               }
             }
             .ant-select-arrow {

+ 48 - 0
src/views/billet/operator/operator.data.ts

@@ -300,3 +300,51 @@ export const steelPlateFormula = (size, nums, diameter = 0.2265) => {
   const weight = parseFloat(((Number(size) / 1000) * diameter).toFixed(3));
   return nums * weight;
 };
+
+// 获取棒线基础数据
+export const getBandBaseData = () => {
+  return {
+    // 棒二字段
+    roll_club_two: {
+      title: '棒二',
+      dataIndex: 'roll_club_two',
+      key: 'roll_club_two',
+      // width: 100,
+      children: [],
+    },
+    // 棒三字段
+    roll_club_three: {
+      title: '棒三',
+      dataIndex: 'roll_club_three',
+      key: 'roll_club_three',
+      // width: 100,
+      children: [],
+    },
+    // 上若字段
+    roll_out_shipp: {
+      title: '上若',
+      dataIndex: 'roll_out_shipp',
+      key: 'roll_out_shipp',
+      // width: 100,
+      children: [],
+    },
+    // 付跨字段
+    roll_deputy_cross: {
+      title: '付跨',
+      dataIndex: 'roll_deputy_cross',
+      key: 'roll_deputy_cross',
+      // width: 100,
+      children: [],
+    },
+  };
+};
+
+export const getHotColumns = () => {
+  // 热装字段
+  return {
+    roll_club_two: [],
+    roll_club_three: [],
+    roll_out_shipp: [],
+    roll_deputy_cross: [],
+  };
+};

+ 90 - 22
src/views/billet/quality/index.vue

@@ -121,36 +121,73 @@
             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: 116px" placeholder="备注" />
+              <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 }} 炉 / {{ statisticsInfo.classTotalWeight }} 吨
+            <a-descriptions-item label="本班冶炼">
+              {{ statisticsInfo.classHeatNum || 0 }} 炉 / {{ statisticsInfo.classTotalWeight ? statisticsInfo.classTotalWeight.toFixed(3) : 0 }} 吨
             </a-descriptions-item>
-            <a-descriptions-item label="止上班日累计">
-              {{ statisticsInfo.dayStartHeatCount }} 炉 / {{ statisticsInfo.dayStartWeight }} 吨
+            <a-descriptions-item label="止上班日累计">
+              {{ statisticsInfo.dayStartHeatCount || 0 }} 炉 / {{ statisticsInfo.dayStartWeight ? statisticsInfo.dayStartWeight.toFixed(3) : 0 }} 吨
             </a-descriptions-item>
-            <a-descriptions-item label="止本班日累计">
-              {{ statisticsInfo.dayEndHeatCount }} 炉 / {{ statisticsInfo.dayEndWeight }} 吨
+            <a-descriptions-item label="止本班日累计">
+              {{ statisticsInfo.dayEndHeatCount || 0 }} 炉 / {{ statisticsInfo.dayEndWeight ? statisticsInfo.dayEndWeight.toFixed(3) : 0 }} 吨
             </a-descriptions-item>
-            <a-descriptions-item> </a-descriptions-item>
-            <a-descriptions-item label="止上班月累计:">
-              {{ statisticsInfo.dayStartHeatCount }} 炉 / {{ statisticsInfo.dayStartWeight }} 吨
+            <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.dayEndHeatCount }} 炉 / {{ statisticsInfo.dayEndWeight }} 吨
+            <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 label="日产:">{{ statisticsInfo.dayHeatCount }} 炉 / {{ statisticsInfo.dayEndWeight }} 吨</a-descriptions-item>
-            <a-descriptions-item label="月产:">{{ statisticsInfo.monthEndCount }} 炉 / {{ statisticsInfo.monthEndWeight }} 吨</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>
@@ -197,6 +234,11 @@
   // 注册打印原始记录modal
   const [registerPrintOriginalRecordsModal, { openModal: openPrintOriginalRecordsModal }] = useModal();
 
+  const sumWeight = (s1, s2) => {
+    const s = (s1 || 0) + (s2 || 0);
+    return s > 0 ? s.toFixed(3) : 0;
+  };
+
   const shiftPerformanceColumns = ref<any>([]);
   const shiftColor = ['#f50', '#2db7f5', '#87d068'];
   const currentShift = ref(-1);
@@ -207,6 +249,17 @@
     paddingLeft: 0,
     textAlign: 'center',
   };
+
+  const newLabelStyle = {
+    width: '100px',
+    paddingRight: 0,
+    paddingLeft: 0,
+    textAlign: 'center',
+    color: '#f50',
+  };
+  const newContentStyle = {
+    color: '#f50',
+  };
   /**
    * BasicForm绑定注册;
    */
@@ -214,6 +267,7 @@
     //注册表单列
     schemas: getFormSchemas({
       onDateChange: (v) => {
+        getSelectedDate.value = v.split('-');
         currentShift.value = -1;
         getShiftInfo(3, dayjs(v));
       },
@@ -237,14 +291,7 @@
   });
 
   // 获取日期
-  const getSelectedDate = computed(() => {
-    const formVals = getFieldsValue();
-    if (formVals && formVals.queryDate) {
-      return formVals.queryDate.split('-');
-    }
-
-    return dayjs().format('YYYY-MM-DD').split('-');
-  });
+  const getSelectedDate = ref(dayjs().format('YYYY-MM-DD').split('-'));
 
   const columns = getTableColumns({
     onTimeChange(date, record) {
@@ -302,6 +349,7 @@
     try {
       if (!shiftPerformanceColumns.value[currentShift.value]) {
         setLoading(false);
+        setTableData([]);
         return;
       }
       setLoading(true);
@@ -370,9 +418,14 @@
 
       // 设计表格
       const rowNums = records.length < 10 ? 10 : records.length;
+      let startNum = 0;
       const datas = getDefaulData(rowNums + 3).map((item, index) => {
+        if (index === 0) {
+          startNum = item.orderNum || 0;
+        }
         return {
           ...item,
+          serialNumber: index + startNum,
           ...(records[index] || {}),
           dayLength: dayLengthArr[index] || '',
           workLength: workLengthArr[index] || '',
@@ -380,6 +433,7 @@
       });
       setColumns(oldColumns);
       setTableData(datas);
+      getOtherZjStatistics();
       setLoading(false);
     } catch (error) {
       console.log(error);
@@ -387,6 +441,20 @@
     }
   };
 
+  // 获取另一个铸机的统计
+  const otherStatisticsInfo = ref<any>({});
+  const getOtherZjStatistics = async () => {
+    try {
+      const res = await getQualityInspection({
+        ccmNo: ccmNo.value == '5' ? '6' : '5',
+        changeShiftId: shiftPerformanceColumns.value[currentShift.value].id,
+      });
+
+      const { statistics } = res;
+      otherStatisticsInfo.value = { ...statistics };
+    } catch (e) {}
+  };
+
   // 编辑信息
   const editInfo = async (params: any) => {
     try {

+ 2 - 5
src/views/billet/quality/quality.data.ts

@@ -9,13 +9,10 @@ import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect
 export const getTableColumns = ({ onTimeChange, onClickRemark, onBrandNumChange }): BasicColumn[] => [
   {
     title: '序号',
-    dataIndex: 'sIndex',
-    key: 'sIndex',
+    dataIndex: 'serialNumber',
+    key: 'serialNumber',
     width: 40,
     align: 'center',
-    customRender: function ({ index }) {
-      return parseInt(index) + 1;
-    },
   },
   {
     title: '炉号',