zhangafei hace 2 semanas
padre
commit
ab10d721ff

+ 6 - 3
src/views/billet/operator/components/headTop.vue

@@ -59,7 +59,7 @@
   <changeHeatModal @register="registerChangeHeatModal" @ok="() => {}" />
 </template>
 <script setup lang="ts">
-  import { ref, h, onMounted, onUnmounted } from 'vue';
+  import { ref, onMounted, onUnmounted } from 'vue';
   import AStatistic from 'ant-design-vue/lib/statistic/Statistic';
   import { getOnDutyInfo, getTeamShift, getOnDutyDetail } from '../../Dashboard/dashboard.api';
   import { useTimeoutFn } from '/@/hooks/core/useTimeout';
@@ -112,7 +112,10 @@
 
   // 获取班组班别
   const getShiftInfo = () => {
-    emits('shiftChange', getTeamShift(info.value.billetHotsendChangeShift.shift, info.value.billetHotsendChangeShift.shiftGroup));
+    emits('shiftChange', getTeamShift(info.value.billetHotsendChangeShift.shift, info.value.billetHotsendChangeShift.shiftGroup), {
+      shift: info.value.billetHotsendChangeShift.shift,
+      shiftGroup: info.value.billetHotsendChangeShift.shiftGroup,
+    });
   };
 
   // 获取当前班次信息
@@ -180,7 +183,7 @@
     }
   };
 
-  const { start, stop } = useTimeoutFn(getInfo, 5000, true);
+  const { start, stop } = useTimeoutFn(getInfo, 5000);
 
   // 换炉
   const changeHeatLoading = ref(false);

+ 67 - 7
src/views/billet/operator/components/heatList.vue

@@ -2,7 +2,7 @@
   <div class="cc-heatList">
     <div class="tips-title flex" v-if="showAction">
       <div class="left-tip">当班浇铸炉次</div>
-      <div class="flex flex-1 items-center">
+      <div class="flex flex-1 items-center" style="display: none">
         <div class="flex flex-1">
           <template v-for="item in 8">
             <JSearchSelect
@@ -30,6 +30,14 @@
       <!--字段回显插槽-->
       <!-- <template v-slot:bodyCell="{ column, record, index, text }"> </template> -->
     </BasicTable>
+    <BasicTable @register="registerExtraTable" v-if="otherShiftTableData.length > 0" :dataSource="otherShiftTableData">
+      <!--操作栏-->
+      <template #action="{ record }">
+        <TableAction class="flex flex-col" style="gap: 4px" :actions="getTableAction(record)" />
+      </template>
+      <!--字段回显插槽-->
+      <!-- <template v-slot:bodyCell="{ column, record, index, text }"> </template> -->
+    </BasicTable>
   </div>
 </template>
 
@@ -101,8 +109,17 @@
         '8': undefined,
       }),
     },
+    curShiftInfo: {
+      type: Object,
+      default: () => ({
+        shift: '',
+        shiftGroup: '',
+      }),
+    },
   });
 
+  const otherShiftTableData = ref<any[]>([]);
+
   //注册table数据
   const { tableContext } = useListPage({
     tableProps: {
@@ -111,8 +128,25 @@
         return Object.assign(params, { ccmNo: props.ccmNo, queryType: props.queryType, changeShiftId: props.changeShiftId });
       },
       afterFetch: (data) => {
-        const length = data.length;
-        return data.map((item, index) => {
+        let cunShift: any[] = [],
+          otherShift: any[] = [];
+        data.forEach((item) => {
+          if (item.shift === props.curShiftInfo.shift && item.shiftGroup === props.curShiftInfo.shiftGroup) {
+            cunShift.push(item);
+          } else {
+            otherShift.push(item);
+          }
+        });
+
+        const length = cunShift.length;
+        otherShiftTableData.value = otherShift.map((item) => {
+          return {
+            ...item,
+            columnIndex: '#',
+          };
+        });
+
+        return cunShift.map((item, index) => {
           return {
             ...item,
             columnIndex: length - index,
@@ -141,8 +175,9 @@
    * @param tableData
    */
   function onSummary(tableData: Recordable[]) {
+    const newTableData = tableData.filter((ele) => ele.shift === props.curShiftInfo.shift && ele.shiftGroup === props.curShiftInfo.shiftGroup);
     // 可用工具方法自动计算合计
-    const totals = mapTableTotalSummary(tableData, [
+    const totals = mapTableTotalSummary(newTableData, [
       'oneStrandNo',
       'twoStrandNo',
       'threeStrandNo',
@@ -162,7 +197,7 @@
       totalCount = 0,
       totalWeight = 0;
     try {
-      tableData.forEach((item) => {
+      newTableData.forEach((item) => {
         const { hotSend, directRolling, hotCharge, stacking, totalInfo } = item;
         // 直轧
         if (hotSend) {
@@ -213,6 +248,27 @@
 
   const [registerTable, { reload, setLoading }] = tableContext;
 
+  // 额外的表格
+  const { tableContext: extraTableContext } = useListPage({
+    tableProps: {
+      columns,
+      showIndexColumn: false,
+      canResize: false,
+      striped: true,
+      showTableSetting: false,
+      pagination: false,
+      actionColumn: {
+        width: 60,
+        title: '操作',
+        fixed: 'right',
+      },
+      showActionColumn: props.showAction,
+      showHeader: false,
+    },
+  });
+
+  const [registerExtraTable] = extraTableContext;
+
   const { start, stop } = useTimeoutFn(() => {
     if (!props.changeShiftId) {
       reload();
@@ -229,7 +285,7 @@
   });
 
   // 热装
-  const hotCharge = async (record) => {
+  const doHotCharge = async (record) => {
     try {
       const valiDesRes = props.carRef && props.carRef.valirDest ? props.carRef.valirDest() : true;
       if (!valiDesRes) {
@@ -246,6 +302,8 @@
         ccmNo: props.ccmNo,
         heatNo: record.heatNo,
         storageId: chargeInfo.id,
+        shift: record.shift,
+        shiftGroup: record.shiftGroup,
       };
 
       setLoading(true);
@@ -295,6 +353,8 @@
         heatNo: record.heatNo,
         billetHotsendTypeConfigId: stackInfo.id,
         stackingAndLoadingVehiclesIds: sortedStackList.map((item) => item.id),
+        shift: record.shift,
+        shiftGroup: record.shiftGroup,
       };
 
       setLoading(true);
@@ -376,7 +436,7 @@
         disabled: !chargeInfo.id || !!chargeInfo.outTime,
         type: 'primary',
         onClick: () => {
-          hotCharge(record);
+          doHotCharge(record);
         },
       },
       {

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

@@ -16,7 +16,7 @@
             ref="destinationRef"
           />
           <span v-else>{{ info.destination }}</span>
-          <a-button style="margin-left: 20px" v-if="!info.outTime && info.id" type="primary" :loading="btnLoading" @click="sendCar">发车</a-button>
+          <a-button style="margin-left: 20px" v-if="!info.outTime && info.id && info.destination" type="primary" :loading="btnLoading" @click="sendCar">发车</a-button>
         </div>
         <div class="flex-1" style="text-align: center; font-size: 16px">{{ dayjs(info.arrivalTime).format('YYYY 年 MM 月 DD 日 HH 时 mm 分') }}</div>
         <div class="flex-1" style="text-align: right; font-size: 16px"></div>

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

@@ -16,7 +16,7 @@
         </div>
       </a-layout-header>
       <a-layout-content class="operator-content">
-        <head-top @shiftChange="(v) => (shiftText = v)" ref="headTopRef" @lengthChange="(v) => ((lengthList = v), (lengthorgList = cloneDeep(v)))" />
+        <head-top @shiftChange="curShiftChange" ref="headTopRef" @lengthChange="(v) => ((lengthList = v), (lengthorgList = cloneDeep(v)))" />
         <div class="operator-content-wrapper flex">
           <div class="operator-content-left">
             <heat-list
@@ -25,6 +25,7 @@
               :lengthList="lengthList"
               :lengthOrgList="lengthorgList"
               @changeLengthSuccess="() => headTopRef && headTopRef.reload()"
+              :curShiftInfo="curShiftInfo"
             />
           </div>
           <div class="operator-content-right">
@@ -51,6 +52,7 @@
   const headTopRef = ref();
   // 班次信息
   const shiftText = ref('');
+  const curShiftInfo = ref({});
   // 时钟
   const clockObj = ref({
     date: '',
@@ -94,6 +96,12 @@
 
   const { start, stop } = useTimeoutFn(clock, 1000);
 
+  // 获取班次信息
+  const curShiftChange = (v, shiftInfo) => {
+    shiftText.value = v;
+    curShiftInfo.value = shiftInfo;
+  };
+
   onMounted(() => {
     start();
   });

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

@@ -48,6 +48,12 @@ export const columns: BasicColumn[] = [
     dataIndex: 'heatNo',
     width: 90,
     fixed: 'left',
+    customRender(opt) {
+      return h('div', {}, [
+        h('div', { style: { color: '#6bd000', position: 'absolute', top: '0px' } }, render.renderDict(opt.record.shiftGroup, 'lg_bz')),
+        h('span', {}, opt.record.heatNo),
+      ]);
+    },
   },
   {
     title: '牌号',