index.vue 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <!-- 现货合同正常完结-->
  3. <a-modal class="commonModal custom-finish"
  4. title="现货合同正常完结"
  5. v-model:visible="visible"
  6. centered
  7. :maskClosable="false"
  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. :businessManager="businessManager" />
  21. </a-modal>
  22. </template>
  23. <script lang="ts">
  24. import { defineComponent, PropType, ref } from 'vue';
  25. import { closeModal } from '@/common/setup/modal/index';
  26. import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
  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 { 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. });
  66. }
  67. return {
  68. visible,
  69. cancel,
  70. submit,
  71. loading,
  72. maskClosableFlag,
  73. };
  74. },
  75. });
  76. </script>
  77. <style lang="less">
  78. .custom-finish {
  79. .upload {
  80. .look {
  81. margin-left: 0;
  82. }
  83. }
  84. }
  85. </style>;