index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <!-- 计划撤销-->
  3. <a-modal class="commonModal custom-detail" title="计划撤销" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
  4. <template #footer>
  5. <a-button key="submit" class="cancelBtn" @click="cancel">取消 </a-button>
  6. <a-button key="submit" type="primary" :loading="loading" @click="submit">确认撤销 </a-button>
  7. </template>
  8. <a-form class="inlineForm" :form="form" @submit="handleSearch">
  9. <fieldset class="formFieldSet">
  10. <legend>基本信息</legend>
  11. <a-row :gutter="24">
  12. <a-col :span="12">
  13. <a-form-item label="计划类型">
  14. <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :span="12">
  18. <a-form-item label="计划名称">
  19. <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
  20. </a-form-item>
  21. </a-col>
  22. </a-row>
  23. <a-row :gutter="24">
  24. <a-col :span="12">
  25. <a-form-item label="现货品种">
  26. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :span="12">
  30. <a-form-item label="标仓系数">
  31. <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
  32. </a-form-item>
  33. </a-col>
  34. </a-row>
  35. <a-row :gutter="24">
  36. <a-col :span="12">
  37. <a-form-item label="计划量">
  38. <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
  39. </a-form-item>
  40. </a-col>
  41. <a-col :span="12">
  42. <a-form-item label="备注">
  43. <span class="white">{{ formatValue(selectedRow.remark) }}</span>
  44. </a-form-item>
  45. </a-col>
  46. </a-row>
  47. </fieldset>
  48. <fieldset class="formFieldSet">
  49. <legend>其它信息</legend>
  50. <a-row :gutter="24">
  51. <a-col :span="12">
  52. <a-form-item label="交易用户">
  53. <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
  54. </a-form-item>
  55. </a-col>
  56. <a-col :span="12">
  57. <a-form-item label="结算币种">
  58. <span class="white">{{ formatValue(selectedRow.enumdicname) }}</span>
  59. </a-form-item>
  60. </a-col>
  61. </a-row>
  62. <a-row :gutter="24">
  63. <a-col :span="12">
  64. <a-form-item label="备注">
  65. <span class="white">{{ formatValue(selectedRow.remark) }}</span>
  66. </a-form-item>
  67. </a-col>
  68. </a-row>
  69. </fieldset>
  70. </a-form>
  71. </a-modal>
  72. </template>
  73. <script lang="ts">
  74. import { defineComponent, PropType, ref } from 'vue';
  75. import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
  76. import { formatValue } from '@/common/methods';
  77. import { getPlanContractType } from '@/views/business/plan/setup';
  78. import { Modal } from 'ant-design-vue';
  79. import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
  80. import * as Long from 'long';
  81. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  82. import { hedgePlanReq } from '@/services/proto/hedgeplan';
  83. import { getPayCurrencyTypeEnumList } from '@/common/constants/enumsList';
  84. import { _closeModal } from '@/common/setup/modal/modal';
  85. export default defineComponent({
  86. name: 'plan_audit_cancel',
  87. emits: ['cancel', 'update'],
  88. props: {
  89. selectedRow: {
  90. type: Object as PropType<Ermcp3HedgePlan>,
  91. default: {},
  92. },
  93. },
  94. setup(props, context) {
  95. const { visible, cancel } = _closeModal(context);
  96. const maskClosableFlag = ref<boolean>(false);
  97. const loading = ref<boolean>(false);
  98. function submit() {
  99. Modal.confirm({
  100. title: '是否确认撤销',
  101. okText: '确认撤销',
  102. cancelText: '取消',
  103. onOk() {
  104. const params: ErmcpHedgePlanReq = {
  105. HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
  106. OperateType: 3,
  107. };
  108. requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['撤销成功', '撤销失败:']).then(() => {
  109. cancel(true);
  110. });
  111. },
  112. onCancel() {},
  113. });
  114. }
  115. return {
  116. visible,
  117. cancel,
  118. submit,
  119. maskClosableFlag,
  120. formatValue,
  121. getPlanContractType,
  122. getPayCurrencyTypeEnumList,
  123. };
  124. },
  125. });
  126. </script>