Browse Source

修改打印装置

zhangafei 1 month ago
parent
commit
109b07ed15

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

@@ -23,6 +23,7 @@
                   openPrintModal(true, {
                     record: vehicleInfo['info' + item],
                     typeConfigId: !vehicleInfo['info' + item].typeConfigId ? '1024' : vehicleInfo['info' + item].typeConfigId,
+                    type: 'offline'
                   })
               "
               >打印</a-button

+ 228 - 22
src/views/billet/operator/components/heatList.vue

@@ -26,17 +26,7 @@
           <a-select style="width: 120px" :options="shortSizeOptions" @change="changeShortLength" />
         </div>
         <div style="margin-right: 6px">
-          <a-button
-            type="primary"
-            @click="
-              () => {
-                stop();
-                reload();
-              }
-            "
-          >
-            刷新
-          </a-button>
+          <a-button type="primary" @click="() => refresh()"> 刷新 </a-button>
         </div>
       </div>
     </div>
@@ -155,6 +145,78 @@
   </div>
   <!-- 打印 -->
   <rollLinePrint @register="registerPrintModal" />
+  <!-- 炉次调根数 -->
+  <a-modal
+    v-model:open="openLuciModal"
+    :title="`调整炉次支数【${adjustCurHeat.heatNo}】`"
+    centered
+    width="1400px"
+    ok-text="确认"
+    :okButtonProps="{ loading: okLoading }"
+    cancel-text="取消"
+    @ok="confirmChangeHeat"
+    @cancel="
+      () => {
+        openLuciModal = false;
+      }
+    "
+  >
+    <div class="flex flex-col justify-center items-center change-heat" style="margin: 20px 0">
+      <div style="width: 100%; padding: 0 20px">
+        <a-radio-group button-style="solid" size="large">
+          <a-radio-button disabled>{{ adjustCurHeat.heatNo }}</a-radio-button>
+        </a-radio-group>
+      </div>
+      <BasicTable @register="registerShiftTableTable" :dataSource="[adjustCurHeat]" />
+      <div style="width: 100%; padding: 10px 20px 0">
+        <span style="padding: 0; color: #f50">调拨至:</span>
+        <a-radio-group v-model:value="adjustHeatNo" button-style="solid" @change="changeHeatNum" size="large">
+          <template v-for="item in currentShiftTableData">
+            <a-radio-button :value="item.heatNo" v-if="item.heatNo !== adjustCurHeat.heatNo">{{ item.heatNo }}</a-radio-button>
+          </template>
+        </a-radio-group>
+      </div>
+      <BasicTable style="min-height: 160px" @register="registerShiftTableTable" :dataSource="[{ ...adjustSelectedHeat, columnIndex: '' }]" />
+      <div class="flex items-center justify-end" style="width: 100%; margin-bottom: 20px; padding-right: 30px">
+        <div style="width: 72px">棒一:</div>
+        <div style="width: 100px">
+          <a-switch v-model:checked="isGotoRollOne" />
+        </div>
+      </div>
+      <div class="flex items-center justify-end" style="width: 100%; margin-bottom: 20px; padding-right: 30px">
+        <div style="width: 72px">调整支数:</div>
+        <div style="width: 100px">
+          <a-input-number size="large" v-if="isGotoRollOne" :defaultValue="1" :step="1" v-model:value="adjustHeatNum" :min="1" />
+          <a-input-number size="large" v-else :defaultValue="4" :step="4" v-model:value="adjustHeatNum" :min="4" @change="handleChangeNum" />
+        </div>
+      </div>
+    </div>
+  </a-modal>
+
+  <!-- 热装堆垛选择定尺 -->
+  <a-modal
+    v-model:open="openHotSelectedModal"
+    title="选择定尺"
+    centered
+    width="400px"
+    ok-text="确认"
+    :okButtonProps="{ loading: okLoading }"
+    cancel-text="取消"
+    @ok="() => (opType === 'hot' ? doHotCharge(opRecord) : doStack(opRecord))"
+    @cancel="
+      () => {
+        openHotSelectedModal = false;
+        selectedSize = undefined;
+        opRecord = null;
+        opType = '';
+      }
+    "
+  >
+    <div class="flex justify-center items-center" style="margin: 20px 0">
+      <div>选择定尺:</div>
+      <a-select v-model:value="selectedSize" placeholder="请选择" allowClear style="width: 277px" :options="selectedSizeOptions"></a-select>
+    </div>
+  </a-modal>
 </template>
 
 <script lang="ts" name="billetLiftingBill" setup>
@@ -171,6 +233,7 @@
     addHeatBillet,
     queryChangeShortLength,
     addRollOneBilletBasic,
+    adjustHeatBillet,
   } from '../operator.api';
   import { h, onMounted, onUnmounted, ref, watch } from 'vue';
   import { mapTableTotalSummary } from '/@/utils/common/compUtils';
@@ -245,6 +308,9 @@
   const isAllHeat = ref<boolean>(false); // 是否是整炉添加
   const isRollOne = ref<string>('default'); // 是否是去棒一,不是整炉添加时有效
   const cuttolengthStatus = ref<string | number>(props.cuttolength); // 1 手动定尺 2  自动定尺
+
+  // 调整炉次支数
+  const openLuciModal = ref(false);
   const columns = getColumns({
     clickCb: ({ record, size, strandNo }) => {
       newSizeNum.value = size;
@@ -329,8 +395,82 @@
       }
       isRollOne.value = 'default';
     },
+    heatNoClick: (record) => {
+      openLuciModal.value = true;
+      adjustCurHeat.value = record;
+      adjustHeatNo.value = '';
+      adjustHeatNum.value = 4;
+      isGotoRollOne.value = false;
+      adjustSelectedHeat.value = {};
+      okLoading.value = false;
+    },
   });
 
+  // 调整炉次支数
+  const adjustCurHeat = ref({});
+  const adjustHeatNo = ref('');
+  const adjustSelectedHeat = ref<any>({});
+  const isGotoRollOne = ref(false); // 是否去棒一
+  const adjustHeatNum = ref(); // 需要调整的支数
+  const confirmChangeHeat = async () => {
+    try {
+      if (!adjustSelectedHeat.value.heatNo) {
+        createMessage.error('请选择要调整的炉次!');
+        return;
+      }
+      if (!adjustHeatNum.value) {
+        createMessage.error('请输入要调整的支数!');
+        return;
+      }
+
+      if (!isGotoRollOne.value && adjustHeatNum.value % 4 !== 0) {
+        createMessage.error('调整支数请输入4的倍数!');
+        return;
+      }
+
+      const { totalInfo } = adjustSelectedHeat.value;
+      if (totalInfo) {
+        const obj = JSON.parse(totalInfo);
+        if (obj.totalCount < adjustHeatNum.value) {
+          createMessage.error('支数不能大于总支数!');
+          return;
+        }
+      }
+
+      const params = {
+        ccmNo: props.ccmNo,
+        originalHeatNo: adjustCurHeat.value.heatNo,
+        changeHeatNo: adjustSelectedHeat.value.heatNo,
+        number: adjustHeatNum.value,
+        changeType: isGotoRollOne.value ? 1 : 2,
+      };
+      okLoading.value = true;
+      await adjustHeatBillet(params);
+
+      refresh();
+      okLoading.value = false;
+      openLuciModal.value = false;
+    } catch (error) {
+      okLoading.value = false;
+      openLuciModal.value = false;
+    }
+  };
+  const changeHeatNum = (v) => {
+    if (v.target.value) {
+      adjustSelectedHeat.value = currentShiftTableData.value.find((item) => item.heatNo === v.target.value);
+    } else {
+      adjustSelectedHeat.value = {};
+    }
+  };
+  // 不去棒一必须是4的倍数
+  const handleChangeNum = async (value) => {
+    if (!isGotoRollOne.value) {
+      if (value % 4 !== 0) {
+        adjustHeatNum.value = value - (value % 4);
+      }
+    }
+  };
+
   // 补录钢坯
   const openCompensateModal = ref(false);
   // 补录钢坯信息 sum 数量 size 定尺 status 状态 no 流号
@@ -461,7 +601,7 @@
 
       const fetchFn = isAllHeat.value ? addHeatBillet : isRollOne.value === 'rollOne' ? addRollOneBilletBasic : addBilletBasic;
       await fetchFn(params);
-      reload();
+      refresh();
       closeCompensateModal();
       okLoading.value = false;
     } catch (error) {
@@ -558,6 +698,21 @@
     },
   });
 
+  // 调整炉次时展示的数据
+  const { tableContext: otherShiftTableContext } = useListPage({
+    tableProps: {
+      columns: getColumns({ clickCb: () => {} }),
+      showIndexColumn: false,
+      canResize: false,
+      striped: true,
+      showTableSetting: false,
+      pagination: false,
+      showActionColumn: false,
+    },
+  });
+
+  const [registerShiftTableTable] = otherShiftTableContext;
+
   /**
    * 计算合计
    * @param tableData
@@ -684,6 +839,39 @@
     stop();
   });
 
+  // 获取所有的定尺
+  const openHotSelectedModal = ref(false);
+  const selectedSize = ref(undefined);
+  const selectedSizeOptions = ref([]);
+  const opType = ref('');
+  const opRecord = ref(null);
+  const getSize = (record, type) => {
+    opType.value = type;
+    opRecord.value = record;
+    const { length } = record;
+    let lengthArr: any = [];
+    if (length) {
+      const obj = JSON.parse(length);
+
+      lengthArr = Object.keys(obj).map((key) => ({
+        label: key,
+        value: key,
+      }));
+    }
+
+    selectedSize.value = undefined;
+    if (lengthArr.length > 0) {
+      openHotSelectedModal.value = true;
+      selectedSizeOptions.value = lengthArr;
+      return;
+    }
+
+    if (type === 'hot') {
+      doHotCharge(record);
+    } else {
+      doStack(record);
+    }
+  };
   // 热装
   const doHotCharge = async (record) => {
     try {
@@ -704,12 +892,12 @@
         storageId: chargeInfo.id,
         shift: record.shift,
         shiftGroup: record.shiftGroup,
+        length: !selectedSize.value ? 0 : Number(selectedSize.value),
       };
 
       setLoading(true);
       await addHotCharge(params);
-      stop();
-      reload();
+      refresh();
       props.carRef.refreshCarList && props.carRef.refreshCarList();
     } catch (error) {
     } finally {
@@ -755,12 +943,12 @@
         stackingAndLoadingVehiclesIds: sortedStackList.map((item) => item.id),
         shift: record.shift,
         shiftGroup: record.shiftGroup,
+        length: !selectedSize.value ? 0 : Number(selectedSize.value),
       };
 
       setLoading(true);
       await stackingUpAdd(params);
-      stop();
-      reload();
+      refresh();
       props.carRef.refreshCarList && props.carRef.refreshCarList();
     } catch (error) {
     } finally {
@@ -882,7 +1070,7 @@
         disabled: !chargeInfo.id || !!chargeInfo.outTime,
         type: 'primary',
         onClick: () => {
-          doHotCharge(record);
+          getSize(record, 'hot');
         },
       },
       {
@@ -890,18 +1078,21 @@
         color: 'warning',
         type: 'primary',
         onClick: () => {
-          doStack(record);
+          getSize(record, 'stack');
         },
       },
       ...printAction,
     ];
   }
 
+  const refresh = async () => {
+    stop();
+    await reload();
+    start();
+  };
+
   defineExpose({
-    reload: () => {
-      stop();
-      reload();
-    },
+    reload: refresh,
   });
 </script>
 
@@ -995,4 +1186,19 @@
       }
     }
   }
+
+  // .change-heat {
+  //   :deep(.ant-table-row-level-0) {
+  //     .ant-table-cell {
+  //       background-color: #9eceff !important;
+  //     }
+  //     &:not(.jeecg-basic-table-row__striped) {
+  //       background-color: rgba(51, 51, 51, 0.04) !important;
+  //       .ant-table-cell {
+  //         background-color: rgba(51, 51, 51, 0.04) !important;
+  //         border-color: #d9d9d9;
+  //       }
+  //     }
+  //   }
+  // }
 </style>

+ 27 - 0
src/views/billet/operator/components/printOriginalRecords.vue

@@ -220,6 +220,7 @@
       align: 'center',
       dataIndex: 'rollOne',
       key: 'rollOne',
+      children: [],
     },
   ];
 
@@ -286,6 +287,8 @@
 
         let sizeColumn: string[] = [];
         let sizeHeadContent = {};
+        // 棒一
+        const rollOneColumns: TableColumnsType = [];
 
         dataSource.value = dataSource.value.map((item, index) => {
           if (!newArr[index]) return item;
@@ -298,6 +301,7 @@
 
           // 棒一
           let rollOneNum = '';
+          let rollOneSizesObj = {};
           if (hotSend) {
             const obj = JSON.parse(hotSend);
             rollOneNum = obj.hotSendTotalCount || '';
@@ -305,6 +309,25 @@
           if (directRolling) {
             const obj = JSON.parse(directRolling);
             rollOneNum = obj.directRollingTotalCount || '';
+            const lengthGroupCount = obj.lengthGroupCount;
+            if (lengthGroupCount) {
+              Object.keys(lengthGroupCount).forEach((key) => {
+                const column = Number(key) / 1000 + 'm';
+                const columnKey = column + 'rollOneColumn';
+                const findIndex = rollOneColumns.findIndex((item: any) => item.dataIndex === columnKey);
+                if (findIndex === -1) {
+                  rollOneColumns.push({
+                    title: column,
+                    dataIndex: columnKey,
+                    key: columnKey,
+                    align: 'center',
+                    width: 40,
+                  });
+                }
+
+                rollOneSizesObj[columnKey] = lengthGroupCount[key];
+              });
+            }
           }
 
           // 定尺
@@ -349,6 +372,7 @@
             total: totalNum || '',
             rollOne: rollOneNum,
             ...sizeArr,
+            ...rollOneSizesObj,
           };
         });
 
@@ -388,6 +412,9 @@
           width: 40,
         });
         columns.value = [...defaultColumns, ...otherColumn];
+        if (rollOneColumns.length) {
+          columns.value[4].children = rollOneColumns;
+        }
       }
     } catch (error) {
       console.log(error);

+ 1 - 1
src/views/billet/operator/index.vue

@@ -35,7 +35,7 @@
           <div class="operator-content-left">
             <heat-list
               ref="heatListRef"
-              v-if="curShiftInfo.shift != undefined && curShiftInfo.shiftGroup != undefined"
+              v-if="curShiftInfo.shift && curShiftInfo.shiftGroup"
               :ccmNo="ccmNo"
               :carRef="carRef"
               :lengthList="lengthList"

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

@@ -25,6 +25,8 @@ enum Api {
   pushCcmNoSize = '/billetHotsendBase/billetHotsendBase/pushCcmNoSize',
   // 补录棒一的钢坯
   addRollOneBilletBasic = '/rollClubOneDetails/addBilletBasic',
+  // 调整炉次支数
+  adjustHeatBillet = '/billetHotsendBase/billetHotsendBase/changeHeatNo',
 }
 
 // 炉次信息
@@ -86,3 +88,8 @@ export const queryChangeShortLength = (params: any) => {
 export const addRollOneBilletBasic = (params: any) => {
   return defHttp.post({ url: Api.addRollOneBilletBasic, params });
 };
+
+// 调整炉次支数
+export const adjustHeatBillet = (params: any) => {
+  return defHttp.post({ url: Api.adjustHeatBillet, params });
+};

+ 3 - 2
src/views/billet/operator/operator.data.ts

@@ -47,12 +47,13 @@ export const renderStrandCell = (options) => {
 };
 
 // 列表数据
-export const getColumns = ({ clickCb, openCompensateModal }): BasicColumn[] => {
+export const getColumns = ({ clickCb, openCompensateModal, heatNoClick }): BasicColumn[] => {
   return [
     {
       title: '#',
       align: 'center',
       dataIndex: 'columnIndex',
+      ellipsis: false,
       width: 36,
       fixed: 'left',
     },
@@ -63,7 +64,7 @@ export const getColumns = ({ clickCb, openCompensateModal }): BasicColumn[] => {
       width: 90,
       fixed: 'left',
       customRender(opt) {
-        return h('div', {}, [
+        return h('div', { style: { cursor: 'pointer' }, onClick: () => heatNoClick && heatNoClick(opt.record) }, [
           h('div', { style: { color: '#6bd000', position: 'absolute', top: '0px' } }, render.renderDict(opt.record.shiftGroup, 'lg_bz')),
           h('span', {}, opt.record.heatNo),
         ]);

+ 44 - 14
src/views/billet/shippingBill/components/printModal.vue

@@ -32,9 +32,29 @@
               showTime
               :bordered="false"
             />
+            <!-- <a-input v-model:value="info.arrivalTimeDay" class="lgprint-date-picker" :bordered="false" /> -->
           </div>
           <div class="flex-1" style="text-align: right; font-size: 12px">
-            <a-input v-model:value="info.classes" style="font-size: 12px; padding: 0; width: 100%; text-align: right" :bordered="false" />
+            <!-- <a-input v-model:value="info.classes" style="font-size: 12px; padding: 0; width: 100%; text-align: right" :bordered="false" /> -->
+            <JSearchSelect
+              type="list"
+              :bordered="false"
+              v-model:value="info.shiftGroup"
+              dict="lg_bb"
+              style="width: 60px; font-size: 12px"
+              placeholder="请选择"
+              allowClear
+            />
+            /
+            <JSearchSelect
+              type="list"
+              :bordered="false"
+              v-model:value="info.shift"
+              dict="lg_bz"
+              style="width: 50px; font-size: 12px"
+              placeholder="请选择"
+              allowClear
+            />
           </div>
         </div>
         <a-descriptions style="margin-top: 6px; margin-bottom: 4px" layout="vertical" bordered :column="8" size="small">
@@ -100,8 +120,7 @@
               :precision="0"
             />
           </a-descriptions-item>
-          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="重量">
-            <!-- {{ weight > 0 ? weight.toFixed(4) : 0 }} -->
+          <!-- <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center; height: 36px" label="重量">
             <a-input-number
               :bordered="false"
               style="min-width: 80px; width: 80px; font-size: 12px; text-align: center"
@@ -110,7 +129,7 @@
               :max="99"
               :precision="4"
             />
-          </a-descriptions-item>
+          </a-descriptions-item> -->
         </a-descriptions>
         <a-descriptions style="padding: 0 30px" size="small">
           <a-descriptions-item label="储运中心"> </a-descriptions-item>
@@ -170,15 +189,13 @@
         arrivalTimeDay: dayjs(record.arrivalTime),
         number: record.carAllNum,
         classes:
-          dayjs(record.arrivalTime).format('YYYYMMDDHHmmss') +
-          '/' +
-          record.carNum +
-          '/' +
-          record.carAllNum +
-          '/' +
-          record.shift_dictText +
-          '/' +
-          record.shiftGroup_dictText,
+          // dayjs(record.arrivalTime).format('YYYYMMDDHHmmss') +
+          // '/' +
+          // record.carNum +
+          // '/' +
+          // record.carAllNum +
+          // '/' +
+          record.shift_dictText + '/' + record.shiftGroup_dictText,
       };
 
       await getTableList();
@@ -261,9 +278,22 @@
       changeOkLoading(true);
       getByStorageBillId({ storageBillId: info.value.id }).then((res) => {
         if (res) {
+          const shiftObj = res.classes.split('/');
+          let shift = '';
+          let shiftGroup = '';
+          if (shiftObj.length === 2) {
+            shift = shiftObj[0];
+            shiftGroup = shiftObj[1];
+          } else {
+            shift = info.value.shift;
+            shiftGroup = info.value.shiftGroup;
+          }
           info.value = {
             ...info.value,
             ...res,
+            shift,
+            shiftGroup,
+            arrivalTimeDay: dayjs(res.arrivalTime),
           };
 
           headDtl.value = Object.keys(res.heatNo).map((item) => ({
@@ -357,7 +387,7 @@
       storageBillId: info.value.id,
       weight: info.value.weight,
       number: info.value.number,
-      classes: info.value.classes,
+      classes: info.value.shift + '/' + info.value.shiftGroup,
       btype: info.value.btype,
       ccmNo: info.value.ccmNo,
     });

+ 4 - 4
src/views/billet/shippingBill/index.vue

@@ -319,16 +319,16 @@
   function getDropDownAction(record) {
     return [
       {
-        label: '线下票据',
+        label: '装运明细',
         onClick: () => {
-          openPrintModal(true, { record, isUpdate: true, type: 'offline' });
+          openDetailModal(true, { record, isUpdate: true });
         },
         disabled: false,
       },
       {
-        label: '装运明细',
+        label: '线下票据',
         onClick: () => {
-          openDetailModal(true, { record, isUpdate: true });
+          openPrintModal(true, { record, isUpdate: true, type: 'offline' });
         },
         disabled: false,
       },