|
|
@@ -3,101 +3,97 @@
|
|
|
<div class="plan-uncommitted"
|
|
|
:loading="loading">
|
|
|
<Filter @search="updateColumn">
|
|
|
- <BtnList :btnList="commonBtn" />
|
|
|
+ <BtnList :btnList="firstBtn"
|
|
|
+ @click="openComponent" />
|
|
|
</Filter>
|
|
|
- <contextMenu :contextMenuList="forDataBtn">
|
|
|
- <a-table :columns="columns"
|
|
|
- class="topTable"
|
|
|
- :pagination="false"
|
|
|
- :expandedRowKeys="expandedRowKeys"
|
|
|
- :customRow="Rowclick"
|
|
|
- rowKey="key"
|
|
|
- :data-source="tableList">
|
|
|
- <!-- 额外的展开行 -->
|
|
|
- <template #expandedRowRender="{ record }">
|
|
|
- <BtnList :btnList="handleBtnList(record.hedgeplanstatus)" />
|
|
|
- </template>
|
|
|
- <template #contracttype="{ text }">
|
|
|
- <a>{{ getPlanContractType(text) }}</a>
|
|
|
- </template>
|
|
|
- <template #hedgeplanstatus="{ text }">
|
|
|
- <a>{{ getPlanStatusName(text) }}</a>
|
|
|
- </template>
|
|
|
- </a-table>
|
|
|
+ <a-table :columns="columns"
|
|
|
+ class="srcollYTable"
|
|
|
+ :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
|
|
|
+ :pagination="false"
|
|
|
+ :loading="loading"
|
|
|
+ :expandedRowKeys="expandedRowKeys"
|
|
|
+ :customRow="Rowclick"
|
|
|
+ rowKey="key"
|
|
|
+ :data-source="tableList">
|
|
|
+ <!-- 额外的展开行 -->
|
|
|
+ <template #expandedRowRender="{ record }">
|
|
|
+ <BtnList :btnList="handleBtnList(secondBtn, record)"
|
|
|
+ :record="record"
|
|
|
+ @click="openComponent" />
|
|
|
+ </template>
|
|
|
+ <template #contracttype="{ text }">
|
|
|
+ <a>{{ getPlanContractType(text) }}</a>
|
|
|
+ </template>
|
|
|
+ <template #hedgeplanstatus="{ text }">
|
|
|
+ <a>{{ getPlanStatusName(text) }}</a>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ <!-- 右键 -->
|
|
|
+ <contextMenu :contextMenu="contextMenu"
|
|
|
+ @cancel="closeContext"
|
|
|
+ :list="secondBtn">
|
|
|
</contextMenu>
|
|
|
- <!-- 详情 -->
|
|
|
- <Detail :selectedRow="selectedRow"
|
|
|
- @refresh="queryTable" />
|
|
|
- <!-- 新增 -->
|
|
|
- <Add :selectedRow="selectedRow"
|
|
|
- @refresh="queryTable" />
|
|
|
- <!-- 修改 -->
|
|
|
- <Modfiy :selectedRow="selectedRow"
|
|
|
- @refresh="queryTable" />
|
|
|
- <Recommit :selectedRow="selectedRow"
|
|
|
- @refresh="queryTable" />
|
|
|
- <!-- 删除-->
|
|
|
- <Delete :selectedRow="selectedRow"
|
|
|
- @refresh="queryTable" />
|
|
|
+ <component :is="componentId"
|
|
|
+ v-if="componentId"
|
|
|
+ :selectedRow="selectedRow"
|
|
|
+ @cancel="closeComponent"></component>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
|
|
|
-import { queryTableList, Ermcp3HedgePlan } from '../index';
|
|
|
-import { Add, Delete, Detail, Filter, Modfiy, Recommit } from '../../components';
|
|
|
+import { queryTableList, BtnList, contextMenu, defineAsyncComponent, defineComponent, ModalEnum, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
|
|
|
+
|
|
|
+import { Filter } from '../../components';
|
|
|
import { getPlanContractType, getPlanStatusName } from '@/views/business/plan/setup';
|
|
|
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
|
|
|
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
|
|
|
+import { QueryHedgePlan } from '@/services/go/ermcp/plan';
|
|
|
+
|
|
|
+const Detail = defineAsyncComponent(() => import('../../components/detail/index.vue'));
|
|
|
+const Add = defineAsyncComponent(() => import('../../components/add/index.vue'));
|
|
|
+const Delete = defineAsyncComponent(() => import('../../components/delete/index.vue'));
|
|
|
+const Modfiy = defineAsyncComponent(() => import('../../components/modify/index.vue'));
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'plan-uncommitted',
|
|
|
components: {
|
|
|
contextMenu,
|
|
|
BtnList,
|
|
|
- Add,
|
|
|
- Modfiy,
|
|
|
Filter,
|
|
|
- Detail,
|
|
|
- Delete,
|
|
|
- Recommit,
|
|
|
+ [ModalEnum.detail]: Detail,
|
|
|
+ [ModalEnum.plan_btn_add]: Add,
|
|
|
+ [ModalEnum.plan_uncommitted_delete]: Delete,
|
|
|
+ [ModalEnum.plan_uncommitted_modify]: Modfiy,
|
|
|
},
|
|
|
setup() {
|
|
|
- // 表头数据
|
|
|
- const { columns, registerColumn, updateColumn } = getTableColumns();
|
|
|
- // 表格事件
|
|
|
- const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
|
|
|
- // 表格操作按钮列表
|
|
|
- const { commonBtn, forDataBtn } = getBtnList('plan_uncommitted', true);
|
|
|
// 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList('0,4,6');
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Ermcp3HedgePlan>();
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => queryTable(QueryHedgePlan, '0,4,6');
|
|
|
+ // 表格通用逻辑
|
|
|
+ const param: ComposeTableParam = {
|
|
|
+ queryFn: queryTableAction,
|
|
|
+ menuType: 'plan_uncommitted',
|
|
|
+ tableName: 'table_pcweb_hedging_plan',
|
|
|
+ tableFilterKey: ['contracttype', 'hedgeplanno', 'deliverygoodsname'],
|
|
|
+ isDetail: true,
|
|
|
+ };
|
|
|
|
|
|
- function handleBtnList(type: number) {
|
|
|
- if (type === 4) {
|
|
|
+ function handleBtnList(btnList: BtnListType[], item: Ermcp3HedgePlan) {
|
|
|
+ if (item.hedgeplanstatus === 4) {
|
|
|
// 审核拒绝
|
|
|
- return forDataBtn.value.filter((e) => e.lable !== '修改');
|
|
|
+ return btnList.filter((e) => e.lable !== '修改');
|
|
|
} else {
|
|
|
- return forDataBtn.value.filter((e) => e.lable !== '重新提交');
|
|
|
+ return btnList.filter((e) => e.lable !== '重新提交');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- initData(() => {
|
|
|
- // 获取列表数据
|
|
|
- queryTable();
|
|
|
- // 注册表头信息 过滤
|
|
|
- registerColumn('table_pcweb_hedging_plan', ['contracttype', 'hedgeplanno', 'deliverygoodsname']);
|
|
|
- });
|
|
|
return {
|
|
|
- columns,
|
|
|
- expandedRowKeys,
|
|
|
- selectedRow,
|
|
|
- Rowclick,
|
|
|
- commonBtn,
|
|
|
- forDataBtn,
|
|
|
+ ...handleComposeTable<Ermcp3HedgePlan>(param),
|
|
|
loading,
|
|
|
tableList,
|
|
|
- updateColumn,
|
|
|
getPlanStatusName,
|
|
|
getPlanContractType,
|
|
|
- queryTable,
|
|
|
handleBtnList,
|
|
|
};
|
|
|
},
|