vbea 3 жил өмнө
parent
commit
1f80ec07c5

+ 15 - 0
Strides-Admin/src/http/api/financial.js

@@ -0,0 +1,15 @@
+import {get, post} from '../http'
+
+const financial = {
+  getTransactionsPages(data) {
+    return post('financial/getChargingTransactions', data)
+  },
+  getIdleFeesPages(data) {
+    return post('financial/getIdleFees', data)
+  },
+  getTopUpPages(data) {
+    return post('financial/getTopUps', data)
+  }
+}
+
+export default financial;

+ 3 - 0
Strides-Admin/src/icons/svg/financial-active.svg

@@ -0,0 +1,3 @@
+<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M7 15.4073H9C9 16.4873 10.37 17.4073 12 17.4073C13.63 17.4073 15 16.4873 15 15.4073C15 14.3073 13.96 13.9073 11.76 13.3773C9.64 12.8473 7 12.1873 7 9.40735C7 7.61735 8.47 6.09735 10.5 5.58735V3.40735H13.5V5.58735C15.53 6.09735 17 7.61735 17 9.40735H15C15 8.32735 13.63 7.40735 12 7.40735C10.37 7.40735 9 8.32735 9 9.40735C9 10.5073 10.04 10.9073 12.24 11.4373C14.36 11.9673 17 12.6273 17 15.4073C17 17.1973 15.53 18.7173 13.5 19.2273V21.4073H10.5V19.2273C8.47 18.7173 7 17.1973 7 15.4073Z" fill="white"/>
+</svg>

+ 3 - 0
Strides-Admin/src/icons/svg/financial.svg

@@ -0,0 +1,3 @@
+<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M7 15.4073H9C9 16.4873 10.37 17.4073 12 17.4073C13.63 17.4073 15 16.4873 15 15.4073C15 14.3073 13.96 13.9073 11.76 13.3773C9.64 12.8473 7 12.1873 7 9.40735C7 7.61735 8.47 6.09735 10.5 5.58735V3.40735H13.5V5.58735C15.53 6.09735 17 7.61735 17 9.40735H15C15 8.32735 13.63 7.40735 12 7.40735C10.37 7.40735 9 8.32735 9 9.40735C9 10.5073 10.04 10.9073 12.24 11.4373C14.36 11.9673 17 12.6273 17 15.4073C17 17.1973 15.53 18.7173 13.5 19.2273V21.4073H10.5V19.2273C8.47 18.7173 7 17.1973 7 15.4073Z" fill="black"/>
+</svg>

+ 47 - 0
Strides-Admin/src/router/FinancialRouter.js

@@ -0,0 +1,47 @@
+import Layout from '@/layout'
+
+export default {
+  path: '/financial',
+  component: Layout,
+  redirect: '/financial/transactions',
+  meta: {
+    title: 'Financial Management',
+    affix: false,
+    icon: 'financial'
+  },
+  children: [
+    {
+      path: '/financial/transactions',
+      component: () => import('@/views/financial/index'),
+      name: 'FinancialTransactions',
+      meta: {
+        title: 'Charging Transactions',
+        icon: 'sidebar-submenu-item',
+        activeIcon: 'sidebar-submenu-item-active',
+        affix: false
+      }
+    },
+    {
+      path: '/financial/idle',
+      component: () => import('@/views/financial/IdleFee'),
+      name: 'FinancialIdleFee',
+      meta: {
+        title: 'Idle Fee',
+        icon: 'sidebar-submenu-item',
+        activeIcon: 'sidebar-submenu-item-active',
+        affix: false
+      }
+    },
+    {
+      path: '/financial/topup',
+      component: () => import('@/views/financial/TopUp'),
+      name: 'FinancialTopup',
+      meta: {
+        title: 'Top-Up',
+        icon: 'sidebar-submenu-item',
+        activeIcon: 'sidebar-submenu-item-active',
+        affix: false
+      }
+    }
+  ]
+}

+ 187 - 0
Strides-Admin/src/views/financial/IdleFee.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="filter.pageVo"
+      class="filter-container"
+      label-position="right">
+      <div class="filter-view">
+        <el-form-item>
+          <el-input
+            clearable
+            v-model="filter.pageVo.criteria"
+            placeholder="Search by Number/Email"
+            @keyup.enter.native="handleFilter" />
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker
+            v-model="filter.pageVo.date"
+            type="month"
+            format="yyyy-MM"
+            value-format="yyyy-MM"
+            placeholder="Filter Date"/>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            filterable
+            remote
+            clearable
+            v-model="filter.pageVo.sitePk"
+            :remote-method="(s) => getSiteOptions(s)"
+            placeholder="Filter by site"
+            @change="getStationOptions">
+            <el-option
+              v-for="(item, index) in siteOptions"
+              :key="index"
+              :label="item.siteName"
+              :value="item.sitePk"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            clearable
+            v-model="filter.pageVo.chargeBoxId"
+            placeholder="Filter by Station ID"
+            v-loading="listLoading">
+            <el-option
+              v-for="(item, index) in stationOptions"
+              :key="index"
+              :label="item.stationId"
+              :value="item.stationId"/>
+          </el-select>
+        </el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          @click="getTableData">
+          Search
+        </el-button>
+      </div>
+    </el-form>
+    <el-table
+      :data="table.list"
+      v-loading="loading">
+      <el-table-column
+        label="User ID"
+        align="center"
+        prop="userPk"/>
+      <el-table-column
+        label="Site Name"
+        align="center"
+        prop="siteName"/>
+      <el-table-column
+        label="Station ID"
+        align="center"
+        prop="chargeBoxId"/>
+      <el-table-column
+        label="Start Date/Time"
+        align="center"
+        prop="startTime"/>
+      <el-table-column
+        label="End Date/Time"
+        align="center"
+        prop="endTime"/>
+      <el-table-column
+        label="Duration"
+        align="center"
+        prop="duration"/>
+      <el-table-column
+        label="Rate"
+        align="center"
+        prop="rate"/>
+      <el-table-column
+        label="Charges"
+        align="center"
+        prop="charges"/>
+    </el-table>
+    <div class="right">
+      <Pagination
+        v-show="table.total > 0"
+        :total="table.total"
+        :page.sync="filter.pageNo"
+        :limit.sync="filter.pageSize"
+        @pagination="getTableData" />
+    </div>
+  </div>
+</template>
+
+<script>
+import site from '@/http/api/site'
+import ocpp from '@/http/api/ocpp'
+import financial from '@/http/api/financial'
+import Pagination from '@/components/Pagination'
+export default {
+  data() {
+    return {
+      loading: false,
+      listLoading: false,
+      siteOptions: [],
+      stationOptions: [],
+      table: {
+        list: [],
+        total: 0
+      },
+      filter: {
+        pageNo: 1,
+        pageSize: 10,
+        pageVo: {
+          date: "",
+          sitePk: "",
+          criteria: "",
+          chargeBoxId: ""
+        }
+      },
+    }
+  },
+  components: { Pagination },
+  created() {
+    this.getSiteOptions()
+    this.getTableData()
+  },
+  methods: {
+    getSiteOptions(search) {
+      site.getAllSiteList({siteName: search ?? ""}).then(res => {
+        if (res.data && res.data.length > 0) {
+          this.siteOptions = res.data
+        }
+      });
+    },
+    getStationOptions() {
+      this.listLoading = true;
+      ocpp.getStationPages({
+        pageNo: 1,
+        pageSize: 20,
+        pageVo: {
+          date: "",
+          sitePk: this.filter.pageVo.sitePk
+        }
+      }).then(res => {
+        if (res.data) {
+          this.stationOptions = res.data;
+        }
+      }).finally(() => {
+        this.listLoading = false;
+      })
+    },
+    getTableData() {
+      this.loading = true;
+      financial.getIdleFeesPages(this.filter).then(res => {
+        this.loading = false;
+        if (res.data) {
+          this.table.total = res.total
+          this.table.list = res.data
+        }
+      }).catch(err => {
+        this.loading = false;
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style>
+  
+</style>

+ 154 - 0
Strides-Admin/src/views/financial/TopUp.vue

@@ -0,0 +1,154 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="filter.pageVo"
+      class="filter-container"
+      label-position="right">
+      <div class="filter-view">
+        <el-form-item>
+          <el-input
+            clearable
+            v-model="filter.pageVo.criteria"
+            placeholder="Search by Number/Email"
+            @keyup.enter.native="handleFilter" />
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker
+            v-model="filter.pageVo.date"
+            type="month"
+            format="yyyy-MM"
+            value-format="yyyy-MM"
+            placeholder="Filter Date"/>
+        </el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          @click="getTableData">
+          Search
+        </el-button>
+      </div>
+    </el-form>
+    <el-table
+      :data="table.list"
+      v-loading="loading">
+      <el-table-column
+        label="Transaction ID"
+        align="center"
+        prop="creditHistoryPk"/>
+      <el-table-column
+        label="Top Up Type"
+        align="center"
+        prop="paymentPlatform"/>
+      <el-table-column
+        label="Amount"
+        align="center"
+        prop="amount"/>
+      <el-table-column
+        label="Creation Time"
+        align="center"
+        prop="creationTime"/>
+      <el-table-column
+        label="Payment Status"
+        align="center"
+        prop="paymentStatus"/>
+      <el-table-column
+        label="Payment Reference"
+        align="center"
+        prop="paymentReference"/>
+      <el-table-column
+        label="Update Time"
+        align="center"
+        prop="updateTime"/>
+    </el-table>
+    <div class="right">
+      <Pagination
+        v-show="table.total > 0"
+        :total="table.total"
+        :page.sync="filter.pageNo"
+        :limit.sync="filter.pageSize"
+        @pagination="getTableData" />
+    </div>
+  </div>
+</template>
+
+<script>
+import site from '@/http/api/site'
+import ocpp from '@/http/api/ocpp'
+import financial from '@/http/api/financial'
+import Pagination from '@/components/Pagination'
+export default {
+  data() {
+    return {
+      loading: false,
+      listLoading: false,
+      siteOptions: [],
+      stationOptions: [],
+      table: {
+        list: [],
+        total: 0
+      },
+      filter: {
+        pageNo: 1,
+        pageSize: 10,
+        pageVo: {
+          date: "",
+          sitePk: "",
+          criteria: "",
+          chargeBoxId: ""
+        }
+      },
+    }
+  },
+  components: { Pagination },
+  created() {
+    //this.getSiteOptions()
+    this.getTableData()
+  },
+  methods: {
+    getSiteOptions(search) {
+      site.getAllSiteList({siteName: search ?? ""}).then(res => {
+        if (res.data && res.data.length > 0) {
+          this.siteOptions = res.data
+        }
+      });
+    },
+    getStationOptions() {
+      this.listLoading = true;
+      ocpp.getStationPages({
+        pageNo: 1,
+        pageSize: 20,
+        pageVo: {
+          date: "",
+          sitePk: this.filter.pageVo.sitePk
+        }
+      }).then(res => {
+        if (res.data) {
+          this.stationOptions = res.data;
+        }
+      }).finally(() => {
+        this.listLoading = false;
+      })
+    },
+    getTableData() {
+      this.loading = true;
+      financial.getTopUpPages(this.filter).then(res => {
+        this.loading = false;
+        if (res.data) {
+          this.table.total = res.total
+          this.table.list = res.data
+        }
+      }).catch(err => {
+        this.loading = false;
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style>
+  
+</style>

+ 187 - 0
Strides-Admin/src/views/financial/index.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class="app-container">
+    <el-form
+      :model="filter.pageVo"
+      class="filter-container"
+      label-position="right">
+      <div class="filter-view">
+        <el-form-item>
+          <el-input
+            clearable
+            v-model="filter.pageVo.criteria"
+            placeholder="Search by Number/Email"
+            @keyup.enter.native="handleFilter" />
+        </el-form-item>
+        <el-form-item>
+          <el-date-picker
+            v-model="filter.pageVo.date"
+            type="month"
+            format="yyyy-MM"
+            value-format="yyyy-MM"
+            placeholder="Filter Date"/>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            filterable
+            remote
+            clearable
+            v-model="filter.pageVo.sitePk"
+            :remote-method="(s) => getSiteOptions(s)"
+            placeholder="Filter by site"
+            @change="getStationOptions">
+            <el-option
+              v-for="(item, index) in siteOptions"
+              :key="index"
+              :label="item.siteName"
+              :value="item.sitePk"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            clearable
+            v-model="filter.pageVo.chargeBoxId"
+            placeholder="Filter by Station ID"
+            v-loading="listLoading">
+            <el-option
+              v-for="(item, index) in stationOptions"
+              :key="index"
+              :label="item.stationId"
+              :value="item.stationId"/>
+          </el-select>
+        </el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          @click="getTableData">
+          Search
+        </el-button>
+      </div>
+    </el-form>
+    <el-table
+      :data="table.list"
+      v-loading="loading">
+      <el-table-column
+        label="Transaction ID"
+        align="center"
+        prop="transactionPk"/>
+      <el-table-column
+        label="Site Name"
+        align="center"
+        prop="siteName"/>
+      <el-table-column
+        label="Station ID"
+        align="center"
+        prop="chargingPk"/>
+      <el-table-column
+        label="Start Date/Time"
+        align="center"
+        prop="startDateTime"/>
+      <el-table-column
+        label="End Date/Time"
+        align="center"
+        prop="endDateTime"/>
+      <el-table-column
+        label="Power (kwh)"
+        align="center"
+        prop="power"/>
+      <el-table-column
+        label="Rate"
+        align="center"
+        prop="rate"/>
+      <el-table-column
+        label="Charges"
+        align="center"
+        prop="charges"/>
+    </el-table>
+    <div class="right">
+      <Pagination
+        v-show="table.total > 0"
+        :total="table.total"
+        :page.sync="filter.pageNo"
+        :limit.sync="filter.pageSize"
+        @pagination="getTableData" />
+    </div>
+  </div>
+</template>
+
+<script>
+import site from '@/http/api/site'
+import ocpp from '@/http/api/ocpp'
+import financial from '@/http/api/financial'
+import Pagination from '@/components/Pagination'
+export default {
+  data() {
+    return {
+      loading: false,
+      listLoading: false,
+      siteOptions: [],
+      stationOptions: [],
+      table: {
+        list: [],
+        total: 0
+      },
+      filter: {
+        pageNo: 1,
+        pageSize: 10,
+        pageVo: {
+          date: "",
+          sitePk: "",
+          criteria: "",
+          chargeBoxId: ""
+        }
+      },
+    }
+  },
+  components: { Pagination },
+  created() {
+    this.getSiteOptions()
+    this.getTableData()
+  },
+  methods: {
+    getSiteOptions(search) {
+      site.getAllSiteList({siteName: search ?? ""}).then(res => {
+        if (res.data && res.data.length > 0) {
+          this.siteOptions = res.data
+        }
+      });
+    },
+    getStationOptions() {
+      this.listLoading = true;
+      ocpp.getStationPages({
+        pageNo: 1,
+        pageSize: 20,
+        pageVo: {
+          date: "",
+          sitePk: this.filter.pageVo.sitePk
+        }
+      }).then(res => {
+        if (res.data) {
+          this.stationOptions = res.data;
+        }
+      }).finally(() => {
+        this.listLoading = false;
+      })
+    },
+    getTableData() {
+      this.loading = true;
+      financial.getTransactionsPages(this.filter).then(res => {
+        this.loading = false;
+        if (res.data) {
+          this.table.total = res.total
+          this.table.list = res.data
+        }
+      }).catch(err => {
+        this.loading = false;
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
+    }
+  }
+}
+</script>
+
+<style>
+  
+</style>