|
|
@@ -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
|
|
|
+}
|