Commit 51945078 by 肖康

x

parent 68d84cfc
...@@ -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;
......
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