index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <!-- 现货合同正常完结-->
  3. <a-modal class="commonModal custom-finish"
  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">取消</a-button>
  14. <a-button key="submit"
  15. type="primary"
  16. :loading="loading"
  17. @click="submit">确认完结</a-button>
  18. </template>
  19. <InfoDetail :selectedRow="selectedRow" />
  20. </a-modal>
  21. </template>
  22. <script lang="ts">
  23. import { defineComponent, PropType, ref } from 'vue';
  24. import { closeModal } from '@/common/setup/modal/index';
  25. import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
  26. import { orderContractOperateControl } from '@/views/information/spot-contract/components/setup';
  27. import { Modal } from 'ant-design-vue';
  28. import { SpotContractOperateReq } from '@/services/proto/spotcontract/interface';
  29. import InfoDetail from '../infoDetail/index.vue';
  30. import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
  31. import {orderContract, spotContractStatus} from "@/services/proto/spotcontract";
  32. export default defineComponent({
  33. name: 'spot-contract-finish',
  34. components: { InfoDetail },
  35. props: {
  36. selectedRow: {
  37. type: Object as PropType<Ermcp3ContractRsp>,
  38. default: {},
  39. },
  40. },
  41. setup(props, context) {
  42. const { visible, cancel } = closeModal('spot_contract_btn_finish');
  43. const maskClosableFlag = ref<boolean>(false);
  44. const loading = ref<boolean>(false);
  45. function submit() {
  46. context.emit('refresh');
  47. Modal.confirm({
  48. title: '是否确认完结',
  49. okText: '确认完结',
  50. cancelText: '取消',
  51. onOk() {
  52. const reqParam: SpotContractOperateReq = {
  53. SpotContractID: props.selectedRow.spotcontractid,
  54. OperateType: 6,
  55. Remark: '',
  56. };
  57. // Fixme 6/4 代码修改
  58. // 合同完结 SpotContractOperateReq operateType 操作类型-1:保存草稿(作废)2:提交申请(作废)3:审核通过4:审核拒绝(作废)5:撤回(作废)6:正常完结7:异常终止
  59. requestResultLoadingAndInfo(spotContractStatus, reqParam, loading, ['合同正常完结', '合同完结失败:']).then(() => {
  60. context.emit('refresh');
  61. cancel();
  62. });
  63. },
  64. onCancel() {
  65. console.log('Cancel');
  66. },
  67. });
  68. }
  69. return {
  70. visible,
  71. cancel,
  72. submit,
  73. loading,
  74. maskClosableFlag,
  75. };
  76. },
  77. });
  78. </script>
  79. <style lang="less">
  80. .custom-finish {
  81. .upload {
  82. .look {
  83. margin-left: 0;
  84. }
  85. }
  86. }
  87. </style>;