|
|
|
@ -101,7 +101,8 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<button class="action-btn secondary" @click="submitAbnormalOffline"> |
|
|
|
<button class="action-btn secondary" :disabled="submitLoading" @click="submitAbnormalOffline"> |
|
|
|
<i v-if="submitLoading" class="el-icon-loading"></i> |
|
|
|
{{ buttons.confirmButton }} |
|
|
|
</button> |
|
|
|
<button class="action-btn secondary" @click="closeDialog"> |
|
|
|
@ -160,6 +161,8 @@ export default { |
|
|
|
confirmButton: '确定', |
|
|
|
closeButton: '关闭', |
|
|
|
}, |
|
|
|
submitLoading: false, |
|
|
|
requestSeq: 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -202,6 +205,8 @@ export default { |
|
|
|
this.pageData.remark = ''; |
|
|
|
|
|
|
|
this.titleCon = '异常下机'; |
|
|
|
this.requestSeq += 1; |
|
|
|
this.submitLoading = false; |
|
|
|
}, |
|
|
|
|
|
|
|
/*关闭modal*/ |
|
|
|
@ -221,6 +226,9 @@ export default { |
|
|
|
|
|
|
|
/*提交异常下机*/ |
|
|
|
submitAbnormalOffline() { |
|
|
|
if (this.submitLoading) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
// 如果没有填写下机数量,默认为0 |
|
|
|
if (!this.pageData.returnQty || this.pageData.returnQty === '' || this.pageData.returnQty < 0) { |
|
|
|
this.pageData.returnQty = 0; |
|
|
|
@ -248,11 +256,17 @@ export default { |
|
|
|
remark: this.pageData.remark || '' // 备注(可选,默认为空字符串) |
|
|
|
}; |
|
|
|
|
|
|
|
const currentSeq = this.requestSeq; |
|
|
|
this.submitLoading = true; |
|
|
|
// 调用后端API |
|
|
|
materialReturnDuringProduction(submitData).then(({data}) => { |
|
|
|
if (currentSeq !== this.requestSeq) { |
|
|
|
return; |
|
|
|
} |
|
|
|
//判断是否存在异常 |
|
|
|
if(data.code == 500 || data.code == 400){ |
|
|
|
this.$message.error(data.msg || data.message); |
|
|
|
this.submitLoading = false; |
|
|
|
} else if (data.code == 201) { |
|
|
|
// code=201 表示需要打印标签 |
|
|
|
this.$message.success(data.msg || '操作成功'); |
|
|
|
@ -275,6 +289,10 @@ export default { |
|
|
|
this.closeDialog(); |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
if (currentSeq !== this.requestSeq) { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.submitLoading = false; |
|
|
|
this.$message.error('操作失败:' + (error.message || '未知错误')); |
|
|
|
}); |
|
|
|
}, |
|
|
|
@ -600,6 +618,11 @@ export default { |
|
|
|
&:active { |
|
|
|
transform: scale(0.98); |
|
|
|
} |
|
|
|
|
|
|
|
&:disabled { |
|
|
|
cursor: not-allowed; |
|
|
|
opacity: 0.7; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|