|
|
@ -22,7 +22,6 @@ |
|
|
|
<button @click="cancle" class="save-button" style="width: 220rpx;margin-top: 10rpx;margin-right: 10rpx; " type="default">取消</button> |
|
|
|
<button @click="submit" class="save-button" style="width: 220rpx;margin-top: 10rpx;margin-left: 10rpx; " type="primary">确定</button> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
@ -34,6 +33,11 @@ |
|
|
|
import { |
|
|
|
showErrorMsg, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import { |
|
|
|
generateNewPacking, |
|
|
|
unPacking, |
|
|
|
getInventoryLabel |
|
|
|
} from '@/api/index.js'; |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue' |
|
|
|
export default { |
|
|
@ -61,6 +65,7 @@ |
|
|
|
default: true |
|
|
|
}, |
|
|
|
dataContent: {}, |
|
|
|
jobContent:{} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -87,7 +92,8 @@ |
|
|
|
this.$refs['popupqtyedit'].open("center"); |
|
|
|
}, |
|
|
|
//qty当前数量,vaildqty校验的最大数量 , isZero数量是否允许为0 |
|
|
|
openPopup3(item, qty, vaildqty, isZero) { |
|
|
|
openPopup3(jobContent,item, qty, vaildqty, isZero) { |
|
|
|
this.jobContent =jobContent |
|
|
|
this.dataContent = item |
|
|
|
this.value = qty; |
|
|
|
this.defaultValue = vaildqty; |
|
|
@ -128,12 +134,10 @@ |
|
|
|
this.showMessage('数量不能小于0'); |
|
|
|
that.value = that.value; |
|
|
|
} else { |
|
|
|
that.$emit("getvalue", qty); |
|
|
|
that.$refs['popupqtyedit'].close(); |
|
|
|
this.getDataInfo(qty) |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.$emit("getvalue", qty); |
|
|
|
that.$refs['popupqtyedit'].close(); |
|
|
|
this.getDataInfo(qty) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
@ -146,18 +150,156 @@ |
|
|
|
this.showMessage('数量不能小于0'); |
|
|
|
that.value = that.defaultValue; |
|
|
|
} else { |
|
|
|
that.$emit("getvalue", qty); |
|
|
|
that.$refs['popupqtyedit'].close(); |
|
|
|
this.getDataInfo(qty) |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.$emit("getvalue", qty); |
|
|
|
that.$refs['popupqtyedit'].close(); |
|
|
|
this.getDataInfo(qty) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
callBack(qty){ |
|
|
|
var data =this.dataContent; |
|
|
|
var params = { |
|
|
|
fullBarcodeString:data.handledPackingCode , |
|
|
|
itemCode: data.itemCode, |
|
|
|
itemName: data.itemName, |
|
|
|
itemDesc1:data.itemDesc1 , |
|
|
|
itemDesc2: data.itemDesc2, |
|
|
|
lot: data.handledLot, |
|
|
|
supplierBatch: data.handledSupplierBatch, |
|
|
|
arriveDate: data.handledArriveDate, |
|
|
|
produceDate: data.handledProduceDate, |
|
|
|
expireDate:data.handledExpireDate , |
|
|
|
stdPackQty: data.stdPackQty, |
|
|
|
uom: data.uom, |
|
|
|
qty: data.handledQty, |
|
|
|
labelStatus: 1, |
|
|
|
recommendLocationCode:data.handledToLocationCode, |
|
|
|
locationErpCode: data.handledToLocationErpCode, |
|
|
|
containerCode:data.handledContainerCode , |
|
|
|
supplierCode:this.jobContent.supplierCode , |
|
|
|
poNumber:data.poNumber, |
|
|
|
rpNumber:this.jobContent.rpNumber , |
|
|
|
asnNumber: this.jobContent.asnNumber, |
|
|
|
qLevel: "", |
|
|
|
qualityFile:"" , |
|
|
|
prodLine: "", |
|
|
|
team: "", |
|
|
|
shift: "", |
|
|
|
specifications:"" , |
|
|
|
supplierName: this.jobContent.supplierName, |
|
|
|
supplierSimpleName: "", |
|
|
|
supplierItemCode:"", |
|
|
|
supplierItemName: "", |
|
|
|
labelType: 1, |
|
|
|
planArriveDate: this.jobContent.planArriveDate, |
|
|
|
remark: data.remark |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
generateNewPacking(qty,params).then(res=>{ |
|
|
|
if(res){ |
|
|
|
var unPackingParams =this.setUnPackingParams(qty) |
|
|
|
unPacking(unPackingParams).then(res=>{ |
|
|
|
this.$emit("getvalue", qty); |
|
|
|
this.$refs['popupqtyedit'].close(); |
|
|
|
}).catch(error=>{ |
|
|
|
this.showMessage(error.message) |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.showMessage("生成新箱码失败") |
|
|
|
} |
|
|
|
}).catch(error=>{ |
|
|
|
this.showMessage(error.message) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async getDataInfo(qty){ |
|
|
|
try{ |
|
|
|
var labelData = await getInventoryLabel(this.dataContent.handledPackingCode) |
|
|
|
|
|
|
|
var newPackingCodeParam = this.setNewPackingCodeParam(labelData,qty) |
|
|
|
var newPackingCodeData = await generateNewPacking(1,newPackingCodeParam); |
|
|
|
var unPackingParams = this.setUnPackingParams(labelData,qty,newPackingCodeData[0].code) |
|
|
|
var unPackingData = await unPacking(unPackingParams) |
|
|
|
}catch(error){ |
|
|
|
this.showMessage(error) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setNewPackingCodeParam(labelData,qty){ |
|
|
|
var params =labelData; |
|
|
|
params.qty = qty; |
|
|
|
return params; |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setUnPackingParams(labelData,qty,newPackingCode){ |
|
|
|
var data = labelData; |
|
|
|
var itemData =this.dataContent; |
|
|
|
var param = { |
|
|
|
tenantId: data.tenantId, |
|
|
|
remark: "", |
|
|
|
extraProperties: {}, |
|
|
|
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, |
|
|
|
activeDate: data.arriveDate, |
|
|
|
confirmed: true, |
|
|
|
confirmTime: data.arriveDate, |
|
|
|
requestNumber:"", |
|
|
|
jobNumber: "", |
|
|
|
type: "SplitPacking", |
|
|
|
useOnTheWayLocation: false, |
|
|
|
details: [ |
|
|
|
{ |
|
|
|
remark: itemData.remark, |
|
|
|
itemCode: itemData.itemCode, |
|
|
|
itemName:itemData.itemName, |
|
|
|
itemDesc1: itemData.itemDesc1, |
|
|
|
itemDesc2:itemData.itemDesc2, |
|
|
|
uom: itemData.uom, |
|
|
|
qty: qty, |
|
|
|
stdPackQty: itemData.stdPackQty, |
|
|
|
fromPackingCode: itemData.recommendPackingCode, |
|
|
|
fromContainerCode: itemData.recommendContainerCode, |
|
|
|
fromLocationCode: itemData.recommendToLocationCode, |
|
|
|
fromLocationArea: itemData.recommendToLocationArea, |
|
|
|
fromLocationGroup: itemData.recommendToLocationGroup, |
|
|
|
fromLocationErpCode: itemData.recommendToLocationErpCode, |
|
|
|
fromWarehouseCode: itemData.recommendToWarehouseCode, |
|
|
|
fromLot: itemData.recommendLot, |
|
|
|
fromStatus: 1, |
|
|
|
|
|
|
|
toPackingCode: newPackingCode, |
|
|
|
toContainerCode: itemData.handledContainerCode, |
|
|
|
toLocationCode: itemData.handledToLocationCode, |
|
|
|
toLocationArea: itemData.handledToLocationArea, |
|
|
|
toLocationGroup: itemData.handledToLocationGroup, |
|
|
|
toLocationErpCode: itemData.handledToLocationErpCode, |
|
|
|
toWarehouseCode: itemData.handledToWarehouseCode, |
|
|
|
toLot: itemData.handledLot, |
|
|
|
|
|
|
|
toStatus: 1, |
|
|
|
supplierBatch: data.supplierBatch, |
|
|
|
arriveDate: data.arriveDate, |
|
|
|
produceDate: data.produceDate, |
|
|
|
expireDate: data.expireDate, |
|
|
|
|
|
|
|
onTheWayLocationCode: "", |
|
|
|
reason: "" |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
return param; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|