huangbin 4 vuotta sitten
vanhempi
commit
e250bf34e4

+ 39 - 39
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/buy/index.vue

@@ -1,43 +1,42 @@
 <template>
-    <!-- 仓单贸易 贸易圈挂牌 卖-->
-    <div>
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'condSecondTabTableHalfTop' : 'condSecondTabTableHalfTopNoBottom', 'halfBottom']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc((100vh- 443px)/2 - 14px)' : 'calc((100vh - 196px)/2 - 16px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        >
-            <template #index="{ index }">
-                <span>{{ index + 1 }}</span>
-            </template>
-            <!-- 议价 -->
-            <template #canbargain="{ text }">
-                <span>{{ text ? '是' : '否' }}</span>
-            </template>
-            <!-- 整单 -->
-            <template #canpart="{ text }">
-                <span>{{ text ? '是' : '否' }}</span>
-            </template>
-            <!-- 挂牌有效期 -->
-            <template #validtime="{ text }">
-                <span>{{ formatTime(text, 'd') }}</span>
-            </template>
-        </a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="filterBtn(firstBtn)"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :enumName="name"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </div>
+  <!-- 仓单贸易 贸易圈挂牌 卖-->
+  <div>
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTableHalfTop' : 'condSecondTabTableHalfTopNoBottom', 'halfBottom']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc((100vh- 443px)/2 - 14px)' : 'calc((100vh - 196px)/2 - 16px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <template #index="{ index }">
+        <span>{{ index + 1 }}</span>
+      </template>
+      <!-- 议价 -->
+      <template #canbargain="{ text }">
+        <span>{{ text ? '是' : '否' }}</span>
+      </template>
+      <!-- 整单 -->
+      <template #canpart="{ text }">
+        <span>{{ text ? '是' : '否' }}</span>
+      </template>
+      <!-- 挂牌有效期 -->
+      <template #validtime="{ text }">
+        <span>{{ formatTime(text, 'd') }}</span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="filterBtn(firstBtn)"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               :buyOrSell="BuyOrSell.sell"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -122,6 +121,7 @@ export default defineComponent({
             search,
             formatTime,
             filterBtn,
+            BuyOrSell,
         };
     },
 });

+ 17 - 8
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -51,14 +51,14 @@
 
           <a-col :span="24">
             <a-form-item label="现货仓单"
-                         name="accountid">
+                         name="LadingBillId">
               <a-select class="inlineFormSelect"
                         style="width: 260px"
-                        v-model:value="formState.accountid"
+                        v-model:value="formState.LadingBillId"
                         placeholder="请选择">
-                <a-select-option v-for="item in accountList"
-                                 :value="item.accountid"
-                                 :key="item.accountid">{{item.accountid}}</a-select-option>
+                <a-select-option v-for="item in wrHoldList"
+                                 :value="item.id"
+                                 :key="item.id">{{item.name}}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -157,7 +157,7 @@ import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { BuyOrSell } from '@/common/constants/enumCommon';
 import { getCanUseMoney } from '@/services/bus/account';
 import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
-import { handleForm } from './setup';
+import { handleForm, handleSpotWarrant } from './setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -165,9 +165,13 @@ export default defineComponent({
     components: { Des, Drawer, PlusOutlined, MinusOutlined },
     props: {
         selectedRow: {
-            type: Object as PropType<TempWrOrderQuoteDetail>,
+            type: Object as PropType<QueryOrderQuoteMyqQsp>,
             default: {},
         },
+        buyOrSell: {
+            type: Number as PropType<BuyOrSell>,
+            default: BuyOrSell.buy,
+        },
     },
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
@@ -181,7 +185,11 @@ export default defineComponent({
             return accountList.find((e) => e.accountid === formState.accountid);
         }
         function getMoney() {}
-        function isBuy() {}
+        function isBuy() {
+            return props.buyOrSell === BuyOrSell.buy;
+        }
+        // 现货仓单
+        const { wrHoldList } = handleSpotWarrant(props.buyOrSell, props.selectedRow, loading);
         function submit() {
             // const marketInfo = getMarketRunByTradeMode(17);
             // if (marketInfo) {
@@ -261,6 +269,7 @@ export default defineComponent({
             getCanUseMoney,
             getMoney,
             isBuy,
+            wrHoldList,
         };
     },
 });

+ 4 - 0
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/interface.ts

@@ -5,3 +5,7 @@ export interface ListingForm {
     case: string,
     caseId: number,
 }
+export interface Wrhold {
+    id: string,
+    name: string,
+}

+ 20 - 1
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/setup.ts

@@ -1,4 +1,9 @@
-import { reactive, ref, UnwrapRef } from "vue";
+import { BuyOrSell } from "@/common/constants/enumCommon";
+import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
+import { queryHoldLB } from "@/services/go/wrtrade";
+import { QueryOrderQuoteMyqQsp, WrHoldLB } from "@/services/go/wrtrade/interface";
+import { Wrhold } from "@/views/market/spot_trade/spot_trade_order_transaction/components/delisting/interface";
+import { reactive, Ref, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
 
 
@@ -22,3 +27,17 @@ export function handleForm() {
     return { rules, formState, formRef }
 }
 
+
+export function handleSpotWarrant(buyOrSell: BuyOrSell, selectedRow: QueryOrderQuoteMyqQsp, loading: Ref<boolean>) {
+    const wrHoldList = ref<Wrhold[]>([])
+    if (buyOrSell === BuyOrSell.sell) {
+        queryResultLoadingAndInfo(queryHoldLB, loading).then(res => {
+            wrHoldList.value = res.filter((e: WrHoldLB) => e.wrfactortypeid === String(selectedRow.wrfactortypeid)).map((e: WrHoldLB) => {
+                const { wrholdeno, enableqty, ladingbillid, enumdicname } = e
+                return { id: ladingbillid, name: `${wrholdeno}(${enableqty}${enumdicname})` }
+            })
+        })
+    }
+
+    return { wrHoldList }
+}

+ 39 - 39
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/sell/index.vue

@@ -1,43 +1,42 @@
 <template>
-    <!-- 仓单贸易 贸易圈挂牌 买-->
-    <div>
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'condSecondTabTableHalfTop' : 'condSecondTabTableHalfTopNoBottom']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc((100vh- 443px)/2 - 14px)' : 'calc((100vh - 196px)/2 - 16px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        >
-            <template #index="{ index }">
-                <span>{{ index + 1 }}</span>
-            </template>
-            <!-- 议价 -->
-            <template #canbargain="{ text }">
-                <span>{{ text ? '是' : '否' }}</span>
-            </template>
-            <!-- 整单 -->
-            <template #canpart="{ text }">
-                <span>{{ text ? '是' : '否' }}</span>
-            </template>
-            <!-- 挂牌有效期 -->
-            <template #validtime="{ text }">
-                <span>{{ formatTime(text, 'd') }}</span>
-            </template>
-        </a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="filterBtn(firstBtn)"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :enumName="name"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </div>
+  <!-- 仓单贸易 贸易圈挂牌 买-->
+  <div>
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTableHalfTop' : 'condSecondTabTableHalfTopNoBottom']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc((100vh- 443px)/2 - 14px)' : 'calc((100vh - 196px)/2 - 16px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList">
+      <template #index="{ index }">
+        <span>{{ index + 1 }}</span>
+      </template>
+      <!-- 议价 -->
+      <template #canbargain="{ text }">
+        <span>{{ text ? '是' : '否' }}</span>
+      </template>
+      <!-- 整单 -->
+      <template #canpart="{ text }">
+        <span>{{ text ? '是' : '否' }}</span>
+      </template>
+      <!-- 挂牌有效期 -->
+      <template #validtime="{ text }">
+        <span>{{ formatTime(text, 'd') }}</span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="filterBtn(firstBtn)"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               :buyOrSell="BuyOrSell.sell"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -122,6 +121,7 @@ export default defineComponent({
             search,
             formatTime,
             filterBtn,
+            BuyOrSell,
         };
     },
 });