|
|
@ -77,8 +77,6 @@ |
|
|
|
:flexSearchOptions="editOptions" |
|
|
|
:flexTableColumns="addPopColumns_YL" |
|
|
|
@detailsDataPush="pushYL" |
|
|
|
@updateSelectListTable="updateSelectListTable_YL" |
|
|
|
@changeSelect="changeSelect_YL" |
|
|
|
@clearHandle="clearHandle_YL" |
|
|
|
></currenTableFlex> |
|
|
|
</div> |
|
|
@ -113,6 +111,7 @@ import { filterSelectMixins } from '@/mixins/filter-Select' |
|
|
|
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 store from '@/store' |
|
|
|
export default { |
|
|
|
name: "materialsAdjustmentFunc", |
|
|
@ -127,16 +126,6 @@ export default { |
|
|
|
components:{ |
|
|
|
currenTableFlex |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
'packingsYL_Options':{ |
|
|
|
handler(val) { |
|
|
|
console.log(128,val) |
|
|
|
this.addPopColumns_YL[1].userOptions = val; |
|
|
|
}, |
|
|
|
deep: true, |
|
|
|
immediate: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
URL: 'wms/store/item-transform-request', |
|
|
@ -153,6 +142,8 @@ export default { |
|
|
|
//粉碎料信息 |
|
|
|
addPopData_FS:[{ |
|
|
|
itemCode:null, |
|
|
|
supplierCode:null, |
|
|
|
poNumber:null, |
|
|
|
qty:null, |
|
|
|
locationCode:null, |
|
|
|
}], |
|
|
@ -160,8 +151,20 @@ 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") |
|
|
|
searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, |
|
|
|
width:"auto", searchButton:false |
|
|
|
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, |
|
|
|
width:"auto" |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "filterSelect", label: "供应商代码", prop: "supplierCode", optionsLabel: "supplierSimpleName", optionsValue: "supplierCode", clearable:true, |
|
|
|
beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].length <= 0){this.$message.error('请选择物品代码'); return false}else{return true}}, |
|
|
|
focus: (type,val,tableScope) => { return this.getFilterList(type, val, "basedata/supplier-item",this.isFilter("itemCode", this.addPopData_FS[tableScope.$index].itemCode))}, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "filterSelect", label: "采购订单号", prop: "poNumber",optionsValue: "poNumber", clearable:true, |
|
|
|
beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].itemCode.length <= 0 || !this.addPopData_FS[tableScope.$index].supplierCode || this.addPopData_FS[tableScope.$index].supplierCode.length <= 0){this.$message.error('请选择物品代码和供应商代码'); return false}else{return true}}, |
|
|
|
focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/store/supplier-asn",this.isFilter("supplierCode", this.addPopData_FS[tableScope.$index].supplierCode))}, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
{ type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code", |
|
|
|
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",this.isFilter("type", "2"))}, |
|
|
@ -171,7 +174,7 @@ export default { |
|
|
|
{ type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", |
|
|
|
rules: [{ |
|
|
|
type: "number", |
|
|
|
trigger: ["change","blur"], |
|
|
|
trigger: ["blur"], |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
let _index = rule.field.slice(8,9) |
|
|
|
let _qty = Number(this.addPopData_FS[_index].qty) |
|
|
@ -192,32 +195,25 @@ export default { |
|
|
|
locationCode:null, |
|
|
|
qty:null |
|
|
|
}], |
|
|
|
packingsYL_Options:[], |
|
|
|
itemPackings_YL:{}, |
|
|
|
//原料表头信息 |
|
|
|
addPopColumns_YL:[ |
|
|
|
{ type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", |
|
|
|
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilter("type", "10C02"))}, |
|
|
|
width:"auto" |
|
|
|
}, |
|
|
|
// { type: "filterSelect", label: "箱标签", prop: "packingCode", |
|
|
|
// // optionsLabel: "itemCode", optionsValue: "packingCode", |
|
|
|
// focus: (type,val) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance")}, |
|
|
|
// colSpan: 12 |
|
|
|
// }, |
|
|
|
{ type: "select", label: "箱码", prop: "packingCode", |
|
|
|
optionsLabel: "packingCode", optionsValue: "packingCode", |
|
|
|
userOptions:this.packingsYL_Options,width:"auto", |
|
|
|
filterable:true,clearable:true |
|
|
|
{ type: "filterSelect", label: "箱标签", prop: "packingCode", optionsLabel: "packingCode", optionsValue: "packingCode", clearable:true, |
|
|
|
beforeFocus:(tableScope)=>{if(!this.addPopData_YL[tableScope.$index].itemCode || this.addPopData_YL[tableScope.$index].length <= 0){this.$message.error('请选择物品代码'); return false}else{return true}}, |
|
|
|
focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance",this.isFilter("itemCode", this.addPopData_YL[tableScope.$index].itemCode))}, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
// todo: 库存数量、库位:自动带出 |
|
|
|
// 库存数量、库位:自动带出 |
|
|
|
{ label: "库存数量", prop: "inventoryQty", width:"auto" }, |
|
|
|
{ label: "库位", prop: "locationCode", width:"auto" }, |
|
|
|
// todo: 小于等于库存数量 |
|
|
|
// 小于等于库存数量 |
|
|
|
{ type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", |
|
|
|
rules: [{ |
|
|
|
type: "number", |
|
|
|
trigger: ["change","blur"], |
|
|
|
trigger: ["blur"], |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
let _index = rule.field.slice(8,9) |
|
|
|
if(this.addPopData_YL[_index].qty == null){ |
|
|
@ -237,15 +233,29 @@ export default { |
|
|
|
//混拌料信息 |
|
|
|
addPopData_HB:[{ |
|
|
|
itemCode:null, |
|
|
|
supplierCode:null, |
|
|
|
poNumber:null, |
|
|
|
qty:null, |
|
|
|
locationCode:null, |
|
|
|
}], |
|
|
|
//混拌料表头信息 |
|
|
|
addPopColumns_HB:[ |
|
|
|
{ type: "filterSelect", label: "物品代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", |
|
|
|
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic")}, |
|
|
|
searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, |
|
|
|
width:"auto", searchButton:false |
|
|
|
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Item-Basic",this.isFilterForHB())}, |
|
|
|
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Item-Basic', 'ItemBasic', '物品选择', this.addPopData_HB) }, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "filterSelect", label: "供应商代码", prop: "supplierCode", optionsLabel: "supplierSimpleName", optionsValue: "supplierCode", clearable:true, |
|
|
|
beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].length <= 0){this.$message.error('请选择物品代码'); return false}else{return true}}, |
|
|
|
focus: (type,val,tableScope) => { return this.getFilterList(type, val, "basedata/supplier-item",this.isFilter("itemCode", this.addPopData_FS[tableScope.$index].itemCode))}, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "filterSelect", label: "采购订单号", prop: "poNumber",optionsValue: "poNumber", clearable:true, |
|
|
|
beforeFocus:(tableScope)=>{if(!this.addPopData_FS[tableScope.$index].itemCode || this.addPopData_FS[tableScope.$index].itemCode.length <= 0 || !this.addPopData_FS[tableScope.$index].supplierCode || this.addPopData_FS[tableScope.$index].supplierCode.length <= 0){this.$message.error('请选择物品代码和供应商代码'); return false}else{return true}}, |
|
|
|
focus: (type,val,tableScope) => { return this.getFilterList(type, val, "wms/store/supplier-asn",this.isFilter("supplierCode", this.addPopData_FS[tableScope.$index].supplierCode))}, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
{ type: "filterSelect", label: "目标库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code", |
|
|
|
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location")}, |
|
|
@ -255,7 +265,7 @@ export default { |
|
|
|
{ type: "input", validType:'pointNumber', label: "数量", prop: "qty", width:"auto", |
|
|
|
rules: [{ |
|
|
|
type: "number", |
|
|
|
trigger: ["change","blur"], |
|
|
|
trigger: ["blur"], |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
let _index = rule.field.slice(8,9) |
|
|
|
let _qty = Number(this.addPopData_HB[_index].qty) |
|
|
@ -269,7 +279,10 @@ export default { |
|
|
|
}, |
|
|
|
], |
|
|
|
itemStagingLists:{},//物料相关内容暂存 |
|
|
|
supplierStagingLists:{},// 供应商信息暂存 |
|
|
|
asnStagingLists:{},// 供应商发货通知暂存 |
|
|
|
locationStagingLists:{},//库位相关内容暂存 |
|
|
|
packingStagingLists:{},//箱码相关内容暂存 |
|
|
|
needNewPackingList:[],//需要生成项目的列表信息(N个粉碎料+1个混拌料) |
|
|
|
newPackArr:[],//已生成的新箱码 |
|
|
|
}; |
|
|
@ -278,6 +291,25 @@ export default { |
|
|
|
// this.paging(); |
|
|
|
}, |
|
|
|
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 |
|
|
|
}, |
|
|
|
//过滤查询条件 |
|
|
|
isFilter (val, data) { |
|
|
|
let filter = [ |
|
|
@ -300,6 +332,8 @@ export default { |
|
|
|
initAddPopData(){ |
|
|
|
this.addPopData_FS=[{ |
|
|
|
itemCode:null, |
|
|
|
supplierCode:null, |
|
|
|
poNumber:null, |
|
|
|
qty:null, |
|
|
|
locationCode:null, |
|
|
|
}] |
|
|
@ -312,6 +346,8 @@ export default { |
|
|
|
}] |
|
|
|
this.addPopData_HB=[{ |
|
|
|
itemCode:null, |
|
|
|
supplierCode:null, |
|
|
|
poNumber:null, |
|
|
|
qty:null, |
|
|
|
locationCode:null, |
|
|
|
}] |
|
|
@ -328,20 +364,26 @@ export default { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 最后提交的from值转义 |
|
|
|
getFormDataInit(item,index,prop,prop_yl){ |
|
|
|
let _prop_yl = prop_yl ? prop_yl : prop; |
|
|
|
return item.remark == '原料' ? this.packingStagingLists[item.packingCode][_prop_yl] : this.newPackArr[index][prop] |
|
|
|
}, |
|
|
|
// todo:最后提交接口 |
|
|
|
lastCommitHttp(){ |
|
|
|
console.log(336,this.newPackArr) |
|
|
|
this.addPopColumns_YL.forEach(item=>{ |
|
|
|
this.addPopData_YL.forEach(item=>{ |
|
|
|
item.remark = '原料' |
|
|
|
}) |
|
|
|
let _allDetails = [ |
|
|
|
...this.addPopData_FS, |
|
|
|
...this.addPopColumns_YL |
|
|
|
...this.addPopData_YL |
|
|
|
] |
|
|
|
let _toData = this.addPopColumns_HB[0] |
|
|
|
let _toData = this.addPopData_HB[0] |
|
|
|
let _toItemInfo = this.itemStagingLists[_toData.itemCode] |
|
|
|
let _toLocationInfo = this.locationStagingLists[_toData.locationCode] |
|
|
|
let _toData_new = this.newPackArr[this.newPackArr.length - 1] |
|
|
|
let _details = [] |
|
|
|
let _this = this |
|
|
|
_allDetails.forEach((item,index)=>{ |
|
|
|
let _itemInfo = this.itemStagingLists[item.itemCode] |
|
|
|
let _locationInfo = this.locationStagingLists[item.locationCode] |
|
|
@ -350,42 +392,43 @@ export default { |
|
|
|
itemCode: item.itemCode || null, |
|
|
|
itemName: _itemInfo.name || null, |
|
|
|
itemDesc1: _itemInfo.desc1 || null, |
|
|
|
itemDesc2: _item_info.desc2 || null, |
|
|
|
"fromPackingCode": item.packingCode || null,//todo:粉碎料无packingCode,是否需要添加选择项 |
|
|
|
toPackingCode: this.newPackArr[index], |
|
|
|
itemDesc2: _itemInfo.desc2 || null, |
|
|
|
fromPackingCode: item.packingCode ? item.packingCode : this.newPackArr[index].code, |
|
|
|
toPackingCode: _toData_new.code, |
|
|
|
toItemCode: _toData.itemCode || null, |
|
|
|
toItemName: _toItemInfo.name || null, |
|
|
|
toItemDesc1: _toItemInfo.desc1 || null, |
|
|
|
toItemDesc2: _toItemInfo.desc2 || null, |
|
|
|
uom: _item_info.basicUom || null, |
|
|
|
uom: _itemInfo.basicUom || null, |
|
|
|
fromQty: item.qty, |
|
|
|
toQty: _toData.qty, |
|
|
|
"fromSupplierBatch": null,//todo |
|
|
|
"fromArriveDate": null,//todo |
|
|
|
"fromProduceDate": null,//todo |
|
|
|
"fromExpireDate": null,//todo |
|
|
|
"fromLot": null,//todo |
|
|
|
"fromStatus": null,//todo |
|
|
|
// 原料的走本身 |
|
|
|
fromSupplierBatch: this.getFormDataInit(item,index,'supplierBatch'), |
|
|
|
fromArriveDate: this.getFormDataInit(item,index,'arriveDate'), |
|
|
|
fromProduceDate: this.getFormDataInit(item,index,'produceDate'), |
|
|
|
fromExpireDate: this.getFormDataInit(item,index,'expireDate'), |
|
|
|
fromLot: this.getFormDataInit(item,index,'lot'), |
|
|
|
fromStatus: this.getFormDataInit(item,index,'labelStatus','status'), |
|
|
|
fromLocationCode: item.locationCode || null, |
|
|
|
fromLocationArea: _locationInfo.areaCode || null, |
|
|
|
fromLocationGroup: _locationInfo.locationGroupCode || null, |
|
|
|
fromLocationErpCode: _locationInfo.erpLocationCode || null, |
|
|
|
fromWarehouseCode: _locationInfo.warehouseCode || null, |
|
|
|
"fromContainerCode": null,//todo |
|
|
|
"toSupplierBatch": null,//todo |
|
|
|
"toArriveDate": null,//todo |
|
|
|
"toProduceDate": null,//todo |
|
|
|
"toExpireDate": null,//todo |
|
|
|
"toLot": null,//todo |
|
|
|
"toStatus": null,//todo |
|
|
|
fromContainerCode: this.getFormDataInit(item,index,'containerCode'), |
|
|
|
toSupplierBatch: _toData_new.supplierBatch || null, |
|
|
|
toArriveDate: _toData_new.arriveDate || null, |
|
|
|
toProduceDate: _toData_new.produceDate || null, |
|
|
|
toExpireDate: _toData_new.expireDate || null, |
|
|
|
toLot: _toData_new.lot || null, |
|
|
|
toStatus: 1, |
|
|
|
toLocationCode: _toData.locationCode || null, |
|
|
|
toLocationArea: _toLocationInfo.areaCode || null, |
|
|
|
toLocationGroup: _toLocationInfo.locationGroupCode || null, |
|
|
|
toLocationErpCode: _toLocationInfo.erpLocationCode || null, |
|
|
|
toWarehouseCode: _toLocationInfo.warehouseCode || null, |
|
|
|
"toContainerCode": null,//todo |
|
|
|
worker: store.getters.name.userName,//todo |
|
|
|
"reasonCode": null,//todo |
|
|
|
toContainerCode: _toData_new.containerCode || null, |
|
|
|
worker: store.getters.name.userName, |
|
|
|
reasonCode: null, |
|
|
|
} |
|
|
|
_details.push(_item) |
|
|
|
}) |
|
|
@ -396,13 +439,13 @@ export default { |
|
|
|
itemName: _toItemInfo.name || null, |
|
|
|
itemDesc1: _toItemInfo.desc1 || null, |
|
|
|
itemDesc2: _toItemInfo.desc2 || null, |
|
|
|
"lot": null,//todo |
|
|
|
"supplierBatch": null,//todo |
|
|
|
"arriveDate": null,//todo |
|
|
|
"produceDate": null,//todo |
|
|
|
"expireDate": null,//todo |
|
|
|
packingCode: this.newPackArr[this.newPackArr.length - 1], |
|
|
|
"containerCode": null,//todo |
|
|
|
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, |
|
|
@ -410,20 +453,20 @@ export default { |
|
|
|
locationArea: _toLocationInfo.areaCode || null, |
|
|
|
locationGroup: _toLocationInfo.locationGroupCode || null, |
|
|
|
locationErpCode: _toLocationInfo.erpLocationCode || null, |
|
|
|
"status": null,//todo |
|
|
|
status: 1, |
|
|
|
warehouseCode: _toLocationInfo.warehouseCode || null, |
|
|
|
"reasonCode": null,//todo |
|
|
|
reasonCode: null, |
|
|
|
} |
|
|
|
] |
|
|
|
let _finalData = { |
|
|
|
"tenantId": null,//todo |
|
|
|
"remark": null,//todo |
|
|
|
"extraProperties": null,//todo |
|
|
|
worker: store.getters.name.userName,//todo |
|
|
|
activeDate: new Date(),//todo |
|
|
|
"number": null,//todo |
|
|
|
"requestNumber": null,//todo |
|
|
|
"jobNumber": null,//todo |
|
|
|
tenantId: null, |
|
|
|
remark: "", |
|
|
|
extraProperties: null, |
|
|
|
worker: store.getters.name.userName, |
|
|
|
activeDate: getNowToT(), |
|
|
|
number: "", |
|
|
|
requestNumber: "", |
|
|
|
jobNumber: "", |
|
|
|
details:_details, |
|
|
|
recDetails:_recDetail |
|
|
|
} |
|
|
@ -450,7 +493,7 @@ export default { |
|
|
|
//如果成功了,继续发送 |
|
|
|
if(_resultBack == 1){ |
|
|
|
let _index = Number(index) + 1 |
|
|
|
_this.resendHandle(_index) |
|
|
|
this.resendHandle(_index) |
|
|
|
} |
|
|
|
//失败了提示不进行任何处理 |
|
|
|
else{ |
|
|
@ -463,45 +506,47 @@ export default { |
|
|
|
let _item = this.needNewPackingList[index] |
|
|
|
let _item_info = this.itemStagingLists[_item.itemCode] |
|
|
|
let _location_info = this.locationStagingLists[_item.locationCode] |
|
|
|
let _supplier_info = this.supplierStagingLists[_item.supplierCode] |
|
|
|
let _asn_info = this.asnStagingLists[_item.poNumber] |
|
|
|
let _creatPackData = { |
|
|
|
itemCode: _item_info.code || null, |
|
|
|
itemName: _item_info.name || null, |
|
|
|
itemDesc1: _item_info.desc1 || null, |
|
|
|
itemDesc2: _item_info.desc2 || null, |
|
|
|
lot: null,//todo |
|
|
|
supplierBatch: null,//todo |
|
|
|
arriveDate: null,//todo |
|
|
|
produceDate: null,//todo |
|
|
|
expireDate: null,//todo |
|
|
|
lot: formatTimeStampToNorm(new Date(),'date'), |
|
|
|
arriveDate: getNowToT(), |
|
|
|
produceDate: getNowToT(), |
|
|
|
expireDate: "9999-12-31", |
|
|
|
stdPackQty: Number(_item_info.stdPackQty) || 0, |
|
|
|
uom: _item_info.basicUom || null, |
|
|
|
qty: Number(_item.qty), |
|
|
|
labelStatus: 1,//todo |
|
|
|
recommendLocationCode: _location_info.code || null,//todo |
|
|
|
locationErpCode: _location_info.erpLocationCode || null,//todo |
|
|
|
containerCode: null,//todo |
|
|
|
supplierCode: null,//todo |
|
|
|
poNumber: null,//todo |
|
|
|
rpNumber: null,//todo |
|
|
|
asnNumber: null,//todo |
|
|
|
qLevel: _item_info.elevel || null,//todo |
|
|
|
qualityFile: null,//todo |
|
|
|
prodLine: null,//todo |
|
|
|
team: null,//todo |
|
|
|
shift: null,//todo |
|
|
|
specifications: null,//todo |
|
|
|
supplierName: null,//todo |
|
|
|
supplierSimpleName: null,//todo |
|
|
|
supplierItemCode: null,//todo |
|
|
|
supplierItemName: null,//todo |
|
|
|
labelType: null,//todo |
|
|
|
planArriveDate: null,//todo |
|
|
|
labelStatus: 1, |
|
|
|
recommendLocationCode: _location_info.code || null, |
|
|
|
locationErpCode: _location_info.erpLocationCode || null, |
|
|
|
containerCode: null, |
|
|
|
supplierCode: _item.supplierCode, |
|
|
|
poNumber: _item.poNumber, |
|
|
|
rpNumber: _asn_info.rpNumber, |
|
|
|
asnNumber: _asn_info.number, |
|
|
|
qLevel: _item_info.elevel || null, |
|
|
|
qualityFile: null, |
|
|
|
prodLine: null, |
|
|
|
team: null, |
|
|
|
shift: null, |
|
|
|
specifications: null, |
|
|
|
supplierBatch: null,//todo |
|
|
|
supplierName: null,//todo:basedata/supplier-item/list中无此字段 |
|
|
|
supplierSimpleName: _supplier_info.supplierSimpleName, |
|
|
|
supplierItemCode: _supplier_info.supplierItemCode, |
|
|
|
supplierItemName: null,//todo:basedata/supplier-item/list中无此字段 |
|
|
|
labelType: 1,//采购标签 |
|
|
|
planArriveDate: "9999-12-31", |
|
|
|
remark:null, |
|
|
|
} |
|
|
|
let resultBack = null |
|
|
|
// // 生成标签(接口) |
|
|
|
postInventoryLabelCode_count({count:1}, _creatPackData) |
|
|
|
.then(res=>{ resultBack = 1;this.newPackArr[index] = res }) |
|
|
|
await postInventoryLabelCode_count({count:1}, _creatPackData) |
|
|
|
.then(res=>{ resultBack = 1;this.newPackArr[index] = res[0] }) |
|
|
|
.catch(err=>{ resultBack = 0 }) |
|
|
|
|
|
|
|
return resultBack |
|
|
@ -511,7 +556,7 @@ export default { |
|
|
|
// 检测【粉碎料】信息是否填全 |
|
|
|
let _err_FS=0 |
|
|
|
this.addPopData_FS.forEach(item=>{ |
|
|
|
if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode){ |
|
|
|
if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode || !item.supplierCode || !item.poNumber){ |
|
|
|
_err_FS++ |
|
|
|
} |
|
|
|
}) |
|
|
@ -533,7 +578,7 @@ export default { |
|
|
|
// 检测【混拌料】信息是否填全 |
|
|
|
let _err_HB=0 |
|
|
|
this.addPopData_HB.forEach(item=>{ |
|
|
|
if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode){ |
|
|
|
if(!item.itemCode || Number(item.qty <= 0) || !item.locationCode || !item.supplierCode || !item.poNumber){ |
|
|
|
_err_HB++ |
|
|
|
} |
|
|
|
}) |
|
|
@ -558,6 +603,18 @@ 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[1].prop == "supplierCode"){ |
|
|
|
this.supplierStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|
if(data[1].prop == "poNumber"){ |
|
|
|
this.asnStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|
if(data[1].prop == "locationCode"){ |
|
|
|
this.locationStagingLists[data[2]] = data[0] |
|
|
@ -565,7 +622,16 @@ export default { |
|
|
|
}, |
|
|
|
// 原料下拉 |
|
|
|
pushYL(data){ |
|
|
|
if(data[1].prop="itemCode"){ |
|
|
|
if(data[1].prop=="itemCode"){ |
|
|
|
this.itemStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|
else if(data[1].prop=="packingCode"){ |
|
|
|
this.packingStagingLists[data[2]] = data[0] |
|
|
|
this.addPopData_YL[data[3].$index].packingCode = data[2] |
|
|
|
this.addPopData_YL[data[3].$index].inventoryQty = data[0].qty |
|
|
|
this.addPopData_YL[data[3].$index].locationCode = data[0].locationCode |
|
|
|
this.addPopData_YL[data[3].$index].qty = null |
|
|
|
// 获取库位相关信息 |
|
|
|
let params = { |
|
|
|
Sorting: "", |
|
|
|
MaxResultCount: 1000, |
|
|
@ -573,20 +639,15 @@ export default { |
|
|
|
condition: { |
|
|
|
filters: [{ |
|
|
|
logic: "And", |
|
|
|
column: "itemCode", |
|
|
|
column: "code", |
|
|
|
action: "==", |
|
|
|
value: data[0].code |
|
|
|
value: data[0].locationCode |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
|
this.Loading.appMainLoading = true |
|
|
|
// todo:字段确定 |
|
|
|
console.log(311,data[3].$index) |
|
|
|
this.addPopData_YL[data[3].$index].packingCode = null |
|
|
|
this.addPopData_YL[data[3].$index].inventoryQty = null |
|
|
|
this.addPopData_YL[data[3].$index].locationCode = null |
|
|
|
getPageList(params, "wms/inventory/inventory-balance").then((res)=>{ |
|
|
|
this.itemPackings_YL[data[0].code] = res.items |
|
|
|
getPageList(params, "basedata/Location").then((res)=>{ |
|
|
|
this.locationStagingLists[data[0].locationCode] = res.items[0] |
|
|
|
this.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(err=>{ |
|
|
@ -594,17 +655,6 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 原料selet更改 |
|
|
|
changeSelect_YL(prop, val,item,searchData,scope){ |
|
|
|
if(prop == 'packingCode'){ |
|
|
|
let _currentRow = this.itemPackings_YL[searchData.itemCode].filter(item=>{ |
|
|
|
return val == item.packingCode |
|
|
|
}) |
|
|
|
// todo:字段确定 |
|
|
|
this.addPopData_YL[scope.$index].inventoryQty = _currentRow.length > 0 ? _currentRow[0].qty : null |
|
|
|
this.addPopData_YL[scope.$index].locationCode = _currentRow.length > 0 ? _currentRow[0].locationCode : null |
|
|
|
} |
|
|
|
}, |
|
|
|
// 原料清空 |
|
|
|
clearHandle_YL(item,scope){ |
|
|
|
this.addPopData_YL[scope.$index].packingCode = null |
|
|
@ -612,26 +662,17 @@ export default { |
|
|
|
this.addPopData_YL[scope.$index].locationCode = null |
|
|
|
this.addPopData_YL[scope.$index].qty = null |
|
|
|
}, |
|
|
|
// 原料select展开/关闭 |
|
|
|
updateSelectListTable_YL(data,item,scope,tableData){ |
|
|
|
// 展开 |
|
|
|
if(data){ |
|
|
|
if(item.prop == "packingCode"){ |
|
|
|
this.packingsYL_Options = [] |
|
|
|
if(!tableData[scope.$index].itemCode || tableData[scope.$index].itemCode.length == 0){ |
|
|
|
this.$warningMsg("请先选择物料") |
|
|
|
} |
|
|
|
if(this.itemPackings_YL[tableData[scope.$index].itemCode]){ |
|
|
|
this.packingsYL_Options = this.itemPackings_YL[tableData[scope.$index].itemCode] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 混拌料下拉 |
|
|
|
pushHB(data){ |
|
|
|
if(data[1].prop == "itemCode"){ |
|
|
|
this.itemStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|
if(data[1].prop == "supplierCode"){ |
|
|
|
this.supplierStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|
if(data[1].prop == "poNumber"){ |
|
|
|
this.asnStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|
if(data[1].prop == "locationCode"){ |
|
|
|
this.locationStagingLists[data[2]] = data[0] |
|
|
|
} |
|
|
|