Browse Source

完成提现申请管理

wzy 1 year ago
parent
commit
4583fd7e66
2 changed files with 119 additions and 48 deletions
  1. 1 1
      .env.development
  2. 118 47
      src/views/finance/withdrawal/index.vue

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ ENV = 'development'
 VUE_APP_BASE_API = '/dev-api'
 
 # 开发环境
-# VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9003'
+VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9003'
 # 演示环境
 # VUE_APP_DOMAIN_PREFIX = 'http://192.168.0.91:9003'
 VUE_APP_DOMAIN_PREFIX = '/api'

+ 118 - 47
src/views/finance/withdrawal/index.vue

@@ -28,10 +28,8 @@
     </div>
     <!-- 表格 -->
     <div class="tableBox">
-      <el-table
-        ref="multipleTable" :data="tableData" border
-        :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
-      >
+      <el-table ref="multipleTable" :data="tableData" border
+        :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%">
         <el-table-column label="店铺名称" width="220">
           <template slot-scope="scope">{{ scope.row.shopName }}</template>
         </el-table-column>
@@ -47,25 +45,21 @@
           <template slot-scope="scope">
             <div class="btnList">
               <el-button type="text" @click="seeMore(scope.row)">查看</el-button>
-              <el-button v-if="scope.row.state == 0" type="text" @click="desh(scope.row)">处理</el-button>
+              <el-button v-if="scope.row.state == 0|| scope.row.state == 2" type="text" @click="desh(scope.row)">处理</el-button>
             </div>
           </template>
         </el-table-column>
       </el-table>
       <div class="fenye">
-        <el-pagination
-          :current-page="currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="10"
+        <el-pagination :current-page="currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="10"
           layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        />
+          @current-change="handleCurrentChange" />
       </div>
     </div>
     <!-- *************对话框开始************* -->
     <!-- 提现申请查询 -->
-    <el-dialog
-      :title="useState ? '查看' : '提现'" :visible.sync="addFormDialog" width="800px" center
-      :close-on-click-modal="false"
-    >
+    <el-dialog :title="useState ? '查看' : '提现'" :visible.sync="addFormDialog" width="800px" center
+      :close-on-click-modal="false" @close="closeDialog">
       <div class="seeModel">
         <el-descriptions class="margin-top" title="" :column="2" border>
           <el-descriptions-item>
@@ -119,9 +113,22 @@
         </el-descriptions>
       </div>
       <div v-if="!useState" class="titleLIne">* 请确认您已转账成功,再点击确认</div>
+      <template>
+        <el-input type="textarea" autosize placeholder="请输入拒绝打款理由" v-model="cause" v-show="refuse == 1">
+        </el-input>
+      </template>
+      <template>
+        <div class="radio-list" v-show="handle == 1">
+          <el-radio v-model="type" label="1" border>通联</el-radio>
+          <el-radio v-model="type" label="2" border>线下</el-radio>
+        </div>
+      </template>
+
       <span slot="footer" class="dialog-footer">
         <el-button @click="addFormDialog = false">取 消</el-button>
-        <el-button v-if="!useState" type="primary" @click="handle_save">确认打款</el-button>
+        <!-- <el-button v-if="!useState" type="danger" @click="refuse_save">{{ refuse == 0 ? "拒绝打款" : "确认拒绝打款" }}</el-button> -->
+        <el-button v-if="!useState" type="danger" @click="refuse_save">{{ refuse == 0 ? "拒绝打款" : "确认拒绝打款" }}</el-button>
+        <el-button v-if="!useState" type="primary" @click="handle_save">{{ handle == 0 ? "确认用户信息" : "确认打款" }}</el-button>
       </span>
     </el-dialog>
   </div>
@@ -156,7 +163,13 @@ export default {
       currentPage: 1,
       addFormDialog: false,
       useState: 1,
-      withDetails: ''
+      withDetails: '',
+      refuse: 0,
+      handle: 0,
+      //  拒绝理由
+      cause: "",
+      //  支付方式选择
+      type: "1"
     }
   },
   // 监听属性 类似于data概念
@@ -211,28 +224,82 @@ export default {
       this.useState = 0
       this.addFormDialog = true
       const res = await withdrawalGetById({ withdrawalId: row.withdrawalId })
+      if(res.data.state == 2){
+        this.handle = 1
+      }else if(res.data.state == 3){
+        this.refuse = 1
+      }
       this.withDetails = res.data
       this.withDetails.bankCard = hidden(this.withDetails.bankCard, 3, 3)
       this.withDetails.collectionName = hidden(this.withDetails.collectionName, 1, 1)
     },
+    // 初始化查询所有数据
+    async getAll(formInline) {
+      const res = await withdrawalGetAll(formInline)
+      this.tableData = res.data.list
+      this.total = res.data.total
+    },
+    //  拒绝打款
+    async refuse_save() {
+      if (this.refuse == 0) {
+        this.refuse = 1;
+        this.$message.warning('请填写理由并确定拒绝打款!!!');
+      }else if(this.refuse == 1){
+        if(this.cause == "") {
+          this.$message.error('拒绝理由不能为空');
+        }
+        const res = await withdrawalHandle({
+          withdrawalId: this.withDetails.withdrawalId,
+          state:"3",
+          audit:2,
+          cause:this.cause
+        })
+        if(res.code == ""){
+          this.$message.success("成功拒绝打款!!!")
+        }
+        this.addFormDialog = false
+        this.getAll(this.formInline)
+      }
+    },
+    // 确认打款
     async handle_save() {
-      const res = await withdrawalHandle({
-        withdrawalId: this.withDetails.withdrawalId
-      })
-      if (res.code === '') {
-        this.$message({
-          message: '新增成功',
-          type: 'success'
+      if (this.handle == 0) {
+        this.handle = 1
+        const res = await withdrawalHandle({
+          withdrawalId: this.withDetails.withdrawalId,
+          state:"2",
+          audit:1
+        })
+      }else if(this.handle == 1){
+        const res = await withdrawalHandle({
+          withdrawalId: this.withDetails.withdrawalId,
+          state:"2",
+          audit:1,
+          type:this.type
         })
+        if(res.code== ""){
+          this.$message.success("打款成功!!!")
+        }
         this.addFormDialog = false
         this.getAll(this.formInline)
       }
+      // const res = await withdrawalHandle({
+      //   withdrawalId: this.withDetails.withdrawalId
+      // })
+      // if (res.code === '') {
+      //   this.$message({
+      //     message: '新增成功',
+      //     type: 'success'
+      //   })
+      //   this.addFormDialog = false
+      //   this.getAll(this.formInline)
+      // }
     },
-    // 初始化查询所有数据
-    async getAll(formInline) {
-      const res = await withdrawalGetAll(formInline)
-      this.tableData = res.data.list
-      this.total = res.data.total
+    // 弹窗关闭时间
+    closeDialog() {
+      this.refuse = 0
+      this.handle = 0
+      this.cause = ""
     }
   }
 }
@@ -243,37 +310,41 @@ export default {
 @import url("../../../styles/elDialog.scss");
 
 .pdl {
-	padding: 20px;
+  padding: 20px;
 }
 
 .seeModel {
-	padding: 20px;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-	color: #000;
-	font-size: 16px;
+  padding: 20px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  color: #000;
+  font-size: 16px;
 
-	.leftBox {
-		padding: 20px;
-	}
+  .leftBox {
+    padding: 20px;
+  }
 
-	.rightBox {
-		padding: 20px;
-	}
+  .rightBox {
+    padding: 20px;
+  }
 
-	.line {
-		padding: 10px;
-	}
+  .line {
+    padding: 10px;
+  }
 }
 
 .titleLIne {
-	color: red;
-	font-size: 16px;
-	text-align: center;
+  color: red;
+  font-size: 16px;
+  text-align: center;
+}
+
+.radio-list {
+  margin-top: 30px;
 }
 
 .el-descriptions {
-	width: 100%;
+  width: 100%;
 }
 </style>