|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<!-- 现货参考价-修改-->
|
|
|
<a-modal class="add-custom custom-detail" title="修改现货参考价" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
|
|
|
- <a-form class="inlineForm" :form="form" @submit="handleSearch">
|
|
|
+ <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
|
|
|
<fieldset class="formFieldSet">
|
|
|
<legend>现货市价信息</legend>
|
|
|
<a-row :gutter="24">
|
|
|
@@ -23,8 +23,8 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="结算币种" name="currencyid">
|
|
|
- <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择结算币种" v-model:value="formState.currencyid">
|
|
|
+ <a-form-item label="结算币种" name="CurrencyID">
|
|
|
+ <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择结算币种" v-model:value="formState.CurrencyID">
|
|
|
<a-select-option v-for="option in currencyList" :key="option.enumitemname" :value="option.enumitemname">{{ option.enumdicname }}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
@@ -32,8 +32,8 @@
|
|
|
</a-row>
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="24">
|
|
|
- <a-form-item label="现货价格" name="spotgoodsprice">
|
|
|
- <a-input-number class="dialogInput" style="width: 200px" v-model:value="formState.spotgoodsprice" :min="0" placeholder="请输入现货价格" />
|
|
|
+ <a-form-item label="现货价格" name="SpotGoodsPrice">
|
|
|
+ <a-input-number class="dialogInput" style="width: 200px" v-model:value="formState.SpotGoodsPrice" :min="0" placeholder="请输入现货价格" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
@@ -47,12 +47,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, PropType, ref } from 'vue';
|
|
|
+import { defineComponent, PropType, ref, reactive, UnwrapRef } from 'vue';
|
|
|
import { formatValue } from '@/common/methods';
|
|
|
-import { Modal } from 'ant-design-vue';
|
|
|
import { Ermcp3SpotGoodsPrice } from '@/services/go/ermcp/qhj/interface';
|
|
|
+import { ErmcpSpotGoodsPriceReq } from '@/services/proto/delivery/interface';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
import { getPayCurrencyTypeEnumList } from '@/common/constants/enumsList';
|
|
|
+import { validateAction } from '@/common/setup/form';
|
|
|
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
+import { ermcpSpotGoodsPrice } from '@/services/proto/delivery';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'spotmarket_price_modify',
|
|
|
@@ -66,26 +69,45 @@ export default defineComponent({
|
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
const loading = ref<boolean>(false);
|
|
|
+ const formRef = ref();
|
|
|
|
|
|
- const formState = ref<{ [key: string]: number | null }>({
|
|
|
- currencyid: props.selectedRow.currencyid,
|
|
|
- spotgoodsprice: props.selectedRow.spotgoodsprice,
|
|
|
+ // 选择币种列表
|
|
|
+ const currencyList = getPayCurrencyTypeEnumList();
|
|
|
+
|
|
|
+ const { deliverygoodsid, wrstandardid, spotgoodsbrandid, tradedate, currencyid, spotgoodsprice } = props.selectedRow;
|
|
|
+ const formState: UnwrapRef<ErmcpSpotGoodsPriceReq> = reactive({
|
|
|
+ DeliveryGoodsID: deliverygoodsid,
|
|
|
+ WRStandardID: wrstandardid,
|
|
|
+ SpotGoodsBrandID: spotgoodsbrandid,
|
|
|
+ CurrencyID: currencyid,
|
|
|
+ SpotGoodsPrice: spotgoodsprice,
|
|
|
+ TradeDate: tradedate,
|
|
|
});
|
|
|
|
|
|
- const currencyList = getPayCurrencyTypeEnumList();
|
|
|
+ // 表单验证规则
|
|
|
+ const rules = {
|
|
|
+ CurrencyID: [{ required: true, message: '请选择结算币种', trigger: 'change', type: 'number' }],
|
|
|
+ SpotGoodsPrice: [{ required: true, message: '请输入现货价格', trigger: 'blur', type: 'number' }],
|
|
|
+ };
|
|
|
|
|
|
- // 审核通过
|
|
|
+ // 提交
|
|
|
function submit() {
|
|
|
- // 提交
|
|
|
+ validateAction<ErmcpSpotGoodsPriceReq>(formRef, formState).then((res) => {
|
|
|
+ requestResultLoadingAndInfo(ermcpSpotGoodsPrice, res, loading, ['修改现货参考价成功', '修改现货参考价失败:']).then(() => {
|
|
|
+ cancel(true);
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
visible,
|
|
|
+ formRef,
|
|
|
cancel,
|
|
|
submit,
|
|
|
loading,
|
|
|
formatValue,
|
|
|
formState,
|
|
|
+ rules,
|
|
|
currencyList,
|
|
|
};
|
|
|
},
|