index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <!-- 现货查询: 购销计划-->
  3. <div class="search-plan" :loading="loading">
  4. <filterCustomTable @search="updateColumn"></filterCustomTable>
  5. <a-table :columns="columns" class="srcollYTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="{ x: 'calc(100% - 160px)', y: 'calc(100vh - 163px)' }">
  6. <template #index="{ index }">
  7. <span>{{ index + 1 }}</span>
  8. </template>
  9. </a-table>
  10. <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
  11. </div>
  12. </template>
  13. <script lang="ts">
  14. import { queryTableList, MtpTableButton, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
  15. import filterCustomTable from './components/filter/index.vue';
  16. import { formatTime, formatValue } from '@/common/methods';
  17. import { columns } from './setup';
  18. import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
  19. import { QueryHedgePlan } from '@/services/go/ermcp/plan';
  20. import { EnumRouterName } from '@/common/constants/enumRouterName';
  21. export default defineComponent({
  22. name: 'search-plan',
  23. components: {
  24. filterCustomTable,
  25. MtpTableButton,
  26. },
  27. setup() {
  28. // 表格列表数据
  29. const { loading, tableList, queryTable } = queryTableList<Ermcp3HedgePlan>();
  30. // 获取列表数据
  31. const queryTableAction = () => queryTable(QueryHedgePlan, '2,3');
  32. // 表格通用逻辑
  33. const param: ComposeTableParam = {
  34. queryFn: queryTableAction,
  35. menuType: EnumRouterName.spot_contract_checkpending,
  36. tableName: 'table_pcweb_hedging_plan',
  37. tableFilterKey: ['contracttype', 'hedgeplanno', 'deliverygoodsname'],
  38. isDetail: true,
  39. };
  40. return {
  41. ...handleComposeTable<Ermcp3HedgePlan>(param),
  42. loading,
  43. tableList,
  44. queryTable,
  45. formatTime,
  46. formatValue,
  47. columns,
  48. };
  49. },
  50. });
  51. </script>