|
|
@ -54,7 +54,9 @@ |
|
|
|
|
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle |
|
|
|
updateTitle, |
|
|
|
getCurrDateOneMonthsTimes, |
|
|
|
navigateBack |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -126,7 +128,7 @@ |
|
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
} else { |
|
|
|
this.$refs.comMessage.showBreakMessage(res.message ); |
|
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -235,11 +237,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
commit() { |
|
|
|
if(this.reasonText==""){ |
|
|
|
if (this.reasonText == "") { |
|
|
|
this.showMessage("请先选择报废原因") |
|
|
|
return; |
|
|
|
} |
|
|
|
if(this.detailSource.length==0){ |
|
|
|
if (this.detailSource.length == 0) { |
|
|
|
this.showErrorMessage("请先扫描数据") |
|
|
|
return; |
|
|
|
} |
|
|
@ -251,40 +253,35 @@ |
|
|
|
|
|
|
|
var params = this.setRequestParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// scrapRequestCreate(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
scrapRequestCreate(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成报废出库申请<br>" + res.data, ) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setRequestParams(){ |
|
|
|
setRequestParams() { |
|
|
|
var subList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
detail.fromLocationCode = detail.locationCode |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.businessType = "PurchasePutaway" |
|
|
|
this.dataContent.departmentCode= "研发部门"; |
|
|
|
this.dataContent.status= 1 ; |
|
|
|
this.dataContent.autoCommit = "FALSE"; |
|
|
|
this.dataContent.autoAgree = "FALSE"; |
|
|
|
this.dataContent.autoExecute = "FALSE"; |
|
|
|
this.dataContent.directCreateRecord = "FALSE"; |
|
|
|
this.dataContent.status = 1; |
|
|
|
this.dataContent.fromWarehouseCode = "W1"; |
|
|
|
this.dataContent.dueTime = getCurrDateOneMonthsTimes(); |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
@ -324,8 +321,7 @@ |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
|
|
navigateBack(1) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|