huangbin 4 gadi atpakaļ
vecāks
revīzija
b5d77343d5

+ 5 - 0
src/common/constants/buttonType.ts

@@ -26,5 +26,10 @@ export interface ButtonType {
     purchase_pending_invoice: string; // 采购 发票登记
     purchase_pending_storage: string; // 采购 入库登记
 
+    sell_pending_someprice: string; // 销售 点价登记
+    sell_pending_settlement: string; // 销售 交收登记
+    sell_pending_funds: string; // 销售 款项登记
+    sell_pending_invoice: string; // 销售 发票登记
+    sell_pending_storage: string; // 销售 出库登记
 
 }

+ 4 - 0
src/common/setup/buttonPermission/interface.ts

@@ -14,6 +14,10 @@ export interface MenuType {
     purchase_performance: string;   // 采购 履约交收
     purchase_all: string;   // 采购 全部
 
+    sell_pending: string;   // 销售 待点价
+    sell_performance: string;   // 销售 履约交收
+    sell_all: string;   // 销售 全部
+
 }
 
 export interface BtnType {

+ 46 - 0
src/views/business/sell/components/detail/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 采购详情-->
+  <a-modal class="custom-detail"
+           title="详情"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'sell-detail',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('detail');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 131 - 0
src/views/business/sell/components/filterTable/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <div class="filter-custom-table">
+    <a-input v-model:value="accountname"
+             class="tableConditionInput"
+             placeholder="模糊搜索销售方" />
+    <a-input v-model:value="contractno"
+             class="tableConditionInput"
+             placeholder="模糊搜索合同编号" />
+    <a-input v-model:value="deliverygoodsname"
+             class="tableConditionInput"
+             placeholder="模糊搜索现货品种" />
+    <a-input v-model:value="convertfactor"
+             class="tableConditionInput"
+             placeholder="模糊搜索品类" />
+    <a-input v-model:value="goodsname"
+             class="tableConditionInput"
+             placeholder="模糊搜索点价合约" />
+    <a-button class="selectBtn"
+              @click="search">查询</a-button>
+    <a-button class="selectBtn"
+              @click="reset">重置</a-button>
+    <slot></slot>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref, SetupContext } from 'vue';
+
+// 搜索
+function handleSearch(context: SetupContext) {
+    const accountname = ref<string>('');
+    const contractno = ref<string>('');
+    const deliverygoodsname = ref<string>('');
+    const convertfactor = ref<string>('');
+    const goodsname = ref<string>('');
+
+    function search() {
+        const result = {
+            accountname: [accountname.value],
+            contractno: [contractno.value],
+            deliverygoodsname: [deliverygoodsname.value],
+            convertfactor: [convertfactor.value],
+            goodsname: [goodsname.value],
+        };
+        context.emit('search', result);
+    }
+    function reset() {
+        accountname.value = '';
+        contractno.value = '';
+        deliverygoodsname.value = '';
+        convertfactor.value = '';
+        goodsname.value = '';
+        search();
+    }
+
+    return { accountname, contractno, convertfactor, goodsname, search, reset };
+}
+
+export default defineComponent({
+    name: 'sell-filter-table',
+    components: {},
+    setup(props, context) {
+        return {
+            ...handleSearch(context),
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.filter-custom-table {
+    width: 100%;
+    display: inline-flex;
+    padding-top: 9px;
+    padding-bottom: 6px;
+    .ant-select-single:not(.ant-select-customize-input) {
+        margin-right: 10px;
+        // background: #252D34;
+        // .rounded-corners(3px);
+        .ant-select-selector {
+            height: 30px;
+            padding: 0 8px;
+            background: @m-grey9;
+            border: none;
+            .rounded-corners(3px);
+            color: @m-grey10;
+            .ant-select-arrow {
+                right: 8px;
+                color: @m-grey1;
+            }
+        }
+        .ant-select-arrow {
+            color: @m-grey1;
+        }
+        .ant-select-selection-item {
+            color: @m-white1;
+        }
+    }
+    .conditionSelect + .conditionSelect {
+        margin-left: 10px;
+    }
+}
+.selectBtn.ant-btn {
+    margin-left: 10px;
+    width: 80px;
+    height: 30px;
+    line-height: 31px;
+    text-align: center;
+    background: linear-gradient(0deg, @m-grey15 0%, @m-grey16 98%);
+    border: 0;
+    color: @m-white0;
+    font-size: 14px;
+    .rounded-corners(3px);
+    &:hover,
+    &:focus {
+        background: linear-gradient(0deg, @m-grey15-hover 0%, @m-grey16-hover 98%);
+        color: rgba(@m-white0, 0.8);
+        border: 0;
+    }
+}
+.operBtn.ant-btn:extend(.selectBtn.ant-btn) {
+    background: linear-gradient(0deg, @m-blue6 0%, @m-blue7 99%);
+    &:hover,
+    &:focus {
+        background: linear-gradient(0deg, @m-blue6-hover 0%, @m-blue7-hover 99%);
+        color: rgba(@m-white0, 0.8);
+        border: 0;
+    }
+}
+</style>;

+ 46 - 0
src/views/business/sell/components/funds/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 款项登记-->
+  <a-modal class="custom-detail"
+           title="款项登记"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'sell_pending_funds',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('sell_pending_funds');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 46 - 0
src/views/business/sell/components/invoice/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 发票登记-->
+  <a-modal class="custom-detail"
+           title="发票登记"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'sell_pending_invoice',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('sell_pending_invoice');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 46 - 0
src/views/business/sell/components/settlement/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 交收登记-->
+  <a-modal class="custom-detail"
+           title="交收登记"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'sell_pending_settlement',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('sell_pending_settlement');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 46 - 0
src/views/business/sell/components/someprice/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 采购点价登记-->
+  <a-modal class="custom-detail"
+           title="点价登记"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'sell_pending_someprice',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('sell_pending_someprice');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 46 - 0
src/views/business/sell/components/storage/index.vue

@@ -0,0 +1,46 @@
+<template>
+  <!-- 出库登记-->
+  <a-modal class="custom-detail"
+           title="出库登记"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">关闭</a-button>
+    </template>
+
+  </a-modal>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+
+export default defineComponent({
+    name: 'sell_pending_storage',
+    components: {},
+    setup() {
+        const { visible, cancel } = closeModal('sell_pending_storage');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;

+ 82 - 72
src/views/business/sell/list/all/index.vue

@@ -1,83 +1,93 @@
 <template>
-    <!-- 采购: 实时敞口-->
-    <div class="purchase-real-time">
-        采购: 实时敞口
-    </div>
+  <!-- 销售:全部-->
+  <div class="sell-all"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="forDataBtn"
+                 :tableList="tableList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 详情 -->
+    <Detail />
+    <!-- 采购点价登记 -->
+    <SomePrice />
+    <!-- 交收登记 -->
+    <Settlement />
+    <!-- 款项登记 -->
+    <Funds />
+    <!-- 发票登记 -->
+    <Invoice />
+    <!-- 出库登记 -->
+    <Storage />
+  </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 { initData } from '@/common/methods';
+import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '../../components/filterTable/index.vue';
+import { getTableList } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import Detail from '../../components/detail/index.vue';
+import Settlement from '../../components/settlement/index.vue';
+import Funds from '../../components/funds/index.vue';
+import Invoice from '../../components/invoice/index.vue';
+import Storage from '../../components/storage/index.vue';
+import SomePrice from '../../components/someprice/index.vue';
 
-    // 查询客户资料列表
-    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));
-        }
+export default defineComponent({
+    name: 'sell-all',
+    components: {
+        contextMenu,
+        filterCustomTable,
+        Detail,
+        Settlement,
+        Funds,
+        Invoice,
+        Storage,
+        SomePrice,
+    },
+    setup() {
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList('table_pcweb_sell');
+        const { commonBtn, forDataBtn } = getBtnList('sell_all');
 
-        return { customList, actionQuery };
-    }
+        initData(() => {
+            actionQuery(1);
+            getColumns();
+        });
 
-    export default defineComponent({
-        name: 'purchase-real-time',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .purchase-real-time {
-    }</style
+.sell-all {
+}
+</style
 >;

+ 66 - 72
src/views/business/sell/list/pending/index.vue

@@ -1,83 +1,77 @@
 <template>
-    <!-- 采购: 现货头寸-->
-    <div class="spot-contract-peddding">
-        采购: 现货头寸
-    </div>
+  <!-- 销售: 待点价-->
+  <div class="sell-peddding"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="forDataBtn"
+                 :tableList="tableList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 详情 -->
+    <Detail />
+    <!-- 采购点价登记 -->
+    <SomePrice />
+  </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 { initData } from '@/common/methods';
+import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '../../components/filterTable/index.vue';
+import { getTableList } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import Detail from '../../components/detail/index.vue';
+import SomePrice from '../../components/someprice/index.vue';
 
-    // 查询客户资料列表
-    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));
-        }
+export default defineComponent({
+    name: 'sell-peddding',
+    components: {
+        contextMenu,
+        filterCustomTable,
+        Detail,
+        SomePrice,
+    },
+    setup() {
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList('table_pcweb_sell');
+        const { commonBtn, forDataBtn } = getBtnList('sell_pending');
 
-        return { customList, actionQuery };
-    }
+        initData(() => {
+            actionQuery(2);
+            getColumns();
+        });
 
-    export default defineComponent({
-        name: 'spot-contract-peddding',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .spot-contract-peddding {
-    }</style
+.sell-peddding {
+}
+</style
 >;

+ 78 - 72
src/views/business/sell/list/performance/index.vue

@@ -1,83 +1,89 @@
 <template>
-    <!-- 采购: 历史敞口-->
-    <div class="purchase-history">
-        采购:历史敞口
-    </div>
+  <!-- 销售: 履约交收-->
+  <div class="sell_performance"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <a-button class="operBtn"
+                v-for="item in commonBtn"
+                :key="item.lable"
+                @click="item.callback">{{item.lable}}</a-button>
+    </filterCustomTable>
+    <contextMenu :contextMenuList="forDataBtn"
+                 :tableList="tableList">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template> -->
+      </a-table>
+    </contextMenu>
+    <!-- 详情 -->
+    <Detail />
+    <!-- 交收登记 -->
+    <Settlement />
+    <!-- 款项登记 -->
+    <Funds />
+    <!-- 发票登记 -->
+    <Invoice />
+    <!-- 出库登记 -->
+    <Storage />
+  </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 { initData } from '@/common/methods';
+import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '../../components/filterTable/index.vue';
+import { getTableList } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import Detail from '../../components/detail/index.vue';
+import Settlement from '../../components/settlement/index.vue';
+import Funds from '../../components/funds/index.vue';
+import Invoice from '../../components/invoice/index.vue';
+import Storage from '../../components/storage/index.vue';
 
-    // 查询客户资料列表
-    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));
-        }
+export default defineComponent({
+    name: 'sell_performance',
+    components: {
+        contextMenu,
+        filterCustomTable,
+        Detail,
+        Settlement,
+        Funds,
+        Invoice,
+        Storage,
+    },
+    setup() {
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList('table_pcweb_sell');
+        const { commonBtn, forDataBtn } = getBtnList('sell_performance');
 
-        return { customList, actionQuery };
-    }
+        initData(() => {
+            actionQuery(3);
+            getColumns();
+        });
 
-    export default defineComponent({
-        name: 'purchase-history',
-        components: {},
-        setup() {
-            const { customList, actionQuery } = getCustomList();
-            initData(() => {
-                actionQuery();
-                // 加载数据在这里
-            });
-            return { customList };
-        },
-    });
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+        };
+    },
+});
 </script>
 
 <style lang="less">
-    .purchase-history {
-    }</style
+.sell_performance {
+}
+</style
 >;

+ 78 - 0
src/views/business/sell/list/setup.ts

@@ -0,0 +1,78 @@
+import { ColumnType, getTableHead } from '@/common/methods/table';
+import { TableKey } from '@/common/methods/table/interface';
+import { Ermcp3SellBuyContract, Querytype } from '@/services/go/ermcp/purchase/interface';
+import { QueryWareHouse } from '@/services/go/ermcp/sell';
+import { message } from 'ant-design-vue';
+import { ref } from 'vue';
+
+// 列表
+export function getTableList(tableKey: keyof TableKey) {
+    // 表格数据
+    const tableList = ref<Ermcp3SellBuyContract[]>([]);
+    // 表头数据
+    const columns = ref<ColumnType[]>([]);
+    // 过滤项
+    const filteredInfo = ref();
+    const loading = ref<boolean>(false);
+    // 获取表头
+    function getColumns() {
+        const list = getTableHead(tableKey);
+        const filtered = filteredInfo.value || {};
+        columns.value.length = 0;
+        list.forEach((e, i) => {
+            const { columnfield, columntitle, aligntype } = e;
+            const item: ColumnType = {
+                key: String(i),
+                dataIndex: columnfield, // 表格数据对应的key
+                title: columntitle,
+                align: aligntype === 1 ? 'center' : aligntype === 2 ? 'left' : 'right',
+                slots: { customRender: columnfield },
+            };
+            // // 以下添加过滤数据对应的方法
+            if (e.columnfield === 'accountname') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.accountname.includes(value);
+                item.filteredValue = filtered.accountname || null;
+            }
+            if (e.columnfield === 'contractno') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.contractno.includes(value);
+                item.filteredValue = filtered.contractno || null;
+            }
+            if (e.columnfield === 'deliverygoodsname') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.deliverygoodsname.includes(value);
+                item.filteredValue = filtered.deliverygoodsname || null;
+            }
+            if (e.columnfield === 'convertfactor') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => String(record.convertfactor).includes(value);
+                item.filteredValue = filtered.convertfactor || null;
+            }
+            if (e.columnfield === 'goodsname') {
+                item.onFilter = (value: string, record: Ermcp3SellBuyContract) => record.goodsname.includes(value);
+                item.filteredValue = filtered.goodsname || null;
+            }
+            columns.value.push(item);
+        });
+    }
+    // 查询列表
+    function actionQuery(querytype: Querytype) {
+        loading.value = true;
+        QueryWareHouse({ querytype })
+            .then((res) => {
+                tableList.value = res.map((e, i) => {
+                    return { ...e, key: String(i) };
+                });
+                loading.value = false;
+                console.log('查询列表', tableList);
+            })
+            .catch((err) => {
+                message.error(err);
+                loading.value = false;
+            });
+    }
+    // 查询
+    function search(value: any) {
+        filteredInfo.value = value;
+        getColumns();
+    }
+
+    return { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading, };
+}