|
|
@ -18,14 +18,12 @@ |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<packageTarget title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" |
|
|
|
@getScanResult='getToPackingNumber'></packageTarget> |
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
|
<view class=""> |
|
|
|
<packageTarget title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" |
|
|
|
@getScanResult='getToPackingNumber'></packageTarget> |
|
|
|
</view> |
|
|
|
<view class=" uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
@ -35,7 +33,7 @@ |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' allowModifyLocation="false"> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false"> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
@ -44,6 +42,9 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
mergePackageRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
|
goHome |
|
|
|
} from '@/common/basic.js'; |
|
|
@ -87,27 +88,21 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
id: '', |
|
|
|
receiptJob: {}, |
|
|
|
received: false, |
|
|
|
isShowPackingCode: true, |
|
|
|
scanCount: 0, |
|
|
|
jobContent: {}, //任务内容 |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
locationTypeList: [], |
|
|
|
toLocationInfo: {}, |
|
|
|
businessTypeInfo: {}, |
|
|
|
fromLocationInfo: {}, |
|
|
|
fromLocationCode: "", |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationCode: "", |
|
|
|
isShowLocation: false, |
|
|
|
fromlocationTypeList: [], |
|
|
|
tolocationTypeList: [], |
|
|
|
allowModifyLocation: false, |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
businessType: {}, |
|
|
|
toPackingNumber: "" |
|
|
|
toPackingNumber: "", |
|
|
|
toBatch:"", |
|
|
|
currentItemCode: "", |
|
|
|
dataContent: {} |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -151,9 +146,15 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
if (this.currentItemCode != "" && this.currentItemCode != balance.itemCode) { |
|
|
|
this.showErrorMessage("合包当前零件号[" + this.currentItemCode + "与扫描零件号[" + balance.itemCode + |
|
|
|
"]不一致,请扫描相同零件号") |
|
|
|
return; |
|
|
|
} |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.currentItemCode = balance.itemCode; |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
@ -231,106 +232,63 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
scanLocationCode(location, code) { |
|
|
|
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
|
this.toLocationCode = code |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
detail.toLocationCode = code |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
mergePackageRecordSubmit(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) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("没有要扫描的数据") |
|
|
|
} |
|
|
|
//允许部分提交 |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// (this.id, params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// var hint = res.data.Number; |
|
|
|
// this.showCommitSuccessMessage("提交成功" + hint, ) |
|
|
|
|
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
var params = { |
|
|
|
requestNumber: this.jobContent.requestNumber, |
|
|
|
jobNumber: "", |
|
|
|
asnNumber: this.jobContent.asnNumber, |
|
|
|
ppNumber: this.jobContent.ppNumber, |
|
|
|
supplierCode: this.jobContent.supplierCode, |
|
|
|
ReceiptDock: this.jobContent.ReceiptDock, |
|
|
|
carrierCode: this.jobContent.carrierCode, |
|
|
|
TransferMode: this.jobContent.TransferMode, |
|
|
|
vehiclePlateNumber: this.jobContent.vehiclePlateNumber, |
|
|
|
fromWarehouseCode: this.toLocationInfo.WarehouseCode, |
|
|
|
toWarehouseCode: this.toLocationInfo.WarehouseCode, |
|
|
|
OutTransaction: this.businessTypeInfo.OutTransactionType, //出库事务类型 |
|
|
|
InTransaction: this.businessTypeInfo.InTransactionType, //入库事务类型 |
|
|
|
executeTime: "2023-08-4 16:30:11", //执行时间 |
|
|
|
activeDate: "2023-08-4 16:30:11", //生效时间 |
|
|
|
available: "1", //是否可用 0不可用,1可用 |
|
|
|
requestTime: this.jobContent.requestTime, |
|
|
|
dueTime: "2023-08-4 16:30:11", //截止时间 |
|
|
|
departmentCode: this.jobContent.departmentCode, |
|
|
|
UserPositionCode: "", //岗位 |
|
|
|
interfaceType: "jklxPURCHASE_RECEIPT", //接口类型 |
|
|
|
Number: this.jobContent.Number, |
|
|
|
businessType: this.jobContent.businessType, |
|
|
|
Remark: this.jobContent.Remark, |
|
|
|
creationTime: this.jobContent.creationTime, |
|
|
|
Creatorld: this.jobContent.Creatorld, |
|
|
|
creatorName: this.jobContent.creatorName, |
|
|
|
extraProperties: this.jobContent.extraProperties, |
|
|
|
Siteld: this.jobContent.Siteld, |
|
|
|
Code: "", |
|
|
|
subList: [ |
|
|
|
|
|
|
|
], |
|
|
|
} |
|
|
|
|
|
|
|
this.detailSource.forEach(res => { |
|
|
|
res.subList.forEach(res1 => { |
|
|
|
if (res1.scaned) { |
|
|
|
res1.record.FromLocationGroupCode = ""; |
|
|
|
res1.record.FromAreaCode = ""; |
|
|
|
res1.record.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode; |
|
|
|
res1.record.ToAreaCode = this.toLocationInfo.AreaCode; |
|
|
|
res1.record.VisualInspectResult = ""; //目检结果 |
|
|
|
res1.record.VisualInspectPhotos = ""; //目检照片 |
|
|
|
res1.record.FailedReason = ""; //不合格原因 |
|
|
|
res1.record.MassDefect = ""; //质量缺陷 |
|
|
|
res1.record.SinglePrice = ""; //单价 |
|
|
|
res1.record.Amount = ""; //金额 |
|
|
|
res1.record.Code = ""; |
|
|
|
res1.record.JobDetailID = res1.record.id; |
|
|
|
res1.record.interfaceType = "jklxPURCHASE_RECEIPT"; |
|
|
|
params.subList.push(res1.record) |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
detail.itemName = detail.package.itemName; |
|
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
detail.fromInventoryStatus = detail.inventoryStatus; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
detail.fromPackingNumber = detail.fromPackingNumber; |
|
|
|
detail.toPackingNumber = this.toPackingNumber; |
|
|
|
|
|
|
|
detail.fromBatch = detail.batch; |
|
|
|
detail.toBatch = detail.batch; |
|
|
|
|
|
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
|
// detail.toLocationCode = detail.toLocationCode; |
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
return params; |
|
|
|
this.dataContent.subList = subList; |
|
|
|
this.dataContent.creator = creator; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
@ -361,25 +319,17 @@ |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocationInfo = location; |
|
|
|
this.fromLocationCode = code; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getToLocationCode(location, code) { |
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
uni.showToast({ |
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.ToLocationCodeInfo = location; |
|
|
|
this.toLocationCode = code; |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.toPackingNumber ="" |
|
|
|
this.toBatch ="" |
|
|
|
this.currentItemCode ="" |
|
|
|
this.dataContent ={} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
@ -394,7 +344,14 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
getToPackingNumber(result) { |
|
|
|
if(this.currentItemCode!=result.label.itemCode){ |
|
|
|
this.showErrorMessage("合包当前零件号[" + this.currentItemCode + "与目标零件号[" + result.label.itemCode + |
|
|
|
"]不一致,请扫描相同零件号") |
|
|
|
return; |
|
|
|
} |
|
|
|
this.toPackingNumber = result.label.packingNumber; |
|
|
|
this.toBatch =result.label.batch |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|