index.vue 5.0 KB

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