index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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">
  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-col :span="12">
  23. <a-form-item label="现货品种">
  24. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  25. </a-form-item>
  26. </a-col>
  27. <a-col :span="12">
  28. <a-form-item label="计划量">
  29. <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
  30. </a-form-item>
  31. </a-col>
  32. </a-row>
  33. </fieldset>
  34. <fieldset class="formFieldSet">
  35. <legend>其它信息</legend>
  36. <a-row :gutter="24">
  37. <a-col :span="12">
  38. <a-form-item label="交易用户">
  39. <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :span="12">
  43. <a-form-item label="结算币种">
  44. <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
  45. </a-form-item>
  46. </a-col>
  47. </a-row>
  48. <a-row :gutter="24">
  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. </fieldset>
  56. </a-form>
  57. </a-modal>
  58. </template>
  59. <script lang="ts">
  60. import { defineComponent, PropType, ref } from 'vue';
  61. import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
  62. import { formatValue } from '@/common/methods';
  63. import { getPlanContractType } from '@/views/business/plan/setup';
  64. import { Modal } from 'ant-design-vue';
  65. import { HedgePlanOperateReq } from '@/services/proto/hedgeplan/interface';
  66. import * as Long from 'long';
  67. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  68. import { oldHedgePlanReq } from '@/services/proto/hedgeplan';
  69. import { getPayCurrencyTypeEnumList } from '@/common/constants/enumsList';
  70. import { _closeModal } from '@/common/setup/modal/modal';
  71. export default defineComponent({
  72. name: 'plan_audit_cancel',
  73. emits: ['cancel', 'update'],
  74. props: {
  75. selectedRow: {
  76. type: Object as PropType<Ermcp3HedgePlan>,
  77. default: {},
  78. },
  79. },
  80. setup(props, context) {
  81. const { visible, cancel } = _closeModal(context);
  82. const maskClosableFlag = ref<boolean>(false);
  83. const loading = ref<boolean>(false);
  84. function submit() {
  85. Modal.confirm({
  86. title: '是否确认撤销',
  87. okText: '确认撤销',
  88. cancelText: '取消',
  89. onOk() {
  90. const { hedgeplanid, hedgeplanno, contracttype, areauserid, deliverygoodsid, wrstandardid, producttype, spotgoodsdesc, planqty, convertfactor, plantime } = props.selectedRow;
  91. const params: HedgePlanOperateReq = {
  92. HedgePlanID: Long.fromString(hedgeplanid),
  93. OperateType: 5,
  94. Info: {
  95. HedgePlanNo: hedgeplanno, // string 套保计划编号
  96. ContractType: contracttype, // int32 计划类型-1:采购-1:销售
  97. AreaUserID: areauserid, // uint32 机构ID
  98. DeliveryGoodsID: deliverygoodsid, // uint32 现货品种ID
  99. WrStandardID: wrstandardid, // uint32 现货商品ID
  100. ProductType: producttype, // uint32 产品类型-1:标准仓单2:等标3:非标
  101. SpotGoodsDesc: spotgoodsdesc, // string 商品型号
  102. PlanQty: planqty, // double 计划数量
  103. ConvertFactor: convertfactor, // double 标仓系数
  104. PlanTime: plantime, // string 计划时间
  105. },
  106. };
  107. requestResultLoadingAndInfo(oldHedgePlanReq, params, loading, ['撤销成功', '撤销失败:']).then(() => {
  108. cancel(true);
  109. });
  110. },
  111. onCancel() { },
  112. });
  113. }
  114. return {
  115. visible,
  116. cancel,
  117. submit,
  118. maskClosableFlag,
  119. formatValue,
  120. getPlanContractType,
  121. getPayCurrencyTypeEnumList,
  122. };
  123. },
  124. });
  125. </script>