index.vue 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <!-- 套期交易:未关联采购合同-未关联购销计划 -->
  3. <mtp-table-scroll>
  4. <template #header>
  5. <Filter @search="updateColumn"></Filter>
  6. </template>
  7. <template #default="{ scroll }">
  8. <a-table :columns="columns" class="srcollYTable" :pagination="false" :expandedRowKeys="expandedRowKeys"
  9. :customRow="Rowclick" :rowKey="(record, index) => index" :data-source="tableList" :scroll="scroll">
  10. <template #expandedRowRender="{ record }">
  11. <mtp-table-button class="btn-list-sticky" :buttons="auth" :record="record" @click="openComponent" />
  12. </template>
  13. <!-- 类型 -->
  14. <template #contracttype="{ text }">
  15. <a>{{ getPlanContractType(text) }}</a>
  16. </template>
  17. <!-- 状态 -->
  18. <template #hedgeplanstatus="{ text }">
  19. <a>{{ getPlanStatusName(text) }}</a>
  20. </template>
  21. </a-table>
  22. </template>
  23. </mtp-table-scroll>
  24. <!-- 右键 -->
  25. <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="auth"> </contextMenu>
  26. <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
  27. </template>
  28. <script lang="ts">
  29. import { queryTableList, contextMenu, defineComponent, MtpTableButton, defineAsyncComponent, handleComposeTable } from '@/common/export/commonTable'
  30. import { UnLinkErmcpHedgePlanReq, UnLinkErmcpHedgePlanRsp } from '@/services/go/ermcp/hedgedItem/interface'
  31. import { queryUnLinkErmcpHedgePlan } from '@/services/go/ermcp/hedgedItem'
  32. import { getPlanStatusName } from '@/views/business/plan/setup'
  33. import { getPlanContractType } from '@/views/business/plan/setup'
  34. import { useMenu } from '@/@next/hooks/common'
  35. import { getAreaUserId } from '@/services/bus/user'
  36. import MtpTableScroll from '@/common/components/tableScroll/index.vue'
  37. import Filter from './components/filter/index.vue';
  38. export default defineComponent({
  39. components: {
  40. MtpTableScroll,
  41. Filter,
  42. MtpTableButton,
  43. contextMenu,
  44. detail: defineAsyncComponent(() => import('@/views/business/plan/components/detail/index.vue')), // 详情
  45. bind: defineAsyncComponent(() => import('./components/bind/index.vue')), // 关联项目
  46. },
  47. setup() {
  48. const { auth } = useMenu();
  49. const { loading, tableList, queryTable } = queryTableList<UnLinkErmcpHedgePlanRsp>(true, 2); // 表格列表数据
  50. const queryFn = () => {
  51. const param: UnLinkErmcpHedgePlanReq = {
  52. areauserid: getAreaUserId(),
  53. }
  54. queryTable(queryUnLinkErmcpHedgePlan, param);
  55. }
  56. // 表格通用逻辑
  57. const composeTable = handleComposeTable<UnLinkErmcpHedgePlanRsp>({
  58. queryFn,
  59. tableName: 'table_pcweb_hedgeditem_spot_plan',
  60. })
  61. return {
  62. ...composeTable,
  63. loading,
  64. tableList,
  65. auth,
  66. getPlanStatusName,
  67. getPlanContractType,
  68. }
  69. }
  70. })
  71. </script>