zhangafei преди 2 месеца
родител
ревизия
76830dcffe

+ 67 - 39
src/views/billet/operator/components/car.vue

@@ -38,8 +38,19 @@
       </a-tab-pane>
       <!-- <a-tab-pane key="2" tab="车位2" force-render>Content of Tab Pane 2</a-tab-pane> -->
     </a-tabs>
+    <div class="flex justify-between refresh-wrapper">
+      <a-button size="large" type="primary" style="font-size: 18px" @click="refresh(1)"> 刷新 </a-button>
+      <RouterLink :to="'/shippingBill/' + ccmNo" target="_blank">
+        <a-button size="large" type="primary" style="font-size: 18px"> 装运列表 </a-button>
+      </RouterLink>
+    </div>
     <div class="stack-divider flex justify-between items-center">
-      <div>{{ stackInfo.typeName || '' }}</div>
+      <div class="flex items-center">
+        {{ stackInfo.typeName || '' }}
+        <div style="margin-left: 20px">
+          <a-button size="large" type="primary" style="font-size: 18px" @click="refresh(2)"> 刷新 </a-button>
+        </div>
+      </div>
       <div>
         <a-button
           type="primary"
@@ -132,52 +143,56 @@
     info4: {},
   });
 
-  const getInfo = async () => {
+  const getInfo = async (type?: number | undefined) => {
     // 获取车位1车辆信息
     try {
       isSpinning.value = true;
-      const fetchArr: any = [];
-      carPosition[props.ccmNo].forEach((item) => {
-        fetchArr.push(
-          list({
-            column: 'createTime',
-            order: 'desc',
-            pageNo: 1,
-            pageSize: 1,
-            positionNum: item,
-            ccmNo: props.ccmNo,
-          })
-        );
-      });
+      if (type === 1 || type === undefined) {
+        const fetchArr: any = [];
+        carPosition[props.ccmNo].forEach((item) => {
+          fetchArr.push(
+            list({
+              column: 'createTime',
+              order: 'desc',
+              pageNo: 1,
+              pageSize: 1,
+              positionNum: item,
+              ccmNo: props.ccmNo,
+            })
+          );
+        });
 
-      await Promise.all(fetchArr).then((res) => {
-        if (Array.isArray(res)) {
-          res.forEach((item, index) => {
-            if (item.records[0]) {
-              vehicleInfo.value[`info${index + 1}`] = {
-                ...item.records[0],
-                oldLicensePlate: item.records[0].licensePlate,
-                oldTypeConfigId: item.records[0].typeConfigId === '1024' ? undefined : item.records[0].typeConfigId,
-                typeConfigId: item.records[0].typeConfigId === '1024' ? undefined : item.records[0].typeConfigId,
-                oldBrandNum: item.records[0].brandNum,
-                oldSize: item.records[0].size,
-              };
-
-              setTimeout(
-                () => {
-                  printCarInfoRefs[`infoRef${index + 1}`] && printCarInfoRefs[`infoRef${index + 1}`].value[0].getTableList();
-                },
-                50 * (index + 1)
-              );
-            }
-          });
-        }
-      });
+        await Promise.all(fetchArr).then((res) => {
+          if (Array.isArray(res)) {
+            res.forEach((item, index) => {
+              if (item.records[0]) {
+                vehicleInfo.value[`info${index + 1}`] = {
+                  ...item.records[0],
+                  oldLicensePlate: item.records[0].licensePlate,
+                  oldTypeConfigId: item.records[0].typeConfigId === '1024' ? undefined : item.records[0].typeConfigId,
+                  typeConfigId: item.records[0].typeConfigId === '1024' ? undefined : item.records[0].typeConfigId,
+                  oldBrandNum: item.records[0].brandNum,
+                  oldSize: item.records[0].size,
+                };
+
+                setTimeout(
+                  () => {
+                    printCarInfoRefs[`infoRef${index + 1}`] && printCarInfoRefs[`infoRef${index + 1}`].value[0].getTableList();
+                  },
+                  50 * (index + 1)
+                );
+              }
+            });
+          }
+        });
+      }
 
       const machineConfig = await getMachineConfig(props.ccmNo)[MachineConfigType.STACKING];
 
       stackInfo.value = machineConfig[0];
-      await getStackInfoList(machineConfig[0].id);
+      if (type === 2 || type === undefined) {
+        await getStackInfoList(machineConfig[0].id);
+      }
     } catch (error) {
       console.log(error);
     } finally {
@@ -377,6 +392,12 @@
     return true;
   };
 
+  // 刷新
+  const refresh = (type) => {
+    stop();
+    getInfo(type);
+  };
+
   onMounted(() => {
     getInfo();
   });
@@ -401,6 +422,7 @@
 <style lang="less" scoped>
   @import '../../hotDelivery/components/metal.less';
   .car-info-spin {
+    position: relative;
     height: 100%;
 
     :deep(.ant-spin-container) {
@@ -409,6 +431,12 @@
       height: 100%;
       overflow: hidden;
     }
+
+    .refresh-wrapper {
+      position: absolute;
+      left: 100px;
+      right: 170px;
+    }
   }
 
   .car-info-wrapper {

+ 12 - 11
src/views/billet/operator/components/headTop.vue

@@ -4,20 +4,20 @@
     <a-col :span="1" class="amount-no bg flex items-center justify-center">
       <a-statistic title="支数" :value="info.currentCastingFurnaceAmount || 0" />
     </a-col>
-    <a-col :span="1" class="amount-no bg flex items-center justify-center">
-      <a-statistic title="重量/t" :value="info.currentCastingFurnace || 0" />
+    <a-col :span="2" class="amount-no bg flex items-center justify-center">
+      <a-statistic title="重量/t" :value="info.currentCastingFurnace ? info.currentCastingFurnace.toFixed(3) : 0" />
     </a-col>
     <a-col :span="1" class="flex items-center justify-center">
       <a-button type="primary" class="change-heat" :disabled="true" @click="switchHeatNo">换炉</a-button>
     </a-col>
-    <a-col :span="2" class="current-shift flex items-center justify-center">当班统计:</a-col>
+    <a-col :span="1" class="current-shift flex items-center justify-center">当班统计:</a-col>
     <a-col :span="1" class="flex items-center justify-center">
       <a-statistic title="总支数" :value="info.billetHotsendChangeShift.shiftSum" />
     </a-col>
     <a-col :span="2" class="flex items-center justify-center">
-      <a-statistic title="总重量/t" :value="info.billetHotsendChangeShift.shiftProduct" />
+      <a-statistic title="总重量/t" :value="info.billetHotsendChangeShift.shiftProduct ? info.billetHotsendChangeShift.shiftProduct.toFixed(3) : 0" />
     </a-col>
-    <a-col :span="3" class="flex flex-col items-center justify-center" v-for="item of typeList">
+    <a-col :span="3" class="flex flex-col" v-for="item of typeList">
       <div class="type-item">
         <span class="type-title" :style="{ color: item.titleColor }">{{ item.title }}:</span> {{ item.amount }}支 / {{ item.weight }}t
       </div>
@@ -75,7 +75,7 @@
     },
   });
 
-  const info = ref({
+  const info = ref<any>({
     brandNum: '',
     billetHotsendChangeShift: {
       heatNo: '',
@@ -217,7 +217,7 @@
 </script>
 <style lang="less" scoped>
   .head-top {
-    height: 100px;
+    height: 130px;
     font-size: 16px;
     color: var(--op-text-color-fff);
     border: 1px solid var(--op-border-color);
@@ -226,9 +226,9 @@
     overflow: hidden;
 
     .ant-col {
-      height: 100px;
+      height: 130px;
       border-right: 1px solid var(--op-border-color);
-      overflow: auto;
+      overflow: hidden auto;
       padding: 10px;
       font-size: 16px;
 
@@ -238,8 +238,9 @@
     }
 
     .head-no {
-      height: 100px;
-      font-size: 16px;
+      height: 130px;
+      font-size: 24px;
+      font-family: 'Kingsoft_Cloud_Font';
     }
     .bg {
       background: #0085ff;

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

@@ -8,7 +8,7 @@
     <BasicTable @register="registerTable">
       <!--操作栏-->
       <template #action="{ record }">
-        <TableAction :actions="getTableAction(record)" />
+        <TableAction class="flex flex-col" style="gap: 4px" :actions="getTableAction(record)" />
       </template>
       <!--字段回显插槽-->
       <!-- <template v-slot:bodyCell="{ column, record, index, text }"> </template> -->
@@ -59,12 +59,12 @@
       },
       columns,
       showIndexColumn: false,
-      canResize: true,
+      canResize: false,
       striped: true,
       showTableSetting: false,
       pagination: false,
       actionColumn: {
-        width: 120,
+        width: 60,
         title: '操作',
         fixed: 'right',
       },
@@ -144,7 +144,7 @@
         hotCharge: JSON.stringify({ hotChargeTotalCount, hotChargeTotalWeight: hotChargeTotalWeight }),
         stacking: JSON.stringify({ stackingTotalCount, stackingTotalWeight: stackingTotalWeight }),
         totalInfo: JSON.stringify({ totalCount, totalWeight: totalWeight }),
-        columnIndex: '合',
+        columnIndex: '合',
       },
     ];
   }
@@ -293,20 +293,20 @@
     }
 
     :deep(.ant-table) {
-      .ant-table-header .ant-table-thead > tr > th {
+      .ant-table-thead > tr > th {
         font-size: 16px;
         font-weight: 800;
         color: #fff;
       }
 
-      .ant-table-header .ant-table-thead > tr > th:nth-child(4),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(5),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(6),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(7),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(8),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(9),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(10),
-      .ant-table-header .ant-table-thead > tr > th:nth-child(11) {
+      .ant-table-thead > tr > th:nth-child(4),
+      .ant-table-thead > tr > th:nth-child(5),
+      .ant-table-thead > tr > th:nth-child(6),
+      .ant-table-thead > tr > th:nth-child(7),
+      .ant-table-thead > tr > th:nth-child(8),
+      .ant-table-thead > tr > th:nth-child(9),
+      .ant-table-thead > tr > th:nth-child(10),
+      .ant-table-thead > tr > th:nth-child(11) {
         color: #f50;
       }
 

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

@@ -81,7 +81,7 @@
           {{ info.amountTotal }}
         </a-descriptions-item>
         <a-descriptions-item label="重量(t)">
-          {{ weight > 0 ? weight.toFixed(4) : 0 }}
+          {{ weight > 0 ? weight.toFixed(3) : 0 }}
         </a-descriptions-item>
       </a-descriptions>
     </div>

+ 74 - 16
src/views/billet/operator/operator.data.ts

@@ -3,25 +3,52 @@ import { BasicColumn } from '/@/components/Table';
 import { render } from '/@/utils/common/renderUtils';
 
 const renderNum = (num, weight, backArr?: boolean) => {
+  let arr = [h('span', { style: { color: '#0085ff' } }, num)];
+  if (weight !== null) {
+    arr.push(h('span', {}, '/' + weight.toFixed(2)));
+  }
   if (backArr === true) {
-    return [h('span', { style: { color: '#0085ff' } }, num), h('span', {}, '/' + weight.toFixed(2))];
+    return arr;
   }
-  return h('div', {}, [h('span', { style: { color: '#0085ff' } }, num), h('span', {}, '/' + weight.toFixed(2))]);
+  return h('div', {}, arr);
+};
+
+const renderStrandCell = (num, lengthJsonStr) => {
+  try {
+    if (lengthJsonStr) {
+      const lengthJson = JSON.parse(lengthJsonStr);
+      console.log('lengthJson', lengthJson);
+      const lengthKeys = Object.keys(lengthJson);
+      if (lengthKeys.length) {
+        return h('div', { style: { textAlign: 'left' } }, [
+          h('div', { style: { color: '#f50' } }, num),
+          ...lengthKeys.map((key) => {
+            return h('div', {}, [h('span', {}, Number(key) / 1000 + ': '), h('span', { style: { color: '#0085ff' } }, lengthJson[key])]);
+          }),
+        ]);
+      }
+
+      return num;
+    }
+  } catch (error) {}
+  return num;
 };
 
 // 列表数据
 export const columns: BasicColumn[] = [
   {
-    title: '序号',
+    title: '#',
     align: 'center',
     dataIndex: 'columnIndex',
-    width: 50,
+    width: 36,
+    fixed: 'left',
   },
   {
     title: '炉号',
     align: 'center',
     dataIndex: 'heatNo',
     width: 90,
+    fixed: 'left',
   },
   {
     title: '牌号',
@@ -34,66 +61,93 @@ export const columns: BasicColumn[] = [
   },
   {
     title: '1流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'oneStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.oneStrandNo, opt.record.oneLength);
+    },
   },
   {
     title: '2流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'twoStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.twoStrandNo, opt.record.twoLength);
+    },
   },
   {
     title: '3流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'threeStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.threeStrandNo, opt.record.threeLength);
+    },
   },
   {
     title: '4流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'fourStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.fourStrandNo, opt.record.fourLength);
+    },
   },
   {
     title: '5流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'fiveStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.fiveStrandNo, opt.record.fiveLength);
+    },
   },
   {
     title: '6流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'sixStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.sixStrandNo, opt.record.sixLength);
+    },
   },
   {
     title: '7流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'sevenStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.sevenStrandNo, opt.record.sevenLength);
+    },
   },
   {
     title: '8流',
-    width: 50,
+    width: 90,
     align: 'center',
     dataIndex: 'eightStrandNo',
+    customRender(opt) {
+      return renderStrandCell(opt.record.eightStrandNo, opt.record.eightLength);
+    },
   },
   {
     title: '棒一',
     align: 'center',
+    width: 100,
     dataIndex: 'directRolling',
     customRender({ record }) {
       const { hotSend, directRolling } = record;
       try {
         if (hotSend) {
           const obj = JSON.parse(hotSend);
-          return obj.hotSendTotalCount + ' / ' + obj.hotSendTotalWeight.toFixed(2);
+          // return obj.hotSendTotalCount + ' / ' + obj.hotSendTotalWeight.toFixed(2);
+          return renderNum(obj.hotSendTotalCount, obj.hotSendTotalWeight);
         }
         if (directRolling) {
           const obj = JSON.parse(directRolling);
-          return obj.directRollingTotalCount + ' / ' + obj.directRollingTotalWeight.toFixed(2);
+          // return obj.directRollingTotalCount + ' / ' + obj.directRollingTotalWeight.toFixed(2);
+          return renderNum(obj.directRollingTotalCount, obj.directRollingTotalWeight);
         }
       } catch (error) {}
       return '';
@@ -102,6 +156,7 @@ export const columns: BasicColumn[] = [
   {
     title: '热装',
     align: 'center',
+    width: 100,
     dataIndex: 'hotCharge',
     customRender({ record }) {
       const { hotCharge } = record;
@@ -118,6 +173,7 @@ export const columns: BasicColumn[] = [
   {
     title: '堆垛',
     align: 'center',
+    width: 100,
     dataIndex: 'stacking',
     customRender({ record }) {
       const { stacking } = record;
@@ -134,6 +190,7 @@ export const columns: BasicColumn[] = [
   {
     title: '定尺',
     align: 'center',
+    width: 100,
     dataIndex: 'length',
     customRender({ record }) {
       const { length } = record;
@@ -143,8 +200,8 @@ export const columns: BasicColumn[] = [
           let lengthCC: any[] = [];
           Object.keys(obj).forEach((key) => {
             // lengthCC.push(h('div', {},  key + ' : ' + obj[key].lengthTotalCount + ' / ' + obj[key].lengthTotalWeight.toFixed(2)));
-            const lengthStlArr = renderNum(obj[key].lengthTotalCount, obj[key].lengthTotalWeight, true) as any[];
-            lengthCC.push(h('div', {}, [h('span', {}, Number(key) / 1000 + ' : '), ...lengthStlArr]));
+            const lengthStlArr = renderNum(obj[key].lengthTotalCount, null, true) as any[];
+            lengthCC.push(h('div', {}, [h('span', {}, Number(key) / 1000 + ': '), ...lengthStlArr]));
           });
           return h('div', { style: { fontSize: '12px', textAlign: 'left' } }, lengthCC);
         }
@@ -155,6 +212,7 @@ export const columns: BasicColumn[] = [
   {
     title: '总计',
     align: 'center',
+    width: 100,
     dataIndex: 'totalInfo',
     customRender({ record }) {
       try {