|
|
@@ -37,11 +37,13 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="修改后套保比例">
|
|
|
- <!-- <a-input class="dialogInput"
|
|
|
- v-model:value="domain.wrstandardname"
|
|
|
- placeholder="请输入品类"></a-input> -->
|
|
|
- <span class="white"></span>
|
|
|
+ <a-form-item label="修改后套保比例"
|
|
|
+ name="needhedgeratio">
|
|
|
+ <a-input-number class="dialogInput"
|
|
|
+ style="width: 200px"
|
|
|
+ type="number"
|
|
|
+ placeholder="请输入套保比例"
|
|
|
+ v-model:value="formState.needhedgeratio" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
@@ -61,12 +63,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, PropType, ref } from 'vue';
|
|
|
+import { defineComponent, PropType, ref, toRaw } from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import { initData } from '@/common/methods/index';
|
|
|
import { initMG } from '../../list/hedging-variety/setup';
|
|
|
import { Ermcp3MiddleGoodsDetail2 } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
import { getGoodsUnitEnumItemName } from '@/common/constants/enumsName';
|
|
|
+import { handleForm } from './setup';
|
|
|
+import { ermsMiddelGoodsEdit } from '@/services/proto/delivery';
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
+import { ErmsMiddelGoodsEditReq } from '@/services/proto/delivery/interface';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'modify-custom',
|
|
|
@@ -78,13 +84,45 @@ export default defineComponent({
|
|
|
},
|
|
|
},
|
|
|
|
|
|
- setup(props) {
|
|
|
+ setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('goods_info_hedge_normal_modify');
|
|
|
- console.log('selctedMG', props.selctedMG);
|
|
|
+
|
|
|
+ const { rules, formState, formRef } = handleForm();
|
|
|
|
|
|
const loading = ref<boolean>(false);
|
|
|
function submit() {
|
|
|
- cancel();
|
|
|
+ formRef.value
|
|
|
+ .validate()
|
|
|
+ .then(() => {
|
|
|
+ loading.value = true;
|
|
|
+ const { middlegoodsid, goodsunitid, relatedgoodsid, evaluateratio, qtydecimalplace, relatedgoodstype, goodsgroupid, remark } = props.selctedMG.mg;
|
|
|
+ const param: ErmsMiddelGoodsEditReq = {
|
|
|
+ middlegoodsid, // uint64 套保品种ID
|
|
|
+ goodsunitid, // int32 单位ID
|
|
|
+ relatedgoodsid, // uint64 关联交易商品ID
|
|
|
+ evaluateratio, // double 估价系数
|
|
|
+ qtydecimalplace, // int32 数量小数位
|
|
|
+ // modifierid,// uint64 修改人
|
|
|
+ relatedgoodstype, // int32 关联商品类型 - 1:期货合约 2:现货品种
|
|
|
+ needhedgeratio: formState.needhedgeratio as number, // double 套保比率
|
|
|
+ // areauserid?,// uint64 机构用户ID
|
|
|
+ goodsgroupid, // uint64 关联期货品种ID
|
|
|
+ remark, // string 备注
|
|
|
+ };
|
|
|
+ ermsMiddelGoodsEdit(param)
|
|
|
+ .then(() => {
|
|
|
+ message.success('修改成功!');
|
|
|
+ cancel();
|
|
|
+ context.emit('refresh', true);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ message.error(err);
|
|
|
+ })
|
|
|
+ .finally(() => (loading.value = false));
|
|
|
+ })
|
|
|
+ .catch((error: any) => {
|
|
|
+ console.log('error', error);
|
|
|
+ });
|
|
|
}
|
|
|
initData(() => {});
|
|
|
return {
|
|
|
@@ -94,6 +132,9 @@ export default defineComponent({
|
|
|
loading,
|
|
|
maskClosableFlag: false,
|
|
|
getGoodsUnitEnumItemName,
|
|
|
+ rules,
|
|
|
+ formState,
|
|
|
+ formRef,
|
|
|
};
|
|
|
},
|
|
|
});
|