huangbin преди 4 години
родител
ревизия
5f7354b89a

+ 4 - 4
src/common/components/drawer/index.vue

@@ -48,10 +48,10 @@ export default defineComponent({
             default: 'right',
             type: String,
         },
-        // visible: {
-        //     default: false,
-        //     type: Boolean,
-        // },
+        visible: {
+            default: false,
+            type: Boolean,
+        },
     },
     components: {
         Listed,

+ 38 - 18
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -7,48 +7,55 @@
           @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>
+        <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
+        <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
+        <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
       </div>
       <div class="formBar">
         <a-form class="inlineForm dialogForm"
-                :form="form"
-                @submit="handleSearch">
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
           <a-row :gutter="24">
             <a-col :span="12">
-              <a-form-item label="挂牌方式">
+              <a-form-item label="挂牌方式"
+                           name="WRPriceType">
                 <a-select class="inlineFormSelect"
                           default-value="1"
+                          v-model:value="formState.WRPriceType"
                           style="width: 140px">
-                  <a-select-option value="1">一口价</a-select-option>
-                  <a-select-option value="2">一口价2</a-select-option>
+                  <a-select-option :value="1">一口价</a-select-option>
+                  <a-select-option :value="2">浮动价</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :span="12">
-              <a-form-item label="挂牌价">
+              <a-form-item label="挂牌价"
+                           name="FixedPrice">
                 <a-input class="commonInput"
+                         v-model:value="formState.FixedPrice"
                          style="width: 140px" />
               </a-form-item>
             </a-col>
           </a-row>
           <a-row :gutter="24">
             <a-col :span="12">
-              <a-form-item label="挂牌数量">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty">
                 <a-input class="commonInput"
-                         suffix="吨"
+                         :suffix="selectedRow.enumdicname"
+                         v-model:value="formState.OrderQty"
                          style="width: 140px" />
+
               </a-form-item>
             </a-col>
             <a-col :span="12">
               <a-form-item label="起摘数量"
                            class="relative">
                 <a-input class="commonInput"
-                         suffix="吨"
+                         :suffix="selectedRow.enumdicname"
                          style="width: 140px" />
-                <div class="tip">最小单位:1</div>
+                <div class="tip">最小单位:1{{selectedRow.enumdicname}}</div>
               </a-form-item>
             </a-col>
           </a-row>
@@ -56,11 +63,14 @@
             <a-col :span="12"
                    class="mt-20">
               <a-form-item>
-                <a-progress class="formProgress"
-                            :percent="30" />
+                <a-slider v-model:value="formState.OrderQty"
+                          :min="0"
+                          :max="selectedRow.enableqty" />
+                <!-- <a-progress class="formProgress"
+                            :percent="30" /> -->
                 <div class="unit">
                   <span>0</span>
-                  <span>300吨</span>
+                  <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
                 </div>
               </a-form-item>
             </a-col>
@@ -114,6 +124,9 @@ import { v4 as uuidv4 } from 'uuid';
 import moment from 'moment';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
+import { handlePasswordForm } from './setup';
+import { validateAction } from '@/common/setup/form';
+import { ListingForm } from './interface';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_spot_details_listed,
@@ -127,10 +140,13 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
+        console.log('selectedRow', props.selectedRow);
+        const { rules, formState, formRef } = handlePasswordForm();
         const data = props.selectedRow;
         const loading = ref<boolean>(false);
         function submit() {
-            debugger;
+            // validateAction<ListingForm>(formRef, formState).then((res) => {
+            //     debugger;
             const param = {
                 AccountID: data.accountid.toString(),
                 ClientSerialNo: uuidv4(), // 客户端流水号
@@ -175,12 +191,16 @@ export default defineComponent({
             requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
                 // cancel(true);
             });
+            // });
         }
 
         return {
             submit,
             visible,
             cancel,
+            rules,
+            formState,
+            formRef,
         };
     },
 });

+ 6 - 0
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/interface.ts

@@ -0,0 +1,6 @@
+export interface ListingForm {
+    WRPriceType: 1 | 2,// 价格方式 1:固定价 2:浮动价
+    FixedPrice: number, // 固定价格
+    OrderQty: number,
+    PriceMove: number,// 升贴水(浮动价时填写)
+}

+ 19 - 0
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -0,0 +1,19 @@
+import { reactive, ref, UnwrapRef } from "vue";
+import { ListingForm } from "./interface";
+
+export function handlePasswordForm() {
+    const formRef = ref();
+    const formState: UnwrapRef<ListingForm> = reactive({
+        WRPriceType: 1,
+        FixedPrice: 0,
+        OrderQty: 0,
+        PriceMove: 1,
+    })
+    const rules = {
+        FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number' }],
+        OrderQty: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number' }],
+        // comfirePassword: [{ required: true, validator: validatePassword, trigger: 'blur' }],
+
+    }
+    return { rules, formState, formRef }
+}