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