index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <!-- 套期交易-期货成交关联-补单关联 -->
  3. <a-modal class="commonModal custom-detail" title="期现单据关联" v-model:visible="visible" centered @cancel="cancel(false)"
  4. :maskClosable="false" width="1000px">
  5. <a-form class="inlineForm">
  6. <fieldset class="formFieldSet">
  7. <legend>成交单信息</legend>
  8. <a-row :gutter="24">
  9. <a-col :span="12">
  10. <a-form-item label="期货合约">
  11. <span class="white">{{ selectedRow.accountname + '/' + selectedRow.accountid }}</span>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :span="12">
  15. <a-form-item label="方向">
  16. <span class="white">{{ selectedRow.goodscode + '/' + selectedRow.goodsname }}</span>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :span="12">
  20. <a-form-item label="期货子账户">
  21. <span class="white">{{ getChannelBuildName(selectedRow.channelbuildtype) }} {{
  22. getBuyOrSellName(selectedRow.buyorsell)
  23. }}</span>
  24. </a-form-item>
  25. </a-col>
  26. <a-col :span="12">
  27. <a-form-item label="建平">
  28. <span class="white">{{ formatValue(selectedRow.tradeprice) }}</span>
  29. </a-form-item>
  30. </a-col>
  31. <a-col :span="12">
  32. <a-form-item label="成交价">
  33. <span class="white">{{ formatValue(selectedRow.tradelot) }}</span>
  34. </a-form-item>
  35. </a-col>
  36. <a-col :span="12">
  37. <a-form-item label="成交数量">
  38. <span class="white">{{ formatValue(selectedRow.tradetime) }}</span>
  39. </a-form-item>
  40. </a-col>
  41. </a-row>
  42. </fieldset>
  43. <fieldset class="formFieldSet">
  44. <legend>关联信息</legend>
  45. <div class="tableDatas">
  46. <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false"
  47. :loading="loading" :rowKey="(record, index) => index" :row-selection="rowSelection">
  48. <template #wrstandardname="{ record }">
  49. <span>{{ record.deliverygoodsname }}/{{ record.wrstandardname }}</span>
  50. </template>
  51. <template #relatedlot="{ record, index }">
  52. <a-input-number class="dialogInput" size="small"
  53. :disabled="!selectedRowKeys.includes(index)" :precision="0"
  54. v-model:value="record.relatedlot" style="width:80px" />
  55. </template>
  56. <template #relatedqty="{ record }">
  57. <span>{{ calcRelatedqty(record) }}</span>
  58. </template>
  59. </a-table>
  60. </div>
  61. </fieldset>
  62. </a-form>
  63. <template #footer>
  64. <a-button key="submit" class="cancelBtn" :loading="loading" @click="cancel(false)">取消</a-button>
  65. <a-button key="submit" type="primary" :loading="loading" @click="formSubmit(() => cancel(true))">确定
  66. </a-button>
  67. </template>
  68. </a-modal>
  69. </template>
  70. <script lang="ts">
  71. import { defineComponent, PropType } from 'vue'
  72. import { _closeModal } from '@/common/setup/modal/modal'
  73. import { formatValue } from '@/common/methods'
  74. import { getChannelBuildName, getBuyOrSellName } from '@/common/constants/enumsName'
  75. import { InternalUncorrelatedTradeDetailRsp } from '@/services/go/ermcp/hedgedItem/interface'
  76. import { useForm } from './form'
  77. export default defineComponent({
  78. emits: ['cancel'],
  79. props: {
  80. selectedRow: {
  81. type: Object as PropType<InternalUncorrelatedTradeDetailRsp>,
  82. required: true
  83. },
  84. },
  85. setup(props, context) {
  86. const { visible, cancel } = _closeModal(context);
  87. const { loading, tableList, columns, currentQty, selectedRowKeys, rowSelection, calcRelatedqty, formSubmit } = useForm(props.selectedRow);
  88. return {
  89. visible,
  90. loading,
  91. tableList,
  92. columns,
  93. cancel,
  94. formatValue,
  95. currentQty,
  96. selectedRowKeys,
  97. rowSelection,
  98. calcRelatedqty,
  99. formSubmit,
  100. getBuyOrSellName,
  101. getChannelBuildName,
  102. }
  103. }
  104. })
  105. </script>
  106. <style lang="less">
  107. .custom-detail {
  108. .ant-modal-body {
  109. padding-top: 0;
  110. padding-left: 0;
  111. padding-right: 0;
  112. }
  113. .tableDatas {
  114. margin-top: 26px;
  115. padding: 0;
  116. overflow: hidden;
  117. .dialogTable {
  118. width: 100%;
  119. max-height: 230px;
  120. overflow-x: auto !important;
  121. }
  122. }
  123. .ant-form.inlineForm {
  124. margin-top: 20px;
  125. padding: 0 24px;
  126. }
  127. }
  128. </style>