|
@ -18,14 +18,12 @@ |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<packageTarget title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" |
|
|
|
|
|
@getScanResult='getToPackingNumber'></packageTarget> |
|
|
|
|
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
<view class="page-footer"> |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
|
|
|
<packageTarget title="目标箱码" :isShowEdit="true" :packingNumber="toPackingNumber" |
|
|
|
|
|
@getScanResult='getToPackingNumber'></packageTarget> |
|
|
</view> |
|
|
</view> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
<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> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</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-pack-and-location> |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
@ -44,6 +42,9 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import { |
|
|
|
|
|
mergePackageRecordSubmit |
|
|
|
|
|
} from '@/api/request2.js'; |
|
|
import { |
|
|
import { |
|
|
goHome |
|
|
goHome |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
@ -87,27 +88,21 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
id: '', |
|
|
id: '', |
|
|
receiptJob: {}, |
|
|
|
|
|
received: false, |
|
|
|
|
|
isShowPackingCode: true, |
|
|
|
|
|
scanCount: 0, |
|
|
scanCount: 0, |
|
|
jobContent: {}, //任务内容 |
|
|
jobContent: {}, //任务内容 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
locationTypeList: [], |
|
|
locationTypeList: [], |
|
|
toLocationInfo: {}, |
|
|
|
|
|
businessTypeInfo: {}, |
|
|
|
|
|
fromLocationInfo: {}, |
|
|
|
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
toLocationInfo: {}, |
|
|
|
|
|
toLocationCode: "", |
|
|
|
|
|
isShowLocation: false, |
|
|
isShowLocation: false, |
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
allowModifyLocation: false, |
|
|
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
toPackingNumber: "" |
|
|
toPackingNumber: "", |
|
|
|
|
|
toBatch:"", |
|
|
|
|
|
currentItemCode: "", |
|
|
|
|
|
dataContent: {} |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
@ -151,9 +146,15 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
|
|
|
if (this.currentItemCode != "" && this.currentItemCode != balance.itemCode) { |
|
|
|
|
|
this.showErrorMessage("合包当前零件号[" + this.currentItemCode + "与扫描零件号[" + balance.itemCode + |
|
|
|
|
|
"]不一致,请扫描相同零件号") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
itemp.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
|
|
|
|
this.currentItemCode = balance.itemCode; |
|
|
this.detailSource.push(itemp) |
|
|
this.detailSource.push(itemp) |
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
@ -231,106 +232,63 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanLocationCode(location, code) { |
|
|
commit() { |
|
|
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
this.toLocationCode = code |
|
|
uni.showLoading({ |
|
|
this.detailSource.forEach(item => { |
|
|
title: "提交中....", |
|
|
item.subList.forEach(detail => { |
|
|
mask: true |
|
|
detail.toLocationCode = code |
|
|
}); |
|
|
}) |
|
|
|
|
|
|
|
|
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("没有要扫描的数据") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
setParams() { |
|
|
if (this.toLocationCode == "") { |
|
|
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
//允许部分提交 |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
var subList = [] |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
var creator = this.$store.state.user.id |
|
|
// (this.id, params).then(res => { |
|
|
this.detailSource.forEach(item => { |
|
|
// uni.hideLoading() |
|
|
item.subList.forEach(detail => { |
|
|
// if (res.data) { |
|
|
if (detail.scaned) { |
|
|
// var hint = res.data.Number; |
|
|
detail.itemCode = detail.itemCode; |
|
|
// this.showCommitSuccessMessage("提交成功" + hint, ) |
|
|
detail.itemName = detail.package.itemName; |
|
|
|
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
// } else { |
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
|
|
|
// this.showErrorMessage(error) |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
detail.fromInventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
detail.toInventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
|
setParams() { |
|
|
detail.fromPackingNumber = detail.fromPackingNumber; |
|
|
var params = { |
|
|
detail.toPackingNumber = this.toPackingNumber; |
|
|
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 => { |
|
|
detail.fromBatch = detail.batch; |
|
|
res.subList.forEach(res1 => { |
|
|
detail.toBatch = detail.batch; |
|
|
if (res1.scaned) { |
|
|
|
|
|
res1.record.FromLocationGroupCode = ""; |
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
res1.record.FromAreaCode = ""; |
|
|
// detail.toLocationCode = detail.toLocationCode; |
|
|
res1.record.ToLocationGroupCode = this.toLocationInfo.LocationGroupCode; |
|
|
|
|
|
res1.record.ToAreaCode = this.toLocationInfo.AreaCode; |
|
|
subList.push(detail) |
|
|
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) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
this.dataContent.subList = subList; |
|
|
return params; |
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
return this.dataContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
@ -361,25 +319,17 @@ |
|
|
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(); |
|
|
}, |
|
|
}, |
|
|
getToLocationCode(location, code) { |
|
|
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.ToLocationCodeInfo = location; |
|
|
|
|
|
this.toLocationCode = code; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.fromLocationCode = ''; |
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
this.toPackingNumber ="" |
|
|
|
|
|
this.toBatch ="" |
|
|
|
|
|
this.currentItemCode ="" |
|
|
|
|
|
this.dataContent ={} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -394,7 +344,14 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getToPackingNumber(result) { |
|
|
getToPackingNumber(result) { |
|
|
|
|
|
if(this.currentItemCode!=result.label.itemCode){ |
|
|
|
|
|
this.showErrorMessage("合包当前零件号[" + this.currentItemCode + "与目标零件号[" + result.label.itemCode + |
|
|
|
|
|
"]不一致,请扫描相同零件号") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.toPackingNumber = result.label.packingNumber; |
|
|
this.toPackingNumber = result.label.packingNumber; |
|
|
|
|
|
this.toBatch =result.label.batch |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|