From be39d93049f3986be4e353fab5c1e51668a6fdf2 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期二, 07 一月 2025 10:45:35 +0800 Subject: [PATCH] 月租车办理页面 --- src/assets/js/ByUtils.js | 82 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 79 insertions(+), 3 deletions(-) diff --git a/src/assets/js/ByUtils.js b/src/assets/js/ByUtils.js index 47c1026..c296143 100644 --- a/src/assets/js/ByUtils.js +++ b/src/assets/js/ByUtils.js @@ -111,8 +111,17 @@ vm.$router.push({'path': '/login'}); vm.$alert('浼氳瘽缁撴潫锛岃閲嶆柊鐧诲綍', {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); }else{ - vm.$alert('鎿嶄綔澶辫触锛�' + data.message, {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); - } + let a = ''; + if(response.data){ + if(response.data.msg){ + a=response.data.msg + }else { + a='鏈嶅姟鍣ㄦ晠闅�' + } + }else { + a="鏁版嵁閿欒" + } + vm.$alert(a , {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); } } }).catch((e) => { vm.$loading().close(); @@ -265,7 +274,8 @@ }).then((response) => { //vm.$loading().close(); let data = response.data; - if (data && data.code==0) { + console.log(response) + if (data && data.code==0) { callBackFunction(data); } else { if(data.message=='-9999'){ @@ -294,6 +304,72 @@ }) }, + exportData(vm, url, data, successCallBackFunction) { + if (StringUtil.isNullOrEmpty(url)) { + vm.$alert('璇锋眰鍦板潃涓嶈兘涓虹┖', {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); + return; + } + let callBackFunction = function (data) { + vm.$message({message: data.message, type: 'success'}); + try { + vm.showDialog(false); + } catch (e) { + } + try { + vm.loadData(); + } catch (e) { + } + } + if (successCallBackFunction) { + callBackFunction = successCallBackFunction; + } + // var token = ""; + // if(this.getUser()){ + // token = this.getUser().token; + // } + // vm.$loading(); + vm.$axios({ + // headers: { + // 'Content-Type': "application/json;charset=UTF-8" + // }, + withCredentials: false, + responseType: "blob", + url: url, + method: 'post', + data: data + }).then((response) => { + //vm.$loading().close(); + let data = response.data; + console.log(response,'response'); + if (data) { + callBackFunction(data); + } else { + if(data.message=='-9999'){ + vm.$router.push({'path': '/login'}); + vm.$alert('浼氳瘽缁撴潫锛岃閲嶆柊鐧诲綍', {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); + }else{ + let a = ''; + if(response.data){ + if(response.data.msg){ + a=response.data.msg + }else { + a='鏈嶅姟鍣ㄦ晠闅�' + } + }else { + a="鏁版嵁閿欒" + } + vm.$alert(a , {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); + } + } + }).catch((e) => { + //vm.$loading().close(); + vm.$alert('鎿嶄綔鍑虹幇寮傚父锛�' + e, {'title': '閿欒', 'type': 'error', 'center': true, 'showClose': false,callback:action=> { + // byUtils.setUser(null); + // vm.$router.push({'path': '/login'}); + }}); + }) + }, + postData4(vm, url, data, successCallBackFunction) { if (StringUtil.isNullOrEmpty(url)) { vm.$alert('璇锋眰鍦板潃涓嶈兘涓虹┖', {'title': '鎻愮ず', 'type': 'warning', 'center': true, 'showClose': false}); -- Gitblit v1.9.1