Browse Source

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

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

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

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

Loading…
Cancel
Save