Bladeren bron

Enhancement transaction module
https://dev.wormwood.com.sg/zentao/task-view-338.html

vbea 1 jaar geleden
bovenliggende
commit
e2f2c5516b

+ 12 - 7
Strides-Admin/src/http/api/financial.js

@@ -1,5 +1,7 @@
 import {get, post, put, del} from '../http'
 
+const prefix = "dawn/api/v1/"
+
 const financial = {
   getTransactionsPages(data) {
     return post('financial/getChargingTransactions', data)
@@ -71,26 +73,29 @@ const financial = {
     return post("financial/account-settlement/redo-account-settlement", data)
   },
   getBillingTypeOptions() {
-    return get("dawn/api/v1/billing-type-select")
+    return get(prefix + "billing-type-select")
+  },
+  getPaymentTypeOptions() {
+    return get(prefix + "payment-method-select")
   },
   /*信用余额操作部分-Start*/
   getCreditActionTypeOptions() {
-    return get("dawn/api/v1/credit-action-type-select")
+    return get(prefix + "credit-action-type-select")
   },
   getCreditStatusOptions() {
-    return get("dawn/api/v1/credit_action_status-select")
+    return get(prefix + "credit_action_status-select")
   },
   getCreaitActionPages(data) {
-    return post("dawn/api/v1/credit-action-pages", data)
+    return post(prefix + "credit-action-pages", data)
   },
   createCreditApply(data) {
-    return post("dawn/api/v1/credit-action-application", data)
+    return post(prefix + "credit-action-application", data)
   },
   approveCreditApply(data) {
-    return put("dawn/api/v1/credit-action-application", data)
+    return put(prefix + "credit-action-application", data)
   },
   viewCreditApply(creditActionId) {
-    return get("dawn/api/v1/credit-action-application/" + creditActionId)
+    return get(prefix + "credit-action-application/" + creditActionId)
   }
   /*信用余额操作部分-End*/
 }

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

@@ -13,6 +13,18 @@
           :label="item"
           :value="item" />
       </el-select>
+      <el-select
+        class="filter-view-item"
+        v-model="filter.pageVo.creditType"
+        placeholder="Credit Type"
+        @change="toSearch"
+        clearable>
+        <el-option
+          v-for="item in payTypeOptions"
+          :key="item.key"
+          :label="item.value"
+          :value="item.key" />
+      </el-select>
       <el-date-picker
         v-model="filter.pageVo.dateRange"
         type="daterange"
@@ -183,6 +195,7 @@ export default {
       listLoading: false,
       siteOptions: [],
       stationOptions: [],
+      payTypeOptions: [],
       userTypeOptions: [],
       table: {
         list: [],
@@ -196,6 +209,7 @@ export default {
           sitePk: "",
           criteria: "",
           userType: "",
+          creditType: "",
           dateRange: [],
           chargeBoxId: ""
         }
@@ -205,6 +219,7 @@ export default {
   components: { Pagination },
   created() {
     this.getUserTypeOption();
+    this.getPaymentTypeOption();
     //this.getSiteOptions()
     this.getTableData()
   },
@@ -249,6 +264,18 @@ export default {
         })
       })
     },
+    getPaymentTypeOption() {
+      financial.getPaymentTypeOptions().then(res => {
+        if (res.data) {
+          this.payTypeOptions = res.data
+        }
+      }).catch(error => {
+        this.$message({
+          message: error,
+          type: 'error'
+        })
+      })
+    },
     getTableData() {
       this.loading = true;
       financial.getTransactionsPages(this.filter).then(res => {

+ 29 - 1
Strides-Admin/src/views/transaction/transactions.vue

@@ -33,6 +33,18 @@
               :label="item.name"
               :value="item.value"/>
           </el-select>
+          <el-select
+            class="filter-view-item"
+            v-model="filter.pageVo.creditType"
+            placeholder="Credit Type"
+            @change="handleFilter"
+            clearable>
+            <el-option
+              v-for="item in payTypeOptions"
+              :key="item.key"
+              :label="item.value"
+              :value="item.key" />
+          </el-select>
           <el-select
             class="filter-view-item"
             v-model="filter.pageVo.filter"
@@ -258,6 +270,7 @@
 import Pagination from '@/components/Pagination'
 import api from '../../http/api/transaction'
 import apiUser from '../../http/api/apiUser.js'
+import financial from '@/http/api/financial'
 
 export default {
   components: { Pagination },
@@ -271,11 +284,13 @@ export default {
           groupPk: "",
           criteria: "",
           userType: "",
+          creditType: "",
           dateRange: [],
         }
       },
       groupOptions: [],
       filterOptions: [],
+      payTypeOptions: [],
       userTypeOptions: [],
       listLoading: true,
       tableList: [],
@@ -289,6 +304,7 @@ export default {
   created() {
     this.getFilters();
     this.getUserTypeOption();
+    this.getPaymentTypeOption();
     //this.handleFilter();
   },
   methods: {
@@ -346,7 +362,19 @@ export default {
         })
       })
     },
-    async getList() {
+    getPaymentTypeOption() {
+      financial.getPaymentTypeOptions().then(res => {
+        if (res.data) {
+          this.payTypeOptions = res.data
+        }
+      }).catch(error => {
+        this.$message({
+          message: error,
+          type: 'error'
+        })
+      })
+    },
+    getList() {
       this.listLoading = true;
       api.getTransactionPages(this.filter).then(res => {
         if (res.data && res.total) {