Explorar o código

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

Zhou.xiaoning %!s(int64=4) %!d(string=hai) anos
pai
achega
36ad5e9e4a

+ 147 - 158
src/views/market/spot_trade/components/buy-sell-market/components/delisting/index.vue

@@ -1,160 +1,149 @@
 <template>
-    <!-- 仓单贸易&仓单预售 买/卖 摘牌 -->
-    <Drawer
-        :title="'摘牌'"
-        :placement="'right'"
-        :visible="visible"
-        width="486px"
-        height="479px"
-        @cancel="cancel"
-        class="top"
-    >
-        <div class="delisting">
-            <div class="formBar">
-                <a-form
-                    class="inlineForm dialogForm"
-                    ref="formRef"
-                    :model="formState"
-                    :rules="rules"
-                >
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="交易账户" name="accountid">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    style="width: 260px"
-                                    v-model:value="formState.accountid"
-                                    placeholder="请选择"
-                                >
-                                    <a-select-option
-                                        v-for="item in accountList"
-                                        :value="item.accountid"
-                                        :key="item.accountid"
-                                    >{{item.accountid}}</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="挂牌方">
-                                <span class="white ml8">{{selectedRow.username}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="基差" v-if="isFloat()">
-                                <span class="yellow ml8">{{selectedRow.pricemove}}</span>
-                            </a-form-item>
-                            <a-form-item label="挂牌价格" v-if="!isFloat()">
-                                <span class="yellow ml8">{{selectedRow.fixedprice}}</span>
-                            </a-form-item>
-                            <a-row :gutter="24">
-                                <a-col :span="24"></a-col>
-                            </a-row>
-                            <a-form-item label="挂牌数量">
-                                <span
-                                    class="white ml8"
-                                >{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24" v-if="isBuy() && isWR()">
-                        <a-col :span="24">
-                            <a-form-item label="现货仓单" name="LadingBillId">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    style="width: 260px"
-                                    v-model:value="formState.LadingBillId"
-                                    placeholder="请选择"
-                                >
-                                    <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>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="摘牌数量" class="relative" name="num">
-                                <a-input-number
-                                    class="dialogInput yellowInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    :max="getMaxNum()"
-                                    v-model:value="formState.num"
-                                />
-                                <span class="input-enumdicname-absolute">{{selectedRow.enumdicname}}</span>
-                                <div
-                                    class="labelTip"
-                                >({{selectedRow.minivalue}}{{selectedRow.enumdicname}}起)</div>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24" class="mt-20">
-                            <a-form-item>
-                                <a-slider
-                                    ::min="0"
-                                    v-model:value="formState.num"
-                                    :max="selectedRow.orderqty"
-                                    class="formSlider"
-                                />
-                                <div class="unit">
-                                    <span>0</span>
-                                    <span>{{getMaxNum()}}{{selectedRow.enumdicname}}</span>
-                                </div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">&nbsp;</a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24" class="mt-20">
-                            <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24" class="mt-20">
-                            <a-form-item :label="getMargin() ? '履约保证金' : ''">
-                                <a-row>
-                                    <a-col :span="8" v-if="getMargin()">
-                                        <span class="white ml8">{{getMargin()}}</span>
-                                    </a-col>
-                                    <a-col :span="4" class="tr">
-                                        <span class="grey1">可用资金</span>
-                                    </a-col>
-                                    <a-col :span="12">
-                                        <span
-                                            class="white ml8"
-                                        >{{getCanUseMoney(getSelectedAccount())}}</span>
-                                    </a-col>
-                                </a-row>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item class="tc">
-                                <a-button
-                                    class="listedBtn"
-                                    :loading="loading"
-                                    :disabled="loading"
-                                    @click="submit"
-                                >{{isBuy() ? '卖出' : '买入'}}</a-button>
-                                <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </a-form>
-            </div>
-        </div>
-    </Drawer>
+  <!-- 仓单贸易&仓单预售 买/卖 摘牌 -->
+  <Drawer :title="'摘牌'"
+          :placement="'right'"
+          :visible="visible"
+          width="486px"
+          height="479px"
+          @cancel="cancel"
+          class="top">
+    <div class="delisting">
+      <div class="formBar">
+        <a-form class="inlineForm dialogForm"
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="交易账户"
+                           name="accountid">
+                <a-select class="inlineFormSelect"
+                          style="width: 260px"
+                          v-model:value="formState.accountid"
+                          placeholder="请选择">
+                  <a-select-option v-for="item in accountList"
+                                   :value="item.accountid"
+                                   :key="item.accountid">{{item.accountid}}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="挂牌方">
+                <span class="white ml8">{{selectedRow.username}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="基差"
+                           v-if="isFloat()">
+                <span class="yellow ml8">{{selectedRow.pricemove}}</span>
+              </a-form-item>
+              <a-form-item label="挂牌价格"
+                           v-if="!isFloat()">
+                <span class="yellow ml8">{{selectedRow.fixedprice}}</span>
+              </a-form-item>
+              <a-row :gutter="24">
+                <a-col :span="24"></a-col>
+              </a-row>
+              <a-form-item label="挂牌数量">
+                <span class="white ml8">{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24"
+                 v-if="isBuy() && isWR()">
+            <a-col :span="24">
+              <a-form-item label="现货仓单"
+                           name="LadingBillId">
+                <a-select class="inlineFormSelect"
+                          style="width: 260px"
+                          v-model:value="formState.LadingBillId"
+                          placeholder="请选择">
+                  <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>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="摘牌数量"
+                           class="relative"
+                           name="num">
+                <a-input-number class="dialogInput yellowInput"
+                                style="width: 260px"
+                                :min="0"
+                                :max="getMaxNum()"
+                                v-model:value="formState.num" />
+                <span class="input-enumdicname-absolute">{{selectedRow.enumdicname}}</span>
+                <div class="labelTip">({{selectedRow.minivalue}}{{selectedRow.enumdicname}}起)</div>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24"
+                   class="mt-20">
+              <a-form-item>
+                <a-slider ::min="0"
+                          v-model:value="formState.num"
+                          :max="selectedRow.orderqty"
+                          class="formSlider" />
+                <div class="unit">
+                  <span>0</span>
+                  <span>{{getMaxNum()}}{{selectedRow.enumdicname}}</span>
+                </div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">&nbsp;</a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24"
+                   class="mt-20">
+              <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24"
+                   class="mt-20">
+              <a-form-item :label="getMargin() ? '履约保证金' : ''">
+                <a-row>
+                  <a-col :span="8"
+                         v-if="getMargin()">
+                    <span class="white ml8">{{getMargin()}}</span>
+                  </a-col>
+                  <a-col :span="4"
+                         class="tr">
+                    <span class="grey1">可用资金</span>
+                  </a-col>
+                  <a-col :span="12">
+                    <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+                  </a-col>
+                </a-row>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item class="tc">
+                <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
+                          @click="submit">{{isBuy() ? '卖出' : '买入'}}</a-button>
+                <a-button class="ml10 cancelBtn"
+                          @click="cancel">取消</a-button>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -173,7 +162,7 @@ import { _closeModal } from '@/common/setup/modal/modal';
 import { handleForm, handleNumAndMoney, handleSpotWarrant, getWrPosition } from './setup';
 import { handleIs } from '../../setup';
 import { validateAction } from '@/common/setup/form';
-import { ListingForm } from './interface';
+import { ListingForm, TempWrOrderQuoteDetail } from './interface';
 import { BuyOrSell } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getCanUseMoney } from '@/services/bus/account';
@@ -187,7 +176,7 @@ export default defineComponent({
             type: String as PropType<EnumRouterName>,
         },
         selectedRow: {
-            type: Object as PropType<WrOrderQuoteDetail>,
+            type: Object as PropType<TempWrOrderQuoteDetail>,
             default: {},
         },
         parantSelectedRow: {

+ 6 - 0
src/views/market/spot_trade/components/buy-sell-market/components/delisting/interface.ts

@@ -1,3 +1,5 @@
+import { WrOrderQuoteDetail } from "@/services/go/wrtrade/interface";
+
 export interface ListingForm {
     accountid: undefined | number,
     num: number,
@@ -7,4 +9,8 @@ export interface ListingForm {
 export interface Wrhold {
     id: string,
     name: string,
+}
+
+export interface TempWrOrderQuoteDetail extends WrOrderQuoteDetail {
+    wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[]
 }

+ 4 - 1
src/views/market/spot_trade/components/filter/index.vue

@@ -137,8 +137,9 @@ export default defineComponent({
                     });
                 });
             }
+            const wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[] = [];
             wrLsit.value.forEach((el) => {
-                const { selected, itemtypename } = el;
+                const { selected, itemtypename, dgfactoryitemtypeid } = el;
                 if (selected) {
                     const { key } = selected;
                     if (itemtypename === '仓库') {
@@ -148,6 +149,7 @@ export default defineComponent({
                         const name = el.itemlst.find((e) => e.dgfactoryitemid === key)!.dgfactoryitemvalue;
                         result.dgitemname = result.dgitemname ? `${result.dgitemname},${name}` : name;
                     }
+                    wrResult.push({ dgfactoryitemtypeid, dgfactoryitemid: key });
                 }
             });
             if (!isWR()) {
@@ -160,6 +162,7 @@ export default defineComponent({
             if (isQuery) {
                 context.emit('search', result);
             }
+            result.wrResult = wrResult;
             return result;
         }
         function listingAction() {