Переглянути джерело

Merge remote-tracking branch 'origin/master'

yu jie 4 роки тому
батько
коміт
5dc945d138

+ 5 - 0
src/views/market/spot_trade/components/buy-sell-market/setup.ts

@@ -86,6 +86,11 @@ export function getHasWR(enumName: EnumRouterName): 0 | 1 {
     }
 }
 
+// true: 固定价; false: 浮动价
+export function isFixed(enumName: EnumRouterName) {
+    return enumName === EnumRouterName.warehouse_receipt_trade_price || enumName === EnumRouterName.warehouse_pre_sale_price;
+}
+
 
 export function handleChildComponentMethod() {
     const childRef = ref<null | { queryTableAction: Function }>(null);

+ 35 - 11
src/views/market/spot_trade/components/post_buying/index.vue

@@ -28,7 +28,7 @@
               </a-form-item>
             </a-col>
             <a-col :span="24"
-                   v-if="isFixed()">
+                   v-if="isFixed(enumName)">
               <a-form-item label="挂牌价格"
                            name="FixedPrice">
                 <a-input-number class="commonInput"
@@ -43,7 +43,6 @@
                            name="PriceMove">
                 <a-input-number class="commonInput"
                                 style="width: 260px"
-                                :min="0"
                                 v-model:value="formState.PriceMove" />
               </a-form-item>
             </a-col>
@@ -59,6 +58,16 @@
               </a-form-item>
             </a-col>
             <a-col :span="24"
+                   v-if="!getHasWR(enumName)">
+              <a-form-item label="交收月"
+                           name="DeliveryMonth">
+                <a-month-picker style="width: 260px"
+                                v-model:value="formState.DeliveryMonth"
+                                :allowClear="false"
+                                class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
                    class="mt-10">
               <a-form-item>
                 <a-slider ::min="0"
@@ -77,9 +86,27 @@
                 <a-input class="commonInput"
                          :suffix="selectedRow.enumdicname"
                          style="width: 260px" />
-                <!-- <div class="tip">最小单位:1吨</div> -->
+                <div class="tip">最小单位:1{{selectedRow.enumdicname}}</div>
               </a-form-item>
             </a-col>
+            <!-- <a-col :span="24">
+              <a-form-item label="挂牌金额"
+                           class="relative">
+                <a-input class="commonInput"
+                         :suffix="selectedRow.enumdicname"
+                         style="width: 260px" />
+                <div class="tip">最小单位:1{{selectedRow.enumdicname}}</div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="履约保证金"
+                           class="relative">
+                <a-input class="commonInput"
+                         :suffix="selectedRow.enumdicname"
+                         style="width: 260px" />
+                <div class="tip">最小单位:1{{selectedRow.enumdicname}}</div>
+              </a-form-item>
+            </a-col> -->
           </a-row>
           <a-row :gutter="24"
                  type="flex"
@@ -121,6 +148,7 @@ import { validateAction } from '@/common/setup/form';
 import { FormParam } from './interface';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getHasWR } from '../buy-sell-market/setup';
+import { isFixed } from '../buy-sell-market/setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -141,9 +169,6 @@ export default defineComponent({
         const loading = ref<boolean>(false);
         const accountList = getAccountTypeList([2]);
         const { rules, formState, formRef } = handleForm();
-        function isFixed() {
-            return props.enumName === EnumRouterName.warehouse_receipt_trade_price || props.enumName === EnumRouterName.warehouse_pre_sale_price;
-        }
         function submit() {
             const marketInfo = getMarketRunByTradeMode(17);
             if (marketInfo) {
@@ -175,7 +200,7 @@ export default defineComponent({
                         // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
                         OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
                         DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID  // 有仓单求购
-                        WRPriceType: isFixed() ? 1 : 2, // 价格方式 1:固定价 2:浮动价
+                        WRPriceType: isFixed(props.enumName) ? 1 : 2, // 价格方式 1:固定价 2:浮动价
                         FixedPrice: res.FixedPrice, // 固定价格
                         PriceFactor: 1, // 价格系数(浮动价时填写)
                         PriceMove: res.PriceMove, // 升贴水(浮动价时填写)
@@ -193,14 +218,12 @@ export default defineComponent({
                         Attachment2: '', // 附件2
                         Remark: '', // 备注
                         ApplyID: 0, // 申请ID
-                        WRTradeGoods: isFixed() ? [] : [wrGoodsInfo],
+                        WRTradeGoods: isFixed(props.enumName) ? [] : [wrGoodsInfo],
                         CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
                         WRStandardID: props.selectedRow.wrstandardid,
                         HasWr: getHasWR(props.enumName), // 无仓单挂牌  是否有无仓单
+                        DeliveryMonth: getHasWR(props.enumName) ? '' : moment(res.DeliveryMonth).format('YYYY-MM'),
                     };
-                    // if (!isFixed()) {
-                    //     Object.assign(param, { WRTradeGoods: [wrGoodsInfo] });
-                    // }
                     requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
                         cancel(true);
                     });
@@ -216,6 +239,7 @@ export default defineComponent({
             formState,
             formRef,
             isFixed,
+            getHasWR,
         };
     },
 });

+ 3 - 0
src/views/market/spot_trade/components/post_buying/interface.ts

@@ -1,6 +1,9 @@
+import { Moment } from "moment";
+
 export interface FormParam {
     accountid: undefined | number,
     FixedPrice: number,
     OrderQty: number,
     PriceMove: number,
+    DeliveryMonth: Moment,
 }

+ 3 - 1
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -1,3 +1,4 @@
+import moment from "moment";
 import { reactive, ref, UnwrapRef } from "vue";
 import { FormParam } from "./interface";
 
@@ -8,6 +9,7 @@ export function handleForm() {
         FixedPrice: 0,
         OrderQty: 0,
         PriceMove: 0,
+        DeliveryMonth: moment()
     })
     const rules = {
         FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', }],
@@ -16,4 +18,4 @@ export function handleForm() {
         accountid: [{ required: true, message: '请输入交易账号' }],
     }
     return { rules, formState, formRef }
-}
+}

+ 0 - 1
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -44,7 +44,6 @@
               <a-form-item label="基差"
                            name="PriceMove">
                 <a-input-number class="commonInput"
-                                :min="0"
                                 v-model:value="formState.PriceMove"
                                 style="width: 140px" />
               </a-form-item>