替换导入数据接收方式sse
This commit is contained in:
parent
0496907995
commit
083a112e95
@ -42,10 +42,14 @@
|
||||
<slot name="download"></slot>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="importBox" v-if="progressShow">
|
||||
<div class="name">导入进度</div>
|
||||
<el-progress class="exportPopover" :text-inside="true" :stroke-width="12" :percentage="importInfo.rate" />
|
||||
</div>
|
||||
<div class="primaryText" v-if="analysisShow">
|
||||
<div class="text success">正在解析...</div>
|
||||
</div>
|
||||
<div class="errText" v-if="errorShow">
|
||||
<div class="deleteErr" @click="errorClick"><el-icon class="icon"><el-icon-Close/></el-icon></div>
|
||||
<el-scrollbar ref="scrollbar" max-height="120px">
|
||||
@ -74,7 +78,7 @@ export default {
|
||||
size:{type:String, default:'small'},
|
||||
title:{type:String, default: ""},
|
||||
type:{type:[String, Number], default: ""},
|
||||
httpDisabled:{type:Boolean, default:false}
|
||||
httpDisabled:{type:Boolean, default:false},
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
@ -88,6 +92,7 @@ export default {
|
||||
fileShow:false,
|
||||
params:{},
|
||||
|
||||
analysisShow:false,
|
||||
importDis:false,
|
||||
importTrue:false,
|
||||
progressShow:false,
|
||||
@ -106,19 +111,21 @@ export default {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
eventBus.$on('sockBack', this.getWsResult);
|
||||
// eventBus.$on('sockBack', this.getWsResult);
|
||||
|
||||
// eventBus.$on('sseBack', this.getWsResult);
|
||||
eventBus.$on('sseBack', this.getWsResult);
|
||||
},
|
||||
unmounted() {
|
||||
eventBus.$off('sockBack', this.getWsResult);
|
||||
// eventBus.$off('sockBack', this.getWsResult);
|
||||
|
||||
// eventBus.$off('sseBack', this.getWsResult);
|
||||
eventBus.$off('sseBack', this.getWsResult);
|
||||
},
|
||||
methods:{
|
||||
getWsResult(res){
|
||||
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10 || res.data.type == 17 || res.data.type == 18 || res.data.type == 27 || res.data.type == 28 || res.data.type == 31 || res.data.type == 42 || res.data.type == 44 || res.data.type == 45 || res.data.type == 48 || res.data.type == 49 || res.data.type == 50 || res.data.type == 51)){
|
||||
if(this.type == res.data.type){
|
||||
this.analysisShow = false;
|
||||
|
||||
this.importInfo = res.data;
|
||||
this.progressShow = true;
|
||||
this.progressTrue = true;
|
||||
@ -140,6 +147,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
setAnalysisShow(params){
|
||||
this.analysisShow = params;
|
||||
},
|
||||
|
||||
// 导入文件
|
||||
importFile(){
|
||||
this.visible = true;
|
||||
@ -274,6 +285,20 @@ export default {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
.primaryText{
|
||||
margin: 15px 0 0 0;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
background: var(--el-color-primary-light-9);
|
||||
::v-deep .text{
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
.text{
|
||||
color: var(--el-color-primary)
|
||||
}
|
||||
}
|
||||
.errText{
|
||||
margin: 15px 0 0 0;
|
||||
padding: 10px;
|
||||
|
||||
@ -234,6 +234,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.finance.cost.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -239,6 +239,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.early.exclude.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -337,6 +337,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.early.earlyWarn.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -175,6 +175,7 @@ export default {
|
||||
async importUpload(params) {
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -220,6 +220,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.orders.order.sock.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -176,6 +176,7 @@ export default {
|
||||
async importUpload(params) {
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -303,6 +303,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -303,6 +303,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.orders.order.repair.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -175,6 +175,7 @@ export default {
|
||||
async importUpload(params) {
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -175,6 +175,7 @@ export default {
|
||||
async importUpload(params) {
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -111,6 +111,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.setup.material.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -128,6 +128,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.setup.regional.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -106,6 +106,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.setup.spare.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -208,6 +208,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.setup.bom.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -282,6 +282,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.system.company.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -244,6 +244,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.system.spareInfo.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -246,6 +246,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.system.spare.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -300,6 +300,7 @@
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.system.user.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -176,6 +176,7 @@ export default {
|
||||
async importUpload(params) {
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -238,6 +238,7 @@ export default {
|
||||
this.httpDisabled = true;
|
||||
const res = await this.$API.shipment.out.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
@ -176,6 +176,7 @@ export default {
|
||||
async importUpload(params) {
|
||||
const res = await this.$API.orders.order.maintenance.import.post(params);
|
||||
if(res.code == 200){
|
||||
this.$refs.scImport.setAnalysisShow(true);
|
||||
this.$message.success('上传成功,开始导入数据');
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user