Przeglądaj źródła

储运配置增加搜索

zhangafei 1 miesiąc temu
rodzic
commit
6d8a860023

+ 66 - 1
src/views/billet/ShiftConfiguration/ShiftConfiguration.data.ts

@@ -71,7 +71,72 @@ export const columns: BasicColumn[] = [
   },
 ];
 //查询数据
-export const searchFormSchema: FormSchema[] = [];
+export const searchFormSchema: FormSchema[] = [
+  {
+    label: '铸机',
+    field: 'ccmNo',
+    component: 'JDictSelectTag',
+    componentProps: {
+      dictCode: 'lg_zj',
+    },
+    defaultValue: '5',
+    slot: 'ccmNo',
+  },
+  {
+    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 },
+      ],
+    },
+  },
+  {
+    label: '日期',
+    field: 'date',
+    component: 'DatePicker',
+  },
+];
 //表单数据
 export const formSchema: FormSchema[] = [
   {

+ 22 - 1
src/views/billet/ShiftConfiguration/ShiftConfigurationList.vue

@@ -2,6 +2,20 @@
   <div>
     <!--引用表格-->
     <BasicTable @register="registerTable" :rowSelection="rowSelection">
+      <template #form-ccmNo="{ field, model }">
+        <segmented-select
+          v-model:value="model[field]"
+          @change="
+            () => {
+              reload();
+            }
+          "
+          dict="lg_zj"
+        />
+      </template>
+      <template #form-destination="{ model }">
+        <a-select v-model:value="model.destination" :options="destinationOptions[model.ccmNo]" />
+      </template>
       <!--插槽:table标题-->
       <template #tableTitle>
         <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
@@ -43,6 +57,8 @@
   import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getCurrentShift } from './ShiftConfiguration.api';
   import { onMounted, ref } from 'vue';
   import dayjs from 'dayjs';
+  import SegmentedSelect from '/@/components/SegmentedSelect/index.vue';
+  import { destinationOptions } from '../hotDelivery/common.data';
 
   const lastData = ref({});
   const currentShift = ref<{
@@ -77,6 +93,7 @@
       afterFetch: (data) => {
         //重置选中
         const pagination: any = getPaginationRef();
+        const values = getForm().getFieldsValue();
         if (pagination && pagination.current === 1 && data.length > 0) {
           let newObj = {};
           for (const key in data[0]) {
@@ -85,6 +102,10 @@
             }
           }
           lastData.value = newObj;
+        } else {
+          lastData.value = {
+            ccmNo: values.ccmNo || '5',
+          };
         }
         return data;
       },
@@ -99,7 +120,7 @@
     },
   });
 
-  const [registerTable, { reload, getPaginationRef }, { rowSelection, selectedRowKeys }] = tableContext;
+  const [registerTable, { reload, getPaginationRef, getForm }, { rowSelection, selectedRowKeys }] = tableContext;
 
   /**
    * 新增事件