浏览代码

挂牌求购 履约方式 指定朋友

huangbin 4 年之前
父节点
当前提交
f5dc7e34ce

+ 5 - 5
src/services/request/serviceURL.ts

@@ -82,10 +82,10 @@ export const setServiceURL = (config: URL): void => {
     // console.log('URL', config);
     //外网环境(175),外包同事使用
     serviceURL = config;
-    if (process.env.NODE_ENV === 'development') {
-        serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';
-        serviceURL.quoteUrl = 'ws://218.17.158.45:21009';
-        serviceURL.tradeUrl = 'ws://218.17.158.45:21010';
-    }
+    // if (process.env.NODE_ENV === 'development') {
+    //     serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';
+    //     serviceURL.quoteUrl = 'ws://218.17.158.45:21009';
+    //     serviceURL.tradeUrl = 'ws://218.17.158.45:21010';
+    // }
     console.log('api地址:', serviceURL);
 };

+ 44 - 49
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/friend.vue

@@ -1,46 +1,48 @@
 <template>
-    <!--选择朋友-->
-    <Drawer :title="'选择朋友'" :placement="'right'" :visible="visible" @cancel="cancel" class="top486">
-        <a-spin :spinning="loading">
-            <div class="listed">
-                <a-form class="inlineForm dialogForm">
-                    <a-input-search
-                        placeholder="搜索朋友编码或名称"
-                        class="searchFriendInput noSuffixInput"
-                        enter-button
-                        v-model:value="searchValue"
-                        @search="handleSearch"
-                    >
-                        <template #prefix>
-                            <SearchOutlined />
-                        </template>
-                    </a-input-search>
-                    <div class="formBar ant-checkbox-group commonCheckboxGroup whitebgCheckbox">
-                        <!-- <a-checkbox-group class="commonCheckboxGroup"> -->
-                        <div class="ant-checkbox-wrapper" style="width: 100%">
-                            <div
-                                class="item"
-                                v-for="(item, index) in getViewFriends()"
-                                :key="index + '11'"
-                            >
-                                <a-checkbox v-model:checked="item.checked">
-                                    <span class="txt">{{item.frienduserid}} {{ item.friendname }}</span>
-                                </a-checkbox>
-                            </div>
-                        </div>
-                        <!-- </a-checkbox-group> -->
-                    </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-form-item>
-                        </a-col>
-                    </a-row>
-                </a-form>
+  <!--选择朋友-->
+  <Drawer :title="'选择朋友'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top486">
+    <a-spin :spinning="loading">
+      <div class="listed">
+        <a-form class="inlineForm dialogForm">
+          <a-input-search placeholder="搜索朋友编码或名称"
+                          class="searchFriendInput noSuffixInput"
+                          enter-button
+                          v-model:value="searchValue">
+            <template #prefix>
+              <SearchOutlined />
+            </template>
+          </a-input-search>
+          <div class="formBar ant-checkbox-group commonCheckboxGroup whitebgCheckbox">
+            <!-- <a-checkbox-group class="commonCheckboxGroup"> -->
+            <div class="ant-checkbox-wrapper"
+                 style="width: 100%">
+              <div class="item"
+                   v-for="(item, index) in getViewFriends()"
+                   :key="index + '11'">
+                <a-checkbox v-model:checked="item.checked">
+                  <span class="txt">{{item.frienduserid}} {{ item.friendname }}</span>
+                </a-checkbox>
+              </div>
             </div>
-        </a-spin>
-    </Drawer>
+            <!-- </a-checkbox-group> -->
+          </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-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-spin>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -105,14 +107,7 @@ export default defineComponent({
                 message.warn('请选择朋友');
             }
         }
-        function handleSearch(value: string) {
-            // const findResult = myFriends.value.find((e) => String(e.frienduserid).includes(value));
-            // if (findResult) {
-            //     searchFriend.value = [findResult];
-            // } else {
-            //     queryMyFriend(value);
-            // }
-        }
+
         return {
             loading,
             myFriends,

+ 129 - 118
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/index.vue

@@ -1,123 +1,132 @@
 <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">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.FixedPrice"
-                                />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌数量" name="OrderQty">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.OrderQty"
-                                />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                            </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">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.FixedPrice" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.OrderQty" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
 
-                        <a-col :span="24">
-                            <a-form-item label="起摘数量" name="delistingQty">
-                                <a-input-number
-                                    class="commonInput"
-                                    v-model:value="formState.delistingQty"
-                                    :min="0"
-                                    style="width: 260px"
-                                />
-                                <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="DeliveryMonth">
-                                <a-date-picker
-                                    style="width: 260px"
-                                    v-model:value="formState.DeliveryMonth"
-                                    :allowClear="false"
-                                    class="commonDatePicker dialogDatePicker"
-                                />
-                            </a-form-item>
-                        </a-col>
+            <a-col :span="24">
+              <a-form-item label="起摘数量"
+                           name="delistingQty">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.delistingQty"
+                                :min="0"
+                                style="width: 260px" />
+                <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="DeliveryMonth">
+                <a-date-picker style="width: 260px"
+                               v-model:value="formState.DeliveryMonth"
+                               :allowClear="false"
+                               class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
 
-                        <a-col :span="24" @click="openPermance">
-                            <a-form-item label="履约方式">
-                                <span class="white ml8">选择履约模板</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" @click="openFriend">
-                            <a-form-item label="指定朋友">
-                                <span class="white ml8">选择朋友</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌金额">
-                                <span class="white ml8">55555</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="履约保证金">
-                                <span class="white ml8">55555</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="可用资金">
-                                <span class="white ml8">55555</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"
+                   @click="openPermance">
+              <a-form-item label="履约方式">
+                <span
+                      class="white ml8">{{selectedPermance ? selectedPermance.templatename : '选择履约模板'}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   @click="openFriend">
+              <a-form-item label="指定朋友">
+                <span class="white ml8">{{frineds ? `已选${frineds.length}人` : '选择朋友'}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌金额">
+                <span class="white ml8">55555</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="履约保证金">
+                <span class="white ml8">55555</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="可用资金">
+                <span class="white ml8">55555</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">
@@ -134,7 +143,7 @@ import { getAccountTypeList, getUserId } from '@/services/bus/account';
 import { v4 as uuidv4 } from 'uuid';
 import moment, { Moment } from 'moment';
 import { getMarketRunByTradeMode } from '@/services/bus/market';
-import { QueryOrderQuoteMyqQsp, WrOrderQuote } from '@/services/go/wrtrade/interface';
+import { QueryOrderQuoteMyqQsp, QueryPermancePlanTmpRsp, WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { handleForm, hanldeOpenAndCloseComponent } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { FormParam } from './interface';
@@ -162,7 +171,7 @@ export default defineComponent({
         // 选择朋友
         const { show: showFriend, selected: frineds, close: chooseFriend, open: openFriend } = hanldeOpenAndCloseComponent<number[]>();
         // 履约模板
-        const { show: showPermance, selected: selectedPermance, close: choosePermance, open: openPermance } = hanldeOpenAndCloseComponent<number>();
+        const { show: showPermance, selected: selectedPermance, close: choosePermance, open: openPermance } = hanldeOpenAndCloseComponent<QueryPermancePlanTmpRsp>();
         const loading = ref<boolean>(false);
         const accountList = getAccountTypeList([2]);
         if (accountList.length) {
@@ -253,10 +262,12 @@ export default defineComponent({
             showFriend,
             chooseFriend,
             openFriend,
+            frineds,
 
             showPermance,
             choosePermance,
             openPermance,
+            selectedPermance,
         };
     },
 });

+ 45 - 32
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/permancePlanTmp.vue

@@ -1,36 +1,44 @@
 <template>
-    <!--选择履约模板-->
-    <Drawer
-        :title="'选择履约模板'"
-        :placement="'right'"
-        :visible="visible"
-        @cancel="cancel"
-        class="top486"
-    >
-        <span class="add-permance" @click="open">
-            <svg class="icon svg-icon" aria-hidden="true">
-                <use xlink:href="#icon-xinjianzengjiaxinzeng-20" />
-            </svg>
-        </span>
-        <a-spin :spinning="loading">
-            <div class="moduleContent">
-                <div class="itemBar" v-for="item in tableList" :key="item.autoid">
-                    <div class="itemName">{{item.templatename}}</div>
-                    <div class="rulesCont">
-                        <a-row>
-                            <a-col :span="24" class="ruleCol">
-                                <div class="line" v-for="sub in item.LstStep" :key="sub.autoid">
-                                    <div class="name">{{sub.steptypename}}</div>
-                                    <div class="time">{{sub.stepdate}}</div>
-                                </div>
-                            </a-col>
-                        </a-row>
-                    </div>
+  <!--选择履约模板-->
+  <Drawer :title="'选择履约模板'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top486">
+    <span class="add-permance"
+          @click="open">
+      <svg class="icon svg-icon"
+           aria-hidden="true">
+        <use xlink:href="#icon-xinjianzengjiaxinzeng-20" />
+      </svg>
+    </span>
+    <a-spin :spinning="loading">
+      <div class="moduleContent">
+        <div class="itemBar"
+             v-for="item in tableList"
+             :key="item.autoid"
+             @click="chooseTemp(item)">
+          <div class="itemName">{{item.templatename}}</div>
+          <div class="rulesCont">
+            <a-row>
+              <a-col :span="24"
+                     class="ruleCol">
+                <div class="line"
+                     v-for="sub in item.LstStep"
+                     :key="sub.autoid">
+                  <div class="name">{{sub.steptypename}}</div>
+                  <div class="time">{{sub.stepdate}}</div>
                 </div>
-            </div>
-        </a-spin>
-    </Drawer>
-    <Add v-if="show" @cancel="close" @update="close" />
+              </a-col>
+            </a-row>
+          </div>
+        </div>
+      </div>
+    </a-spin>
+  </Drawer>
+  <Add v-if="show"
+       @cancel="close"
+       @update="close" />
 </template>
 
 <script lang="ts">
@@ -64,7 +72,11 @@ export default defineComponent({
         };
         const { loading, tableList, queryTable } = queryTableList<QueryPermancePlanTmpRsp>();
         queryTable(queryQueryPermancePlanTmp, param);
-
+        // 选择履约模板
+        function chooseTemp(item: QueryPermancePlanTmpRsp) {
+            context.emit('update', item);
+            cancel();
+        }
         return {
             loading,
             cancel,
@@ -73,6 +85,7 @@ export default defineComponent({
             show,
             close,
             open,
+            chooseTemp,
         };
     },
 });