Browse Source

拆分标签功能页面开发,所有的箱标签(包装数量+数量)字段调整

dev_web_online
安虹睿 2 years ago
parent
commit
d7a9125e72
  1. 9
      fe/PC/src/api/wms-api.js
  2. 9
      fe/PC/src/api/wms-core.js
  3. 10
      fe/PC/src/mixins/printMixin.js
  4. 30
      fe/PC/src/router/index.js
  5. 307
      fe/PC/src/views/labelManage/PartiallyPreparedProducts/splitLabels.vue

9
fe/PC/src/api/wms-api.js

@ -417,6 +417,15 @@ export function notifyMessage(params, id) {
// })
// }
// 库存列表
export function inventoryBalanceList(data) {
return request({
url: baseURL + 'wms/inventory/Inventory-Balance/list',
method: 'post',
data
})
}
// 库存-启用 | 库存余额 改
export function inventoryBalanceActive(params) {
return request({

9
fe/PC/src/api/wms-core.js

@ -36,3 +36,12 @@ export function postInventoryLabelCode_count(params,data) {
data
})
}
// 拆箱 | 标签管理-拆分箱标签
export function postSplitPacking(data) {
return request({
url: baseURL + 'wms/store/transfer-note/split-packing',
method: 'post',
data
})
}

10
fe/PC/src/mixins/printMixin.js

@ -42,7 +42,7 @@ export function initPrintPackingCodeData(propsData,options,name,url){
"packingCode": item[_options.packingCode] || item.packingCode,//条形码
"printIndex":item[_options.printIndex] || Number(key)+1,//打印序列
// "itemName": item[_options.itemName] || item.itemName,//物品名称 暂未使用
// "stdPackQty": item[_options.stdPackQty] || item.stdPackQty,//整包数量 暂未使用
"stdPackQty": item[_options.stdPackQty] || item.stdPackQty,//整包数量 暂未使用
}
],
})
@ -85,7 +85,8 @@ export function initPrintPackingCodeTwoData(oldData,newData,options,name,url){
"oldLot": oldData[_options.lot] || oldData.lot,//上方_生产批次
"oldLocationErpCode": oldData[_options.locationErpCode] || oldData.locationErpCode,//上方_储位
"oldItemCode": oldData[_options.itemCode] || oldData.itemCode,//上方_物品代码(ERP号)
"oldQty": oldData[_options.qty] || oldData.qty,//上方_要货数量 + 整包数量
"oldQty": oldData[_options.qty] || oldData.qty,//上方_要货数量
"oldStdPackQty": oldData[_options.stdPackQty] || oldData.stdPackQty,//上方_整包数量
"oldPackingCode": oldData[_options.packingCode] || oldData.packingCode,//上方_条形码
"oldPrintIndex":oldData[_options.printIndex] || 1,//上方_打印序列
..._printData
@ -108,7 +109,8 @@ export function initPrintPackingCodeTwoData(oldData,newData,options,name,url){
"newLot": newData[_options.lot] || newData.lot,//下方_生产批次
"newLocationErpCode": newData[_options.locationErpCode] || newData.locationErpCode,//下方_储位
"newItemCode": newData[_options.itemCode] || newData.itemCode,//下方_物品代码(ERP号)
"newQty": newData[_options.qty] || newData.qty,//下方_要货数量 + 整包数量
"newQty": newData[_options.qty] || newData.qty,//下方_数量 + 整包数量
"newStdPackQty": newData[_options.stdPackQty] || newData.stdPackQty,//上方_整包数量
"newPackingCode": newData[_options.packingCode] || newData.packingCode,//下方_条形码
"newPrintIndex":newData[_options.printIndex] || 1,//下方_打印序列
..._printData
@ -177,7 +179,7 @@ export function initPrintPackingCodeTwoData(oldData,newData,options,name,url){
_label['lot'+Number(key2 + 1)] = item[_options.lot] || item2.lot;//生产批次
_label['locationErpCode'+Number(key2 + 1)] = item[_options.locationErpCode] || item2.locationErpCode;//储位
_label['itemCode'+Number(key2 + 1)] = item[_options.itemCode] || item2.itemCode;//物品代码(ERP号)
// _label['stdPackQty'+Number(key2 + 1)] = item[_options.stdPackQty] || item2.stdPackQty;//整包数量 暂未使用
_label['stdPackQty'+Number(key2 + 1)] = item[_options.stdPackQty] || item2.stdPackQty;//整包数量 暂未使用
_label['qty'+Number(key2 + 1)] = item[_options.qty] || item2.qty;//要货数量 + 整包数量
_label['packingCode'+Number(key2 + 1)] = item[_options.packingCode] || item2.packingCode;//条形码
_label['printIndex'+Number(key2 + 1)] = item[_options.printIndex] || item2.printIndex;//序号

30
fe/PC/src/router/index.js

@ -135,21 +135,21 @@ export const constantRoutes = [
}]
},
// 开发中模拟路由
// {
// path: '/',
// component: Layout,
// redirect: '/splitLabels',
// hidden: true,
// children: [{
// path: 'splitLabels',
// component: () => import('@/views/labelManage/PartiallyPreparedProducts/splitLabels.vue'),
// name: 'splitLabels',
// meta: {
// title: 'splitLabels',
// icon: '拆分箱标签',
// }
// }]
// },
{
path: '/',
component: Layout,
redirect: '/splitLabels',
hidden: true,
children: [{
path: 'splitLabels',
component: () => import('@/views/labelManage/PartiallyPreparedProducts/splitLabels.vue'),
name: 'splitLabels',
meta: {
title: 'splitLabels',
icon: '拆分箱标签',
}
}]
},
// {
// path: '/',
// component: Layout,

307
fe/PC/src/views/labelManage/PartiallyPreparedProducts/splitLabels.vue

@ -57,9 +57,9 @@
</div>
</template>
<script>
import { getPageList } from "@/api/wms-api"
import { inventoryBalanceList } from "@/api/wms-api"
import { initDataToHttpFormat } from "@/utils/index"
import { postInventoryLabelCode_count } from "@/api/wms-core"
import { postInventoryLabelCode_count,postSplitPacking } from "@/api/wms-core"
import currenForm from "@/components/currenForm"
import StepsFormAlone from "@/components/StepsFormAlone"
import resultStatus from "@/components/resultStatus"
@ -69,8 +69,9 @@ import _ from "lodash"
import { mixins } from "@/mixins/mixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { filterSelectMixins } from '@/mixins/filter-Select'
import store from '@/store'
export default {
name: "RecycledMaterialsLabel",
name: "splitLabels",
mixins: [
mixins,
LoadingMixins,
@ -82,12 +83,12 @@ export default {
currenTableFlex,
resultStatus,
},
watch:{
"selectData.labelType"(val){
console.log("watch",val)
this.changeFormItemShow(val)
}
},
// watch:{
// "selectData.labelType"(val){
// console.log("watch",val)
// this.changeFormItemShow(val)
// }
// },
data () {
let _this = this
return {
@ -99,19 +100,20 @@ export default {
{title:"打印"},
],
selectItemInfo:{},//
selectSupplierItemInfo:{},//
selectSupplierInfo:{},//
selectPoNumberInfo:{},//
InventoryInfo:{},//
// selectSupplierItemInfo:{},//
// selectSupplierInfo:{},//
// selectPoNumberInfo:{},//
//
defaultSelectData:{
oldPackingCode:"",//
itemCode:"",//
itemName:"",//
canMake:null,//
canBuy:null,//
// canMake:null,//
// canBuy:null,//
labelType:null,//1 2
isRecycled:null,//
canOutsourcing:null,//
// isRecycled:null,//
// canOutsourcing:null,//
qty:"",
lot:"",
labelQty:"1",
@ -120,31 +122,38 @@ export default {
remark:"",
arriveDate:undefined,
produceDate:undefined,
stdPackQty:0
},
//
selectData:{},
//
selectForm:[
{
type: "filterSelect", label: "原箱标签", prop: "oldPackingCode", optionsLabel: "itemCode", optionsValue: "packingCode", clearable:true,
focus: (type,val) => { return this.getFilterList(type, val, "wms/inventory/Inventory-Balance")},
searchButton: (val) => { this.showSerarchPage(val, 'wms/inventory/Inventory-Balance', 'InventoryBalance', '箱标签选择', this.selectData) },
type: "filterSelect", label: "原箱标签", prop: "oldPackingCode", optionsLabel: "itemCode", optionsValue: "code", clearable:true,
focus: (type,val) => { return this.getFilterList(type, val, "label/inventory-label",[
{logic:"And",column:"labelType",action:"==",value:"1"},
{logic:"And",column:"qty",action:">",value:"0"},
])},
searchButton: (val) => { this.showSerarchPage(val, 'label/inventory-label', 'labelsList', '箱标签选择', this.selectData,[
{logic:"And",column:"labelType",action:"==",value:"1"},
{logic:"And",column:"qty",action:">",value:"0"},
]) },
colSpan: 12,
},
{ type: "inputNumber", label: "实际数量", prop: "qty",colSpan: 12 },
{ type: "input",disabled:true,label: "物品代码", prop: "itemCode", colSpan: 12 },
{ type: "input",disabled:true,label: "物品名称", prop: "itemName", colSpan: 12 },
{ type: "select",disabled:true, label: "制造件", prop: "canMake", options: "whetherOrNot", colSpan: 12 },
{ type: "select", disabled:true,label: "采购件", prop: "canBuy", options: "whetherOrNot", colSpan: 12 },
{ type: "input",disabled:true,label: "标包数量", prop: "stdPackQty", colSpan: 12 },
// { type: "select",disabled:true, label: "", prop: "canMake", options: "whetherOrNot", colSpan: 12 },
// { type: "select", disabled:true,label: "", prop: "canBuy", options: "whetherOrNot", colSpan: 12 },
{ type: "select", disabled:true,label: "标签类型", prop: "labelType", options: "labelTypeSelectOption", colSpan: 12 },
{ type: "select", disabled:true,label: "回收件", prop: "isRecycled", options: "whetherOrNot", colSpan: 12 },
{ type: "select", disabled:true,label: "外包件", prop: "canOutsourcing", options: "whetherOrNot", colSpan: 12 },
{ type: "inputNumber", label: "实际数量", prop: "qty",colSpan: 12 },
{ type: "input", label: "批次", prop: "lot", colSpan: 12 },
// { type: "select", disabled:true,label: "", prop: "isRecycled", options: "whetherOrNot", colSpan: 12 },
// { type: "select", disabled:true,label: "", prop: "canOutsourcing", options: "whetherOrNot", colSpan: 12 },
{ type: "input", disabled:true, label: "批次", prop: "lot", colSpan: 12 },
// { type: "inputNumber", label: "", prop: "labelQty", min:1,colSpan: 12 },
{ type: "dateTime", label: "生产时间", prop: "produceDate", colSpan: 12 },
{ type: "dateTime", label: "到货时间", prop: "arriveDate", colSpan: 12 },
{ type: "input", label: "备注", prop: "remark", colSpan: 12 },
{ type: "dateTime", disabled:true,label: "生产时间", prop: "produceDate", colSpan: 12 },
{ type: "dateTime", disabled:true,label: "到货时间", prop: "arriveDate", colSpan: 12 },
{ type: "input", disabled:true,label: "备注", prop: "remark", colSpan: 12 },
{ type: "input",disabled:true,label: "供应商代码", prop: "supplierCode", colSpan: 12 },
{ type: "input",disabled:true,label: "采购订单号", prop: "poNumber", colSpan: 12 },
// {
@ -167,7 +176,7 @@ export default {
selectRules:{
oldPackingCode: [{ required: true, trigger: "change", message: "请选择原箱标签" },],
// itemCode: [{ required: true, trigger: "change", message: "" },],
labelType:[{ required: true, trigger: "change", message: "标签类型不能为空" }],
// labelType:[{ required: true, trigger: "change", message: "" }],
qty: [{ required: true, trigger: "change", message: "实际数量不能为空" }],
// labelQty: [{ required: true, trigger: "change", message: "" }],
// supplierCode: [{ required: false, trigger: "change", message: "" }],
@ -197,19 +206,13 @@ export default {
this.selectData = this.defaultSelectData
},
methods: {
consoleLog(){
console.log('selectItemInfo',this.selectItemInfo)//basedata/item-basic/list
console.log('selectData',this.selectData)
console.log('selectSupplierItemInfo',this.selectSupplierItemInfo)//basedata/supplier-item/list
console.log('selectSupplierInfo',this.selectSupplierInfo)//basedata/supplier/{id}
console.log('selectPoNumberInfo',this.selectPoNumberInfo)
},
//
rest(){
this.selectItemInfo={};
this.selectSupplierItemInfo = {}
this.selectPoNumberInfo = {}
this.selectSupplierInfo = {}
this.InventoryInfo={}
// this.selectSupplierItemInfo = {}
// this.selectPoNumberInfo = {}
// this.selectSupplierInfo = {}
this.selectData = this.defaultSelectData
this.flexSelectTableData = [];
this.$refs.steps_split.returnFirstActive()
@ -225,30 +228,68 @@ export default {
},
//
detailsDataPush (val) {
// todo:
if(val[1].prop == "oldPackingCode"){
this.rest()
this.selectItemInfo = val[0];
this.selectSupplierItemInfo = val[0];//todo
this.selectPoNumberInfo = val[0];//todo
this.selectData.oldPackingCode = this.selectItemInfo.packingCode
this.selectItemInfo.packingCode = val[0].code;
this.selectData.oldPackingCode = this.selectItemInfo.code
this.selectData.itemCode = this.selectItemInfo.itemCode
this.selectData.itemName = this.selectItemInfo.itemName
this.selectData.canBuy=this.selectItemInfo.canBuy;
this.selectData.canMake=this.selectItemInfo.canMake;
this.selectData.isRecycled=this.selectItemInfo.isRecycled;
this.selectData.canOutsourcing=this.selectItemInfo.canOutsourcing;
this.selectData.labelType = this.selectItemInfo.labelType
this.selectData.lot = this.selectItemInfo.lot
this.selectData.supplierCode = this.selectItemInfo.supplierCode
this.selectData.poNumber = this.selectItemInfo.poNumber
this.selectData.remark = this.selectItemInfo.remark
this.selectData.arriveDate = this.selectItemInfo.arriveDate
this.selectData.produceDate = this.selectItemInfo.produceDate
this.selectData.stdPackQty= this.selectItemInfo.stdPackQty
// true
let _labelType_index = this.getFormPropIndex('labelType')
if((this.selectItemInfo.canBuy && !this.selectItemInfo.canMake) || (!this.selectItemInfo.canBuy && this.selectItemInfo.canMake)){
this.selectData.labelType = this.selectItemInfo.canBuy ? 1 : 2;
this.selectForm[_labelType_index].disabled = true
}else{
this.selectData.labelType = null
this.selectForm[_labelType_index].disabled = false
let _option = {
SkipCount: 0,
MaxResultCount: 100,
condition: {
filters: [
{
logic: "And",
column: "packingCode",
action: "Like",
value: val[0].code
}
]
}
}
inventoryBalanceList(_option)
.then(res => {
console.log(255,res)
this.InventoryInfo = res.items[0]
console.log(245,'item',this.selectItemInfo)
console.log(246,'库存',this.InventoryInfo)
this.pageLoading = false
})
.catch(err => {
this.pageLoading = false
})
// todoInventoryInfo
// this.selectSupplierItemInfo = val[0];
// this.selectPoNumberInfo = val[0];
// this.selectData.itemCode = this.selectItemInfo.itemCode
// this.selectData.itemName = this.selectItemInfo.itemName
// this.selectData.canBuy=this.selectItemInfo.canBuy;
// this.selectData.canMake=this.selectItemInfo.canMake;
// this.selectData.isRecycled=this.selectItemInfo.isRecycled;
// this.selectData.canOutsourcing=this.selectItemInfo.canOutsourcing;
// true
// let _labelType_index = this.getFormPropIndex('labelType')
// if((this.selectItemInfo.canBuy && !this.selectItemInfo.canMake) || (!this.selectItemInfo.canBuy && this.selectItemInfo.canMake)){
// this.selectData.labelType = this.selectItemInfo.canBuy ? 1 : 2;
// this.selectForm[_labelType_index].disabled = true
// }else{
// this.selectData.labelType = null
// this.selectForm[_labelType_index].disabled = false
// }
}
//
// if(val[1].prop == "supplierCode"){
// this.selectSupplierItemInfo = val[0];
@ -269,78 +310,136 @@ export default {
// }
},
//
changeFormItemShow(val){
this.selectData.labelType = val
let _poNumber_index = this.getFormPropIndex('poNumber')
let _supplierCode_index = this.getFormPropIndex('supplierCode')
//
if(this.selectData.labelType == 1){
this.selectForm[_poNumber_index].hide = false
this.selectForm[_supplierCode_index].hide = false
// this.selectRules.poNumber[0].required = true
// this.selectRules.supplierCode[0].required = true
}
//
else{
this.selectForm[_poNumber_index].hide = true
this.selectForm[_supplierCode_index].hide = true
// this.selectRules.poNumber[0].required = false
// this.selectRules.supplierCode[0].required = false
// changeFormItemShow(val){
// this.selectData.labelType = val
// let _poNumber_index = this.getFormPropIndex('poNumber')
// let _supplierCode_index = this.getFormPropIndex('supplierCode')
// //
// if(this.selectData.labelType == 1){
// this.selectForm[_poNumber_index].hide = false
// this.selectForm[_supplierCode_index].hide = false
// // this.selectRules.poNumber[0].required = true
// // this.selectRules.supplierCode[0].required = true
// }
// //
// else{
// this.selectForm[_poNumber_index].hide = true
// this.selectForm[_supplierCode_index].hide = true
// // this.selectRules.poNumber[0].required = false
// // this.selectRules.supplierCode[0].required = false
// }
// },
//
postSplitPackingHandle(newCode,resolve,reject){
let _data = {
useOnTheWayLocation: false,
requestNumber: null,
worker: store.getters.name.userName,
jobNumber: null,
remark: this.selectItemInfo.remark,
extraProperties: this.selectItemInfo.extraProperties,
activeDate: new Date(),
confirmed: true,
confirmTime: new Date(),
details: [{
fromLocationCode: this.InventoryInfo ? this.InventoryInfo.locationCode : null,
fromLocationErpCode: this.selectItemInfo.locationErpCode || (this.InventoryInfo ? this.InventoryInfo.locationErpCode : null),
fromLot: this.selectItemInfo.lot,
fromPackingCode: this.selectItemInfo.code,
fromWarehouseCode: this.InventoryInfo ? this.InventoryInfo.warehouseCode : null,
itemCode: this.selectItemInfo.itemCode,
itemName: this.selectItemInfo.itemName,
toLocationCode: this.InventoryInfo ? this.InventoryInfo.locationCode : null,
toLocationErpCode: this.selectItemInfo.locationErpCode || (this.InventoryInfo ? this.InventoryInfo.locationErpCode : null),
toLot: this.selectItemInfo.lot,
toPackingCode: newCode,
toWarehouseCode: this.InventoryInfo ? this.InventoryInfo.warehouseCode : "T8",//
uom: this.selectItemInfo.uom,
itemDesc1: this.selectItemInfo.itemDesc1,
onTheWayLocationCode: "",
expireDate: this.selectItemInfo.expireDate,
fromLocationArea: this.InventoryInfo ? this.InventoryInfo.locationArea : null,
itemDesc2: this.selectItemInfo.itemDesc2,
fromLocationGroup: this.InventoryInfo ? this.InventoryInfo.locationGroup : null,
toLocationArea: this.InventoryInfo ? this.InventoryInfo.locationArea : null,
reason: "",
fromStatus: this.InventoryInfo ? this.InventoryInfo.status : 0,//
stdPackQty: this.selectItemInfo.stdPackQty || 0,//
arriveDate: this.selectItemInfo.arriveDate,
toContainerCode: this.selectItemInfo.containerCode,
produceDate: this.selectItemInfo.produceDate,
supplierBatch: this.selectItemInfo.supplierBatch,
toStatus: this.InventoryInfo ? this.InventoryInfo.status : 0,//
toLocationGroup: this.InventoryInfo ? this.InventoryInfo.locationGroup : null,
qty: Number(this.selectData.qty),
remark: this.selectItemInfo.remark,
fromContainerCode: this.selectItemInfo.containerCode,
}],
type: "SplitPacking"
}
//
postSplitPacking(_data)
.then(res => {
this.pageLoading = false
resolve()
})
.catch(err => {
this.pageLoading = false
reject()
})
},
//
firstNext(){
return new Promise((resolve,reject) => {
this.$refs['form_split'].getDom().validate(valid=>{
if(valid){
// this.consoleLog()
let _data = {
// fullBarcodeString: undefined,//
itemCode: this.selectData.itemCode || null,
itemCode: this.selectItemInfo.itemCode || null,
itemName: this.selectItemInfo.itemName || null,
itemDesc1: this.selectItemInfo.itemDesc1 || null,
itemDesc2: this.selectItemInfo.itemDesc2 || null,
lot: this.selectData.lot || "",
// supplierBatch: undefined,//
arriveDate: initDataToHttpFormat(this.selectData.arriveDate),
produceDate: initDataToHttpFormat(this.selectData.produceDate),
// expireDate: undefined,//
lot: this.selectItemInfo.lot || "",
supplierBatch: this.selectItemInfo.supplierBatch,
arriveDate: this.selectItemInfo.arriveDate,
produceDate: this.selectItemInfo.produceDate,
expireDate: this.selectItemInfo.expireDate,
stdPackQty: Number(this.selectItemInfo.stdPackQty) || 0,
uom: this.selectItemInfo.basicUom || "",
uom: this.selectItemInfo.uom || "",
qty: Number(this.selectData.qty),
labelStatus: 1,//
// recommendLocationCode: undefined,//
// locationErpCode: undefined,//
// containerCode: undefined,//
supplierCode: this.selectData.supplierCode,
poNumber: this.selectData.poNumber,
rpNumber: this.selectPoNumberInfo.rpNumber,
asnNumber: this.selectPoNumberInfo.number,
// qLevel: this.selectItemInfo.qLevel || undefined,//
// qualityFile: undefined,//
// prodLine: undefined,//
// team: undefined,//
// shift: undefined,//
specifications: this.selectItemInfo.color || null,
supplierName: this.selectSupplierItemInfo.supplierName,
supplierSimpleName: this.selectSupplierItemInfo.supplierSimpleName,
supplierItemCode: this.selectSupplierItemInfo.supplierItemCode,
supplierItemName: this.selectSupplierItemInfo.itemName,
labelType: this.selectData.labelType,
planArriveDate: initDataToHttpFormat(this.selectPoNumberInfo.planArriveDate),
remark:this.selectData.remark,//
recommendLocationCode: this.selectItemInfo.recommendLocationCode,
locationErpCode: this.selectItemInfo.locationErpCode,
containerCode: this.selectItemInfo.containerCode,
supplierCode: this.selectItemInfo.supplierCode,
poNumber: this.selectItemInfo.poNumber,
rpNumber: this.selectItemInfo.rpNumber,
asnNumber: this.selectItemInfo.number,
qLevel: this.selectItemInfo.qLevel,
qualityFile: this.selectItemInfo.qualityFile,
prodLine: this.selectItemInfo.prodLine,
team: this.selectItemInfo.team,
shift: this.selectItemInfo.shift,
specifications: this.selectItemInfo.specifications,
supplierName: this.selectItemInfo.supplierName,
supplierSimpleName: this.selectItemInfo.supplierSimpleName,
supplierItemCode: this.selectItemInfo.supplierItemCode,
supplierItemName: this.selectItemInfo.supplierItemName,
labelType: this.selectItemInfo.labelType,
planArriveDate: this.selectItemInfo.planArriveDate,
remark:this.selectItemInfo.remark,
}
//
this.pageLoading = true;
postInventoryLabelCode_count({count:this.selectData.labelQty}, _data)
.then(res => {
this.pageLoading = false
// this.pageLoading = false
this.flexSelectTableData = res
this.flexSelectTableData.forEach(item=>{
item.packingCode=item.code
})
this.flexSelectTableData[0].oldPackingCode = this.selectData.oldPackingCode
resolve()
this.postSplitPackingHandle(res[0].code,resolve,reject)
})
.catch(err => {
this.pageLoading = false
@ -359,9 +458,11 @@ export default {
//
printHandle(){
let _oldData = this.selectItemInfo
_oldData.packingCode = this.selectItemInfo.code
let _newData = this.flexSelectTableData[0]
_oldData.title = "原箱标签"
_newData.title = "拆分箱标签"
console.log(_oldData,_newData)
this.Print(initPrintPackingCodeTwoData(_oldData,_newData))
},
//

Loading…
Cancel
Save