zhou.xiaoning пре 4 година
родитељ
комит
9700b4e78a

+ 76 - 0
src/views/manage/business-review/list/dj/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <!-- 管理-业务审核-点价 -->
+  <div class="business-review-dj"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <BtnList :btnList="commonBtn" />
+    </filterCustomTable>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+        <!-- 额外的展开行 -->
+        <template #expandedRowRender="{  }">
+          <BtnList :btnList="forDataBtn" />
+        </template>
+        <template #warehousetype="{ text }">
+          <span>{{ getWareHouseType(text) }}</span>
+        </template>
+        <template #warehousestatus="{ text }">
+          <span>{{ getWareHouseStatus(text) }}</span>
+        </template>
+      </a-table>
+    </contextMenu>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import filterCustomTable from '@/views/information/warehouse-info/compoments/filterTable/index.vue';
+import { getTableList } from '../setup';
+import { getBtnList } from '@/common/setup/contextMenu/index';
+import contextMenu from '@/common/components/contextMenu/index.vue';
+import { handleTableEvent } from '@/common/setup/event/index';
+import BtnList from '@/common/components/buttonList/index.vue';
+
+export default defineComponent({
+    name: 'warehouse-info-normal',
+    components: {
+        contextMenu,
+        filterCustomTable,
+        BtnList,
+    },
+    setup() {
+        const { tableList, actionQuery, columns, filteredInfo, getColumns, search, loading } = getTableList();
+        const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+
+        initData(() => {
+            actionQuery();
+            getColumns();
+        });
+
+        return {
+            tableList,
+            filteredInfo,
+            columns,
+            search,
+            loading,
+            commonBtn,
+            forDataBtn,
+            ...handleTableEvent(),
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.business-review-dj {
+}
+</style
+>;
+

+ 0 - 0
src/views/manage/business-review/list/js/index.vue


+ 71 - 0
src/views/manage/business-review/list/setup.ts

@@ -0,0 +1,71 @@
+import { ColumnType, getTableHead } from '@/common/methods/table';
+import { QueryBusinessDj } from '@/services/go/ermcp/business-review/index';
+import { getUserId } from '@/services/bus/account';
+import { QryBusinessDjRsp } from '@/services/go/ermcp/business-review/interface';
+import { message } from 'ant-design-vue';
+import { ref } from 'vue';
+
+// 管理-业务审核-点价
+export function getTableList() {
+    // 表格数据
+    const tableList = ref<QryBusinessDjRsp[]>([]);
+    // 表头数据
+    const columns = ref<ColumnType[]>([]);
+    // 过滤项
+    const filteredInfo = ref();
+    const loading = ref<boolean>(false);
+    
+    // 获取表头
+    function getColumns() {
+        const list = getTableHead('table_pcweb_business_aduit_dj');
+        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 === 'warehousetype') {
+            //     item.onFilter = (value: string, record: QryBusinessDjRsp) => String(record.warehousetype).includes(String(value));
+            //     item.filteredValue = filtered.warehousetype || null;
+            // }
+            // if (e.columnfield === 'warehousename') {
+            //     item.onFilter = (value: string, record: QryBusinessDjRsp) => record.warehousename.includes(value);
+            //     item.filteredValue = filtered.warehousename || null;
+            // }
+            // if (e.columnfield === 'address') {
+            //     item.onFilter = (value: string, record: QryBusinessDjRsp) => record.address.includes(value);
+            //     item.filteredValue = filtered.address || null;
+            // }
+            columns.value.push(item);
+        });
+    }
+    // 查询列表
+    function actionQuery() {
+        loading.value = true;
+        QueryBusinessDj({UserId: getUserId()})
+            .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, };
+}

+ 0 - 2
src/views/manage/business-review/setup.ts

@@ -1,2 +0,0 @@
-import { ColumnType, getTableHead } from '@/common/methods/table';
-