Commit 19b086e9 authored by 黄奎's avatar 黄奎

页面修改

parent a8a12b25
......@@ -467,7 +467,7 @@ export default {
let msg = this.msg;
msg = JSON.parse(JSON.stringify(msg));
msg.pageSize=999;
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/product/GetProductGoodsListToExcel",
msg,
"商品列表.xls"
......
......@@ -131,7 +131,7 @@
Export(){
this.msg.ExcelEnumIds=this.checkedCities;
let msg = JSON.parse(JSON.stringify(this.msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/order/GetMembersToBuyToExcel",
msg,
"会员购买列表.xls"
......
......@@ -255,7 +255,7 @@
Export(){
this.msg.ExcelEnumIds=this.checkedCities;
let msg = JSON.parse(JSON.stringify(this.msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/user/GetDistributorRemitListToExcel",
msg,
"分销提现.xls"
......
......@@ -310,7 +310,7 @@ export default {
Export(){
this.msg.ExcelEnumIds=this.checkedCities;
let msg = JSON.parse(JSON.stringify(this.msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/order/GetDistributionOrdersToExcel",
msg,
"分销订单列表.xls"
......
......@@ -633,7 +633,7 @@
if(!msg.UserId && msg.UserId==''){
msg.UserId=0;
}
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/user/GetDistributorListToExcel",
msg,
"分销商.xls"
......
......@@ -303,7 +303,7 @@
if(!msg.Id ||msg.Id==''){
msg.Id=0;
}
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/user/GetMemberUserListToExcel",
msg,
"用户管理.xls"
......
......@@ -692,7 +692,7 @@ export default {
Export(){
this.msg.ExcelEnumIds=this.checkedCities;
let msg = JSON.parse(JSON.stringify(this.msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/order/GetDistributionOrdersToExcel",
msg,
"售后订单.xls"
......
......@@ -1022,7 +1022,7 @@
Export() {
this.msg.ExcelEnumIds = this.checkedCities;
let msg = JSON.parse(JSON.stringify(this.msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/order/GetMemberUserListToExcel",
msg,
"订单列表.xls"
......
......@@ -177,7 +177,7 @@
ExcelEnumIds:this.checkedCities
}
msg = JSON.parse(JSON.stringify(msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/Integral/GetDistributorRemitListToExcel",
msg,
"积分记录.xls"
......
......@@ -175,7 +175,7 @@
ExcelEnumIds:this.checkedCities
}
msg = JSON.parse(JSON.stringify(msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/Recharge/GetDistributorRemitListToExcel",
msg,
"余额收支.xls"
......
......@@ -219,7 +219,7 @@
EndDate :this.msg.EndDate,
}
msg = JSON.parse(JSON.stringify(msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/Coupon/GetCouponListToExcel",
msg,
"优惠券-发布统计.xls"
......
......@@ -179,7 +179,7 @@
EndDate :this.msg.EndDate,
}
msg = JSON.parse(JSON.stringify(msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/Integral/GetIntegralListToExcel",
msg,
"积分收支.xls"
......
......@@ -168,7 +168,7 @@
Source :this.msg.Source ,
}
msg = JSON.parse(JSON.stringify(msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/User/GetRankingListToExcel",
msg,
"分销排行.xls"
......
......@@ -305,7 +305,7 @@
}
msg = JSON.parse(JSON.stringify(msg));
this.JavaGetLocalFile(
this.GetLocalFile(
"/api/Statistics/GetSellExcel",
msg,
"销售统计.xls"
......
......@@ -417,7 +417,7 @@
<div class="el-card">
<div class="el-zanIndex_btmheader">
<span>商品购买力TOP排行</span>
<el-button type="primary" class="ZexportBtn" size="mini">导出TOP100</el-button>
<el-button type="primary" class="ZexportBtn" size="mini" @click="DownLoadSalesGoods">导出TOP100</el-button>
</div>
<div class="table_Inner">
<el-table :data="saleIncomeData" style="width: 100%">
......@@ -462,7 +462,7 @@
<div class="el-card">
<div class="el-zanIndex_btmheader">
<span>用户购买力TOP排行</span>
<el-button type="primary" class="ZexportBtn" size="mini">导出TOP100</el-button>
<el-button type="primary" class="ZexportBtn" size="mini" @click="DownLoadSalesUser">导出TOP100</el-button>
</div>
<div class="table_Inner table2">
<el-table :data="saleUserData" style="width: 100%">
......@@ -746,6 +746,24 @@
};
myChart.setOption(option, true);
},
//商品购买力TOP排行
DownLoadSalesGoods() {
this.GetLocalFile(
"/api/Export/DownLoad",
this.basicQMsg,
"商品购买力TOP排行.xls",
"getSalesGoodTop"
);
},
//用户购买力TOP排行
DownLoadSalesUser() {
this.GetLocalFile(
"/api/Export/DownLoad",
this.basicQMsg,
"用户购买力TOP排行.xls",
"getSalesUserTop"
);
}
},
mounted() {
this.getChange();
......
......@@ -54,11 +54,7 @@ export default {
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = '';
//domainUrl = "http://192.168.2.214:8200"
// domainUrl = "http://192.168.2.65";
// domainUrl = "https://localhost:5001";
domainUrl = "http://mallapi.oytour.com";
domainUrl = "http://192.168.2.214:8200"
let locationName = window.location.hostname;
if (locationName.indexOf('testmall.oytour') !== -1) {
domainUrl = "http://mallapi.oytour.com";
......@@ -71,8 +67,8 @@ export default {
//常用提交数据URL
PostUrl: domainUrl + "/api/common/post",
ImageUrl: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com',
UploadFileUrl:domainUrl + '/api/File/LocalFileUploadImport',
UploadBlob:domainUrl + '/api/File/UploadBlob',
UploadFileUrl: domainUrl + '/api/File/LocalFileUploadImport',
UploadBlob: domainUrl + '/api/File/UploadBlob',
};
return obj;
......@@ -115,7 +111,6 @@ export default {
}
item[filed] = value;
},
//是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
......@@ -197,57 +192,10 @@ export default {
return str;
}
}
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().DomainUrl + cmd;
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId=0;//员工编号【员工登录时使用】
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId=this.getLocalStorage().EmpId;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"languageId": tempLanguage,
"cmd": cmd,
"MallBaseId": MallBaseId,
"TenantId": TenantId,
"EmpId":EmpId
}
var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
......@@ -266,58 +214,78 @@ export default {
}
}, faildCall)
}
Vue.prototype.JavaGetLocalFile = function (cmd, msg, fileName, successCall) {
var apiurl = this.domainManager().DomainUrl + cmd;
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
}
let mall_userInfo = localStorage.mall_userInfo ? JSON.parse(localStorage.mall_userInfo) : '';
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
//获取请求参数
Vue.prototype.GetPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
this.$route.path.toLowerCase() != "/login" &&
this.$route.path.toLowerCase() != "/register" &&
this.$route.path.toLowerCase() != "/forgetpassword"
) {
this.$router.push({
path: '/login'
})
}
var token = "";
var key = "";
var MallBaseId = "0"; //小程序ID
var TenantId = "0"; //商户Id
var EmpId = 0; //员工编号【员工登录时使用】
if (this.getLocalStorage() != null) {
token = this.getLocalStorage().Token;
key = this.getLocalStorage().SecretKey;
MallBaseId = this.getLocalStorage().MallBaseId;
TenantId = this.getLocalStorage().TenantId;
EmpId = this.getLocalStorage().EmpId;
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
}
return postData
},
//文件下载
Vue.prototype.GetLocalFile = function (cmd, msg, fileName, newCmd, successCall) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetPostData(cmd, msg, newCmd);
this.$http.post(apiurl, postData, {
responseType: 'arraybuffer'
}).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function (res) {});
}
var postData = {
"msg": msg,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"languageId": tempLanguage,
"cmd": cmd,
"MallBaseId": MallBaseId,
}
this.$http.post(apiurl, postData, {
responseType: 'arraybuffer'
}).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function (res) {});
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment