Эх сурвалжийг харах

feat: #重置上传组件 对接提现记录接口

loki 3 жил өмнө
parent
commit
e547c96159

+ 0 - 0
src/api/points/detail.js


+ 8 - 0
src/api/statistics/withdrawalRecord.js

@@ -0,0 +1,8 @@
+import api from '@/utils/request';
+
+export const getList = params =>
+	api.post(`/yxl-back-end/admin/tweet/page`, params);
+export const getItem = ({ id, ...params }) =>
+	api.get(`/yxl-back-end/admin/tweet/${id}`, params);
+export const auditItem = params =>
+	api.post(`/yxl-back-end/admin/tweet/save`, params);

+ 5 - 6
src/components/Upload.vue

@@ -45,7 +45,7 @@
 </template>
 
 <script>
-import { UPLOAD_URL, MINIO_UPLOAD_URL } from '@/const/urlKey';
+import { UPLOAD_URL } from '@/const/urlKey';
 import { getToken } from '@/utils/auth';
 
 export default {
@@ -63,7 +63,7 @@ export default {
       type: String,
       default: ''
     },
-    bucketName: {
+    url: {
       type: String,
       default: ''
     }
@@ -86,11 +86,10 @@ export default {
   computed: {
     newUrl() {
       const params = this.params;
-      const bucketName = this.bucketName;
+      const url = this.url;
       let baseUrl = UPLOAD_URL;
-      console.log(UPLOAD_URL);
-      if (bucketName !== '') {
-        baseUrl = MINIO_UPLOAD_URL(bucketName);
+      if (url !== '') {
+        baseUrl = url;
       }
       if (params === '') {
         return baseUrl;

+ 0 - 3
src/const/urlKey.js

@@ -1,6 +1,3 @@
 export const UPLOAD_URL = `${process.env.VUE_APP_BASE_API}/yxl-back-end/framework/oss/local/upload`;
 
-export const MINIO_UPLOAD_URL = bucketName =>
-	`${process.env.VUE_APP_BASE_API}/yxl-back-end/framework/oss/minio/${bucketName}/upload`;
-
 export const UPLOAD_URL_DEMO = `${process.env.VUE_APP_BASE_API}/file/init/f728a2ca-14fa-40b3-9daf-47622d628849.png`;

+ 8 - 0
src/utils/dialog-helper.js

@@ -9,6 +9,7 @@ import MemberLeverItem from 'views/memberManagement/memberLever/modal/ItemModal.
 import TrendItem from 'views/baseManagement/trending/modal/ItemModal.vue';
 import SceneVerifyItem from 'views/sceneManagement/sceneVerify/modal/ItemModal.vue';
 import SceneItem from 'views/sceneManagement/sceneList/modal/ItemModal.vue';
+import WithdrawalRecordVerifyItem from 'views/statistics/withdrawalRecord/modal/ItemModal.vue';
 
 const modal = (Component, props) => {
   let _component = null;
@@ -93,3 +94,10 @@ let SceneItemModal = data => {
 Vue.prototype.$SceneItemModal = params => {
   SceneItemModal(params);
 };
+
+let WithdrawalRecordVerifyItemModal = data => {
+  modal(WithdrawalRecordVerifyItem, data);
+};
+Vue.prototype.$WithdrawalRecordVerifyItemModal = params => {
+  WithdrawalRecordVerifyItemModal(params);
+};

+ 2 - 1
src/views/pointsManagement/pointsDetail/index.vue

@@ -15,6 +15,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
+import { getList, delItem } from '@/api/points/detail';
 
 export default {
   name: 'PointsDetail',
@@ -23,7 +24,7 @@ export default {
 
   mixins: [
     mxFilterList({
-      // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
   ],
 

+ 75 - 10
src/views/statistics/withdrawalRecord/index.vue

@@ -15,6 +15,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
+import { getList } from '@/api/statistics/withdrawalRecord';
 
 export default {
   name: 'WithdrawalRecord',
@@ -23,7 +24,7 @@ export default {
 
   mixins: [
     mxFilterList({
-      // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
   ],
 
@@ -31,24 +32,88 @@ export default {
     return {
       columns: [
         {
-          key: 'photo',
-          name: '用户名称',
+          key: 'id',
+          name: '提现编号',
           width: '160'
         },
         {
-          key: 'region',
+          key: 'accountName',
+          name: '提现用户',
+          width: '160'
+        },
+        {
+          key: 'phonenumber',
           name: '手机号',
-          width: '180'
+          width: '120'
         },
         {
-          key: 'region',
-          name: '反馈内容',
-          minWidth: '120'
+          key: 'value',
+          name: '提现金额',
+          minWidth: '80',
+          render: (h, { row }) => h('span', `¥${row.value}`)
         },
         {
-          key: 'region',
-          name: '反馈时间',
+          key: 'auditStatus',
+          name: '状态',
+          minWidth: '180',
+          type: 'tag',
+          fetchTagType: val => {
+            switch (val) {
+              case 1:
+                return 'success';
+              case 0:
+                return 'info';
+              case -1:
+                return 'error';
+              default:
+                return 'info';
+            }
+          },
+          tagName: row => {
+            switch (row.auditStatus) {
+              case 1:
+                return '通过';
+              case 0:
+                return '待审核';
+              case -1:
+                return '拒绝';
+              default:
+                return '-';
+            }
+          }
+        },
+        {
+          key: 'createAt',
+          name: '提现时间',
           width: '180'
+        },
+        {
+          key: 'action',
+          name: '操作',
+          width: '120',
+          render: (h, { row }) => {
+            const action = [];
+            row.auditStatus !== 1 &&
+              action.push(
+                h(
+                  'el-button',
+                  {
+                    props: {
+                      type: 'text'
+                    },
+                    on: {
+                      click: () =>
+                        this.$WithdrawalRecordVerifyItemModal({
+                          id: row.id,
+                          auditStatus: row.auditStatus
+                        })
+                    }
+                  },
+                  '编辑'
+                )
+              );
+            return h('div', action);
+          }
         }
       ]
     };

+ 139 - 0
src/views/statistics/withdrawalRecord/modal/ItemModal.vue

@@ -0,0 +1,139 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="modal"
+    width="80%"
+    :close-on-click-modal="false"
+    @close="
+      res => {
+        $emit('cancel');
+      }
+    "
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-form-item label="提现用户"> {{ form.accountName }} </el-form-item>
+      <el-form-item label="提现手机号"> {{ form.phonenumber }} </el-form-item>
+      <el-form-item label="提现金额"> ¥{{ form.value }} </el-form-item>
+      <el-form-item label="提现时间"> {{ form.createAt }} </el-form-item>
+
+      <el-form-item label="审核状态" prop="auditStatus">
+        <el-radio-group v-if="auditStatus !== 1" v-model="form.auditStatus">
+          <el-radio :label="1">通过</el-radio>
+          <el-radio :label="-1">不通过</el-radio>
+        </el-radio-group>
+        <span v-else>{{ form.auditStatus | auditStatusName }}</span>
+      </el-form-item>
+      <el-form-item label="审核备注">
+        <el-input
+          v-if="auditStatus !== 1"
+          v-model="form.auditMsg"
+          type="textarea"
+          :rows="2"
+          placeholder="请输入内容"
+        >
+        </el-input>
+        <span v-else>{{ form.auditMsg }}</span>
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="modal = false">取消</el-button>
+      <el-button type="primary" @click="handleConfirm">确定</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { getItem, auditItem } from '@/api/statistics/withdrawalRecord';
+
+export default {
+  name: 'WithdrawalRecordVerifyItemModal',
+
+  filters: {
+    auditStatusName: function(num) {
+      switch (num) {
+        case 1:
+          return '通过';
+        case 0:
+          return '待审核';
+        case -1:
+          return '拒绝';
+        default:
+          return '-';
+      }
+    }
+  },
+
+  props: {
+    id: {
+      type: String,
+      default: ''
+    },
+    auditStatus: {
+      type: Number,
+      default: 0
+    }
+  },
+
+  data() {
+    return {
+      title: '提现记录详情',
+      modal: true,
+      form: {
+        auditStatus: null,
+        auditMsg: ''
+      },
+      rules: {
+        auditStatus: [
+          { required: true, message: '请选择是否通过', trigger: 'blur' }
+        ]
+      }
+    };
+  },
+
+  watch: {
+    id: {
+      handler(id) {
+        id && this.loadData();
+      },
+      immediate: true
+    }
+  },
+
+  mounted() {},
+
+  methods: {
+    async loadData() {
+      const { success, data, msg } = await getItem({
+        id: this.id
+      });
+      if (success) {
+        this.form = data;
+      }
+    },
+
+    handleConfirm() {
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const params = {
+            auditStatus: this.form.auditStatus,
+            auditMsg: this.form.auditMsg
+          };
+          if (this.id) params.id = this.id;
+          const { success, msg } = await auditItem(params);
+          if (success) {
+            this.$success('保存成功!');
+            this.modal = false;
+            this.$g_emit('scene_reload');
+          }
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.pre-img {
+  height: 80px;
+}
+</style>