Browse Source

【NEV-PC】回收料recDetails传参更改+成功后打印功能开发

ag_report_nev
安虹睿 1 year ago
parent
commit
5f9780a983
  1. 205
      fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue

205
fe/PC/src/views/inventoryManage/recycledMaterials/materialsAdjustmentFunc.vue

@ -73,7 +73,6 @@
<div class="addPopContent addPopContent_YL">
<span class="addPopTypeTitle">原料</span>
<currenTableFlex
ref="flexTable_Ref"
:flexTableData="addPopData_YL"
:flexSearchOptions="editOptions"
:flexTableColumns="addPopColumns_YL"
@ -114,6 +113,7 @@ import detailsRules from '@/utils/rules';
import { getPageList,itemTransformNewCreate } from "@/api/wms-api"
import { postInventoryLabelCode_count } from "@/api/wms-core"
import { getNowToT,formatTimeStampToNorm } from '@/utils/formatTime'
import {initPrintPackingCodeData } from "@/mixins/printMixin"
import store from '@/store'
export default {
name: "materialsAdjustmentFunc",
@ -152,7 +152,9 @@ export default {
//
addPopColumns_FS:[
{ type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilter("isRecycled","true"),1000)},
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",
this.isFilter("isRecycled","true"),1000
)},
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '', this.addPopData_HB) },
width:"auto"
},
@ -243,7 +245,7 @@ export default {
//
addPopColumns_HB:[
{ type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code",
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilterForHB(),1000)},
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilter("isRecycled","false"),1000)},
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '', this.addPopData_HB) },
width:"auto",
},
@ -294,24 +296,24 @@ export default {
},
methods:{
//
isFilterForHB(){
let _items = []
this.addPopData_FS.forEach(item=>{
if(item.itemCode)_items.push(item.itemCode)
})
if(_items.length <= 0){
return []
}
let filter = [
{
logic: "And",
column: 'code',
action: "NotIn",
value: JSON.stringify(_items)
}
]
return filter
},
// isFilterForHB(){
// let _items = []
// this.addPopData_FS.forEach(item=>{
// if(item.itemCode)_items.push(item.itemCode)
// })
// if(_items.length <= 0){
// return []
// }
// let filter = [
// {
// logic: "And",
// column: 'code',
// action: "NotIn",
// value: JSON.stringify(_items)
// }
// ]
// return filter
// },
//
isFilter (val, data) {
let filter = [
@ -434,32 +436,37 @@ export default {
}
_details.push(_item)
})
let _recDetail= [
{
let _recDetail= []
this.addPopData_FS.forEach((item,index)=>{
let _itemInfoFS = this.itemStagingLists[item.itemCode]
let _locationInfoFS = this.locationStagingLists[item.locationCode]
let _item = {
remark: null,
itemCode: _toItemInfo.code || null,
itemName: _toItemInfo.name || null,
itemDesc1: _toItemInfo.desc1 || null,
itemDesc2: _toItemInfo.desc2 || null,
lot: _toData_new.lot || null,
supplierBatch: _toData_new.supplierBatch || null,
arriveDate: _toData_new.arriveDate || null,
produceDate: _toData_new.produceDate || null,
expireDate: _toData_new.expireDate || null,
packingCode: _toData_new.code,
containerCode: _toData_new.containerCode || null,
uom: _toItemInfo.basicUom || null,
qty: _toData.qty,
stdPackQty: Number(_toItemInfo.stdPackQty) || 0,
locationCode: _toData.locationCode || null,
locationArea: _toLocationInfo.areaCode || null,
locationGroup: _toLocationInfo.locationGroupCode || null,
locationErpCode: _toLocationInfo.erpLocationCode || null,
itemCode: _itemInfoFS.code || null,
itemName: _itemInfoFS.name || null,
itemDesc1: _itemInfoFS.desc1 || null,
itemDesc2: _itemInfoFS.desc2 || null,
lot: this.newPackArr[index].lot || null,
supplierBatch: this.newPackArr[index].supplierBatch || null,
arriveDate: this.newPackArr[index].arriveDate || null,
produceDate: this.newPackArr[index].produceDate || null,
expireDate: this.newPackArr[index].expireDate || null,
packingCode: this.newPackArr[index].code,
containerCode: this.newPackArr[index].containerCode || null,
uom: _itemInfoFS.basicUom || null,
qty: item.qty,
stdPackQty: Number(_itemInfoFS.stdPackQty) || 0,
locationCode: item.locationCode || null,
locationArea: _locationInfoFS.areaCode || null,
locationGroup: _locationInfoFS.locationGroupCode || null,
locationErpCode: _locationInfoFS.erpLocationCode || null,
status: 1,
warehouseCode: _toLocationInfo.warehouseCode || null,
warehouseCode: _locationInfoFS.warehouseCode || null,
reasonCode: null,
}
]
_recDetail.push(_item)
})
let _finalData = {
tenantId: null,
remark: "",
@ -472,11 +479,45 @@ export default {
details:_details,
recDetails:_recDetail
}
itemTransformNewCreate(_finalData)
.then(item=>{
this.$successMsg("提交成功!")
this.initAddPopData()
this.Loading.appMainLoading = false
//
this.$confirm('提交成功, 是否需要打印箱标签?', '提示', {
confirmButtonText: '打印',
cancelButtonText: '关闭',
type: 'warning'
}).then(() => {
let _HBPack = this.newPackArr[this.newPackArr.length - 1]
let _printData = {
supplierSimpleName:_HBPack.supplierSimpleName || "",
supplierCode:_HBPack.supplierCode || "",
contacts:_HBPack.contacts || "",
customerAddressCode:_HBPack.customerAddressCode || "",
remark:_HBPack.remark || "",
planArriveDate:_HBPack.planArriveDate || "",
poNumber:_HBPack.poNumber || "",
asnNumber:_HBPack.asnNumber || "",
details:[],
}
_HBPack.packingCode = _HBPack.code
_printData.details.push(_HBPack)
let _data = initPrintPackingCodeData(_printData);
this.Loading.appMainLoading = true
this.Print(_data)
.then(data=>{
this.initAddPopData()
this.Loading.appMainLoading = false
})
.catch(err=>{
this.$errorMsg(`打印失败,可去标签查询中重新打印,箱标签为${_HBPack.packingCode}`)
this.initAddPopData()
this.Loading.appMainLoading = false
})
}).catch(() => {
this.initAddPopData()
});
})
.catch(err=>{
this.$errorMsg("提交失败!请重试")
@ -515,7 +556,7 @@ export default {
itemName: _item_info.name || null,
itemDesc1: _item_info.desc1 || null,
itemDesc2: _item_info.desc2 || null,
lot: formatTimeStampToNorm(new Date(),'date'),
lot: formatTimeStampToNorm(new Date(),'date').replaceAll("-",""),
arriveDate: getNowToT(),
produceDate: getNowToT(),
expireDate: "9999-12-31",
@ -536,11 +577,11 @@ export default {
team: null,
shift: null,
specifications: null,
supplierBatch: null,//todo
supplierName: null,//todo:basedata/supplier-item/list
supplierBatch: null,
supplierName: null,
supplierSimpleName: _supplier_info.supplierSimpleName,
supplierItemCode: _supplier_info.supplierItemCode,
supplierItemName: null,//todo:basedata/supplier-item/list
supplierItemName: _supplier_info.itemName,
labelType: 1,//
planArriveDate: "9999-12-31",
remark:null,
@ -555,7 +596,8 @@ export default {
},
//
addPopSureHandle(){
//
//
let _err_FS=0
this.addPopData_FS.forEach(item=>{
if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode || !item.supplierCode || !item.poNumber){
@ -563,10 +605,10 @@ export default {
}
})
if(_err_FS > 0){
return this.$warningMsg("粉碎料信息未填全,请填写")
return this.$warningMsg("粉碎料信息未填全,请填写")
}
//
//
let _err_YL=0
this.addPopData_YL.forEach(item=>{
if(!item.itemCode || Number(item.inventoryQty <= 0) || Number(item.qty <= 0) || !item.locationCode || !item.packingCode || item.packingCode.length <= 0){
@ -574,10 +616,21 @@ export default {
}
})
if(_err_YL > 0){
return this.$warningMsg("原料信息未填全,请填写")
return this.$warningMsg("【原料】信息未填全,请填写")
}
//
let notPass_YL = 0
this.addPopData_YL.forEach(item=>{
if(item.qty > item.inventoryQty){
notPass_YL++
}
})
if(notPass_YL > 0){
return this.$warningMsg("【原料】数量不可以大于库存数量,请更改")
}
//
//
let _err_HB=0
this.addPopData_HB.forEach(item=>{
if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode || !item.supplierCode || !item.poNumber){
@ -585,7 +638,15 @@ export default {
}
})
if(_err_HB > 0){
return this.$warningMsg("混拌料信息未填全,请填写")
return this.$warningMsg("【混拌料】信息未填全,请填写")
}
// +
let _maxQty_HB = 0
this.addPopData_FS.forEach(item=>{ _maxQty_HB += Number(item.qty) })
this.addPopData_YL.forEach(item=>{ _maxQty_HB += Number(item.qty) })
if(Number(this.addPopData_HB[0].qty) > _maxQty_HB){
return this.$warningMsg(`【混拌料】数量,不可大于${_maxQty_HB} (粉碎料数量加原料数量的总和)`)
}
//
@ -605,12 +666,12 @@ export default {
pushFS(data){
if(data[1].prop == "itemCode"){
this.itemStagingLists[data[2]] = data[0]
if(data[2] == this.addPopData_HB[0].itemCode){
this.$warningMsg("不可选择与混拌料相同的物料")
this.$nextTick(()=>{
this.addPopData_FS[data[3].$index].itemCode = null
})
}
// if(data[2] == this.addPopData_HB[0].itemCode){
// this.$warningMsg("")
// this.$nextTick(()=>{
// this.addPopData_FS[data[3].$index].itemCode = null
// })
// }
this.addPopData_FS[data[3].$index].supplierCode = null
this.addPopData_FS[data[3].$index].poNumber = null
this.addPopData_FS[data[3].$index].locationCode = null
@ -627,8 +688,10 @@ export default {
},
//
clearHandle_FS(item,scope){
this.addPopData_FS[scope.$index].supplierCode = null
this.addPopData_FS[scope.$index].poNumber = null
if(item.prop == "itemCode" || item.prop == "supplierCode"){
this.addPopData_FS[scope.$index].supplierCode = null
this.addPopData_FS[scope.$index].poNumber = null
}
},
//
pushYL(data){
@ -667,10 +730,12 @@ export default {
},
//
clearHandle_YL(item,scope){
this.addPopData_YL[scope.$index].packingCode = null
this.addPopData_YL[scope.$index].inventoryQty = null
this.addPopData_YL[scope.$index].locationCode = null
this.addPopData_YL[scope.$index].qty = null
if(item.prop == "itemCode" || item.prop == "packingCode"){
this.addPopData_YL[scope.$index].packingCode = null
this.addPopData_YL[scope.$index].inventoryQty = null
this.addPopData_YL[scope.$index].locationCode = null
this.addPopData_YL[scope.$index].qty = null
}
},
//
pushHB(data){
@ -691,8 +756,10 @@ export default {
},
//
clearHandle_HB(item,scope){
this.addPopData_HB[scope.$index].supplierCode = null
this.addPopData_HB[scope.$index].poNumber = null
if(item.prop == "itemCode" || item.prop == "supplierCode"){
this.addPopData_HB[scope.$index].supplierCode = null
this.addPopData_HB[scope.$index].poNumber = null
}
},
}
};

Loading…
Cancel
Save