Преглед изворни кода

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

li.shaoyi пре 4 година
родитељ
комит
bda21fc11f
18 измењених фајлова са 440 додато и 142 уклоњено
  1. 17 0
      public/proto/mtp.proto
  2. 25 0
      src/assets/styles/mixin.less
  3. 4 4
      src/common/setup/trade/index.ts
  4. 1 1
      src/services/bus/account.ts
  5. 3 0
      src/services/funcode/index.ts
  6. 10 1
      src/services/proto/warehousetrade/index.ts
  7. 8 0
      src/services/proto/warehousetrade/interface.ts
  8. 1 1
      src/services/socket/quota/adapter/index.ts
  9. 72 78
      src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/index.vue
  10. 4 4
      src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts
  11. 61 0
      src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_cancel_order/index.vue
  12. 89 0
      src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_refuse_order/index.vue
  13. 63 0
      src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_submit_order/index.vue
  14. 28 7
      src/views/order/commodity_contract/components/commodity_contract_bargain/index.vue
  15. 23 26
      src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_deal_closed/index.vue
  16. 6 0
      src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_deal_closed/setup.ts
  17. 1 1
      src/views/order/commodity_contract/components/commodity_contract_summary/index.vue
  18. 24 19
      src/views/order/commodity_contract/index.vue

+ 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;

+ 25 - 0
src/assets/styles/mixin.less

@@ -3628,4 +3628,29 @@ input:-internal-autofill-selected {
     position: absolute;
     top: 15px;
     left: -66px;
+}
+
+// 审核拒绝失败原因
+.toolTipTableColumn {
+    .ant-tooltip-content {
+        border: 1px solid @m-grey23;
+        box-shadow: 0px 10px 10px 0px @m-boxShadow;
+        .rounded-corners(5px);
+        .ant-tooltip-arrow {
+            .ant-tooltip-arrow-content {
+                border-top-color: @m-grey22;
+                border-left-color: @m-grey22;
+                border: 1PX solid @m-grey23;
+                border-bottom: 0;
+                border-right: 0;
+                background: @m-grey22;
+            }
+        }
+        .ant-tooltip-inner {
+            border-image-width: 0;
+            background: @m-grey22;
+            color: @m-grey1;
+            padding: 5px 10px;
+        }
+    }
 }

+ 4 - 4
src/common/setup/trade/index.ts

@@ -38,7 +38,7 @@ export function useTradeRule() {
 export function useBuyFixedPricMaxNum<T extends CommomTradeForm>(formState: T, canUseMoney: Function) {
     let result = 0
     // 可用资金
-    const money = canUseMoney()
+    const money = canUseMoney() > 0 ? canUseMoney() : 0
     const { isRatioInBuyMarginType, buymarginvalue } = useTradeRule()
 
     // 最大数量 = 可用资金/(履约保证金*挂牌价格)
@@ -55,7 +55,7 @@ export function useBuyFixedPricMaxNum<T extends CommomTradeForm>(formState: T, c
 export function useSellFixedPriceMaxNum<T extends CommomTradeForm>(formState: T, canUseMoney: Function) {
     let result = 0
     // 可用资金
-    const money = canUseMoney()
+    const money = canUseMoney() > 0 ? canUseMoney() : 0
     const { isRationInSellMarginType, sellmarginvalue } = useTradeRule()
     // 最大数量 = 可用资金/(履约保证金*挂牌价格)
     const marginValue = isRationInSellMarginType() ? (sellmarginvalue * formState.FixedPrice) : (sellmarginvalue + formState.FixedPrice)
@@ -96,7 +96,7 @@ export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formStat
 
     function getMaxNum(value: number, isBuy: boolean) {
         // 可用资金
-        const money = canUseMoney()
+        const money = canUseMoney() > 0 ? canUseMoney() : 0
         // 挂牌 最大数量=可用资金/(买方履约保证金比例*挂牌价格)
         let result = 0
         if (isFloat()) {
@@ -161,7 +161,7 @@ export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formStat
 export function useBuyDelistingRatioMaxNum(OrderQty: number, canUseMoney: Function) {
     let result = 0;
     const { buymarginvalue } = useTradeRule()
-    const money = canUseMoney()
+    const money = canUseMoney() > 0 ? canUseMoney() : 0
     if (money && !isNaN(money)) {
         const num = +(money / buymarginvalue).toFixed(0);
         // 买 最大可摘数量=min{挂牌数量,可用资金/(履约保证金比例)}

+ 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

+ 1 - 1
src/services/socket/quota/adapter/index.ts

@@ -129,7 +129,7 @@ export function parseReceivePush(quotationData: any) {
                 const fn = (value: number) => +(value / num).toFixed(decimalplace)
                 goodsQuoteTik.decimalplace = decimalplace
                 goodsQuoteTik.last = goodsQuoteTik.last ? fn(goodsQuoteTik.last) : '--'
-                //goodsQuoteTik.presettle = goodsQuoteTik.presettle ? (fn(goodsQuoteTik.presettle)) : '--'
+                // goodsQuoteTik.presettle = goodsQuoteTik.presettle ? (fn(goodsQuoteTik.presettle)) : '--'
                 goodsQuoteTik.ask = goodsQuoteTik.ask ? (fn(goodsQuoteTik.ask)) : '--'
                 goodsQuoteTik.ask2 = goodsQuoteTik.ask2 ? (fn(goodsQuoteTik.ask2)) : '--'
                 goodsQuoteTik.ask3 = goodsQuoteTik.ask3 ? (fn(goodsQuoteTik.ask3)) : '--'

+ 72 - 78
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/index.vue

@@ -1,85 +1,79 @@
 <template>
-    <!--订单交易 挂牌转让-->
-    <div class="topTableHeight">
-        <div class="filterTable">
-            <div class="filter-custom-table">
-                <a-select
-                    class="conditionSelect"
-                    :style="{width: '180px', maxHeight: '400px', overflow: 'auto' }"
-                    @change="goodsChange"
-                    placeholder="全部标的合约"
-                >
-                    <a-select-option
-                        v-for="item in getRefGoodsList()"
-                        :value="item"
-                        :key="item"
-                    >{{item}}</a-select-option>
-                </a-select>
-                <!-- <a-button class="btnDeafault"
+  <!--订单交易 挂牌转让-->
+  <div class="topTableHeight">
+    <div class="filterTable">
+      <div class="filter-custom-table">
+        <a-select class="conditionSelect"
+                  :style="{width: '180px', maxHeight: '400px', overflow: 'auto' }"
+                  @change="goodsChange"
+                  placeholder="全部标的合约">
+          <a-select-option v-for="item in getRefGoodsList()"
+                           :value="item"
+                           :key="item">{{item}}</a-select-option>
+        </a-select>
+        <!-- <a-button class="btnDeafault"
                 @click="search(true)"
                 style="width: 80px">筛选</a-button>-->
-            </div>
-        </div>
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'secondTabTable' : 'secondTabTableNoBottom', goodsList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 407px)' : 'calc(100vh - 167px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="goodscode"
-            ref="tableRef"
-            :data-source="goodsList"
-        >
-            <template #totalturnover="{ text }">
-                <span>{{changeUnit(text)}}</span>
-            </template>
-            <!-- 涨跌 -->
-            <template #change="{ record }">
-                <span>{{quoteChange(record, record.decimalplace)}}</span>
-            </template>
-            <!-- 幅度 -->
-            <template #amplitude="{ record }">
-                <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
-            </template>
-            <!-- 振幅 -->
-            <template #vibration="{ record }">
-                <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
-            </template>
-            <template #index="{ index }">
-                <span>{{index + 1}}</span>
-            </template>
-            <!-- 买价 -->
-            <template #bid="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
-            </template>
-            <!-- 卖价 -->
-            <template #ask="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
-            </template>
-            <!-- 最新价 -->
-            <template #last="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
-            </template>
-            <!-- 最低价 -->
-            <template #lowest="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
-            </template>
-            <!-- 最高价 -->
-            <template #highest="{ text, record }">
-                <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
-            </template>
-        </a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="btnList"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
+      </div>
     </div>
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'secondTabTable' : 'secondTabTableNoBottom', goodsList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 407px)' : 'calc(100vh - 167px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="goodscode"
+             ref="tableRef"
+             :data-source="goodsList">
+      <template #totalturnover="{ text }">
+        <span>{{changeUnit(text)}}</span>
+      </template>
+      <!-- 涨跌 -->
+      <template #change="{ record }">
+        <span>{{quoteChange(record, record.decimalplace)}}</span>
+      </template>
+      <!-- 幅度 -->
+      <template #amplitude="{ record }">
+        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+      </template>
+      <!-- 振幅 -->
+      <template #vibration="{ record }">
+        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+      </template>
+      <template #index="{ index }">
+        <span>{{index + 1}}</span>
+      </template>
+      <!-- 买价 -->
+      <template #bid="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 卖价 -->
+      <template #ask="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最新价 -->
+      <template #last="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最低价 -->
+      <template #lowest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最高价 -->
+      <template #highest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="btnList"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">

+ 4 - 4
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts

@@ -75,10 +75,10 @@ export const columnsList = [
 
     { title: '标的合约', key: 'refgoodsname' },
 
-    { title: '买价', key: 'bid' },
-    { title: '买量', key: 'bidvolume' },
-    { title: '卖价', key: 'ask' },
-    { title: '卖量', key: 'askvolume' },
+    // { title: '买价', key: 'bid' },
+    // { title: '买量', key: 'bidvolume' },
+    // { title: '卖价', key: 'ask' },
+    // { title: '卖量', key: 'askvolume' },
 
     { title: '当前价', key: 'last' },
     { title: '涨跌', key: 'change' }, // 最新价 - 昨结价

+ 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>;

+ 89 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_refuse_order/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <!-- 商品合约 议价单 撤单 -->
+  <a-modal class="commonModal"
+           title="原因"
+           v-model:visible="visible"
+           centered
+           :maskClosable="false">
+    <template #footer>
+      <a-button key="submit"
+                class="cancelBtn">取消</a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading">提交</a-button>
+    </template>
+    <a-form class="inlineForm"
+            ref="formRef">
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="原因"
+                       class="relative"
+                       name="Remark">
+            <a-textarea class="dialogInput"
+                        style="width: 100%"
+                        placeholder="请输入原因"
+                        readonly
+                        :autosize="{ minRows: 8, maxRows: 24 }" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
+</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>;

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

@@ -23,6 +23,23 @@
       <template #applytime="{ text }">
         <span>{{ formatTime(text) }}</span>
       </template>
+      <template #transferamount="{ record }">
+        <div>
+          <!-- 审核拒绝 -->
+          <a-tooltip placement="bottom"
+                     v-if="record.applystatus === 4"
+                     overlayClassName="toolTipTableColumn">
+            <template #title>
+              <span>{{ getScfContractStatusName(text) }}</span>
+            </template>
+            <span
+                  :class="record.applystatus === 4 ? 'red' : 'white'">{{ record.transferamount }}</span>
+            <ExclamationCircleOutlined class="ml10 red"
+                                       v-if="record.applystatus === 4" />
+          </a-tooltip>
+          <span v-else>{{ record.transferamount }}</span>
+        </div>
+      </template>
       <template #buyorsell="{ text }">
         <span>{{ getBuyOrSellName(text) }}</span>
       </template>
@@ -60,38 +77,42 @@ 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';
+import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 
 export default defineComponent({
     name: 'commodity_contract_bargain',
     components: {
+        ExclamationCircleOutlined,
         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) {

+ 23 - 26
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_deal_closed/index.vue

@@ -122,35 +122,27 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
 import Drawer from '@/common/components/drawer/index.vue';
-import { ModalEnum } from '@/common/constants/modalNameEnum';
-import { _closeModal } from '@/common/setup/modal/modal';
-
 import UploadImg from '@/common/components/uploadImg/index.vue';
-import { getSelectedAccountId, getUserId } from '@/services/bus/account';
-
 import { BuyOrSell } from '@/common/constants/enumCommon';
-import Long from 'long';
-import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
-import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
-import { DeliveryOrder, tradeHoldTransferApply } from '@/services/proto/warehousetrade';
-import { v4 } from 'uuid';
-import moment from 'moment';
-import { DeliveryOrderReq, TradeHoldTransferApplyReq } from '@/services/proto/warehousetrade/interface';
-import { geLoginID_number, getLoginData } from '@/services/bus/login';
-import { message } from 'ant-design-vue';
-import { getGoodsByCode } from '@/services/bus/goods';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { validateAction } from '@/common/setup/form';
+import { _closeModal } from '@/common/setup/modal/modal';
 import { queryTableList } from '@/common/setup/table';
-import { queryTjmdTransferApply } from '@/services/go/Tjmd';
-import { QueryTjmdTransferApplyRsp } from '@/services/go/Tjmd/interface';
-import { GetLoginID } from '@/services/go/useInfo';
+import { getUserId } from '@/services/bus/account';
+import { geLoginID_number } from '@/services/bus/login';
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
 import { queryTradeHolderDetail } from '@/services/go/order';
 import { QueryTradeHolderDetailReq } from '@/services/go/order/interface';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { validateAction } from '@/common/setup/form';
-import { FormState, BargainList } from './interface';
-import { handleForm, usePrice, useCheckd } from './setup';
+import { tradeHoldTransferApply } from '@/services/proto/warehousetrade';
+import { TradeHoldTransferApplyReq } from '@/services/proto/warehousetrade/interface';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import { message } from 'ant-design-vue';
+import Long from 'long';
+import { defineComponent, PropType } from 'vue';
+import { BargainList, FormState } from './interface';
+import { handleForm, useCheckd, usePrice } from './setup';
 
 export default defineComponent({
     name: ModalEnum.commodity_contract_summary_settlement,
@@ -171,6 +163,7 @@ export default defineComponent({
         const { rules, formState, formRef } = handleForm();
         // 选中逻辑
         const { checked, selected, checkGroupChange, checkboxChange } = useCheckd();
+
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<BargainList>();
         const param: QueryTradeHolderDetailReq = {
@@ -186,6 +179,7 @@ export default defineComponent({
                     // 默认勾选第一个
                     checked.value = e.tradeid;
                     const result = { ...e, checked: true };
+                    selected.value = result;
                     return result;
                 }
             });
@@ -194,11 +188,14 @@ export default defineComponent({
         const toFixed0 = (value: number) => +value.toFixed(0);
 
         function submit() {
+            if (!selected.value) {
+                message.warn('请选择持仓');
+                return;
+            }
             validateAction<FormState>(formRef, formState).then((res) => {
-                const item = tableList.value[0];
                 const param: TradeHoldTransferApplyReq = {
-                    TradeID: Long.fromString(item.tradeid),
-                    BuyorSell: item.buyorsell,
+                    TradeID: Long.fromString(selected.value!.tradeid),
+                    BuyorSell: selected.value!.buyorsell,
                     TransferPrice: res.price,
                     ApplySrc: 2,
                     ApplicantID: geLoginID_number()!,

+ 6 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_deal_closed/setup.ts

@@ -45,5 +45,11 @@ export function useCheckd() {
 
 // 计算盈亏
 export function useProfit(item: BargainList) {
+    const { buyorsell, holderprice, agreeunit, holderqty } = item
+    // let result = '--'
+    // if(buyorsell === BuyOrSell.buy) {
 
+    // } else {
+
+    // }
 }

+ 1 - 1
src/views/order/commodity_contract/components/commodity_contract_summary/index.vue

@@ -15,7 +15,7 @@
       <!-- 额外的展开行 -->
       <template v-if="btnList.length"
                 #expandedRowRender="{ record }">
-        <BtnList :btnList="handleBtnList(record, btnList)"
+        <BtnList :btnList="handleBtnList(record,btnList)"
                  :record="record"
                  class="btn-list-sticky"
                  @click="openComponent" />

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