|
|
@@ -0,0 +1,117 @@
|
|
|
+<template>
|
|
|
+ <div style="background: red; color: #fff; padding: 5px 0">待修改-表头</div>
|
|
|
+ <!-- 管理-业务审核-交收 -->
|
|
|
+ <div class="business-review-js" :loading="loading">
|
|
|
+ <Filter @search="updateColumn"></Filter>
|
|
|
+ <a-table :columns="columns" class="topTable" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :data-source="tableList">
|
|
|
+ <!-- 额外的展开行 -->
|
|
|
+ <template #expandedRowRender="{ record }">
|
|
|
+ <mtp-table-button class="btn-list-sticky" :buttons="handlePermissionBtn(buttons, record)" :record="record" @click="openComponent" />
|
|
|
+ </template>
|
|
|
+ <template #operateapplytype="{ text }">
|
|
|
+ <a>{{ getPriceTypeName(text) }}</a>
|
|
|
+ </template>
|
|
|
+ <template #contracttype="{ text }">
|
|
|
+ <a>{{ getContractTypeName(text) }}</a>
|
|
|
+ </template>
|
|
|
+ <template #applystatus="{ text }">
|
|
|
+ <a>{{ getApplyStatusName(text) }}</a>
|
|
|
+ </template>
|
|
|
+ <template #buyusernameOrsellusername="{ record }">
|
|
|
+ <a>{{ getAnalogueName(record.contracttype, record.buyusername, record.sellusername) }}</a>
|
|
|
+ </template>
|
|
|
+ <template #addmargin||decmargin="{ record }">
|
|
|
+ <a>{{ record.addmargin !== 0 && record.addmargin !== undefined ? '+' + record.addmargin : record.decmargin === 0 || record.decmargin === undefined ? '' : '-' + record.decmargin }} </a>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ <!-- 右键 -->
|
|
|
+ <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="handlePermissionBtn(buttons, selectedRow)"> </contextMenu>
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+import { MtpTableButton, contextMenu, defineAsyncComponent, defineComponent, handleComposeTable, ComposeTableParam } from '@/common/export/commonTable';
|
|
|
+import { initData, getTableColumns, getTableEvent, getBtnList } from '@/common/export/table';
|
|
|
+
|
|
|
+import { SettlementDetail, SettlementAudit, SettlementCancel, Filter } from '../../../components';
|
|
|
+
|
|
|
+import { queryTableList, QryBussinessJsRsp } from '../setup';
|
|
|
+import { invoiceStatusName } from '@/views/manage/finance-review/setup';
|
|
|
+import { Column, ColumnType } from '@/common/setup/table';
|
|
|
+import { getPriceTypeName, getContractTypeName, getApplyStatusName } from '@/common/constants/enumsName';
|
|
|
+import { getAnalogueName } from '@/views/information/spot-contract/setup';
|
|
|
+import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
+import { BtnListType } from '@/common/components/btnList/interface';
|
|
|
+import { getTableButton } from '@/common/setup/table/button';
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ name: 'business-review-js',
|
|
|
+ components: {
|
|
|
+ contextMenu,
|
|
|
+ Filter,
|
|
|
+ MtpTableButton,
|
|
|
+ detail: defineAsyncComponent(() => import('../../../components/settlementDetail/index.vue')),
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ // 表格列表数据
|
|
|
+ const { loading, tableList, queryTable } = queryTableList({ applystatus: '2' });
|
|
|
+
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => queryTable();
|
|
|
+ const filtrFn = (e: Column, item: ColumnType, filtered: any) => {
|
|
|
+ if (e.columnfield === 'buyusernameOrsellusername') {
|
|
|
+ item.onFilter = (value: string, record: QryBussinessJsRsp) => {
|
|
|
+ const { contracttype, buyusername, sellusername } = record;
|
|
|
+ if (contracttype === 1) {
|
|
|
+ // 采购
|
|
|
+ return sellusername.includes(value);
|
|
|
+ } else {
|
|
|
+ return buyusername.includes(value);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ item.filteredValue = filtered.buyusernameOrsellusername || null;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 表格通用逻辑
|
|
|
+ const param: ComposeTableParam = {
|
|
|
+ queryFn: queryTableAction,
|
|
|
+ menuType: EnumRouterName.business_review_settlement,
|
|
|
+ tableName: 'table_pcweb_business_aduit_js',
|
|
|
+ tableFilterKey: ['contracttype', 'contractno', 'deliverygoodsname'],
|
|
|
+ tableFilterCB: filtrFn,
|
|
|
+ isDetail: true,
|
|
|
+ };
|
|
|
+
|
|
|
+ function handlePermissionBtn(btnList: BtnListType[], item: QryBussinessJsRsp) {
|
|
|
+ if (item) {
|
|
|
+ const { applystatus } = item;
|
|
|
+ if (applystatus === 1) {
|
|
|
+ return btnList;
|
|
|
+ } else {
|
|
|
+ return btnList.filter((e) => e.code === 'detail');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 权限按钮
|
|
|
+ const buttons = getTableButton(['detail']);
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...handleComposeTable<QryBussinessJsRsp>(param),
|
|
|
+ handlePermissionBtn,
|
|
|
+ getAnalogueName,
|
|
|
+ loading,
|
|
|
+ tableList,
|
|
|
+ getPriceTypeName,
|
|
|
+ getContractTypeName,
|
|
|
+ getApplyStatusName,
|
|
|
+ invoiceStatusName,
|
|
|
+ buttons,
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+</script>
|