marymelisa vor 4 Jahren
Ursprung
Commit
4b6e3bf995

+ 7 - 7
src/services/proto/delivery/index.ts

@@ -18,7 +18,7 @@ export const addDeliveryGoodsApply = (param: DeliveryGoodsApplyReq): Promise<any
         const req = {
             version: "3.2",
             userid: getUserId(),
-            loginid: getLongTypeLoginID() ,
+            loginid: getLongTypeLoginID(),
         };
         const params = {
             protobufName: 'DeliveryGoodsApplyReq',
@@ -49,15 +49,15 @@ export const addDeliveryGoodsApply = (param: DeliveryGoodsApplyReq): Promise<any
  * 修改套保品种请求 ErmsMiddelGoodsEditReq 只能修改比率 但是其它参数也必须传
  */
 export const ermsMiddelGoodsEdit = (param: ErmsMiddelGoodsEditReq): Promise<any> => {
-
-    param.areauserid = APP.get('userInfo').MemberUserid // 机构用户id
-
+    param.areauserid = APP.get('userAccount').memberuserid // 机构用户id
     return new Promise((resolve, reject) => {
+        const userid = getUserId()
         const req = {
             version: "3.2",
-            userid: getUserId(),
-            loginid: getLongTypeLoginID() ,
+            userid,
+            loginid: getLongTypeLoginID(),
         };
+        param.modifierid = userid
         const params = {
             protobufName: 'ErmsMiddelGoodsEditReq',
             funCodeName: 'ErmsMiddelGoodsEditReq',
@@ -92,7 +92,7 @@ export const deliveryGoodsCancel = (param: DeliveryGoodsCancelReq): Promise<any>
         const req = {
             version: "3.2",
             userid: getUserId(),
-            loginid: getLongTypeLoginID() ,
+            loginid: getLongTypeLoginID(),
         };
         const params = {
             protobufName: 'DeliveryGoodsCancelReq',

+ 1 - 1
src/services/proto/delivery/interface.ts

@@ -40,7 +40,7 @@ export interface ErmsMiddelGoodsEditReq {
     relatedgoodsid: number; // uint64 关联交易商品ID
     evaluateratio: number; // double 估价系数
     qtydecimalplace: number; // int32 数量小数位
-    modifierid: number; // uint64 修改人
+    modifierid?: number; // uint64 修改人
     relatedgoodstype: number; // int32 关联商品类型 - 1:期货合约 2:现货品种
     needhedgeratio: number; // double 套保比率
     areauserid?: number; // uint64 机构用户ID

+ 7 - 8
src/views/information/goods/components/disable/index.vue

@@ -1,7 +1,7 @@
 <template>
-  <!-- 停用客户资料-->
+  <!-- 停用现货品种-->
   <a-modal class="commonModal warehouse-disable"
-           title="停用客户资料"
+           title="停用现货品种"
            v-model:visible="visible"
            centered
            :maskClosable="maskClosableFlag"
@@ -117,8 +117,8 @@ import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { formatValue } from '@/common/methods';
 import { getStatusName } from '@/views/information/custom/setup';
 import { Modal } from 'ant-design-vue';
-import {stopDeliveryGoods} from "@/views/information/goods/components/setup";
-import {ErmcpDeliveryGoodsDetailEx} from "@/services/go/ermcp/goodsInfo/interface";
+import { stopDeliveryGoods } from '@/views/information/goods/components/setup';
+import { ErmcpDeliveryGoodsDetailEx } from '@/services/go/ermcp/goodsInfo/interface';
 
 export default defineComponent({
     name: 'custom-disable',
@@ -139,10 +139,9 @@ export default defineComponent({
                 okText: '确认停用',
                 cancelText: '取消',
                 onOk() {
-                    stopDeliveryGoods(props.selectedRow.data.deliverygoodsid.toString(), loading)
-                    .then(res => {
-                        cancel()
-                    })
+                    stopDeliveryGoods(props.selectedRow.data.deliverygoodsid.toString(), loading).then((res) => {
+                        cancel();
+                    });
                 },
                 onCancel() {
                     console.log('Cancel');

+ 50 - 9
src/views/information/goods/components/hedgingModify/index.vue

@@ -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,
         };
     },
 });

+ 24 - 0
src/views/information/goods/components/hedgingModify/setup.ts

@@ -0,0 +1,24 @@
+import { ermsMiddelGoodsEdit } from "@/services/proto/delivery";
+import { ErmsMiddelGoodsEditReq } from "@/services/proto/delivery/interface";
+import { reactive, ref, UnwrapRef } from "vue";
+/**
+ * 表单
+ * @returns 
+ */
+export function handleForm() {
+    interface FormState {
+        needhedgeratio: number | null
+    }
+    const formRef = ref();
+    const formState: UnwrapRef<FormState> = reactive({
+        needhedgeratio: null,
+    })
+    const rules = {
+        needhedgeratio: [{ required: true, message: '请输入套保比例', trigger: 'blur', type: 'number' }],
+    }
+    return { rules, formState, formRef }
+}
+
+export function modifyAction(param: ErmsMiddelGoodsEditReq) {
+    ermsMiddelGoodsEdit(param)
+}

+ 3 - 3
src/views/information/goods/components/rightHedging/index.vue

@@ -134,14 +134,14 @@
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <HedgingDetail @selctedMG="selctedMG" />
-    <HedgingModify @selctedMG="selctedMG" />
+    <HedgingDetail :selctedMG="selctedMG" />
+    <HedgingModify :selctedMG="selctedMG" />
 
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType } from 'vue';
+import { defineComponent, PropType, reactive } from 'vue';
 import { initMG } from '@/views/information/goods/list/hedging-variety/setup';
 import { Ermcp3MiddleGoodsDetail2 } from '@/services/go/ermcp/goodsInfo/interface';
 import { initData } from '@/common/methods';

+ 1 - 1
src/views/information/goods/components/rightSpot/index.vue

@@ -113,7 +113,7 @@
       </a-collapse>
     </div>
     <Modify :selctedDeliveryGoods="selctedDeliveryGoods" />
-    <Disable :selctedDeliveryGoods="selctedDeliveryGoods" />
+    <Disable :selectedRow="selctedDeliveryGoods" />
     <SpotDetail />
   </div>
 </template>