index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <!-- 审核计划-->
  3. <a-modal class="commonModal fieldsetDialog warehouse-disable"
  4. title="审核计划"
  5. v-model:visible="visible"
  6. centered
  7. @cancel="cancel"
  8. width="890px">
  9. <template #footer>
  10. <a-button key="submit"
  11. class="cancelBtn"
  12. @click="cancel">取消</a-button>
  13. <a-button key="submit"
  14. type="primary"
  15. :loading="loading"
  16. @click="pass">审核通过</a-button>
  17. <a-button key="submit"
  18. type="primary"
  19. :loading="loading"
  20. @click="refuse">审核拒绝</a-button>
  21. </template>
  22. <a-form class="inlineForm"
  23. :form="form"
  24. @submit="handleSearch">
  25. <fieldset class="formFieldSet">
  26. <legend>基本信息</legend>
  27. <a-row :gutter="24">
  28. <a-col :span="12">
  29. <a-form-item label="计划类型">
  30. <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :span="12">
  34. <a-form-item label="计划名称">
  35. <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
  36. </a-form-item>
  37. </a-col>
  38. </a-row>
  39. <a-row :gutter="24">
  40. <a-col :span="12">
  41. <a-form-item label="现货品种">
  42. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  43. </a-form-item>
  44. </a-col>
  45. <a-col :span="12">
  46. <a-form-item label="标仓系数">
  47. <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
  48. </a-form-item>
  49. </a-col>
  50. </a-row>
  51. <a-row :gutter="24">
  52. <a-col :span="12">
  53. <a-form-item label="计划量">
  54. <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
  55. </a-form-item>
  56. </a-col>
  57. <a-col :span="12">
  58. <a-form-item label="备注">
  59. <span class="white">{{ formatValue(selectedRow.remark) }}</span>
  60. </a-form-item>
  61. </a-col>
  62. </a-row>
  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-form>
  87. </a-modal>
  88. </template>
  89. <script lang="ts">
  90. import { defineComponent, PropType, ref } from 'vue';
  91. import { closeModal } from '@/common/setup/modal/index';
  92. import { Modal } from 'ant-design-vue';
  93. import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
  94. import Long from 'long';
  95. import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
  96. import { getPlanContractType } from '@/views/business/plan/setup';
  97. import { formatValue } from '@/common/methods';
  98. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  99. import { hedgePlanReq } from '@/services/proto/hedgeplan';
  100. export default defineComponent({
  101. name: 'plan_audit_audit',
  102. components: {},
  103. props: {
  104. selectedRow: {
  105. type: Object as PropType<Ermcp3HedgePlan>,
  106. default: {},
  107. },
  108. },
  109. setup(props, context) {
  110. const { visible, cancel } = closeModal('plan_audit_audit');
  111. const loading = ref<boolean>(false);
  112. // 审核通过
  113. function pass() {
  114. Modal.confirm({
  115. title: '是否确认审核通过',
  116. okText: '审核通过',
  117. cancelText: '取消',
  118. onOk() {
  119. const params: ErmcpHedgePlanReq = {
  120. HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
  121. OperateType: 4,
  122. Remark: '通过',
  123. Currencyid: props.selectedRow.currencyid, // 结算币种id
  124. Tradeuserid: props.selectedRow.tradeuserid, // 交易用户id
  125. };
  126. requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['审核通过', '审核失败:']).then(() => {
  127. context.emit('refresh');
  128. cancel();
  129. });
  130. },
  131. onCancel() {
  132. console.log('Cancel');
  133. },
  134. });
  135. }
  136. // 审核拒绝
  137. function refuse() {
  138. Modal.confirm({
  139. title: '是否确认审核拒绝',
  140. okText: '审核拒绝',
  141. cancelText: '取消',
  142. onOk() {
  143. const params: ErmcpHedgePlanReq = {
  144. HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
  145. OperateType: 5,
  146. };
  147. requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['审核拒绝通过', '审核拒绝失败:']).then(() => {
  148. context.emit('refresh');
  149. cancel();
  150. });
  151. },
  152. onCancel() {
  153. console.log('Cancel');
  154. },
  155. });
  156. }
  157. return {
  158. visible,
  159. cancel,
  160. refuse,
  161. loading,
  162. pass,
  163. getPlanContractType,
  164. formatValue,
  165. };
  166. },
  167. });
  168. </script>
  169. <style lang="less">
  170. .warehouse-disable {
  171. }
  172. </style>