Kaynağa Gözat

退费完成

soft5566 3 yıl önce
ebeveyn
işleme
1301e375f2

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

@@ -27,7 +27,7 @@
 					</el-table-column>
 					<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 == 1">
+					<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>
@@ -157,17 +157,17 @@
 				var _this = this;
 				let formData = new FormData();
 				if (_this.tkform.card_number != '' && typeof _this.tkform.card_number != 'undefined') {
-					params.card_number = this.tkform.card_number;
+					formData.card_number = this.tkform.card_number;
 				}
 				if (_this.tkform.amount != '' && typeof _this.tkform.amount != 'undefined') {
-					params.amount = this.tkform.amount
+					formData.amount = this.tkform.amount
 				}
 
 				if (_this.tkform.amount < 0.01 || _this.tkform.amount > 1000) {
 					_this.$message.error("退款金额需要在 0.01~1000 之间!");
 					return;
 				}
-
+				
 				this.$axios.post('/jxch-smartmp/HotWaters/waterrefund.action', formData)
 					.then(res => {
 						// console.log(res.data);

+ 43 - 41
src/components/tuikuan/tuikuan.vue

@@ -9,9 +9,8 @@
 			<el-col :span="24" class="second-row">
 				<el-form :inline="true" class="demo-form-inline">
 					<el-form-item label="" class="riqi">
-						<el-date-picker v-model="select_datetime" type="daterange" range-separator="至"
-							@change="dateChange" start-placeholder="开始日期" end-placeholder="结束日期"
-							value-format="yyyy-MM-dd">
+						<el-date-picker v-model="select_datetime" type="daterange" range-separator="至" @change="dateChange" start-placeholder="开始日期"
+							end-placeholder="结束日期" value-format="yyyy-MM-dd">
 						</el-date-picker>
 					</el-form-item>
 					<el-form-item label="" class="shuibiaoId">
@@ -29,16 +28,14 @@
 		<el-row>
 			<el-col :span="24">
 				<div class="">
-					<span class="item">总计:<span class="green_txt">{{ amount }}</span>元</span> <span
-						class="item">总交易笔数:<span class="green_txt">{{ total_times }}</span>笔</span> <span
-				</div>
+					<span class="item">总计:<span class="green_txt">{{ amount }}</span>元</span> <span class="item">总交易笔数:<span
+							class="green_txt">{{ total_times }}</span>笔</span> <span </div>
 			</el-col>
 		</el-row>
 		<hr style="background-color: #CCCCCC;height: 1px;border: 0;">
 		<el-row>
 			<el-col :span="24" class="third-row">
-				<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
-					highlight-current-row>
+				<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" highlight-current-row>
 					<el-table-column align="center" label="序号" type="index" :index="indexMethod" width="100px">
 					</el-table-column>
 					<el-table-column align="center" label="户号">
@@ -48,15 +45,13 @@
 					<el-table-column prop="order_num" label="交易流水号" align="center"></el-table-column>
 					<el-table-column prop="handler_man" label="操作账号" align="center">
 					</el-table-column>
-					<el-table-column prop="account" label="支付金额(元)" align="center" :formatter="formatBalance"
-						show-overflow-tooltip></el-table-column>
+					<el-table-column prop="account" label="支付金额(元)" align="center" :formatter="formatBalance" show-overflow-tooltip></el-table-column>
 					<el-table-column prop="time" label="支付时间" align="center" width="200px"></el-table-column>
 				</el-table>
 				<div style="margin-top: 20px" class="table-footer">
 					<div class="pages">
-						<el-pagination layout="prev, pager, next" :current-page.sync="currentPage"
-							:hide-on-single-page="true" :page-size="pageRows" :total="rows_total"
-							@current-change="handleCurrentChange"></el-pagination>
+						<el-pagination layout="prev, pager, next" :current-page.sync="currentPage" :hide-on-single-page="true" :page-size="pageRows"
+							:total="rows_total" @current-change="handleCurrentChange('page')"></el-pagination>
 					</div>
 				</div>
 			</el-col>
@@ -90,16 +85,21 @@
 			}
 		},
 		created() {
-			// 获取总金额
-			this.get_total_amount()
-			// 获取余额列表
-			let params = {
-				page: this.currentPage,
-				rows: this.pageRows
-			}
+			var level = sessionStorage.getItem('level');
+			if (level == 2) {
+				// 获取总金额
+				this.get_total_amount();
+				// 获取余额列表
+				let params = {
+					page: this.currentPage,
+					rows: this.pageRows
+				};
 
-			// 初始化日期为今天天 至 明天
-			this.initDate()
+				// 初始化日期为今天天 至 明天
+				this.initDate();
+			} else {
+				this.$message.error('请使用【退款专用账号】登录!');
+			}
 		},
 		methods: {
 			get_total_amount() {
@@ -111,7 +111,7 @@
 				if (typeof _this.endTime != 'undefined' && _this.endTime != '') {
 					formData.append("end_time", _this.endTime);
 				}
-				if (_this.searchformUser != '' && typeof _this.searchformUser  != 'undefined') {
+				if (_this.searchformUser != '' && typeof _this.searchformUser != 'undefined') {
 					params.user_name = this.searchformUser
 				}
 				this.$axios.post('/jxch-smartmp/HotWaters/waterrefund_total.action', formData)
@@ -119,7 +119,7 @@
 						// console.log(res.data);
 						if (res.data.code == 200) {
 							_this.amount = res.data.data;
-						} else{
+						} else {
 							_this.$message.error(res.data.message);
 						}
 					})
@@ -170,25 +170,28 @@
 			},
 			/**
 			 * 退款列表改变页码
-			 * @param {Object} val
+			 * @param {Object} param
 			 */
-			handleCurrentChange(val) {
-				// console.log(val);
-				this.currentPage = val
+			handleCurrentChange(param) {
+				// console.log(param);
+				this.currentPage = this.currentPage
 				var params = {
 					page: this.currentPage,
 					rows: this.pageRows,
 				}
-				if (this.startTime != '' && typeof this.startTime != 'undefined') {
-					params.begin_time = this.startTime
-				}
-				if (this.endTime != '' && typeof this.endTime != 'undefined') {
-					params.end_time = this.endTime
-				}
-				if (this.searchformUser != '' && typeof this.searchformUser != 'undefined') {
-					params.user_name = this.searchformUser
+				if (param != 'init') {
+					if (this.startTime != '' && typeof this.startTime != 'undefined') {
+						params.begin_time = this.startTime
+					}
+					if (this.endTime != '' && typeof this.endTime != 'undefined') {
+						params.end_time = this.endTime
+					}
+					if (this.searchformUser != '' && typeof this.searchformUser != 'undefined') {
+						params.user_name = this.searchformUser
+					}
 				}
 
+
 				// 获取退款列表
 				this.get_amount_list(params)
 			},
@@ -215,7 +218,7 @@
 				this.select_datetime.push(this.endTime)
 
 				// 显示列表
-				this.handleCurrentChange(1)
+				this.handleCurrentChange('init')
 			},
 			/**
 			 * 获取指定格式 年、月、日
@@ -240,8 +243,7 @@
 				if (this.startTime == this.endTime) {
 					this.$message.error('起止日期不能为同一天!')
 				} else {
-					// 选择日期后,马上搜索
-					// this.handleCurrentChange(1)
+
 				}
 			},
 			/**
@@ -250,7 +252,7 @@
 			onSearch() {
 				this.currentPage = 1
 
-				this.handleCurrentChange(this.currentPage)
+				this.handleCurrentChange('search')
 			},
 			/**
 			 * 导出为Excel表格
@@ -285,4 +287,4 @@
 
 <style scoped>
 	@import url("tuikuan.css");
-</style>
+</style>

+ 2 - 2
src/router/index.js

@@ -46,7 +46,7 @@ export default new Router({
 			component: CZJL // 充值记录
 		}, {
 			path: 'tk',
-			name: 'tk',
+			name: 'TK',
 			component: TK // 充值记录
 		}, {
 			path: 'sjdz',
@@ -78,4 +78,4 @@ export default new Router({
 			component: AD // 广告管理
 		}]
 	}]
-})
+});