Commit 51945078 by 肖康

x

parent 68d84cfc
......@@ -127,8 +127,9 @@
brand_id: '',
keyword: ''
},
disabled:false,
tableData: "",
timer:null,
multipleSelection: []
};
},
......@@ -212,10 +213,45 @@
},
downOut() {
if(this.disabled){
Message("正在导出中,请不要重复点击");
return
}
this.$http('post', "/api/brand/export_brand", {
brand_id: this.formInline.brand_id,
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() {
if (this.multipleSelection.length == 0) {
......
......@@ -148,7 +148,8 @@
class_id2: '',
class_id1: ''
},
disabled:false,
timer:null,
tableData: "",
multipleSelection: [],
options: [],
......@@ -281,13 +282,48 @@
},
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,
brand_id: this.formInline.brand_id,
class_id2: this.formInline.class_id2,
class_id1: this.formInline.class_id1,
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) {
......
......@@ -3,12 +3,13 @@
<div class="store-con">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="型号">
<el-autocomplete v-model="formInline.goods_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync"
placeholder="请输入型号" @select="handleSelectGoodsName" ></el-autocomplete>
<el-autocomplete v-model="formInline.goods_name" :trigger-on-focus="false"
:fetch-suggestions="querySearchAsync" placeholder="请输入型号" @select="handleSelectGoodsName"></el-autocomplete>
</el-form-item>
<el-form-item label="品牌">
<el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false" :fetch-suggestions="querySearchAsync2"
placeholder="请输入品牌" @select="handleSelectBrandName" ></el-autocomplete>
<el-autocomplete v-model="formInline.brand_name" :trigger-on-focus="false"
:fetch-suggestions="querySearchAsync2" placeholder="请输入品牌" @select="handleSelectBrandName">
</el-autocomplete>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="formInline.status" placeholder="请选择">
......@@ -178,7 +179,7 @@
<el-table-column label="修改香港交期" min-width="20%">
<template slot-scope="scope">
<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>
<div class="selectdw">
<el-select v-model="scope.row.hkhqdw" placeholder="天" class="placehoload">
......@@ -253,7 +254,9 @@
huoqidata: [],
kucundata: [],
tableData: [],
brandList:[],
brandList: [],
disabled: false,
timer: null,
};
},
watch: {
......@@ -272,7 +275,7 @@
goods_name: this.formInline.goods_name,
status: this.formInline.status,
brand_id: this.formInline.brand_id,
brand_name:this.formInline.brand_name,
brand_name: this.formInline.brand_name,
action_time: this.formInline.date[0],
end_time: this.formInline.date[1]
}).then(res => {
......@@ -286,21 +289,23 @@
})
},
handleSelectGoodsName(item) {
this.formInline.goods_name=item.value
this.formInline.goods_name = item.value
},
handleSelectBrandName(item){
this.formInline.brand_name=item.value;
this.formInline.brand_id=item.brand_id;
handleSelectBrandName(item) {
this.formInline.brand_name = item.value;
this.formInline.brand_id = item.brand_id;
},
querySearchAsync(queryString, cb) {
this.$http('get', "/api/search/getspu", {
spu_name: this.formInline.goods_name
}).then(res => {
if (res.err_code == 0) {
var arrlist_=res.data||[];
var arr_=[]
for(var i=0;i<arrlist_.length;i++){
arr_.push({value:arrlist_[i]['spu_name']})
var arrlist_ = res.data || [];
var arr_ = []
for (var i = 0; i < arrlist_.length; i++) {
arr_.push({
value: arrlist_[i]['spu_name']
})
}
cb(arr_);
}
......@@ -311,17 +316,24 @@
brand_name: this.formInline.brand_name
}).then(res => {
if (res.err_code == 0) {
var arrlist_=res.data||[];
this.brandList=[]
this.formInline.brand_id=""
for(var i=0;i<arrlist_.length;i++){
this.brandList.push({value:arrlist_[i]['brand_name'],brand_id:arrlist_[i]['brand_id']})
var arrlist_ = res.data || [];
this.brandList = []
this.formInline.brand_id = ""
for (var i = 0; i < arrlist_.length; i++) {
this.brandList.push({
value: arrlist_[i]['brand_name'],
brand_id: arrlist_[i]['brand_id']
})
}
cb(this.brandList);
}
})
},
downOut() {
if (this.disabled) {
Message("正在导出中,请不要重复点击");
return
}
this.$http('get', "/api/sku/exportSku", {
page: this.page,
limit: this.limit,
......@@ -329,7 +341,38 @@
brand_id: this.formInline.brand_id,
action_time: this.formInline.date[0],
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() {
this.page = 1;
......
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