marymelisa vor 4 Jahren
Ursprung
Commit
36f2ab7160

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

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://103.40.249.123:28280/cfg?key=mtp_20"
+    "apiUrl": "http://103.40.249.123:38280/cfg?key=mtp_20"
 }

+ 9 - 5
src/common/components/thirdMenu/index.vue

@@ -1,9 +1,13 @@
 <template>
-    <div class="thirdMenu">
-        <a-tabs v-model:activeKey="current" @change="menuClick">
-            <a-tab-pane :key="String(index)" v-for="(item, index) in list" :tab="item[value]"></a-tab-pane>
-        </a-tabs>
-    </div>
+  <div class="thirdMenu">
+    <a-tabs v-model:activeKey="current"
+            @change="menuClick">
+      <a-tab-pane :key="String(index)"
+                  v-for="(item, index) in list"
+                  :tab="item[value]"></a-tab-pane>
+    </a-tabs>
+    <slot></slot>
+  </div>
 </template>
 
 <script lang="ts">

+ 5 - 3
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/index.vue

@@ -83,8 +83,8 @@
                                     :max="getMaxNum()"
                                     v-model:value="formState.OrderQty"
                                 />
-                                <MinusOutlined @click="decreasePrice" />
-                                <PlusOutlined @click="increasePrice" />
+                                <MinusOutlined @click="increaseNum" />
+                                <PlusOutlined @click="decreaseNum" />
                                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
                             </a-form-item>
                         </a-col>
@@ -156,7 +156,7 @@ import { v4 as uuidv4 } from 'uuid';
 import { defineComponent, PropType, ref } from 'vue';
 import { useUserType } from '../setup';
 import { FormParam } from './interface';
-import { handleForm, isFloat, useBuySellDirection } from './setup';
+import { handleForm, isFloat, useBuySellDirection, usePrice, useNum } from './setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -263,6 +263,8 @@ export default defineComponent({
             useUserType,
             canUseMoney,
             accountList,
+            ...usePrice(),
+            ...useNum(),
         };
     },
 });

+ 25 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/setup.ts

@@ -52,4 +52,29 @@ export function useBuySellDirection() {
         return direction.value === BuyOrSell.buy
     }
     return { direction, changeDirection, isBuy }
+}
+
+// 价格
+export const usePrice = () => {
+    function increasePrice() {
+        formState.FixedPrice++;
+    }
+    function decreasePrice() {
+        if (formState.FixedPrice) {
+            formState.FixedPrice--;
+        }
+    }
+    return { increasePrice, decreasePrice };
+};
+
+export const useNum = () => {
+    function increaseNum() {
+        formState.OrderQty++;
+    }
+    function decreaseNum() {
+        if (formState.OrderQty) {
+            formState.OrderQty--;
+        }
+    }
+    return { increaseNum, decreaseNum };
 }

+ 101 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/index.vue

@@ -0,0 +1,101 @@
+<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 v-if="btnList.length"
+                #expandedRowRender="{ record }">
+        <BtnList :btnList="btnList"
+                 :record="record"
+                 class="btn-list-sticky"
+                 @click="openComponent" />
+      </template>
+      <template #createtime="{ record }">
+        <a>{{ formatTime(record.createtime) }}</a>
+      </template>
+    </a-table>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               :tableList="tableList"
+               @cancel="closeComponent"></component>
+  </section>
+</template>
+
+<script lang="ts">
+import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { queryTableList, BtnList, defineAsyncComponent, defineComponent, ModalEnum } from '@/common/export/commonTable';
+import { getRecordItemTab } from '@/common/setup/order/orderData';
+import { handleComposeOrderTable } from '@/common/setup/table/compose';
+import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import { formatTime } from '@/common/methods';
+import { expandIcon } from '@/common/setup/table/clolumn';
+import { queryTradePosition } from '@/services/go/ermcp/order';
+import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
+import { handleSubcriteQuote } from '@/common/setup/table/tableQuote';
+import { findGoodsTradeModeById, getQuoteDayInfoByCode } from '@/services/bus/goods';
+import { handleDeliveryRelation } from '@/common/setup/deliveryRelation';
+import { TradeMode } from '@/common/constants/enumCommon';
+import { BtnListType } from '@/common/components/btnList/interface';
+import { columns } from './setup';
+import { queryTjmdTransferApply } from '@/services/go/Tjmd';
+import { QueryTjmdTransferApplyReq } from '@/services/go/Tjmd/interface';
+
+export default defineComponent({
+    name: 'commodity_contract_bargain',
+    components: {
+        BtnList,
+        // [ModalEnum.commodity_contract_summary_settlement]: defineAsyncComponent(() => import('./components/commodity_contract_summary_settlement/index.vue')),
+        // [ModalEnum.commodity_contract_summary_transfer]: defineAsyncComponent(() => import('./components/commodity_contract_summary_transfer/index.vue')),
+        // commodity_contract_summary_deal_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_deal_closed/index.vue')),
+    },
+    setup() {
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<QueryTradePositionRsp>();
+        // 交割商品
+        handleDeliveryRelation();
+        // 获取列表数据
+        const queryTableAction = (applytype: 1 | 2) => {
+            const param: QueryTjmdTransferApplyReq = {
+                applytype,
+            };
+            queryTable(queryTjmdTransferApply, param);
+        };
+        // 表格通用逻辑
+        const param: ComposeOrderTableParam = {
+            queryFn: () => queryTableAction(1),
+            recordList: getRecordItemTab(),
+        };
+
+        function handleBtnList(record: QueryTradePositionRsp, btnList: BtnListType[]) {
+            if (findGoodsTradeModeById(record.goodsid) === TradeMode.DiaoQi) {
+                return btnList.filter((e) => e.code === 'commodity_contract_summary_deal_closed');
+            } else {
+                return btnList.filter((e) => e.code !== 'commodity_contract_summary_deal_closed');
+            }
+        }
+        return {
+            ...handleComposeOrderTable<QueryTradePositionRsp>(param),
+            columns,
+            loading,
+            tableList,
+            formatTime,
+            expandIcon,
+            handleBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 9 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/setup.ts

@@ -0,0 +1,9 @@
+export const columns = [
+    { title: '订单合约', dataIndex: 'goodsname', key: 'goodsname', align: 'center', width: 120 },
+    { title: '方向', dataIndex: 'buyorsell', key: 'buyorsell', align: 'center', width: 120, slots: { customRender: 'buyorsell' } },
+    { title: '协议价', dataIndex: 'transferprice', key: 'transferprice', width: 120, align: 'center' },
+    { title: '数量', dataIndex: 'qty', key: 'qty', align: 'center', width: 120, slots: { customRender: 'qty' } },
+    { title: '金额', dataIndex: 'transferamount', key: 'transferamount', width: 120, align: 'center', slots: { customRender: 'transferamount' } },
+    { title: '状态', dataIndex: 'applystatus', key: 'applystatus', width: 120, align: 'center', slots: { customRender: 'applystatus' } },
+    { title: '时间', dataIndex: 'applytime', key: 'applytime', width: 120, align: 'center', slots: { customRender: 'applytime' } },
+];

+ 13 - 1
src/views/order/commodity_contract/index.vue

@@ -6,7 +6,13 @@
     </component>
     <thirdMenu :list="tabList"
                @selectMenu="changeTab"
-               :value="'title'"></thirdMenu>
+               :value="'title'">
+      <div class="goods-apply"
+           v-if="componentId === 'commodity_contract_bargain'">
+        <span>我的申请</span>
+        <span>对方申请</span>
+      </div>
+    </thirdMenu>
   </section>
 </template>
 
@@ -24,6 +30,7 @@ export default defineComponent({
         [enumOrderComponents.commodity_contract_commission]: defineAsyncComponent(() => import('./components/commodity_contract_commission/index.vue')),
         [enumOrderComponents.commodity_contract_make_deal]: defineAsyncComponent(() => import('./components/commodity_contract_make_deal/index.vue')),
         [enumOrderComponents.commodity_contract_settlement]: defineAsyncComponent(() => import('./components/commodity_contract_settlement/index.vue')),
+        commodity_contract_bargain: defineAsyncComponent(() => import('./components/commodity_contract_bargain/index.vue')),
     },
     setup() {
         return { ...handleOrderDetailList(enumOrderComponents.commodity_contract) };
@@ -32,4 +39,9 @@ export default defineComponent({
 </script>
 
 <style lang="less">
+.goods-apply {
+    position: absolute;
+    bottom: 2px;
+    right: 20px;
+}
 </style>;