ソースを参照

修改议价单

huangbin 4 年 前
コミット
d384978077

+ 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"
 }

+ 14 - 9
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/components/bargain_detail/index.vue

@@ -84,19 +84,24 @@ export default defineComponent({
             haswr: 0,
             wrtradeorderid: props.selectedRow.wrtradeorderid,
         };
+        // 判断是否有 待确认 状态的 数据,如果有需要显示操作按钮,没就无操作按钮
         function isShowBtn() {
-            let result = true;
-            const len = tableList.value.length;
-            if (len) {
-                if (tableList.value[len - 1].applystatus !== 1) {
-                    result = false;
+            let result = false;
+            tableList.value.forEach((el) => {
+                if (el.applystatus === 1) {
+                    result = true;
                 }
-            } else {
-                result = false;
-            }
+            });
             return result;
         }
-        queryTable(queryQueryWrTradeBargainApply, param);
+        queryTable(queryQueryWrTradeBargainApply, param).then((res) => {
+            // 时间 倒序排序
+            tableList.value = res.sort((a, b) => {
+                const time1 = new Date(a.applytime).getTime();
+                const time2 = new Date(b.applytime).getTime();
+                return time2 - time1;
+            });
+        });
         // 我对别人的 => 撤销
         // 别人对我的 => 确认、拒绝
         const { isMy, getColums } = getSpotWarrantBargainDetailColumns(props.selectedRow);

+ 11 - 2
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/index.vue

@@ -35,6 +35,15 @@
       <template #wrtradetype="{ record }">
         <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
       </template>
+      <template #applystatus="{ text }">
+        <span>{{ getBarmaginApplyStatus(text) }}</span>
+      </template>
+      <template #applytime="{ text }">
+        <span>{{ formatTime(text) }}</span>
+      </template>
+      <template #marginvalue="{ text }">
+        <span>{{ (text * 100).toFixed(2) }}%</span>
+      </template>
       <!-- 挂牌价格 -->
     </a-table>
     <component :is="componentId"
@@ -52,7 +61,7 @@ import { QueryWrOrderDetailReq, QueryWrTradeBargainApplyQsp, QueryWrTradeBargain
 import { getRecordItemTab } from '@/common/setup/order/orderData';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
-import { getWrOrderTypeName, getWrTradeOrderStatusName } from '@/common/constants/enumsName';
+import { getWrOrderTypeName, getWrTradeOrderStatusName, getBarmaginApplyStatus } from '@/common/constants/enumsName';
 import { BtnListType } from '@/common/components/btnList/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { getSpotWarrantBargainColumns } from './setup';
@@ -77,7 +86,6 @@ export default defineComponent({
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_spot_warrant_pending_order',
             recordList: getRecordItemTab(),
         };
         const {
@@ -111,6 +119,7 @@ export default defineComponent({
             getWrOrderTypeName,
             expandIcon,
             formatTime,
+            getBarmaginApplyStatus,
         };
     },
 });

+ 4 - 0
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/setup.ts

@@ -14,6 +14,10 @@ export function getSpotWarrantBargainColumns() {
         { title: '挂牌有效期', key: 'validtime', align: 'center', width: 120 },
         { title: '履约保证金', key: 'marginvalue', align: 'center', width: 120 },
         { title: '履约方式', key: 'templatename', align: 'center', width: 160 },
+        { title: '最新议价价格', key: 'applyprice', align: 'center', width: 120 },
+        { title: '最新议价数量', key: 'applyqty', align: 'center', width: 120 },
+        { title: '最新议价时间', key: 'applytime', align: 'center', width: 160 },
+        { title: '最新议价状态', key: 'applystatus', align: 'center', width: 140 },
     ];
     return columns.map(el => {
         const slots = { customRender: el.key };

+ 13 - 9
src/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue

@@ -84,17 +84,21 @@ export default defineComponent({
             haswr: 1,
             wrtradeorderid: props.selectedRow.wrtradeorderid,
         };
-        queryTable(queryQueryWrTradeBargainApply, param);
+        queryTable(queryQueryWrTradeBargainApply, param).then((res) => {
+            // 时间 倒序排序
+            tableList.value = res.sort((a, b) => {
+                const time1 = new Date(a.applytime).getTime();
+                const time2 = new Date(b.applytime).getTime();
+                return time2 - time1;
+            });
+        });
         function isShowBtn() {
-            let result = true;
-            const len = tableList.value.length;
-            if (len) {
-                if (tableList.value[len - 1].applystatus !== 1) {
-                    result = false;
+            let result = false;
+            tableList.value.forEach((el) => {
+                if (el.applystatus === 1) {
+                    result = true;
                 }
-            } else {
-                result = false;
-            }
+            });
             return result;
         }
         // 我对别人的 => 撤销