Bladeren bron

fix: 1029

huangbin 4 jaren geleden
bovenliggende
commit
6c08805b6c

+ 10 - 11
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/post-buying/index.vue

@@ -215,20 +215,19 @@ export default defineComponent({
         // 摘牌数量
         const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
         function submit() {
-            if (!formState.permanceTempName) {
-                message.error('请选择履约模板');
-                return;
-            }
-            if (!friendCheck.value) {
-                if (formState.friends.length === 0) {
-                    message.error('请选择朋友');
-                    return;
-                }
-            }
-
             const marketInfo = getMarketRunByTradeMode(17);
             if (marketInfo) {
                 validateAction<BlocsListingForm>(formRef, formState).then((res) => {
+                    if (!formState.permanceTempName) {
+                        message.error('请选择履约模板');
+                        return;
+                    }
+                    if (!friendCheck.value) {
+                        if (formState.friends.length === 0) {
+                            message.error('请选择朋友');
+                            return;
+                        }
+                    }
                     const param = {
                         AccountID: res.accountid, // 默认内部资金账号第一个
                         ClientSerialNo: uuidv4(), // 客户端流水号

+ 161 - 154
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/index.vue

@@ -1,150 +1,158 @@
 <template>
-    <!--仓单贸易 贸易圈挂牌 挂牌求购 -->
-    <Drawer :title="'挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top486">
-        <div class="post_buying">
-            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
-                <div class="formBar">
-                    <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-col :span="24">
-                            <a-form-item label="挂牌价格" name="FixedPrice" class="inputIconBox">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.FixedPrice"
-                                />
-                                <MinusOutlined @click="decreasePrice" />
-                                <PlusOutlined @click="increasePrice" />
-                                <a-checkbox class="commonCheckbox" v-model:checked="priceCheck">可议价</a-checkbox>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌数量" name="OrderQty" class="inputIconBox">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.OrderQty"
-                                />
-                                <MinusOutlined @click="decreaseNumber" />
-                                <PlusOutlined @click="increaseNumber" />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                                <a-checkbox v-model:checked="numCheck" class="commonCheckbox">整单</a-checkbox>
-                            </a-form-item>
-                        </a-col>
+  <!--仓单贸易 贸易圈挂牌 挂牌求购 -->
+  <Drawer :title="'挂牌求购'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top486">
+    <div class="post_buying">
+      <a-form class="inlineForm dialogForm"
+              ref="formRef"
+              :model="formState"
+              :rules="rules">
+        <div class="formBar">
+          <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-col :span="24">
+              <a-form-item label="挂牌价格"
+                           name="FixedPrice"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.FixedPrice" />
+                <MinusOutlined @click="decreasePrice" />
+                <PlusOutlined @click="increasePrice" />
+                <a-checkbox class="commonCheckbox"
+                            v-model:checked="priceCheck">可议价</a-checkbox>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.OrderQty" />
+                <MinusOutlined @click="decreaseNumber" />
+                <PlusOutlined @click="increaseNumber" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                <a-checkbox v-model:checked="numCheck"
+                            class="commonCheckbox">整单</a-checkbox>
+              </a-form-item>
+            </a-col>
 
-                        <a-col :span="24" v-if="!numCheck">
-                            <a-form-item label="起摘数量" name="delistingQty">
-                                <a-input-number
-                                    class="commonInput"
-                                    v-model:value="formState.delistingQty"
-                                    :min="0"
-                                    style="width: 260px !important"
-                                />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="履约保证金" name="margin">
-                                <a-input-number
-                                    class="commonInput"
-                                    v-model:value="formState.margin"
-                                    :min="0"
-                                    style="width: 260px"
-                                />
-                                <span class="input-enumdicname">%</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
-                                <a-date-picker
-                                    style="width: 260px"
-                                    v-model:value="formState.vidaliteTime"
-                                    :allowClear="false"
-                                    class="commonDatePicker dialogDatePicker"
-                                />
-                            </a-form-item>
-                        </a-col>
+            <a-col :span="24"
+                   v-if="!numCheck">
+              <a-form-item label="起摘数量"
+                           name="delistingQty">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.delistingQty"
+                                :min="0"
+                                style="width: 260px !important" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="履约保证金"
+                           name="margin">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.margin"
+                                :min="0"
+                                style="width: 260px" />
+                <span class="input-enumdicname">%</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌有效期"
+                           name="vidaliteTime"
+                           class="inputIconBox">
+                <a-date-picker style="width: 260px"
+                               v-model:value="formState.vidaliteTime"
+                               :allowClear="false"
+                               class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
 
-                        <a-col :span="24">
-                            <a-form-item label="履约方式" class="inputIconBox">
-                                <span
-                                    class="clickBox"
-                                    @click="openPermance"
-                                >{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
-                                <svg
-                                    class="icon svg-icon"
-                                    aria-hidden="true"
-                                    @click="openPermance"
-                                >
-                                    <use xlink:href="#icon-moban" />
-                                </svg>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="指定朋友" class="inputIconBox">
-                                <span
-                                    class="clickBox"
-                                    @click="openFriend"
-                                >{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
-                                <svg class="icon svg-icon" aria-hidden="true" @click="openFriend">
-                                    <use xlink:href="#icon-pengyou1" />
-                                </svg>
-                                <a-checkbox
-                                    class="commonCheckbox"
-                                    v-model:checked="friendCheck"
-                                    @change="limiteFriends"
-                                >不限</a-checkbox>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌金额">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="履约保证金">
-                                <span class="white ml8">{{getMargin()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="可用资金">
-                                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </div>
-                <a-row :gutter="24">
-                    <a-col :span="24" class="fixedBtns">
-                        <a-form-item class="btnCenter">
-                            <a-button class="listedBtn" @click="submit">买入</a-button>
-                            <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </a-form>
+            <a-col :span="24">
+              <a-form-item label="履约方式"
+                           class="inputIconBox">
+                <span class="clickBox"
+                      @click="openPermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
+                <svg class="icon svg-icon"
+                     aria-hidden="true"
+                     @click="openPermance">
+                  <use xlink:href="#icon-moban" />
+                </svg>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="指定朋友"
+                           class="inputIconBox">
+                <span class="clickBox"
+                      @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
+                <svg class="icon svg-icon"
+                     aria-hidden="true"
+                     @click="openFriend">
+                  <use xlink:href="#icon-pengyou1" />
+                </svg>
+                <a-checkbox class="commonCheckbox"
+                            v-model:checked="friendCheck"
+                            @change="limiteFriends">不限</a-checkbox>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌金额">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="履约保证金">
+                <span class="white ml8">{{getMargin()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="可用资金">
+                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </div>
-    </Drawer>
-    <!-- 选择朋友 -->
-    <Friend v-if="showFriend" @cancel="chooseFriend" @update="chooseFriend" />
-    <!-- 选择履约模板 -->
-    <Permance v-if="showPermance" @cancel="choosePermance" @update="choosePermance" />
+        <a-row :gutter="24">
+          <a-col :span="24"
+                 class="fixedBtns">
+            <a-form-item class="btnCenter">
+              <a-button class="listedBtn"
+                        @click="submit">买入</a-button>
+              <a-button class="ml10 cancelBtn"
+                        @click="cancel">取消</a-button>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+  </Drawer>
+  <!-- 选择朋友 -->
+  <Friend v-if="showFriend"
+          @cancel="chooseFriend"
+          @update="chooseFriend" />
+  <!-- 选择履约模板 -->
+  <Permance v-if="showPermance"
+            @cancel="choosePermance"
+            @update="choosePermance" />
 </template>
 
 <script lang="ts">
@@ -194,20 +202,19 @@ export default defineComponent({
         // 摘牌数量
         const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
         function submit() {
-            if (!formState.permanceTempName) {
-                message.error('请选择履约模板');
-                return;
-            }
-            if (!friendCheck.value) {
-                if (formState.friends.length === 0) {
-                    message.error('请选择朋友');
-                    return;
-                }
-            }
-
             const marketInfo = getMarketRunByTradeMode(17);
             if (marketInfo) {
                 validateAction<BlocsListingForm>(formRef, formState).then((res) => {
+                    if (!formState.permanceTempName) {
+                        message.error('请选择履约模板');
+                        return;
+                    }
+                    if (!friendCheck.value) {
+                        if (formState.friends.length === 0) {
+                            message.error('请选择朋友');
+                            return;
+                        }
+                    }
                     const param = {
                         AccountID: res.accountid, // 默认内部资金账号第一个
                         ClientSerialNo: uuidv4(), // 客户端流水号