Explorar el Código

1757会员端,充值提交后跳转到充值列表

theo hace 3 años
padre
commit
8e20c0cf0b
Se han modificado 1 ficheros con 53 adiciones y 64 borrados
  1. 53 64
      frontendEle/src/views/finance/recharge-add.vue

+ 53 - 64
frontendEle/src/views/finance/recharge-add.vue

@@ -28,71 +28,60 @@
 </template>
 
 <script>
-    import Vue from 'vue'
-    import network from '@/utils/network'
-    import baseInfo from '@/utils/baseInfo'
-    import store from '@/utils/vuexStore'
-    export default {
-        name: "recharge-add",
-        mounted() {
-            this.getData()
-        },
-        data(){
-            return{
-
-                form:{
-                    applyAmount:'',
-                    bankNo:'',
-                    bankAddress:'',
-                    openBank:'',
-
-
-                },
-                loading: false,
-                allOpenBank: null,
-                submitButtonStat: false
-            }
-        },
-        methods: {
-            getData () {
-
-                network.getData(`/finance/recharge-add`).then(response => {
-                    console.log(response)
-                    this.loading = false;
-                    this.allOpenBank = response.allOpenBank;
-
-                }).catch(() => {
-                });
-
-            },
-            onSubmits() {
-                this.submitButtonStat = true
-                let path = '/finance/recharge-add'
-                let postData = {
-                    openBank: this.form.openBank,
-                    bankAddress: this.form.bankAddress,
-                    bankNo: this.form.bankNo,
-                    applyAmount: this.form.applyAmount,
-
-
-                };
-
-                return network.postData(path, postData).then(response => {
-                    console.log(response);
-                    this.$message({
-                        message: response,
-                        type: 'success'
-                    })
-                    this.submitButtonStat = false
-                    this.$router.go(-1)
-                }).catch(() => {
-                    this.submitButtonStat = false
-                })
-            },
-        }
-
-
+import Vue from 'vue'
+import network from '@/utils/network'
+import baseInfo from '@/utils/baseInfo'
+import store from '@/utils/vuexStore'
+export default {
+  name: "recharge-add",
+  mounted() {
+    this.getData()
+  },
+  data(){
+    return{
+      form:{
+        applyAmount: '',
+        bankNo: '',
+        bankAddress: '',
+        openBank: '',
+      },
+      loading: false,
+      allOpenBank: null,
+      submitButtonStat: false
     }
+  },
+  methods: {
+    getData () {
+      network.getData(`/finance/recharge-add`).then(response => {
+        console.log(response)
+        this.loading = false;
+        this.allOpenBank = response.allOpenBank;
+      }).catch(() => {
+      });
+    },
+    onSubmits() {
+      this.submitButtonStat = true
+      let path = '/finance/recharge-add'
+      let postData = {
+        openBank: this.form.openBank,
+        bankAddress: this.form.bankAddress,
+        bankNo: this.form.bankNo,
+        applyAmount: this.form.applyAmount,
+      };
+      return network.postData(path, postData).then(response => {
+        console.log(response);
+        this.$message({
+          message: response,
+          type: 'success'
+        })
+        this.submitButtonStat = false
+        this.$router.push({path: `/finance/recharge`})
+      }).catch(() => {
+        this.submitButtonStat = false
+      })
+    },
+  }
+}
 </script>
 
 <style scoped>