Browse Source

退款测试完成

soft5566 3 năm trước cách đây
mục cha
commit
d151766b08
2 tập tin đã thay đổi với 15 bổ sung11 xóa
  1. 4 2
      src/components/balance/Balance.vue
  2. 11 9
      src/components/tuikuan/tuikuan.vue

+ 4 - 2
src/components/balance/Balance.vue

@@ -99,6 +99,7 @@
 </template>
 
 <script>
+import { Form } from 'element-ui';
 	export default {
 		data() {
 			return {
@@ -157,10 +158,10 @@
 				var _this = this;
 				let formData = new FormData();
 				if (_this.tkform.card_number != '' && typeof _this.tkform.card_number != 'undefined') {
-					formData.card_number = this.tkform.card_number;
+					formData.append('card_number', this.tkform.card_number);
 				}
 				if (_this.tkform.amount != '' && typeof _this.tkform.amount != 'undefined') {
-					formData.amount = this.tkform.amount
+					formData.append('amount', this.tkform.amount);
 				}
 
 				if (_this.tkform.amount < 0.01 || _this.tkform.amount > 1000) {
@@ -173,6 +174,7 @@
 						// console.log(res.data);
 						if (res.data.code == 200) {
 							_this.$message.success(res.data.message);
+							_this.tkdialogFormVisible = false;
 						} else {
 							_this.$message.error(res.data.message);
 						}

+ 11 - 9
src/components/tuikuan/tuikuan.vue

@@ -89,7 +89,7 @@
 			var level = sessionStorage.getItem('level');
 			if (level === '2') {
 				// 获取总金额
-				this.get_total_amount();
+				this.get_total_amount('init');
 				// 获取余额列表
 				let params = {
 					page: this.currentPage,
@@ -103,23 +103,25 @@
 			}
 		},
 		methods: {
-			get_total_amount() {
+			get_total_amount(param) {
 				var _this = this;
 				let formData = new FormData();
-				if (typeof _this.startTime != 'undefined' && _this.startTime != '') {
-					formData.append("begin_time", _this.startTime);
-				}
-				if (typeof _this.endTime != 'undefined' && _this.endTime != '') {
-					formData.append("end_time", _this.endTime);
+				if (param != 'init') {
+					if (typeof _this.startTime != 'undefined' && _this.startTime != '') {
+						formData.append("begin_time", _this.startTime);
+					}
+					if (typeof _this.endTime != 'undefined' && _this.endTime != '') {
+						formData.append("end_time", _this.endTime);
+					}
 				}
 				if (_this.searchformUser != '' && typeof _this.searchformUser != 'undefined') {
-					params.user_name = this.searchformUser
+					formData.append('user_name', this.searchformUser);
 				}
 				this.$axios.post('/jxch-smartmp/HotWaters/waterrefund_total.action', formData)
 					.then(res => {
 						// console.log(res.data);
 						if (res.data.code == 200) {
-							_this.amount = res.data.data;
+							_this.amount = res.data.data.toFixed(2);
 						} else {
 							_this.$message.error(res.data.message);
 						}