|
|
|
@ -458,7 +458,7 @@ |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|
|
|
<el-button type="primary" @click="saveDeclaration()">保存</el-button> |
|
|
|
<el-button type="primary" :loading="saveLoading" :disabled="saveLoading" @click="saveDeclaration()">保存</el-button> |
|
|
|
<el-button type="primary" @click="declarationFlag=false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
@ -496,6 +496,7 @@ |
|
|
|
dataList2:[], |
|
|
|
detailList:[], |
|
|
|
dataListLoading: false, |
|
|
|
saveLoading: false, |
|
|
|
searchData: { |
|
|
|
page: 1, |
|
|
|
limit: 100, |
|
|
|
@ -1440,6 +1441,11 @@ |
|
|
|
this.declarationData.salesArea=this.customerMap.get(this.declarationData.overseasShipper) |
|
|
|
}, */ |
|
|
|
saveDeclaration(){ |
|
|
|
// 防止重复点击 |
|
|
|
if(this.saveLoading) { |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
if(this.detailList==null|| this.detailList.length<1){ |
|
|
|
this.$alert('不存在明细记录!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
@ -1454,7 +1460,11 @@ |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 开始loading |
|
|
|
this.saveLoading = true |
|
|
|
this.declarationData.detailList=this.detailList |
|
|
|
|
|
|
|
saveDeclaration(this.declarationData).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -1465,6 +1475,15 @@ |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
// 处理请求异常 |
|
|
|
this.$alert('保存失败,请重试!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
console.error('保存报关单失败:', error) |
|
|
|
}).finally(() => { |
|
|
|
// 无论成功失败都要关闭loading |
|
|
|
this.saveLoading = false |
|
|
|
}); |
|
|
|
}, |
|
|
|
//导出excel |
|
|
|
|