li.shaoyi 4 gadi atpakaļ
vecāks
revīzija
e85f161ace

+ 1 - 1
src/assets/styles/index.css

@@ -748,7 +748,7 @@
 }
 
 .dialogInput {
-    background   : var(--m-grey21);
+    background   : var(--m-grey21) !important;
     border       : 1px solid var(--m-grey14);
     border-radius: 3px;
     color        : var(--m-white1);

+ 1 - 1
src/assets/styles/mixin.less

@@ -1017,7 +1017,7 @@
 }
 
 .dialogInput {
-    background   : @m-grey21;
+    background   : @m-grey21  !important;
     border       : 1px solid @m-grey14;
     border-radius: 3px;
     color        : @m-white1;

+ 2 - 0
src/common/constants/enumsName.ts

@@ -1447,6 +1447,8 @@ export function geLinkStatusName(status: number): string {
             return '成功';
         case 2:
             return '失败';
+        case 3:
+            return '解绑';
         default:
             return '--'
     }

+ 15 - 15
src/layout/components/menu.vue

@@ -1,19 +1,19 @@
 <template>
-    <a-menu theme="dark" mode="inline" :class="['left-menu', isBottom ? 'left-menu_bottom' : 'left-menu_no_bottom']" v-model:selectedKeys="selectedKeys" v-model:openKeys="openKeys" @click="menuClick">
-        <a-sub-menu v-for="item in filterMenu()" :key="item.code">
-            <template #title>
-                <span>
-                    <svg class="icon svg-icon" aria-hidden="true">
-                        <use :xlink:href="fontIcon(item.code)" />
-                    </svg>
-                    <span class="menu-item_title" v-show="!collapsed">{{ item.title }}</span>
-                </span>
-            </template>
-            <a-menu-item :key="subItem.code" v-for="subItem in item.children">
-                <span>{{ subItem.title }}</span>
-            </a-menu-item>
-        </a-sub-menu>
-    </a-menu>
+  <a-menu theme="dark" mode="inline" class="left-menu" v-model:selectedKeys="selectedKeys" v-model:openKeys="openKeys" @click="menuClick">
+    <a-sub-menu v-for="item in filterMenu()" :key="item.code">
+      <template #title>
+        <span>
+          <svg class="icon svg-icon" aria-hidden="true">
+            <use :xlink:href="fontIcon(item.code)" />
+          </svg>
+          <span class="menu-item_title" v-show="!collapsed">{{ item.title }}</span>
+        </span>
+      </template>
+      <a-menu-item :key="subItem.code" v-for="subItem in item.children">
+        <span>{{ subItem.title }}</span>
+      </a-menu-item>
+    </a-sub-menu>
+  </a-menu>
 </template>
 
 <script lang="ts">

+ 15 - 15
src/layout/components/top.vue

@@ -1,19 +1,19 @@
 <template>
-    <a-layout :class="['layout-top', isBottom ? 'layout-top-bottom' : 'layout-top-no-bottom']">
-        <a-layout-header class="m-layout-header">
-            <Header />
-        </a-layout-header>
-        <a-layout class="middleLayout">
-            <a-layout-sider class="m-layout-left" width="160" v-model:collapsed="collapsed" @collapse="collapse" collapsible>
-                <Menu @chooseMenu="chooseMenu" :collapsed="collapsed" />
-            </a-layout-sider>
-            <a-layout-content :style="{ background: '#0E0E0F', flex: 1 }">
-                <!-- <Drawer :title="'挂牌'" :visible="visible"></Drawer> -->
-                <!-- <Main /> -->
-                <router-view />
-            </a-layout-content>
-        </a-layout>
+  <a-layout :class="['layout-top', isBottom ? 'layout-top-bottom' : 'layout-top-no-bottom']">
+    <a-layout-header class="m-layout-header">
+      <Header />
+    </a-layout-header>
+    <a-layout class="middleLayout">
+      <a-layout-sider class="m-layout-left" width="160" v-model:collapsed="collapsed" @collapse="collapse" collapsible>
+        <Menu @chooseMenu="chooseMenu" :collapsed="collapsed" />
+      </a-layout-sider>
+      <a-layout-content :style="{ background: '#0E0E0F', flex: 1 }">
+        <!-- <Drawer :title="'挂牌'" :visible="visible"></Drawer> -->
+        <!-- <Main /> -->
+        <router-view />
+      </a-layout-content>
     </a-layout>
+  </a-layout>
 </template>
 <script lang="ts">
 import { defineComponent, ref, provide } from 'vue';
@@ -206,7 +206,7 @@ export default defineComponent({
             overflow: hidden;
             .ant-layout-sider-children {
                 ul.ant-menu.ant-menu-inline.left-menu {
-                    height: calc(100vh - 316px);
+                    height: 100%;
                     overflow-y: auto;
                     li.ant-menu-submenu {
                         padding-bottom: 0;

+ 2 - 1
src/router/index.ts

@@ -7,6 +7,7 @@ import { localStorageUtil } from '@/utils/storage';
 import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
 import eventBus from '../utils/eventBus';
 import { registerRoutes } from './dynamic';
+import { message } from 'ant-design-vue';
 
 const routes: Array<RouteRecordRaw> = [
     {
@@ -70,7 +71,7 @@ router.beforeEach((to, from, next) => {
                     routerComplete = true;
                     next({ ...to, replace: true });
                 }).catch(() => {
-                    console.error('路由加载失败');
+                    message.error('账号没有对应菜单权限');
                 })
             }
         } else {

+ 1 - 1
src/services/bus/user.ts

@@ -49,7 +49,7 @@ export function getAreaUserId(): number {
  * 获取所属机构名称
  */
 export function getAreaUserName(): number {
-    return APP.get('userAccount').memberusername
+    return APP.get('userAccount').accountname
 }
 
 

+ 82 - 90
src/views/business/purchase/components/detail/index.vue

@@ -1,81 +1,78 @@
 <template>
   <!-- 采购合同详情-->
-  <a-modal class="add-custom custom-detail"
-           title="详情"
-           v-model:visible="visible"
-           centered
-           @cancel="cancel"
-           width="890px">
+  <a-modal class="add-custom custom-detail" title="详情" v-model:visible="visible" centered @cancel="cancel" width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭
+      <a-button key="submit" type="primary" :loading="loading" @click="submit">关闭
       </a-button>
     </template>
     <a-tabs v-model:activeKey="activeKey" @change="tabClick">
-        <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
+      <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
     </a-tabs>
     <InfoDetail :selectedRow="selectedRow" v-if="activeKey == 1" />
     <div class="tableDatas" v-else>
-            <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
-                <template #status="{ text }">
-                    <span class="yellow">{{ text }}</span>
-                    <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
-                </template>
+      <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
+        <template #status="{ text }">
+          <span class="yellow">{{ text }}</span>
+          <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
+        </template>
 
-                <template #applystatus="{ text }">
-                    <a>{{ getApplyStatusName(text) }}</a>
-                </template>
+        <template #applystatus="{ text }">
+          <a>{{ getApplyStatusName(text) }}</a>
+        </template>
 
-                <!-- 发票金额-->
-                <template #invoicetype="{ text }">
-                    <a>{{ invoiceStatusName(text) }}</a>
-                </template>
+        <!-- 发票金额-->
+        <template #invoicetype="{ text }">
+          <a>{{ invoiceStatusName(text) }}</a>
+        </template>
 
-                <!-- 发票类型-->
-                <template #contracttype="{ text }">
-                    <a>{{ getReceiptName(text) }}</a>
-                </template>
+        <!-- 发票类型-->
+        <template #contracttype="{ text }">
+          <a>{{ getReceiptName(text) }}</a>
+        </template>
 
-                <!-- 出入库类型 -->
-                <template #inouttype="{ text }">
-                    <a>{{ InOutTypeName(text) }}</a>
-                </template>
+        <!-- 出入库类型 -->
+        <template #inouttype="{ text }">
+          <a>{{ InOutTypeName(text) }}</a>
+        </template>
 
-                <!-- 款项类型 -->
-                <template #kxtype="{ record }">
-                    <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
-                </template>
+        <!-- 款项类型 -->
+        <template #kxtype="{ record }">
+          <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
+        </template>
 
-                <!-- 金额-->
-                <template #payamount="{ text, record }">
-                    <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
-                </template>
+        <!-- 金额-->
+        <template #payamount="{ text, record }">
+          <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
+        </template>
 
-                <!-- 调整付保证金-->
-                <template #addmargin="{ record }">
-                    <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
-                </template>
+        <!-- 调整付保证金-->
+        <template #addmargin="{ record }">
+          <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
+        </template>
 
-                <!-- 交收量 -->
-                <template #reckonrealqty="{ record }">
-                    <span>{{ formatValue(record.reckonrealqty) }}</span>
-                </template>
+        <!-- 交收量 -->
+        <template #reckonrealqty="{ record }">
+          <span>{{ formatValue(record.reckonrealqty) }}</span>
+        </template>
 
-                <!-- 其他费用 -->
-                <template #reckonotheramount="{ record }">
-                    <span>{{ formatValue(record.reckonotheramount) }}</span>
-                </template>
+        <!-- 其他费用 -->
+        <template #reckonotheramount="{ record }">
+          <span>{{ formatValue(record.reckonotheramount) }}</span>
+        </template>
 
-                <!-- 申请人 -->
-                <template #applyname="{ record }">
-                    <span>{{ formatValue(record.applyname) }}</span>
-                </template>
+        <!-- 调整金额 -->
+        <template #reckonadjustamount="{ record }">
+          <span>{{ formatValue(record.reckonadjustamount) }}</span>
+        </template>
 
-                <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
-            </a-table>
-        </div>
+        <!-- 申请人 -->
+        <template #applyname="{ record }">
+          <span>{{ formatValue(record.applyname) }}</span>
+        </template>
+
+        <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
+      </a-table>
+    </div>
   </a-modal>
 </template>
 
@@ -93,14 +90,15 @@ import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
 import { QueryChangeLog } from '@/services/go/ermcp/spot-contract';
 import { QueryPaTradeLinkDetail } from '@/services/go/ermcp/patrade-link';
 import { columnsPaTradeLink } from '@/views/information/spot-contract/components/detail/setup';
-import InfoDetail from '../infoDetail/index.vue'
+import InfoDetail from '../infoDetail/index.vue';
 import { getApplyStatusName, getReceiptName } from '@/common/constants/enumsName';
 import { InOutTypeName } from '@/views/manage/inventory-review/setup';
 import { invoiceStatusName, stateName } from '@/views/manage/finance-review/setup';
+import moment from 'moment';
 
 export default defineComponent({
     name: 'purchase_pending-detail',
-    components: {InfoDetail},
+    components: { InfoDetail },
     emits: ['cancel', 'update'],
     props: {
         selectedRow: {
@@ -120,13 +118,10 @@ export default defineComponent({
         // 表头数据
         const { columns, registerColumn } = getTableColumns();
 
-
         function submit() {
             cancel();
         }
 
-
-
         // 审核拒绝和未提交不显示后面的选项
         tabList.value = [0, 4, 6].includes(props.selectedRow.contracctstatus)
             ? [{ key: 1, name: '合同详情' }]
@@ -137,69 +132,66 @@ export default defineComponent({
                   { key: 4, name: '款项记录' },
                   { key: 5, name: '发票记录' },
                   { key: 6, name: props.selectedRow.contracttype === 1 ? '入库记录' : '出库记录' },
-                  { key: 8, name: '变更记录' },
-                  { key: 9, name: '关联记录' },
+                  { key: 7, name: '变更记录' },
+                  { key: 8, name: '关联记录' },
               ];
         activeKey.value = 1;
         function tabClick() {
-            const relatedid = props.selectedRow.spotcontractid;
+            const { spotcontractid, contracttype } = props.selectedRow;
             switch (activeKey.value) {
                 case 1:
                     break;
                 case 2: // 点价记录
                     registerColumn('table_pcweb_someprice_detail_dj', []);
-                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid }).then((res) => {
-                      console.log(res,'hhh')
+                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { spotcontractid }).then((res) => {
+                        console.log(res, 'hhh');
                         tableList.value = res;
                     });
                     break;
                 case 3: // 交收记录
                     registerColumn('table_pcweb_someprice_detail_js', []);
-                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
                 case 4: //款项记录
                     registerColumn('table_pcweb_someprice_detail_kx', []);
-                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
                 case 5: // 发票记录
                     registerColumn('table_pcweb_someprice_detail_fp', []);
-                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 6: // 入库记录
-                    registerColumn('table_pcweb_someprice_detail_stock', []);
-                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
-                        spotcontractid: relatedid,
-                        inouttype: '1,3',
-                    }).then((res) => {
-                        tableList.value = res;
-                    });
-                    break;
-                case 7: // 出库记录
-                    registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                case 6: // 出入库记录
+                    const inouttype = contracttype === 1 ? '5' : '6';
+                    if (contracttype === 1) {
+                        registerColumn('table_pcweb_someprice_detail_stock', []);
+                    } else {
+                        registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                    }
                     queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
-                        spotcontractid: relatedid,
-                        inouttype: '2,4',
+                        spotcontractid: spotcontractid,
+                        inouttype,
                     }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 8: //// 变更记录
+                case 7: //// 变更记录
                     registerColumn('table_pcweb_someprice_detail_change', []);
-                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 9: //// 关联记录
+                case 8: //// 关联记录
                     columns.value.length = 0;
                     columns.value.push(...columnsPaTradeLink);
                     queryResultLoadingAndInfo(QueryPaTradeLinkDetail, loading).then((res) => {
-                        tableList.value = res;
+                        // 关联日期降序
+                        tableList.value = res.sort((a, b) => moment(b.tradetime).valueOf() - moment(a.tradetime).valueOf());
                     });
                     break;
             }
@@ -217,10 +209,10 @@ export default defineComponent({
             tableList,
             activeKey,
             columns,
-            getApplyStatusName, 
+            getApplyStatusName,
             getReceiptName,
             InOutTypeName,
-            invoiceStatusName, 
+            invoiceStatusName,
             stateName,
         };
     },

+ 82 - 86
src/views/business/sell/components/detail/index.vue

@@ -1,80 +1,77 @@
 <template>
   <!-- 采购详情-->
-  <a-modal class="add-custom custom-detail"
-           title="详情"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           width="890px">
+  <a-modal class="add-custom custom-detail" title="详情" v-model:visible="visible" @cancel="cancel" centered width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭</a-button>
+      <a-button key="submit" type="primary" :loading="loading" @click="submit">关闭</a-button>
     </template>
     <a-tabs v-model:activeKey="activeKey" @change="tabClick">
-            <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
+      <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
     </a-tabs>
     <InfoDetail :selectedRow="selectedRow" v-if="activeKey == 1" />
     <div class="tableDatas" v-else>
-            <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
-                <template #status="{ text }">
-                    <span class="yellow">{{ text }}</span>
-                    <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
-                </template>
+      <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
+        <template #status="{ text }">
+          <span class="yellow">{{ text }}</span>
+          <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
+        </template>
 
-                <template #applystatus="{ text }">
-                    <a>{{ getApplyStatusName(text) }}</a>
-                </template>
+        <template #applystatus="{ text }">
+          <a>{{ getApplyStatusName(text) }}</a>
+        </template>
 
-                <!-- 发票金额-->
-                <template #invoicetype="{ text }">
-                    <a>{{ invoiceStatusName(text) }}</a>
-                </template>
+        <!-- 发票金额-->
+        <template #invoicetype="{ text }">
+          <a>{{ invoiceStatusName(text) }}</a>
+        </template>
 
-                <!-- 发票类型-->
-                <template #contracttype="{ text }">
-                    <a>{{ getReceiptName(text) }}</a>
-                </template>
+        <!-- 发票类型-->
+        <template #contracttype="{ text }">
+          <a>{{ getReceiptName(text) }}</a>
+        </template>
 
-                <!-- 出入库类型 -->
-                <template #inouttype="{ text }">
-                    <a>{{ InOutTypeName(text) }}</a>
-                </template>
+        <!-- 出入库类型 -->
+        <template #inouttype="{ text }">
+          <a>{{ InOutTypeName(text) }}</a>
+        </template>
 
-                <!-- 款项类型 -->
-                <template #kxtype="{ record }">
-                    <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
-                </template>
+        <!-- 款项类型 -->
+        <template #kxtype="{ record }">
+          <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
+        </template>
 
-                <!-- 金额-->
-                <template #payamount="{ text, record }">
-                    <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
-                </template>
+        <!-- 金额-->
+        <template #payamount="{ text, record }">
+          <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
+        </template>
 
-                <!-- 调整付保证金-->
-                <template #addmargin="{ record }">
-                    <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
-                </template>
+        <!-- 调整付保证金-->
+        <template #addmargin="{ record }">
+          <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
+        </template>
 
-                <!-- 交收量 -->
-                <template #reckonrealqty="{ record }">
-                    <span>{{ formatValue(record.reckonrealqty) }}</span>
-                </template>
+        <!-- 交收量 -->
+        <template #reckonrealqty="{ record }">
+          <span>{{ formatValue(record.reckonrealqty) }}</span>
+        </template>
 
-                <!-- 其他费用 -->
-                <template #reckonotheramount="{ record }">
-                    <span>{{ formatValue(record.reckonotheramount) }}</span>
-                </template>
+        <!-- 其他费用 -->
+        <template #reckonotheramount="{ record }">
+          <span>{{ formatValue(record.reckonotheramount) }}</span>
+        </template>
 
-                <!-- 申请人 -->
-                <template #applyname="{ record }">
-                    <span>{{ formatValue(record.applyname) }}</span>
-                </template>
+        <!-- 调整金额 -->
+        <template #reckonadjustamount="{ record }">
+          <span>{{ formatValue(record.reckonadjustamount) }}</span>
+        </template>
 
-                <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
-            </a-table>
-        </div>
+        <!-- 申请人 -->
+        <template #applyname="{ record }">
+          <span>{{ formatValue(record.applyname) }}</span>
+        </template>
+
+        <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
+      </a-table>
+    </div>
   </a-modal>
 </template>
 
@@ -90,17 +87,18 @@ import { QueryBusinessDj, QueryBusinessJs } from '@/services/go/ermcp/business-r
 import { QueryBusinessFp, QueryBusinessKx } from '@/services/go/ermcp/finance-review';
 import { QueryAreaStockApply } from '@/services/go/ermcp/inventory-review';
 import { QueryChangeLog } from '@/services/go/ermcp/spot-contract';
-import { columnsPaTradeLink } from '@/views/information/spot-contract/components/detail/setup'
+import { columnsPaTradeLink } from '@/views/information/spot-contract/components/detail/setup';
 import { QueryPaTradeLinkDetail } from '@/services/go/ermcp/patrade-link';
-import InfoDetail  from '@/views/information/spot-contract/components/infoDetail/index.vue'
+import InfoDetail from '@/views/information/spot-contract/components/infoDetail/index.vue';
 import { getApplyStatusName, getReceiptName } from '@/common/constants/enumsName';
 import { invoiceStatusName, stateName } from '@/views/manage/finance-review/setup';
 import { InOutTypeName } from '@/views/manage/inventory-review/setup';
+import moment from 'moment';
 
 export default defineComponent({
     name: 'sell-detail',
     emits: ['cancel', 'update'],
-    components: {InfoDetail},
+    components: { InfoDetail },
     props: {
         selectedRow: {
             type: Object as PropType<Ermcp3SellBuyContract>,
@@ -126,71 +124,69 @@ export default defineComponent({
                   { key: 4, name: '款项记录' },
                   { key: 5, name: '发票记录' },
                   { key: 6, name: props.selectedRow.contracttype === 1 ? '入库记录' : '出库记录' },
-                  { key: 8, name: '变更记录' },
-                  { key: 9, name: '关联记录' },
+                  { key: 7, name: '变更记录' },
+                  { key: 8, name: '关联记录' },
               ];
         function submit() {
             cancel();
         }
 
         function tabClick() {
-            const relatedid = props.selectedRow.spotcontractid;
+            const { spotcontractid, contracttype } = props.selectedRow;
             switch (activeKey.value) {
                 case 1:
                     break;
                 case 2: // 点价记录
                     registerColumn('table_pcweb_someprice_detail_dj', []);
-                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { spotcontractid }).then((res) => {
+                        console.log(res, 'hhh');
                         tableList.value = res;
                     });
                     break;
                 case 3: // 交收记录
                     registerColumn('table_pcweb_someprice_detail_js', []);
-                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
                 case 4: //款项记录
                     registerColumn('table_pcweb_someprice_detail_kx', []);
-                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
                 case 5: // 发票记录
                     registerColumn('table_pcweb_someprice_detail_fp', []);
-                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
-                        tableList.value = res;
-                    });
-                    break;
-                case 6: // 入库记录
-                    registerColumn('table_pcweb_someprice_detail_stock', []);
-                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
-                        spotcontractid: relatedid,
-                        inouttype: '1,3',
-                    }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 7: // 出库记录
-                    registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                case 6: // 出入库记录
+                    const inouttype = contracttype === 1 ? '5' : '6';
+                    if (contracttype === 1) {
+                        registerColumn('table_pcweb_someprice_detail_stock', []);
+                    } else {
+                        registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                    }
                     queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
-                        spotcontractid: relatedid,
-                        inouttype: '2,4',
+                        spotcontractid: spotcontractid,
+                        inouttype,
                     }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 8: //// 变更记录
+                case 7: //// 变更记录
                     registerColumn('table_pcweb_someprice_detail_change', []);
-                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 9: //// 关联记录
+                case 8: //// 关联记录
                     columns.value.length = 0;
                     columns.value.push(...columnsPaTradeLink);
                     queryResultLoadingAndInfo(QueryPaTradeLinkDetail, loading).then((res) => {
-                        tableList.value = res;
+                        // 关联日期降序
+                        tableList.value = res.sort((a, b) => moment(b.tradetime).valueOf() - moment(a.tradetime).valueOf());
                     });
                     break;
             }
@@ -211,7 +207,7 @@ export default defineComponent({
             getReceiptName,
             invoiceStatusName,
             stateName,
-            InOutTypeName
+            InOutTypeName,
         };
     },
 });

+ 2 - 1
src/views/business/sell/list/all/index.vue

@@ -49,7 +49,8 @@ export default defineComponent({
         contextMenu,
         filterCustomTable,
         MtpTableButton,
-        detail: defineAsyncComponent(() => import('../../components/detail/index.vue')),
+        detail: defineAsyncComponent(() => import('../../components/detail/index.vue')), // 详情
+        sell_pending_trade: defineAsyncComponent(() => import('@/views/market/futures/compoments/futures-trade/index.vue')), // 套保交易
         sell_pending_someprice: defineAsyncComponent(() => import('../../components/someprice/index.vue')), //点价登记
         sell_performance_settlement: defineAsyncComponent(() => import('../../components/settlement/index.vue')), //交收登记
         sell_performance_funds: defineAsyncComponent(() => import('../../components/funds/index.vue')), // 款项登记

+ 52 - 52
src/views/information/account_info/list/account_info_business/index.vue

@@ -1,50 +1,50 @@
 <template>
-    <!-- 业务账户 -->
-    <div class="account_info_business account_info_container" :loading="loading">
-        <filterCustomTable @search="search"></filterCustomTable>
-        <div class="tltLeft">
-            <span class="blue">
-                <svg class="icon svg-icon" aria-hidden="true">
-                    <use xlink:href="#icon-shuzhuangtu"></use>
-                </svg>
-                {{ getUserName() }}
-            </span>
-        </div>
-        <div class="a-collapse-container">
-            <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
-                <template #expandIcon="props">
-                    <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                        <use xlink:href="#icon-shouqi1"></use>
-                    </svg>
-                    <svg class="icon svg-icon" aria-hidden="true" v-else>
-                        <use xlink:href="#icon-shouqi2"></use>
-                    </svg>
-                </template>
-                <a-collapse-panel>
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="12">{{ item.rolename }}({{ item.userlist.length }})</a-col>
-                            <a-col :span="12">
-                                <mtp-table-button :buttons="firstBtn" :record="item" @click="openComponent" />
-                            </a-col>
-                        </a-row>
-                    </template>
-                    <a-collapse class="busyCollapse" v-for="(sub, j) in item.userlist" :key="j + '11'" :bordered="false">
-                        <a-collapse-panel :show-arrow="false">
-                            <template #header>
-                                <a-row class="contRow">
-                                    <a-col :span="12">{{ sub.loginname }}-{{ sub.logincode }}</a-col>
-                                    <a-col :span="12">{{ getLoginStatusEnumItemName(sub.loginstatus) }}</a-col>
-                                </a-row>
-                            </template>
-                            <mtp-table-button :buttons="secondBtn" :record="sub" @click="openComponent" />
-                        </a-collapse-panel>
-                    </a-collapse>
-                </a-collapse-panel>
-            </a-collapse>
-        </div>
-        <component :is="componentId" v-if="componentId" :selectedRow="selectedData" @cancel="closeComponent"></component>
+  <!-- 业务账户 -->
+  <div class="account_info_business account_info_container" :loading="loading">
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon" aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu"></use>
+        </svg>
+        {{ getUserName() }}
+      </span>
     </div>
+    <div class="a-collapse-container">
+      <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
+        <template #expandIcon="props">
+          <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
+            <use xlink:href="#icon-shouqi1"></use>
+          </svg>
+          <svg class="icon svg-icon" aria-hidden="true" v-else>
+            <use xlink:href="#icon-shouqi2"></use>
+          </svg>
+        </template>
+        <a-collapse-panel>
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="12">{{ item.rolename }}({{ item.userlist.length }})</a-col>
+              <a-col :span="12">
+                <mtp-table-button :buttons="firstBtn" :record="item" @click="openComponent" />
+              </a-col>
+            </a-row>
+          </template>
+          <a-collapse class="busyCollapse" v-for="(sub, j) in item.userlist" :key="j + '11'" :bordered="false">
+            <a-collapse-panel :show-arrow="false">
+              <template #header>
+                <a-row class="contRow">
+                  <a-col :span="12">{{ sub.loginname }}-{{ sub.logincode }}</a-col>
+                  <a-col :span="12">{{ getLoginStatusEnumItemName(sub.loginstatus) }}</a-col>
+                </a-row>
+              </template>
+              <mtp-table-button :buttons="handleBtnList(secondBtn,sub)" :record="sub" @click="openComponent" />
+            </a-collapse-panel>
+          </a-collapse>
+        </a-collapse-panel>
+      </a-collapse>
+    </div>
+    <component :is="componentId" v-if="componentId" :selectedRow="selectedData" @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -55,7 +55,7 @@ import { handlerManagerList } from '@/common/setup/user';
 import { getLoginStatusEnumItemName } from '@/common/constants/enumsName';
 import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import { getUserName } from '@/services/bus/user';
-import { handleTableList } from '../setup';
+import { handleTableList, handleBtnList } from '../setup';
 import { ref } from 'vue';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { getTableButton } from '@/common/setup/table/button';
@@ -82,18 +82,18 @@ export default defineComponent({
         const firstBtn = getTableButton(['account_spot_add']);
         const secondBtn = getTableButton(['account_spot_add'], true);
 
-        // 处理根据状态显示对应按钮
-        function handleBtnAction() {
-            handleTableList(queryTable, tableList, secondBtn);
+        // 获取列表数据
+        function queryTableAction() {
+            handleTableList(queryTable, tableList);
         }
 
         // 弹窗选中的数据
         const selectedData = ref<ErmcpLoginUserEx>();
 
         // 控制异步组件
-        const { componentId, closeComponent, openComponent } = handleModalComponent(handleBtnAction, selectedData);
+        const { componentId, closeComponent, openComponent } = handleModalComponent(queryTableAction, selectedData);
         initData(() => {
-            handleBtnAction();
+            queryTableAction();
         });
 
         // 查询
@@ -106,7 +106,7 @@ export default defineComponent({
             search,
             tableList,
             getLoginStatusEnumItemName,
-            handleBtnAction,
+            handleBtnList,
             getUserName,
             componentId,
             closeComponent,

+ 52 - 52
src/views/information/account_info/list/account_info_futures/index.vue

@@ -1,55 +1,55 @@
 <template>
-    <!-- 期货账户 -->
-    <div class="account_info_futures account_info_container" :loading="loading">
-        <filterCustomTable @search="search"></filterCustomTable>
-        <div class="tltLeft">
-            <span class="blue">
-                <svg class="icon svg-icon" aria-hidden="true">
-                    <use xlink:href="#icon-shuzhuangtu" />
-                </svg>
-                {{ getUserName() }}
-            </span>
-            <mtp-table-button :buttons="firstBtn" @click="openComponent" />
-        </div>
-        <div class="a-collapse-container">
-            <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
-                <template #expandIcon="props">
-                    <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                        <use xlink:href="#icon-shouqi1" />
-                    </svg>
-                    <svg class="icon svg-icon" aria-hidden="true" v-else>
-                        <use xlink:href="#icon-shouqi2" />
-                    </svg>
-                </template>
-                <a-collapse-panel>
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="12">
-                                {{ item.mainAcc.accountname }}
-                                {{ '-' + item.mainAcc.hedgeaccountcode }}
-                                ({{ item.subacclist.length }}){{ item.mainAcc.fcname }}
-                            </a-col>
-                            <a-col :span="12">
-                                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
-                            </a-col>
-                        </a-row>
-                    </template>
-                    <a-collapse class="futureCollapse" accordion :bordered="false">
-                        <a-collapse-panel :show-arrow="false" v-for="(sub, i) in item.subacclist" :key="i + '11'">
-                            <template #header>
-                                <a-row class="contRow">
-                                    <a-col :span="12">{{ sub.accountname }}-{{ sub.accountid }}</a-col>
-                                    <a-col :span="12">{{ getTaAccountStatus(sub.tradestatus) }}</a-col>
-                                </a-row>
-                            </template>
-                            <mtp-table-button :buttons="thirdBtn" :record="sub" @click="openSecondBtnAction" />
-                        </a-collapse-panel>
-                    </a-collapse>
-                </a-collapse-panel>
-            </a-collapse>
-        </div>
-        <component :is="componentId" v-if="componentId" :selectedData="selectedData" :firstSelectedData="firstSelectedData" :userList="userList" :marginList="marginList" :feeList="feeList" @update="queryUserList" @cancel="closeComponent"></component>
+  <!-- 期货账户 -->
+  <div class="account_info_futures account_info_container" :loading="loading">
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon" aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu" />
+        </svg>
+        {{ getAreaUserName() }}
+      </span>
+      <mtp-table-button :buttons="firstBtn" @click="openComponent" />
     </div>
+    <div class="a-collapse-container">
+      <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
+        <template #expandIcon="props">
+          <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
+            <use xlink:href="#icon-shouqi1" />
+          </svg>
+          <svg class="icon svg-icon" aria-hidden="true" v-else>
+            <use xlink:href="#icon-shouqi2" />
+          </svg>
+        </template>
+        <a-collapse-panel>
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="12">
+                {{ item.mainAcc.accountname }}
+                {{ '-' + item.mainAcc.hedgeaccountcode }}
+                ({{ item.subacclist.length }}){{ item.mainAcc.fcname }}
+              </a-col>
+              <a-col :span="12">
+                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
+              </a-col>
+            </a-row>
+          </template>
+          <a-collapse class="futureCollapse" accordion :bordered="false">
+            <a-collapse-panel :show-arrow="false" v-for="(sub, i) in item.subacclist" :key="i + '11'">
+              <template #header>
+                <a-row class="contRow">
+                  <a-col :span="12">{{ sub.accountname }}-{{ sub.accountid }}</a-col>
+                  <a-col :span="12">{{ getTaAccountStatus(sub.tradestatus) }}</a-col>
+                </a-row>
+              </template>
+              <mtp-table-button :buttons="thirdBtn" :record="sub" @click="openSecondBtnAction" />
+            </a-collapse-panel>
+          </a-collapse>
+        </a-collapse-panel>
+      </a-collapse>
+    </div>
+    <component :is="componentId" v-if="componentId" :selectedData="selectedData" :firstSelectedData="firstSelectedData" :userList="userList" :marginList="marginList" :feeList="feeList" @update="queryUserList" @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -59,7 +59,7 @@ import { initData } from '@/common/methods';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { getTableButton } from '@/common/setup/table/button';
 import { handlerManagerList } from '@/common/setup/user';
-import { getUserName } from '@/services/bus/user';
+import { getAreaUserName } from '@/services/bus/user';
 import { ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
 import { ref, Ref } from 'vue';
@@ -134,7 +134,7 @@ export default defineComponent({
             search,
             tableList,
             getTaAccountStatus,
-            getUserName,
+            getAreaUserName,
             queryTable,
             getBtnList,
             firstBtn,

+ 59 - 77
src/views/information/account_info/list/account_info_manager/index.vue

@@ -1,62 +1,53 @@
 <template>
-    <!-- 管理账户 -->
-    <div class="account_info_manager account_info_container" :loading="loading">
-        <filterCustomTable @search="search"></filterCustomTable>
-        <div class="tltLeft">
-            <span class="blue">
-                <svg class="icon svg-icon" aria-hidden="true">
-                    <use xlink:href="#icon-shuzhuangtu"></use>
-                </svg>
-                {{ getUserName() }}
-            </span>
-            <mtp-table-button :buttons="firstBtn" @click="openComponent" />
-        </div>
-        <div class="a-collapse-container">
-            <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
-                <template #expandIcon="props">
-                    <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                        <use xlink:href="#icon-shouqi1"></use>
-                    </svg>
-                    <svg class="icon svg-icon" aria-hidden="true" v-else>
-                        <use xlink:href="#icon-shouqi2"></use>
-                    </svg>
-                </template>
-                <a-collapse-panel>
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="12">{{ item.rolename }}({{ item.userlist.length }})</a-col>
-                            <a-col :span="12">
-                                <!-- <BtnList :selectedData="item" :btnList="secondBtn" @onClick="openAction" /> -->
-                                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
-                            </a-col>
-                        </a-row>
-                    </template>
-                    <a-collapse class="busyCollapse" v-for="(sub, i) in item.userlist" :key="i + '11'" :bordered="false">
-                        <a-collapse-panel :show-arrow="false">
-                            <template #header>
-                                <a-row class="contRow">
-                                    <a-col :span="12">{{ sub.loginname }}-{{ sub.logincode }}</a-col>
-                                    <a-col :span="12">{{ getLoginStatusEnumItemName(sub.loginstatus) }}</a-col>
-                                </a-row>
-                            </template>
-                            <!-- <BtnList :btnList="sub.btnList" :selectedData="sub" @onClick="moreOptenAction" /> -->
-                            <mtp-table-button :buttons="thirdBtn" :record="sub" @click="openSecondBtnAction" />
-                        </a-collapse-panel>
-                    </a-collapse>
-                </a-collapse-panel>
-            </a-collapse>
-        </div>
-        <!-- <Add @refresh="handleBtnAction" :selectedData="addModelData" :tableList="tableList" />
-        <Modify :tableList="tableList" @refresh="handleBtnAction" :selectedData="moreModelData" />
-        <Cancel @refresh="handleBtnAction" :selectedData="moreModelData" />
-        <Locked @refresh="handleBtnAction" :selectedData="moreModelData" />
-        <Unlocked @refresh="handleBtnAction" :selectedData="moreModelData" />
-        <Reset @refresh="handleBtnAction" :selectedData="moreModelData" />
-        <Detail :selectedData="moreModelData" />
-        <AddPermission @refresh="handleBtnAction" />
-        <Permission /> -->
-        <component :is="componentId" v-if="componentId" :tableList="tableList" :selectedData="selectedData" @cancel="closeComponent"></component>
+  <!-- 管理账户 -->
+  <div class="account_info_manager account_info_container" :loading="loading">
+    <filterCustomTable @search="search"></filterCustomTable>
+    <div class="tltLeft">
+      <span class="blue">
+        <svg class="icon svg-icon" aria-hidden="true">
+          <use xlink:href="#icon-shuzhuangtu"></use>
+        </svg>
+        {{ getUserName() }}
+      </span>
+      <mtp-table-button :buttons="firstBtn" @click="openComponent" />
     </div>
+    <div class="a-collapse-container">
+      <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
+        <template #expandIcon="props">
+          <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
+            <use xlink:href="#icon-shouqi1"></use>
+          </svg>
+          <svg class="icon svg-icon" aria-hidden="true" v-else>
+            <use xlink:href="#icon-shouqi2"></use>
+          </svg>
+        </template>
+        <a-collapse-panel>
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="12">{{ item.rolename }}({{ item.userlist.length }})</a-col>
+              <a-col :span="12">
+                <!-- <BtnList :selectedData="item" :btnList="secondBtn" @onClick="openAction" /> -->
+                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
+              </a-col>
+            </a-row>
+          </template>
+          <a-collapse class="busyCollapse" v-for="(sub, i) in item.userlist" :key="i + '11'" :bordered="false">
+            <a-collapse-panel :show-arrow="false">
+              <template #header>
+                <a-row class="contRow">
+                  <a-col :span="12">{{ sub.loginname }}-{{ sub.logincode }}</a-col>
+                  <a-col :span="12">{{ getLoginStatusEnumItemName(sub.loginstatus) }}</a-col>
+                </a-row>
+              </template>
+              <!-- <BtnList :btnList="sub.btnList" :selectedData="sub" @onClick="moreOptenAction" /> -->
+              <mtp-table-button :buttons="handleBtnList(thirdBtn,sub)" :record="sub" @click="openSecondBtnAction" />
+            </a-collapse-panel>
+          </a-collapse>
+        </a-collapse-panel>
+      </a-collapse>
+    </div>
+    <component :is="componentId" v-if="componentId" :tableList="tableList" :selectedData="selectedData" @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -64,9 +55,9 @@ import { defineAsyncComponent, defineComponent, MtpTableButton } from '@/common/
 import { initData } from '@/common/methods';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
 import { getLoginStatusEnumItemName } from '@/common/constants/enumsName';
-import { getAccountStatus, handleModalData, handleTableList, useSelectedData, useTaAccount } from '../setup';
+import { getAccountStatus, handleTableList, handleBtnList, useSelectedData, useTaAccount } from '../setup';
 import { getUserName } from '@/services/bus/user';
-import { ErmcpLoginUser, ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
+import { ErmcpLoginUser } from '@/services/go/ermcp/account/interface';
 import { handlerManagerList } from '@/common/setup/user';
 import { ref, Ref } from 'vue';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
@@ -80,9 +71,9 @@ export default defineComponent({
         detail: defineAsyncComponent(() => import('../../compoments/detail-managers/index.vue')), // 详情
         account_manager_add: defineAsyncComponent(() => import('../../compoments/add-managers-permission/index.vue')), // 新增权限模板
         account_manager_setting: defineAsyncComponent(() => import('../../compoments/managers-permission/index.vue')), // 权限设置
-        account_manager_child_add: defineAsyncComponent(() => import('../../compoments/add-managers/index.vue')), //  新增角色
+        account_manager_child_add: defineAsyncComponent(() => import('../../compoments/add-managers/index.vue')), //  新增账户
         account_manager_child_modify: defineAsyncComponent(() => import('../../compoments/modify-managers/index.vue')), // 修改
-        account_trade_child_cancel: defineAsyncComponent(() => import('../../compoments/cancel-managers/index.vue')), // 注销
+        account_manager_child_cancel: defineAsyncComponent(() => import('../../compoments/cancel-managers/index.vue')), // 注销
         account_manager_child_locked: defineAsyncComponent(() => import('../../compoments/locked-managers/index.vue')), // 锁定
         account_manager_child_unlocked: defineAsyncComponent(() => import('../../compoments/unlocked-managers/index.vue')), // 解锁
         account_manager_child_reset: defineAsyncComponent(() => import('../../compoments/reset-managers/index.vue')), // 重置
@@ -94,22 +85,17 @@ export default defineComponent({
 
         const firstBtn = getTableButton(['account_manager_add', 'account_manager_setting']);
         const secondBtn = getTableButton(['account_manager_child_add']);
-        const thirdBtn = getTableButton(['account_manager_child_modify', 'account_manager_child_reset', 'account_manager_child_locked', 'account_manager_child_unlocked', 'account_trade_child_cancel', 'detail']);
-
-        // 新增弹窗
-        // const { selectedData: addModelData, openAction } = handleModalData<ErmcpLoginUserEx>();
-        // 修改 重置密码、详情等弹窗
-        // const { selectedData: moreModelData, openAction: moreOptenAction } = handleModalData<ErmcpLoginUser>();
+        const thirdBtn = getTableButton(['account_manager_child_modify', 'account_manager_child_reset', 'account_manager_child_locked', 'account_manager_child_unlocked', 'account_manager_child_cancel', 'detail']);
 
-        // 处理根据状态显示对应按钮
-        function handleBtnAction() {
-            handleTableList(queryTable, tableList, thirdBtn);
+        // 获取列表数据
+        function queryTableAction() {
+            handleTableList(queryTable, tableList);
         }
 
         // 弹窗选中的数据
         const selectedData = ref<ErmcpLoginUser>();
         // 控制异步组件
-        const { componentId, closeComponent, openComponent } = handleModalComponent<ErmcpLoginUser>(handleBtnAction, selectedData as Ref<ErmcpLoginUser>);
+        const { componentId, closeComponent, openComponent } = handleModalComponent<ErmcpLoginUser>(queryTableAction, selectedData as Ref<ErmcpLoginUser>);
 
         // 处理点击 二级按钮时候 选中的数据
         const { firstSelectedData, openSecondBtnAction } = useSelectedData(tableList, openComponent);
@@ -117,7 +103,7 @@ export default defineComponent({
         // 期货账户
         const { updateTaAccount } = useTaAccount();
         initData(() => {
-            handleBtnAction();
+            queryTableAction();
             updateTaAccount();
         });
 
@@ -134,16 +120,12 @@ export default defineComponent({
             getAccountStatus,
             getUserName,
             getLoginStatusEnumItemName,
-            // addModelData,
-            // openAction,
-            // moreModelData,
-            // moreOptenAction,
-            handleBtnAction,
             componentId,
             closeComponent,
             openComponent,
             firstSelectedData,
             openSecondBtnAction,
+            handleBtnList,
             selectedData,
         };
     },

+ 18 - 42
src/views/information/account_info/list/account_info_trade/index.vue

@@ -1,33 +1,23 @@
 <template>
   <!-- 交易账户 -->
-  <div class="account_info_trade account_info_container"
-       :loading="loading">
+  <div class="account_info_trade account_info_container" :loading="loading">
     <filterCustomTable @search="search"></filterCustomTable>
     <div class="tltLeft">
       <span class="blue">
-        <svg class="icon svg-icon"
-             aria-hidden="true">
+        <svg class="icon svg-icon" aria-hidden="true">
           <use xlink:href="#icon-shuzhuangtu"></use>
         </svg>
         {{ getUserName() }}
       </span>
-      <mtp-table-button :buttons="firstBtn"
-                        @click="openComponent" />
+      <mtp-table-button :buttons="firstBtn" @click="openComponent" />
     </div>
     <div class="a-collapse-container">
-      <a-collapse class="spotCollapse"
-                  v-for="(item, i) in tableList"
-                  :key="i + '11'"
-                  :bordered="false">
+      <a-collapse class="spotCollapse" v-for="(item, i) in tableList" :key="i + '11'" :bordered="false">
         <template #expandIcon="props">
-          <svg class="icon svg-icon"
-               aria-hidden="true"
-               v-if="props.isActive == 0">
+          <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
             <use xlink:href="#icon-shouqi1"></use>
           </svg>
-          <svg class="icon svg-icon"
-               aria-hidden="true"
-               v-else>
+          <svg class="icon svg-icon" aria-hidden="true" v-else>
             <use xlink:href="#icon-shouqi2"></use>
           </svg>
         </template>
@@ -36,16 +26,11 @@
             <a-row class="headRow">
               <a-col :span="12"> {{ item.rolename }}({{ item.userlist.length }}) </a-col>
               <a-col :span="12">
-                <mtp-table-button :buttons="secondBtn"
-                                  :record="item"
-                                  @click="openComponent" />
+                <mtp-table-button :buttons="secondBtn" :record="item" @click="openComponent" />
               </a-col>
             </a-row>
           </template>
-          <a-collapse class="busyCollapse"
-                      v-for="(sub, i) in item.userlist"
-                      :key="i + '11'"
-                      :bordered="false">
+          <a-collapse class="busyCollapse" v-for="(sub, i) in item.userlist" :key="i + '11'" :bordered="false">
             <a-collapse-panel :show-arrow="false">
               <template #header>
                 <a-row class="contRow">
@@ -53,21 +38,13 @@
                   <a-col :span="12">{{ getRoleTypeName(sub.loginstatus) }}</a-col>
                 </a-row>
               </template>
-              <mtp-table-button :buttons="thirdBtn"
-                                :record="sub"
-                                @click="openSecondBtnAction" />
+              <mtp-table-button :buttons="handleBtnList(thirdBtn,sub)" :record="sub" @click="openSecondBtnAction" />
             </a-collapse-panel>
           </a-collapse>
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <component :is="componentId"
-               v-if="componentId"
-               :accountList="accountList"
-               :tableList="tableList"
-               :firstBtnData="firstSelectedData"
-               :selectedData="selectedData"
-               @cancel="closeComponent"></component>
+    <component :is="componentId" v-if="componentId" :accountList="accountList" :tableList="tableList" :firstBtnData="firstSelectedData" :selectedData="selectedData" @cancel="closeComponent"></component>
   </div>
 </template>
 
@@ -75,16 +52,15 @@
 import { initData } from '@/common/methods';
 import { defineAsyncComponent, defineComponent, MtpTableButton } from '@/common/export/commonTable';
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
-import { getRoleTypeName, useSelectedData } from '../setup';
+import { getRoleTypeName, useSelectedData, handleBtnList } from '../setup';
 import { getUserName } from '@/services/bus/user';
 import { handleTableList } from '../setup';
-import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
+import { ErmcpLoginUser, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { QueryAccMgrTaaccount } from '@/services/go/ermcp/account';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { handlerManagerList } from '@/common/setup/user';
 import { getTableButton } from '@/common/setup/table/button';
-import { BtnListType } from '@/common/components/btnList/interface';
 import { Ref, ref } from 'vue';
 
 export default defineComponent({
@@ -111,9 +87,9 @@ export default defineComponent({
         const secondBtn = getTableButton(['account_trade_modify', 'account_trade_child_add']);
         const thirdBtn = getTableButton(['account_trade_add', 'account_trade_modify', 'account_trade_child_add'], true);
 
-        // 处理根据状态显示对应按钮
-        function handleBtnAction() {
-            handleTableList(queryTable, tableList, thirdBtn);
+        // 获取列表数据
+        function queryTableAction() {
+            handleTableList(queryTable, tableList);
         }
 
         // 授权期货账户
@@ -121,13 +97,13 @@ export default defineComponent({
         // 弹窗选中的数据
         const selectedData = ref<ErmcpLoginUser>();
         // 控制异步组件
-        const { componentId, closeComponent, openComponent } = handleModalComponent<ErmcpLoginUser>(handleBtnAction, selectedData as Ref<ErmcpLoginUser>);
+        const { componentId, closeComponent, openComponent } = handleModalComponent<ErmcpLoginUser>(queryTableAction, selectedData as Ref<ErmcpLoginUser>);
 
         // 处理点击 二级按钮时候 选中的数据
         const { firstSelectedData, openSecondBtnAction } = useSelectedData(tableList, openComponent);
 
         initData(() => {
-            handleBtnAction();
+            queryTableAction();
             // 处理授权期货账户
             queryResultLoadingAndInfo(QueryAccMgrTaaccount, loading).then((res) => {
                 accountList.value.length = 0;
@@ -155,7 +131,7 @@ export default defineComponent({
             tableList,
             accountList,
             getRoleTypeName,
-            handleBtnAction,
+            handleBtnList,
             getUserName,
             componentId,
             closeComponent,

+ 11 - 13
src/views/information/account_info/list/setup.ts

@@ -99,28 +99,26 @@ export function handleModalData<T extends object>() {
     return { selectedData, openAction }
 }
 
-export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>, btnList: BtnListType[]) {
+export function handleTableList(fn: Function, tableList: Ref<ErmcpLoginUserEx[]>) {
     fn().then(() => {
         tableList.value.forEach((el) => {
             // 过滤无效
             const arr = el.userlist.filter((item) => item.loginstatus !== 3);
-            arr.forEach((item) => {
-                const { loginstatus } = item;
-                let result = [...btnList];
-                if (loginstatus === 1) {
-                    // 正常
-                    result = btnList.filter((e) => e.lable !== '解锁');
-                } else if (loginstatus === 2) {
-                    // 冻结
-                    result = btnList.filter((e) => e.lable === '解锁' || e.lable === '详情');
-                }
-                Object.assign(item, { btnList: result });
-            });
             Object.assign(el, { userlist: arr });
         });
     });
 }
 
+// 处理根据状态显示对应按钮
+export function handleBtnList(btnList: BtnListType[], item: ErmcpLoginUser) {
+    switch (item.loginstatus) {
+        case 1: // 正常
+            return btnList.filter((e) => e.lable !== '解锁');
+        case 2: // 冻结
+            return btnList.filter((e) => e.lable === '解锁' || e.lable === '详情');
+    }
+};
+
 export function handleBtnClickData() {
     const firstBtnData = ref<any>(null)
     const secondBtnData = ref<any>(null)

+ 89 - 85
src/views/information/spot-contract/components/detail/index.vue

@@ -1,77 +1,82 @@
 <template>
-    <!-- 现货合同详情-->
-    <a-modal class="add-custom custom-detail" title="现货合同详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
-        <template #footer>
-            <a-button key="submit" type="primary" :loading="loading" @click="cancel">关闭</a-button>
+  <!-- 现货合同详情-->
+  <a-modal class="add-custom custom-detail" title="现货合同详情" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+    <template #footer>
+      <a-button key="submit" type="primary" :loading="loading" @click="cancel">关闭</a-button>
+    </template>
+    <a-tabs v-model:activeKey="activeKey" @change="tabClick">
+      <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
+    </a-tabs>
+    <InfoDetail :selectedRow="selectedRow" v-if="activeKey == 1" />
+    <div class="tableDatas" v-else>
+      <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
+        <template #status="{ text }">
+          <span class="yellow">{{ text }}</span>
+          <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
         </template>
-        <a-tabs v-model:activeKey="activeKey" @change="tabClick">
-            <a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.name"></a-tab-pane>
-        </a-tabs>
-        <InfoDetail :selectedRow="selectedRow" v-if="activeKey == 1" />
-        <div class="tableDatas" v-else>
-            <a-table class="dialogTable" :columns="columns" :data-source="tableList" :pagination="false">
-                <template #status="{ text }">
-                    <span class="yellow">{{ text }}</span>
-                    <!-- 审核通过'green' 审核拒绝 'orange' 待审核'yellow'   -->
-                </template>
 
-                <!-- 审核状态 -->
-                <template #applystatus="{ text }">
-                    <a>{{ getApplyStatusName(text) }}</a>
-                </template>
+        <!-- 审核状态 -->
+        <template #applystatus="{ text }">
+          <a>{{ getApplyStatusName(text) }}</a>
+        </template>
 
-                <!-- 发票金额-->
-                <template #invoicetype="{ text }">
-                    <a>{{ invoiceStatusName(text) }}</a>
-                </template>
+        <!-- 发票金额-->
+        <template #invoicetype="{ text }">
+          <a>{{ invoiceStatusName(text) }}</a>
+        </template>
 
-                <!-- 发票类型-->
-                <template #contracttype="{ text }">
-                    <a>{{ getReceiptName(text) }}</a>
-                </template>
+        <!-- 发票类型-->
+        <template #contracttype="{ text }">
+          <a>{{ getReceiptName(text) }}</a>
+        </template>
+
+        <!-- 出入库类型 -->
+        <template #inouttype="{ text }">
+          <a>{{ InOutTypeName(text) }}</a>
+        </template>
 
-                <!-- 出入库类型 -->
-                <template #inouttype="{ text }">
-                    <a>{{ InOutTypeName(text) }}</a>
-                </template>
+        <!-- 款项类型 -->
+        <template #kxtype="{ record }">
+          <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
+        </template>
 
-                <!-- 款项类型 -->
-                <template #kxtype="{ record }">
-                    <a>{{ stateName(record.deductamount, record.contracttype) }}</a>
-                </template>
+        <!-- 金额-->
+        <template #payamount="{ text, record }">
+          <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
+        </template>
 
-                <!-- 金-->
-                <template #payamount="{ text, record }">
-                    <span>{{ formatValue(record.kxtype === 2 ? record.deductamount : text) }}</span>
-                </template>
+        <!-- 调整付保证金-->
+        <template #addmargin="{ record }">
+          <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
+        </template>
 
-                <!-- 调整付保证金-->
-                <template #addmargin="{ record }">
-                    <span>{{ formatValue(record.addmargin === undefined || '' ? record.decmargin : record.addmargin) }}</span>
-                </template>
+        <!-- 交收量 -->
+        <template #reckonrealqty="{ record }">
+          <span>{{ formatValue(record.reckonrealqty) }}</span>
+        </template>
 
-                <!-- 交收量 -->
-                <template #reckonrealqty="{ record }">
-                    <span>{{ formatValue(record.reckonrealqty) }}</span>
-                </template>
+        <!-- 其他费用 -->
+        <template #reckonotheramount="{ record }">
+          <span>{{ formatValue(record.reckonotheramount) }}</span>
+        </template>
 
-                <!-- 其他费用 -->
-                <template #reckonotheramount="{ record }">
-                    <span>{{ formatValue(record.reckonotheramount) }}</span>
-                </template>
+        <!-- 调整金额 -->
+        <template #reckonadjustamount="{ record }">
+          <span>{{ formatValue(record.reckonadjustamount) }}</span>
+        </template>
 
-                <!-- 申请人 -->
-                <template #applyname="{ record }">
-                    <span>{{ formatValue(record.applyname) }}</span>
-                </template>
-                <template #warehousename="{record}">
-                    {{record.warehousecode}}
-                </template>
+        <!-- 申请人 -->
+        <template #applyname="{ record }">
+          <span>{{ formatValue(record.applyname) }}</span>
+        </template>
+        <template #warehousename="{record}">
+          {{record.warehousecode}}
+        </template>
 
-                <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
-            </a-table>
-        </div>
-    </a-modal>
+        <!-- 款项记录 款项类型为退款  则金额使用deductamount-->
+      </a-table>
+    </div>
+  </a-modal>
 </template>
 
 <script lang="ts">
@@ -93,6 +98,7 @@ import { kxtypeName } from '@/views/manage/finance-review/setup';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { formatValue } from '@/common/methods';
 import { columnsPaTradeLink } from './setup';
+import moment from 'moment';
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -125,68 +131,66 @@ export default defineComponent({
                   { key: 4, name: '款项记录' },
                   { key: 5, name: '发票记录' },
                   { key: 6, name: props.selectedRow.contracttype === 1 ? '入库记录' : '出库记录' },
-                  { key: 8, name: '变更记录' },
-                  { key: 9, name: '关联记录' },
+                  { key: 7, name: '变更记录' },
+                  { key: 8, name: '关联记录' },
               ];
         activeKey.value = 1;
         function tabClick() {
-            const relatedid = props.selectedRow.spotcontractid;
+            const { spotcontractid, contracttype } = props.selectedRow;
             switch (activeKey.value) {
                 case 1:
                     break;
                 case 2: // 点价记录
                     registerColumn('table_pcweb_someprice_detail_dj', []);
-                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessDj, loading, { spotcontractid }).then((res) => {
+                        console.log(res, 'hhh');
                         tableList.value = res;
                     });
                     break;
                 case 3: // 交收记录
                     registerColumn('table_pcweb_someprice_detail_js', []);
-                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessJs, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
                 case 4: //款项记录
                     registerColumn('table_pcweb_someprice_detail_kx', []);
-                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessKx, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
                 case 5: // 发票记录
                     registerColumn('table_pcweb_someprice_detail_fp', []);
-                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { relatedid }).then((res) => {
-                        tableList.value = res;
-                    });
-                    break;
-                case 6: // 入库记录
-                    registerColumn('table_pcweb_someprice_detail_stock', []);
-                    queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
-                        spotcontractid: relatedid,
-                        inouttype: '1,3',
-                    }).then((res) => {
+                    queryResultLoadingAndInfo(QueryBusinessFp, loading, { spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 7: // 出库记录
-                    registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                case 6: // 出入库记录
+                    const inouttype = contracttype === 1 ? '5' : '6';
+                    if (contracttype === 1) {
+                        registerColumn('table_pcweb_someprice_detail_stock', []);
+                    } else {
+                        registerColumn('table_pcweb_someprice_detail_stock_out', []);
+                    }
                     queryResultLoadingAndInfo(QueryAreaStockApply, loading, {
-                        spotcontractid: relatedid,
-                        inouttype: '2,4',
+                        spotcontractid: spotcontractid,
+                        inouttype,
                     }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 8: //// 变更记录
+                case 7: //// 变更记录
                     registerColumn('table_pcweb_someprice_detail_change', []);
-                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: relatedid }).then((res) => {
+                    queryResultLoadingAndInfo(QueryChangeLog, loading, { RelatedId: spotcontractid }).then((res) => {
                         tableList.value = res;
                     });
                     break;
-                case 9: //// 关联记录
+                case 8: //// 关联记录
                     columns.value.length = 0;
                     columns.value.push(...columnsPaTradeLink);
                     queryResultLoadingAndInfo(QueryPaTradeLinkDetail, loading).then((res) => {
-                        tableList.value = res;
+                        // 关联日期降序
+                        tableList.value = res.sort((a, b) => moment(b.tradetime).valueOf() - moment(a.tradetime).valueOf());
                     });
                     break;
             }

+ 14 - 5
src/views/information/spot-contract/components/filterTable/index.vue

@@ -1,9 +1,9 @@
 <template>
-    <!-- 过滤客户资料表格 -->
-    <div class="filterTable">
-        <FilterOption :selectList="selectList" :inputList="inputList" :fixedBtnList="fixedBtnList" />
-        <slot></slot>
-    </div>
+  <!-- 过滤客户资料表格 -->
+  <div class="filterTable">
+    <FilterOption :selectList="selectList" :inputList="inputList" :fixedBtnList="fixedBtnList" />
+    <slot></slot>
+  </div>
 </template>
 
 <script lang="ts">
@@ -17,6 +17,15 @@ export default defineComponent({
         const select: SelectList[] = [
             {
                 value: undefined,
+                key: 'contracttype',
+                placeholder: '全部合同类型',
+                list: [
+                    { value: 1, lable: '采购' },
+                    { value: -1, lable: '销售' },
+                ],
+            },
+            {
+                value: undefined,
                 key: 'pricetype',
                 placeholder: '全部定价类型',
                 list: [

+ 2 - 2
src/views/market/futures/compoments/futures-trade/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <!-- 期货交易 -->
-  <Drawer class="top dialog-trade" title="期货交易" placement="right" :visible="visible" @cancel="cancel">
+  <!-- 期货交易、套保交易 -->
+  <Drawer class="top dialog-trade" :title="isHedging ? '套保交易' : '期货交易'" placement="right" :visible="visible" @cancel="cancel">
     <div class="futures_trade">
       <div class="futures_trade__left">
         <div class="futures_trade__form">

+ 2 - 1
src/views/market/futures/setup.tsx

@@ -44,7 +44,8 @@ export function getColumnsList() {
         },
         {
             title: '名称',
-            key: 'goodsname'
+            key: 'goodsname',
+            width: 120
         },
         {
             title: '最新价',

+ 109 - 146
src/views/report/sum_pl_report/list/sum_pl_report/index.vue

@@ -2,47 +2,10 @@
   <!-- 汇总损益报表 -->
   <div class="table-detail-container table-height" :loading="loading">
     <Filter @update="search"></Filter>
-    <a-table
-      :columns="columns"
-      class="srcollYTable"
-      :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
-      :pagination="false"
-      :expandedRowKeys="expandedRowKeys"
-      :customRow="customRow"
-      rowKey="key"
-      :data-source="tableList"
-    >
-      <!-- 出现浮点失真  强行处理-->
-      <template #spotactualpl="{ record }">
-        <span>{{ record.spotactualpl.toFixed(2) }}</span>
-      </template>
-      <template #spotfloatpl="{ record }">
-        <span>{{ record.spotfloatpl.toFixed(2) }}</span>
-      </template>
-      <template #futureactualpl="{ record }">
-        <span>{{ record.futureactualpl.toFixed(2) }}</span>
-      </template>
-      <!-- 期现比例 -->
-      <template #futurespotratio="{ text }">
-        <span>{{ (+text) * 100 }}{{+text ? '%' : ''}}</span>
-      </template>
-      <template #sumactualpl="{ record }">
-        <span>{{ record.sumactualpl.toFixed(2) }}</span>
-      </template>
-      <template #sumpl="{ record }">
-        <span>{{ record.sumpl.toFixed(2) }}</span>
-      </template>
-    </a-table>
+    <a-table :columns="getColumns()" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="customRow" rowKey="key" :data-source="tableList"></a-table>
     <!-- 明细 -->
     <Description v-if="visible" @close="closeDrawer" @changeTab="changeTab" :tabList="tabList">
-      <a-table
-        :columns="columnsDetail"
-        class="topTable"
-        :pagination="false"
-        rowKey="key"
-        :data-source="detailTableList"
-        :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
-      >
+      <a-table :columns="columnsDetail" class="topTable" :pagination="false" rowKey="key" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
         <!-- 出现浮点失真  强行处理 * 2-->
         <template #spotactualpl="{ record }">
           <span>{{ record.spotactualpl.toFixed(2) }}</span>
@@ -78,120 +41,120 @@ import { TypeAndTime } from '@/views/report/interface';
 import { handleInitTypeAndTime } from '@/views/report/setup';
 import { ref, watchEffect } from 'vue';
 import Filter from '../../components/filterTable/index.vue';
-import { columns } from './setup';
+import { getColumns } from './setup';
 
 export default defineComponent({
-  name: 'sum_pl_report',
-  components: {
-    Filter,
-    Description,
-  },
-  setup() {
-    let cycletime = '';
-    // 周期类型
-    const cycletype = ref(0);
-    // 表格列表数据
-    const { loading, tableList, queryTable } = queryTableList<Ermcp3ArealSumPL>(true, 2);
-    // 获取列表数据
-    const queryTableAction = () => {
-      const { getInitTime, getInitType } = handleInitTypeAndTime();
-      cycletime = getInitTime();
-      const param: QryAreaSumPLReq = {
-        cycletype: getInitType(),
-        cycletime,
-        querytype: 1,
-      };
-      // 获取列表数据
-      queryTable(qryAreaSumPL, param);
-    };
-    const param: ComposeTableDetailParam = {
-      queryFn: queryTableAction, // 查询表格数据
-      tableName: 'table_pcweb_aggregate_profit_and_loss', // 表头key
-      tableFilterKey: [], // 表格过滤字段
-      menuType: EnumRouterName.sum_pl_report_sum_pl, // 当前tab页对应的code
-    };
-    const {
-      visible,
-      closeDrawer, // 控制 drawer 组件是否显示
-      updateColumn, //  表头数据
-      columnsDetail,
-      registerColumnDetail,
-      detailTableList, // 明细表头数据
-      expandedRowKeys,
-      selectedRow,
-      Rowclick, // 表格事件
-    } = handleComposeTable_detail<Ermcp3ArealSumPL>(param);
-    const chaceSearchValue = ref<TypeAndTime>();
+    name: 'sum_pl_report',
+    components: {
+        Filter,
+        Description,
+    },
+    setup() {
+        let cycletime = '';
+        // 周期类型
+        const cycletype = ref(0);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3ArealSumPL>(true, 2);
+        // 获取列表数据
+        const queryTableAction = () => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
+            cycletime = getInitTime();
+            const param: QryAreaSumPLReq = {
+                cycletype: getInitType(),
+                cycletime,
+                querytype: 1,
+            };
+            // 获取列表数据
+            queryTable(qryAreaSumPL, param);
+        };
+        const param: ComposeTableDetailParam = {
+            queryFn: queryTableAction, // 查询表格数据
+            tableName: 'table_pcweb_aggregate_profit_and_loss', // 表头key
+            tableFilterKey: [], // 表格过滤字段
+            menuType: EnumRouterName.sum_pl_report_sum_pl, // 当前tab页对应的code
+        };
+        const {
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            updateColumn, //  表头数据
+            columnsDetail,
+            registerColumnDetail,
+            detailTableList, // 明细表头数据
+            expandedRowKeys,
+            selectedRow,
+            Rowclick, // 表格事件
+        } = handleComposeTable_detail<Ermcp3ArealSumPL>(param);
+        const chaceSearchValue = ref<TypeAndTime>();
 
-    // 底部明细标签
-    const tabList = getTableButton();
+        // 底部明细标签
+        const tabList = getTableButton();
 
-    // 自定义表格事件
-    const customRow = (record: Ermcp3ArealSumPL, index: number) => {
-      // 日报表不显示“损益明细“标签页
-      if (cycletype.value === 0) {
-        return {};
-      }
-      return Rowclick(record, index);
-    };
+        // 自定义表格事件
+        const customRow = (record: Ermcp3ArealSumPL, index: number) => {
+            // 日报表不显示“损益明细“标签页
+            if (cycletype.value === 0) {
+                return {};
+            }
+            return Rowclick(record, index);
+        };
 
-    // 切换明细
-    function changeTab(index: number, current: TabList) {
-      const { code, lable } = current;
-      const data = selectedRow.value as Ermcp3ArealSumPL;
-      const { cycletype, currencyid } = data;
-      const param: QryAreaSumPLReq = {
-        querytype: 2,
-        cycletype,
-        cycletime,
-        currencyid,
-        userid: chaceSearchValue.value?.userid,
-      };
-      if (code === 'sum_pl_report_profit_and_loss_details') {
-        // 损益明细
-        // 注册表头
-        registerColumnDetail('table_pcweb_inventory_summary_profit_and_loss_details', []);
-      } else {
-        console.error(`${lable}没有配置对应的code: ${code},`);
-        return;
-      }
-      // 查询明细数据
-      queryResultLoadingAndInfo(qryAreaSumPL, loading, param).then((res) => {
-        detailTableList.value = res;
-      });
-    }
-    watchEffect(() => {
-      if (visible.value) {
-        if (tabList.length) {
-          changeTab(0, tabList[0]);
+        // 切换明细
+        function changeTab(index: number, current: TabList) {
+            const { code, lable } = current;
+            const data = selectedRow.value as Ermcp3ArealSumPL;
+            const { cycletype, currencyid } = data;
+            const param: QryAreaSumPLReq = {
+                querytype: 2,
+                cycletype,
+                cycletime,
+                currencyid,
+                userid: chaceSearchValue.value?.userid,
+            };
+            if (code === 'sum_pl_report_profit_and_loss_details') {
+                // 损益明细
+                // 注册表头
+                registerColumnDetail('table_pcweb_inventory_summary_profit_and_loss_details', []);
+            } else {
+                console.error(`${lable}没有配置对应的code: ${code},`);
+                return;
+            }
+            // 查询明细数据
+            queryResultLoadingAndInfo(qryAreaSumPL, loading, param).then((res) => {
+                detailTableList.value = res;
+            });
         }
-      }
-    });
+        watchEffect(() => {
+            if (visible.value) {
+                if (tabList.length) {
+                    changeTab(0, tabList[0]);
+                }
+            }
+        });
 
-    function search(value: TypeAndTime) {
-      cycletype.value = value.cycletype;
-      chaceSearchValue.value = value;
-      cycletime = value.cycletime;
-      const obj = Object.assign(value, { querytype: 1 });
-      queryTable(qryAreaSumPL, obj);
-    }
+        function search(value: TypeAndTime) {
+            cycletype.value = value.cycletype;
+            chaceSearchValue.value = value;
+            cycletime = value.cycletime;
+            const obj = Object.assign(value, { querytype: 1 });
+            queryTable(qryAreaSumPL, obj);
+        }
 
-    return {
-      loading,
-      tableList,
-      visible,
-      closeDrawer,
-      columns,
-      updateColumn,
-      search,
-      columnsDetail,
-      detailTableList,
-      expandedRowKeys,
-      selectedRow,
-      customRow,
-      tabList,
-      changeTab,
-    };
-  },
+        return {
+            loading,
+            tableList,
+            visible,
+            closeDrawer,
+            getColumns,
+            updateColumn,
+            search,
+            columnsDetail,
+            detailTableList,
+            expandedRowKeys,
+            selectedRow,
+            customRow,
+            tabList,
+            changeTab,
+        };
+    },
 });
 </script>

+ 67 - 128
src/views/report/sum_pl_report/list/sum_pl_report/setup.ts

@@ -1,141 +1,80 @@
-import { ColumnType } from '@/common/methods/table';
+import { Ermcp3ArealSumPL } from '@/services/go/ermcp/report/interface';
 
-/**
- * 表头对应字段
- */
-export const columns: ColumnType[] = [
-    {
-        "key": "0th",
-        "dataIndex": "currencyname",
-        "title": "结算币种",
-        "align": "center",
-        "slots": {
-            "customRender": "currencyname"
+export function getColumns() {
+    const columns = [
+        {
+            title: '结算币种',
+            key: 'currencyname',
         },
-        "width": 120
-    },
-    {
-        "key": "1th",
-        "dataIndex": "accountname",
-        "title": "交易用户",
-        "align": "center",
-        "slots": {
-            "customRender": "accountname"
+        {
+            title: '交易用户',
+            key: 'accountname',
         },
-        "width": 120
-    },
-    {
-        "key": "2th",
-        "dataIndex": "middlegoodsname",
-        "title": "套保品种",
-        "align": "center",
-        "slots": {
-            "customRender": "middlegoodsname"
+        {
+            title: '套保品种',
+            key: 'middlegoodsname',
         },
-        "width": 120
-    },
-    {
-        "key": "3th",
-        "dataIndex": "enumdicname",
-        "title": "单位",
-        "align": "center",
-        "slots": {
-            "customRender": "enumdicname"
+        {
+            title: '单位',
+            key: 'enumdicname',
         },
-        "width": 140
-    },
-    {
-        "key": "4th",
-        "dataIndex": "totalspotqty",
-        "title": "现货总量",
-        "align": "center",
-        "width": 120,
-    },
-    {
-        "key": "5th",
-        "dataIndex": "totalneedhedgeqty",
-        "title": "计划套保量",
-        "align": "center",
-        "width": 120,
-    },
-    {
-        "key": "6th",
-        "dataIndex": "totalfutureqty",
-        "title": "期货持仓量",
-        "align": "center",
-        "slots": {
-            "customRender": "totalfutureqty"
+        {
+            title: '现货总量',
+            key: 'totalspotqty',
         },
-        "width": 120
-    },
-    {
-        "key": "7th",
-        "dataIndex": "futurespotratio",
-        "title": "期现比例",
-        "align": "center",
-        "slots": {
-            "customRender": "futurespotratio"
+        {
+            title: '计划套保量',
+            key: 'totalneedhedgeqty',
+            width: 130,
         },
-        "width": 120
-    },
-    {
-        "key": "8th",
-        "dataIndex": "spotactualpl",
-        "title": "现货损益",
-        "align": "center",
-        "slots": {
-            "customRender": "spotactualpl"
+        {
+            title: '期货持仓量',
+            key: 'totalfutureqty',
+            width: 130,
         },
-        "width": 120
-    },
-    {
-        "key": "9th",
-        "dataIndex": "spotfloatpl",
-        "title": "现货浮动损益",
-        "align": "center",
-        "slots": {
-            "customRender": "spotfloatpl"
+        {
+            title: '期现比例',
+            key: 'futurespotratio',
+            customRender: ({ record }: { record: Ermcp3ArealSumPL }) => {
+                return (record.futurespotratio * 100) + '%';
+            }
         },
-        "width": 120
-    },
-    {
-        "key": "10th",
-        "dataIndex": "futureactualpl",
-        "title": "期货损益",
-        "align": "center",
-        "slots": {
-            "customRender": "futureactualpl"
+        {
+            title: '现货损益',
+            key: 'spotactualpl',
         },
-        "width": 120
-    },
-    {
-        "key": "11th",
-        "dataIndex": "futurefloatpl",
-        "title": "期货浮动损益",
-        "align": "center",
-        "slots": {
-            "customRender": "futurefloatpl"
+        {
+            title: '现货浮动损益',
+            key: 'spotfloatpl',
+            width: 130,
         },
-        "width": 120
-    },
-    {
-        "key": "12th",
-        "dataIndex": "sumpl",
-        "title": "总敞口损益",
-        "align": "center",
-        "slots": {
-            "customRender": "sumpl"
+        {
+            title: '期货损益',
+            key: 'futureactualpl',
         },
-        "width": 120
-    },
-    {
-        "key": "13th",
-        "dataIndex": "hedgeexposurepl",
-        "title": "套保敞口损益",
-        "align": "center",
-        "slots": {
-            "customRender": "hedgeexposurepl"
+        {
+            title: '期货浮动损益',
+            key: 'futurefloatpl',
+            width: 130,
         },
-        "width": 120
-    }
-];
+        {
+            title: '总敞口损益',
+            key: 'sumpl',
+            width: 130,
+        },
+        {
+            title: '套保敞口损益',
+            key: 'hedgeexposurepl',
+            width: 130,
+        },
+    ];
+
+    return columns.map(el => {
+        return {
+            dataIndex: el.key,
+            width: 100,
+            align: 'center',
+            ...el
+        }
+    })
+}