|
@@ -5,7 +5,7 @@
|
|
|
v-model:visible="visible"
|
|
v-model:visible="visible"
|
|
|
centered
|
|
centered
|
|
|
:maskClosable="maskClosableFlag"
|
|
:maskClosable="maskClosableFlag"
|
|
|
- @cancel="cancel"
|
|
|
|
|
|
|
+ @cancel="closeAction"
|
|
|
width="890px">
|
|
width="890px">
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
@@ -220,8 +220,8 @@
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
placeholder="请选择结算币种">
|
|
placeholder="请选择结算币种">
|
|
|
<a-select-option v-for="item in payCurrency"
|
|
<a-select-option v-for="item in payCurrency"
|
|
|
- :key="item.enumitemname"
|
|
|
|
|
- :value="item.enumitemname">
|
|
|
|
|
|
|
+ :key="item.enumdicid"
|
|
|
|
|
+ :value="item.enumdicid">
|
|
|
{{item.enumdicname}}
|
|
{{item.enumdicname}}
|
|
|
</a-select-option>
|
|
</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
@@ -354,9 +354,9 @@
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
placeholder="请选择业务员">
|
|
placeholder="请选择业务员">
|
|
|
<a-select-option v-for="item in businesserList"
|
|
<a-select-option v-for="item in businesserList"
|
|
|
- :key="item.id"
|
|
|
|
|
- :value="item.id">
|
|
|
|
|
- {{item.name}}
|
|
|
|
|
|
|
+ :key="item.loginid"
|
|
|
|
|
+ :value="item.loginid">
|
|
|
|
|
+ {{item.accountname}}-{{item.logincode}}
|
|
|
</a-select-option>
|
|
</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -371,9 +371,9 @@
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
placeholder="请选择跟单员">
|
|
placeholder="请选择跟单员">
|
|
|
<a-select-option v-for="item in merchandiserList"
|
|
<a-select-option v-for="item in merchandiserList"
|
|
|
- :key="item.id"
|
|
|
|
|
- :value="item.id">
|
|
|
|
|
- {{item.name}}
|
|
|
|
|
|
|
+ :key="item.loginid"
|
|
|
|
|
+ :value="item.loginid">
|
|
|
|
|
+ {{item.accountname}}-{{item.logincode}}
|
|
|
</a-select-option>
|
|
</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -386,9 +386,9 @@
|
|
|
v-model:value="formState.TradeUserID"
|
|
v-model:value="formState.TradeUserID"
|
|
|
placeholder="请选择期货账户">
|
|
placeholder="请选择期货账户">
|
|
|
<a-select-option v-for="item in traderList"
|
|
<a-select-option v-for="item in traderList"
|
|
|
- :key="item.id"
|
|
|
|
|
- :value="item.id">
|
|
|
|
|
- {{item.name}}
|
|
|
|
|
|
|
+ :key="item.roleid"
|
|
|
|
|
+ :value="item.roleid">
|
|
|
|
|
+ {{item.rolename}}
|
|
|
</a-select-option>
|
|
</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -396,9 +396,11 @@
|
|
|
</a-row>
|
|
</a-row>
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
- <a-form-item label="备注">
|
|
|
|
|
|
|
+ <a-form-item label="备注"
|
|
|
|
|
+ name="Remark">
|
|
|
<a-input class="dialogInput"
|
|
<a-input class="dialogInput"
|
|
|
style="width: 608px"
|
|
style="width: 608px"
|
|
|
|
|
+ v-model:value="formState.Remark"
|
|
|
placeholder="请输入备注" />
|
|
placeholder="请输入备注" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
@@ -409,7 +411,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, PropType, ref, toRaw } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import { initData } from '@/common/methods';
|
|
import { initData } from '@/common/methods';
|
|
|
import { addContractReq } from './setup';
|
|
import { addContractReq } from './setup';
|
|
@@ -420,10 +422,11 @@ import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
|
|
|
import { FormState } from '../interface';
|
|
import { FormState } from '../interface';
|
|
|
import { formatTime } from '@/common/methods/format';
|
|
import { formatTime } from '@/common/methods/format';
|
|
|
import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
|
|
import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
|
|
|
-import { handleAccountManager } from '../setup';
|
|
|
|
|
import { Moment } from 'moment';
|
|
import { Moment } from 'moment';
|
|
|
import { handleFormRule, handleContract, handleDeliveryGoods, handleAmout, handlePrice, handleDate, handleFromState } from '../setup';
|
|
import { handleFormRule, handleContract, handleDeliveryGoods, handleAmout, handlePrice, handleDate, handleFromState } from '../setup';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
|
|
+import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
|
|
|
|
|
+import { handlerManagerList } from '@/common/setup/user';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'add-spot-contract',
|
|
name: 'add-spot-contract',
|
|
@@ -454,11 +457,29 @@ export default defineComponent({
|
|
|
const { deliveryDate, priceDate, disabledDate } = handleDate();
|
|
const { deliveryDate, priceDate, disabledDate } = handleDate();
|
|
|
// 处理金额
|
|
// 处理金额
|
|
|
const { getAmout } = handleAmout(formState);
|
|
const { getAmout } = handleAmout(formState);
|
|
|
- // 账号列表: 交易用户 业务员 跟单员
|
|
|
|
|
- const { traderList, businesserList, merchandiserList, getRoleList, getBusinesserList } = handleAccountManager();
|
|
|
|
|
|
|
+ // 获取 业务账户
|
|
|
|
|
+ const { queryTable: queryBusinessManager, getBusinesserOrMerchandiser } = handlerManagerList(loading, 1);
|
|
|
|
|
+ const { tableList: traderList, queryTable: queryTradeManager } = handlerManagerList(loading, 2, true);
|
|
|
|
|
+ // 业务员
|
|
|
|
|
+ const businesserList = ref<ErmcpLoginUser[]>([]);
|
|
|
|
|
+ // 跟单员
|
|
|
|
|
+ const merchandiserList = ref<ErmcpLoginUser[]>([]);
|
|
|
// 现货商品列表
|
|
// 现货商品列表
|
|
|
const goodsList = ref<Goods[]>([]);
|
|
const goodsList = ref<Goods[]>([]);
|
|
|
|
|
+ watchEffect(() => {
|
|
|
|
|
+ if (visible.value) {
|
|
|
|
|
+ console.log('merchandiserList', merchandiserList);
|
|
|
|
|
|
|
|
|
|
+ queryCustomList();
|
|
|
|
|
+ getDeliveryGoods();
|
|
|
|
|
+ queryTradeManager();
|
|
|
|
|
+ goodsList.value = getGoodsList();
|
|
|
|
|
+ queryBusinessManager().then(() => {
|
|
|
|
|
+ businesserList.value = getBusinesserOrMerchandiser('22');
|
|
|
|
|
+ merchandiserList.value = getBusinesserOrMerchandiser('23');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
function submit(OperateType: 1 | 2) {
|
|
function submit(OperateType: 1 | 2) {
|
|
|
validateAction<FormState>(formRef, formState).then((param) => {
|
|
validateAction<FormState>(formRef, formState).then((param) => {
|
|
|
const id = getUsrId();
|
|
const id = getUsrId();
|
|
@@ -484,25 +505,21 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
sendReq(param, loading, OperateType)
|
|
sendReq(param, loading, OperateType)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
- //清空添加成功后的数据,确保在此新增打开是个空数据
|
|
|
|
|
- Object.assign(formState, initFormData());
|
|
|
|
|
context.emit('refresh');
|
|
context.emit('refresh');
|
|
|
- cancel();
|
|
|
|
|
|
|
+ closeAction();
|
|
|
})
|
|
})
|
|
|
.catch((err) => {});
|
|
.catch((err) => {});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ function closeAction() {
|
|
|
|
|
+ //清空添加成功后的数据,确保在此新增打开是个空数据
|
|
|
|
|
+ Object.assign(formState, initFormData());
|
|
|
|
|
+ cancel();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- initData(() => {
|
|
|
|
|
- queryCustomList();
|
|
|
|
|
- getDeliveryGoods();
|
|
|
|
|
- goodsList.value = getGoodsList();
|
|
|
|
|
- getRoleList();
|
|
|
|
|
- getBusinesserList();
|
|
|
|
|
- });
|
|
|
|
|
return {
|
|
return {
|
|
|
visible,
|
|
visible,
|
|
|
- cancel,
|
|
|
|
|
|
|
+ closeAction,
|
|
|
submit,
|
|
submit,
|
|
|
formRef,
|
|
formRef,
|
|
|
loading,
|
|
loading,
|