|
|
@@ -1,78 +1,72 @@
|
|
|
<template>
|
|
|
<!-- 现货合同: 履约中-->
|
|
|
<div class="spot-contract-performance">
|
|
|
- 客户信息: 履约中
|
|
|
+ <filterCustomTable @search="search">
|
|
|
+ <a-button class="operBtn"
|
|
|
+ v-if="hasPermission('spot_contract_btn_add')"
|
|
|
+ @click="addAction">新增</a-button>
|
|
|
+ </filterCustomTable>
|
|
|
+ <contextMenu :contextMenuList="contextMenuList"
|
|
|
+ :tableList="spotContractList">
|
|
|
+ <a-table :columns="columns"
|
|
|
+ class="topTable"
|
|
|
+ :pagination="false"
|
|
|
+ rowKey="key"
|
|
|
+ :data-source="spotContractList">
|
|
|
+ <!-- <template #userinfotype="{ text }">
|
|
|
+ <a>{{ text === '2' ? '企业' : '个人'}}</a>
|
|
|
+ </template> -->
|
|
|
+ </a-table>
|
|
|
+ </contextMenu>
|
|
|
+ <!-- 现货合同: 详情 -->
|
|
|
+ <SpotContractDeatil />
|
|
|
+ <!-- 现货合同: 正常完结 -->
|
|
|
+ <Finish />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref } from 'vue';
|
|
|
-import { QueryCustomInfo } from '@/services/go/ermcp/customInfo/index';
|
|
|
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
+import { defineComponent, onUnmounted, ref, watchEffect } from 'vue';
|
|
|
import { initData } from '@/common/methods';
|
|
|
-
|
|
|
-// 查询客户资料列表
|
|
|
-function getCustomList() {
|
|
|
- // const filteredInfo = ref();
|
|
|
- // const sortedInfo = ref();
|
|
|
- // const columns = computed(() => {
|
|
|
- // const filtered = filteredInfo.value || {};
|
|
|
- // const sorted = sortedInfo.value || {};
|
|
|
- // return [
|
|
|
- // {
|
|
|
- // title: '序号',
|
|
|
- // dataIndex: 'index',
|
|
|
- // key: 'index',
|
|
|
- // align: 'center',
|
|
|
- // width: 50,
|
|
|
- // customRender: (param: any) => `${param.index + 1}`,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title: 'Age',
|
|
|
- // dataIndex: 'age',
|
|
|
- // key: 'age',
|
|
|
- // sorter: (a: DataItem, b: DataItem) => a.age - b.age,
|
|
|
- // sortOrder: sorted.columnKey === 'age' && sorted.order,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // title: 'Address',
|
|
|
- // dataIndex: 'address',
|
|
|
- // key: 'address',
|
|
|
- // filters: [
|
|
|
- // { text: 'London', value: 'London' },
|
|
|
- // { text: 'New York', value: 'New York' },
|
|
|
- // ],
|
|
|
- // filteredValue: filtered.address || null,
|
|
|
- // onFilter: (value: string, record: DataItem) => record.address.includes(value),
|
|
|
- // sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
|
|
|
- // sortOrder: sorted.columnKey === 'address' && sorted.order,
|
|
|
- // ellipsis: true,
|
|
|
- // },
|
|
|
- // ];
|
|
|
- // });
|
|
|
- const customList = ref<QueryCustomInfoType[]>([]);
|
|
|
- function actionQuery() {
|
|
|
- QueryCustomInfo(4)
|
|
|
- .then((res) => {
|
|
|
- console.log('L', res);
|
|
|
- })
|
|
|
- .catch((err) => message.error(err));
|
|
|
- }
|
|
|
-
|
|
|
- return { customList, actionQuery };
|
|
|
-}
|
|
|
+import filterCustomTable from '@/views/information/spot-contract/components/filterTable/index.vue';
|
|
|
+import { getCustomList } from '../setup';
|
|
|
+import { openModal } from '@/common/setup/modal/index';
|
|
|
+import contextMenu from '@/common/components/contextMenu/index.vue';
|
|
|
+import { MenuItem } from '@/common/components/contextMenu/interface';
|
|
|
+import AddSpotContract from '@/views/information/spot-contract/components/add/index.vue';
|
|
|
+import { detailButton, permissionButton, handlePermission } from '@/common/setup/buttonPermission/index';
|
|
|
+import SpotContractDeatil from '@/views/information/spot-contract/components/detail/index.vue';
|
|
|
+import Finish from '@/views/information/spot-contract/components/finish/index.vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'spot-contract-performance',
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ filterCustomTable,
|
|
|
+ contextMenu,
|
|
|
+ AddSpotContract,
|
|
|
+ SpotContractDeatil,
|
|
|
+ Finish,
|
|
|
+ },
|
|
|
setup() {
|
|
|
- const { customList, actionQuery } = getCustomList();
|
|
|
+ const contextMenuList = ref<MenuItem[]>([]);
|
|
|
+ const { spotContractList, actionQuery, columns, getColumns, search, loading } = getCustomList();
|
|
|
+ const { hasPermission } = handlePermission('spot_contract_performance');
|
|
|
+ const { openAction: addAction } = openModal('addSpotContract');
|
|
|
+
|
|
|
+ detailButton('spotContractDetail', contextMenuList);
|
|
|
+ const { action: checkAction } = permissionButton('spotContractFinish', '正常完结', contextMenuList);
|
|
|
+
|
|
|
+ const stop = watchEffect(() => {
|
|
|
+ hasPermission('spot_contract_btn_finish') && checkAction();
|
|
|
+ });
|
|
|
+ onUnmounted(() => {
|
|
|
+ stop();
|
|
|
+ });
|
|
|
initData(() => {
|
|
|
- actionQuery();
|
|
|
- // 加载数据在这里
|
|
|
+ actionQuery(2);
|
|
|
+ getColumns();
|
|
|
});
|
|
|
- return { customList };
|
|
|
+ return { spotContractList, columns, search, contextMenuList, addAction, loading, hasPermission };
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
@@ -80,5 +74,4 @@ export default defineComponent({
|
|
|
<style lang="less">
|
|
|
.spot-contract-performance {
|
|
|
}
|
|
|
-</style
|
|
|
->;
|
|
|
+</style>;
|