index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <!-- 审核计划-->
  3. <a-modal class="commonModal fieldsetDialog warehouse-disable" title="审核计划" v-model:visible="visible" centered @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="pass">审核通过</a-button>
  7. <a-button key="submit" type="primary" :loading="loading" @click="refuse">审核拒绝</a-button>
  8. </template>
  9. <a-form class="inlineForm" :form="form" @submit="handleSearch">
  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-row>
  24. <a-row :gutter="24">
  25. <a-col :span="12">
  26. <a-form-item label="现货品种">
  27. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :span="12">
  31. <a-form-item label="商品">
  32. <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</span>
  33. </a-form-item>
  34. </a-col>
  35. </a-row>
  36. <a-row :gutter="24">
  37. <a-col :span="12">
  38. <a-form-item label="计划量">
  39. <span class="white">{{ formatValue(selectedRow.planqty) }}</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.tradeusername) }}</span>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :span="12">
  50. <a-form-item label="结算币种">
  51. <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
  52. </a-form-item>
  53. </a-col>
  54. </a-row>
  55. <a-row :gutter="24">
  56. <a-col :span="12">
  57. <a-form-item label="状态">
  58. <span class="white">{{ formatValue(getPlanStatusName(selectedRow.hedgeplanstatus)) }}</span>
  59. </a-form-item>
  60. </a-col>
  61. </a-row>
  62. <a-row :gutter="24">
  63. <a-col :span="12">
  64. <a-form-item label="备注">
  65. <span class="white">{{ formatValue(selectedRow.remark) }}</span>
  66. </a-form-item>
  67. </a-col>
  68. </a-row>
  69. </fieldset>
  70. </a-form>
  71. </a-modal>
  72. </template>
  73. <script lang="ts">
  74. import { defineComponent, PropType, ref } from 'vue';
  75. import { closeModal } from '@/common/setup/modal/index';
  76. import { Modal } from 'ant-design-vue';
  77. import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
  78. import Long from 'long';
  79. import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
  80. import { getPlanContractType, getPlanStatusName } from '@/views/business/plan/setup';
  81. import { formatValue } from '@/common/methods';
  82. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  83. import { hedgePlanReq } from '@/services/proto/hedgeplan';
  84. import { getPayCurrencyTypeEnumList } from '@/common/constants/enumsList';
  85. import { getUserId } from '@/services/bus/user';
  86. import { geLoginID_number } from '@/services/bus/login';
  87. import { _closeModal } from '@/common/setup/modal/modal';
  88. export default defineComponent({
  89. name: 'plan_audit_audit',
  90. emits: ['cancel', 'update'],
  91. props: {
  92. selectedRow: {
  93. type: Object as PropType<Ermcp3HedgePlan>,
  94. default: {},
  95. },
  96. },
  97. setup(props, context) {
  98. const { visible, cancel } = _closeModal(context);
  99. const loading = ref<boolean>(false);
  100. // 审核通过
  101. function pass() {
  102. Modal.confirm({
  103. title: '是否确认审核通过',
  104. okText: '审核通过',
  105. cancelText: '取消',
  106. onOk() {
  107. const params: ErmcpHedgePlanReq = {
  108. HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
  109. OperateType: 4,
  110. auditremark: '通过',
  111. Currencyid: props.selectedRow.currencyid, // 结算币种id
  112. Tradeuserid: props.selectedRow.tradeuserid, // 交易用户id
  113. auditid: Number(geLoginID_number()),
  114. };
  115. requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['审核通过', '审核失败:']).then(() => {
  116. cancel(true);
  117. });
  118. },
  119. onCancel() {},
  120. });
  121. }
  122. // 审核拒绝
  123. function refuse() {
  124. Modal.confirm({
  125. title: '是否确认审核拒绝',
  126. okText: '审核拒绝',
  127. cancelText: '取消',
  128. onOk() {
  129. const params: ErmcpHedgePlanReq = {
  130. HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
  131. OperateType: 5,
  132. };
  133. requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['审核拒绝通过', '审核拒绝失败:']).then(() => {
  134. cancel(true);
  135. });
  136. },
  137. onCancel() {},
  138. });
  139. }
  140. return {
  141. visible,
  142. cancel,
  143. refuse,
  144. loading,
  145. pass,
  146. getPlanContractType,
  147. formatValue,
  148. getPayCurrencyTypeEnumList,
  149. getPlanStatusName,
  150. };
  151. },
  152. });
  153. </script>