|
|
@@ -3,149 +3,143 @@
|
|
|
<div class="spot-contract-not-commit"
|
|
|
:loading="loading">
|
|
|
<filterCustomTable @search="updateColumn">
|
|
|
- <BtnList :btnList="commonBtn" />
|
|
|
+ <BtnList :btnList="firstBtn"
|
|
|
+ @click="openComponent" />
|
|
|
</filterCustomTable>
|
|
|
- <contextMenu :contextMenuList="forDataBtn">
|
|
|
- <a-table :columns="columns"
|
|
|
- class="topOrderTable"
|
|
|
- :pagination="false"
|
|
|
- :expandedRowKeys="expandedRowKeys"
|
|
|
- :customRow="Rowclick"
|
|
|
- rowKey="key"
|
|
|
- :data-source="tableList"
|
|
|
- :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
|
|
|
- <!-- 额外的展开行 -->
|
|
|
- <template #expandedRowRender="{ }">
|
|
|
- <BtnList :btnList="forDataBtn" />
|
|
|
- </template>
|
|
|
- <!-- <template #userinfotype="{ text }">
|
|
|
- <a>{{ text === '2' ? '企业' : '个人'}}</a>
|
|
|
- </template> -->
|
|
|
- <template #biztype="{ text }">
|
|
|
- <a>{{ getBizTypeName(text) }}</a>
|
|
|
- </template>
|
|
|
+ <a-table :columns="columns"
|
|
|
+ class="topOrderTable"
|
|
|
+ :pagination="false"
|
|
|
+ :expandedRowKeys="expandedRowKeys"
|
|
|
+ :customRow="Rowclick"
|
|
|
+ rowKey="key"
|
|
|
+ :data-source="tableList"
|
|
|
+ :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
|
|
|
+ <!-- 额外的展开行 -->
|
|
|
+ <template #expandedRowRender="{ record }">
|
|
|
+ <BtnList :btnList="secondBtn"
|
|
|
+ :record="record"
|
|
|
+ @click="openComponent" />
|
|
|
+ </template>
|
|
|
+ <template #biztype="{ text }">
|
|
|
+ <a>{{ getBizTypeName(text) }}</a>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #pricetype="{ text }">
|
|
|
- <a>{{ getPriceTypeName(text) }}</a>
|
|
|
- </template>
|
|
|
+ <template #pricetype="{ text }">
|
|
|
+ <a>{{ getPriceTypeName(text) }}</a>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #contracctstatus="{ text }">
|
|
|
- <a>{{ getContractStatusName(text) }}</a>
|
|
|
- </template>
|
|
|
+ <template #contracctstatus="{ text }">
|
|
|
+ <a>{{ getContractStatusName(text) }}</a>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #contracttype="{ text }">
|
|
|
- <a>{{ getContractTypeName(text) }}</a>
|
|
|
- </template>
|
|
|
- <!-- 对手方 -->
|
|
|
- <template #negative="{ record }">
|
|
|
- <a>{{ record.contracttype === 1 ? record.sellusername : record.buyusername }}</a>
|
|
|
- </template>
|
|
|
- <!-- 点假期 -->
|
|
|
- <template #startdate="{ record }">
|
|
|
- <a>{{ formatValue(formatTime(record.startdate, "d") + '--' + formatTime(record.enddate, "d")) }}</a>
|
|
|
- </template>
|
|
|
- <!-- 交收期 -->
|
|
|
- <template #deliverystartdate="{ record }">
|
|
|
- <a>{{ formatValue(formatTime(record.deliverystartdate, "d") + '--' +
|
|
|
+ <template #contracttype="{ text }">
|
|
|
+ <a>{{ getContractTypeName(text) }}</a>
|
|
|
+ </template>
|
|
|
+ <!-- 对手方 -->
|
|
|
+ <template #negative="{ record }">
|
|
|
+ <a>{{ record.contracttype === 1 ? record.sellusername : record.buyusername }}</a>
|
|
|
+ </template>
|
|
|
+ <!-- 点假期 -->
|
|
|
+ <template #startdate="{ record }">
|
|
|
+ <a>{{ formatValue(formatTime(record.startdate, "d") + '--' + formatTime(record.enddate, "d")) }}</a>
|
|
|
+ </template>
|
|
|
+ <!-- 交收期 -->
|
|
|
+ <template #deliverystartdate="{ record }">
|
|
|
+ <a>{{ formatValue(formatTime(record.deliverystartdate, "d") + '--' +
|
|
|
formatTime(record.deliveryenddate, "d")) }}</a>
|
|
|
- </template>
|
|
|
- <!-- 业务员 -->
|
|
|
- <template #saleuserid="{ record }">
|
|
|
- <a>{{ findManagerName(record.saleuserid) }}</a>
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
+ <!-- 业务员 -->
|
|
|
+ <template #saleuserid="{ record }">
|
|
|
+ <a>{{ findManagerName(record.saleuserid) }}</a>
|
|
|
+ </template>
|
|
|
|
|
|
- <!-- 跟单员 -->
|
|
|
- <template #meruserid="{ record }">
|
|
|
- <a>{{ findManagerName(record.meruserid) }}</a>
|
|
|
- </template>
|
|
|
- </a-table>
|
|
|
+ <!-- 跟单员 -->
|
|
|
+ <template #meruserid="{ record }">
|
|
|
+ <a>{{ findManagerName(record.meruserid) }}</a>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ <!-- 右键 -->
|
|
|
+ <contextMenu :contextMenu="contextMenu"
|
|
|
+ @cancel="closeContext"
|
|
|
+ :list="secondBtn">
|
|
|
</contextMenu>
|
|
|
- <!-- 新增现货合同 -->
|
|
|
- <AddSpotContract @refresh="queryTable" />
|
|
|
- <!-- 现货合同: 详情 -->
|
|
|
- <SpotContractDeatil :selectedRow="selectedRow"
|
|
|
- :businessManager="businessManager"
|
|
|
- @refresh="queryTable" />
|
|
|
- <!-- 现货合同: 修改 -->
|
|
|
- <ModifySpotContract :selectedRow="selectedRow"
|
|
|
- @refresh="queryTable" />
|
|
|
- <!-- 现货合同: 删除 -->
|
|
|
- <DeleteSpotContract :selectedRow="selectedRow"
|
|
|
- :businessManager="businessManager"
|
|
|
- @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 { AddSpotContract, SpotContractDeatil, filterCustomTable, ModifySpotContract, DeleteSpotContract } from '../../components';
|
|
|
+import { defineComponent, _getBtnList } from '@/common/export/table';
|
|
|
+import { filterCustomTable } from '../../components';
|
|
|
|
|
|
-import { queryTableList, Ermcp3ContractRsp } from '../index';
|
|
|
-import { Column, ColumnType } from '@/common/setup/table';
|
|
|
+import { Column, ColumnType, queryTableList } from '@/common/setup/table';
|
|
|
import { formatTime, formatValue } from '@/common/methods';
|
|
|
-import { handlerManagerList } from '@/common/setup/user';
|
|
|
-import { reactive } from '@vue/reactivity';
|
|
|
+import { queryBusinessManager, findManagerName } from '../setup';
|
|
|
import { getPriceTypeName, getBizTypeName, getContractStatusName, getContractTypeName } from '@/common/constants/enumsName';
|
|
|
+import BtnList from '@/common/components/btnList/index.vue';
|
|
|
+import contextMenu from '@/common/components/contextMenu/temp.vue';
|
|
|
+import { defineAsyncComponent } from 'vue';
|
|
|
+import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
+import { ComposeTableParam, handleComposeTable } from '@/common/setup/table/compose';
|
|
|
+import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
|
|
|
+import { QuerySpotContract } from '@/services/go/ermcp/spot-contract';
|
|
|
+
|
|
|
+const Add = defineAsyncComponent(() => import('../../components/add/index.vue'));
|
|
|
+const Detail = defineAsyncComponent(() => import('../../components/detail/index.vue'));
|
|
|
+const Modify = defineAsyncComponent(() => import('../../components/modify/index.vue'));
|
|
|
+const Delete = defineAsyncComponent(() => import('../../components/delete/index.vue'));
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'spot-contract-not-commit',
|
|
|
components: {
|
|
|
filterCustomTable,
|
|
|
contextMenu,
|
|
|
- AddSpotContract,
|
|
|
- SpotContractDeatil,
|
|
|
- ModifySpotContract,
|
|
|
- DeleteSpotContract,
|
|
|
+ [ModalEnum.detail]: Detail,
|
|
|
+ [ModalEnum.spot_contract_btn_add]: Add,
|
|
|
+ [ModalEnum.spot_contract_btn_modify]: Modify,
|
|
|
+ [ModalEnum.spot_contract_btn_delete]: Delete,
|
|
|
BtnList,
|
|
|
},
|
|
|
setup() {
|
|
|
- // 表头数据
|
|
|
- const { columns, registerColumn, updateColumn } = getTableColumns();
|
|
|
- // 表格事件
|
|
|
- const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3ContractRsp>({});
|
|
|
- // 表格操作按钮列表
|
|
|
- const { commonBtn, forDataBtn } = getBtnList('spot_contract_unsubmitted', true);
|
|
|
// 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList(1);
|
|
|
- console.log(loading);
|
|
|
- const a = reactive({ name: 'hello' });
|
|
|
- console.log(a);
|
|
|
-
|
|
|
- // 获取 业务账户
|
|
|
- const { tableList: businessManager, queryTable: queryBusinessManager, findManagerName } = handlerManagerList(loading, 1);
|
|
|
-
|
|
|
- initData(() => {
|
|
|
- // 获取列表数据
|
|
|
- queryTable();
|
|
|
- // 注册表头信息 过滤
|
|
|
- registerColumn('table_pcweb_delivery', ['contracttype', 'pricetype', 'contractno'], (e: Column, item: ColumnType, filtered: any) => {
|
|
|
- if (e.columntitle === '对手方') {
|
|
|
- item.onFilter = (value: string, record: Ermcp3ContractRsp) => {
|
|
|
- if (record.contracttype === 1) {
|
|
|
- //采购方
|
|
|
- return record.sellusername.includes(value);
|
|
|
- } else {
|
|
|
- // 销售
|
|
|
- return record.buyusername.includes(value);
|
|
|
- }
|
|
|
- };
|
|
|
- item.filteredValue = filtered.negative || null;
|
|
|
- }
|
|
|
- });
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Ermcp3ContractRsp>();
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => {
|
|
|
+ queryTable(QuerySpotContract, { querytype: 1 });
|
|
|
+ // 获取 业务账户
|
|
|
queryBusinessManager();
|
|
|
- });
|
|
|
- return {
|
|
|
- columns,
|
|
|
+ };
|
|
|
+ // 表格过滤回调函数,处理特殊字段
|
|
|
+ const tableFilterCB = (e: Column, item: ColumnType, filtered: any) => {
|
|
|
+ if (e.columntitle === '对手方') {
|
|
|
+ item.onFilter = (value: string, record: Ermcp3ContractRsp) => {
|
|
|
+ if (record.contracttype === 1) {
|
|
|
+ //采购方
|
|
|
+ return record.sellusername.includes(value);
|
|
|
+ } else {
|
|
|
+ // 销售
|
|
|
+ return record.buyusername.includes(value);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ item.filteredValue = filtered.negative || null;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // 表格通用逻辑
|
|
|
+ const param: ComposeTableParam = {
|
|
|
+ queryFn: queryTableAction,
|
|
|
+ menuType: 'spot_contract_unsubmitted',
|
|
|
+ tableName: 'table_pcweb_delivery',
|
|
|
+ tableFilterKey: ['contracttype', 'pricetype', 'contractno'],
|
|
|
+ tableFilterCB,
|
|
|
+ isDetail: true,
|
|
|
+ };
|
|
|
|
|
|
- expandedRowKeys,
|
|
|
- selectedRow,
|
|
|
- Rowclick,
|
|
|
- commonBtn,
|
|
|
- forDataBtn,
|
|
|
+ return {
|
|
|
+ ...handleComposeTable<Ermcp3ContractRsp>(param),
|
|
|
loading,
|
|
|
tableList,
|
|
|
- updateColumn,
|
|
|
- queryTable,
|
|
|
getBizTypeName,
|
|
|
getPriceTypeName,
|
|
|
getContractStatusName,
|
|
|
@@ -153,7 +147,6 @@ export default defineComponent({
|
|
|
formatTime,
|
|
|
formatValue,
|
|
|
findManagerName,
|
|
|
- businessManager,
|
|
|
};
|
|
|
},
|
|
|
});
|