浏览代码

feat: [EK-3382] [AE]-[Recharge Management] 列表新增Type字段,增加编辑功能

bill 1 月之前
父节点
当前提交
f9f47de862
共有 4 个文件被更改,包括 76 次插入1 次删除
  1. 18 0
      src/api/finance.js
  2. 2 0
      src/lang/en.js
  3. 2 0
      src/lang/zh.js
  4. 54 1
      src/views/finance/recharge.vue

+ 18 - 0
src/api/finance.js

@@ -174,4 +174,22 @@ export function postWithdrawStatus(query) {
   })
 }
 
+// 银行列表
+export function fetchRechargeTypeList() {
+  return request({
+    url: '/v1/finance/recharge-type',
+    method: 'get',
+    params: {}
+  })
+}
+
+// 保存充值类型
+export function saveRechargeType(data) {
+  return request({
+    url: '/v1/finance/recharge-type',
+    method: 'post',
+    data
+  })
+}
+
 

+ 2 - 0
src/lang/en.js

@@ -777,6 +777,8 @@ export default {
     ecoinInsufficientNotice: 'Ecoin of member is insufficient, whether to continue to submit.',
     reviewRemberEcoinInfo: 'Review member Ecoin change information',
     statusManagement: 'Status management',
+    typeManagement: 'Type Management',
+    type: 'Type',
     viewVoucher: 'View voucher',
     checkRechargeVoucher: 'Check recharge voucher',
     rechargeStatusState: 'State',

+ 2 - 0
src/lang/zh.js

@@ -767,6 +767,8 @@ export default {
     ecoinInsufficientNotice: '会员账户余额不足,是否继续提交',
     reviewRemberEcoinInfo: '审核会员余额变动信息',
     statusManagement: '状态管理',
+    typeManagement: '充值类型管理',
+    type: '充值类型',
     viewVoucher: '查看凭证',
     checkRechargeVoucher: '查看充值凭证',
     rechargeStatusState: '充值状态',

+ 54 - 1
src/views/finance/recharge.vue

@@ -22,6 +22,12 @@
                         {{  $t('financial.statusManagement')  }}<!-- 状态管理 -->
                     </el-button>
                 </template></el-table-column>
+              <el-table-column :label="$t('financial.typeManagement')"> <!-- 操作 -->
+                <template slot-scope="scope">
+                  <el-button type="success" size="small" @click="handleTypeManagement(scope.row)" >
+                    {{  $t('financial.typeManagement')  }}<!-- 状态管理 -->
+                  </el-button>
+                </template></el-table-column>
                 <el-table-column :label="$t('financial.viewVoucher')"><!-- 查看凭证 -->
                     <template slot-scope="scope">
                         <el-button type="success" size="small" @click="handleInvoiceShow(scope.row)"
@@ -45,6 +51,19 @@
                     <el-button @click="dialogInvoiceVisible = false">{{ $t('common.confirm') }}</el-button> <!-- 确 定 -->
                 </div>
             </el-dialog>
+          <el-dialog width="30%" :title="$t('financial.typeManagement')" :visible.sync="dialogTypeVisible"> <!-- 查看充值凭证 -->
+            <el-form ref="form" :model="form">
+              <el-form-item :label="$t('financial.type')" prop="rechargeType">
+                <el-select v-model="form.rechargeType" clearable filterable style="width: 100%">
+                  <el-option v-for="(item,key) in typeList" :key="key" :label="item" :value="item" />
+                </el-select>
+              </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+              <el-button @click="onCancel">{{ $t('table.cancel') }}<!-- 取 消 --></el-button>
+              <el-button type="primary" @click.native="handleSave">{{ $t('common.save') }}<!-- 发货 --></el-button>
+            </div>
+          </el-dialog>
         </div>
     </div>
 </template>
@@ -55,13 +74,14 @@
     import permission from '@/utils/permission'
     import Pagination from '@/components/Pagination'
     import filterHelper from '@/utils/filterHelper'
-    import { rechargeList, rechargeExport } from '@/api/finance'
+    import {rechargeList, rechargeExport, fetchRechargeTypeList, saveRechargeType} from '@/api/finance'
 
     export default {
         name: 'recharge',
         components: {FilterUser,Pagination},
         mounted () {
             this.getData()
+            this.fetchRechargeTypeList()
         },
 
         data () {
@@ -82,7 +102,13 @@
                 selectedIds:'',
                 dialogInvoiceVisible: false,
                 dialogInvoiceLoading: false,
+                dialogTypeVisible: false,
+                typeList: [],
                 invoiceUrl:'',
+                form: {
+                  id: null,
+                  rechargeType: '',
+                },
                 urlimg:''
             }
         },
@@ -162,6 +188,33 @@
                 this.dialogInvoiceLoading = false
                 this.urlimg = tool.getArImage(row.BANK_PROVE, '/files/');
             },
+            fetchRechargeTypeList() {
+              fetchRechargeTypeList().then(response => {
+                this.typeList = response.data.type
+              })
+            },
+            onCancel() {
+              this.dialogTypeVisible = false
+              this.$refs['form'].resetFields()
+            },
+            handleTypeManagement(row) {
+              console.log(row)
+              this.form.id = row.ID
+              this.form.rechargeType = row.TYPE.value
+              this.dialogTypeVisible = true
+            },
+            handleSave() {
+              saveRechargeType(this.form).then(response => {
+                this.$message({
+                  message: response.data,
+                  type: 'success'
+                })
+                this.getData()
+              }).finally(() => {
+                this.dialogTypeVisible = false
+                this.$refs['form'].resetFields()
+              })
+            },
 
        /* handlestate(){
             this.$router.push({path: `/finance/recharge-status`})