From e1e694369dabf557615669ce2f71e9af70277ff6 Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Wed, 07 Jan 2026 13:56:32 +0800
Subject: [PATCH] 1

---
 src/views/modules/mining/loan-order.vue |  344 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 170 insertions(+), 174 deletions(-)

diff --git a/src/views/modules/mining/loan-order.vue b/src/views/modules/mining/loan-order.vue
index 57fa058..9ca7e35 100644
--- a/src/views/modules/mining/loan-order.vue
+++ b/src/views/modules/mining/loan-order.vue
@@ -1,19 +1,11 @@
 <template>
   <div class="mod-role">
-    <avue-crud
-      ref="crud"
-      :page.sync="page"
-      :data="dataList"
-      :option="tableOption"
-      @search-change="searchChange"
-      @selection-change="selectionChange"
-      @on-load="getDataList"
-      :cell-class-name="addClasscolor"
-      @refresh-change="refreshChange"
-    >
+    <avue-crud ref="crud" :page.sync="page" :data="dataList" :option="tableOption" @search-change="searchChange"
+      @selection-change="selectionChange" @on-load="getDataList" :cell-class-name="addClasscolor"
+      @refresh-change="refreshChange">
       <template slot="menuLeft">
-          <!-- Tag页 -->
-          <el-tabs v-model="activeName" @tab-click="handleClick">
+        <!-- Tag页 -->
+        <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="全部" name=0></el-tab-pane>
           <el-tab-pane label="未审" name=1></el-tab-pane>
           <el-tab-pane label="通过" name=2></el-tab-pane>
@@ -36,57 +28,47 @@
         <span>{{ scope.row.repayment[1] }}</span>
       </template>
 
+      <template slot-scope="scope" slot="dailyRate">
+        <span>{{ scope.row.dailyRate * scope.row.quota }}</span>
+      </template>
+
       <template slot-scope="scope" slot="lendingInstitution">
         <span>{{ scope.row.lendingInstitution[1] }}</span>
       </template>
 
       <template slot-scope="scope" slot="menu">
 
-        <el-select v-if="scope.row.state[0]==1 && isAuth('mining:loan-order:operate')"
-          v-model="scope.row.select"
-          class="celectSpeac"
-          clearable
-          placeholder="操作"
-          @change="
+        <el-select v-if="scope.row.state[0] == 1" v-model="scope.row.select" class="celectSpeac" clearable
+          placeholder="操作" @change="
             changeSelet(
               scope.row.userId,
               scope.row.select,
               scope.row.userCode,
               scope.row
             )
-          "
-        >
-          <el-option
-            v-for="item in options"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
+            ">
+          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
           </el-option>
         </el-select>
 
-        <el-select v-if="scope.row.state[0]==2 && isAuth('mining:loan-order:operate')"
-          v-model="scope.row.select"
-          class="celectSpeac"
-          clearable
-          placeholder="操作"
-          @change="
+        <el-select v-if="scope.row.state[0] == 2" v-model="scope.row.select" class="celectSpeac" clearable
+          placeholder="操作" @change="
             changeSelet(
               scope.row.userId,
               scope.row.select,
               scope.row.userCode,
               scope.row
             )
-          "
-        >
-          <el-option
-            v-for="item in options2"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
+            ">
+          <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
           </el-option>
         </el-select>
+
+        <el-button v-if="scope.row.state[0] == 6" type="primary" size="small" style="margin-bottom: 10px;"
+          @click.stop="repaymentApprove(scope.row)">还款通过</el-button>
+
+        <el-button v-if="scope.row.state[0] == 6" type="danger" size="small" style="margin-left: 0px;"
+          @click.stop="repaymentReject(scope.row)">还款拒绝</el-button>
 
         <!-- <el-button
           type="primary"
@@ -98,34 +80,13 @@
       </template>
     </avue-crud>
     <!-- 弹窗, 新增 / 修改 -->
-    <add-or-update
-      v-if="addOrUpdateVisible"
-      ref="addOrUpdate"
-      @refreshDataList="getDataList"
-    ></add-or-update>
+    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
 
     <!-- 确认弹窗-start -->
-    <el-dialog
-      title="驳回原因"
-      :visible.sync="dialogFormVisible"
-      :append-to-body="true"
-    >
-      <el-form
-        :model="dataForm2"
-        ref="dataForm2"
-        @keyup.enter.native="dataFormSubmit()"
-        label-width="80px"
-      >
-        <el-form-item
-          label="驳回原因"
-          :label-width="formLabelWidth"
-          prop="reason"
-        >
-          <el-input
-            v-model="dataForm2.reason"
-            placeholder="请输入驳回原因"
-            autocomplete="off"
-          ></el-input>
+    <el-dialog title="驳回原因" :visible.sync="dialogFormVisible" :append-to-body="true">
+      <el-form :model="dataForm2" ref="dataForm2" @keyup.enter.native="dataFormSubmit()" label-width="80px">
+        <el-form-item label="驳回原因" :label-width="formLabelWidth" prop="reason">
+          <el-input v-model="dataForm2.reason" placeholder="请输入驳回原因" autocomplete="off"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -141,13 +102,14 @@
 <script>
 import { tableOption } from "@/crud/mining/loan-order";
 import AddOrUpdate from "./loan-add-or-update";
+import { isAuth } from '@/utils'
 export default {
   data() {
     return {
-      searchParams:{},
+      searchParams: {},
       dataForm: {},
       dataList: [],
-      datetimePick:'',
+      datetimePick: '',
       activeName: 0,
       dataListLoading: false,
       dataListSelections: [],
@@ -185,13 +147,14 @@
       dialogFormVisible: false,
       dataForm2: {},
       formLabelWidth: "120px",
-      row:{},
+      row: {},
     };
   },
   components: {
     AddOrUpdate,
   },
   methods: {
+    isAuth,
     addClasscolor({ column, row }) {
       //表单样式
       if (
@@ -210,7 +173,7 @@
       ) {
         return "red";
       } else if (
-        (column.property === "rolename" && row.rolename == "GUEST") || 
+        (column.property === "rolename" && row.rolename == "GUEST") ||
         (column.property === "state" && row.state == "submitted")
       ) {
         return "yellow";
@@ -237,7 +200,7 @@
           current: this.page.currentPage,
           size: this.page.pageSize,
           ...this.searchParams,
-          status:this.activeName
+          status: this.activeName
         }),
       }).then(({ data }) => {
         console.log("data => " + JSON.stringify(data));
@@ -275,8 +238,8 @@
       var ids = id
         ? [id]
         : this.dataListSelections.map((item) => {
-            return item.roleId;
-          });
+          return item.roleId;
+        });
       this.$confirm(`确定进行[${id ? "删除" : "批量删除"}]操作?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -298,150 +261,183 @@
             });
           });
         })
-        .catch(() => {});
+        .catch(() => { });
     },
     changeSelet(uid, val, userCode, row) {
       this.row = row;
       console.log("row = " + JSON.stringify(row));
       if (val) {
-  
         // let m = this.options[val - 1].label; //弹窗标题
         console.log("changeSelet = " + val);
-        switch(val)
-        {
-        case "1": //修改
-          {
-            this.addOrUpdateHandle(row);
-          }    
-          break;
-        case "2": //通过
-          {
-            console.log("AAA-changeSelet = " + val);
-            //
-            this.$confirm('', '是否确认通过?', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-            }).then(() => {
-              //https://hajhiug.com/384732342/normal/loanadmin!change.action
-              //reason=&orderId=202cc6a1d6173c1ebd4abdfb00b5462e&statusStr=2
-              console.log("/normal/loanadmin!change.action");
-              this.$http({
-                url: this.$http.adornUrl("/normal/loanadmin!change.action"),
-                method: "get",
-                params: this.$http.adornParams(Object.assign({
-                  reason: "", 
-                  orderId: row.uuid,
-                  statusStr: 2
-                })),
-              }).then(({ data }) => {
-                console.log("data => " + JSON.stringify(data));
-                this.getDataList();
-                if (data.code == 0) {
-                  this.dataForm = data.data;
-                }
+        switch (val) {
+          case "1": //修改
+            {
+              this.addOrUpdateHandle(row);
+            }
+            break;
+          case "2": //通过
+            {
+              console.log("AAA-changeSelet = " + val);
+              //
+              this.$confirm('', '是否确认通过?', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }).then(() => {
+                //https://hajhiug.com/384732342/normal/loanadmin!change.action
+                //reason=&orderId=202cc6a1d6173c1ebd4abdfb00b5462e&statusStr=2
+                console.log("/normal/loanadmin!change.action");
+                this.$http({
+                  url: this.$http.adornUrl("/normal/loanadmin!change.action"),
+                  method: "get",
+                  params: this.$http.adornParams(Object.assign({
+                    reason: "",
+                    orderId: row.uuid,
+                    statusStr: 2
+                  })),
+                }).then(({ data }) => {
+                  console.log("data => " + JSON.stringify(data));
+                  this.getDataList();
+                  if (data.code == 0) {
+                    this.dataForm = data.data;
+                  }
+                });
+
+              }).catch((e) => {
+                console.log("/normal/loanadmin!change.action fail " + JSON.stringify(e));
               });
-              
-            }).catch((e) => {
-              console.log("/normal/loanadmin!change.action fail " + JSON.stringify(e));
-            });
-            //
-          }    
-          break;
-        case "3": //驳回
-          {
-            this.dialogFormVisible = true;
-          }    
-          break;
-        case "4": //还款
-          {
-            //
-            this.$confirm('', '是否确认还款?', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning'
-            }).then(() => {
-              //https://hajhiug.com/384732342/normal/loanadmin!change.action
-              //reason=&orderId=202cc6a1d6173c1ebd4abdfb00b5462e&statusStr=2
-              console.log("/normal/loanadmin!change.action");
-              this.$http({
-                url: this.$http.adornUrl("/normal/loanadmin!change.action"),
-                method: "get",
-                params: this.$http.adornParams(Object.assign({
-                  reason: "", 
-                  orderId: row.uuid,
-                  statusStr: 5
-                })),
-              }).then(({ data }) => {
-                console.log("data => " + JSON.stringify(data));
-                this.getDataList();
-                if (data.code == 0) {
-                  this.dataForm = data.data;
-                }
+              //
+            }
+            break;
+          case "3": //驳回
+            {
+              this.dialogFormVisible = true;
+            }
+            break;
+          case "4": //还款
+            {
+              //
+              this.$confirm('', '是否确认还款?', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              }).then(() => {
+                console.log("/normal/loanadmin!change.action");
+                this.$http({
+                  url: this.$http.adornUrl("/normal/loanadmin!change.action"),
+                  method: "get",
+                  params: this.$http.adornParams(Object.assign({
+                    reason: "",
+                    orderId: row.uuid,
+                    statusStr: 5
+                  })),
+                }).then(({ data }) => {
+                  console.log("data => " + JSON.stringify(data));
+                  this.getDataList();
+                  if (data.code == 0) {
+                    this.dataForm = data.data;
+                  }
+                });
+
+              }).catch((e) => {
+                console.log("/normal/loanadmin!change.action fail " + JSON.stringify(e));
               });
-              
-            }).catch((e) => {
-              console.log("/normal/loanadmin!change.action fail " + JSON.stringify(e));
-            });
-            //
-          }    
-          break;
+              //
+            }
+            break;
         }
         row.select = "";
       }
     },
-    dataFormSubmit(){
+    dataFormSubmit() {
       //驳回原因
       //
       this.$http({
-          url: this.$http.adornUrl("/normal/loanadmin!change.action"),
-          method: "get",
-          params: this.$http.adornParams(Object.assign({
-            reason: this.dataForm2.reason, 
-            orderId: this.row.uuid,
-            statusStr: 3
-          })),
-        }).then(({ data }) => {
-          console.log("data => " + JSON.stringify(data));
-          this.getDataList();
-          this.dialogFormVisible = false;
-          // if (data.code == 0) {
-          //   this.dataForm = data.data;
-          // }
-        });
+        url: this.$http.adornUrl("/normal/loanadmin!change.action"),
+        method: "get",
+        params: this.$http.adornParams(Object.assign({
+          reason: this.dataForm2.reason,
+          orderId: this.row.uuid,
+          statusStr: 3
+        })),
+      }).then(({ data }) => {
+        console.log("data => " + JSON.stringify(data));
+        this.getDataList();
+        this.dialogFormVisible = false;
+        // if (data.code == 0) {
+        //   this.dataForm = data.data;
+        // }
+      });
       //
     },
     // 刷新回调用
-    refreshChange () {
+    refreshChange() {
       console.log("refreshChange")
       this.page = this.$refs.crud.$refs.tablePage.defaultPage
       this.getDataList(this.page)
       this.dataListSelections = []
       this.$refs.crud.selectClear()
     },
+    // 还款操作(通过/拒绝)
+    handleRepayment(row, statusStr, message) {
+      this.$confirm('', message, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log("/normal/loanadmin!change.action - " + message);
+        this.$http({
+          url: this.$http.adornUrl("/normal/loanadmin!change.action"),
+          method: "get",
+          params: this.$http.adornParams(Object.assign({
+            reason: "",
+            orderId: row.uuid,
+            statusStr: statusStr
+          })),
+        }).then(({ data }) => {
+          console.log("data => " + JSON.stringify(data));
+          this.getDataList();
+          if (data.code == 0) {
+            this.dataForm = data.data;
+          }
+        });
+      }).catch((e) => {
+        console.log("/normal/loanadmin!change.action fail " + JSON.stringify(e));
+      });
+    },
+    // 还款通过
+    repaymentApprove(row) {
+      this.handleRepayment(row, 5, '是否确认还款通过?');
+    },
+    // 还款拒绝
+    repaymentReject(row) {
+      this.handleRepayment(row, 7, '是否确认还款拒绝?');
+    },
   },
 };
 </script>
 <style scoped>
-.mod-role {
-}
 .allBox {
   overflow: hidden;
   height: 40px;
   line-height: 40px;
   margin: 30px 0;
 }
-.leDiv{
+
+.leDiv {
   float: left;
   margin-left: 20px;
   line-height: 40px;
 }
-.speacRead{
+
+.speacRead {
   font-weight: 500;
 }
+
 ::v-deep .celectSpeac .el-input__inner {
   background: #1c4efa !important;
 }
+
 ::v-deep .celectSpeac .el-input__inner::placeholder {
   color: #fff;
 }

--
Gitblit v1.9.3