|
|
@ -5,8 +5,8 @@ |
|
|
|
</view> |
|
|
|
<view class="page-wraper" v-if="detailSource.length>0"> |
|
|
|
<view class="flex u-col-center" style="width: 100%;background-color:#fff;"> |
|
|
|
<view class="" style="margin-left: 20rpx; font-size: 30rpx;flex-shrink: 0;">报废原因:</view> |
|
|
|
<view style="width: 100%"> |
|
|
|
<view class="" style="margin-left: 20rpx; font-size: 30rpx;flex-shrink: 0;">报废原因:</view> |
|
|
|
<view style="width: 100%"> |
|
|
|
<uni-data-picker style="background-color:#fff;margin-right: 20rpx;" class='uni-data-picker' |
|
|
|
placeholder="请选择报废原因" popup-title="报废原因" :localdata="reasonList" @change="reasonChange"> |
|
|
|
</uni-data-picker> |
|
|
@ -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; |
|
|
|
} |
|
|
@ -249,42 +251,37 @@ |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
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) |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
var params = this.setRequestParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
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) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|