index.vue 5.5 KB

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