|
@@ -8,21 +8,24 @@
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
class="cancelBtn"
|
|
class="cancelBtn"
|
|
|
- @click="cancel">保存草稿
|
|
|
|
|
|
|
+ @click="submit(1)">保存草稿
|
|
|
</a-button>
|
|
</a-button>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
|
- @click="submit">提交审核</a-button>
|
|
|
|
|
|
|
+ @click="submit(2)">提交审核</a-button>
|
|
|
</template>
|
|
</template>
|
|
|
<a-form class="inlineForm"
|
|
<a-form class="inlineForm"
|
|
|
- ref="formRef">
|
|
|
|
|
|
|
+ ref="formRef"
|
|
|
|
|
+ :model="formState"
|
|
|
|
|
+ :rules="rules">
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
<a-form-item label="计划类型"
|
|
<a-form-item label="计划类型"
|
|
|
- name="">
|
|
|
|
|
|
|
+ name="ContractType">
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
|
|
+ v-model:value="formState.ContractType"
|
|
|
placeholder="请选择计划类型">
|
|
placeholder="请选择计划类型">
|
|
|
<a-select-option v-for="item in planTye"
|
|
<a-select-option v-for="item in planTye"
|
|
|
:value="item.enumitemname"
|
|
:value="item.enumitemname"
|
|
@@ -34,17 +37,20 @@
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
<a-form-item label="计划名称"
|
|
<a-form-item label="计划名称"
|
|
|
- name="">
|
|
|
|
|
|
|
+ name="HedgePlanNo">
|
|
|
<a-input class="dialogInput"
|
|
<a-input class="dialogInput"
|
|
|
|
|
+ v-model:value="formState.HedgePlanNo"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
placeholder="请输入计划名称" />
|
|
placeholder="请输入计划名称" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
<a-form-item label="现货品种"
|
|
<a-form-item label="现货品种"
|
|
|
- name="">
|
|
|
|
|
|
|
+ name="DeliveryGoodsID">
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
|
|
+ v-model:value="formState.DeliveryGoodsID"
|
|
|
|
|
+ @change="chooseMG"
|
|
|
placeholder="请选择现货品种">
|
|
placeholder="请选择现货品种">
|
|
|
<a-select-option v-for="item in DGList"
|
|
<a-select-option v-for="item in DGList"
|
|
|
:value="item.data.deliverygoodsid"
|
|
:value="item.data.deliverygoodsid"
|
|
@@ -55,25 +61,76 @@
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
|
|
+ <a-form-item label="品类"
|
|
|
|
|
+ name="WRStandardID">
|
|
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
|
|
+ style="width: 200px"
|
|
|
|
|
+ v-model:value="formState.WRStandardID"
|
|
|
|
|
+ placeholder="请选择品类">
|
|
|
|
|
+ <a-select-option v-for="item in gmlist"
|
|
|
|
|
+ :value="item.wrstandardid"
|
|
|
|
|
+ :key="item.wrstandardid">
|
|
|
|
|
+ {{item.wrstandardname}}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="12">
|
|
|
<a-form-item label="标仓系数"
|
|
<a-form-item label="标仓系数"
|
|
|
name="">
|
|
name="">
|
|
|
- <span class="white">1</span>
|
|
|
|
|
|
|
+ <a-input class="ConvertFactor"
|
|
|
|
|
+ v-model:value="formState.ConvertFactor"
|
|
|
|
|
+ readonly
|
|
|
|
|
+ style="width: 200px"
|
|
|
|
|
+ placeholder="请输入标仓系数" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
- <a-col :span="24">
|
|
|
|
|
|
|
+ <a-col :span="12">
|
|
|
<a-form-item label="计划量"
|
|
<a-form-item label="计划量"
|
|
|
class="relative"
|
|
class="relative"
|
|
|
- name="">
|
|
|
|
|
|
|
+ name="PlanQty">
|
|
|
<a-input class="dialogInput"
|
|
<a-input class="dialogInput"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
|
|
+ v-model:value="formState.PlanQty"
|
|
|
placeholder="请输入计划量" />
|
|
placeholder="请输入计划量" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <a-form-item label="交易用户"
|
|
|
|
|
+ name="Tradeuserid">
|
|
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
|
|
+ style="width: 200px"
|
|
|
|
|
+ v-model:value="formState.Tradeuserid"
|
|
|
|
|
+ placeholder="请选择交易用户">
|
|
|
|
|
+ <a-select-option v-for="item in traderList"
|
|
|
|
|
+ :value="item.roleid"
|
|
|
|
|
+ :key="item.roleid">
|
|
|
|
|
+ {{item.rolename}}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <a-form-item label="结算币种"
|
|
|
|
|
+ name="Currencyid">
|
|
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
|
|
+ style="width: 200px"
|
|
|
|
|
+ v-model:value="formState.Currencyid"
|
|
|
|
|
+ placeholder="请选择结算币种">
|
|
|
|
|
+ <a-select-option v-for="item in priceTyep"
|
|
|
|
|
+ :key="item.enumdicid"
|
|
|
|
|
+ :value="item.enumdicid">
|
|
|
|
|
+ {{item.enumdicname}}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-item label="备注"
|
|
<a-form-item label="备注"
|
|
|
class="relative"
|
|
class="relative"
|
|
|
- name="">
|
|
|
|
|
|
|
+ name="Remark">
|
|
|
<a-input class="dialogInput"
|
|
<a-input class="dialogInput"
|
|
|
|
|
+ v-model:value="formState.Remark"
|
|
|
style="width: 636px"
|
|
style="width: 636px"
|
|
|
placeholder="请输入备注" />
|
|
placeholder="请输入备注" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -84,29 +141,52 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, ref, toRaw } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import { initData } from '@/common/methods/index';
|
|
import { initData } from '@/common/methods/index';
|
|
|
-import { getSpotContractTypeEnumList } from '@/common/constants/enumsList';
|
|
|
|
|
|
|
+import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
|
|
|
import { AllEnums } from '@/services/go/commonService/interface';
|
|
import { AllEnums } from '@/services/go/commonService/interface';
|
|
|
import { getAllEnum } from '@/services/bus/allEnum';
|
|
import { getAllEnum } from '@/services/bus/allEnum';
|
|
|
-import { getMiddleGoodsD } from '../setup';
|
|
|
|
|
|
|
+import { 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';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'add-custom',
|
|
name: 'add-custom',
|
|
|
components: {},
|
|
components: {},
|
|
|
- setup() {
|
|
|
|
|
|
|
+ setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('plan_btn_add');
|
|
const { visible, cancel } = closeModal('plan_btn_add');
|
|
|
const planTye = ref<AllEnums[]>(getSpotContractTypeEnumList());
|
|
const planTye = ref<AllEnums[]>(getSpotContractTypeEnumList());
|
|
|
// const arr = getAllEnum().filter((e) => e.enumdicname === '销售');
|
|
// const arr = getAllEnum().filter((e) => e.enumdicname === '销售');
|
|
|
// console.log('arr', arr);
|
|
// console.log('arr', arr);
|
|
|
- const { DGList, getDG } = getMiddleGoodsD();
|
|
|
|
|
|
|
+ // 品种、品类
|
|
|
|
|
+ const { DGList, getDG, gmlist, chooseMG } = getMiddleGoodsD();
|
|
|
|
|
+ // 交易用户
|
|
|
|
|
+ const { traderList, getRoleList } = handleTrader();
|
|
|
|
|
+ // 币种
|
|
|
|
|
+ const priceTyep = getPayCurrencyTypeEnumList();
|
|
|
|
|
+ // 表单
|
|
|
|
|
+ const { formRef, formState, rules } = handleForm();
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
- function submit() {
|
|
|
|
|
- cancel();
|
|
|
|
|
|
|
+ function submit(OperateType: 1 | 2) {
|
|
|
|
|
+ formRef.value
|
|
|
|
|
+ .validate()
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ const param = toRaw(formState);
|
|
|
|
|
+ // addAction(param).then(() => {
|
|
|
|
|
+ // cancel();
|
|
|
|
|
+ // context.emit('refresh', true);
|
|
|
|
|
+ // });
|
|
|
|
|
+ console.log('param', param);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
|
|
+ console.log('error', error);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
initData(() => {
|
|
initData(() => {
|
|
|
getDG();
|
|
getDG();
|
|
|
|
|
+ getRoleList();
|
|
|
});
|
|
});
|
|
|
return {
|
|
return {
|
|
|
visible,
|
|
visible,
|
|
@@ -115,6 +195,13 @@ export default defineComponent({
|
|
|
loading,
|
|
loading,
|
|
|
planTye,
|
|
planTye,
|
|
|
DGList,
|
|
DGList,
|
|
|
|
|
+ gmlist,
|
|
|
|
|
+ chooseMG,
|
|
|
|
|
+ traderList,
|
|
|
|
|
+ priceTyep,
|
|
|
|
|
+ formRef,
|
|
|
|
|
+ formState,
|
|
|
|
|
+ rules,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|