소스 검색

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 년 전
부모
커밋
8180a55304

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
+    "apiUrl": "http://192.168.31.135:8080/cfg?key=test_135"
 }

+ 13 - 16
src/common/components/permanceTemp/addPermanceTemp.vue

@@ -101,25 +101,22 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, Ref, ref, UnwrapRef } from 'vue';
 import { Des } from '@/common/components/commonDes';
-import { _closeModal } from '@/common/setup/modal/modal';
 import Drawer from '@/common/components/drawer/index.vue';
-import { PlusOutlined, MinusOutlined, SearchOutlined, PlusCircleOutlined } from '@ant-design/icons-vue';
-import { QueryPermancePlanTmpRsp, QueryWrFriendApplyRsp, QueryWrPerformanceStepTypeRsp } from '@/services/go/wrtrade/interface';
-import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
-import { queryQueryWrFriend, queryWrPerformanceStepType } from '@/services/go/wrtrade';
-import { message } from 'ant-design-vue';
-import { useQueryData } from '@/common/setup/request';
-import { AddPerformanceTemp, PerfomanceStempTempInfo } from '@/services/proto/performance/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { validateAction } from '@/common/setup/form';
-import { PermanceTemp, PermanceTempForm } from './interface';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { useQueryData } from '@/common/setup/request';
 import { getUserId } from '@/services/bus/account';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { addPerformanceTemp } from '@/services/proto/performance';
 import { geLoginID_number } from '@/services/bus/login';
-import { onMounted } from '@vue/runtime-core';
-import { RuleObject } from 'ant-design-vue/lib/form/interface';
+import { queryWrPerformanceStepType } from '@/services/go/wrtrade';
+import { QueryPermancePlanTmpRsp, QueryWrPerformanceStepTypeRsp } from '@/services/go/wrtrade/interface';
+import { addPerformanceTemp } from '@/services/proto/performance';
+import { AddPerformanceTemp, PerfomanceStempTempInfo } from '@/services/proto/performance/interface';
+import { MinusOutlined, PlusCircleOutlined, PlusOutlined, SearchOutlined } from '@ant-design/icons-vue';
+import { message } from 'ant-design-vue';
+import { defineComponent, PropType, reactive, Ref, ref, UnwrapRef } from 'vue';
+import { PermanceTemp, PermanceTempForm } from './interface';
 
 // 初始化 模板
 const initTemp = (): PermanceTemp => {
@@ -289,12 +286,12 @@ export default defineComponent({
                     return;
                 }
                 const performancesteps: PerfomanceStempTempInfo[] = res.domains.map((el, i) => {
-                    const { steptypeid, stepvalue, stepdays, isauto, remark } = el;
+                    const { steptypeid, stepvalue, stepdays, remark } = el;
                     return {
                         steptypeid: steptypeid as number,
                         stepvalue: stepvalue as number,
                         stepdays: stepdays as number,
-                        isauto,
+                        isauto: 1,
                         remark,
                         stepindex: i + 1,
                     };

+ 36 - 0
src/hooks/form/verify.ts

@@ -0,0 +1,36 @@
+import { RuleObject } from "ant-design-vue/lib/form/interface";
+
+// 验证 挂牌数量
+/**
+ *
+ * @param delistingQty 起摘数量
+ * @param 挂牌数量对应的key
+ * @param minivalue 最小单位
+ * @param maxValue 最大数量(可选)
+ * @returns
+ */
+export const useVerifyListingNum = <T extends object, k extends keyof T>(formState: T, key: k, minivalue: number, maxValue?: number) => {
+    const v_num = async (rule: RuleObject, value: number) => {
+        if (value) {
+            if (formState[key] && value < (formState[key] as unknown as number)) {
+                return Promise.reject(`挂牌数量不能小于起摘数量`)
+            }
+            if (value < minivalue) {
+                return Promise.reject(`挂牌数量不能小于${minivalue}`)
+            }
+            if (maxValue && value > maxValue) {
+                return Promise.reject(`挂牌数量不能大于${maxValue}`)
+            }
+            if (value % minivalue) {
+                return Promise.reject(`挂牌数量不是${minivalue}的倍数`)
+            }
+
+            return Promise.resolve();
+
+        } else {
+            return Promise.reject('请输入挂牌数量')
+        }
+    };
+    return { v_num }
+}
+

+ 1 - 0
src/services/go/wrtrade/interface.ts

@@ -406,6 +406,7 @@ export interface WrHoldLB {
     wrstandardid: number;//现货商品ID
     wrstandardname: string;//商品名称
     wrtypename: string;//商品
+    minivalue: number;
 }
 
 /**

+ 2 - 13
src/views/market/spot_trade/components/filter/index.vue

@@ -144,6 +144,8 @@ export default defineComponent({
                         if (el.key === id) {
                             //  品种id
                             result.deliverygoodsid = +(item.key as string).replace('--', '');
+                            result.enumdicname = el.enumdicname;
+                            result.minivalue = el.minivalue;
                         }
                     });
                 });
@@ -207,19 +209,6 @@ export default defineComponent({
                 }
                 const result = search(false);
 
-                const obj = {
-                    enumdicname: '',
-                    minivalue: 0,
-                };
-                FtDeliveryGoods.value.forEach((el) => {
-                    el.children?.forEach((e) => {
-                        e.key === selectedFT.value;
-                        obj.enumdicname = e.enumdicname;
-                        obj.minivalue = e.minivalue;
-                    });
-                });
-                Object.assign(result, obj);
-
                 context.emit('buy', result, selectedGoods.value);
             }
         }

+ 136 - 84
src/views/market/spot_trade/components/post_buying/index.vue

@@ -1,70 +1,116 @@
 <template>
-    <!-- 挂牌求购 -->
-    <Drawer :title="'挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top">
-        <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" v-if="!isFloat()">
-                            <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" v-else>
-                            <a-form-item label="基差" name="PriceMove">
-                                <a-input-number class="commonInput" style="width: 260px" v-model:value="formState.PriceMove" />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="isFloat()">
-                            <a-form-item label="估算价" name="PriceMove">
-                                <span class="white">{{ getPrice() }}</span>
-                            </a-form-item>
-                        </a-col>
+  <!-- 挂牌求购 -->
+  <Drawer :title="'挂牌求购'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top">
+    <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"
+                   v-if="!isFloat()">
+              <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"
+                   v-else>
+              <a-form-item label="基差"
+                           name="PriceMove">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                v-model:value="formState.PriceMove" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="isFloat()">
+              <a-form-item label="估算价"
+                           name="PriceMove">
+                <span class="white">{{ getPrice() }}</span>
+              </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" :max="getMaxNum()" v-model:value="formState.OrderQty" />
-                                <span class="input-enumdicname">{{ selectedRow.enumdicname }}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="!isWR()">
-                            <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" v-model:value="formState.OrderQty" :max="getMaxNum()" class="formSlider" />
-                                <div class="unit">
-                                    <span>{{ getMaxNum() ? selectedRow.minivalue : 0 }}</span>
-                                    <span>{{ getMaxNum() }}{{ selectedRow.enumdicname }}</span>
-                                </div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="起摘数量" class="relative">
-                                <a-input class="commonInput" :suffix="selectedRow.enumdicname" :min="selectedRow.minivalue" style="width: 260px !important" />
-                                <div class="tip">最小单位:{{ selectedRow.minivalue }}{{ selectedRow.enumdicname }}</div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" class="relative mt20">
-                            <a-form-item :label="isFloat() ? '估算金额' : '挂牌金额'">
-                                <span class="white ml8">{{ getMoney() }}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="getMargin()">
-                            <a-form-item :label="getMargin() ? '履约保证金' : ''">
-                                <!-- <a-row>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                :max="getMaxNum()"
+                                v-model:value="formState.OrderQty" />
+                <span class="input-enumdicname">{{ selectedRow.enumdicname }}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="!isWR()">
+              <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"
+                          v-model:value="formState.OrderQty"
+                          :max="getMaxNum()"
+                          class="formSlider" />
+                <div class="unit">
+                  <span>{{ getMaxNum() ? selectedRow.minivalue : 0 }}</span>
+                  <span>{{ getMaxNum() }}{{ selectedRow.enumdicname }}</span>
+                </div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="起摘数量"
+                           name="DelistMinQty"
+                           class="relative">
+                <a-input-number class="commonInput"
+                                :suffix="selectedRow.enumdicname"
+                                v-model:value="formState.DelistMinQty"
+                                :min="0"
+                                style="width: 260px !important" />
+                <div class="tip">最小单位:{{ selectedRow.minivalue }}{{ selectedRow.enumdicname }}</div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   class="relative mt20">
+              <a-form-item :label="isFloat() ? '估算金额' : '挂牌金额'">
+                <span class="white ml8">{{ getMoney() }}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="getMargin()">
+              <a-form-item :label="getMargin() ? '履约保证金' : ''">
+                <!-- <a-row>
                                 <a-col :span="8">-->
-                                <span class="white ml8">{{ getMargin() }}</span>
-                                <!-- </a-col>
+                <span class="white ml8">{{ getMargin() }}</span>
+                <!-- </a-col>
                                     <a-col :span="4" class="tr">
                                         <span class="grey1">可用资金</span>
                                     </a-col>
@@ -74,26 +120,31 @@
                                         >{{getCanUseMoney(getSelectedAccount())}}</span>
                                     </a-col>
                                 </a-row>-->
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="可用资金">
-                                <span class="white ml8">{{ getCanUseMoney(getSelectedAccount()) }}</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" :loading="loading">买入</a-button>
-                            <a-button class="ml10 cancelBtn" @click="cancel" :disabled="loading">取消</a-button>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </a-form>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="可用资金">
+                <span class="white ml8">{{ getCanUseMoney(getSelectedAccount()) }}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </div>
-    </Drawer>
+        <a-row :gutter="24">
+          <a-col :span="24"
+                 class="fixedBtns">
+            <a-form-item class="btnCenter">
+              <a-button class="listedBtn"
+                        @click="submit"
+                        :loading="loading">买入</a-button>
+              <a-button class="ml10 cancelBtn"
+                        @click="cancel"
+                        :disabled="loading">取消</a-button>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -140,7 +191,7 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
-        const { rules, formState, formRef } = handleForm();
+        const { rules, formState, formRef } = handleForm(props.selectedRow);
         const loading = ref<boolean>(false);
         const accountList = getAccountTypeList([2]);
         if (accountList.length) {
@@ -205,6 +256,7 @@ export default defineComponent({
                         CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
                         WRStandardID: props.selectedRow.wrstandardid,
                         HasWr: isWR(), // 无仓单挂牌  是否有无仓单
+                        DelistMinQty: res.DelistMinQty, // 起摘数量
                         DeliveryMonth: isWR() ? '' : moment(res.DeliveryMonth).format('YYYY-MM'),
                         FactoryItems:
                             props.selectedRow.wrResult != undefined

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

@@ -7,6 +7,7 @@ export interface FormParam {
     OrderQty: number,
     PriceMove: number,
     DeliveryMonth: Moment,
+    DelistMinQty: number,
 }
 
 

+ 21 - 11
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -1,29 +1,39 @@
 import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
+import { useVerifyListingNum } from '@/hooks/form/verify';
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
 import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { WrOrderQuote } from "@/services/go/wrtrade/interface";
 import moment from "moment";
-import { reactive, ref, UnwrapRef } from "vue";
+import { onBeforeUnmount, reactive, ref, UnwrapRef } from "vue";
 import { getGoodsPrice, handleIs } from "../buy-sell-market/setup";
-import { FormParam } from "./interface";
+import { FormParam, TempWrOrderQuoteDetail } from "./interface";
 
-const formState: UnwrapRef<FormParam> = reactive({
-    accountid: undefined,
-    FixedPrice: 0,
-    OrderQty: 0,
-    PriceMove: 0,
-    DeliveryMonth: moment()
-})
-export function handleForm() {
+function initFormData(): FormParam {
+    return {
+        accountid: undefined,
+        FixedPrice: 0,
+        OrderQty: 0,
+        PriceMove: 0,
+        DelistMinQty: 0,
+        DeliveryMonth: moment()
+    }
+}
+const formState: UnwrapRef<FormParam> = reactive(initFormData())
+export function handleForm(selectedRow: TempWrOrderQuoteDetail) {
     const formRef = ref();
+    formState.OrderQty = selectedRow.minivalue
+    const { v_num } = useVerifyListingNum<FormParam, 'DelistMinQty'>(formState, 'DelistMinQty', selectedRow.minivalue)
     const rules = {
         FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', }],
-        OrderQty: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number', min: 1 }],
+        OrderQty: [{ required: true, validator: v_num, trigger: 'change', type: 'number' }],
         PriceMove: [{ required: true, message: '请输入基差', trigger: 'blur', type: 'number' }],
         accountid: [{ required: true, message: '请输入交易账号' }],
     }
+    onBeforeUnmount(() => {
+        Object.assign(formState, initFormData(), { OrderQty: selectedRow.minivalue })
+    })
     return { rules, formState, formRef }
 }
 

+ 111 - 0
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_deal/components/pre_sale_warehouse_receipt_deal_detail/index.vue

@@ -0,0 +1,111 @@
+<template>
+    <Drawer :title="'详情'" :placement="'right'" class="delistingBottom" :visible="visible" @cancel="cancel">
+        <div class="detail">
+            <div class="detail__body">
+                <a-row v-for="(item, index) in columns" :key="index">
+                    <a-col :span="6">{{ item.columntitle }}</a-col>
+                    <a-col :span="18">{{ handleDetailValue(item.columnfield) }}</a-col>
+                </a-row>
+            </div>
+            <div class="detail__footer">
+                <a-button class="cancelBtn" @click="cancel">取消</a-button>
+            </div>
+        </div>
+    </Drawer>
+</template>
+
+<script lang="ts">
+import Drawer from '@/common/components/drawer/index.vue';
+import { BtnList, ModalEnum } from '@/common/export/commonTable';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { QueryWrTradeBargainApplyQsp, WrOrderDetail } from '@/services/go/wrtrade/interface';
+import { defineComponent, PropType, ref } from 'vue';
+import { getWrOrderTypeName } from '@/common/constants/enumsName';
+import { Column } from '@/services/go/commonService/interface';
+import { getTableHead } from '@/common/methods/table';
+import { TableKey } from '@/common/methods/table/interface';
+
+export default defineComponent({
+    name: ModalEnum.pre_sale_warehouse_receipt_deal_detail,
+    components: { Drawer, BtnList },
+    emits: ['cancel', 'update'],
+    props: {
+        tableName: Object as PropType<keyof TableKey>,
+        selectedRow: {
+            type: Object as PropType<QueryWrTradeBargainApplyQsp & WrOrderDetail>,
+            default: {},
+        },
+        isMy: {
+            type: Boolean,
+            default: true,
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const columns = ref<Column[]>([]);
+
+        if (props.tableName) {
+            columns.value = getTableHead(props.tableName);
+        }
+
+        // 处理详情数据
+        const handleDetailValue = (field: keyof typeof props.selectedRow) => {
+            const data = props.selectedRow;
+            // 挂牌类型
+            if (field === 'wrtradetype') {
+                return getWrOrderTypeName(data.buyorsell, data.wrtradetype);
+            }
+            // 成交金额
+            if (field === 'amount') {
+                return data.tradeqty * data.tradeprice;
+            }
+            return data[field];
+        };
+
+        return {
+            visible,
+            columns,
+            cancel,
+            getWrOrderTypeName,
+            handleDetailValue,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+.detail {
+    [theme='light'] & {
+        --label-color: #7a8a94;
+        --text-color: #333;
+    }
+
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+
+    &__body {
+        flex: 1;
+        overflow-y: auto;
+        padding: 0 25px;
+
+        .ant-row {
+            margin-top: 10px;
+
+            .ant-col {
+                &:first-child {
+                    color: var(--label-color, #7a8a94);
+                }
+                &:last-child {
+                    color: var(--text-color, #fff);
+                }
+            }
+        }
+    }
+
+    &__footer {
+        text-align: center;
+        padding: 20px 0;
+    }
+}
+</style>;

+ 23 - 35
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_deal/index.vue

@@ -1,38 +1,22 @@
 <template>
-  <!-- 成交 -->
-  <section>
-    <a-table :columns="columns"
-             class="srcollYTable expandLeftTable"
-             :scroll="{ x: '100%', y: '190px' }"
-             :pagination="false"
-             :loading="loading"
-             :expandedRowKeys="expandedRowKeys"
-             :customRow="Rowclick"
-             :expandIcon="expandIcon"
-             :expandIconAsCell="false"
-             rowKey="key"
-             :data-source="tableList">
-      <!-- 额外的展开行 -->
-      <template #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
-                 class="btn-list-sticky"
-                 :record="record"
-                 @click="openComponent" />
-      </template>
-      <!-- 成交金额 -->
-      <template #amount="{ record }">
-        <a>{{ record.tradeqty * record.tradeprice }}</a>
-      </template>
-      <!-- 挂牌类型 -->
-      <template #wrtradetype="{ record }">
-        <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
-      </template>
-    </a-table>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"></component>
-  </section>
+    <!-- 成交 -->
+    <section>
+        <a-table :columns="columns" class="srcollYTable expandLeftTable" :scroll="{ x: '100%', y: '190px' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="tableList">
+            <!-- 额外的展开行 -->
+            <template #expandedRowRender="{ record }">
+                <BtnList :btnList="btnList" class="btn-list-sticky" :record="record" @click="openComponent" />
+            </template>
+            <!-- 成交金额 -->
+            <template #amount="{ record }">
+                <a>{{ record.tradeqty * record.tradeprice }}</a>
+            </template>
+            <!-- 挂牌类型 -->
+            <template #wrtradetype="{ record }">
+                <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
+            </template>
+        </a-table>
+        <component :is="componentId" v-if="componentId" :tableName="tableName" :selectedRow="selectedRow" @cancel="closeComponent"></component>
+    </section>
 </template>
 
 <script lang="ts">
@@ -45,13 +29,16 @@ import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { getWrOrderTypeName } from '@/common/constants/enumsName';
+import { TableKey } from '@/common/methods/table/interface';
 
 export default defineComponent({
     name: enumOrderComponents.pre_sale_warehouse_receipt_deal,
     components: {
         BtnList,
+        pre_sale_warehouse_receipt_deal_detail: defineAsyncComponent(() => import('./components/pre_sale_warehouse_receipt_deal_detail/index.vue')),
     },
     setup() {
+        const tableName: keyof TableKey = 'table_pcweb_spot_trade_bottom_pre_sale_make_deal';
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrSpecialMatchOrder>();
         // 获取列表数据
@@ -63,13 +50,14 @@ export default defineComponent({
         };
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
+            tableName,
             queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_pre_sale_make_deal',
             recordList: getRecordItemTab(),
         };
         return {
             ...handleComposeOrderTable<WrSpecialMatchOrder>(param),
             loading,
+            tableName,
             tableList,
             expandIcon,
             getWrOrderTypeName,

+ 6 - 11
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/setup.ts

@@ -1,6 +1,7 @@
 import { TradeMode } from '@/common/constants/enumCommon';
 import { validateCommon } from '@/common/setup/validate';
 import { handleForm as useForm } from '@/common/setup/warehouse_receipt_trade/listing';
+import { useVerifyListingNum } from '@/hooks/form/verify';
 import { getGoodsGroupsByTradeMode, getIPOGoodsList, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import { getRules } from '@/services/bus/rules';
 import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
@@ -32,6 +33,8 @@ function initFormData(): ListingForm {
 
 const formState: UnwrapRef<ListingForm> = reactive(initFormData())
 export function handleForm(data: WrPosition) {
+    const { minivalue, creditenableqty } = data
+    formState.OrderQty = data.minivalue
     const { rules, formRef } = useForm();
 
     const v_group = async (rule: RuleObject, value: number) => {
@@ -41,17 +44,9 @@ export function handleForm(data: WrPosition) {
             return Promise.reject('请选择商品')
         }
     };
-    const v_num = async (rule: RuleObject, value: number) => {
-        if (value) {
-            if (value > data.creditenableqty || value < 1) {
-                return Promise.reject('提示挂牌数量有误')
-            } else {
-                return Promise.resolve();
-            }
-        } else {
-            return Promise.reject('请输入挂牌数量')
-        }
-    };
+
+    const { v_num } = useVerifyListingNum<ListingForm, 'DelistMinQty'>(formState, 'DelistMinQty', minivalue, creditenableqty)
+
     const rule = {
         FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', min: 1, }],
         OrderQty: [{ required: true, validator: v_num, trigger: 'blur', type: 'number' }],

+ 2 - 2
src/views/order/setup.ts

@@ -156,8 +156,8 @@ export const useOrderWarrant = (hasWR: 0 | 1) => {
         return result
     }
     // 是否显示 议价单 按钮
-    function isShowBarginBtn({ wrpricetype, isspecified, canpart }: WrOrderDetail) {
-        return isspecified && (isspecified === 1) && canpart
+    function isShowBarginBtn({ isspecified, canbargain }: WrOrderDetail) {
+        return isspecified && canbargain
     }
     // 显示价格 或者基差
     function showPriceOrMove({ wrpricetype, fixedprice, pricemove }: WrOrderDetail) {

+ 72 - 66
src/views/order/spot_warran/components/spot_warrant_deal/components/spot_warrant_deal_detail/index.vue

@@ -1,48 +1,38 @@
 <template>
-  <Drawer :title="'详情'"
-          :placement="'right'"
-          class="delistingBottom"
-          :visible="visible"
-          @cancel="cancel">
-    <div>
-      <a-row :gutter="24"
-             type="flex"
-             justify="center">
-        <a-col :span="24"
-               class="fixedBtns">
-          <a-form-item class="btnCenter">
-            <a-button class="cancelBtn"
-                      @click="cancel">取消</a-button>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </div>
-  </Drawer>
+    <Drawer :title="'详情'" :placement="'right'" class="delistingBottom" :visible="visible" @cancel="cancel">
+        <div class="detail">
+            <div class="detail__body">
+                <a-row v-for="(item, index) in columns" :key="index">
+                    <a-col :span="6">{{ item.columntitle }}</a-col>
+                    <a-col :span="18">{{ handleDetailValue(item.columnfield) }}</a-col>
+                </a-row>
+            </div>
+            <div class="detail__footer">
+                <a-button class="cancelBtn" @click="cancel">取消</a-button>
+            </div>
+        </div>
+    </Drawer>
 </template>
 
 <script lang="ts">
-import { BtnListType } from '@/common/components/btnList/interface';
 import Drawer from '@/common/components/drawer/index.vue';
-import { getBarmaginApplyStatus } from '@/common/constants/enumsName';
-import { BtnList, ModalEnum, queryTableList } from '@/common/export/commonTable';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { BtnList, ModalEnum } from '@/common/export/commonTable';
 import { _closeModal } from '@/common/setup/modal/modal';
-import { getTableEvent } from '@/common/setup/table';
-import { expandIcon } from '@/common/setup/table/clolumn';
-import { queryQueryWrTradeBargainApply } from '@/services/go/wrtrade';
-import { QueryWrTradeBargainApplyQsp, QueryWrTradeBargainApplyReq, WrOrderDetail } from '@/services/go/wrtrade/interface';
-import { wrBargainBack, wrBargainNoAgree } from '@/services/proto/WrBargain';
-import { WrBargainBackReq, WrBargainNoAgreeReq } from '@/services/proto/WrBargain/interface';
-import Long from 'long';
+import { QueryWrTradeBargainApplyQsp, WrOrderDetail } from '@/services/go/wrtrade/interface';
 import { defineComponent, PropType, ref } from 'vue';
+import { getWrOrderTypeName } from '@/common/constants/enumsName';
+import { Column } from '@/services/go/commonService/interface';
+import { getTableHead } from '@/common/methods/table';
+import { TableKey } from '@/common/methods/table/interface';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_bargain_detail,
     components: { Drawer, BtnList },
     emits: ['cancel', 'update'],
     props: {
+        tableName: Object as PropType<keyof TableKey>,
         selectedRow: {
-            type: Object as PropType<QueryWrTradeBargainApplyQsp | WrOrderDetail>,
+            type: Object as PropType<QueryWrTradeBargainApplyQsp & WrOrderDetail>,
             default: {},
         },
         isMy: {
@@ -52,54 +42,70 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
+        const columns = ref<Column[]>([]);
+
+        if (props.tableName) {
+            columns.value = getTableHead(props.tableName);
+        }
+
+        // 处理详情数据
+        const handleDetailValue = (field: keyof typeof props.selectedRow) => {
+            const data = props.selectedRow;
+            // 挂牌类型
+            if (field === 'wrtradetype') {
+                return getWrOrderTypeName(data.buyorsell, data.wrtradetype);
+            }
+            // 成交金额
+            if (field === 'amount') {
+                return data.tradeqty * data.tradeprice;
+            }
+            return data[field];
+        };
 
         return {
             visible,
+            columns,
             cancel,
+            getWrOrderTypeName,
+            handleDetailValue,
         };
     },
 });
 </script>
 
 <style lang="less" scoped>
-.listed {
-    width: 100%;
-    height: 100%;
-    .flex;
-    flex-direction: column;
-    overflow: hidden;
-    .ant-form {
-        height: 100%;
-        .formBar {
-            height: 100%;
-            max-height: 100%;
-        }
+.detail {
+    [theme='light'] & {
+        --label-color: #7a8a94;
+        --text-color: #333;
     }
-    .condition {
-        width: 100%;
-        height: 48px;
-        padding: 10px 16px;
-        border-bottom: 1px solid @m-black6;
-        .inlineflex;
-        .conditionBtn {
-            align-self: center;
-            align-items: center;
-            border: 0;
-            min-width: 80px;
-            height: 28px;
-            line-height: 28px;
-            background: @m-black7;
-            .rounded-corners(3px);
-            font-size: 14px;
-            color: @m-blue0;
-            &:hover {
-                background: @m-black7-hover;
-                color: @m-blue0-hover;
+
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+
+    &__body {
+        flex: 1;
+        overflow-y: auto;
+        padding: 0 25px;
+
+        .ant-row {
+            margin-top: 10px;
+
+            .ant-col {
+                &:first-child {
+                    color: var(--label-color, #7a8a94);
+                }
+                &:last-child {
+                    color: var(--text-color, #fff);
+                }
             }
         }
-        .conditionBtn + .conditionBtn {
-            margin-left: 10px;
-        }
+    }
+
+    &__footer {
+        text-align: center;
+        padding: 20px 0;
     }
 }
 </style>;

+ 22 - 35
src/views/order/spot_warran/components/spot_warrant_deal/index.vue

@@ -1,40 +1,24 @@
 <template>
-  <!-- 成交 -->
-  <section>
-    <a-table :columns="columns"
-             class="srcollYTable expandLeftTable"
-             :scroll="{ x: '100%', y: '190px' }"
-             :pagination="false"
-             :loading="loading"
-             :expandedRowKeys="expandedRowKeys"
-             :customRow="Rowclick"
-             :expandIcon="expandIcon"
-             :expandIconAsCell="false"
-             rowKey="key"
-             :data-source="tableList">
-      <!-- 额外的展开行 -->
-      <template #expandedRowRender="{ record }">
-        <BtnList :btnList="btnList"
-                 :record="record"
-                 class="btn-list-sticky"
-                 @click="openComponent" />
-      </template>
+    <!-- 成交 -->
+    <section>
+        <a-table :columns="columns" class="srcollYTable expandLeftTable" :scroll="{ x: '100%', y: '190px' }" :pagination="false" :loading="loading" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :expandIcon="expandIcon" :expandIconAsCell="false" rowKey="key" :data-source="tableList">
+            <!-- 额外的展开行 -->
+            <template #expandedRowRender="{ record }">
+                <BtnList :btnList="btnList" :record="record" class="btn-list-sticky" @click="openComponent" />
+            </template>
 
-      <!-- 成交金额 -->
-      <template #amount="{ record }">
-        <a>{{ record.tradeqty * record.tradeprice }}</a>
-      </template>
+            <!-- 成交金额 -->
+            <template #amount="{ record }">
+                <a>{{ record.tradeqty * record.tradeprice }}</a>
+            </template>
 
-      <!-- 挂牌类型 -->
-      <template #wrtradetype="{ record }">
-        <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
-      </template>
-    </a-table>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"></component>
-  </section>
+            <!-- 挂牌类型 -->
+            <template #wrtradetype="{ record }">
+                <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
+            </template>
+        </a-table>
+        <component :is="componentId" v-if="componentId" :tableName="tableName" :selectedRow="selectedRow" @cancel="closeComponent"></component>
+    </section>
 </template>
 
 <script lang="ts">
@@ -47,6 +31,7 @@ import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { getWrOrderTypeName } from '@/common/constants/enumsName';
+import { TableKey } from '@/common/methods/table/interface';
 
 export default defineComponent({
     name: enumOrderComponents.spot_warrant_deal,
@@ -55,6 +40,7 @@ export default defineComponent({
         spot_warrant_deal_detail: defineAsyncComponent(() => import('./components/spot_warrant_deal_detail/index.vue')),
     },
     setup() {
+        const tableName: keyof TableKey = 'table_pcweb_spot_trade_bottom_spot_warrant_deal';
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrSpecialMatchOrder>();
         // 获取列表数据
@@ -66,8 +52,8 @@ export default defineComponent({
         };
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
+            tableName,
             queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_spot_warrant_deal',
             recordList: getRecordItemTab(),
         };
         //仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
@@ -92,6 +78,7 @@ export default defineComponent({
         return {
             ...handleComposeOrderTable<WrSpecialMatchOrder>(param),
             loading,
+            tableName,
             tableList,
             expandIcon,
             getWrOrderTypeName,

+ 5 - 12
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -1,6 +1,7 @@
 import { TradeMode } from '@/common/constants/enumCommon';
 import { validateCommon } from '@/common/setup/validate';
 import { handleForm as useForm } from '@/common/setup/warehouse_receipt_trade/listing';
+import { useVerifyListingNum } from '@/hooks/form/verify';
 import { getGoodsGroupsByTradeMode, getIPOGoodsList, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import { getRules } from '@/services/bus/rules';
 import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
@@ -33,6 +34,8 @@ function initFormData(): ListingForm {
 const formState: UnwrapRef<ListingForm> = reactive(initFormData())
 
 export function handleForm(data: WrHoldLB) {
+    const { minivalue, enableqty } = data
+    formState.OrderQty = data.minivalue
     const { rules, formRef } = useForm();
 
     const v_group = async (rule: RuleObject, value: number) => {
@@ -42,17 +45,7 @@ export function handleForm(data: WrHoldLB) {
             return Promise.reject('请选择商品')
         }
     };
-    const v_num = async (rule: RuleObject, value: number) => {
-        if (value) {
-            if (value > data.enableqty || value < 1) {
-                return Promise.reject('提示挂牌数量有误')
-            } else {
-                return Promise.resolve();
-            }
-        } else {
-            return Promise.reject('请输入挂牌数量')
-        }
-    };
+    const { v_num } = useVerifyListingNum<ListingForm, 'DelistMinQty'>(formState, 'DelistMinQty', minivalue, enableqty)
 
     const rule = {
         FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', min: 1, }],
@@ -63,7 +56,7 @@ export function handleForm(data: WrHoldLB) {
     }
     Object.assign(rules, rule)
     onBeforeUnmount(() => {
-        Object.assign(formState, initFormData())
+        Object.assign(formState, initFormData(), { OrderQty: data.minivalue })
     })
     return { rules, formState, formRef }
 }

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

@@ -1,49 +1,42 @@
 <template>
-    <!-- 现货明细 -->
-    <section>
-        <a-table
-            :columns="columns"
-            class="srcollYTable expandLeftTable"
-            :scroll="{ x: '100%', y: '190px' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            :expandIcon="expandIcon"
-            :expandIconAsCell="false"
-            rowKey="key"
-            :data-source="tableList"
-        >
-            <!-- 额外的展开行 -->
-            <template #expandedRowRender="{ record }">
-                <BtnList
-                    :btnList="btnList"
-                    :record="record"
-                    class="btn-list-sticky"
-                    @click="openComponent"
-                    v-if="record.enableqty > 0"
-                />
-            </template>
-        </a-table>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </section>
+  <!-- 现货明细 -->
+  <section>
+    <a-table :columns="columns"
+             class="srcollYTable expandLeftTable"
+             :scroll="{ x: '100%', y: '190px' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             :expandIcon="expandIcon"
+             :expandIconAsCell="false"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="btnList"
+                 :record="record"
+                 class="btn-list-sticky"
+                 @click="openComponent"
+                 v-if="record.enableqty > 0" />
+      </template>
+    </a-table>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </section>
 </template>
 
 <script lang="ts">
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { queryTableList, BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, ComposeTableParam, handleComposeTable } from '@/common/export/commonTable';
-import { queryHoldLB, queryWrOrderDetail, queryWrPosition } from '@/services/go/wrtrade';
-import { QueryHoldLBReq, QueryWrOrderDetailReq, QueryWrPositionReq, WrHoldLB, WrOrderDetail, WrPosition } from '@/services/go/wrtrade/interface';
+import { BtnList, defineAsyncComponent, defineComponent, ModalEnum, queryTableList } from '@/common/export/commonTable';
 import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { expandIcon } from '@/common/setup/table/clolumn';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
-import { expandIcon } from '@/common/setup/table/clolumn';
+import { queryHoldLB } from '@/services/go/wrtrade';
+import { WrHoldLB } from '@/services/go/wrtrade/interface';
 export default defineComponent({
     name: enumOrderComponents.spot_warrant_spot_details,
     components: {