From 3c9801025acf79edd3c8dc78451752e0c5d8435f Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Mon, 01 Jun 2026 14:55:42 +0800
Subject: [PATCH] 1

---
 src/views/modules/mining/finance-order.vue |  219 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 190 insertions(+), 29 deletions(-)

diff --git a/src/views/modules/mining/finance-order.vue b/src/views/modules/mining/finance-order.vue
index 61d8568..e9a69cf 100644
--- a/src/views/modules/mining/finance-order.vue
+++ b/src/views/modules/mining/finance-order.vue
@@ -7,15 +7,41 @@
       :option="tableOption"
       @search-change="searchChange"
       @selection-change="selectionChange"
+      :cell-class-name="addClasscolor"
       @on-load="getDataList"
+      @refresh-change="refreshChange"
     >
       <template slot="menuLeft">
+        <template>
+          <div class="allBox"  v-if="isAuth('sys:user:root')">
+            <div class="leDiv speacRead" >操作</div>
+            <div class="leDiv" >
+              <el-date-picker
+                v-model="datetimePick"
+                type="datetime"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                placeholder="选择日期时间"
+              >
+              </el-date-picker>
+            </div>
+            <div class="leDiv">
+              <el-button
+          type="primary"
+          icon="el-icon-edit"
+          size="small"
+          v-if="isAuth('sys:user:root')"
+          @click.stop="addProfit()"
+          >利息重计</el-button
+        >
+            </div>
+          </div>
+        </template>
         <!-- Tag页 -->
         <el-tabs v-model="activeName" @tab-click="handleClick">
-          <el-tab-pane label="全部" name="1"></el-tab-pane>
-          <el-tab-pane label="赎回" name="2"></el-tab-pane>
-          <el-tab-pane label="托管中" name="3"></el-tab-pane>
-          <el-tab-pane label="违约" name="4"></el-tab-pane>
+          <el-tab-pane label="全部" name="3"></el-tab-pane>
+          <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>
         </el-tabs>
       </template>
 
@@ -24,18 +50,10 @@
           type="primary"
           icon="el-icon-edit"
           size="small"
-          v-if="isAuth('sys:role:update')"
-          @click.stop="addOrUpdateHandle(scope.row.roleId)"
-          >编辑</el-button
-        >
-
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="small"
-          v-if="isAuth('sys:role:delete')"
-          @click.stop="deleteHandle(scope.row.roleId)"
-          >删除</el-button
+          @click.stop="withdrawHandle(scope.row)"
+          v-if="isAuth('mining:finance:order:operate') && scope.row.state == '1' "
+          >赎回</el-button
+        
         >
       </template>
     </avue-crud>
@@ -54,9 +72,11 @@
 export default {
   data() {
     return {
+      searchParams:{},
       dataForm: {},
       dataList: [],
-      activeName: "1",
+      datetimePick:'',
+      activeName: "3",
       dataListLoading: false,
       dataListSelections: [],
       addOrUpdateVisible: false,
@@ -72,8 +92,57 @@
     AddOrUpdate,
   },
   methods: {
+    addProfit(){
+      //--
+      this.$confirm(
+        `确认重新计算补上理财收益`,
+        '提示',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }
+      ).then(() => {
+        //
+        this.$http({
+          url: this.$http.adornUrl('/normal/adminFinanceOrderAction!addProfit.action'),
+          method: 'get',
+          params: this.$http.adornParams(Object.assign({
+            system_time:this.datetimePick
+          })),
+        }).then(({data}) => {
+          //
+          if(data.code=="0"){
+            //
+            this.$message({
+              message: '操作成功',
+              type: 'success',
+              duration: 1500,
+              onClose: () => {
+                // this.getDataList(this.page)
+                this.getDataList()
+              }
+            })
+            //
+          }else{
+            this.$message({
+              message: data.msg,
+              type: 'error',
+              duration: 1500,
+              onClose: () => {
+              }
+            })
+          }
+          //
+        })
+        //
+      }).catch((e) => {
+        console.log('e: ', e)
+      })
+      //--
+    },
     // 获取数据列表
-    getDataList(page, params, done) {
+    getDataList(page, done) {
       let obj = {
         current: 1,
         endTime: "",
@@ -86,33 +155,98 @@
 
       this.dataListLoading = true;
       this.$http({
-        url: this.$http.adornUrl("/moneylog/list"),
-        method: "post",
-        data: this.$http.adornData({
+        url: this.$http.adornUrl("/normal/adminFinanceOrderAction!list.action"),
+        method: "get",
+        params: this.$http.adornParams({
           current: this.page.currentPage,
           size: this.page.pageSize,
-          rolename: this.dataForm.rolename,
-          userCode: this.dataForm.userCode,
-          userId: this.dataForm.userId,
-          startTime: this.dataForm.startTime,
-          endTime: this.dataForm.endTime,
+          ...this.searchParams,
+          status_para:this.activeName
         }),
       }).then(({ data }) => {
-        this.dataList = data.data.records;
-        this.page.total = data.total;
+        console.log("data => " + JSON.stringify(data));
+        this.dataList = data.data.page.records;
+        this.page.total = data.data.page.total;
         this.dataListLoading = false;
         if (done) {
           done();
         }
       });
     },
+    addClasscolor({ column, row }) {
+      //表单样式
+      if (
+        (column.property === "rolename" && row.rolename == "MEMBER") ||
+        (column.property === "state" && row.state == "1") ||
+        (column.property === "profit" && row.profit >= 0)
+      ) {
+        return "green";
+      } else if (
+        (column.property === "rolename" && row.rolename == "GUEST") ||
+        (column.property === "state" && row.state == "0")
+      ) {
+        return "yellow";
+      } else if (
+        (column.property === "rolename" && row.rolename == "TEST") ||
+        (column.property === "state" && row.state == "2") ||
+        (column.property === "direction" && row.direction == "sell")||
+        (column.property === "profit" && row.profit < 0)
+      ) {
+        return "red";
+      }
+    },
     // 条件查询
     searchChange(params, done) {
-      this.getDataList(this.page, params, done);
+      this.page.currentPage = 1; // 重置当前页为第一页
+      if(params["rolename"]){
+        params["rolename_para"] = params["rolename"]
+      }
+      this.searchParams = params;
+      this.getDataList(this.page, done);
     },
     // 多选变化
     selectionChange(val) {
       this.dataListSelections = val;
+    },
+    withdrawHandle(row){
+      //
+      this.$confirm(`是否确认赎回?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$http({
+            url: this.$http.adornUrl("/normal/adminFinanceOrderAction!close.action"),
+            method: "get",
+            params: this.$http.adornParams(
+              Object.assign({
+                id: row.id,
+              }),
+              false
+            ),
+          }).then(({ data }) => {
+            if (data.code == 0) {
+              this.$message({
+                message: "操作成功",
+                type: "success",
+                duration: 1500,
+                onClose: () => {
+                  this.getDataList();
+                },
+              });
+            } else {
+              this.$message({
+                message: data.msg,
+                type: "error",
+                duration: 1500,
+                onClose: () => {},
+              });
+            }
+          });
+        })
+        .catch(() => {});
+      //
     },
     // 新增 / 修改
     addOrUpdateHandle(id) {
@@ -123,6 +257,7 @@
     },
     handleClick(tab, event) {
       console.log(tab, event);
+      this.getDataList();
     },
     // 删除
     deleteHandle(id) {
@@ -154,6 +289,32 @@
         })
         .catch(() => {});
     },
+    // 刷新回调用
+    refreshChange () {
+      console.log("refreshChange")
+      this.page = this.$refs.crud.$refs.tablePage.defaultPage
+      this.getDataList(this.page)
+      this.dataListSelections = []
+      this.$refs.crud.selectClear()
+    },
   },
 };
 </script>
+<style scoped>
+.mod-role {
+}
+.allBox {
+  overflow: hidden;
+  height: 40px;
+  line-height: 40px;
+  margin: 30px 0;
+}
+.leDiv{
+  float: left;
+  margin-left: 20px;
+  line-height: 40px;
+}
+.speacRead{
+  font-weight: 500;
+}
+</style>

--
Gitblit v1.9.3