修改订单列表显示条数 修改充值界面管理员跟用户显示区别 home 增加修改密码更新缓存等操作 登录后跳转缴费界面
正在显示
8 个修改的文件
包含
262 行增加
和
30 行删除
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
6 | - <title>流浪地球项目</title> | 6 | + <title>郑州机场集团水电缴费平台</title> |
7 | <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> | 7 | <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> |
8 | </head> | 8 | </head> |
9 | 9 |
@@ -4,7 +4,7 @@ let setIntervalWesocketPush = null | @@ -4,7 +4,7 @@ let setIntervalWesocketPush = null | ||
4 | /**建立连接 */ | 4 | /**建立连接 */ |
5 | export function createSocket() { | 5 | export function createSocket() { |
6 | var socketUrl="http://localhost:10003/imserver"; | 6 | var socketUrl="http://localhost:10003/imserver"; |
7 | - // var socketUrl="http://10.5.10.98:10003/imserver"; | 7 | + // var socketUrl="http://218.28.199.138:10003/imserver"; |
8 | socketUrl=socketUrl.replace("https","ws").replace("http","ws"); | 8 | socketUrl=socketUrl.replace("https","ws").replace("http","ws"); |
9 | 9 | ||
10 | console.log(socketUrl); | 10 | console.log(socketUrl); |
@@ -8,8 +8,12 @@ export const removeUser = params => { return http.del(`${baseUrl}/del`,params)}; | @@ -8,8 +8,12 @@ export const removeUser = params => { return http.del(`${baseUrl}/del`,params)}; | ||
8 | 8 | ||
9 | export const batchRemoveUser = params => { return http.del(`${baseUrl}/batchremove`, { params: params }); }; | 9 | export const batchRemoveUser = params => { return http.del(`${baseUrl}/batchremove`, { params: params }); }; |
10 | 10 | ||
11 | +export const editPass = params => { return http.put(`${baseUrl}/password`,params)}; | ||
12 | + | ||
11 | export const editUser = params => { return http.put(`${baseUrl}/edit`,params)}; | 13 | export const editUser = params => { return http.put(`${baseUrl}/edit`,params)}; |
12 | 14 | ||
13 | export const addUser = params => { return http.post(`${baseUrl}/add`,params)}; | 15 | export const addUser = params => { return http.post(`${baseUrl}/add`,params)}; |
14 | 16 | ||
15 | export const setUserRole = params => { return http.put(`${baseUrl}/roleset`,params)}; | 17 | export const setUserRole = params => { return http.put(`${baseUrl}/roleset`,params)}; |
18 | + | ||
19 | +export const resetToken = params => { return http.put(`${baseUrl}/resetToken`,params)}; |
@@ -84,13 +84,15 @@ axios.interceptors.response.use( | @@ -84,13 +84,15 @@ axios.interceptors.response.use( | ||
84 | router.push({ | 84 | router.push({ |
85 | path: "/login" | 85 | path: "/login" |
86 | }); | 86 | }); |
87 | + message({ | ||
88 | + // 饿了么的消息弹窗组件 | ||
89 | + message: '缺少身份验证', | ||
90 | + type: "error" | ||
91 | + }); | ||
87 | } else { | 92 | } else { |
88 | 93 | ||
89 | // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面 | 94 | // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面 |
90 | if (error.response.status === 401) { | 95 | if (error.response.status === 401) { |
91 | - router.push({ | ||
92 | - path: "/login" | ||
93 | - }); | ||
94 | message({ | 96 | message({ |
95 | // 饿了么的消息弹窗组件 | 97 | // 饿了么的消息弹窗组件 |
96 | message: '授权超时,或未授权,请重新登录', | 98 | message: '授权超时,或未授权,请重新登录', |
@@ -100,13 +102,17 @@ axios.interceptors.response.use( | @@ -100,13 +102,17 @@ axios.interceptors.response.use( | ||
100 | 102 | ||
101 | // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面 | 103 | // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面 |
102 | if (error.response.status === 403) { | 104 | if (error.response.status === 403) { |
103 | - router.push({ | ||
104 | - path: "/error/403" | 105 | + message({ |
106 | + // 饿了么的消息弹窗组件 | ||
107 | + message: '网络异常', | ||
108 | + type: "error" | ||
105 | }); | 109 | }); |
106 | } | 110 | } |
107 | if (error.response.status === 500) { | 111 | if (error.response.status === 500) { |
108 | - router.push({ | ||
109 | - path: "/error/500" | 112 | + message({ |
113 | + // 饿了么的消息弹窗组件 | ||
114 | + message: '网络异常', | ||
115 | + type: "error" | ||
110 | }); | 116 | }); |
111 | } | 117 | } |
112 | if (error.response.status === 502) { | 118 | if (error.response.status === 502) { |
@@ -115,8 +121,10 @@ axios.interceptors.response.use( | @@ -115,8 +121,10 @@ axios.interceptors.response.use( | ||
115 | }); | 121 | }); |
116 | } | 122 | } |
117 | if (error.response.status === 404) { | 123 | if (error.response.status === 404) { |
118 | - router.push({ | ||
119 | - path: "/error/404" | 124 | + message({ |
125 | + // 饿了么的消息弹窗组件 | ||
126 | + message: '访问页面不存在', | ||
127 | + type: "error" | ||
120 | }); | 128 | }); |
121 | } | 129 | } |
122 | } | 130 | } |
@@ -14,12 +14,32 @@ | @@ -14,12 +14,32 @@ | ||
14 | <span class="el-dropdown-link userinfo-inner"><img :src="this.sysUserAvatar" /> {{sysUserName}}</span> | 14 | <span class="el-dropdown-link userinfo-inner"><img :src="this.sysUserAvatar" /> {{sysUserName}}</span> |
15 | <el-dropdown-menu slot="dropdown"> | 15 | <el-dropdown-menu slot="dropdown"> |
16 | <el-dropdown-item>我的消息</el-dropdown-item> | 16 | <el-dropdown-item>我的消息</el-dropdown-item> |
17 | - <el-dropdown-item>设置</el-dropdown-item> | 17 | + <el-dropdown-item @click.native="editPass">修改密码</el-dropdown-item> |
18 | + <el-dropdown-item @click.native="updateCache">更新缓存</el-dropdown-item> | ||
18 | <el-dropdown-item divided @click.native="logout">退出登录</el-dropdown-item> | 19 | <el-dropdown-item divided @click.native="logout">退出登录</el-dropdown-item> |
19 | </el-dropdown-menu> | 20 | </el-dropdown-menu> |
20 | </el-dropdown> | 21 | </el-dropdown> |
21 | </el-col> | 22 | </el-col> |
22 | </el-col> | 23 | </el-col> |
24 | + <el-col> | ||
25 | + <el-dialog title="修改密码" :visible.sync="dialogFormVisible"> | ||
26 | + <el-form :model="resetForm" status-icon :rules="resetFormRules" ref="resetForm" label-width="100px"> | ||
27 | + <el-form-item label="用户名" prop="name"> | ||
28 | + <span>{{sysUserName}}</span> | ||
29 | + </el-form-item> | ||
30 | + <el-form-item label="新密码" prop="newpwd"> | ||
31 | + <el-input type="password" v-model="resetForm.newpwd" autocomplete="off" placeholder="8-20位字符在数字、小写、大写字母以及特殊字符中四选三"></el-input> | ||
32 | + </el-form-item> | ||
33 | + <el-form-item label="确认密码" prop="renewpwd"> | ||
34 | + <el-input type="password" v-model="resetForm.renewpwd" auto-complete="off"></el-input> | ||
35 | + </el-form-item> | ||
36 | + <el-form-item> | ||
37 | + <el-button type="primary" @click="submitEdit('resetForm')" style="float:right">提 交</el-button> | ||
38 | + </el-form-item> | ||
39 | + | ||
40 | + </el-form> | ||
41 | + </el-dialog> | ||
42 | + </el-col> | ||
23 | <el-col :span="24" class="main"> | 43 | <el-col :span="24" class="main"> |
24 | <aside :class="collapsed?'menu-collapsed':'menu-expanded'"> | 44 | <aside :class="collapsed?'menu-collapsed':'menu-expanded'"> |
25 | <!--导航菜单--> | 45 | <!--导航菜单--> |
@@ -72,6 +92,8 @@ | @@ -72,6 +92,8 @@ | ||
72 | 92 | ||
73 | <script> | 93 | <script> |
74 | import rt from '../routes' | 94 | import rt from '../routes' |
95 | + import { editPass,resetToken} from '../api/user'; | ||
96 | + import ElFormItem from "element-ui/packages/form/src/form-item"; | ||
75 | export default { | 97 | export default { |
76 | 98 | ||
77 | provide() { | 99 | provide() { |
@@ -79,11 +101,55 @@ | @@ -79,11 +101,55 @@ | ||
79 | reload: this.reload | 101 | reload: this.reload |
80 | } | 102 | } |
81 | }, | 103 | }, |
104 | + components: {ElFormItem}, | ||
82 | data() { | 105 | data() { |
106 | + var validatePass = (rule, value, callback) => { | ||
107 | + if (!value) { | ||
108 | + callback(new Error('请输入新密码')); | ||
109 | + }else { | ||
110 | + var ls=0; | ||
111 | + if(value.match(/([a-z])+/)){ | ||
112 | + ls++; | ||
113 | + } if(value.match(/([0-9])+/)){ | ||
114 | + ls++; | ||
115 | + } if(value.match(/([A-Z])+/)){ | ||
116 | + ls++; | ||
117 | + } if((/([\W])+/) && !value.match(/(![\u4E00-\u9FA5])+/)){ | ||
118 | + ls++; | ||
119 | + } if (value.toString().length < 8 || value.toString().length > 20) { | ||
120 | + callback(new Error('密码长度为8 - 20个字符')); | ||
121 | + ls=0; | ||
122 | + } if(value.match(/([\u4E00-\u9FA5])+/)){ | ||
123 | + callback(new Error('不能包含中文字符')); | ||
124 | + ls=0; | ||
125 | + } | ||
126 | + switch (ls) { | ||
127 | + case 0: this.passwordPercent = 0;callback(new Error('数字、小写字母、大写字母以及特殊字符中四选三'));break; | ||
128 | + case 1: this.passwordPercent = 33;callback(new Error('数字、小写字母、大写字母以及特殊字符中四选三'));break; | ||
129 | + case 2: this.passwordPercent = 66;callback(new Error('数字、小写字母 、大写字母以及特殊字符中四选三'));break; | ||
130 | + case 3: | ||
131 | + case 4: this.passwordPercent = 100;break; | ||
132 | + default: this.passwordPercent = 0;break; | ||
133 | + } | ||
134 | + callback(); | ||
135 | + } | ||
136 | + | ||
137 | + }; | ||
138 | + | ||
139 | + var validatePass2 = (rule, value, callback) => { | ||
140 | + if (value === '') { | ||
141 | + callback(new Error('请再次输入密码')); | ||
142 | + } else if (value !== this.resetForm.newpwd) { | ||
143 | + callback(new Error('两次输入密码不一致!')); | ||
144 | + } else { | ||
145 | + callback(); | ||
146 | + } | ||
147 | + }; | ||
83 | return { | 148 | return { |
84 | sysName:'易通快速通关申报管理系统', | 149 | sysName:'易通快速通关申报管理系统', |
85 | collapsed:false, | 150 | collapsed:false, |
86 | sysUserName: '', | 151 | sysUserName: '', |
152 | + sysUserId:'', | ||
87 | sysUserAvatar: '', | 153 | sysUserAvatar: '', |
88 | isRouterAlive: true, | 154 | isRouterAlive: true, |
89 | form: { | 155 | form: { |
@@ -95,7 +161,24 @@ | @@ -95,7 +161,24 @@ | ||
95 | type: [], | 161 | type: [], |
96 | resource: '', | 162 | resource: '', |
97 | desc: '' | 163 | desc: '' |
98 | - } | 164 | + }, |
165 | + dialogFormVisible:false, | ||
166 | + resetForm: { | ||
167 | + newpwd: '', | ||
168 | + renewpwd: '', | ||
169 | + }, | ||
170 | + resetFormRules: { | ||
171 | + newpwd: [ | ||
172 | + { required: true, validator: validatePass, trigger: 'blur' } | ||
173 | + ], | ||
174 | + renewpwd: [ | ||
175 | + { required: true, validator: validatePass2, trigger: 'blur' } | ||
176 | + ] | ||
177 | + }, | ||
178 | + editForm: { | ||
179 | + userId: '', | ||
180 | + password: '', | ||
181 | + }, | ||
99 | } | 182 | } |
100 | }, | 183 | }, |
101 | methods: { | 184 | methods: { |
@@ -109,6 +192,53 @@ | @@ -109,6 +192,53 @@ | ||
109 | }) | 192 | }) |
110 | }) | 193 | }) |
111 | }, | 194 | }, |
195 | + editPass:function(){ | ||
196 | + this.dialogFormVisible=true; | ||
197 | + }, | ||
198 | + updateCache:function(){ | ||
199 | + resetToken().then( res =>{ | ||
200 | + let response = res.data; | ||
201 | + if (response.code === '200'){ | ||
202 | + this.$notify({ | ||
203 | + title: '成功', | ||
204 | + message: '缓存更新成功', | ||
205 | + type: 'success' | ||
206 | + }); | ||
207 | + }else{ | ||
208 | + this.$notify.error({ | ||
209 | + title: '失败', | ||
210 | + message: '缓存更新失败' | ||
211 | + }); | ||
212 | + } | ||
213 | + }) | ||
214 | + }, | ||
215 | + submitEdit(formName){ | ||
216 | + this.$refs[formName].validate((valid) => { | ||
217 | + if (valid) { | ||
218 | + this.editForm.userId=this.sysUserId; | ||
219 | + this.editForm.password=this.resetForm.renewpwd; | ||
220 | + editPass(this.editForm).then(res=>{ | ||
221 | + let response=res.data; | ||
222 | + if(response.code=='200'){ | ||
223 | + this.$notify({ | ||
224 | + title: '密码修改成功', | ||
225 | + message: '密码修改成功,退出请重新登录', | ||
226 | + type: 'success' | ||
227 | + }); | ||
228 | + this.dialogFormVisible=false; | ||
229 | + }else{ | ||
230 | + this.$notify.error({ | ||
231 | + title: '密码修改失败', | ||
232 | + message: '密码修改失败!!!' | ||
233 | + }); | ||
234 | + } | ||
235 | + }); | ||
236 | + } else { | ||
237 | + console.log('error submit!!'); | ||
238 | + return false; | ||
239 | + } | ||
240 | + }); | ||
241 | + }, | ||
112 | onSubmit() { | 242 | onSubmit() { |
113 | console.log('submit!'); | 243 | console.log('submit!'); |
114 | }, | 244 | }, |
@@ -155,6 +285,7 @@ | @@ -155,6 +285,7 @@ | ||
155 | if (user) { | 285 | if (user) { |
156 | user = JSON.parse(user); | 286 | user = JSON.parse(user); |
157 | this.sysUserName = user.username || ''; | 287 | this.sysUserName = user.username || ''; |
288 | + this.sysUserId=user.userId||''; | ||
158 | this.sysUserAvatar = user.userface || '/static/images/faceDefault.jpg'; | 289 | this.sysUserAvatar = user.userface || '/static/images/faceDefault.jpg'; |
159 | } | 290 | } |
160 | //操作路由,判断本地存储的用户栏目列表是否存在,如果存在则加载路由 | 291 | //操作路由,判断本地存储的用户栏目列表是否存在,如果存在则加载路由 |
@@ -240,6 +371,8 @@ | @@ -240,6 +371,8 @@ | ||
240 | aside { | 371 | aside { |
241 | flex:0 0 230px; | 372 | flex:0 0 230px; |
242 | width: 230px; | 373 | width: 230px; |
374 | + overflow-y: scroll; | ||
375 | + background: #606060; | ||
243 | // position: absolute; | 376 | // position: absolute; |
244 | // top: 0px; | 377 | // top: 0px; |
245 | // bottom: 0px; | 378 | // bottom: 0px; |
@@ -136,7 +136,7 @@ | @@ -136,7 +136,7 @@ | ||
136 | 136 | ||
137 | console.log("user:"); | 137 | console.log("user:"); |
138 | console.log(_this.$router.options.routes); | 138 | console.log(_this.$router.options.routes); |
139 | - _this.$router.push({path: '/main'}); | 139 | + _this.$router.push({path: '/userPayOrder'}); |
140 | } | 140 | } |
141 | }).catch(error => { | 141 | }).catch(error => { |
142 | this.$message({ | 142 | this.$message({ |
@@ -9,7 +9,8 @@ | @@ -9,7 +9,8 @@ | ||
9 | <br/> | 9 | <br/> |
10 | <el-form :inline="true" :model="filters"> | 10 | <el-form :inline="true" :model="filters"> |
11 | <el-form-item prop="roomNumber"> | 11 | <el-form-item prop="roomNumber"> |
12 | - <el-input style="width: 700px" v-model="filters.roomNumber" placeholder="房间号" required></el-input> | 12 | + <el-input v-if="username == 'admin'" style="width: 700px" v-model="filters.roomNumber" placeholder="房间号" required></el-input> |
13 | + <el-input v-else="" disabled style="width: 700px" v-model="filters.roomNumber" placeholder="房间号" required></el-input> | ||
13 | <br/><br/> | 14 | <br/><br/> |
14 | <el-button style="width: 150px" type="primary" v-on:click="getdefaultData()">查询</el-button> | 15 | <el-button style="width: 150px" type="primary" v-on:click="getdefaultData()">查询</el-button> |
15 | </el-form-item> | 16 | </el-form-item> |
@@ -91,9 +92,10 @@ | @@ -91,9 +92,10 @@ | ||
91 | components: {ElButton}, | 92 | components: {ElButton}, |
92 | data() { | 93 | data() { |
93 | return{ | 94 | return{ |
95 | + username: JSON.parse(sessionStorage.getItem('user')).username, | ||
94 | loading:false, | 96 | loading:false, |
95 | filters:{ | 97 | filters:{ |
96 | - roomNumber:'' | 98 | + roomNumber: JSON.parse(sessionStorage.getItem('user')).username |
97 | }, | 99 | }, |
98 | electricityForm:{ | 100 | electricityForm:{ |
99 | balance:'', | 101 | balance:'', |
@@ -120,6 +122,7 @@ | @@ -120,6 +122,7 @@ | ||
120 | { required: true, message: '充值金额不能为空', trigger: "blur"}, | 122 | { required: true, message: '充值金额不能为空', trigger: "blur"}, |
121 | { type: 'number', message: '金额必须为数字值'} | 123 | { type: 'number', message: '金额必须为数字值'} |
122 | ] | 124 | ] |
125 | + | ||
123 | }, | 126 | }, |
124 | labelPosition:'left', | 127 | labelPosition:'left', |
125 | // Edistatus:'', | 128 | // Edistatus:'', |
@@ -145,7 +148,7 @@ | @@ -145,7 +148,7 @@ | ||
145 | this.electricityForm = resData[i]; | 148 | this.electricityForm = resData[i]; |
146 | this.electricityForm.payTime = new Date() | 149 | this.electricityForm.payTime = new Date() |
147 | this.electricityForm.realName = JSON.parse(sessionStorage.getItem('user')).realname; | 150 | this.electricityForm.realName = JSON.parse(sessionStorage.getItem('user')).realname; |
148 | - this.electricityForm.userId = JSON.parse(sessionStorage.getItem('user')).userId;; | 151 | + this.electricityForm.userId = JSON.parse(sessionStorage.getItem('user')).userId; |
149 | } else { | 152 | } else { |
150 | this.waterForm = resData[i]; | 153 | this.waterForm = resData[i]; |
151 | this.waterForm.payTime = new Date(); | 154 | this.waterForm.payTime = new Date(); |
@@ -155,10 +158,10 @@ | @@ -155,10 +158,10 @@ | ||
155 | } | 158 | } |
156 | this.loading=false; | 159 | this.loading=false; |
157 | } else { | 160 | } else { |
158 | - this.$alert('未查询到该房间的设备信息', '提示', { | ||
159 | - confirmButtonText: '确定', | ||
160 | - callback: action => { | ||
161 | - } | 161 | + this.$message({ |
162 | + showClose: true, | ||
163 | + message: '未查询到该房间的设备信息', | ||
164 | + type: 'error' | ||
162 | }); | 165 | }); |
163 | } | 166 | } |
164 | this.loading = false; | 167 | this.loading = false; |
@@ -168,10 +171,16 @@ | @@ -168,10 +171,16 @@ | ||
168 | if (null != error.response && error.response !== undefined) { | 171 | if (null != error.response && error.response !== undefined) { |
169 | let status = error.response.status; | 172 | let status = error.response.status; |
170 | let msg = error.response.statusText; | 173 | let msg = error.response.statusText; |
171 | - alert("请输入所查询的房号"); | 174 | + this.$message({ |
175 | + showClose: true, | ||
176 | + message: '请输入查询的房间号', | ||
177 | + type: 'warning' | ||
178 | + }); | ||
172 | } else { | 179 | } else { |
173 | - this.$alert('请输入房间号', '提示', { | ||
174 | - confirmButtonText: '确定', | 180 | + this.$message({ |
181 | + showClose: true, | ||
182 | + message: '请输入正确的房间号', | ||
183 | + type: 'error' | ||
175 | }); | 184 | }); |
176 | } | 185 | } |
177 | 186 | ||
@@ -204,12 +213,20 @@ | @@ -204,12 +213,20 @@ | ||
204 | if(resultMessage.orderNumber===res.data.data.orderNumber){ | 213 | if(resultMessage.orderNumber===res.data.data.orderNumber){ |
205 | if (resultMessage.success === "Y"){ | 214 | if (resultMessage.success === "Y"){ |
206 | _this.dialogVisible=false; | 215 | _this.dialogVisible=false; |
207 | - alert("支付成功,请等待系统充值") | 216 | + this.$message({ |
217 | + showClose: true, | ||
218 | + message: '支付成功,请等待系统充值', | ||
219 | + type: 'warning' | ||
220 | + }); | ||
208 | //带参数跳转 | 221 | //带参数跳转 |
209 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); | 222 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); |
210 | }else { | 223 | }else { |
211 | _this.dialogVisible=false; | 224 | _this.dialogVisible=false; |
212 | - alert("充值失败,网络波动,请联系管理员") | 225 | + this.$message({ |
226 | + showClose: true, | ||
227 | + message: '充值失败,网络波动,请联系管理员', | ||
228 | + type: 'error' | ||
229 | + }); | ||
213 | //带参数跳转 | 230 | //带参数跳转 |
214 | _this.$router.push({path:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); | 231 | _this.$router.push({path:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); |
215 | } | 232 | } |
@@ -252,17 +269,29 @@ | @@ -252,17 +269,29 @@ | ||
252 | if(resultMessage.orderNumber===res.data.data.orderNumber){ | 269 | if(resultMessage.orderNumber===res.data.data.orderNumber){ |
253 | if (resultMessage.success === "Y"){ | 270 | if (resultMessage.success === "Y"){ |
254 | _this.dialogVisible=false; | 271 | _this.dialogVisible=false; |
255 | - alert("充值成功。") | 272 | + this.$message({ |
273 | + showClose: true, | ||
274 | + message: '充值成功', | ||
275 | + type: 'success' | ||
276 | + }); | ||
256 | //带参数跳转 | 277 | //带参数跳转 |
257 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); | 278 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); |
258 | }else if (resultMessage.success ==="S"){ | 279 | }else if (resultMessage.success ==="S"){ |
259 | _this.dialogVisible=false; | 280 | _this.dialogVisible=false; |
260 | - alert("支付成功,请等待系统充值。") | 281 | + this.$message({ |
282 | + showClose: true, | ||
283 | + message: '支付成功,请等待系统充值', | ||
284 | + type: 'warning' | ||
285 | + }); | ||
261 | //带参数跳转 | 286 | //带参数跳转 |
262 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); | 287 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); |
263 | }else { | 288 | }else { |
264 | _this.dialogVisible=false; | 289 | _this.dialogVisible=false; |
265 | - alert("充值失败,请联系管理员查看原因。") | 290 | + this.$message({ |
291 | + showClose: true, | ||
292 | + message: '充值失败,请联系管理员查看原因', | ||
293 | + type: 'error' | ||
294 | + }); | ||
266 | //带参数跳转 | 295 | //带参数跳转 |
267 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); | 296 | _this.$router.push({name:'订单查询',params:{orderNumber:resultMessage.orderNumber}}); |
268 | } | 297 | } |
@@ -283,7 +312,65 @@ | @@ -283,7 +312,65 @@ | ||
283 | }, | 312 | }, |
284 | }, | 313 | }, |
285 | mounted(){ | 314 | mounted(){ |
315 | + let para={} | ||
316 | + if (this.filters.roomNumber == 'admin'){ | ||
317 | + para = { | ||
318 | + roomNumber: "1101", | ||
319 | + }; | ||
320 | + }else { | ||
321 | + para = { | ||
322 | + roomNumber: this.filters.roomNumber, | ||
323 | + }; | ||
324 | + } | ||
325 | + | ||
326 | + this.loading=true; | ||
327 | + this.electricityForm.balance=""; | ||
328 | + | ||
329 | + getList(para).then((res) => { | ||
330 | + let resData = res.data; | ||
331 | + if (resData.length > 0) { | ||
332 | + for (var i = 0; i < resData.length; i++) { | ||
333 | + if (resData[i].wmId === "") { | ||
334 | + this.electricityForm = resData[i]; | ||
335 | + this.electricityForm.payTime = new Date() | ||
336 | + this.electricityForm.realName = JSON.parse(sessionStorage.getItem('user')).realname; | ||
337 | + this.electricityForm.userId = JSON.parse(sessionStorage.getItem('user')).userId; | ||
338 | + } else { | ||
339 | + this.waterForm = resData[i]; | ||
340 | + this.waterForm.payTime = new Date(); | ||
341 | + this.waterForm.realName = JSON.parse(sessionStorage.getItem('user')).realname; | ||
342 | + this.waterForm.userId = JSON.parse(sessionStorage.getItem('user')).userId; | ||
343 | + } | ||
344 | + } | ||
345 | + this.loading=false; | ||
346 | + } else { | ||
347 | + this.$message({ | ||
348 | + showClose: true, | ||
349 | + message: '未查询到该房间的设备信息', | ||
350 | + type: 'error' | ||
351 | + }); | ||
352 | + } | ||
353 | + this.loading = false; | ||
354 | + //NProgress.done(); | ||
355 | + }).catch((error) => { | ||
356 | + this.loading = false; | ||
357 | + if (null != error.response && error.response !== undefined) { | ||
358 | + let status = error.response.status; | ||
359 | + let msg = error.response.statusText; | ||
360 | + this.$message({ | ||
361 | + showClose: true, | ||
362 | + message: '请输入查询的房间号', | ||
363 | + type: 'warning' | ||
364 | + }); | ||
365 | + } else { | ||
366 | + this.$message({ | ||
367 | + showClose: true, | ||
368 | + message: '请输入正确的房间号', | ||
369 | + type: 'error' | ||
370 | + }); | ||
371 | + } | ||
286 | 372 | ||
373 | + }); | ||
287 | } | 374 | } |
288 | } | 375 | } |
289 | </script> | 376 | </script> |
-
请 注册 或 登录 后发表评论