Procházet zdrojové kódy

储运中心修改;
增加储运配置

zhangafei před 1 měsícem
rodič
revize
670e0684f6

+ 68 - 0
src/views/billet/ShiftConfiguration/ShiftConfiguration.api.ts

@@ -0,0 +1,68 @@
+import { defHttp } from '/@/utils/http/axios';
+import { useMessage } from '/@/hooks/web/useMessage';
+
+const { createConfirm } = useMessage();
+
+enum Api {
+  list = '/shiftConfiguration/shiftConfiguration/list',
+  save = '/shiftConfiguration/shiftConfiguration/add',
+  edit = '/shiftConfiguration/shiftConfiguration/edit',
+  deleteOne = '/shiftConfiguration/shiftConfiguration/delete',
+  deleteBatch = '/shiftConfiguration/shiftConfiguration/deleteBatch',
+  importExcel = '/shiftConfiguration/shiftConfiguration/importExcel',
+  exportXls = '/shiftConfiguration/shiftConfiguration/exportXls',
+  // 获取当班信息
+  currentShift = '/shiftConfiguration/shiftConfiguration/getShiftInfo',
+}
+/**
+ * 导出api
+ * @param params
+ */
+export const getExportUrl = Api.exportXls;
+/**
+ * 导入api
+ */
+export const getImportUrl = Api.importExcel;
+/**
+ * 列表接口
+ * @param params
+ */
+export const list = (params) => defHttp.get({ url: Api.list, params });
+
+/**
+ * 删除单个
+ */
+export const deleteOne = (params, handleSuccess) => {
+  return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
+    handleSuccess();
+  });
+};
+/**
+ * 批量删除
+ * @param params
+ */
+export const batchDelete = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认删除',
+    content: '是否删除选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
+        handleSuccess();
+      });
+    },
+  });
+};
+/**
+ * 保存或者更新
+ * @param params
+ */
+export const saveOrUpdate = (params, isUpdate) => {
+  let url = isUpdate ? Api.edit : Api.save;
+  return defHttp.post({ url: url, params });
+};
+
+// 获取当班信息
+export const getCurrentShift = () => defHttp.get({ url: Api.currentShift });

+ 157 - 0
src/views/billet/ShiftConfiguration/ShiftConfiguration.data.ts

@@ -0,0 +1,157 @@
+import { BasicColumn } from '/@/components/Table';
+import { FormSchema } from '/@/components/Table';
+// import { rules } from '/@/utils/helper/validator';
+import { render } from '/@/utils/common/renderUtils';
+import { destinationOptions } from '/@/views/billet/hotDelivery/common.data';
+//列表数据
+export const columns: BasicColumn[] = [
+  {
+    title: '日期',
+    align: 'center',
+    dataIndex: 'date',
+    customRender: ({ text }) => {
+      return !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
+    },
+  },
+  {
+    title: '铸机号',
+    align: 'center',
+    dataIndex: 'ccmNo',
+    customRender: ({ text }) => {
+      return render.renderDict(text, 'lg_zj');
+    },
+  },
+  {
+    title: '班别',
+    align: 'center',
+    dataIndex: 'shift',
+    customRender: ({ text }) => {
+      return render.renderDict(text, 'lg_bb');
+    },
+  },
+  {
+    title: '班组',
+    align: 'center',
+    dataIndex: 'shiftGroup',
+    customRender: ({ text }) => {
+      return render.renderDict(text, 'lg_bz');
+    },
+  },
+  {
+    title: '牌号',
+    align: 'center',
+    dataIndex: 'steelGrade',
+    customRender: ({ text }) => {
+      return render.renderDict(text, 'billet_spec');
+    },
+  },
+  {
+    title: '定尺',
+    align: 'center',
+    dataIndex: 'spec',
+    customRender: ({ text }) => {
+      return render.renderDict(text, 'lg_dcgg');
+    },
+  },
+  {
+    title: '目的地',
+    align: 'center',
+    dataIndex: 'destination',
+    customRender: ({ record, text }) => {
+      return destinationOptions[record.ccmNo].find((item) => item.value === text)?.label;
+    },
+  },
+  {
+    title: '新/旧站台',
+    align: 'center',
+    dataIndex: 'newOldPlatform',
+    customRender(opt) {
+      return opt.record.newOldPlatform === 0 ? '新站台' : '旧站台';
+    },
+  },
+];
+//查询数据
+export const searchFormSchema: FormSchema[] = [];
+//表单数据
+export const formSchema: FormSchema[] = [
+  {
+    label: '日期',
+    field: 'date',
+    component: 'DatePicker',
+    defaultValue: new Date(),
+  },
+  {
+    label: '铸机号',
+    field: 'ccmNo',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'lg_zj',
+    },
+    defaultValue: '5',
+  },
+  {
+    label: '班别',
+    field: 'shift',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'lg_bb',
+    },
+  },
+  {
+    label: '班组',
+    field: 'shiftGroup',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'lg_bz',
+    },
+  },
+  {
+    label: '牌号',
+    field: 'steelGrade',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'billet_spec',
+    },
+  },
+  {
+    label: '定尺',
+    field: 'spec',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'lg_dcgg',
+    },
+  },
+  {
+    label: '目的地',
+    field: 'destination',
+    component: 'Input',
+    slot: 'destination',
+  },
+  {
+    label: '新/旧站台',
+    field: 'newOldPlatform',
+    component: 'Select',
+    componentProps: {
+      options: [
+        { label: '新站台', value: 0 },
+        { label: '旧站台', value: 1 },
+      ],
+    },
+  },
+  // TODO 主键隐藏字段,目前写死为ID
+  {
+    label: '',
+    field: 'id',
+    component: 'Input',
+    show: false,
+  },
+];
+
+/**
+ * 流程表单调用这个方法获取formSchema
+ * @param param
+ */
+export function getBpmFormSchema(_formData): FormSchema[] {
+  // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
+  return formSchema;
+}

+ 196 - 0
src/views/billet/ShiftConfiguration/ShiftConfigurationList.vue

@@ -0,0 +1,196 @@
+<template>
+  <div>
+    <!--引用表格-->
+    <BasicTable @register="registerTable" :rowSelection="rowSelection">
+      <!--插槽:table标题-->
+      <template #tableTitle>
+        <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> -->
+        <a-dropdown v-if="selectedRowKeys.length > 0">
+          <template #overlay>
+            <a-menu>
+              <a-menu-item key="1" @click="batchHandleDelete">
+                <Icon icon="ant-design:delete-outlined"></Icon>
+                删除
+              </a-menu-item>
+            </a-menu>
+          </template>
+          <a-button>
+            批量操作
+            <Icon icon="mdi:chevron-down"></Icon>
+          </a-button>
+        </a-dropdown>
+      </template>
+      <!--操作栏-->
+      <template #action="{ record }">
+        <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
+      </template>
+      <!--字段回显插槽-->
+      <!-- <template v-slot:bodyCell="{ column, record, index, text }"> </template> -->
+    </BasicTable>
+    <!-- 表单区域 -->
+    <ShiftConfigurationModal @register="registerModal" @success="handleSuccess"></ShiftConfigurationModal>
+  </div>
+</template>
+
+<script lang="ts" name="shiftConfiguration-shiftConfiguration" setup>
+  import { BasicTable, TableAction } from '/@/components/Table';
+  import { useModal } from '/@/components/Modal';
+  import { useListPage } from '/@/hooks/system/useListPage';
+  import ShiftConfigurationModal from './components/ShiftConfigurationModal.vue';
+  import { columns, searchFormSchema } from './ShiftConfiguration.data';
+  import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getCurrentShift } from './ShiftConfiguration.api';
+  import { onMounted, ref } from 'vue';
+  import dayjs from 'dayjs';
+
+  const lastData = ref({});
+  const currentShift = ref<{
+    shift: string;
+    shiftGroup: string;
+  }>({
+    shift: '',
+    shiftGroup: '',
+  });
+  //注册model
+  const [registerModal, { openModal }] = useModal();
+  //注册table数据
+  const { tableContext, onExportXls, onImportXls } = useListPage({
+    tableProps: {
+      title: '班次配置',
+      api: list,
+      columns,
+      canResize: false,
+      formConfig: {
+        //labelWidth: 120,
+        schemas: searchFormSchema,
+        autoSubmitOnEnter: true,
+        showAdvancedButton: true,
+        fieldMapToNumber: [],
+        fieldMapToTime: [],
+      },
+      actionColumn: {
+        width: 150,
+        title: '操作',
+        fixed: 'right',
+      },
+      afterFetch: (data) => {
+        //重置选中
+        const pagination: any = getPaginationRef();
+        if (pagination && pagination.current === 1 && data.length > 0) {
+          let newObj = {};
+          for (const key in data[0]) {
+            if (data[0].hasOwnProperty(key) && key !== 'id') {
+              newObj[key] = data[0][key];
+            }
+          }
+          lastData.value = newObj;
+        }
+        return data;
+      },
+    },
+    exportConfig: {
+      name: '班次配置',
+      url: getExportUrl,
+    },
+    importConfig: {
+      url: getImportUrl,
+      success: handleSuccess,
+    },
+  });
+
+  const [registerTable, { reload, getPaginationRef }, { rowSelection, selectedRowKeys }] = tableContext;
+
+  /**
+   * 新增事件
+   */
+  function handleAdd() {
+    openModal(true, {
+      lastData: lastData.value,
+      isUpdate: false,
+      showFooter: true,
+    });
+  }
+  /**
+   * 编辑事件
+   */
+  function handleEdit(record: Recordable) {
+    openModal(true, {
+      record,
+      isUpdate: true,
+      showFooter: true,
+    });
+  }
+  /**
+   * 详情
+   */
+  function handleDetail(record: Recordable) {
+    openModal(true, {
+      record,
+      isUpdate: true,
+      showFooter: false,
+    });
+  }
+  /**
+   * 删除事件
+   */
+  async function handleDelete(record) {
+    await deleteOne({ id: record.id }, handleSuccess);
+  }
+  /**
+   * 批量删除事件
+   */
+  async function batchHandleDelete() {
+    await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
+  }
+  /**
+   * 成功回调
+   */
+  function handleSuccess() {
+    (selectedRowKeys.value = []) && reload();
+  }
+  /**
+   * 操作栏
+   */
+  function getTableAction(record) {
+    const canEdit =
+      record.date === dayjs().format('YYYY-MM-DD') &&
+      record.shiftGroup === currentShift.value.shiftGroup &&
+      record.shift === currentShift.value.shift;
+    return [
+      {
+        label: '编辑',
+        disabled: !canEdit,
+        onClick: handleEdit.bind(null, record),
+      },
+    ];
+  }
+  /**
+   * 下拉操作栏
+   */
+  function getDropDownAction(record) {
+    return [
+      {
+        label: '详情',
+        onClick: handleDetail.bind(null, record),
+      },
+      // {
+      //   label: '删除',
+      //   popConfirm: {
+      //     title: '是否确认删除',
+      //     confirm: handleDelete.bind(null, record),
+      //   },
+      // },
+    ];
+  }
+
+  // 获取当前班次
+  onMounted(() => {
+    getCurrentShift().then((res) => {
+      const { shift, shiftGroup } = res;
+      currentShift.value = { shift, shiftGroup };
+    });
+  });
+</script>
+
+<style scoped></style>

+ 26 - 0
src/views/billet/ShiftConfiguration/ShiftConfiguration_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/shiftConfiguration文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) 
+VALUES ('2025041701134420140', NULL, '班次配置', '/shiftConfiguration/shiftConfigurationList', 'shiftConfiguration/ShiftConfigurationList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2025041701134420141', '2025041701134420140', '添加班次配置', NULL, NULL, 0, NULL, NULL, 2, 'shiftConfiguration:shift_configuration:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2025041701134420142', '2025041701134420140', '编辑班次配置', NULL, NULL, 0, NULL, NULL, 2, 'shiftConfiguration:shift_configuration:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2025041701134430143', '2025041701134420140', '删除班次配置', NULL, NULL, 0, NULL, NULL, 2, 'shiftConfiguration:shift_configuration:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2025041701134430144', '2025041701134420140', '批量删除班次配置', NULL, NULL, 0, NULL, NULL, 2, 'shiftConfiguration:shift_configuration:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2025041701134430145', '2025041701134420140', '导出excel_班次配置', NULL, NULL, 0, NULL, NULL, 2, 'shiftConfiguration:shift_configuration:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2025041701134430146', '2025041701134420140', '导入excel_班次配置', NULL, NULL, 0, NULL, NULL, 2, 'shiftConfiguration:shift_configuration:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-04-17 13:13:14', NULL, NULL, 0, 0, '1', 0);

+ 70 - 0
src/views/billet/ShiftConfiguration/components/ShiftConfigurationForm.vue

@@ -0,0 +1,70 @@
+<template>
+    <div style="min-height: 400px">
+        <BasicForm @register="registerForm"></BasicForm>
+        <div style="width: 100%;text-align: center" v-if="!formDisabled">
+            <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
+        </div>
+    </div>
+</template>
+
+<script lang="ts">
+    import {BasicForm, useForm} from '/@/components/Form/index';
+    import {computed, defineComponent} from 'vue';
+    import {defHttp} from '/@/utils/http/axios';
+    import { propTypes } from '/@/utils/propTypes';
+    import {getBpmFormSchema} from '../ShiftConfiguration.data';
+    import {saveOrUpdate} from '../ShiftConfiguration.api';
+    
+    export default defineComponent({
+        name: "ShiftConfigurationForm",
+        components:{
+            BasicForm
+        },
+        props:{
+            formData: propTypes.object.def({}),
+            formBpm: propTypes.bool.def(true),
+        },
+        setup(props){
+            const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
+                labelWidth: 150,
+                schemas: getBpmFormSchema(props.formData),
+                showActionButtonGroup: false,
+                baseColProps: {span: 24}
+            });
+
+            const formDisabled = computed(()=>{
+                if(props.formData.disabled === false){
+                    return false;
+                }
+                return true;
+            });
+
+            let formData = {};
+            const queryByIdUrl = '/shiftConfiguration/shiftConfiguration/queryById';
+            async function initFormData(){
+                let params = {id: props.formData.dataId};
+                const data = await defHttp.get({url: queryByIdUrl, params});
+                formData = {...data}
+                //设置表单的值
+                await setFieldsValue(formData);
+                //默认是禁用
+                await setProps({disabled: formDisabled.value})
+            }
+
+            async function submitForm() {
+                let data = getFieldsValue();
+                let params = Object.assign({}, formData, data);
+                console.log('表单数据', params)
+                await saveOrUpdate(params, true)
+            }
+
+            initFormData();
+            
+            return {
+                registerForm,
+                formDisabled,
+                submitForm,
+            }
+        }
+    });
+</script>

+ 84 - 0
src/views/billet/ShiftConfiguration/components/ShiftConfigurationModal.vue

@@ -0,0 +1,84 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="registerModal"
+    destroyOnClose
+    :title="title"
+    :width="800"
+    :bodyStyle="{ padding: '20px 0 0' }"
+    @ok="handleSubmit"
+  >
+    <BasicForm @register="registerForm">
+      <template #destination="{ model }">
+        <a-select v-model:value="model.destination" :options="destinationOptions[model.ccmNo]" />
+      </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 { formSchema } from '../ShiftConfiguration.data';
+  import { saveOrUpdate } from '../ShiftConfiguration.api';
+  import { destinationOptions } from '../../hotDelivery/common.data';
+
+  // Emits声明
+  const emit = defineEmits(['register', 'success']);
+  const isUpdate = ref(true);
+  //表单配置
+  const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
+    //labelWidth: 150,
+    schemas: formSchema,
+    showActionButtonGroup: false,
+    baseColProps: { span: 24 },
+  });
+  //表单赋值
+  const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
+    //重置表单
+    await resetFields();
+    setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
+    isUpdate.value = !!data?.isUpdate;
+    if (unref(isUpdate)) {
+      //表单赋值
+      await setFieldsValue({
+        ...data.record,
+      });
+    } else if (data?.lastData) {
+      await setFieldsValue({
+        ...data.lastData,
+      });
+    }
+    // 隐藏底部时禁用整个表单
+    setProps({ disabled: !data?.showFooter });
+  });
+  //设置标题
+  const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
+  //表单提交事件
+  async function handleSubmit() {
+    try {
+      let values = await validate();
+      setModalProps({ confirmLoading: true });
+      //提交表单
+      await saveOrUpdate(values, isUpdate.value);
+      //关闭弹窗
+      closeModal();
+      //刷新列表
+      emit('success');
+    } finally {
+      setModalProps({ confirmLoading: false });
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+  /** 时间和数字输入框样式 */
+  :deep(.ant-input-number) {
+    width: 100%;
+  }
+
+  :deep(.ant-calendar-picker) {
+    width: 100%;
+  }
+</style>

+ 15 - 15
src/views/billet/shippingBill/components/hotCharging/rodLine.vue

@@ -178,16 +178,16 @@
       newKeys = newKeys.concat(steelIds);
       newRows = newRows.concat(groupDatas);
       // 验证定尺是否一样
-      const isSameLength = groupDatas.every((item) => item.length === groupDatas[0].length);
-      if (!isSameLength) {
-        createMessage.error(
-          `所选钢坯${groupDatas
-            .filter((item) => steelIds.includes(item.id))
-            .map((item) => item.billetNo)
-            .join(',')}定尺不一致,请重新选择`
-        );
-        noSameLength = noSameLength.concat(steelIds);
-      }
+      // const isSameLength = groupDatas.every((item) => item.length === groupDatas[0].length);
+      // if (!isSameLength) {
+      //   createMessage.error(
+      //     `所选钢坯${groupDatas
+      //       .filter((item) => steelIds.includes(item.id))
+      //       .map((item) => item.billetNo)
+      //       .join(',')}定尺不一致,请重新选择`
+      //   );
+      //   noSameLength = noSameLength.concat(steelIds);
+      // }
 
       // 判断是否存在钢坯定尺一样的数据
       const filterNewRows = newRows.filter((item) => !noSameLength.includes(item.id));
@@ -288,11 +288,11 @@
     }
 
     // 检测所选钢坯定尺是否一致
-    const billetLength = selectedRows.value.map((item) => item.length);
-    if (billetLength.length && !billetLength.every((item) => item === billetLength[0])) {
-      createMessage.error('所选钢坯定尺不一致,请重新选择');
-      return false;
-    }
+    // const billetLength = selectedRows.value.map((item) => item.length);
+    // if (billetLength.length && !billetLength.every((item) => item === billetLength[0])) {
+    //   createMessage.error('所选钢坯定尺不一致,请重新选择');
+    //   return false;
+    // }
 
     const curRodLine = rodLineList.value.find((item) => item.id === activeKey.value);
     console.log('selectedRows.value', rodLineList, activeKey.value);

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

@@ -198,7 +198,7 @@
       {
         label: '热装',
         color: 'error',
-        disabled: !!record.outTime,
+        // disabled: !!record.outTime,
         onClick: () => {
           openRodLineModal(true, {
             info: record,
@@ -210,7 +210,7 @@
       },
       {
         label: '堆垛装车',
-        disabled: !!record.outTime,
+        // disabled: !!record.outTime,
         color: 'warning',
         onClick: () => {
           openStackingEntruckingModal(true, {

+ 16 - 16
src/views/billet/stackingManage/components/stacking.vue

@@ -310,7 +310,7 @@
       for (let i = groupLen - 1; i > -1; i--) {
         const element = steelGroupList[i];
         // 查询是否存在不同的定尺
-        const isSameLength = element.every((item) => item.length === groupDatas[0].length);
+        // const isSameLength = element.every((item) => item.length === groupDatas[0].length);
         const steelIds = element.map((item) => item.id);
 
         // 所选分组不够四个一组就不如选
@@ -320,11 +320,11 @@
           continue;
         }
 
-        if (!isSameLength) {
-          createMessage.error(`所选钢坯${steelIds.join(',')}定尺不一致,请重新选择`);
-          noSameLength = noSameLength.concat(steelIds);
-          continue;
-        }
+        // if (!isSameLength) {
+        //   createMessage.error(`所选钢坯${steelIds.join(',')}定尺不一致,请重新选择`);
+        //   noSameLength = noSameLength.concat(steelIds);
+        //   continue;
+        // }
         // 如果层数大于20层代表已经满了
         if (Number(activeKey.value) > STEEL_MAX_LAYER_NUM) {
           createMessage.error(`当前堆垛已满,请选择其他堆垛`);
@@ -570,11 +570,11 @@
     }
 
     // 检测所选钢坯定尺是否一致
-    const billetLength = selectedGpRows.value.map((item) => item.length);
-    if (billetLength.length && !billetLength.every((item) => item === billetLength[0])) {
-      createMessage.error('所选钢坯定尺不一致,请重新选择');
-      return false;
-    }
+    // const billetLength = selectedGpRows.value.map((item) => item.length);
+    // if (billetLength.length && !billetLength.every((item) => item === billetLength[0])) {
+    //   createMessage.error('所选钢坯定尺不一致,请重新选择');
+    //   return false;
+    // }
 
     if (selectedRowKeys.value.length && selectedRowKeys.value.length % 4 !== 0) {
       createMessage.error('钢坯需要4个为一组,现已选择' + selectedRowKeys.value.length + '根钢坯');
@@ -623,11 +623,11 @@
   //表单提交事件
   async function handleSubmit() {
     try {
-      const hasEmptyPosition = checkMiddlePosition();
-      if (hasEmptyPosition.length > MAX_EMPTY_POSITION_NUM) {
-        createMessage.error('请检查' + hasEmptyPosition.join(';') + '是否有钢坯');
-        return;
-      }
+      // const hasEmptyPosition = checkMiddlePosition();
+      // if (hasEmptyPosition.length > MAX_EMPTY_POSITION_NUM) {
+      //   createMessage.error('请检查' + hasEmptyPosition.join(';') + '是否有钢坯');
+      //   return;
+      // }
       const params = handleSubmitData();
       if (!params) return;
       setModalProps({ confirmLoading: true });

+ 57 - 2
src/views/billet/storageAndTransportation/components/filterItems.vue

@@ -1,5 +1,17 @@
 <template>
   <div class="filter-items-container">
+    <div class="shift-performance-tags flex-1">
+      <a-tag color="#3b5999" @click="selectedShift(-1)">
+        {{ currentDate }} 【全部】
+        <span class="current-shift" :style="{ background: '#3b5999' }" v-if="currentShift === -1"></span>
+      </a-tag>
+      <a-tag :color="shiftColor[index]" @click="selectedShift(index)" v-for="(item, index) in shiftInfo">
+        {{ item.createTime ? item.createTime.substring(5, 16) : '' }} ~
+        {{ item.changeShiftTime ? item.changeShiftTime.substring(5, 16) : '当前' }}
+        【{{ getTeamShift(item.shift, item.shiftGroup) }}】
+        <span class="current-shift" :style="{ background: shiftColor[index] }" v-if="index === currentShift"></span>
+      </a-tag>
+    </div>
     <div v-for="item in list" :key="item.type" class="filter-item flex">
       <div class="filter-item-title">{{ item.title }}</div>
       <div class="flex-1 flex" style="gap: 10px">
@@ -25,17 +37,38 @@
 <script lang="ts" setup name="FilterItems">
   import { getMachineDict } from '@/views/billet/hotDelivery/common.data';
   import { debounce } from 'lodash-es';
+  import { ref } from 'vue';
+  import { getTeamShift } from '../../Dashboard/dashboard.api';
 
-  const emit = defineEmits(['change']);
+  const emit = defineEmits(['change', 'change-shift']);
 
-  defineProps<{
+  const props = defineProps<{
     list: any[];
     selectedId: string | number;
+    shiftInfo: any[];
+    currentDate: string;
   }>();
 
+  const shiftColor = ['#f50', '#2db7f5', '#87d068'];
+  const currentShift = ref(-1);
+
+  const selectedShift = (index: number) => {
+    currentShift.value = index;
+    emit('change-shift', index === -1 ? null : props.shiftInfo[index]);
+  };
+
   const handleClick = debounce((val) => {
     emit('change', val);
   }, 300);
+
+  // 设置当前班次
+  const setCurrentShift = (val) => {
+    currentShift.value = val;
+  };
+
+  defineExpose({
+    setCurrentShift,
+  });
 </script>
 <style lang="less" scoped>
   .filter-items-container {
@@ -43,6 +76,28 @@
     line-height: 32px;
     // background-color: #fff;
 
+    .shift-performance-tags {
+      margin-left: 10px;
+
+      .ant-tag {
+        padding: 6px 6px;
+        position: relative;
+        cursor: pointer;
+        margin-bottom: 20px;
+      }
+
+      .current-shift {
+        position: absolute;
+        display: inline-block;
+        width: 60px;
+        height: 4px;
+        border-radius: 4px;
+        bottom: -8px;
+        left: 50%;
+        transform: translateX(-30px);
+      }
+    }
+
     .filter-item {
       margin-bottom: 16px;
 

+ 30 - 590
src/views/billet/storageAndTransportation/index - 副本.vue

@@ -1,519 +1,16 @@
 <template>
-  <div>
-    <!-- 查询区域 -->
-    <div class="jeecg-basic-table-form-container">
-      <a-form layout="inline" :model="templateInfo" :label-col="labelCol" :wrapper-col="wrapperCol">
-        <a-row :gutter="24">
-          <a-col :xl="2" :lg="7" :md="2" :sm="24">
-            <a-form-item label="铸    机">
-              <a-input placeholder="请输入" defaultValue="5#机" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item label="总支数">
-              <a-input placeholder="请输入" v-model:value="templateInfo.amountTotalf" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="3" :lg="7" :md="8" :sm="24">
-            <a-form-item label="轧钢接收">
-              <a-input placeholder="请输入" v-model:value="templateInfo.stackRecivef" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="3" :lg="7" :md="8" :sm="24">
-            <a-form-item label="判废支数">
-              <a-input placeholder="请输入" v-model:value="templateInfo.wasteAmountf" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24" :offset="2">
-            <a-form-item label="铸    机">
-              <a-input placeholder="请输入" defaultValue="6#机" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item label="总支数">
-              <a-input placeholder="请输入" v-model:value="templateInfo.amountTotals" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="3">
-            <a-form-item label="轧钢接收">
-              <a-input placeholder="请输入" v-model:value="templateInfo.stackRecives" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="3">
-            <a-form-item label="判废支数">
-              <a-input placeholder="请输入" v-model:value="templateInfo.wasteAmounts" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item
-              label="热送支数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotfeignAmounts" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item
-              label="热送接收"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotsendRecivef" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item
-              label="总车次数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 18 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 21 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.carTimesf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24" :offset="6">
-            <a-form-item
-              label="热送支数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12},
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotfeignAmountf" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item
-              label="热送接收"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotsendRecives" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item
-              label="热装支数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotfeignAmount" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item
-              label="热装接收"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotfeignRecives" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒二">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubOneHotfeignf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒三">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubTwoHotfeignf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="上若">
-              <a-input placeholder="请输入" v-model:value="templateInfo.srHotfeignf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24" :offset="2">
-            <a-form-item
-              label="热装支数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotfeignAmount" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item
-              label="热装接收"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.hotfeignRecivef" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒二">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubOneHotfeigns" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒三">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubTwoHotfeigns" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="上若">
-              <a-input placeholder="请输入" v-model:value="templateInfo.srHotfeigns" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :xl="2" :lg="7" :md="8" :sm="24">
-            <a-form-item
-              label="起垛支数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.stackAmountf" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item
-              label="垛位接收"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.stackRecivef" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒二">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubOneStackf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒三">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubTwoStackf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="上若">
-              <a-input placeholder="请输入" v-model:value="templateInfo.srStackf" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2" :lg="7" :md="8" :sm="24" :offset="2">
-            <a-form-item
-              label="起垛支数"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.stackAmounts" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item
-              label="垛位接收"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 16 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 12 },
-              }"
-            >
-              <a-input placeholder="请输入" v-model:value="templateInfo.stackRecives" defaultValue="0" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒二">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubOneStacks" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="棒三">
-              <a-input placeholder="请输入" v-model:value="templateInfo.clubTwoStacks" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="2">
-            <a-form-item label="上若">
-              <a-input placeholder="请输入" v-model:value="templateInfo.srStacks" defaultValue="" @blur="editTemplateInfo" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :xl="9">
-            <a-form-item
-              label="厂内车辆"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 3 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 24 },
-              }"
-            >
-              <JCheckbox v-model:value="templateInfo.inCarsf" :options="carInnerOption" @change="editTemplateInfo('inCarsf')" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="9" :offset="2">
-            <a-form-item
-              label="厂内车辆"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 6 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 24 },
-              }"
-            >
-              <JCheckbox v-model:value="templateInfo.inCarss" :options="carInnerOption" @change="editTemplateInfo('inCarss')" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <div style="display: flex; width: auto">
-          <div v-if="templateInfo.inCarsf">
-            <a-row v-for="(item, index) in carInfo.inCarsf" :key="'nadr' + index" :gutter="24">
-              <a-col>
-                <a-form-item
-                  :label-col="{
-                    xs: { span: 24 },
-                    sm: { span: 1 },
-                  }"
-                  :wrapper-col="{
-                    xs: { span: 24 },
-                    sm: { span: 24 },
-                  }"
-                  :label="carOutOption?.find((e) => e.value === item?.carNm)?.label"
-                ></a-form-item>
-              </a-col>
-              <a-col :xl="5">
-                <a-form-item label="车次数">
-                  <a-input v-model:value="item.outCarNum" placeholder="请输入" @blur="editCar(item)"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :xl="5">
-                <a-form-item label="支数">
-                  <a-input v-model:value="item.amount" placeholder="请输入" @blur="editCar(item)"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :xl="5">
-                <a-form-item label="目的地">
-                  <a-input v-model:value="item.destination" placeholder="请输入" @blur="editCar(item)"></a-input>
-                </a-form-item>
-              </a-col>
-            </a-row>
-          </div>
-          <div style="margin-left: 2%; border: 0px solid red">
-            <div v-if="templateInfo.inCarss">
-              <a-row v-for="(item, index) in carInfo.inCarss" :key="'nadr' + index" :gutter="24">
-                <a-col>
-                  <a-form-item
-                    :label-col="{
-                      xs: { span: 24 },
-                      sm: { span: 2 },
-                    }"
-                    :wrapper-col="{
-                      xs: { span: 24 },
-                      sm: { span: 24 },
-                    }"
-                    :label="carOutOption?.find((e) => e.value === item?.carNm)?.label"
-                  ></a-form-item>
-                </a-col>
-                <a-col :xl="5" :offset="1">
-                  <a-form-item label="车次数">
-                    <a-input v-model:value="item.outCarNum" placeholder="请输入" @blur="editCar(item)"></a-input>
-                  </a-form-item>
-                </a-col>
-                <a-col :xl="5">
-                  <a-form-item label="支数">
-                    <a-input v-model:value="item.amount" placeholder="请输入" @blur="editCar(item)"></a-input>
-                  </a-form-item>
-                </a-col>
-                <a-col :xl="5">
-                  <a-form-item label="目的地">
-                    <a-input v-model:value="item.destination" placeholder="请输入" @blur="editCar(item)"></a-input>
-                  </a-form-item>
-                </a-col>
-              </a-row>
-            </div>
-          </div>
-        </div>
-        <a-row :gutter="24">
-          <a-col :xl="9">
-            <a-form-item
-              label="外运车辆"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 3 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 24 },
-              }"
-            >
-              <JCheckbox v-model:value="templateInfo.outCarsf" :options="carOutOption" @change="editTemplateInfo('outCarsf')" />
-            </a-form-item>
-          </a-col>
-          <a-col :xl="9" :offset="2">
-            <a-form-item
-              label="外运车辆"
-              :label-col="{
-                xs: { span: 24 },
-                sm: { span: 6 },
-              }"
-              :wrapper-col="{
-                xs: { span: 24 },
-                sm: { span: 24 },
-              }"
-            >
-              <JCheckbox v-model:value="templateInfo.outCarss" :options="carOutOption" @change="editTemplateInfo('outCarss')" />
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <div style="display: flex; width: auto">
-          <div v-if="templateInfo.outCarsf">
-            <a-row v-for="(item, index) in carInfo.outCarsf" :key="'nadr' + index" :gutter="24">
-              <a-col>
-                <a-form-item
-                  :label-col="{
-                    xs: { span: 24 },
-                    sm: { span: 1 },
-                  }"
-                  :wrapper-col="{
-                    xs: { span: 24 },
-                    sm: { span: 24 },
-                  }"
-                  :label="carOutOption?.find((e) => e.value === item?.carNm)?.label"
-                ></a-form-item>
-              </a-col>
-              <a-col :xl="5">
-                <a-form-item label="车次数">
-                  <a-input v-model:value="item.outCarNum" placeholder="请输入" @blur="editCar(item)"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :xl="5">
-                <a-form-item label="支数">
-                  <a-input v-model:value="item.amount" placeholder="请输入" @blur="editCar(item)"></a-input>
-                </a-form-item>
-              </a-col>
-              <a-col :xl="5">
-                <a-form-item label="目的地">
-                  <a-input v-model:value="item.destination" placeholder="请输入" @blur="editCar(item)"></a-input>
-                </a-form-item>
-              </a-col>
-            </a-row>
-          </div>
-          <div style="margin-left: 2%; border: 0px solid red">
-            <div v-if="templateInfo.outCarss">
-              <a-row v-for="(item, index) in carInfo.outCarss" :key="'nadr' + index" :gutter="24">
-                <a-col>
-                  <a-form-item
-                    :label-col="{
-                      xs: { span: 24 },
-                      sm: { span: 2 },
-                    }"
-                    :wrapper-col="{
-                      xs: { span: 24 },
-                      sm: { span: 24 },
-                    }"
-                    :label="carOutOption?.find((e) => e.value === item?.carNm)?.label"
-                  ></a-form-item>
-                </a-col>
-                <a-col :xl="5" :offset="1">
-                  <a-form-item label="车次数">
-                    <a-input v-model:value="item.outCarNum" placeholder="请输入" @blur="editCar(item)"></a-input>
-                  </a-form-item>
-                </a-col>
-                <a-col :xl="5">
-                  <a-form-item label="支数">
-                    <a-input v-model:value="item.amount" placeholder="请输入" @blur="editCar(item)"></a-input>
-                  </a-form-item>
-                </a-col>
-                <a-col :xl="5">
-                  <a-form-item label="目的地">
-                    <a-input v-model:value="item.destination" placeholder="请输入" @blur="editCar(item)"></a-input>
-                  </a-form-item>
-                </a-col>
-              </a-row>
-            </div>
-          </div>
-        </div>
-      </a-form>
-    </div>
-    <!--引用表格-->
+  <div class="storageAndTransportation">
     <BasicTable @register="registerTable" @edit-end="handleEditEnd">
-      <!--插槽:table标题-->
-      <template #tableTitle>
-        <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
+      <template #form-ccmNo="{ model, field }">
+        <segmented-select
+          v-model:value="model[field]"
+          @change="
+            () => {
+              reload();
+            }
+          "
+          dict="lg_zj"
+        />
       </template>
       <!--操作栏-->
       <template #action="{ record }">
@@ -525,63 +22,17 @@
   </div>
 </template>
 
-<script lang="ts" name="barlineTwo" setup>
-  import { BasicTable, useTable, EditRecordRow } from '/@/components/Table';
-  import { JCheckbox } from '/@/components/Form';
+<script lang="ts" name="storageAndTransportation" setup>
+  import { BasicTable, EditRecordRow } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { columns, searchFormSchema, initDictConfig } from './storageAndTransportation.data';
+  import { columns, initDictConfig, searchFormSchema } from './storageAndTransportation.data';
   import { list, editCell } from './storageAndTransportation.api';
   import { defHttp } from '/@/utils/http/axios';
-  import { onMounted, ref, reactive } from 'vue';
-  const labelCol = reactive({
-    xs: { span: 24 },
-    sm: { span: 11 },
-  });
-  const wrapperCol = reactive({
-    xs: { span: 24 },
-    sm: { span: 13 },
-  });
-  const templateInfo = ref({});
-  const carInfo = ref({});
-  const carInnerOption = ref([]);
-  const carOutOption = ref([]);
-  // 勾选车辆
-  const editCar = (param) => {
-    defHttp.put({ url: '/storageCarConfig/edit', params: { ...param } }, { joinParamsToUrl: true });
-  };
-  // 获取车辆接口
-  const getCarOption = () => {
-    defHttp.get({ url: '/sys/dictItem/getCar', params: {} }, { joinParamsToUrl: true }).then((res) => {
-      carInnerOption.value = res?.map((e) => ({ label: e?.itemText, value: e?.itemValue })) || [];
-      carOutOption.value = res?.map((e) => ({ label: e?.itemText, value: e?.itemValue })) || [];
-    });
-  };
-  // 获取车辆具体信息
-  const getCarInfo = (key, param) => {
-    defHttp.get({ url: '/storageCarConfig/getCarConfig', params: { carNums: param } }, { joinParamsToUrl: true }).then((res) => {
-      carInfo.value[key] = res || [];
-    });
-  };
-  // 获取表单配置信息
-  const getTemplateInfo = () => {
-    defHttp.get({ url: '/storageCastConfig/getConfig', params: {} }, { joinParamsToUrl: true }).then((res) => {
-      templateInfo.value = res || {};
-      if (res.inCarsf) {
-        getCarInfo('inCarsf', res.inCarsf);
-      }
-      if (res.inCarss) {
-        getCarInfo('inCarss', res.inCarss);
-      }
-      if (res.outCarsf) {
-        getCarInfo('outCarsf', res.outCarsf);
-      }
-      if (res.outCarss) {
-        getCarInfo('outCarss', res.outCarss);
-      }
-    });
-  };
+  import { onMounted } from 'vue';
+  import SegmentedSelect from '/@/components/SegmentedSelect/index.vue';
+
   // 编辑单元格
-  async function handleEditEnd({ record, index, key, value }: Recordable) {
+  async function handleEditEnd({ record }: Recordable) {
     const {
       amount,
       carNm,
@@ -630,25 +81,28 @@
   }
 
   //注册table数据
-  const { prefixCls, tableContext } = useListPage({
+  const { tableContext } = useListPage({
     tableProps: {
-      title: '轧钢棒线二',
       api: list,
       columns,
       canResize: false,
       showActionColumn: false,
       showIndexColumn: true,
-      useSearchForm: false,
+      useSearchForm: true,
       formConfig: {
         //labelWidth: 120,
-        // schemas: searchFormSchema,
+        schemas: searchFormSchema,
         autoSubmitOnEnter: true,
         showAdvancedButton: true,
+        autoAdvancedCol: 3,
         fieldMapToNumber: [],
-        fieldMapToTime: [],
+        fieldMapToTime: [['dataTime', ['dataTime_begin', 'dataTime_end'], 'YYYY-MM-DD']],
       },
+      striped: true,
       actionColumn: {
         width: 150,
+        title: '操作',
+        dataIndex: 'action',
         fixed: 'right',
       },
     },
@@ -656,13 +110,6 @@
 
   const [registerTable, { reload }] = tableContext;
 
-  /**
-   * 新增事件
-   */
-  function handleAdd() {
-    defHttp.post({ url: '/storageCarLog/add', params: {} }, { joinParamsToUrl: true }).then(() => {});
-  }
-
   // 同步数据至目的地表
   function confirm(obj: EditRecordRow) {
     const {
@@ -712,23 +159,16 @@
 
     defHttp.post({ url: '/storageCarLog/editAndAddRoll', params }, { joinParamsToUrl: true }).then(() => {});
   }
-  // 编辑表单
-  const editTemplateInfo = (key) => {
-    defHttp.post({ url: '/storageCastConfig/add', params: { ...templateInfo.value } }, { joinParamsToUrl: true }).then(() => {
-      // 当编辑厂内、外运车辆信息,获取对应配置信息
-      if (['inCarsf', 'inCarss', 'outCarsf', 'outCarss'].includes(key)) {
-        getCarInfo(key, templateInfo.value[key]);
-      }
-    });
-  };
+
   onMounted(() => {
-    getTemplateInfo();
-    getCarOption();
     initDictConfig();
   });
 </script>
 
 <style lang="less" scoped>
+  .storageAndTransportation {
+    padding: 0;
+  }
   :deep(.ant-table-thead) {
     .anticon-form {
       display: none;

+ 359 - 156
src/views/billet/storageAndTransportation/index.vue

@@ -1,181 +1,384 @@
 <template>
-  <div class="storageAndTransportation">
-    <BasicTable @register="registerTable" @edit-end="handleEditEnd">
-      <template #form-ccmNo="{ model, field }">
-        <segmented-select
-          v-model:value="model[field]"
-          @change="
-            () => {
-              reload();
-            }
-          "
-          dict="lg_zj"
-        />
+  <div class="storageAndTransportation flex flex-col">
+    <div class="search-wrapper">
+      <BasicForm class="search-form" @register="registerForm" @submit="handleSubmit" @reset="handleSubmit">
+        <template #ccmNo="{ model, field }">
+          <segmented-select
+            v-model:value="model[field]"
+            @change="
+              () => {
+                handleSubmit();
+              }
+            "
+            dict="lg_zj"
+          />
+        </template>
+      </BasicForm>
+    </div>
+    <a-list item-layout="vertical" size="large" :pagination="pagination" :loading="loading" :data-source="listData">
+      <template #renderItem="{ item, index }">
+        <a-list-item key="item.heatNo">
+          <a-list-item-meta>
+            <template #title>
+              <span>炉号:{{ item.heatNo }}</span>
+              <span style="padding: 0 20px"> 总支数:{{ item.heatNoAmount }} </span>
+              <span> 总重量:{{ item.heatNoWeight }} t </span>
+            </template>
+            <template #avatar>
+              <a-tag color="#108ee9">{{ (page - 1) * pageSize + index + 1 }}</a-tag>
+            </template>
+          </a-list-item-meta>
+          <div class="flex heat-wrapper">
+            <div class="items-content flex-1" :style="{ width: 100 / item.content.length + '%' }" v-for="pval in item.content">
+              <a-card>
+                <template #title>
+                  <div class="customer-title flex">
+                    <img src="/@/assets/images/send.png" v-if="pval.type === 'line'" alt="" class="heat-img" />
+                    <img src="/@/assets/images/charge.png" v-if="pval.type === 'car'" alt="" class="heat-img" />
+                    <div class="heat-title">
+                      {{ pval.title }} 【{{ pval.type == 'car' ? pval.content['rollChargeDetails'].length : pval.content['rollSendDetails'].length }}
+                      条记录】
+                    </div>
+                  </div>
+                </template>
+                <template v-if="pval.type == 'car'">
+                  <div class="ticket next-ticket" v-for="(sval, i) in pval.content['rollChargeDetails']">
+                    <a-descriptions size="small">
+                      <a-descriptions-item label="库名"> {{ pval.title }} </a-descriptions-item>
+                      <a-descriptions-item> {{ dayjs(sval.createTime).format('YYYY 年 MM 月 DD 日 HH 时 mm 分') }} </a-descriptions-item>
+                      <a-descriptions-item>
+                        <div style="width: 100%; text-align: right">
+                          <a-tag v-if="sval.btype == 1">冷装</a-tag>
+                          <a-tag color="#f50" v-else>热装</a-tag>
+                        </div>
+                      </a-descriptions-item>
+                    </a-descriptions>
+                    <a-descriptions layout="vertical" bordered :column="8" size="small">
+                      <a-descriptions-item label="序号">{{ sval.carNum }}</a-descriptions-item>
+                      <a-descriptions-item label="炉号">{{ sval.heatNo }}</a-descriptions-item>
+                      <a-descriptions-item label="车号">{{ sval.licensePlate }}</a-descriptions-item>
+                      <a-descriptions-item label="类型"><component :is="renderDictTag(sval.btype, 'lg_btype')" /></a-descriptions-item>
+                      <a-descriptions-item label="定尺">{{ sval.size }}</a-descriptions-item>
+                      <a-descriptions-item label="牌号">{{ sval.spec }}</a-descriptions-item>
+                      <a-descriptions-item label="支数">{{ sval.amount }}</a-descriptions-item>
+                      <a-descriptions-item label="重量">{{ sval.weight }}</a-descriptions-item>
+                    </a-descriptions>
+                  </div>
+                </template>
+                <a-table
+                  v-else
+                  class="heat-s-table"
+                  size="small"
+                  :scroll="{ y: 300 }"
+                  :columns="columnLine"
+                  :pagination="false"
+                  :data-source="pval.content['rollSendDetails']"
+                />
+              </a-card>
+            </div>
+          </div>
+        </a-list-item>
       </template>
-      <!--操作栏-->
-      <template #action="{ record }">
-        <a-popconfirm title="是否确认新增该数据" ok-text="是的" cancel-text="取消" @confirm="confirm(record)">
-          <a href="#">新增</a>
-        </a-popconfirm>
-      </template>
-    </BasicTable>
+    </a-list>
   </div>
 </template>
 
 <script lang="ts" name="storageAndTransportation" setup>
-  import { BasicTable, EditRecordRow } from '/@/components/Table';
-  import { useListPage } from '/@/hooks/system/useListPage';
-  import { columns, initDictConfig, searchFormSchema } from './storageAndTransportation.data';
-  import { list, editCell } from './storageAndTransportation.api';
-  import { defHttp } from '/@/utils/http/axios';
-  import { onMounted } from 'vue';
+  import { onMounted, ref } from 'vue';
+  //引入依赖
+  import { useForm, BasicForm, FormSchema } from '/@/components/Form';
+  import { getStorageCenterInvoicingInfo } 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';
 
-  // 编辑单元格
-  async function handleEditEnd({ record }: Recordable) {
-    const {
-      amount,
-      carNm,
-      castas,
-      createBy,
-      createTime,
-      dataTime,
-      destination,
-      fixedWeight,
-      furnceNum,
-      id,
-      isUpd,
-      outCarNum,
-      shift,
-      shiftGroup,
-      size,
-      spec,
-      steel,
-      sysOrgCode,
-      updateBy,
-      updateTime,
-    } = record;
-    let params = {
-      amount,
-      carNm,
-      castas,
-      createBy,
-      createTime,
-      dataTime,
-      destination,
-      fixedWeight,
-      furnceNum,
-      id,
-      isUpd,
-      outCarNum,
-      shift,
-      shiftGroup,
-      size,
-      spec,
-      steel,
-      sysOrgCode,
-      updateBy,
-      updateTime,
-    };
-    await editCell(params);
-  }
+  // 渲染字典标签
+  const renderDictTag = (value: string, dictCode: string) => {
+    return render.renderDict(value, dictCode);
+  };
 
-  //注册table数据
-  const { tableContext } = useListPage({
-    tableProps: {
-      api: list,
-      columns,
-      canResize: false,
-      showActionColumn: false,
-      showIndexColumn: true,
-      useSearchForm: true,
-      formConfig: {
-        //labelWidth: 120,
-        schemas: searchFormSchema,
-        autoSubmitOnEnter: true,
-        showAdvancedButton: true,
-        autoAdvancedCol: 3,
-        fieldMapToNumber: [],
-        fieldMapToTime: [['dataTime', ['dataTime_begin', 'dataTime_end'], 'YYYY-MM-DD']],
+  //自定义表单字段
+  const formSchemas: FormSchema[] = [
+    {
+      field: 'ccmNo',
+      label: '铸机',
+      component: 'Input',
+      defaultValue: '5',
+      componentProps: {
+        dictCode: 'lg_zj',
+      },
+      colProps: { span: 6 },
+      slot: 'ccmNo',
+    },
+    {
+      label: '炉号',
+      field: 'heatsCode',
+      component: 'Input',
+    },
+    {
+      label: '班组',
+      field: 'shiftGroup',
+      component: 'JDictSelectTag',
+      componentProps: {
+        dictCode: 'lg_bz',
+      },
+    },
+    {
+      label: '班别',
+      field: 'shift',
+      component: 'JDictSelectTag',
+      componentProps: {
+        dictCode: 'lg_bb',
       },
-      striped: true,
-      actionColumn: {
-        width: 150,
-        title: '操作',
-        dataIndex: 'action',
-        fixed: 'right',
+    },
+    {
+      label: '日期',
+      field: 'createTime',
+      component: 'RangePicker',
+      componentProps: {
+        valueFormat: 'YYYY-MM-DD',
       },
     },
+  ];
+  /**
+   * BasicForm绑定注册;
+   */
+  const [registerForm, { getFieldsValue }] = useForm({
+    //注册表单列
+    schemas: formSchemas,
+    //是否显示展开收起按钮,默认false
+    showAdvancedButton: true,
+    //超过指定行数折叠,默认3行
+    autoAdvancedCol: 3,
+    //折叠时默认显示行数,默认1行
+    alwaysShowLines: 3,
+    //将表单内时间区域的值映射成 2个字段, 'YYYY-MM-DD'日期格式化
+    fieldMapToTime: [['createTime', ['createTime_begin', 'createTime_end'], 'YYYY-MM-DD']],
+    //每列占比,默认一行为24
+    baseColProps: { span: 6 },
   });
 
-  const [registerTable, { reload }] = tableContext;
-
-  // 同步数据至目的地表
-  function confirm(obj: EditRecordRow) {
-    const {
-      amount,
-      carNm,
-      castas,
-      createBy,
-      createTime,
-      dataTime,
-      destination,
-      fixedWeight,
-      furnceNum,
-      id,
-      isUpd,
-      outCarNum,
-      shift,
-      shiftGroup,
-      size,
-      spec,
-      steel,
-      sysOrgCode,
-      updateBy,
-      updateTime,
-    } = obj;
-    let params = {
-      amount,
-      carNm,
-      castas,
-      createBy,
-      createTime,
-      dataTime,
-      destination,
-      fixedWeight,
-      furnceNum,
-      id,
-      isUpd,
-      outCarNum,
-      shift,
-      shiftGroup,
-      size,
-      spec,
-      steel,
-      sysOrgCode,
-      updateBy,
-      updateTime,
-    };
-
-    defHttp.post({ url: '/storageCarLog/editAndAddRoll', params }, { joinParamsToUrl: true }).then(() => {});
+  /**
+   * 点击提交按钮的value值
+   * @param values
+   */
+  function handleSubmit() {
+    console.log(getFieldsValue());
+    page.value = 1;
+    getList();
   }
 
+  const listData = ref<Record<string, any>>([]);
+  const loading = ref(false);
+  const columnLine = [
+    { title: '定尺', dataIndex: 'size' },
+    { title: '规格', dataIndex: 'spec' },
+    { title: '支数', dataIndex: 'amount' },
+    { title: '重量/t', dataIndex: 'weight' },
+  ];
+
+  // 分页请求
+  const pageSize = ref(10);
+  const page = ref(1);
+
+  const pagination = ref({
+    onChange: (p: number, ps: number) => {
+      page.value = p;
+      pageSize.value = ps;
+      getList();
+    },
+    pageSize: 10,
+    current: 1,
+    total: 0,
+  });
+
+  const getList = async () => {
+    try {
+      loading.value = true;
+      const values = getFieldsValue();
+
+      if (!values.ccmNo) {
+        values.ccmNo = '5';
+      }
+
+      const params = Object.assign(
+        {},
+        {
+          pageNo: page.value,
+          pageSize: pageSize.value,
+        },
+        values
+      );
+
+      const res = await getStorageCenterInvoicingInfo(params);
+
+      const { records, current, total, size } = res;
+
+      pagination.value = {
+        ...pagination.value,
+        current,
+        total,
+        pageSize: size,
+      };
+
+      if (records && isArray(records)) {
+        const list = records.map((item: any) => {
+          let content: any[] = [];
+          const {
+            heatNoDetails,
+            storageCenterHeatNoInvoicing: { rollClubOneDetails, rollClubTwoDetails, rollClubThreeDetails, rollHeightDetails, rollOutShippDetails },
+          } = item;
+
+          if (rollClubOneDetails) {
+            content.push({
+              title: '棒一',
+              type: 'line',
+              content: rollClubOneDetails,
+            });
+          }
+
+          if (rollClubTwoDetails) {
+            content.push({
+              title: '棒二',
+              type: 'car',
+              content: rollClubTwoDetails,
+            });
+          }
+
+          if (rollClubThreeDetails) {
+            content.push({
+              title: '棒三',
+              type: 'car',
+              content: rollClubThreeDetails,
+            });
+          }
+
+          if (rollOutShippDetails) {
+            content.push({
+              title: '上若',
+              type: 'car',
+              content: rollOutShippDetails,
+            });
+          }
+
+          if (rollHeightDetails) {
+            content.push({
+              title: '高线',
+              type: 'line',
+              content: rollHeightDetails,
+            });
+          }
+
+          return {
+            ...heatNoDetails[0],
+            content,
+          };
+        });
+
+        listData.value = list;
+      }
+
+      loading.value = false;
+    } catch (error) {
+      console.error(error);
+      loading.value = false;
+    }
+  };
+
   onMounted(() => {
-    initDictConfig();
+    getList();
   });
 </script>
 
 <style lang="less" scoped>
   .storageAndTransportation {
-    padding: 0;
-  }
-  :deep(.ant-table-thead) {
-    .anticon-form {
-      display: none;
+    margin: 10px;
+
+    .search-wrapper {
+      margin-bottom: 10px;
+      background-color: #fff;
+      padding-top: 30px;
+
+      .search-form {
+        :deep(.btnArea) {
+          .ant-form-item-row {
+            width: 100%;
+            justify-content: flex-end;
+          }
+        }
+      }
+    }
+
+    .ant-list {
+      background-color: #fff;
+      padding: 10px;
+    }
+
+    .heat-wrapper {
+      gap: 10px;
+    }
+
+    .items-content {
+      flex-shrink: 0;
+    }
+
+    .customer-title {
+      line-height: 32px;
+    }
+
+    .heat-img {
+      width: 32px;
+      height: 32px;
+    }
+
+    .heat-title {
+      margin-left: 8px;
+      margin-right: 60px;
+      font-weight: 400;
+      font-size: 14px;
+      color: #000000;
+    }
+
+    .ant-card {
+      width: 100%;
+      height: 100%;
+      overflow: hidden;
+
+      :deep(.ant-card-body) {
+        padding: 10px;
+        display: flex;
+        overflow: auto;
+
+        &::after,
+        &::before {
+          display: none;
+        }
+      }
+    }
+
+    /* 基础票据样式 */
+    .ticket {
+      width: 666px;
+      background: #fff;
+      border-radius: 8px;
+      box-shadow: 5px 0px 6px 2px rgba(0, 0, 0, 0.25);
+      padding: 10px;
+      position: relative;
+      border-left: 4px solid #ddd;
+      transition: transform 0.2s;
+      margin-right: 10px;
+      flex-shrink: 0;
+
+      &:last-child {
+        margin-right: 0;
+      }
+    }
+
+    /* 下一个票据的特殊样式 */
+    .next-ticket {
+      border-left-color: #0958d9; /* 左侧高亮蓝色边框 */
+      background: #f8f9fa; /* 浅灰色背景 */
     }
-  }
-  :deep(.ant-row) {
-    margin: 3px 0;
-    width: 100%;
   }
 </style>

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

@@ -8,6 +8,8 @@ enum Api {
   storageCenterCarById = '/storageBill/storageCenterCarById', // 根据运单号获取运单信息
   storageCenterHeatNoInfo = '/storageBill/storageCenterHeatNoInfo', // 获取炉次信息
   storageCenterByHeatNo = '/storageBill/storageCenterByHeatNo', // 根据炉批号获取运单信息
+  // 获取炉次信息
+  storageCenterInvoicingInfo = '/storageBill/storageCenterInvoicingInfo',
 }
 
 /**
@@ -33,3 +35,8 @@ export const getStorageCenterHeatNoInfo = (params) => {
 export const getStorageCenterByHeatNo = (params) => {
   return defHttp.get({ url: Api.storageCenterByHeatNo, params }, { joinParamsToUrl: true });
 };
+
+// 获取炉次信息
+export const getStorageCenterInvoicingInfo = (params) => {
+  return defHttp.get({ url: Api.storageCenterInvoicingInfo, params }, { joinParamsToUrl: true });
+};

+ 80 - 2
src/views/billet/storageAndTransportation/workbenches.vue

@@ -8,7 +8,15 @@
         <template #tab>
           <a-button :type="activeKey === 'car' ? 'primary' : 'default'">车次</a-button>
         </template>
-        <filter-items :list="filterList" :selectedId="selectedId" @change="changeId" />
+        <filter-items
+          ref="filterItemsCarRef"
+          :list="filterList"
+          :shiftInfo="shiftInfo"
+          @change-shift="changeShift"
+          :currentDate="currentDate"
+          :selectedId="selectedId"
+          @change="changeId"
+        />
         <car
           ref="carRef"
           :currentDate="currentDate"
@@ -21,7 +29,15 @@
         <template #tab>
           <a-button :type="activeKey === 'heat' ? 'primary' : 'default'">炉次</a-button>
         </template>
-        <filter-items :list="filterList" :selectedId="selectedId" @change="changeId" />
+        <filter-items
+          ref="filterItemsHeatRef"
+          :list="filterList"
+          :shiftInfo="shiftInfo"
+          @change-shift="changeShift"
+          :currentDate="currentDate"
+          :selectedId="selectedId"
+          @change="changeId"
+        />
         <heat
           ref="heatRef"
           :currentDate="currentDate"
@@ -43,6 +59,9 @@
   import type { Dayjs } from 'dayjs';
   import dayjs from 'dayjs';
   import { useTimeoutFn } from '/@/hooks/core/useTimeout';
+  import { list } from '../ShiftPerformance/ShiftPerformance.api';
+  import { cloneDeep } from 'lodash-es';
+  import { isArray } from '/@/utils/is';
 
   const activeKey = ref('car');
   const currentDate = ref(dayjs().format('YYYY-MM-DD'));
@@ -51,6 +70,8 @@
   // 声明 carRef 的类型为 car 组件的实例类型
   const carRef = ref<InstanceType<typeof car> | null>(null);
   const heatRef = ref<InstanceType<typeof heat> | null>(null);
+  const filterItemsCarRef = ref<InstanceType<typeof filterItems> | null>(null);
+  const filterItemsHeatRef = ref<InstanceType<typeof filterItems> | null>(null);
   const loading = ref(false);
 
   // 总数
@@ -64,6 +85,7 @@
   const dtlList = ref<any[]>([]);
 
   // 筛选
+  const orgFilterList = ref<any[]>([]);
   const filterList = ref<any[]>([]);
 
   const changeTotal = (data: any) => {
@@ -169,6 +191,7 @@
       if (!storageBillInfo) storageBillInfo = fiveOutShipp.length ? fiveOutShipp[0] : sixOutShipp.length ? sixOutShipp[0] : '';
     }
     filterList.value = list;
+    orgFilterList.value = list;
 
     if (storageBillInfo) {
       changeId(storageBillInfo);
@@ -215,6 +238,7 @@
       if (!storageBillInfo) storageBillInfo = fiveHeatDtl.length ? fiveHeatDtl[0] : sixHeatDtl.length ? sixHeatDtl[0] : '';
     }
     filterList.value = luciList;
+    orgFilterList.value = luciList;
 
     if (storageBillInfo) {
       changeId(storageBillInfo);
@@ -224,6 +248,7 @@
   // 切换id
   const changeId = (data) => {
     const { id } = data || {};
+    if (id === selectedId.value) return;
     selectedId.value = id;
     selectedIdItem.value = data;
     if (activeKey.value === 'car') {
@@ -233,14 +258,42 @@
     }
   };
 
+  // 切换班组班别
+  const changeShift = (shiftObj: any) => {
+    const cloneList = cloneDeep(orgFilterList.value);
+    let current = null;
+    for (let index = 0; index < cloneList.length; index++) {
+      const element = cloneList[index];
+      if (element.children) {
+        for (const item in element.children) {
+          if (isArray(element.children[item])) {
+            element.children[item] = shiftObj
+              ? element.children[item].filter((citem) => citem.shift === shiftObj.shift && citem.shiftGroup === shiftObj.shiftGroup)
+              : element.children[item];
+
+            if (!current) {
+              current = element.children[item].length ? element.children[item][0] : null;
+            }
+          }
+        }
+      }
+    }
+
+    filterList.value = cloneList;
+    changeId(current);
+  };
+
   const changeDate = (date: Dayjs) => {
     stop();
     currentDate.value = date.format('YYYY-MM-DD');
     if (activeKey.value === 'car') {
       carRef.value && carRef.value.getInfo(currentDate.value);
+      filterItemsCarRef.value && filterItemsCarRef.value.setCurrentShift(-1);
     } else {
       heatRef.value && heatRef.value.getInfo(currentDate.value);
+      filterItemsHeatRef.value && filterItemsHeatRef.value.setCurrentShift(-1);
     }
+    getShiftInfo(date);
     setTimeout(() => {
       start();
     }, 10000);
@@ -248,10 +301,13 @@
 
   const changeTabs = (key) => {
     activeKey.value = key;
+    selectedIdItem.value = {};
     if (key === 'car') {
       carRef.value && carRef.value.getInfo(currentDate.value);
+      filterItemsCarRef.value && filterItemsCarRef.value.setCurrentShift(-1);
     } else {
       heatRef.value && heatRef.value.getInfo(currentDate.value);
+      filterItemsHeatRef.value && filterItemsHeatRef.value.setCurrentShift(-1);
     }
   };
 
@@ -259,6 +315,28 @@
     changeDate(dayjs(currentDate.value));
   }, 600000);
 
+  const shiftInfo = ref<any>([]);
+  // 获取班次数据
+  const getShiftInfo = async (date?: Dayjs) => {
+    try {
+      const createTime_begin = date ? date.subtract(1, 'day').format('YYYY-MM-DD 23:55:00') : undefined;
+      const createTime_end = date ? date.add(1, 'day').format('YYYY-MM-DD 00:05:00') : undefined;
+      const res = await list({
+        ccmNo: '5',
+        pageNo: 1,
+        pageSize: 3,
+        column: 'createTime',
+        order: 'asc',
+        ...(date ? { createTime_begin, createTime_end } : {}),
+      });
+      const { records } = res;
+
+      shiftInfo.value = records;
+    } catch (error) {
+      console.error(error);
+    }
+  };
+
   onMounted(() => {
     changeDate(dayjs());
   });