浏览代码

【日志汇总查询】页面绘制:列表、搜索

002390 1 年之前
父节点
当前提交
8dfe02e5fa

+ 10 - 0
src/api/business/report/summary.js

@@ -0,0 +1,10 @@
+import request from "@/utils/request";
+
+export function LIST(data, params) {
+  return request({
+    url: "/pu/priceApply/list",
+    method: "POST",
+    params: params,
+    data: data,
+  });
+}

+ 98 - 0
src/views/report/summary-sheet/columns.js

@@ -0,0 +1,98 @@
+export default function useColumns() {
+  const SearchColumns = [
+    {
+      item: { key: "", title: "开始时间", },
+      attr: {
+        is: "el-date-picker",
+        type: "date",
+        placeholder: "选择日期",
+        valueFormat: "yyyy-MM-dd",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "", title: "结束时间", },
+      attr: {
+        is: "el-date-picker",
+        type: "date",
+        placeholder: "选择日期",
+        valueFormat: "yyyy-MM-dd",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "", title: "日志类型", },
+      attr: {
+        is: "el-select",
+        clearable: true,
+      },
+    },
+    {
+      item: { key: "", title: "员工", },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "CONTACTS_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          // buyer: "code",
+        },
+      },
+    },
+    // {
+    //   item: { key: "", title: "员工姓名", },
+    //   attr: {
+    //     is: "el-input",
+    //     clearable: true,
+    //   },
+    // },
+  ];
+
+  const TableColumns = [
+    {
+      item: { key: "", title: "员工工号", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "员工姓名", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "一级部门", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "二级部门", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "三级部门", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "应交份数", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "实交份数", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "缺交份数", },
+      attr: {},
+    },
+    {
+      item: { key: "", title: "休假", },
+      attr: {},
+    },
+  ].map(({ item, attr }) => ({
+    attr,
+    item: {
+      ...item,
+      sortabled: true,
+      fixedabled: true,
+      filterabled: true,
+      hiddenabled: true,
+    },
+  }));
+  return { SearchColumns, TableColumns }
+}

+ 14 - 0
src/views/report/summary-sheet/dicts.js

@@ -0,0 +1,14 @@
+import { initDicts } from "@/utils/init.js";
+const modules = require.context("./", true, /columns.js$/);
+const columns = [];
+modules.keys().forEach((fileName) => {
+  const data = modules(fileName).default();
+  for (const key in data) {
+    if (key === "TabColumns") {
+      columns.push(...data[key].map((item) => item.TableColumns).flat());
+    } else {
+      columns.push(...data[key]);
+    }
+  }
+});
+export const dicts = initDicts(columns);

+ 112 - 0
src/views/report/summary-sheet/index.vue

@@ -0,0 +1,112 @@
+<!-- 日志汇总查询 -->
+<script>
+import { dicts } from "./dicts";
+import useColumns from "./columns";
+export default {
+  name: "SummarySheet",
+  dicts: [...dicts],
+  components: {
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
+  },
+  data() {
+    const { SearchColumns, TableColumns } = useColumns();
+    const params = this.$init.params(SearchColumns);
+    const page = this.$init.page();
+    return {
+      page,
+      params,
+      TableColumns,
+      SearchColumns,
+      size: "mini",
+      loading: false,
+      tableData: [],
+      selectData: [],
+    };
+  },
+  computed: {},
+  methods: {
+    // 重置
+    useReset() {
+      this.params = this.$init.params(this.SearchColumns);
+      this.page = this.$init.page();
+      this.useQuery(this.params, this.page);
+    },
+    useQuery(params, page) {
+      try {
+        this.loading = true;
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
+    },
+    // 导出
+    useExport() {
+      try {
+      } catch (error) {}
+    },
+    useSelect(selection) {
+      this.selectData = selection;
+    },
+  },
+  created() {
+    this.useQuery(this.params, this.page);
+  },
+};
+</script>
+
+<template>
+  <el-card
+    v-loading="loading"
+    :body-style="{
+      height: '100%',
+      padding: 0,
+      display: 'flex',
+      'flex-direction': 'column',
+    }"
+  >
+    <el-super-search
+      v-model="params"
+      :size="size"
+      :dict="dict"
+      :columns="SearchColumns"
+      @reset="useReset"
+      @submit="useQuery(params, page)"
+    >
+    </el-super-search>
+
+    <el-row class="my-4" style="text-align: right">
+      <el-button-group>
+        <el-button :size="size" @click="useExport">导 出</el-button>
+      </el-button-group>
+    </el-row>
+
+    <el-super-ux-table
+      v-model="tableData"
+      :size="size"
+      :dict="dict"
+      :page="page"
+      :columns="TableColumns"
+      checkbox
+      pagination
+      convenitentOperation
+      storage-key="SummarySheetSuperTable"
+      @row-select="useSelect"
+      @pagination="useQuery(params, page)"
+    >
+    </el-super-ux-table>
+  </el-card>
+</template>
+<style scoped lang="scss">
+.el-card {
+  width: calc(100% - 32px);
+  height: calc(100vh - 32px);
+  margin: 16px;
+  padding: 16px;
+  border-radius: 8px;
+}
+
+.el-button-group + .el-button-group {
+  margin: 0 0 0 8px;
+}
+</style>