huangbin %!s(int64=4) %!d(string=hai) anos
pai
achega
6925e4ecf6

+ 17 - 0
public/proto/mtp.proto

@@ -457,6 +457,23 @@ message TradeHoldTransferApplyRsp {
 	optional uint64 applyid = 4; // uint64 申请ID
 }
 
+// 按单协议平仓操作
+message TradeHoldTransferApplyAuditReq {
+	optional MessageHead Header = 1;
+			optional uint64 ApplyID = 2; // 申请ID
+			optional uint32 ApplyStatus = 3; // 1:撤销2:拒绝3:通过
+			optional uint32 AuditSrc = 4; // 审核来源-1:管理端
+			optional uint64 AuditorID = 5; // 登录账号
+			optional string AuditRemark = 6; // 审核备注
+}
+// 按单协议平仓操作
+message TradeHoldTransferApplyAuditRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+			optional uint64 ApplyID = 4; // 申请ID
+}
+
 // 新增修改收货地址请求
 message UserReceiveInfoReq {
 	optional MessageHead Header = 1;

+ 0 - 1
src/common/setup/trade/index.ts

@@ -112,7 +112,6 @@ export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formStat
 
     // 挂买 最大数量
     function getListingBuyMaxNum() {
-        debugger
         const { buymarginvalue } = useTradeRule()
         return getMaxNum(buymarginvalue, true)
     }

+ 1 - 1
src/services/bus/account.ts

@@ -16,7 +16,7 @@ export function getAllTaAccount(): AccountListItem[] {
 export const getAccoutIdList = (): string => {
     const accountList = getAllTaAccount();
     return accountList.reduce((prev: string, cur: any, i: number) => {
-        const id = String(cur.AccountId);
+        const id = String(cur.accountid);
         const temp = i ? `,${id}` : id;
         prev += temp;
         return prev;

+ 3 - 0
src/services/funcode/index.ts

@@ -33,6 +33,9 @@ export const funCode: Code = {
     TradeHoldTransferApplyReq: 1900757, // /按单协议平仓申请
     TradeHoldTransferApplyRsp: 1900758, // /按单协议平仓申请
 
+    TradeHoldTransferApplyAuditReq: 1900759, // 按单协议平仓
+    TradeHoldTransferApplyAuditRsp: 1900760, // 按单协议平仓操作响应
+
     UserReceiveInfoReq: 1900545, // 新增修改收货地址请求
     UserReceiveInfoRsp: 1900546, // 新增修改收货地址请求响应
     DelUserReceiveInfoReq: 1900547, // 删除收货地址请求请求

+ 10 - 1
src/services/proto/warehousetrade/index.ts

@@ -1,7 +1,7 @@
 import {
     DeliveryOrderReq,
     HdWRDealOrderReq,
-    HdWROrderReq, PaymentArrearsReq, TradeHoldTransferApplyReq, WarehouseRepurchaseReq, WrBargainApplyReq, WRListingCancelOrderReq, WROutApplyCancelReq,
+    HdWROrderReq, PaymentArrearsReq, TradeHoldTransferApplyAuditReqType, TradeHoldTransferApplyReq, WarehouseRepurchaseReq, WrBargainApplyReq, WRListingCancelOrderReq, WROutApplyCancelReq,
     WROutApplyReq, WROutCancelReq, WROutConfirmReq, WRTradeFinanceBuyCancelReq
 } from "@/services/proto/warehousetrade/interface";
 import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
@@ -125,6 +125,15 @@ export const tradeHoldTransferApply = (param: TradeHoldTransferApplyReq): Promis
     return protoMiddleware<TradeHoldTransferApplyReq>(param, 'TradeHoldTransferApplyReq', 'TradeHoldTransferApplyRsp', HeadEnum.tradeMode17)
 }
 
+/**
+ * 单协议平仓
+ * @param param
+ * @constructor
+ */
+export const tradeHoldTransferApplyAuditReq = (param: TradeHoldTransferApplyAuditReqType): Promise<any> => {
+    return protoMiddleware<TradeHoldTransferApplyAuditReqType>(param, 'TradeHoldTransferApplyAuditReq', 'TradeHoldTransferApplyAuditRsp', HeadEnum.tradeMode17)
+}
+
 
 
 // /**

+ 8 - 0
src/services/proto/warehousetrade/interface.ts

@@ -318,6 +318,14 @@ export interface TradeHoldTransferApplyReq {
     Remark: string; // 申请备注
 }
 
+export interface TradeHoldTransferApplyAuditReqType {
+    ApplyID: number; // 申请ID
+    ApplyStatus: number; //  1:撤销2:拒绝3:通过
+    AuditSrc: number; // 申请来源 - 1:管理端 2:终端
+    AuditorID: string; //  登录账号
+    AuditRemark: string; // 审核备注
+}
+
 // // 议价申请审核请求 0 29 59
 // export interface WrBargainNoAgreeReq {
 //     WrBargainID: number // uint64 申请ID

+ 61 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_cancel_order/index.vue

@@ -0,0 +1,61 @@
+<template>
+  <!-- 商品合约 议价单 撤单 -->
+  <div></div>
+</template>
+
+<script lang="ts">
+import Drawer from '@/common/components/drawer/index.vue';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { geLoginID_number } from '@/services/bus/login';
+import { QueryTjmdTransferApplyRsp } from '@/services/go/Tjmd/interface';
+import { tradeHoldTransferApplyAuditReq } from '@/services/proto/warehousetrade';
+import { TradeHoldTransferApplyAuditReqType } from '@/services/proto/warehousetrade/interface';
+import { Modal } from 'ant-design-vue';
+import { defineComponent, PropType, ref } from 'vue';
+
+export default defineComponent({
+    name: 'commodity_contract_bargain_cancel_order',
+    components: { Drawer },
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryTjmdTransferApplyRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const loading = ref<boolean>(false);
+
+        function submit() {
+            const param: TradeHoldTransferApplyAuditReqType = {
+                ApplyID: props.selectedRow.applyid,
+                ApplyStatus: 1, // 1:撤销2:拒绝3:通过
+                AuditSrc: 2,
+                AuditorID: geLoginID_number()!.toString(),
+                AuditRemark: '',
+            };
+            requestResultLoadingAndInfo(tradeHoldTransferApplyAuditReq, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+                // Bus.$emit('spotTrade', true);
+                cancel(true);
+            });
+        }
+
+        Modal.confirm({
+            title: '撤单',
+            content: '是否确认撤单!',
+            onOk: submit,
+            onCancel: cancel,
+        });
+
+        return {
+            visible,
+            cancel,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+</style>;

+ 63 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_submit_order/index.vue

@@ -0,0 +1,63 @@
+<template>
+  <!-- 商品合约 议价单 撤单 -->
+  <div></div>
+</template>
+
+<script lang="ts">
+import Drawer from '@/common/components/drawer/index.vue';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { geLoginID_number } from '@/services/bus/login';
+import { QueryTjmdTransferApplyRsp } from '@/services/go/Tjmd/interface';
+import { tradeHoldTransferApplyAuditReq } from '@/services/proto/warehousetrade';
+import { TradeHoldTransferApplyAuditReqType } from '@/services/proto/warehousetrade/interface';
+import { Modal } from 'ant-design-vue';
+import { defineComponent, PropType, ref } from 'vue';
+
+export default defineComponent({
+    name: 'commodity_contract_bargain_submit_order',
+    components: { Drawer },
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryTjmdTransferApplyRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const loading = ref<boolean>(false);
+
+        function submit() {
+            console.log(geLoginID_number());
+            debugger;
+            const param: TradeHoldTransferApplyAuditReqType = {
+                ApplyID: props.selectedRow.applyid,
+                ApplyStatus: 3, // 1:撤销2:拒绝3:通过
+                AuditSrc: 2,
+                AuditorID: geLoginID_number()!.toString(),
+                AuditRemark: '',
+            };
+            requestResultLoadingAndInfo(tradeHoldTransferApplyAuditReq, param, loading, ['同意成功', '同意失败:']).then(() => {
+                // Bus.$emit('spotTrade', true);
+                cancel(true);
+            });
+        }
+
+        Modal.confirm({
+            title: '撤单',
+            content: '是否确认撤单!',
+            onOk: submit,
+            onCancel: cancel,
+        });
+
+        return {
+            visible,
+            cancel,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+</style>;

+ 9 - 7
src/views/order/commodity_contract/components/commodity_contract_bargain/index.vue

@@ -60,38 +60,40 @@ import Bus from '@/utils/eventBus/index';
 import { ref } from 'vue';
 import { ApplyType } from '@/common/constants/enumCommon';
 import { getBuyOrSellName, getScfContractStatusName } from '@/common/constants/enumsName';
+import { getAccoutIdList } from '@/services/bus/account';
 
 export default defineComponent({
     name: 'commodity_contract_bargain',
     components: {
         BtnList,
-        // [ModalEnum.commodity_contract_summary_settlement]: defineAsyncComponent(() => import('./components/commodity_contract_summary_settlement/index.vue')),
-        // [ModalEnum.commodity_contract_summary_transfer]: defineAsyncComponent(() => import('./components/commodity_contract_summary_transfer/index.vue')),
+        commodity_contract_bargain_submit_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_submit_order/index.vue')),
+        commodity_contract_bargain_cancel_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_cancel_order/index.vue')),
         // commodity_contract_summary_deal_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_deal_closed/index.vue')),
     },
     setup() {
         // 类型 1-我的申请 2-对方申请
-        const margainType = ref<number>(ApplyType.my);
+        const margainType = ref<ApplyType>(ApplyType.my);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<QueryTjmdTransferApplyRsp>();
         // 交割商品
         handleDeliveryRelation();
         // 获取列表数据
-        const queryTableAction = (applytype: ApplyType) => {
+        const queryTableAction = () => {
             const param: QueryTjmdTransferApplyReq = {
-                applytype,
+                applytype: margainType.value,
+                accountids: getAccoutIdList(),
             };
             queryTable(queryTjmdTransferApply, param);
         };
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
-            queryFn: () => queryTableAction(1),
+            queryFn: () => queryTableAction(),
             recordList: getRecordItemTab(),
         };
         // 切换 我的申请和对方申请
         Bus.$onOnly('bargain', (value: ApplyType) => {
             margainType.value = value;
-            queryTableAction(value);
+            queryTableAction();
         });
         function handleBtnList(record: QueryTjmdTransferApplyRsp, btnList: BtnListType[]) {
             if (record.applystatus === 1) {

+ 24 - 19
src/views/order/commodity_contract/index.vue

@@ -1,26 +1,30 @@
 <template>
-    <!-- 商品合约 -->
-    <section class="spot_warran">
-        <component :is="componentId" v-if="componentId"></component>
-        <thirdMenu :list="tabList" @selectMenu="changeTab" :value="'title'">
-            <!-- 议价单 -->
-            <div class="goods-apply" v-if="componentId === BARGIN">
-                <!-- <span @click="changeBargain(ApplyType.my)">我的议价</span>
+  <!-- 商品合约 -->
+  <section class="spot_warran">
+    <component :is="componentId"
+               v-if="componentId"></component>
+    <thirdMenu :list="tabList"
+               @selectMenu="changeTab"
+               :value="'title'">
+      <!-- 议价单 -->
+      <div class="goods-apply"
+           v-if="componentId === BARGIN">
+        <!-- <span @click="changeBargain(ApplyType.my)">我的议价</span>
                 <span @click="changeBargain(ApplyType.counterpart)">对方议价</span>-->
-                <a-radio-group class="conditionCommonRadioGroup">
-                    <a-radio @focus="changeBargain(ApplyType.my)" :value="ApplyType.my">我的议价</a-radio>
-                    <a-radio
-                        @focus="changeBargain(ApplyType.counterpart)"
-                        :value="ApplyType.counterpart"
-                    >对方议价</a-radio>
-                </a-radio-group>
-            </div>
-        </thirdMenu>
-    </section>
+        <a-radio-group class="conditionCommonRadioGroup"
+                       v-model:value="bargainValue">
+          <a-radio @focus="changeBargain(ApplyType.my)"
+                   :value="ApplyType.my">我的议价</a-radio>
+          <a-radio @focus="changeBargain(ApplyType.counterpart)"
+                   :value="ApplyType.counterpart">对方议价</a-radio>
+        </a-radio-group>
+      </div>
+    </thirdMenu>
+  </section>
 </template>
 
 <script lang="ts">
-import { defineAsyncComponent, defineComponent } from 'vue';
+import { defineAsyncComponent, defineComponent, ref } from 'vue';
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
 import thirdMenu from '@/common/components/thirdMenu/index.vue';
 import { handleOrderDetailList } from '@/common/setup/order/orderData';
@@ -44,7 +48,8 @@ export default defineComponent({
         function changeBargain(value: ApplyType) {
             Bus.$emit('bargain', value);
         }
-        return { ...handleOrderDetailList(enumOrderComponents.commodity_contract), changeBargain, BARGIN, ApplyType };
+        const bargainValue = ref<ApplyType>(ApplyType.my);
+        return { ...handleOrderDetailList(enumOrderComponents.commodity_contract), changeBargain, BARGIN, ApplyType, bargainValue };
     },
 });
 </script>