From bfd4f0e5ac1c8da2b997c2fee7738e9f4bb976da Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Wed, 10 Jul 2024 17:47:15 +0800
Subject: [PATCH] 涨停板审核

---
 src/views/userlist/components/editCapitaluserdialog.vue |   88 ++++++++++++++++++++++++++------------------
 1 files changed, 52 insertions(+), 36 deletions(-)

diff --git a/src/views/userlist/components/editCapitaluserdialog.vue b/src/views/userlist/components/editCapitaluserdialog.vue
index 5efa897..6f06203 100644
--- a/src/views/userlist/components/editCapitaluserdialog.vue
+++ b/src/views/userlist/components/editCapitaluserdialog.vue
@@ -25,10 +25,13 @@
           >
             <a-select-option value="1">扣款</a-select-option>
             <a-select-option value="0">入款</a-select-option>
+            <a-select-option value="2">充值</a-select-option>
+            <!-- <a-select-option value="3">提币</a-select-option> -->
           </a-select>
         </a-form-item>
         <a-form-item label="账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
           <a-select
+            disabled
             placeholder="请选择账户"
             v-decorator="['accectType', { rules: [{ required: true, message: '请选择账户' }] }]"
           >
@@ -47,82 +50,95 @@
 export default {
   components: {},
   filters: {
-    formatDate (value) {
-      switch (value.accectType) {
-        case 'US':
-          return `美元(${value.symbol} ${value.availableBalance})`
-        case 'MAS':
-          return `马来西亚(${value.symbol} ${value.availableBalance})`
+    formatDate(value) {
+      // switch (value.accectType) {
+      //   case 'US':
+      //     return `美元(${value.symbol} ${value.availableBalance})`
+      //   case 'MAS':
+      //     return `马来西亚(${value.symbol} ${value.availableBalance})`
+      //   case 'HK':
+      //     return `香港(${value.symbol} ${value.availableBalance})`
+      //   case 'IN':
+      //     return `印度(${value.symbol} ${value.availableBalance})`
 
-        default:
-          break
-      }
-    }
+      //   default:
+      //     break
+      // }
+      return `印度(${value.symbol} ${value.availableBalance})`
+    },
   },
   props: {
     getinit: {
       type: Function,
-      default: function () {}
+      default: function () {},
     },
     activeArr: {
       type: Array,
-      default: []
-    }
+      default: [],
+    },
   },
-  data () {
+  data() {
     return {
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 7 }
+        sm: { span: 7 },
       },
       wrapperCol: {
         xs: { span: 24 },
-        sm: { span: 13 }
+        sm: { span: 13 },
       },
       editUserform: this.$form.createForm(this),
       editUserdialog: false,
       editUserDialogloading: false,
-      fields: ['amt', 'direction', 'userId'],
-      currentDetails: {}
+      fields: ['amt', 'direction', 'userId', 'accectType'],
+      currentDetails: {},
     }
   },
   methods: {
-    getEditorder (val) {
+    getEditorder(val) {
+      val.accectType = 'IN'
       this.currentDetails = val
       this.editUserdialog = true
       this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
       this.editUserform.setFieldsValue(pick(val, this.fields))
       this.editUserform.setFieldsValue(pick({ userId: val.id }, this.fields))
     },
-    CanceleditUserdialog () {
+    CanceleditUserdialog() {
       this.editUserdialog = false
       const form = this.$refs.editUserform.form
       form.resetFields()
     },
-    OkeditUserdialog () {
+    OkeditUserdialog() {
       const form = this.$refs.editUserform.form
       form.validateFields((errors, values) => {
-        console.log(values, 'from')
+        console.log(values, 'from', !errors)
         const arr = this.activeArr.filter((item) => item.accectType === values.accectType)
-        const amt = values.direction == '1' ? 0 - Number(values.amt) : Number(values.amt)
+        const amt = values.amt
+
+        console.log(arr)
         if (!errors) {
           this.editUserDialogloading = true
-          updateMoney({ id: arr[0].id, amt: amt }).then((res) => {
-            if (res.status == 0) {
-              this.editUserdialog = false
-              this.$message.success({ content: res.msg, duration: 2 })
-              form.resetFields()
-              this.getinit()
-            } else {
-              this.$message.error({ content: res.msg || '划转成功' })
-            }
-            this.editUserDialogloading = false
-          })
+          console.log({ id: arr[0].id, amt: amt, type: this.direction })
+          updateMoney({ id: arr[0].id, amt: amt, type: values.direction })
+            .then((res) => {
+              if (res.status == 0) {
+                this.editUserdialog = false
+                this.$message.success(res.msg)
+                form.resetFields()
+                this.getinit()
+              } else {
+                this.$message.error({ content: res.msg || '划转成功' })
+              }
+              this.editUserDialogloading = false
+            })
+            .catch((res) => {
+              this.editUserDialogloading = false
+            })
         } else {
           console.log(3333)
         }
       })
-    }
-  }
+    },
+  },
 }
 </script>

--
Gitblit v1.9.3