Explorar el Código

修改 预售仓单 挂单

huangbin hace 4 años
padre
commit
302f12a72d

+ 17 - 2
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 仓单预售 挂单 -->
-  <a-table :columns="columns"
+  <a-table :columns="tableColumns"
            class="srcollYTable expandLeftTable"
            :scroll="{ x: '100%', y: '190px' }"
            :pagination="false"
@@ -26,6 +26,14 @@
     <template #wrtradetype="{ record }">
       <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
     </template>
+    <!-- 挂牌方式 -->
+    <template #wrpricetype="{ record }">
+      <span>{{ getWrPriceType(record) }}</span>
+    </template>
+    <!-- 价格/基差 -->
+    <template #futushow="{ record }">
+      <span>{{ showPriceOrMove(record) }}</span>
+    </template>
   </a-table>
   <component :is="componentId"
              v-if="componentId"
@@ -45,6 +53,7 @@ import { getWrOrderTypeName, getOrderStatusName } from '@/common/constants/enums
 import { BtnListType } from '@/common/components/btnList/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import Bus from '@/utils/eventBus';
+import { useOrderWarrant } from '@/views/order/setup';
 
 export default defineComponent({
     name: enumOrderComponents.pre_sale_warehouse_receipt_pending_order,
@@ -66,14 +75,17 @@ export default defineComponent({
         Bus.$on('blocsTrade', () => {
             queryTableAction();
         });
+        const { tableColumns, getWrPriceType, isShowBarginBtn, showPriceOrMove } = useOrderWarrant(0);
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {
             queryFn: queryTableAction,
-            tableName: 'table_pcweb_spot_trade_bottom_pre_sale_pending_order',
             recordList: getRecordItemTab(),
             isDetail: true,
         };
         function filterBtnList(list: BtnListType[], record: WrOrderDetail) {
+            if (!isShowBarginBtn(record)) {
+                list = list.filter((e) => e.code !== 'spot_warrant_pending_order_bargain_order');
+            }
             //委托状态 - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:已成 8:成交失败 9:委托拒绝 1number;
             const arr = [3, 7];
             if (!arr.includes(record.wrtradeorderstatus)) {
@@ -90,6 +102,9 @@ export default defineComponent({
             expandIcon,
             getOrderStatusName,
             getWrOrderTypeName,
+            tableColumns,
+            getWrPriceType,
+            showPriceOrMove,
         };
     },
 });

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

@@ -127,16 +127,17 @@ export const useOrderWarrant = (hasWR: 0 | 1) => {
     if (!hasWR) { // 无仓单 需要交收月
         const obj = {
             key: '42th',
-            dataIndex: 'wrtradeorderstatus',
+            dataIndex: 'deliverymonth',
             title: '交收月',
             align: 'center',
             slots: {
-                customRender: 'wrtradeorderstatus',
+                customRender: 'deliverymonth',
             },
             width: 120,
         }
         tableColumns.splice(6, 0, obj)
     }
+    console.log('tableColumns', tableColumns)
     // 挂牌方式
     function getWrPriceType({ wrpricetype, isspecified, canpart }: WrOrderDetail) {
         let result = '--'