soft5566 преди 3 години
родител
ревизия
b9da769052
променени са 2 файла, в които са добавени 24 реда и са изтрити 9 реда
  1. 18 4
      src/components/balance/Balance.vue
  2. 6 5
      src/components/tuikuan/tuikuan.vue

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

@@ -28,8 +28,9 @@
 					<el-table-column prop="user_name" label="姓名" align="center" width="400"></el-table-column>
 					<el-table-column prop="balance" label="余额(元)" align="right" width="180" :formatter="formatBalance" show-overflow-tooltip></el-table-column>
 					<el-table-column label="操作" align="center" v-if="userLevel == 2">
-						<el-button type="text" slot-scope="scope" @click="handleTkDialog(scope.$index, scope.row)"  v-if="scope.row.balance > 0.01">
-							<span style="color: #ffffff; display: inline-block; background-color:#ff0000; padding: 5px 8px; border-radius: 5px; margin-top: -10px;">退款</span>
+						<el-button type="text" slot-scope="scope" @click="handleTkDialog(scope.$index, scope.row)" v-if="scope.row.balance > 0.01">
+							<span
+								style="color: #ffffff; display: inline-block; background-color:#ff0000; padding: 5px 8px; border-radius: 5px; margin-top: -10px;">退款</span>
 						</el-button>
 					</el-table-column>
 					<el-table-column label="操作" align="center">
@@ -99,7 +100,9 @@
 </template>
 
 <script>
-import { Form } from 'element-ui';
+	import {
+		Form
+	} from 'element-ui';
 	export default {
 		data() {
 			return {
@@ -156,6 +159,12 @@ import { Form } from 'element-ui';
 			handleDialogTk(param) {
 				// console.log(param);
 				var _this = this;
+				const loading = this.$loading({
+					lock: true,
+					text: '在等待服务器响应...',
+					spinner: 'el-icon-loading',
+					background: 'rgba(0, 0, 0, 0.7)'
+				});
 				let formData = new FormData();
 				if (_this.tkform.card_number != '' && typeof _this.tkform.card_number != 'undefined') {
 					formData.append('card_number', this.tkform.card_number);
@@ -168,13 +177,14 @@ import { Form } from 'element-ui';
 					_this.$message.error("退款金额需要在 0.01~1000 之间!");
 					return;
 				}
-				
+
 				this.$axios.post('/jxch-smartmp/HotWaters/waterrefund.action', formData)
 					.then(res => {
 						// console.log(res.data);
 						if (res.data.code == 200) {
 							_this.$message.success(res.data.message);
 							_this.tkdialogFormVisible = false;
+							_this.handleCurrentChange(this.currentPage)
 						} else {
 							_this.$message.error(res.data.message);
 						}
@@ -183,6 +193,10 @@ import { Form } from 'element-ui';
 						// console.log(err);
 						_this.$message.error('【操作退款】请求异常: ' + err);
 					});
+
+				setTimeout(() => {
+					loading.close();
+				}, 2000);
 			},
 			// 一弹出对话,让金额输入框获得焦点
 			onDialogOpen() {

+ 6 - 5
src/components/tuikuan/tuikuan.vue

@@ -97,7 +97,10 @@
 				};
 
 				// 初始化日期为今天天 至 明天
-				this.initDate();
+				// this.initDate();
+				
+				// 显示列表
+				this.handleCurrentChange('init')
 			} else {
 				this.$message.error('请使用【退款专用账号】登录!');
 			}
@@ -121,7 +124,8 @@
 					.then(res => {
 						// console.log(res.data);
 						if (res.data.code == 200) {
-							_this.amount = res.data.data.toFixed(2);
+							_this.amount = res.data.data.total.toFixed(2);
+							_this.total_times = res.data.data.num;
 						} else {
 							_this.$message.error(res.data.message);
 						}
@@ -219,9 +223,6 @@
 
 				this.select_datetime.push(this.startTime)
 				this.select_datetime.push(this.endTime)
-
-				// 显示列表
-				this.handleCurrentChange('init')
 			},
 			/**
 			 * 获取指定格式 年、月、日