|
@@ -1,19 +1,17 @@
|
|
|
-import {validateCommon} from '@/common/setup/validate';
|
|
|
|
|
-import {getItemEnum} from '@/services/bus/allEnum';
|
|
|
|
|
-import {QueryCustomInfo} from '@/services/go/ermcp/customInfo';
|
|
|
|
|
-import {QueryCustomInfoType} from '@/services/go/ermcp/customInfo/interface';
|
|
|
|
|
-import {QueryDeliveryGoods, QueryDeliveryGoodsDetail} from '@/services/go/ermcp/goodsInfo';
|
|
|
|
|
-import {Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsRsp} from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
|
|
-import {message} from 'ant-design-vue';
|
|
|
|
|
-import {RuleObject} from 'ant-design-vue/lib/form/interface';
|
|
|
|
|
-import moment, {Moment} from 'moment';
|
|
|
|
|
-import {reactive, ref, UnwrapRef} from 'vue';
|
|
|
|
|
-import {FormState} from "./interface";
|
|
|
|
|
-import {changeOrderContract} from "@/views/information/spot-contract/components/setup";
|
|
|
|
|
-import {GldErmcpSpotContractOperateReq, GldSpotContractInfo} from "@/services/proto/spotcontract/interface";
|
|
|
|
|
-import {getServerTime} from "@/services/go/commonService";
|
|
|
|
|
|
|
+import { validateCommon } from '@/common/setup/validate';
|
|
|
import APP from "@/services";
|
|
import APP from "@/services";
|
|
|
-import {orderContract} from "@/services/proto/spotcontract";
|
|
|
|
|
|
|
+import { getItemEnum } from '@/services/bus/allEnum';
|
|
|
|
|
+import { QueryCustomInfo } from '@/services/go/ermcp/customInfo';
|
|
|
|
|
+import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
|
|
|
|
|
+import { QueryDeliveryGoods, QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
|
|
|
|
|
+import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsRsp } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
|
|
+import { GldSpotContractInfo } from "@/services/proto/spotcontract/interface";
|
|
|
|
|
+import { changeOrderContract } from "@/views/information/spot-contract/components/setup";
|
|
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
|
|
+import { RuleObject } from 'ant-design-vue/lib/form/interface';
|
|
|
|
|
+import moment, { Moment } from 'moment';
|
|
|
|
|
+import { reactive, ref, UnwrapRef } from 'vue';
|
|
|
|
|
+import { FormState } from "./interface";
|
|
|
|
|
|
|
|
export function handleFromState() {
|
|
export function handleFromState() {
|
|
|
const formState: UnwrapRef<FormState> = reactive({
|
|
const formState: UnwrapRef<FormState> = reactive({
|
|
@@ -48,17 +46,17 @@ export function handleFromState() {
|
|
|
})
|
|
})
|
|
|
// 业务类型
|
|
// 业务类型
|
|
|
const businessType = [
|
|
const businessType = [
|
|
|
- {key: 1, value: '套保'},
|
|
|
|
|
- {key: 2, value: '套利'},
|
|
|
|
|
|
|
+ { key: 1, value: '套保' },
|
|
|
|
|
+ { key: 2, value: '套利' },
|
|
|
];
|
|
];
|
|
|
- return {formState, businessType}
|
|
|
|
|
|
|
+ return { formState, businessType }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 新增现货合同 表单提交
|
|
* 新增现货合同 表单提交
|
|
|
*/
|
|
*/
|
|
|
export function addContractReq() {
|
|
export function addContractReq() {
|
|
|
- const {loading, orderContractState} = changeOrderContract()
|
|
|
|
|
|
|
+ const { loading, orderContractState } = changeOrderContract()
|
|
|
/**
|
|
/**
|
|
|
* @param form 表单信息
|
|
* @param form 表单信息
|
|
|
* @Param type 1: 保存草稿 2: 提交申请
|
|
* @Param type 1: 保存草稿 2: 提交申请
|
|
@@ -89,7 +87,7 @@ export function addContractReq() {
|
|
|
// ContractAttachment: , // 合同附件
|
|
// ContractAttachment: , // 合同附件
|
|
|
ContractMargin: form.ContractMargin as number, // 合同保证金
|
|
ContractMargin: form.ContractMargin as number, // 合同保证金
|
|
|
|
|
|
|
|
- Amount: [1,3].includes(form.PriceType) ? Number(form.Price) * Number(form.Qty) : 0, // 金额
|
|
|
|
|
|
|
+ Amount: [1, 3].includes(form.PriceType) ? Number(form.Price) * Number(form.Qty) : 0, // 金额
|
|
|
PriceMove: form.PriceMove as number, // 升贴水
|
|
PriceMove: form.PriceMove as number, // 升贴水
|
|
|
|
|
|
|
|
StartDate: form.StartDate, // 点价开始时间
|
|
StartDate: form.StartDate, // 点价开始时间
|
|
@@ -103,7 +101,6 @@ export function addContractReq() {
|
|
|
// TradeUserID: form.TradeUserID, // 交易员ID
|
|
// TradeUserID: form.TradeUserID, // 交易员ID
|
|
|
// SaleUserID: form.SaleUserID,// 业务员id
|
|
// SaleUserID: form.SaleUserID,// 业务员id
|
|
|
}
|
|
}
|
|
|
- debugger
|
|
|
|
|
return orderContractState('0', type, info)
|
|
return orderContractState('0', type, info)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
return Promise.resolve(res);
|
|
return Promise.resolve(res);
|
|
@@ -113,7 +110,7 @@ export function addContractReq() {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return {loading, sendReq}
|
|
|
|
|
|
|
+ return { loading, sendReq }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -122,8 +119,8 @@ export function addContractReq() {
|
|
|
export function handleContract() {
|
|
export function handleContract() {
|
|
|
// 合同类型
|
|
// 合同类型
|
|
|
const contractType = [
|
|
const contractType = [
|
|
|
- {key: 1, value: '采购'},
|
|
|
|
|
- {key: -1, value: '销售'},
|
|
|
|
|
|
|
+ { key: 1, value: '采购' },
|
|
|
|
|
+ { key: -1, value: '销售' },
|
|
|
];
|
|
];
|
|
|
const isSell = ref<boolean>(false) // true => 销售 false => 采购
|
|
const isSell = ref<boolean>(false) // true => 销售 false => 采购
|
|
|
/**
|
|
/**
|
|
@@ -146,7 +143,7 @@ export function handleContract() {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return {contractType, isSell, contractChange, customList, queryCustomList}
|
|
|
|
|
|
|
+ return { contractType, isSell, contractChange, customList, queryCustomList }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -289,9 +286,9 @@ export function handleDeliveryGoods(formState: UnwrapRef<FormState>) {
|
|
|
export function handlePrice(formState: UnwrapRef<FormState>) {
|
|
export function handlePrice(formState: UnwrapRef<FormState>) {
|
|
|
// 定价类型
|
|
// 定价类型
|
|
|
const priceType = [
|
|
const priceType = [
|
|
|
- {key: 1, value: '一口价'},
|
|
|
|
|
- {key: 2, value: '点价'},
|
|
|
|
|
- {key: 3, value: '暂定价'},
|
|
|
|
|
|
|
+ { key: 1, value: '一口价' },
|
|
|
|
|
+ { key: 2, value: '点价' },
|
|
|
|
|
+ { key: 3, value: '暂定价' },
|
|
|
];
|
|
];
|
|
|
// 币种
|
|
// 币种
|
|
|
const payCurrency = getItemEnum('paycurrency')
|
|
const payCurrency = getItemEnum('paycurrency')
|
|
@@ -307,13 +304,7 @@ export function handlePrice(formState: UnwrapRef<FormState>) {
|
|
|
// payCurrencyUnit.value = obj?.enumdicname
|
|
// payCurrencyUnit.value = obj?.enumdicname
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return {priceType, payCurrency, payCurrencyUnit, parCurrencyChange}
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-export function handleAddAction() {
|
|
|
|
|
- function addAction() {
|
|
|
|
|
- // orderContract()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ return { priceType, payCurrency, payCurrencyUnit, parCurrencyChange }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -330,5 +321,15 @@ export function handleDate() {
|
|
|
return current && current < moment().endOf('day');
|
|
return current && current < moment().endOf('day');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return {deliveryDate, priceDate, disabledDate}
|
|
|
|
|
|
|
+ return { deliveryDate, priceDate, disabledDate }
|
|
|
}
|
|
}
|
|
|
|
|
+/**
|
|
|
|
|
+ * 处理金额
|
|
|
|
|
+ */
|
|
|
|
|
+export function handleAmout(formState: UnwrapRef<FormState>) {
|
|
|
|
|
+ function getAmout() {
|
|
|
|
|
+ const { Price, Qty } = formState
|
|
|
|
|
+ formState.Amount = (Price && Qty) ? Price * Qty : 0
|
|
|
|
|
+ }
|
|
|
|
|
+ return { getAmout }
|
|
|
|
|
+}
|