Selaa lähdekoodia

修改 履约模板

huangbin 4 vuotta sitten
vanhempi
commit
6136b91f37

+ 1 - 0
src/common/constants/enumRouterName.ts

@@ -325,4 +325,5 @@ export enum EnumRouterName {
 	spot_trade_warehouse_sell_hall = 'spot_trade_warehouse_sell_hall', // 卖大厅
 	warehouse_receipt_trade_blocs = 'warehouse_receipt_trade_blocs', //  仓单贸易 贸易圈挂牌
 	warehouse_pre_sale_blocs = 'warehouse_pre_sale_blocs', //  仓单预售 贸易圈挂牌
+	search_performance_template_sub = 'search_performance_template_sub', //  履约模板
 }

+ 28 - 0
src/common/setup/table/button.ts

@@ -200,6 +200,7 @@ export function _getBtnList(menuType: keyof ButtonListKey, hasDetail: boolean):
  */
 export function findChildList(menuType: EnumRouterName): OperationTabMenu | undefined {
     const data = getThirdMenuData()
+    console.log('data', data)
     let list: OperationTabMenu | undefined = undefined
     // 这里处理有两层路由菜单
     function findFn(arr: OperationTabMenu[]) {
@@ -221,3 +222,30 @@ export function getBtnList_(menuType: EnumRouterName, hasDetail: boolean) {
     const list = findChildList(menuType)
     return _handleBtnList_(list, hasDetail)
 }
+
+/****************************** ======================================= *************************/
+/**
+ * 往后统一 用此方法,注意,配置 菜单json数据的时候,按钮列表统一配置为一级列表,不再配置为树结果
+ */
+export function getButtonList(menuType: EnumRouterName, hasDetail: boolean) {
+    const list = findChildList(menuType)
+    debugger
+    const result = [] // 操作按钮列表
+    if (list && list.children) {
+        list.children.forEach(el => {
+            const { code, type, title, isshow } = el;
+            if (isshow) {
+                if (type === 2) {
+                    const item = { lable: title, className: getClassName(code), code: code }
+                    result.push(item)
+                }
+            }
+        })
+    }
+    // 详情
+    if (hasDetail) {
+        const item = { lable: '详情', code: 'detail', className: getClassName('') }
+        result.push(item)
+    }
+    return result
+}

+ 0 - 10
src/services/bus/login.ts

@@ -24,11 +24,8 @@ export const login = async (logidCode: string, password: string, byteArr: Uint8A
     try {
         /** 建立行情交易长链 */
         await APP.connectTrading();
-        debugger
         const account = await GetLoginID(logidCode);
-        debugger
         const loginData = await loginAction(account, password, byteArr, isEncryt);
-        debugger
         // localstorage 缓存登录信息,处理页面刷新
         setLoginData(loginData);
         await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount(), queryMarketRun()])
@@ -64,9 +61,7 @@ export const login = async (logidCode: string, password: string, byteArr: Uint8A
  * 缓存登录信息
  */
 export function setLoginData(loginData: LoginResponse) {
-    console.log('loginData', loginData);
     loginData.id = loginData.LoginID.toNumber()
-    debugger
     sessionStorageUtil.setItem('loginData', loginData);
 }
 
@@ -98,11 +93,6 @@ export const isLogin = (): boolean => {
  */
 export const geLoginID_number = (): number | null => {
     if (isLogin()) {
-        // const id = getLoginData().LoginID;
-        // debugger
-        // const loginData = getLoginData().LoginID;
-        // const { low, high, unsigned } = loginData;
-        // return new Long(low, high, unsigned);
         return getLoginData()!.id
     } else {
         return null;

+ 0 - 1
src/services/go/commonService/index.ts

@@ -98,7 +98,6 @@ export function GetPCMenus(): Promise<string> {
         loginID: geLoginID_number(),
         clientType: 0, // 终端类型,0:PC 1:Mobile
     };
-    debugger
     Object.assign(param, obj)
     return commonSearch_go('/Common/GetClientMenus', param)
         .then((res) => {

+ 0 - 1
src/views/account/login.vue

@@ -176,7 +176,6 @@ export default defineComponent({
         const { getQtInfo } = qtAction();
         function loginAction() {
             formDom.value.validate().then(() => {
-                debugger;
                 loading.value = true;
                 const { account, password } = toRaw(form);
                 setLoadComplete(false);

+ 24 - 24
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_price/index.vue

@@ -1,28 +1,28 @@
 <template>
-    <!-- 仓单贸易 一口价挂牌-->
-    <div class="topTableHeight">
-        <Filter :enumName="name" @search="search" @buy="buyOpen" />
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="firstBtn"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :enumName="name"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </div>
+  <!-- 仓单贸易 一口价挂牌-->
+  <div class="topTableHeight">
+    <Filter :enumName="name"
+            @search="search"
+            @buy="buyOpen" />
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList"></a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="firstBtn"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">

+ 94 - 34
src/views/search/search_performance_template/search_performance_template_sub/index.vue

@@ -12,64 +12,124 @@
              :expandIconAsCell="false"
              rowKey="key"
              :data-source="tableList">
-      <!-- 类型 -->
-      <template #financetype="{ record }">
-        <a>{{ getFinanceTypeName(record.financetype) }}</a>
-      </template>
-
       <!-- 状态 -->
-      <template #applystatus="{ text }">
-        <a>{{ getApplyStatusFinanceName(text) }}</a>
+      <template #handle="{ record }">
+        <BtnList :btnList="btnList"
+                 :record="record"
+                 class="btn-list-sticky"
+                 @click="openComponent" />
       </template>
 
       <template #createtime="{ record }">
-        <a>{{ formatTime(record.createtime) }}</a>
-      </template>
-
-      <!-- 结算方式 1:按日结息 3:按月结息-->
-      <template #interestsettlemode="{ record }">
-        <a>{{ getInterestSettleModeName(record.interestsettlemode) }}</a>
+        <span>{{ formatTime(record.createtime) }}</span>
       </template>
-      <!-- 费用 -->
-      <template #interestsettlevalue="{ record }">
-        <a>{{ getInterestrateModeName(record.interestratemode, record.interestrate) }}</a>
-      </template>
-
     </a-table>
+    <!-- 明细 -->
+    <Description v-if="visible"
+                 @close="closeDrawer"
+                 :tabList="tabList">
+      <!-- <a-table :columns="columnsDetail"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="detailTableList"
+               :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
+      </a-table> -->
+    </Description>
   </section>
 </template>
 
 <script lang="ts">
-import { queryTableList, defineComponent } from '@/common/export/commonTable';
-import { queryWrFinanceBuyApply } from '@/services/go/wrtrade';
-import { WrFinanceBuyApply } from '@/services/go/wrtrade/interface';
+import { queryTableList, defineComponent, BtnList } from '@/common/export/commonTable';
+import { queryQueryPermancePlanTmp, queryWrFinanceBuyApply } from '@/services/go/wrtrade';
+import { QueryPermancePlanTmpReq, QueryPermancePlanTmpRsp, WrFinanceBuyApply } from '@/services/go/wrtrade/interface';
 import { getRecordItemTab } from '@/common/setup/order/orderData';
-import { handleComposeOrderTable } from '@/common/setup/table/compose';
-import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import { handleComposeOrderTable, handleComposeTable_detail } from '@/common/setup/table/compose';
+import { ComposeOrderTableParam, ComposeTableDetailParam } from '@/common/setup/table/interface';
 import { formatTime } from '@/common/methods';
 import { expandIcon } from '@/common/setup/table/clolumn';
 import { getApplyStatusFinanceName, getFinanceTypeName, getInterestrateModeName, getInterestSettleModeName } from '@/common/constants/enumsName';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { getColumns } from './setup';
+import { getUsrId } from '@/services/bus/user';
+import { getButtonList, getOrderBtnList } from '@/common/setup/table/button';
+import { handleModalComponent } from '@/common/setup/asyncComponent';
+import Description from '@/common/components/description/index.vue';
 
 export default defineComponent({
-    name: EnumRouterName.search_financing_inquiry_apply_order,
+    name: EnumRouterName.search_performance_template_sub,
+    components: {
+        BtnList,
+        Description,
+    },
     setup() {
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrFinanceBuyApply>();
-        // 获取列表数据
-        const queryTableAction = () => {
-            queryTable(queryWrFinanceBuyApply);
+        const { loading, tableList, queryTable } = queryTableList<QueryPermancePlanTmpRsp>();
+        const loadData = () => {
+            const param: QueryPermancePlanTmpReq = {
+                userid: getUsrId(),
+                tmptype: '2,3',
+            };
+            queryTable(queryQueryPermancePlanTmp, param);
         };
-        // 表格通用逻辑
-        const param: ComposeOrderTableParam = {
-            queryFn: queryTableAction,
-            tableName: 'table_pcweb_financing_manage_bottom_apply_order',
-            recordList: getRecordItemTab(),
+
+        loadData();
+        // 表头
+        const { columns } = getColumns();
+        const param: ComposeTableDetailParam = {
+            queryFn: loadData, // 查询表格数据
+            tableFilterKey: [], // 表格过滤字段
+            menuType: EnumRouterName.search_performance_template_sub, // 当前tab页对应的code
         };
+        const {
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            updateColumn, //  表头数据
+            columnsDetail,
+            registerColumnDetail,
+            detailTableList, // 明细表头数据
+            expandedRowKeys,
+            selectedRow,
+            Rowclick, // 表格事件
+            tabList,
+        } = handleComposeTable_detail<QueryPermancePlanTmpRsp>(param);
+
+        // 表格操作按钮列表
+        const btnList = getButtonList(EnumRouterName.search_performance_template_sub, false);
+        // 选中的数据
+        // 控制异步组件
+        const { componentId, closeComponent, openComponent } = handleModalComponent(loadData, selectedRow);
+        // 获取列表数据
+        // const queryTableAction = () => {
+        //     queryTable(queryWrFinanceBuyApply);
+        // };
+        // // 表格通用逻辑
+        // const param: ComposeOrderTableParam = {
+        //     queryFn: queryTableAction,
+        //     tableName: 'table_pcweb_financing_manage_bottom_apply_order',
+        //     recordList: getRecordItemTab(),
+        // };
         return {
-            ...handleComposeOrderTable<WrFinanceBuyApply>(param),
+            // ...handleComposeOrderTable<WrFinanceBuyApply>(param),
             loading,
             tableList,
+            columns,
+            btnList,
+            componentId,
+            closeComponent,
+            openComponent,
+
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            updateColumn, //  表头数据
+            columnsDetail,
+            registerColumnDetail,
+            detailTableList, // 明细表头数据
+            expandedRowKeys,
+            selectedRow,
+            Rowclick, // 表格事件
+            tabList,
+
             formatTime,
             expandIcon,
             getFinanceTypeName,

+ 8 - 0
src/views/search/search_performance_template/search_performance_template_sub/setup.ts

@@ -0,0 +1,8 @@
+export function getColumns() {
+    const columns = [
+        { title: '模板名称', key: 'templatename', dataIndex: 'templatename', align: 'center', width: 200 },
+        { title: '创建时间', key: 'createtime', dataIndex: 'createtime', align: 'center', width: 200, slots: { customRender: 'createtime' } },
+        { title: '操作', key: 'handle', dataIndex: 'handle', align: 'center', width: 200, slots: { customRender: 'handle' } },
+    ]
+    return { columns }
+}