|
|
@@ -1,27 +1,26 @@
|
|
|
<template>
|
|
|
<!-- 库存查询: 当前库存-->
|
|
|
<div class="inventory_current" :loading="loading">
|
|
|
- <Filter @search="updateColumn"> </Filter>
|
|
|
- <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList"> </a-table>
|
|
|
+ <Filter @search="updateColumn">
|
|
|
+ <mtp-table-button class="btn-list-sticky" :buttons="buttons" @click="openComponent" />
|
|
|
+ </Filter>
|
|
|
+ <a-table :columns="columns" class="topTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :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)' }">
|
|
|
- <!-- 类型 -->
|
|
|
- <!-- <template #logtype="{ record }">
|
|
|
- <span>{{ getLogType(record.logtype) }}</span>
|
|
|
- </template> -->
|
|
|
- </a-table>
|
|
|
+ <a-table :columns="columnsDetail" class="topTable" :pagination="false" rowKey="key" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"></a-table>
|
|
|
</Description>
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList, _getBtnList } from '@/common/export/table';
|
|
|
+import { ref } from 'vue';
|
|
|
+import { queryTableList, MtpTableButton, contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
|
|
|
import Filter from '../../components/filterTable/index.vue';
|
|
|
-import Add from '../../components/add/index.vue';
|
|
|
-
|
|
|
-import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/common/constants/enumsName';
|
|
|
-import { Ermcp3AreaStock, queryTableList } from './setup';
|
|
|
+import { QueryAreaStockApply } from '@/services/go/ermcp/search-inventory/index';
|
|
|
+import { Ermcp3AreaStock } from '@/services/go/ermcp/search-inventory/interface';
|
|
|
+import { QueryAreaStock } from '@/services/go/ermcp/search-inventory';
|
|
|
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
import Description from '@/common/components/description/index.vue';
|
|
|
import { ComposeTableDetailParam } from '@/common/setup/table/interface';
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
@@ -29,27 +28,33 @@ import { handleComposeTable_detail } from '@/common/setup/table/compose';
|
|
|
import { TabList } from '@/common/components/description/interface';
|
|
|
import { watchEffect } from 'vue';
|
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
|
+import { getDetailColumns } from './setup';
|
|
|
+import { ColumnType } from '@/common/methods/table';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'inventory_current',
|
|
|
components: {
|
|
|
Filter,
|
|
|
contextMenu,
|
|
|
- Add,
|
|
|
- BtnList,
|
|
|
+ add: defineAsyncComponent(() => import('../../components/add/index.vue')),
|
|
|
+ MtpTableButton,
|
|
|
+ Description,
|
|
|
},
|
|
|
setup() {
|
|
|
- // // 表头数据
|
|
|
- // const { columns, registerColumn, updateColumn } = getTableColumns();
|
|
|
- // // 表格事件
|
|
|
- // const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3AreaStock>({});
|
|
|
- // // 表格操作按钮列表
|
|
|
- // const [firstBtn, secondBtn] = _getBtnList('inventory_current', false).value;
|
|
|
+ // 按钮权限
|
|
|
+ const buttons = getTableButton(['add']);
|
|
|
+ // 底部明细标签
|
|
|
+ const tabList = getTableButton(['add'], true);
|
|
|
+ const columnsDetail = ref<ColumnType[]>([]);
|
|
|
|
|
|
// 表格列表数据
|
|
|
const { loading, tableList, queryTable } = queryTableList();
|
|
|
+
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => queryTable(QueryAreaStock);
|
|
|
+
|
|
|
const param: ComposeTableDetailParam = {
|
|
|
- queryFn: queryTable, // 查询表格数据
|
|
|
+ queryFn: queryTableAction, // 查询表格数据
|
|
|
tableName: 'table_pcweb_current_inventory', // 表头key
|
|
|
tableFilterKey: ['deliverygoodsid', 'wrstandardid', 'spotgoodsbrandid', 'warehouseinfoid'], // 表格过滤字段
|
|
|
menuType: EnumRouterName.exposure_realtime, // 当前tab页对应的code
|
|
|
@@ -60,43 +65,37 @@ export default defineComponent({
|
|
|
closeDrawer, // 控制 drawer 组件是否显示
|
|
|
columns,
|
|
|
updateColumn, // 表头数据
|
|
|
- columnsDetail,
|
|
|
- registerColumnDetail,
|
|
|
detailTableList, // 明细表头数据
|
|
|
expandedRowKeys,
|
|
|
selectedRow,
|
|
|
Rowclick, // 表格事件
|
|
|
+ componentId,
|
|
|
+ closeComponent,
|
|
|
+ openComponent,
|
|
|
} = handleComposeTable_detail<Ermcp3AreaStock>(param);
|
|
|
|
|
|
- // 底部明细标签
|
|
|
- const tabList = getTableButton();
|
|
|
-
|
|
|
// 切换明细
|
|
|
function changeTab(index: number, current: TabList) {
|
|
|
const { code, lable } = current;
|
|
|
- let fn = null;
|
|
|
- // if (code === 'exposure_realtime_spot_details') {
|
|
|
- // // 现货明细信息
|
|
|
- // // 注册表头
|
|
|
- // registerColumnDetail('table_pcweb_exposure_detail', []);
|
|
|
- // fn = QueryActualExposureDetail;
|
|
|
-
|
|
|
- // queryResultLoadingAndInfo(fn, loading, { middlegoodsid: selectedRow.value?.MiddleGoodsID }).then((res) => {
|
|
|
- // detailTableList.value = res;
|
|
|
- // });
|
|
|
- // } else if (code === 'exposure_realtime_futures_details') {
|
|
|
- // // 期货明细
|
|
|
- // // 注册表头
|
|
|
- // registerColumnDetail('table_pcweb_exposure_futures_detail', []);
|
|
|
- // fn = QueryAutualExposurePosition;
|
|
|
- // queryResultLoadingAndInfo(fn, loading, { middleGoodsId: selectedRow.value?.MiddleGoodsID }).then((res) => {
|
|
|
- // detailTableList.value = res;
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
- // return;
|
|
|
- // }
|
|
|
+ columnsDetail.value = getDetailColumns(code);
|
|
|
+ switch (code) {
|
|
|
+ case 'inventory_manager_inbound_details':
|
|
|
+ // 入库明细
|
|
|
+ queryResultLoadingAndInfo(QueryAreaStockApply, loading, { applystatus: '2', inouttype: '5,7' }).then((res) => {
|
|
|
+ detailTableList.value = res;
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 'inventory_manager_outbound_details':
|
|
|
+ // 出库明细
|
|
|
+ queryResultLoadingAndInfo(QueryAreaStockApply, loading, { applystatus: '2', inouttype: '6,8' }).then((res) => {
|
|
|
+ detailTableList.value = res;
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
watchEffect(() => {
|
|
|
if (visible.value) {
|
|
|
if (tabList.length) {
|
|
|
@@ -104,12 +103,7 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- // initData(() => {
|
|
|
- // // 获取列表数据
|
|
|
- // queryTable();
|
|
|
- // // 注册表头信息 过滤
|
|
|
- // registerColumn('table_pcweb_current_inventory', ['deliverygoodsid', 'wrstandardid', 'spotgoodsbrandid', 'warehouseinfoid']);
|
|
|
- // });
|
|
|
+
|
|
|
return {
|
|
|
loading,
|
|
|
tableList,
|
|
|
@@ -125,10 +119,10 @@ export default defineComponent({
|
|
|
tabList,
|
|
|
changeTab,
|
|
|
queryTable,
|
|
|
- getBizTypeName,
|
|
|
- getPriceTypeName,
|
|
|
- getContractStatusName,
|
|
|
- getContractTypeName,
|
|
|
+ buttons,
|
|
|
+ componentId,
|
|
|
+ closeComponent,
|
|
|
+ openComponent,
|
|
|
};
|
|
|
},
|
|
|
});
|