Ver código fonte

装运单增加打印;
炉次传递单增加导出;

zhangafei 1 mês atrás
pai
commit
3840ecd00d

+ 65 - 5
src/views/billet/billetBasicInfo/BilletBasicInfo.data.ts

@@ -298,11 +298,6 @@ export const formSchema: FormSchema[] = [
     field: 'weight',
     component: 'InputNumber',
   },
-  {
-    label: '堆垛或车位关联id',
-    field: 'stackOrCarId',
-    component: 'Input',
-  },
   {
     label: '流内顺序号',
     field: 'strandnoIndex',
@@ -345,6 +340,71 @@ export const formSchema: FormSchema[] = [
   },
 ];
 
+// 补钢坯表单数据
+export const supplementFormSchema: FormSchema[] = [
+  {
+    label: '炉号',
+    field: 'heatNo',
+    component: 'JSearchSelect',
+    slot: 'heatNo',
+  },
+  {
+    label: '补充数量',
+    field: 'num',
+    component: 'InputNumber',
+    componentProps: {
+      min: 0,
+    },
+    slot: 'num',
+  },
+  {
+    label: '铸机号',
+    field: 'ccmNo',
+    component: 'InputNumber',
+  },
+  {
+    label: '钢包号',
+    field: 'ladleNo',
+    component: 'Input',
+  },
+  {
+    label: '钢种',
+    field: 'grade',
+    component: 'Input',
+  },
+  {
+    label: '定尺',
+    field: 'length',
+    component: 'InputNumber',
+  },
+  {
+    label: '宽度',
+    field: 'width',
+    component: 'InputNumber',
+  },
+  {
+    label: '厚度',
+    field: 'thickness',
+    component: 'Input',
+  },
+  {
+    label: '规格',
+    field: 'spec',
+    component: 'Input',
+  },
+  {
+    label: '定重',
+    field: 'weight',
+    component: 'InputNumber',
+  },
+  {
+    label: '目的地',
+    field: 'belongTable',
+    component: 'JSearchSelect',
+    slot: 'belongTable',
+  },
+];
+
 /**
  * 流程表单调用这个方法获取formSchema
  * @param param

+ 17 - 0
src/views/billet/billetBasicInfo/BilletBasicInfoList.vue

@@ -4,6 +4,7 @@
     <BasicTable @register="registerTable">
       <!--插槽:table标题-->
       <template #tableTitle>
+        <!-- <a-button type="primary" @click="handleSupplement" preIcon="ant-design:plus-outlined"> 补钢坯</a-button> -->
         <!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
         <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
         <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
@@ -38,6 +39,8 @@
     <BilletBasicInfoModal @register="registerModal" @success="handleSuccess"></BilletBasicInfoModal>
     <!-- 明细 -->
     <detailsModal @register="registerDtlModal" />
+    <!-- 补钢坯 -->
+    <SupplementSteelBilletsModal @register="registerSupplementSteelBilletsModal" @success="handleSuccess"></SupplementSteelBilletsModal>
   </div>
 </template>
 
@@ -52,12 +55,14 @@
   import { useTimeoutFn } from '/@/hooks/core/useTimeout';
   import detailsModal from './components/detailsModal.vue';
   import { getMachineNum } from '../hotDelivery/common.data';
+  import SupplementSteelBilletsModal from './components/SupplementSteelBilletsModal.vue';
 
   const machine = getMachineNum();
 
   //注册model
   const [registerModal, { openModal }] = useModal();
   const [registerDtlModal, { openModal: openDtlModal }] = useModal();
+  const [registerSupplementSteelBilletsModal, { openModal: openSupplementSteelBilletsModal }] = useModal();
   //注册table数据
   const { tableContext } = useListPage({
     tableProps: {
@@ -123,6 +128,18 @@
       showFooter: true,
     });
   }
+
+  /**
+   * 补充钢坯
+   */
+  function handleSupplement() {
+    openSupplementSteelBilletsModal(true, {
+      isUpdate: false,
+      showFooter: true,
+      ccmNo: machine,
+    });
+  }
+
   /**
    * 编辑事件
    */

+ 195 - 0
src/views/billet/billetBasicInfo/components/SupplementSteelBilletsModal.vue

@@ -0,0 +1,195 @@
+<template>
+  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
+    <BasicForm @register="registerForm">
+      <template #heatNo="{ model }">
+        <JSearchSelect v-model:value="model.heatNo" @change="getLastBillet" :options="heatNoOptions" placeholder="请选择" />
+      </template>
+      <template #num="{ model }">
+        <a-input-number v-if="Number(ccmNo) === 5" :defaultValue="1" :step="1" v-model:value="model.num" :min="1" />
+        <a-input-number v-else :defaultValue="4" :step="4" v-model:value="model.num" :min="4" @change="handleChangeNum" />
+      </template>
+
+      <template #belongTable="{ model }">
+        <JSearchSelect v-model:value="model.belongTable" :options="belongTableOPtions" placeholder="请选择" />
+      </template>
+    </BasicForm>
+  </BasicModal>
+</template>
+
+<script lang="ts" setup>
+  import { ref, computed, unref } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, useForm } from '/@/components/Form/index';
+  import { supplementFormSchema } from '../BilletBasicInfo.data';
+  import { saveOrUpdate, list as billetList } from '../BilletBasicInfo.api';
+  import { list } from '../../heatsActuals/HeatsActuals.api';
+  import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
+  import { configAll5, configAll6 } from '../../hotDelivery/common.data';
+
+  // Emits声明
+  const emit = defineEmits(['register', 'success']);
+  const isUpdate = ref(true);
+  const ccmNo = ref(6);
+  const heatNoOptions = ref([]);
+  const belongTableOPtions = ref<any[]>([]);
+  //表单配置
+  const [registerForm, { setProps, resetFields, setFieldsValue, validate, getFieldsValue }] = useForm({
+    //labelWidth: 150,
+    schemas: supplementFormSchema,
+    showActionButtonGroup: false,
+    baseColProps: { span: 24 },
+  });
+  //表单赋值
+  const [registerModal, { setModalProps, closeModal, changeLoading }] = useModalInner(async (data) => {
+    //重置表单
+    await resetFields();
+    setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
+    isUpdate.value = !!data?.isUpdate;
+
+    ccmNo.value = data?.ccmNo;
+
+    const belongTable = Number(data?.ccmNo) === 5 ? 'roll_club_one' : 'roll_height';
+    belongTableOPtions.value = (Number(data?.ccmNo) === 5 ? configAll5 : configAll6)
+      .filter((val) => val.belongTable === belongTable)
+      .map((item: any) => {
+        return {
+          id: item.id,
+          label: item.typeName,
+          value: item.belongTable,
+          belongTable: item.belongTable,
+        };
+      });
+
+    // 查询当天的炉号
+    // 获取当前时间
+    const now = new Date();
+    // 格式化时间
+    const year = now.getFullYear();
+    const month = String(now.getMonth() + 1).padStart(2, '0');
+    const day = String(now.getDate()).padStart(2, '0');
+    const formattedDate = `${year}-${month}-${day}`;
+    // const formattedDate = `2025-04-16`;
+    await getTodayBillet(formattedDate);
+    // 隐藏底部时禁用整个表单
+    setProps({ disabled: !data?.showFooter });
+  });
+  //设置标题
+  const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
+  //表单提交事件
+  async function handleSubmit() {
+    try {
+      let values = await validate();
+      setModalProps({ confirmLoading: true });
+      // 查询当前目的地
+      const nudidi = belongTableOPtions.value.find((item) => item.value === values.belongTable);
+      values.belongTable = nudidi ? nudidi?.belongTable : undefined;
+      values.bhtcId = nudidi ? nudidi?.id : undefined;
+      console.log('111111111111111111111', values);
+      //提交表单
+      // await saveOrUpdate(values, isUpdate.value);
+      //关闭弹窗
+      closeModal();
+      //刷新列表
+      emit('success');
+    } finally {
+      setModalProps({ confirmLoading: false });
+    }
+  }
+
+  // 获取某一路炉最后一条钢坯信息
+  const getLastBillet = async (casterCode) => {
+    try {
+      changeLoading(true);
+      const res = await billetList({
+        column: 'createTime',
+        order: 'desc',
+        pageNo: 1,
+        pageSize: 1,
+        ccmNo: ccmNo.value,
+        heatNo: casterCode,
+      });
+
+      const { records } = res;
+
+      if (records && records.length > 0) {
+        const { heatNo, ccmNo, ladleNo, grade, length, width, thickness, spec, weight } = records[0];
+        const values = {
+          heatNo,
+          num: 1,
+          ccmNo,
+          ladleNo,
+          grade,
+          length,
+          width,
+          thickness,
+          spec,
+          weight,
+          belongTable: Number(ccmNo) === 5 ? 'roll_club_one' : 'roll_height',
+        };
+
+        console.log('values', values);
+
+        await setFieldsValue(values);
+      }
+    } catch (error) {
+      console.log('error', error);
+    } finally {
+      changeLoading(false);
+    }
+  };
+
+  // 获取当天的炉次实绩
+  const getTodayBillet = async (date) => {
+    try {
+      changeLoading(true);
+      const res = await list({
+        column: 'createTime',
+        order: 'desc',
+        pageNo: 1,
+        pageSize: 200,
+        createTime_begin: date,
+        createTime_end: date,
+        casterCode: ccmNo.value,
+      });
+
+      const { records } = res;
+
+      if (records && records.length > 0) {
+        heatNoOptions.value = records.map((item) => {
+          return {
+            label: item.heatsCode,
+            value: item.heatsCode,
+          };
+        });
+
+        await getLastBillet(records[0].heatsCode);
+      }
+    } catch (error) {
+      console.log('error', error);
+    } finally {
+      changeLoading(false);
+    }
+  };
+
+  // 如果是去高线必须是4的倍数
+  const handleChangeNum = async (value) => {
+    if (Number(ccmNo.value) === 6) {
+      if (value % 4 !== 0) {
+        setFieldsValue({
+          num: value - (value % 4),
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="less" scoped>
+  /** 时间和数字输入框样式 */
+  :deep(.ant-input-number) {
+    width: 100%;
+  }
+
+  :deep(.ant-calendar-picker) {
+    width: 100%;
+  }
+</style>

+ 8 - 0
src/views/billet/hotDelivery/hotDelivery.api.ts

@@ -53,8 +53,16 @@ enum Api {
   addBilletHotsendInfo = '/billetHotsendBase/billetHotsendBase/addBilletHotsendInfo',
   // 查询车辆是否装运过堆垛信息
   queryCarHasStackBillet = '/stackingDownLog/stackingDownLog/queryByStorageBillId',
+  // 导出接口
+  exportXls = '/billetHotsendBase/billetHotsendBase/exportExcel',
 }
 
+/**
+ * 导出api
+ * @param params
+ */
+export const getExportUrl = Api.exportXls;
+
 /**
  * 列表接口
  * @param params

+ 7 - 2
src/views/billet/hotDelivery/index.vue

@@ -12,6 +12,7 @@
       <!--插槽:table标题-->
       <template #tableTitle>
         <!-- 根据铸机号不同显示不同的操作按钮 -->
+        <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
         <!-- <a-button
           type="primary"
           v-if="machineConfig[machine] && machineConfig[machine][MachineConfigType.RODLINE].length > 0"
@@ -55,7 +56,7 @@
   import detailsModal from './components/details/index.vue';
   import stackingEntrucking from './components/stackingEntrucking/index.vue';
   import wastes from './components/wastes/index.vue';
-  import { list, queryBilletNameList } from './hotDelivery.api';
+  import { list, queryBilletNameList, getExportUrl } from './hotDelivery.api';
   import { columns, searchFormSchema, initDictConfig, queryParam } from './hotDelivery.data';
   import { MACHINE_CONFIG_FIELD_NAME, MachineConfigType, getMachineNum } from './common.data';
   import { useModal } from '/@/components/Modal';
@@ -74,7 +75,7 @@
   });
 
   //注册table数据
-  const { tableContext } = useListPage({
+  const { tableContext, onExportXls } = useListPage({
     tableProps: {
       title: '热送',
       api: list,
@@ -107,6 +108,10 @@
       rowKey: 'id',
       rowSelection: { type: 'checkbox' },
     },
+    exportConfig: {
+      name: '炉次传递单',
+      url: getExportUrl,
+    },
   });
 
   const [registerTable, { reload, setColumns }] = tableContext;

+ 5 - 13
src/views/billet/shippingBill/components/editForm.vue

@@ -8,6 +8,11 @@
             <JSearchSelect placeholder="请选择" disabled v-model:value="model.ccmNo" dict="lg_zj" defaultValue="5" />
           </a-form-item>
         </a-col>
+        <a-col :span="12">
+          <a-form-item label="牌号">
+            <JSearchSelect type="list" v-model:value="model.brandNum" dict="billet_spec" placeholder="请选择" allowClear />
+          </a-form-item>
+        </a-col>
       </a-row>
       <a-row :gutter="24">
         <a-col :span="12">
@@ -79,18 +84,6 @@
           </a-form-item>
         </a-col>
       </a-row>
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="牌号">
-            <JSearchSelect type="list" v-model:value="model.brandNum" dict="billet_spec" placeholder="请选择" allowClear />
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="新/旧站台">
-            <a-select allowClear v-model:value="model.newOldPlatform" :options="platformOptions"></a-select>
-          </a-form-item>
-        </a-col>
-      </a-row>
       <a-row :gutter="24">
         <a-col :span="12">
           <a-form-item label="车位号">
@@ -131,7 +124,6 @@
   import { carPosition } from '../shippingBill.data';
   import { getDictItemsByCode } from '/@/utils/dict/index';
   import dayjs from 'dayjs';
-  import { platformOptions } from '../../ShiftConfiguration/ShiftConfiguration.data';
 
   const props = defineProps({
     rowData: {

+ 168 - 0
src/views/billet/shippingBill/components/printModal.vue

@@ -0,0 +1,168 @@
+<template>
+  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose title="装运单打印" :height="400" :width="800" ok-text="打印" @ok="onPrint">
+    <section ref="print" style="padding: 20px 10px; position: relative; border: 1px solid #c5c5c5; background: beige" id="printContent">
+      <span style="position: absolute; right: 20px; top: 10px; font-size: 16px; font-weight: bold">{{ info.ccmNo }}#机</span>
+      <div class="ticket next-ticket">
+        <div style="text-align: center">
+          <p style="font-size: 24px; font-weight: 800; display: inline-block; border-bottom: 2px solid #000; margin-bottom: 16px; line-height: 30px">
+            龙钢公司钢坯装运单
+          </p>
+        </div>
+        <a-descriptions size="small" :column="4">
+          <a-descriptions-item label="库名"> {{ info.destination }} </a-descriptions-item>
+          <a-descriptions-item :span="2"> {{ dayjs(info.arrivalTime).format('YYYY 年 MM 月 DD 日 HH 时 mm 分') }} </a-descriptions-item>
+          <a-descriptions-item>
+            <div style="width: 100%; text-align: right">
+              <a-tag v-if="info.btype == 1" style="font-size: 14px; color: #000; font-weight: 600">冷</a-tag>
+              <a-tag color="#f50" v-else style="font-size: 14px; color: #000; font-weight: 600">热</a-tag>
+            </div>
+          </a-descriptions-item>
+        </a-descriptions>
+        <a-descriptions style="margin-top: 10px; margin-bottom: 10px" layout="vertical" bordered :column="8" size="small">
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="序号">
+            {{ info.carAllNum }}
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="车号">
+            {{ info.licensePlate }}
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="牌号">
+            <component :is="renderDictTag(info.brandNum, 'billet_spec')" />
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="炉号">
+            <div v-for="item in headDtl" :key="item.id">{{ item.heatNo }} - {{ item.billetNos.length }}</div>
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="规格">
+            170 / {{ info.size }}
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="名称">
+            方坯
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="支数">
+            {{ info.amountTotal }}
+          </a-descriptions-item>
+          <a-descriptions-item style="border: 1px solid #bfbfbf; font-size: 12px; padding: 4px; text-align: center" label="重量">
+            {{ weight > 0 ? weight.toFixed(4) : 0 }}
+          </a-descriptions-item>
+        </a-descriptions>
+        <a-descriptions style="padding: 0 30px" size="small">
+          <a-descriptions-item label="储运中心"> </a-descriptions-item>
+          <a-descriptions-item label="轧钢厂"> </a-descriptions-item>
+          <a-descriptions-item label="炼钢厂"> </a-descriptions-item>
+        </a-descriptions>
+      </div>
+    </section>
+  </BasicModal>
+</template>
+
+<script lang="ts" setup>
+  import { ref } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import dayjs from 'dayjs';
+  import { render } from '/@/utils/common/renderUtils';
+  import { printJS } from '/@/hooks/web/usePrintJS';
+  import { listShippingBill } from '../shippingBill.api';
+
+  const props = defineProps({
+    api: {
+      type: Function as PropType<(params: any) => Promise<any>>,
+      default: listShippingBill,
+    },
+  });
+
+  const info = ref<any>({});
+  const headDtl = ref<any[]>([]);
+  const weight = ref<number>(0);
+  //表单赋值
+  const [registerModal, { changeLoading, changeOkLoading }] = useModalInner(async (data) => {
+    const { record } = data;
+    if (record) {
+      info.value = record;
+      getTableList();
+    } else {
+      info.value = {};
+    }
+  });
+
+  // 渲染字典标签
+  const renderDictTag = (value: string, dictCode: string) => {
+    return render.renderDict(value, dictCode);
+  };
+
+  const getTableList = async () => {
+    try {
+      changeLoading(true);
+      changeOkLoading(true);
+      const { id, ccmNo, heatNo, typeConfigId } = info.value;
+      const data = await props.api({
+        id,
+        ccmNo,
+        heatNo,
+        typeConfigId,
+      });
+
+      let newArr: any[] = [];
+      if (Array.isArray(data)) {
+        newArr = data;
+      } else {
+        for (let item in data) {
+          if (data[item] && data[item].length > 0) {
+            newArr = newArr.concat(data[item]);
+          }
+        }
+      }
+      let allWeight = 0;
+
+      // 数据结果按组批号分组
+      newArr = newArr.reduce((acc, cur) => {
+        const index = acc.findIndex((item) => cur.heatNo && item.heatNo === cur.heatNo);
+        if (index === -1) {
+          acc.push({
+            ...cur,
+            billetNos: [...cur.billetNo.split(',')],
+          });
+        } else {
+          acc[index].billetNos = acc[index].billetNos.concat(cur.billetNo.split(','));
+        }
+
+        if (cur.blankOutput) {
+          allWeight += Number(cur.blankOutput);
+        }
+        return acc;
+      }, []);
+
+      headDtl.value = newArr;
+      weight.value = allWeight;
+    } catch (error) {
+      console.log(error);
+    } finally {
+      changeLoading(false);
+      changeOkLoading(false);
+    }
+  };
+
+  function onPrint() {
+    changeOkLoading(true);
+    printJS({
+      printable: '#printContent',
+      type: 'html',
+    });
+    setTimeout(() => {
+      changeOkLoading(false);
+    }, 1000);
+  }
+</script>
+
+<style lang="less">
+  @media print {
+    header,
+    footer,
+    .noprint {
+      display: none;
+    }
+
+    @page :first {
+      margin-top: 10px; /* 第一页的页眉距离顶部为0 */
+      margin-bottom: 0; /* 第一页的页脚距离底部为0 */
+    }
+  }
+</style>

+ 14 - 2
src/views/billet/shippingBill/index.vue

@@ -115,11 +115,13 @@
     />
     <!-- 堆垛装车 -->
     <stack @register="registerStackingEntruckingModal" :machine="queryParam.ccmNo" @success="handleSuccess" />
+    <!-- 打印 -->
+    <printModal @register="registerPrintModal" @success="handleSuccess" />
   </div>
 </template>
 
 <script lang="ts" name="shippingBill" setup>
-  import SegmentedSelect from '/@/components/SegmentedSelect/index.vue';
+  // import SegmentedSelect from '/@/components/SegmentedSelect/index.vue';
   import { BasicTable, TableAction } from '/@/components/Table';
   import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
   import { useListPage } from '/@/hooks/system/useListPage';
@@ -131,6 +133,7 @@
   import editModal from './components/editModal.vue';
   import logModel from './components/logModel.vue';
   import detailsModal from './components/detailsModal.vue';
+  import printModal from './components/printModal.vue';
   import { useModal } from '/@/components/Modal';
   import { message } from 'ant-design-vue';
   import { destinationOptions, getMachineConfig, MachineConfigType, getMachineNum } from '../hotDelivery/common.data';
@@ -159,6 +162,8 @@
   const [registerDetailModal, { openModal: openDetailModal }] = useModal();
   // 注册添加棒线弹框
   const [registerRodLineModal, { openModal: openRodLineModal }] = useModal();
+  // 注册打印modal
+  const [registerPrintModal, { openModal: openPrintModal }] = useModal();
   // 堆垛发车modal
   const [registerStackingEntruckingModal, { openModal: openStackingEntruckingModal }] = useModal();
 
@@ -222,6 +227,13 @@
           });
         },
       },
+      {
+        label: '打印',
+        onClick: () => {
+          openPrintModal(true, { record, isUpdate: true });
+        },
+        disabled: false,
+      },
       {
         label: '编辑',
         onClick: handleEdit.bind(null, record),
@@ -331,7 +343,7 @@
       },
       striped: true,
       actionColumn: {
-        width: 310,
+        width: 340,
         title: '操作',
         fixed: 'right',
       },

+ 1 - 13
src/views/billet/shippingBill/shippingBill.data.ts

@@ -5,7 +5,6 @@ import { render } from '/@/utils/common/renderUtils';
 import { groupArray } from '/@/views/billet/hotDelivery/common.data';
 import { FormSchema } from '/@/components/Table';
 import { cloneDeep } from 'lodash-es';
-import { platformOptions } from '../ShiftConfiguration/ShiftConfiguration.data';
 
 export const dictOptions = ref({});
 /**
@@ -104,17 +103,6 @@ export const columns: BasicColumn[] = computed(() => [
       return render.renderDict(opt.record.brandNum, 'billet_spec');
     },
   },
-  {
-    title: '新/旧站台',
-    align: 'center',
-    width: 100,
-    dataIndex: 'newOldPlatform',
-    customRender(opt) {
-      const { record } = opt;
-      const findItem = platformOptions.find((item) => item.value === record.newOldPlatform);
-      return findItem ? findItem.label : '';
-    },
-  },
   {
     title: '类型',
     align: 'center',
@@ -200,7 +188,7 @@ export const columns: BasicColumn[] = computed(() => [
     title: '操作',
     dataIndex: 'action',
     align: 'center',
-    width: 310,
+    width: 360,
     fixed: 'right',
     slots: { customRender: 'action' },
   },

+ 31 - 1
src/views/billet/storageAndTransportation/index.vue

@@ -13,6 +13,9 @@
             dict="lg_zj"
           />
         </template>
+        <template #advanceBefore>
+          <a-button type="primary" preIcon="ant-design:export-outlined" style="margin-right: 10px" @click="onExportXls"> 导出</a-button>
+        </template>
       </BasicForm>
     </div>
     <a-list item-layout="vertical" size="large" :pagination="pagination" :loading="loading" :data-source="listData">
@@ -87,11 +90,15 @@
   import { onMounted, ref } from 'vue';
   //引入依赖
   import { useForm, BasicForm, FormSchema } from '/@/components/Form';
-  import { getStorageCenterInvoicingInfo } from './storageAndTransportation.api';
+  import { getStorageCenterInvoicingInfo, exportExcel } from './storageAndTransportation.api';
   import SegmentedSelect from '/@/components/SegmentedSelect/index.vue';
   import { isArray } from '/@/utils/is';
   import dayjs from 'dayjs';
   import { render } from '/@/utils/common/renderUtils';
+  import { useMethods } from '/@/hooks/system/useMethods';
+
+  //导入导出方法
+  const { handleExportXls } = useMethods();
 
   // 渲染字典标签
   const renderDictTag = (value: string, dictCode: string) => {
@@ -286,6 +293,29 @@
     }
   };
 
+  // 导出
+  const onExportXls = () => {
+    const values = getFieldsValue();
+
+    if (!values.ccmNo) {
+      values.ccmNo = '5';
+    }
+
+    const params = Object.assign(
+      {
+        pageNo: page.value,
+        pageSize: pageSize.value,
+      },
+      values
+    );
+
+    let queryParams = Object.keys(params).map((key) => {
+      return `${key}=${params[key]}`;
+    });
+
+    return handleExportXls('储运中心', exportExcel() + (queryParams.length > 0 ? '?' + queryParams.join('&') : ''));
+  };
+
   onMounted(() => {
     getList();
   });

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

@@ -10,6 +10,8 @@ enum Api {
   storageCenterByHeatNo = '/storageBill/storageCenterByHeatNo', // 根据炉批号获取运单信息
   // 获取炉次信息
   storageCenterInvoicingInfo = '/storageBill/storageCenterInvoicingInfo',
+  // 导出
+  exportExcel = '/carUnit/carUnit/exportStorageCenterInfo',
 }
 
 /**
@@ -40,3 +42,8 @@ export const getStorageCenterByHeatNo = (params) => {
 export const getStorageCenterInvoicingInfo = (params) => {
   return defHttp.get({ url: Api.storageCenterInvoicingInfo, params }, { joinParamsToUrl: true });
 };
+
+// 导出
+export const exportExcel = () => {
+  return Api.exportExcel;
+};