huangbin il y a 4 ans
Parent
commit
d9095fa9d1

+ 24 - 26
src/common/components/drawer/index.vue

@@ -1,27 +1,25 @@
 <template>
-    <div class="drawer">
-        <a-drawer
-            :placement="placement"
+  <a-drawer :placement="placement"
             :closable="false"
             :visible="visible"
+            :destroyOnClose="true"
             class="bottomListed"
-            height="406px"
-        >
-            <!-- 摘牌是top  挂牌是bottom 期货交易是tradeDialog -->
-            <div class="collapse" @click="cancel">
-                <DoubleRightOutlined />
-            </div>
-            <div class="collapseCont">
-                <div class="title">{{ title }}</div>
-                <div class="content highContent">
-                    <!-- <Listed></Listed> -->
-                    <!-- <Delisting></Delisting> -->
-                    <slot></slot>
-                    <!-- <Trade></Trade> -->
-                </div>
-            </div>
-        </a-drawer>
+            height="406px">
+    <!-- 摘牌是top  挂牌是bottom 期货交易是tradeDialog -->
+    <div class="collapse"
+         @click="cancel">
+      <DoubleRightOutlined />
     </div>
+    <div class="collapseCont">
+      <div class="title">{{ title }}</div>
+      <div class="content highContent">
+        <!-- <Listed></Listed> -->
+        <!-- <Delisting></Delisting> -->
+        <slot></slot>
+        <!-- <Trade></Trade> -->
+      </div>
+    </div>
+  </a-drawer>
 </template>
 
 <script lang="ts">
@@ -33,10 +31,6 @@ import Trade from '@/views/market/warehouseTrade/components/trade/index.vue';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { DoubleRightOutlined } from '@ant-design/icons-vue';
 
-interface Key {
-    [propName: string]: string;
-}
-
 export default defineComponent({
     name: 'drawer',
     emits: ['cancel'],
@@ -54,6 +48,10 @@ export default defineComponent({
             default: 'right',
             type: String,
         },
+        // visible: {
+        //     default: false,
+        //     type: Boolean,
+        // },
     },
     components: {
         Listed,
@@ -62,10 +60,10 @@ export default defineComponent({
         DoubleRightOutlined,
     },
     setup(props, context) {
-        const { visible, cancel } = _closeModal(context);
-        // const { visible, cancel } = closeModal(props.modalName);
+        function cancel() {
+            context.emit('cancel');
+        }
         return {
-            visible,
             cancel,
         };
     },

+ 155 - 137
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -1,95 +1,105 @@
 <template>
-    <!-- 现货仓单 现货明细 挂牌 -->
-    <Drawer :title="'挂牌'" :placement="'bottom'" :visible="visible">
-        <div class="listed">
-            <div class="condition">
-                <a-button class="conditionBtn">螺纹钢</a-button>
-                <a-button class="conditionBtn">12mm-江铜</a-button>
-                <!-- <a-button class="conditionBtn">江铜</a-button> -->
-                <a-button class="conditionBtn">华南仓库</a-button>
-            </div>
-            <div class="formBar">
-                <a-form class="inlineForm dialogForm" :form="form" @submit="handleSearch">
-                    <a-row :gutter="24">
-                        <a-col :span="12">
-                            <a-form-item label="挂牌方式">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    default-value="1"
-                                    style="width: 140px"
-                                >
-                                    <a-select-option value="1">一口价</a-select-option>
-                                    <a-select-option value="2">一口价2</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">
-                            <a-form-item label="挂牌价">
-                                <a-input class="commonInput" style="width: 140px" />
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="12">
-                            <a-form-item label="挂牌数量">
-                                <a-input class="commonInput" suffix="吨" style="width: 140px" />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">
-                            <a-form-item label="起摘数量" class="relative">
-                                <a-input class="commonInput" suffix="吨" style="width: 140px" />
-                                <div class="tip">最小单位:1吨</div>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="12" class="mt-20">
-                            <a-form-item>
-                                <a-progress class="formProgress" :percent="30" />
-                                <div class="unit">
-                                    <span>0</span>
-                                    <span>300吨</span>
-                                </div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">&nbsp;</a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="行情商品">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    style="width: 135px"
-                                    placeholder="请择交易所"
-                                >
-                                    <!-- <a-select-option value="1">一口价</a-select-option>
+  <!-- 现货仓单 现货明细 挂牌 -->
+  <Drawer :title="'挂牌'"
+          :placement="'bottom'"
+          v-if="visible"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listed">
+      <div class="condition">
+        <a-button class="conditionBtn">螺纹钢</a-button>
+        <a-button class="conditionBtn">12mm-江铜</a-button>
+        <!-- <a-button class="conditionBtn">江铜</a-button> -->
+        <a-button class="conditionBtn">华南仓库</a-button>
+      </div>
+      <div class="formBar">
+        <a-form class="inlineForm dialogForm"
+                :form="form"
+                @submit="handleSearch">
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="挂牌方式">
+                <a-select class="inlineFormSelect"
+                          default-value="1"
+                          style="width: 140px">
+                  <a-select-option value="1">一口价</a-select-option>
+                  <a-select-option value="2">一口价2</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="挂牌价">
+                <a-input class="commonInput"
+                         style="width: 140px" />
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="挂牌数量">
+                <a-input class="commonInput"
+                         suffix="吨"
+                         style="width: 140px" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="起摘数量"
+                           class="relative">
+                <a-input class="commonInput"
+                         suffix="吨"
+                         style="width: 140px" />
+                <div class="tip">最小单位:1吨</div>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12"
+                   class="mt-20">
+              <a-form-item>
+                <a-progress class="formProgress"
+                            :percent="30" />
+                <div class="unit">
+                  <span>0</span>
+                  <span>300吨</span>
+                </div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">&nbsp;</a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="行情商品">
+                <a-select class="inlineFormSelect"
+                          style="width: 135px"
+                          placeholder="请择交易所">
+                  <!-- <a-select-option value="1">一口价</a-select-option>
                                     <a-select-option value="2">一口价2</a-select-option>-->
-                                </a-select>
-                                <a-select
-                                    class="inlineFormSelect ml5"
-                                    style="width: 135px"
-                                    placeholder="请选择商品"
-                                ></a-select>
-                                <a-select
-                                    class="inlineFormSelect ml5"
-                                    style="width: 135px"
-                                    placeholder="请选择合约"
-                                ></a-select>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24" type="flex" justify="center">
-                        <a-col :span="24">
-                            <a-form-item class="tc">
-                                <a-button class="listedBtn">卖出</a-button>
-                                <a-button class="ml10 cancelBtn">取消</a-button>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </a-form>
-            </div>
-        </div>
-    </Drawer>
+                </a-select>
+                <a-select class="inlineFormSelect ml5"
+                          style="width: 135px"
+                          placeholder="请选择商品"></a-select>
+                <a-select class="inlineFormSelect ml5"
+                          style="width: 135px"
+                          placeholder="请选择合约"></a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24"
+                 type="flex"
+                 justify="center">
+            <a-col :span="24">
+              <a-form-item class="tc">
+                <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>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -103,66 +113,74 @@ import { hdWROrder } from '@/services/proto/warehousetrade';
 import { v4 as uuidv4 } from 'uuid';
 import moment from 'moment';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { _closeModal } from '@/common/setup/modal/modal';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_spot_details_listed,
     components: { Drawer },
+    emits: ['cancel'],
     props: {
         selectedRow: {
             type: Object as PropType<WrHoldLB>,
             default: {},
         },
     },
-    setup(props) {
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
         const data = props.selectedRow;
         const loading = ref<boolean>(false);
-        debugger;
-        const param = {
-            AccountID: data.accountid.toString(),
-            ClientSerialNo: uuidv4(), // 客户端流水号
-            // OperateSrc: 2,
-            ClientType: 4,
-            // MarketID: 17201,
-            LadingBillId: props.selectedRow.ladingbillid.toString(), // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-            // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-            TradeDate: moment('20210727').format('YYYYMMDD'), // 交易日 string
-            // SubNum: '0', // 提单子单号
-            SubNum: props.selectedRow.subnum,
-            // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-            WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-            IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
-            // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
-            OrderQty: 1, // 委托数量(可挂部分数据量) ======
-            DeliveryGoodsID: data.deliverygoodsid, // 交割商品商品ID
-            WRPriceType: 1, // 价格方式 1:固定价 2:浮动价
-            FixedPrice: 10, // 固定价格
-            PriceFactor: 0, // 价格系数(浮动价时填写)
-            PriceMove: 0, // 升贴水(浮动价时填写)
-            TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
-            // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
-            ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
-            FirstRatio: 0, // 首付比例
-            PerformanceTemplateID: 0, // 履约计划模板ID
-            UserID: getUserId(),
-            OperatorID: getUserId(), // 操作员账号ID
-            BuyOrSell: 1, // 买卖方向 0买1卖
-            PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
-            CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
-            Attachment1: '', // 附件1
-            Attachment2: '', // 附件2
-            Remark: '222', // 备注
-            ApplyID: 0, // 申请ID
-            CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
-            WRTradeGoods: [],
-            wrstandardid: 1,
-            HasWr: 1,
-        };
-        console.log(param);
-        requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
-            // cancel(true);
-        });
+        function submit() {
+            debugger;
+            const param = {
+                AccountID: data.accountid.toString(),
+                ClientSerialNo: uuidv4(), // 客户端流水号
+                // OperateSrc: 2,
+                ClientType: 4,
+                // MarketID: 17201,
+                LadingBillId: props.selectedRow.ladingbillid.toString(), // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+                // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+                TradeDate: moment('20210727').format('YYYYMMDD'), // 交易日 string
+                // SubNum: '0', // 提单子单号
+                SubNum: props.selectedRow.subnum,
+                // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+                WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+                IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
+                // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
+                OrderQty: 1, // 委托数量(可挂部分数据量) ======
+                DeliveryGoodsID: data.deliverygoodsid, // 交割商品商品ID
+                WRPriceType: 1, // 价格方式 1:固定价 2:浮动价
+                FixedPrice: 10, // 固定价格
+                PriceFactor: 0, // 价格系数(浮动价时填写)
+                PriceMove: 0, // 升贴水(浮动价时填写)
+                TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
+                // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
+                ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+                FirstRatio: 0, // 首付比例
+                PerformanceTemplateID: 0, // 履约计划模板ID
+                UserID: getUserId(),
+                OperatorID: getUserId(), // 操作员账号ID
+                BuyOrSell: 1, // 买卖方向 0买1卖
+                PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
+                CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
+                Attachment1: '', // 附件1
+                Attachment2: '', // 附件2
+                Remark: '222', // 备注
+                ApplyID: 0, // 申请ID
+                CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
+                WRTradeGoods: [],
+                wrstandardid: 1,
+                HasWr: 1,
+            };
+            console.log(param);
+            requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
+                // cancel(true);
+            });
+        }
+
         return {
-            visible: true,
+            submit,
+            visible,
+            cancel,
         };
     },
 });