From 852a70a949bf13f1c5233829b632531fa517c054 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Mon, 13 May 2024 18:07:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?wms=E5=8C=85=E6=9D=90po=E6=94=B6=E8=B4=A7&&?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/wms/Raw/PurchaseWHPO/index.vue | 15 +- src/pages/wms/Raw/ReceivePO/index.vue | 307 ++++++++++++++++++----- src/pages/wms/Raw/ReceivePO/model.ts | 18 ++ src/utils/url.ts | 2 + 4 files changed, 281 insertions(+), 61 deletions(-) diff --git a/src/pages/wms/Raw/PurchaseWHPO/index.vue b/src/pages/wms/Raw/PurchaseWHPO/index.vue index 0051f7b..22cf055 100644 --- a/src/pages/wms/Raw/PurchaseWHPO/index.vue +++ b/src/pages/wms/Raw/PurchaseWHPO/index.vue @@ -11,7 +11,7 @@ - 送货单号: + 采购单号: @@ -20,7 +20,7 @@ - + @@ -151,6 +151,7 @@ export default class PurchaseWHPO extends BasePage { form3: any = {}; aimWl = {} as OptionType; materilist = []; + materilistonly = []; // remove: any = {}; // async onReady() { // await this.model.queryLocation(); @@ -248,7 +249,15 @@ export default class PurchaseWHPO extends BasePage { this.materilist = model.orderNoItemList; this.list = []; if (this.materilist.length) { - this.aimWl = this.materilist[0]; + const filteredArray = this.materilist.reduce((acc, curr) => { + // 检查是否已经存在相同的 code + if (!acc.map((item) => item.materialCode).includes(curr.materialCode)) { + acc.push({ value: curr.materialCode, lable: curr.materialCode, materialCode: curr.materialCode, materialDesc: curr.materialDesc }); + } + return acc; + }, []); + this.materilistonly = filteredArray; + this.aimWl = this.materilistonly[0]; this.list.push(this.materilist[0]); } else { this.aimWl = {} as OptionType; diff --git a/src/pages/wms/Raw/ReceivePO/index.vue b/src/pages/wms/Raw/ReceivePO/index.vue index 5de20b0..cb06c6c 100644 --- a/src/pages/wms/Raw/ReceivePO/index.vue +++ b/src/pages/wms/Raw/ReceivePO/index.vue @@ -11,7 +11,7 @@ - 送货单号: + 采购单号: @@ -23,20 +23,12 @@ - - + + 生成收货单号 + + - - + @@ -71,20 +63,56 @@ + + + + + + + + 已收货 + + + 采购单号: + {{ item.procureCode }} + + + 物料编码: + {{ item.materialCode }} + + + 物料描述: + {{ item.materialDesc }} + + + 工厂号: + {{ item.siteCode }} + + + 应收/已收: + {{ item.planNumber }}/{{ item.realityNumber }} + + + + + + - + - + 返回 - + 批次号: @@ -95,9 +123,21 @@ - 托盘号: - + 收货方式: + + + + + 物料号: + + + + 托盘号: + + + + 收货仓库: @@ -123,6 +163,7 @@ import { BasePage } from '@/components/base/page'; import jPicker from '@/components/J-Picker/jPicker.vue'; import model from './model'; import { session } from '@/store/modules/session'; +import dayjs from 'dayjs'; interface OptionType { label: string; value: string; @@ -135,6 +176,34 @@ interface OptionType { export default class receivePO extends BasePage { model = model; list: any = []; + receivedlist: any = []; + // receivedlist=[{ + // orderStatus:'1', + // procureCode:'111', + // materialCode:'ddewcc', + // materialDesc:'ewdcxw', + // siteCode:'1061', + // planNumber:'1', + // realityNumber:'1' + // },{ + // orderStatus:'1', + // procureCode:'111', + // materialCode:'ddewcc', + // materialDesc:'ewdcxw', + // siteCode:'1061', + // planNumber:'1', + // realityNumber:'1' + // }, + // { + // orderStatus:'1', + // procureCode:'111', + // materialCode:'ddewcc', + // materialDesc:'ewdcxw', + // siteCode:'1061', + // planNumber:'1', + // realityNumber:'1' + // } + // ] whList: any = []; show = false; form3: any = {}; @@ -142,6 +211,19 @@ export default class receivePO extends BasePage { materilist = []; productCodeTypeList: any = {}; moren = '选择仓库'; + waylist = [ + { + value: '0', + lable: '根据物料', + }, + { + value: '1', + lable: '根据托盘', + }, + ]; + bimWl = {} as OptionType; + selectway: boolean = null; + showshow = false; // remove: any = {}; // async onReady() { // await this.model.queryLocation(); @@ -169,17 +251,26 @@ export default class receivePO extends BasePage { ]; clickitem: any = ''; productCodeList: any = {}; + receiptNoCode = ''; async onReady() { await this.model.Stashlist(); this.whList = model.DictTypeList; //this.remove = this.model.WlList[0]; } + //生成收货单号 + generate() { + const today = dayjs().format('YYYYMMDDHHmmss'); + this.receiptNoCode = `sn${today}`; + } //收货按钮 onPass(item) { this.clickitem = item; this.show = true; this.form3 = {}; this.productCodeTypeList = {}; + this.showshow = false; + this.bimWl = {} as OptionType; + this.selectway = null; } nopoup() { this.show = false; @@ -203,7 +294,7 @@ export default class receivePO extends BasePage { }); return; } - if (this.form3.sn == '' || this.form3.sn == undefined) { + if (this.form3.sn == '' && this.selectway == true) { (this.$refs.uToast as any).show({ title: '托盘号不能为空', type: 'default', @@ -217,15 +308,27 @@ export default class receivePO extends BasePage { }); return; } + if (this.receiptNoCode == '' || this.receiptNoCode == undefined) { + (this.$refs.uToast as any).show({ + title: '请先生成收货单号', + type: 'default', + }); + return; + } console.log('1234567'); let query = this.clickitem; // query.applyList = this.Sparepartlist; query.workStatus = this.form3.workStatus; - query.sn = this.form3.sn; + if (this.selectway == true) { + query.sn = this.form3.sn; + } else { + query.sn = dayjs().format('YYYYMMDDHHmmss'); + } query.planNumber = this.form3.planNumber; query.whCode = this.productCodeTypeList.warehouseCode; query.factoryCode = session.FactoryCode; query.incomeBatchNo = this.form3.incomeBatchNo; + query.receiptNoCode = this.receiptNoCode; await this.model.PurchaseOrderdeliPda(query); console.log(this.model.SubmitCode); if (this.model.SubmitCode.code == 200) { @@ -235,6 +338,7 @@ export default class receivePO extends BasePage { }); this.show = false; this.query(); + // this.ProcureOrderAlready(); } else { (this.$refs.uToast as any).show({ title: '失败', @@ -278,6 +382,7 @@ export default class receivePO extends BasePage { } else { this.aimWl = {} as OptionType; } + this.ProcureOrderAlready(); //this.list = model.orderNoItemList; } //提单按钮 @@ -301,7 +406,20 @@ export default class receivePO extends BasePage { factoryCode: session.FactoryCode, }; await this.model.PurchaseOrderPda(query); - this.list = model.orderNoItemList; + this.materilist = model.orderNoItemList; + this.aimWl = this.materilist[0]; + this.list = this.materilist[0]; + } + } + //查询所有已经收货的信息 + async ProcureOrderAlready() { + let item = { + procureCode: this.procureCode, + factoryCode: session.FactoryCode, + }; + await this.model.selectOdsProcureOrderAlready(item); + if (model.Alreadycode == '200') { + this.receivedlist = model.ProcureOrderAlreadylist; } } histroyItem: any = {}; @@ -318,38 +436,34 @@ export default class receivePO extends BasePage { } //完成送货单 async onSubmit() { - // if (this.procureCode == '' || this.procureCode.length == 0) { - // this.customToast('请输入nficl'); - // return; - // } - // if (this.histroyItem == {} || !this.histroyItem.productCode) { - // this.customToast(this.$t('message.AppendMateriel5') as string); - // return; - // } - // if (this.barcode == '' || this.barcode.length == 0) { - // this.customToast(this.$t('message.barcode') as string); - // return; - // } - // let params = { - // loginName: session.loginName, - // factoryCode: session.factoryCode, - // procureCode: this.procureCode, - // orderItem: this.histroyItem.orderItem, - // productCode: this.histroyItem.productCode, - // productDescZh: this.histroyItem.productDescZh, - // orderType: this.histroyItem.orderType, - // barcode: this.barcode, - // // locCode: this.remove.value, - // }; - // await this.model.OnSubmit(params); - // if (this.model.SubmitCode == '1') { - // this.customToast(this.$t('message.Warehouse_Tip9') as string); - // this.barcode = ''; - // this.histroyItem = {}; - // this.productCodeList = {}; - // this.model.empty(); - // await this.query(); - // } + if (this.procureCode == '' || this.procureCode.length == 0) { + (this.$refs.uToast as any).show({ + title: '请输入采购单号', + type: 'default', + }); + return; + } + if (this.receiptNoCode == '' || this.receiptNoCode.length == 0) { + (this.$refs.uToast as any).show({ + title: '请先生成收货单号', + type: 'default', + }); + return; + } + let params = { + factoryCode: session.FactoryCode, + procureCode: this.procureCode, + receiptNoCode: this.receiptNoCode, + }; + await this.model.OnSubmit(params); + if (this.model.submitcode == '200') { + (this.$refs.uToast as any).show({ + title: '成功', + type: 'success', + }); + await this.query(); + this.receiptNoCode = ''; + } } bookTypeChange(e: any) { this.aimWl = e.pickerName; @@ -363,6 +477,16 @@ export default class receivePO extends BasePage { //this.queryinformation(); //this.getlist(); } + bookTypeChangeway(e) { + this.showshow = true; + this.bimWl.value = e.pickerName.value; + console.log(e); + if (e.pickerName.value == '0') { + this.selectway = false; + } else { + this.selectway = true; + } + } }