|
|
@ -10,7 +10,7 @@ |
|
|
|
</view> |
|
|
|
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" |
|
|
|
class='uni-data-picker' placeholder="请选择原因" popup-title="选择报废原因" :localdata="reasonList" |
|
|
|
v-model="reason"> |
|
|
|
@change="reasonChange"> |
|
|
|
</uni-data-picker> |
|
|
|
</view> |
|
|
|
<view class="page-main"> |
|
|
@ -56,12 +56,12 @@ |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle, |
|
|
|
getScarpReasonList |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getInventoryStatusDesc, |
|
|
|
getDirectoryItemArray, |
|
|
|
getScarpReasonList |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -94,27 +94,19 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: '', |
|
|
|
receiptJob: {}, |
|
|
|
received: false, |
|
|
|
isShowPackingCode: true, |
|
|
|
scanCount: 0, |
|
|
|
dataContent: {}, //任务内容 |
|
|
|
subList: [], //接口返回的任务subList |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
locationTypeList: [], |
|
|
|
toLocationInfo: {}, |
|
|
|
businessTypeInfo: {}, |
|
|
|
fromLocationInfo: {}, |
|
|
|
fromLocationCode: "", |
|
|
|
isShowLocation: false, |
|
|
|
fromlocationTypeList: [], |
|
|
|
tolocationTypeList: [], |
|
|
|
allowModifyLocation: false, |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
businessType: {}, |
|
|
|
reasonList: [], |
|
|
|
reason: "", |
|
|
|
reasonText: "", |
|
|
|
reasonCode:"", |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -249,7 +241,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
commit() { |
|
|
|
if(this.reason==""){ |
|
|
|
if(this.reasonText==""){ |
|
|
|
this.showMessage("请先选择报废原因") |
|
|
|
return; |
|
|
|
} |
|
|
@ -259,18 +251,17 @@ |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// scrapRecordSubmit(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) |
|
|
|
// }) |
|
|
|
scrapRecordSubmit(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) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -279,10 +270,26 @@ |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
// detail.packingNumber, detail.batch); |
|
|
|
// detail.toPackingNumber =info.packingNumber; |
|
|
|
// detail.toBatch =info.batch; |
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
detail.itemName = detail.package.itemName; |
|
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
detail.fromPackingNumber = detail.packingNumber; |
|
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
|
|
|
|
|
detail.fromContainerNumber = detail.containerNumber; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|
detail.fromBatch = detail.batch; |
|
|
|
detail.toBatch = detail.batch; |
|
|
|
|
|
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
|
detail.toLocationCode = ""; |
|
|
|
|
|
|
|
detail.reason = this.reasonCode; |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
@ -290,31 +297,7 @@ |
|
|
|
return subList; |
|
|
|
}, |
|
|
|
|
|
|
|
setRequestParams(){ |
|
|
|
var subList = [] |
|
|
|
var supplierCode="" |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
if(supplierCode==""){ |
|
|
|
supplierCode = detail.package.supplierCode |
|
|
|
} |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.supplierCode = supplierCode |
|
|
|
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"; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
@ -345,14 +328,18 @@ |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocationInfo = location; |
|
|
|
this.fromLocationCode = code; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.reasonCode = "" |
|
|
|
this.reasonText = ""; |
|
|
|
this.detailSource = []; |
|
|
|
this.subList =[]; |
|
|
|
this.managementList =[]; |
|
|
|
this.dataContent ={} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
@ -365,6 +352,15 @@ |
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
reasonChange(e) { |
|
|
|
if (e.detail.value.length == 0) { |
|
|
|
this.reasonCode = "" |
|
|
|
this.reasonText = "" |
|
|
|
} else { |
|
|
|
this.reasonCode = e.detail.value[0].value |
|
|
|
this.reasonText = e.detail.value[0].text |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|