huangbin 4 years ago
parent
commit
c54872d0b7

+ 108 - 112
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/index.vue

@@ -1,114 +1,110 @@
 <template>
 <template>
-    <!-- 贸易圈挂牌 -->
-    <Drawer
-        :title="'挂牌'"
-        :placement="'right'"
-        :visible="visible"
-        width="486px"
-        height="479px"
-        @cancel="cancel"
-        class="top"
-    >
-        <div class="delisting">
-            <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-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="挂牌价格" class="relative" name="price">
-                                <a-input-number
-                                    class="dialogInput yellowInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    :max="99999"
-                                    v-model:value="formState.price"
-                                />
-                            </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="99999"
-                                    v-model:value="formState.num"
-                                />
-                                <span
-                                    class="input-enumdicname-absolute"
-                                >{{parantSelectedRow.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="parantSelectedRow.orderqty"
-                                    class="formSlider"
-                                    style="width: 260px"
-                                />
-                                <div class="unit">
-                                    <span>0</span>
-                                    <span>99999{{parantSelectedRow.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="挂牌金额">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="可用资金">
-                                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
+  <!-- 贸易圈挂牌 -->
+  <Drawer :title="'挂牌'"
+          :placement="'right'"
+          :visible="visible"
+          width="486px"
+          height="479px"
+          @cancel="cancel"
+          class="top">
+    <div class="delisting">
+      <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-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="挂牌价格"
+                           class="relative"
+                           name="price">
+                <a-input-number class="dialogInput yellowInput"
+                                style="width: 260px"
+                                :min="0"
+                                :max="99999"
+                                v-model:value="formState.price" />
+              </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="99999"
+                                v-model:value="formState.num" />
+                <span class="input-enumdicname-absolute">{{deliverGoods.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="deliverGoods.orderqty"
+                          class="formSlider"
+                          style="width: 260px" />
+                <div class="unit">
+                  <span>0</span>
+                  <span>99999{{deliverGoods.enumdicname}}</span>
                 </div>
                 </div>
-                <a-row :gutter="24">
-                    <a-col :span="24" class="fixedBtns">
-                        <a-form-item class="btnCenter">
-                            <a-button
-                                class="listedBtn"
-                                :loading="loading"
-                                :disabled="loading"
-                                @click="submit"
-                            >买入</a-button>
-                            <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </a-form>
+              </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="挂牌金额">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="可用资金">
+                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </div>
         </div>
-    </Drawer>
+        <a-row :gutter="24">
+          <a-col :span="24"
+                 class="fixedBtns">
+            <a-form-item class="btnCenter">
+              <a-button class="listedBtn"
+                        :loading="loading"
+                        :disabled="loading"
+                        @click="submit">买入</a-button>
+              <a-button class="ml10 cancelBtn"
+                        @click="cancel">取消</a-button>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+  </Drawer>
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
@@ -137,7 +133,7 @@ export default defineComponent({
     components: { Drawer, PlusOutlined, MinusOutlined },
     components: { Drawer, PlusOutlined, MinusOutlined },
     emits: ['cancel', 'update'],
     emits: ['cancel', 'update'],
     props: {
     props: {
-        parantSelectedRow: {
+        deliverGoods: {
             type: Object as PropType<QueryDeliveryRelationRsp>,
             type: Object as PropType<QueryDeliveryRelationRsp>,
             default: {},
             default: {},
         },
         },
@@ -158,7 +154,7 @@ export default defineComponent({
         function getMoney() {
         function getMoney() {
             return (formState.price * formState.num).toFixed(2);
             return (formState.price * formState.num).toFixed(2);
         }
         }
-        // const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.parantSelectedRow, formState);
+        // const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.deliverGoods, formState);
         function submit() {
         function submit() {
             validateAction<FormState>(formRef, formState).then((res) => {
             validateAction<FormState>(formRef, formState).then((res) => {
                 // 挂牌请求 通过挂牌求购进行挂牌
                 // 挂牌请求 通过挂牌求购进行挂牌
@@ -168,8 +164,8 @@ export default defineComponent({
                     ClientType: 4, // 终端类型
                     ClientType: 4, // 终端类型
                     LoginID: geLoginID_number()!, // 登陆账号
                     LoginID: geLoginID_number()!, // 登陆账号
                     AccountID: getSelectedAccountId(), // 交易账号
                     AccountID: getSelectedAccountId(), // 交易账号
-                    GoodsID: props.parantSelectedRow.goodsid, // 商品ID
-                    MarketID: props.parantSelectedRow.marketid, // 市场ID
+                    GoodsID: props.deliverGoods.goodsid, // 商品ID
+                    MarketID: props.deliverGoods.marketid, // 市场ID
                     ValidType: 1, // 校验类型 当日有效
                     ValidType: 1, // 校验类型 当日有效
                     OperateType: 1, // 操作类型: 申请
                     OperateType: 1, // 操作类型: 申请
                     OrderSrc: 1, // 单据来源: 客户端下单
                     OrderSrc: 1, // 单据来源: 客户端下单