index.vue 5.1 KB

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