|
|
@@ -143,14 +143,21 @@
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, ref, toRaw } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
-import { initData } from '@/common/methods/index';
|
|
|
+import {formatTime, initData} from '@/common/methods/index';
|
|
|
import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
|
|
|
import { AllEnums } from '@/services/go/commonService/interface';
|
|
|
import { getAllEnum } from '@/services/bus/allEnum';
|
|
|
-import { getMiddleGoodsD, handleForm, handleTrader } from '../setup';
|
|
|
+import {changeStatus, getMiddleGoodsD, handleForm, handleTrader} from '../setup';
|
|
|
import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
|
|
|
import { FormState } from '@/views/information/spot-contract/components/interface';
|
|
|
import { context } from 'ant-design-vue/lib/vc-image/src/PreviewGroup';
|
|
|
+import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
|
|
|
+import {hedgePlanReq} from "@/services/proto/hedgeplan";
|
|
|
+import {getLongTypeLoginID} from "@/services/bus/login";
|
|
|
+import {LongType} from "@/services/socket/login/interface";
|
|
|
+import moment from "moment";
|
|
|
+import APP from "@/services";
|
|
|
+import * as Long from "long";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'add-custom',
|
|
|
@@ -174,10 +181,29 @@ export default defineComponent({
|
|
|
.validate()
|
|
|
.then(() => {
|
|
|
const param = toRaw(formState);
|
|
|
- // addAction(param).then(() => {
|
|
|
- // cancel();
|
|
|
- // context.emit('refresh', true);
|
|
|
- // });
|
|
|
+ const loginId = getLongTypeLoginID() as LongType;
|
|
|
+ const userid = APP.get('userAccount').memberuserid;
|
|
|
+ const reqParam: ErmcpHedgePlanReq = {
|
|
|
+ HedgePlanNo: param.HedgePlanNo, // 计划类型
|
|
|
+ ContractType: param.ContractType, // 计划类型
|
|
|
+ DeliveryGoodsID: Number(param.DeliveryGoodsID),
|
|
|
+ WRStandardID: Number(param.WRStandardID), // 现货品种
|
|
|
+ PlanQty: Number(param.PlanQty), // 计划数量
|
|
|
+ OperateType: OperateType,
|
|
|
+ Currencyid: param.Currencyid,
|
|
|
+ ApplyId: Number(loginId),
|
|
|
+ PlanTime: formatTime(moment(), "s"),
|
|
|
+ ProductType: 1,
|
|
|
+ Biztype: 1,
|
|
|
+ AreaUserID: userid,
|
|
|
+ Remark: param.Remark,
|
|
|
+ Tradeuserid: param.Tradeuserid, // 交易用户id
|
|
|
+ }
|
|
|
+ changeStatus(reqParam, OperateType, loading)
|
|
|
+ .then(() => {
|
|
|
+ cancel();
|
|
|
+ context.emit('refresh', true);
|
|
|
+ });
|
|
|
console.log('param', param);
|
|
|
})
|
|
|
.catch((error: ValidateErrorEntity<FormState>) => {
|