Commit ac9c65bb by liangjianmin

Merge branch 'master' of http://119.23.72.7/xiaokang/cloudSystem

parents 445b6e35 e22a1ead
...@@ -21,4 +21,4 @@ pnpm-debug.log* ...@@ -21,4 +21,4 @@ pnpm-debug.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
/view
...@@ -19,7 +19,7 @@ switch (envs) { ...@@ -19,7 +19,7 @@ switch (envs) {
break; break;
case 'test': case 'test':
//测试环境 //测试环境
NODE_ENVS = ''; NODE_ENVS = 'http://cloud.liexindev.net';
break; break;
case 'production': case 'production':
//线上环境 //线上环境
...@@ -29,6 +29,7 @@ switch (envs) { ...@@ -29,6 +29,7 @@ switch (envs) {
export const http = (method, url, param,loading) => { export const http = (method, url, param,loading) => {
axios.defaults.withCredentials = false; // 不携带cookie
//loading 默认加载loading 传1 不加载 //loading 默认加载loading 传1 不加载
param = param && typeof param === 'object' ? param : {}; param = param && typeof param === 'object' ? param : {};
let token = Util.getCookie('token') || ''; let token = Util.getCookie('token') || '';
...@@ -38,16 +39,19 @@ export const http = (method, url, param,loading) => { ...@@ -38,16 +39,19 @@ export const http = (method, url, param,loading) => {
transformRequest: [function (param) { transformRequest: [function (param) {
return qs.stringify(param); return qs.stringify(param);
}], }],
headers: {
'Authorization': 'Bearer ' + token
},
loading:(loading?false:true) loading:(loading?false:true)
}; };
param.token=token
// if(url!="/auth/cp"&&url!="/auth/login"){
// config.headers={
// 'Authorization': 'Bearer ' + token
// }
// }
// post请求时需要设定Content-Type // post请求时需要设定Content-Type
if (method === 'post') { if (method == 'post'||method == 'POST') {
config.data = param; config.data = param;
} else if (method === 'get') { } else if (method === 'get'||method == 'GET') {
config.params = param; config.params = param;
} }
return axios(config); return axios(config);
......
import Vue from 'vue'; import Vue from 'vue';
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
Vue.use(Loading)
let loadingCount = 0; let loadingCount = 0;
let loading; let loading;
......
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
this.tabss(key) this.tabss(key)
}, },
logout() { logout() {
this.$http('POST', "/auth/logout").then(res => { this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token'); Util.delCookie('token');
if (res.err_code === 0) { if (res.err_code === 0) {
window.location.href = '/#/login'; window.location.href = '/#/login';
......
...@@ -127,8 +127,9 @@ ...@@ -127,8 +127,9 @@
brand_id: '', brand_id: '',
keyword: '' keyword: ''
}, },
disabled:false,
tableData: "", tableData: "",
timer:null,
multipleSelection: [] multipleSelection: []
}; };
}, },
...@@ -212,10 +213,45 @@ ...@@ -212,10 +213,45 @@
}, },
downOut() { downOut() {
if(this.disabled){
Message("正在导出中,请不要重复点击");
return
}
this.$http('post', "/api/brand/export_brand", { this.$http('post', "/api/brand/export_brand", {
brand_id: this.formInline.brand_id, brand_id: this.formInline.brand_id,
keyword: this.formInline.keyword, keyword: this.formInline.keyword,
}).then(res => {}) }).then(res => {
if(res.err_code==0){
this.disabled=true
Message("正在导出中,请耐心等待")
this.timer=setInterval(()=>{
if(!this.disabled){
clearInterval(this.timer)
return
}
this.resultDown(res.data)
},3000)
}
})
},
resultDown(id_){
this.$http('get', "/api/export/get_export_data", {
id:id_
}).then(res => {
if(res.err_code==0){
this.disabled=false
Message("导出成功")
window.location.href=res.data
}else if(res.err_code==-1){
//导出失败
Message(res.data)
this.disabled=false
}
}, error => {
Message('网络出现问题,请检查网络');
this.disabled=false
})
}, },
del() { del() {
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {
......
...@@ -148,7 +148,8 @@ ...@@ -148,7 +148,8 @@
class_id2: '', class_id2: '',
class_id1: '' class_id1: ''
}, },
disabled:false,
timer:null,
tableData: "", tableData: "",
multipleSelection: [], multipleSelection: [],
options: [], options: [],
...@@ -281,13 +282,48 @@ ...@@ -281,13 +282,48 @@
}, },
downOut() { downOut() {
this.$http('post', "/api/brand/export_spu", { if(this.disabled){
Message("正在导出中,请不要重复点击");
return
}
this.$http('post', "/api/spu/export_spu", {
spu_name: this.formInline.goods_name, spu_name: this.formInline.goods_name,
brand_id: this.formInline.brand_id, brand_id: this.formInline.brand_id,
class_id2: this.formInline.class_id2, class_id2: this.formInline.class_id2,
class_id1: this.formInline.class_id1, class_id1: this.formInline.class_id1,
keyword: this.formInline.keyword, keyword: this.formInline.keyword,
}).then(res => {}) }).then(res => {
if(res.err_code==0){
this.disabled=true
Message("正在导出中,请耐心等待")
this.timer=setInterval(()=>{
if(!this.disabled){
clearInterval(this.timer)
return
}
this.resultDown(res.data)
},3000)
}
})
},
resultDown(id_){
this.$http('get', "/api/export/get_export_data", {
id:id_
}).then(res => {
if(res.err_code==0){
this.disabled=false
Message("导出成功")
window.location.href=res.data
}else if(res.err_code==-1){
//导出失败
Message(res.data)
this.disabled=false
}
}, error => {
Message('网络出现问题,请检查网络');
this.disabled=false
})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
......
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
<div class="store-con"> <div class="store-con">
<el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="型号"> <el-form-item label="型号">
<el-autocomplete v-model="formInline.goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync" <el-autocomplete v-model="formInline.goods_name" :trigger-on-focus="false"
placeholder="请输入型号" @select="handleSelectGoodsName" ></el-autocomplete> :fetch-suggestions="querySearchAsync" placeholder="请输入型号" @select="handleSelectGoodsName"></el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="品牌"> <el-form-item label="品牌">
<el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync2" <el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false"
placeholder="请输入品牌" @select="handleSelectBrandName" ></el-autocomplete> :fetch-suggestions="querySearchAsync2" placeholder="请输入品牌" @select="handleSelectBrandName">
</el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-select v-model="formInline.status" placeholder="请选择"> <el-select v-model="formInline.status" placeholder="请选择">
...@@ -178,7 +179,7 @@ ...@@ -178,7 +179,7 @@
<el-table-column label="修改香港交期" min-width="20%"> <el-table-column label="修改香港交期" min-width="20%">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="updatebox"> <div class="updatebox">
<el-input v-model="scope.row.hkhq" placeholder="如:2-5" > <el-input v-model="scope.row.hkhq" placeholder="如:2-5">
</el-input> </el-input>
<div class="selectdw"> <div class="selectdw">
<el-select v-model="scope.row.hkhqdw" placeholder="天" class="placehoload"> <el-select v-model="scope.row.hkhqdw" placeholder="天" class="placehoload">
...@@ -253,7 +254,9 @@ ...@@ -253,7 +254,9 @@
huoqidata: [], huoqidata: [],
kucundata: [], kucundata: [],
tableData: [], tableData: [],
brandList:[], brandList: [],
disabled: false,
timer: null,
}; };
}, },
watch: { watch: {
...@@ -272,7 +275,7 @@ ...@@ -272,7 +275,7 @@
goods_name: this.formInline.goods_name, goods_name: this.formInline.goods_name,
status: this.formInline.status, status: this.formInline.status,
brand_id: this.formInline.brand_id, brand_id: this.formInline.brand_id,
brand_name:this.formInline.brand_name, brand_name: this.formInline.brand_name,
action_time: this.formInline.date[0], action_time: this.formInline.date[0],
end_time: this.formInline.date[1] end_time: this.formInline.date[1]
}).then(res => { }).then(res => {
...@@ -286,21 +289,23 @@ ...@@ -286,21 +289,23 @@
}) })
}, },
handleSelectGoodsName(item) { handleSelectGoodsName(item) {
this.formInline.goods_name=item.value this.formInline.goods_name = item.value
}, },
handleSelectBrandName(item){ handleSelectBrandName(item) {
this.formInline.brand_name=item.value; this.formInline.brand_name = item.value;
this.formInline.brand_id=item.brand_id; this.formInline.brand_id = item.brand_id;
}, },
querySearchAsync(queryString, cb) { querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", { this.$http('get', "/api/search/getspu", {
spu_name: this.formInline.goods_name spu_name: this.formInline.goods_name
}).then(res => { }).then(res => {
if (res.err_code == 0) { if (res.err_code == 0) {
var arrlist_=res.data||[]; var arrlist_ = res.data || [];
var arr_=[] var arr_ = []
for(var i=0;i<arrlist_.length;i++){ for (var i = 0; i < arrlist_.length; i++) {
arr_.push({value:arrlist_[i]['spu_name']}) arr_.push({
value: arrlist_[i]['spu_name']
})
} }
cb(arr_); cb(arr_);
} }
...@@ -311,17 +316,24 @@ ...@@ -311,17 +316,24 @@
brand_name: this.formInline.brand_name brand_name: this.formInline.brand_name
}).then(res => { }).then(res => {
if (res.err_code == 0) { if (res.err_code == 0) {
var arrlist_=res.data||[]; var arrlist_ = res.data || [];
this.brandList=[] this.brandList = []
this.formInline.brand_id="" this.formInline.brand_id = ""
for(var i=0;i<arrlist_.length;i++){ for (var i = 0; i < arrlist_.length; i++) {
this.brandList.push({value:arrlist_[i]['brand_name'],brand_id:arrlist_[i]['brand_id']}) this.brandList.push({
value: arrlist_[i]['brand_name'],
brand_id: arrlist_[i]['brand_id']
})
} }
cb(this.brandList); cb(this.brandList);
} }
}) })
}, },
downOut() { downOut() {
if (this.disabled) {
Message("正在导出中,请不要重复点击");
return
}
this.$http('get', "/api/sku/exportSku", { this.$http('get', "/api/sku/exportSku", {
page: this.page, page: this.page,
limit: this.limit, limit: this.limit,
...@@ -329,7 +341,38 @@ ...@@ -329,7 +341,38 @@
brand_id: this.formInline.brand_id, brand_id: this.formInline.brand_id,
action_time: this.formInline.date[0], action_time: this.formInline.date[0],
end_time: this.formInline.date[1] end_time: this.formInline.date[1]
}).then(res => {}) }).then(res => {
if (res.err_code == 0) {
this.disabled = true
Message("正在导出中,请耐心等待")
this.timer = setInterval(() => {
if (!this.disabled) {
clearInterval(this.timer)
return
}
this.resultDown(res.data)
}, 3000)
}
})
},
resultDown(id_) {
this.$http('get', "/api/export/get_export_data", {
id: id_
}).then(res => {
if (res.err_code == 0) {
this.disabled = false
Message("导出成功")
window.location.href = res.data
} else if (res.err_code == -1) {
//导出失败
Message(res.data)
this.disabled = false
}
}, error => {
Message('网络出现问题,请检查网络');
this.disabled = false
})
}, },
onSubmit() { onSubmit() {
this.page = 1; this.page = 1;
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="http://yunxin.liexindev.net/favicon.ico">
<title>cloudsystem</title>
<link href="http://yunxin.liexindev.net/js/app.js" rel="preload" as="script"></head>
<body>
<noscript>
<strong>网络异常,请稍后加载</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="text/javascript" src="http://yunxin.liexindev.net/js/app.js"></script></body>
</html>
This diff could not be displayed because it is too large.
...@@ -9,7 +9,7 @@ switch (env) { ...@@ -9,7 +9,7 @@ switch (env) {
break; break;
case 'test': case 'test':
//测试环境 //测试环境
NODE_ENV = ''; NODE_ENV = 'http://yunxin.liexindev.net';
break; break;
case 'production': case 'production':
//线上环境 //线上环境
......
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 sign in to comment