index.vue 5.1 KB

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