Ver código fonte

【进度】支付异常完成。

程志平 4 anos atrás
pai
commit
477848c1e4

+ 5 - 1
src/components/index/Index.vue

@@ -120,7 +120,11 @@
 			// 退出登陆
 			logout() {
 				var _this = this
-				this.$confirm('确认退出?')
+				this.$confirm('确认退出?', '提示', {
+						confirmButtonText: '是,退出',
+						cancelButtonText: '否,不退出',
+						type: 'warning'
+					})
 					.then(_ => {
 						// console.log(_);
 						sessionStorage.removeItem('uname')

+ 5 - 3
src/components/zhifuyichang/zhifuyichang.css

@@ -160,10 +160,11 @@
 	font-size: 18px;
 }
 
-.pages {
-	width: 100%;
+.table-footer {
+	margin-top: 20px;
 	display: flex;
-	justify-content: space-between;
+	flex-direction: row;
+	justify-content: center;
 	align-items: center;
 }
 
@@ -317,4 +318,5 @@
 	display: flex;
 	justify-content: flex-end;
 }
+
 /* yongshuiyichang */

+ 143 - 83
src/components/zhifuyichang/zhifuyichang.vue

@@ -25,65 +25,30 @@
 				<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
 					highlight-current-row>
 					<el-table-column align="center" label="姓名" width="200">
-						<template slot-scope="scope">{{ scope.row.stu_number }}</template>
+						<template slot-scope="scope">{{ scope.row.user_name }}</template>
 					</el-table-column>
-					<el-table-column prop="user_name" label="学号" align="center" width="200"></el-table-column>
-					<el-table-column prop="user_name" label="充值宿舍号" align="center" width="200"></el-table-column>
-					<el-table-column prop="balance" label="金额(元)" align="center" show-overflow-tooltip></el-table-column>
-					<el-table-column prop="balance" label="时间" align="center" show-overflow-tooltip></el-table-column>
+					<el-table-column prop="stu_number" label="学号" align="center" width="200"></el-table-column>
+					<el-table-column prop="room" label="充值宿舍号" :formatter="formatRoom" align="center" width="200">
+					</el-table-column>
+					<el-table-column prop="account" label="金额(元)" align="center" show-overflow-tooltip>
+					</el-table-column>
+					<el-table-column prop="re_time" label="时间" align="center" show-overflow-tooltip></el-table-column>
 					<el-table-column label="操作" align="center" width="380">
 						<template slot-scope="scope">
-							<el-button type="text" v-if="handle"
-								@click="handleShowDialog(scope.$index, scope.row)">未处理</el-button>
+							<el-button type="text" v-if="scope.row.handler_state == '未处理'"
+								@click="handleShowDialog(scope.$index, scope.row)">未处理
+							</el-button>
 							<el-button type="text" class="exception" v-else>已处理</el-button>
 						</template>
 					</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>
-					</div>
+				<div class="table-footer">
+					<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>
 				</div>
 			</el-col>
 		</el-row>
-		<el-row>
-			<el-col :span="24" class="forth-row">
-				<!-- 操作对话框 -->
-				<el-dialog title="用水异常处理" :visible.sync="detail_dialogFormVisible" width="640px" top="0vh"
-					class="my-dialog" :close-on-click-modal="false" :close-on-press-escape="false">
-					<hr
-						style="width: 100%; position: absolute; top: 60px; left: 0px;background-color: #CCCCCC;height: 1px;border: 0;">
-					<el-form :inline="true" class="demo-form-inline">
-						<el-form-item label="姓名:" class="shuibiaoId">
-							<el-input v-model="detail_userName" placeholder="请输入姓名" clearable></el-input>
-						</el-form-item>
-						<el-form-item>
-							<el-button type="primary" @click="onSearch">查找</el-button>
-						</el-form-item>
-					</el-form>
-					<el-table ref="multipleTable" :data="detail_tableData" tooltip-effect="dark" style="width: 100%"
-						highlight-current-row>
-						<el-table-column align="center" label="学号">
-							<template slot-scope="scope">{{ scope.row.stu_number }}</template>
-						</el-table-column>
-						<el-table-column align="center" prop="user_name" label="姓名" show-overflow-tooltip>
-						</el-table-column>
-						<el-table-column align="center" prop="use_amount" label="用水量" show-overflow-tooltip>
-						</el-table-column>
-					</el-table>
-					<div slot="footer" class="dialog-footer">
-						<div class="dialog-pages">
-							<el-pagination layout="prev, pager, next"
-								:current-page.sync="control_table.detail_current_page" :hide-on-single-page="true"
-								:page-size="control_table.detail_page_rows" @current-change="handleCurrentChange"
-								:total="control_table.detail_total_rows"></el-pagination>
-						</div>
-					</div>
-				</el-dialog>
-			</el-col>
-		</el-row>
 	</div>
 </template>
 
@@ -91,16 +56,16 @@
 	export default {
 		data() {
 			return {
-				drom_value: 0, // 楼栋号编码
-				drom: '', // 楼栋号
-				// 楼栋号下拉列表
+				drom_value: 0, // 项目编码
+				drom: '', // 项目
+				// 项目下拉列表
 				drom_options: { // 下拉列表的数据绑定
 					builds: [{
 						value: 0,
-						label: '电费'
-					},{
-						value: 1,
 						label: '水费'
+					}, {
+						value: 1,
+						label: '电费'
 					}],
 					value: 0
 				},
@@ -116,21 +81,33 @@
 					detail_current_page: 1,
 					detail_page_rows: 8,
 					detail_total_rows: 0
-				},
-				handle: true
+				}
 			}
 		},
 		created() {
-			// 获取余额列表
+			// 获取请求参数
 			let params = {
 				page: this.currentPage,
 				rows: this.pageRows
 			}
-			// 异常列表
-			this.get_exception_list(params)
+			// 水费支付异常列表
+			this.get_water_exception_list(params)
 		},
 		methods: {
 			/**
+			 * 格式化充值宿舍号
+			 */
+			formatRoom: (row, column, cellValue, index) => {
+				// row: 行数据
+				// column: 列属性
+				// cellValue: 单元格数据值
+				// index: 行索引,注意:2.3.9版本以后才有。
+				if (cellValue.trim() == "")
+					return "-----"
+				else
+					return cellValue
+			},
+			/**
 			 * 列表改变页码
 			 * @param {Object} val
 			 */
@@ -150,45 +127,123 @@
 						rows: this.pageRows
 					}
 				}
-				// 获取余额列表
-				// this.get_amount_list(params)
+				// 水费支付异常列表
+				this.get_water_exception_list(params)
 			},
 			/**
-			 * 处理异常
+			 * 处理异常对话框
 			 * @param {Object} index
 			 * @param {Object} row
 			 */
 			handleShowDialog(index, row) {
+				// this.detail_dialogFormVisible = true
 				console.log(index, row)
+				var _this = this
+				this.$confirm('是否现在处理?', '提示', {
+						confirmButtonText: '确定处理',
+						cancelButtonText: '暂不处理',
+						type: 'warning'
+					})
+					.then(_ => {
+						// console.log(_);
+						if (_ == 'confirm') {
+							// console.log(row.id);
+							var params = {
+								id: row.id
+							}
+							if (this.drom == '水费') {
+								this.$axios.get('/jxch-smartmp-api/HotWaters/waterhandlerPayError.action', {
+										params: params
+									})
+									.then(res => {
+										// console.log(res.data);
+										if (res.data.code == 1 && res.data.msg == '处理成功') {
+											row.handler_state = '已处理'
+											_this.$message.success('处理成功!');
+										} else {
+											_this.$message.warning('【处理】失败!');
+										}
+									})
+									.catch(err => {
+										// console.log(err);
+										_this.$message.error('【处理】请求异常: ' + err);
+									})
+							} else if (this.drom == '电费') {
+								this.$axios.get('/jxch-smartmp-api/HotWaters/waterhandlerElecPayError.action', {
+										params: params
+									})
+									.then(res => {
+										// console.log(res.data);
+										if (res.data.code == 1 && res.data.msg == '处理成功') {
+											row.handler_state = '已处理'
+											_this.$message.success('处理成功!');
+										} else {
+											_this.$message.warning('【处理】失败!');
+										}
+									})
+									.catch(err => {
+										// console.log(err);
+										_this.$message.error('【处理】请求异常: ' + err);
+									})
+							}
+						}
+					})
+					.catch(_ => {
+						console.log(_);
+					});
+			},
+			/**
+			 * 获取水费支付异常列表
+			 */
+			get_water_exception_list(params) {
+				var _this = this
+				_this.tableData = []
+				// _this.rows_total = 0
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindErrorPayByNo.action', {
+						params: params
+					})
+					.then(res => {
+						// console.log(res.data.data);
+						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
+							'{}') {
+							_this.tableData = res.data.rows
+							_this.rows_total = res.data.total
+						} else {
+							_this.$message.warning('【获取水费支付异常列表】暂无数据!');
+						}
+					})
+					.catch(err => {
+						// console.log(err);
+						_this.$message.error('【获取水费支付异常列表】请求异常: ' + err);
+					})
 			},
 			/**
-			 * 获取余额列表
+			 * 获取电费支付异常列表
 			 */
-			get_exception_list(params) {
+			get_electric_exception_list(params) {
 				var _this = this
 				_this.tableData = []
 				// _this.rows_total = 0
-				this.$axios.get('/jxch-smartmp-api/HotWaters/waterMoney.action', {
+				this.$axios.get('/jxch-smartmp-api/HotWaters/waterfindErrorElcPayByNo.action', {
 						params: params
 					})
 					.then(res => {
-						// console.log(res.data);
+						// console.log(res.data.data);
 						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
 							'{}') {
-							// _this.$message.success('数据加载成功!');
 							_this.tableData = res.data.rows
 							_this.rows_total = res.data.total
 						} else {
-							_this.$message.success('【获取余额列表】暂无数据!');
+							_this.$message.warning('【获取电费支付异常列表】暂无数据!');
 						}
 					})
 					.catch(err => {
 						// console.log(err);
-						_this.$message.error('【获取余额列表】请求异常: ' + err);
+						_this.$message.error('【获取电费支付异常列表】请求异常: ' + err);
 					})
 			},
 			/**
-			 * 选择楼栋号
+			 * 选择项目
 			 */
 			selectGetBuild(vId) {
 				// console.log(vId);
@@ -197,22 +252,27 @@
 				obj = this.drom_options.builds.find((item) => {
 					return item.value === vId; //筛选出匹配数据
 				});
-				// console.log(obj);
+				console.log(obj);
 				this.drom_options.value = obj.value
 				this.drom_options.label = obj.label
-				// 获取楼栋号
+				// 获取项目
 				this.drom = this.drom_options.label
 
-				// 共用部分
-				// this.updateData()
-			},
-			/**
-			 * 详情页面查找
-			 */
-			onSearch() {
-				this.control_table.detail_current_page = 1
-
-				// this.show_detail()
+				// 获取请求参数
+				let params = {
+					page: this.currentPage,
+					rows: this.pageRows
+				}
+				
+				if (this.drom == '水费') {
+					// 水费支付异常列表
+					this.get_water_exception_list(params)
+				} else if (this.drom == '电费') {
+					// 电费支付异常列表
+					this.get_electric_exception_list(params)
+				} else {
+					this.$message.error('选择了未知项目')
+				}
 			}
 		}
 	}