Ver Fonte

commit 两个proto接口 现货

xkwg há 4 anos atrás
pai
commit
bb9e83a697

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

@@ -57,7 +57,7 @@ export interface ErmsMiddelGoodsEditRsp {
 // 现货品种停用请求 0 29 129
 export interface DeliveryGoodsCancelReq {
     wrstandardid: string; // uint64 现货商品ID
-    isvalid: number; // int32 是否有效 - 0:无效 1:有效
+    isvalid?: number; // int32 是否有效 - 0:无效 1:有效
 }
 // 现货品种停用响应 0 29 130
 export interface DeliveryGoodsCancelRsp {

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

@@ -117,27 +117,32 @@ 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";
 
 export default defineComponent({
     name: 'custom-disable',
     components: {},
     props: {
         selectedRow: {
-            type: Object as PropType<QueryCustomInfoType>,
+            type: Object as PropType<ErmcpDeliveryGoodsDetailEx>,
             default: {},
         },
     },
     setup(props) {
         const { visible, cancel } = closeModal('goods_info_spot_normal_disable');
         const maskClosableFlag = ref<boolean>(false);
-        const { loading, ModifyUserInfo } = updateUserAccount();
+        const loading = ref<boolean>(false);
         function submit() {
             Modal.confirm({
                 title: '是否确认停用客户资料',
                 okText: '确认停用',
                 cancelText: '取消',
                 onOk() {
-                    ModifyUserInfo(props.selectedRow.userid, 6);
+                    stopDeliveryGoods(props.selectedRow.data.deliverygoodsid.toString(), loading)
+                    .then(res => {
+                        cancel()
+                    })
                 },
                 onCancel() {
                     console.log('Cancel');

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

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

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

@@ -0,0 +1,41 @@
+import {DeliveryGoodsSign} from "@/views/information/goods/setup";
+import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
+import {hedgePlanReq} from "@/services/proto/hedgeplan";
+import {deliveryGoodsCancel} from "@/services/proto/delivery";
+import {DeliveryGoodsCancelReq} from "@/services/proto/delivery/interface";
+import {Ref} from "vue";
+
+/**
+ * 现货品种停用请求
+ * @param req
+ * @param loading
+ */
+export function stopDeliveryGoods(wrstandardid: string, loading: Ref<boolean>) :Promise<string>{
+    const sign = getRequestResultInfo(DeliveryGoodsSign, 0)  // 接口请求后的返回提示 这里统一进行管理
+    const result = deliveryGoodsCancel(reqDeliveryGoodsBuilder(wrstandardid, 0))
+    return commonResultInfo(result, sign, loading)
+}
+
+/**
+ * 现货品种恢复请求
+ * @param req
+ * @param loading
+ */
+export function resumeDeliveryGoods(wrstandardid: string, loading: Ref<boolean>) :Promise<string>{
+    const sign = getRequestResultInfo(DeliveryGoodsSign, 1)  // 接口请求后的返回提示 这里统一进行管理
+    const result = deliveryGoodsCancel(reqDeliveryGoodsBuilder(wrstandardid, 1))
+    return commonResultInfo(result, sign, loading)
+}
+
+
+/**
+ * 这里组装请求
+ * @param wrstandardid
+ * @param type 0: 停用 1: 恢复
+ */
+export function reqDeliveryGoodsBuilder(wrstandardid: string, type: number) :DeliveryGoodsCancelReq{
+    return {
+        wrstandardid: wrstandardid,
+        isvalid: type
+    } as DeliveryGoodsCancelReq
+}

+ 10 - 0
src/views/information/goods/setup.ts

@@ -1,6 +1,7 @@
 import { getThirdMenuData } from '@/common/setup/table/button';
 import { MenuList } from '@/services/go/ermcp/goodsInfo/interface';
 import { Ref, ref } from 'vue';
+import {ResultInfo} from "@/common/methods/request";
 
 interface MenuType {
     menuList: Ref<MenuList[]>;
@@ -25,3 +26,12 @@ export function getInitMenuData(code: 'goods_info_spot' | 'goods_info_hedge'): M
     return { menuList, menuMap }
 }
 
+
+
+/************** 接口请求相关提示 ****************/
+
+// 停用提示
+export const DeliveryGoodsSign = new Map<number, ResultInfo>([
+    [0, ['停用现货品种成功', '停用现货品种失败:']],
+    [1, ['恢复现货品种成功', '恢复现货品种失败:']],
+])