|
|
@@ -0,0 +1,76 @@
|
|
|
+<template>
|
|
|
+ <!-- 现货查询: 采购合同-销售合同-->
|
|
|
+ <div class="spot-contract-search" :loading="loading">
|
|
|
+ <filterCustomTable @search="updateColumn"></filterCustomTable>
|
|
|
+ <a-table :columns="columns" class="srcollYTable" :pagination="false" rowKey="key" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" :data-source="tableList" :scroll="{ x: 'calc(100% - 160px)', y: 'calc(100vh - 163px)' }">
|
|
|
+ <template #index="{ index }">
|
|
|
+ <span>{{ index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ <!-- 右键 -->
|
|
|
+ <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"> </contextMenu>
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import { queryTableList, MtpTableButton, contextMenu, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
|
|
|
+import filterCustomTable from '../../components/filter/index.vue';
|
|
|
+import { formatTime, formatValue } from '@/common/methods';
|
|
|
+import { columns } from './setup';
|
|
|
+import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
|
|
|
+import { QueryPurchase } from '@/services/go/ermcp/purchase';
|
|
|
+import { QueryWareHouse } from '@/services/go/ermcp/sell';
|
|
|
+import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
+import { getTableButton } from '@/common/setup/table/button';
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ name: 'spot-contract-search',
|
|
|
+ components: {
|
|
|
+ filterCustomTable,
|
|
|
+ contextMenu,
|
|
|
+ MtpTableButton,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ const { name: routeName } = useRoute();
|
|
|
+ // 权限按钮
|
|
|
+ const buttons = getTableButton();
|
|
|
+
|
|
|
+ // 表格列表数据
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Ermcp3SellBuyContract>();
|
|
|
+
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => {
|
|
|
+ switch (routeName) {
|
|
|
+ case 'search_purchase':
|
|
|
+ queryTable(QueryPurchase, { querytype: 1 });
|
|
|
+ break;
|
|
|
+ case 'search_sell':
|
|
|
+ queryTable(QueryWareHouse, { querytype: 1 });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 表格通用逻辑
|
|
|
+ const param: ComposeTableParam = {
|
|
|
+ queryFn: queryTableAction,
|
|
|
+ menuType: EnumRouterName.spot_contract_checkpending,
|
|
|
+ tableName: 'table_pcweb_delivery',
|
|
|
+ tableFilterKey: ['contracttype', 'pricetype', 'contractno'],
|
|
|
+ isDetail: true,
|
|
|
+ };
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...handleComposeTable<Ermcp3SellBuyContract>(param),
|
|
|
+ loading,
|
|
|
+ tableList,
|
|
|
+ queryTable,
|
|
|
+ formatTime,
|
|
|
+ formatValue,
|
|
|
+ columns,
|
|
|
+ buttons,
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+</script>
|