From 178ccd5828c09ac3d3eb507aa09cf99044080cdc Mon Sep 17 00:00:00 2001 From: guoshuang Date: Thu, 28 Mar 2024 15:19:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?wms=E6=88=90=E5=93=81=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/wms/product/SaleOutWH/index.vue | 287 ++++++++++++++-------- src/pages/wms/product/SaleOutWH/model.ts | 63 +++-- src/utils/url.ts | 8 + 3 files changed, 233 insertions(+), 125 deletions(-) diff --git a/src/pages/wms/product/SaleOutWH/index.vue b/src/pages/wms/product/SaleOutWH/index.vue index 8360f00..514fee0 100644 --- a/src/pages/wms/product/SaleOutWH/index.vue +++ b/src/pages/wms/product/SaleOutWH/index.vue @@ -16,7 +16,7 @@ - 提单 + 提单 @@ -24,8 +24,24 @@ + + + + 出库仓库: + + + + 客户名称: + {{ orderNoItemList && orderNoItemList.attr1 }} + + - 成品库 + @@ -54,28 +70,33 @@ - + + + {{ item.name }} + + + - + - 批次号: - {{ item.lotNumber }} + 托盘号: + {{ item.sn }} 箱码: - {{ item.barcode }}件 + {{ item.barcode }} - + 库位码: {{ item.wlCode }} @@ -87,7 +108,7 @@ - 删除 + 删除 @@ -114,6 +135,7 @@ import { Component } from 'vue-property-decorator'; import { BasePage } from '@/components/base/page'; import jPicker from '@/components/J-Picker/jPicker.vue'; import model from './model'; +import { session } from '@/store/modules/session'; interface OptionType { label: string; value: string; @@ -127,7 +149,9 @@ interface OptionType { export default class SaleOutWH extends BasePage { model = model; list: any = []; - aimWl = {} as OptionType; + //productCodebiaozhiwei = ''; + cimWl = {} as OptionType; + aimWl: any = {}; boxnumber: any = ''; materilist = []; // remove: any = {}; @@ -144,33 +168,54 @@ export default class SaleOutWH extends BasePage { showProduceCodeList: any = []; itemdetail: any = ''; outnumber: any = 0; + warehouselist = []; + Radiolist = [ + { + code: 0, + name: '整托扫描', + disabled: false, + }, + { + code: 1, + name: '单箱扫描', + disabled: false, + }, + ]; + selectvalue: any = 0; + async onLoad() { + await this.model.getwarehouselist(); + this.warehouselist = model.warehouselist; + this.cimWl = this.warehouselist[0]; + } bookTypeChange(e: any) { this.aimWl = e.pickerName; - this.getlist(); - this.queryinformation(); + this.orderNoItemList = e.pickerName; + this.list = []; + this.outnumber = this.orderNoItemList.outQuantity; + } + wlChange(e: any) { + this.cimWl = e.pickerName; + } + // 选中任一radio时,由radio-group触发 + radioGroupChange(e) { + console.log(e); + console.log('selectvalue', this.selectvalue); } //收货按钮 - async ondelete(item) { - console.log('1234567', item); - this.itemdetail = item; - // this.showmodal = true; - // this.content = '是否删除?'; - this.itemdetail.orderNo = this.orderNo; - console.log(this.itemdetail, this.orderNo); - await this.model.deleteTray(this.itemdetail); - if (this.model.SubmitCode == '200') { - (this.$refs.uToast as any).show({ - title: '删除成功', - type: 'success', - }); - this.getlist(); - } else { - (this.$refs.uToast as any).show({ - title: '删除失败', - type: 'error', - }); - this.getlist(); - } + async ondelete(item, index) { + console.log('this.list', Array.isArray(this.list)); + const newList = [...this.list]; // 创建一个新的数组 + newList.splice(index, 1); // 在新数组上执行 splice 操作 + this.list = newList; // 将新数组赋值回原数组 + (this.$refs.uToast as any).show({ + title: '删除成功', + type: 'success', + }); + console.log('this.outnumber', this.outnumber); + this.outnumber = this.outnumber - 1; + // if(!this.list.length){ + // this.productCodebiaozhiwei = ''; + // } } //查询货单关联采购单信息 async query() { @@ -184,53 +229,20 @@ export default class SaleOutWH extends BasePage { await this.model.showProduceCode(this.orderNo); if (model.orderNoItemList) { this.materilist = []; - let a: any = {}; - model.orderNoItemList.forEach((item) => { - a.label = item.productName; - a.value = item.productCode; - this.materilist.push(a); + //let a: any = {}; + this.model.orderNoItemList.forEach((item) => { + item.label = item.productName; + item.value = item.productCode; + this.materilist.push(item); }); this.aimWl.value = this.materilist[0].value; - this.queryinformation(); - this.getlist(); + this.orderNoItemList = this.materilist[0]; + this.outnumber = this.orderNoItemList.outQuantity; } else { this.materilist = []; } } - //查询货单关联采购单信息 - async queryinformation() { - if (this.orderNo == '' || this.orderNo.length == 0) { - (this.$refs.uToast as any).show({ - title: '请输入备货单号', - // url: '/pages/user/index' - }); - return; - } - let item: any = {}; - item.orderNo = this.orderNo; - item.value = this.aimWl.value; - await this.model.queryinformation(item); - if (model.information) { - this.orderNoItemList = model.information; - } else { - this.orderNoItemList = {}; - } - // this.getlist(); - } - async getlist() { - let item: any = {}; - item.orderNo = this.orderNo; - item.value = this.aimWl.value; - await (this.model as any).showTrays(item); - if (model.TraysList.length > 0) { - this.list = model.TraysList; - this.outnumber = model.TraysList.length; - } else { - this.list = []; - this.outnumber = 0; - } - console.log(model.TraysList); - } + async addlist() { if (this.orderNo == '' || this.orderNo.length == 0) { (this.$refs.uToast as any).show({ @@ -246,25 +258,76 @@ export default class SaleOutWH extends BasePage { }); return; } - let item: any = {}; - item.productCode = this.aimWl.value; - item.barcode = this.boxnumber; - await this.model.selloutconntray(item); - if (this.model.SubmitCode == '200') { - (this.$refs.uToast as any).show({ - title: '成功', - type: 'success', - }); - this.getlist(); - this.boxnumber = ''; - } else { - (this.$refs.uToast as any).show({ - title: '失败', - type: 'error', - }); - this.getlist(); - this.boxnumber = ''; + + if (this.selectvalue == 0) { + //选择整托扫描 + let item: any = {}; + item.sn = this.boxnumber; + item.siteCode = session.FactoryCode; + await this.model.ScanCodeWholePallet(item); + if (this.model.scanCode == '200') { + (this.$refs.uToast as any).show({ + title: '成功', + type: 'success', + }); + // if (this.productCodebiaozhiwei == ''&&model.scandatalist.length) { + // this.productCodebiaozhiwei = model.scandatalist[0].productCode; + // } + model.scandatalist.map((item) => { + if (item.productCode == this.aimWl.value) { + this.list.push({ sn: item.sn, barcode: item.barcode, wlCode: item.wlCode, storageId: item.storageId }); + this.outnumber += 1; + } else { + (this.$refs.uToast as any).show({ + title: '必须是同一种物料的', + type: 'error', + }); + } + }); + // this.list.push() + + this.boxnumber = ''; + } else { + (this.$refs.uToast as any).show({ + title: '失败', + type: 'error', + }); + this.boxnumber = ''; + } + } else if (this.selectvalue == 1) { + let item: any = {}; + item.barcode = this.boxnumber; + item.siteCode = session.FactoryCode; + await this.model.ScanCodeSingleBox(item); + if (this.model.scanCode == '200') { + // if (this.productCodebiaozhiwei == ''&& model.scandata) { + // this.productCodebiaozhiwei = model.scandata.productCode; + // } + let scandata = model.scandata; + if (this.aimWl.value == scandata.productCode) { + (this.$refs.uToast as any).show({ + title: '成功', + type: 'success', + }); + this.list.push({ sn: scandata.sn, barcode: scandata.barcode, wlCode: scandata.wlCode, storageId: scandata.storageId }); + this.outnumber += 1; + } else { + (this.$refs.uToast as any).show({ + title: '必须是同一种物料的', + type: 'error', + }); + } + + this.boxnumber = ''; + } else { + (this.$refs.uToast as any).show({ + title: '失败', + type: 'error', + }); + this.boxnumber = ''; + } } + // //入库后的查询下面列表的接口 // await this.model.queryOrderNo(this.form5); // this.list = model.orderNoItemList; @@ -285,22 +348,34 @@ export default class SaleOutWH extends BasePage { }); return; } - this.list[0].outnumber = this.outnumber; - await this.model.out(this.list); + //this.list[0].outnumber = this.outnumber; + let item = { + factoryCode: session.FactoryCode, + whCode: this.cimWl.value, + id: this.orderNoItemList.id, + productCode: this.orderNoItemList.productCode, + productName: this.orderNoItemList.productName, + wmsProductPutTrayCodeList: this.list, + }; + await this.model.out(item); if (this.model.SubmitCode == '200') { (this.$refs.uToast as any).show({ title: '成功', type: 'success', }); - this.getlist(); + this.list = []; + this.query(); + //this.productCodebiaozhiwei = ''; } else { (this.$refs.uToast as any).show({ title: '失败', type: 'error', }); - this.getlist(); } } + async tidan() { + //提单方法 + } } diff --git a/src/pages/wms/product/SalesReturn/index.vue b/src/pages/wms/product/SalesReturn/index.vue new file mode 100644 index 0000000..b26959e --- /dev/null +++ b/src/pages/wms/product/SalesReturn/index.vue @@ -0,0 +1,756 @@ + + + diff --git a/src/pages/wms/product/SalesReturn/model.ts b/src/pages/wms/product/SalesReturn/model.ts new file mode 100644 index 0000000..cb95c64 --- /dev/null +++ b/src/pages/wms/product/SalesReturn/model.ts @@ -0,0 +1,96 @@ +import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators'; +import store from '@/store'; +import http from '@/utils/request'; +import { url } from '@/utils/url'; +import { session } from '@/store/modules/session'; +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'page.product.SalesReturn', +}) +// http.defaults.headers.common['poolName'] = session.PoolName; +export class SalesReturn extends VuexModule { + WlList = []; + orderNoItemList: any = []; + @MutationAction + async queryOrderNo(orderNo: any) { + const result: any = await http.post(url.lanjuwms.product.SalesReturn.FinishedProductSalesReturn, { + productOrder: orderNo, + factoryCode: session.FactoryCode, + }); + const orderNoItemList = result.data; + return { orderNoItemList }; + } + productCodeList: any = []; + @MutationAction + async list(orderNo: any) { + const result: any = await http.get(url.lanjuwms.product.OfflineStorage.list + '/' + orderNo, {}); + const productCodeList = result.data; + return { productCodeList }; + } + SubmitCode: any = ''; + @MutationAction + async insertTary(params: any) { + const result: any = await http.post(url.lanjuwms.product.OfflineStorage.insertTary, params); + const SubmitCode = result.code; + return { SubmitCode }; + } + @MutationAction + async deleteTray(item: any) { + console.log(item); + const result: any = await http.delete(url.lanjuwms.product.OfflineStorage.deleteTray + '/' + item.sn + '/' + item.orderNo); + const SubmitCode = result.code; + return { SubmitCode }; + } + @MutationAction + async handPut(params: any) { + const result: any = await http.post(url.lanjuwms.product.SalesReturn.FinishedProductSalesReturnConfirm, params); + const SubmitCode = result.code; + return { SubmitCode }; + } + warehouselist: any = []; + @MutationAction + async getwarehouselist() { + const result = await http.post(url.lanjuwms.raw.ProductionREQ.warehouselist, { + factoryCode: session.FactoryCode, + }); + const warehouselist = result.data.map((element: any) => ({ + label: element.warehouseName, + value: element.warehouseCode, + ...element, + })); + return { warehouselist }; + } + selectdata: any = []; + selectcode: any = ''; + @MutationAction + async selectSnCorrelationBarcode(sn: string) { + const result: any = await http.post(url.lanjuwms.product.OfflineStorage.selectSnCorrelationBarcode, { + siteCode: session.FactoryCode, + sn: sn, + }); + const selectdata = result.data; + const selectcode = result.code; + return { selectdata, selectcode }; + } + addsncode: any = ''; + @MutationAction + async addSnCorrelationBarcode(params: any) { + const result: any = await http.post(url.lanjuwms.product.OfflineStorage.addSnCorrelationBarcode, params); + const addsncode = result.code; + return { addsncode }; + } + delsncode: any = ''; + @MutationAction + async deletSnCorrelationBarcode(params: any) { + const result: any = await http.post(url.lanjuwms.product.OfflineStorage.deletSnCorrelationBarcode, { + siteCode: session.FactoryCode, + storageId: params, + }); + const delsncode = result.code; + return { delsncode }; + } +} + +export default getModule(SalesReturn); diff --git a/src/pages/wms/product/TransferWarehouse/index.vue b/src/pages/wms/product/TransferWarehouse/index.vue new file mode 100644 index 0000000..8e59353 --- /dev/null +++ b/src/pages/wms/product/TransferWarehouse/index.vue @@ -0,0 +1,722 @@ + + + diff --git a/src/pages/wms/product/TransferWarehouse/model.ts b/src/pages/wms/product/TransferWarehouse/model.ts new file mode 100644 index 0000000..05b05ed --- /dev/null +++ b/src/pages/wms/product/TransferWarehouse/model.ts @@ -0,0 +1,71 @@ +import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators'; +import store from '@/store'; +import http from '@/utils/request'; +import { url } from '@/utils/url'; +import { session } from '@/store/modules/session'; +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'page.product.TransferWarehouse', +}) +export class TransferWarehouse extends VuexModule { + orderNoItemList: any = []; + @MutationAction + async showProduceCode(orderNo: any) { + const result: any = await http.post(url.lanjuwms.product.TransferWarehouse.selectFinishedProductTransferAndOutbound, { + deliveryOrder: orderNo, + factoryCode: session.FactoryCode, + }); + const orderNoItemList = result.data; + return { orderNoItemList }; + } + + SubmitCode: any = ''; + @MutationAction + async selloutconntray(params: any) { + const result: any = await http.post(url.lanjuwms.product.SaleOutWH.selloutconntray, params); + const SubmitCode = result.code; + return { SubmitCode }; + } + @MutationAction + async out(params: any) { + const result: any = await http.post(url.lanjuwms.product.TransferWarehouse.confirmFinishedProductTransferAndOutbound, params); + const SubmitCode = result.code; + return { SubmitCode }; + } + scanCode: any = ''; + scandatalist: any = []; + scandata: any = {}; + //整托 + @MutationAction + async ScanCodeWholePallet(params: any) { + const result: any = await http.post(url.lanjuwms.product.SaleOutWH.ScanCodeWholePallet, params); + const scanCode = result.code; + const scandatalist = result.data; + return { scanCode, scandatalist }; + } + //单箱 + @MutationAction + async ScanCodeSingleBox(params: any) { + const result: any = await http.post(url.lanjuwms.product.SaleOutWH.ScanCodeSingleBox, params); + const scanCode = result.code; + const scandata = result.data; + return { scanCode, scandata }; + } + warehouselist: any = []; + @MutationAction + async getwarehouselist() { + const result = await http.post(url.lanjuwms.raw.ProductionREQ.warehouselist, { + factoryCode: session.FactoryCode, + }); + const warehouselist = result.data.map((element: any) => ({ + label: element.warehouseName, + value: element.warehouseCode, + ...element, + })); + return { warehouselist }; + } +} + +export default getModule(TransferWarehouse); diff --git a/src/store/use/salesreturn.ts b/src/store/use/salesreturn.ts new file mode 100644 index 0000000..4a6eff2 --- /dev/null +++ b/src/store/use/salesreturn.ts @@ -0,0 +1,28 @@ +import { Action, getModule, Module, Mutation, VuexModule } from 'vuex-module-decorators'; +import store from '@/store'; + +export interface salesreturn { + kuwei?: string; + list?: any[]; + index?: string; + //rowitem?: string; +} +@Module({ + dynamic: true, + store, + namespaced: true, + name: 'data', +}) +class usedataService extends VuexModule { + salesreturndata: salesreturn | null = null; + @Mutation + salesreturn(data: salesreturn) { + this.salesreturndata = data; + } + + @Action + cacheData(data: salesreturn) { + this.context.commit('salesreturn', data); + } +} +export const usedata = getModule(usedataService); diff --git a/src/utils/page.ts b/src/utils/page.ts index ced89c4..e7f85b6 100644 --- a/src/utils/page.ts +++ b/src/utils/page.ts @@ -39,5 +39,8 @@ export const page = { WhiteOutstorage: '/pages/wms/WhiteManagement/WhiteOutstorage/index', TransferInlibrary: '/pages/wms/WhiteManagement/TransferInlibrary/index', WhiteReturn: '/pages/wms/WhiteManagement/WhiteReturn/index', + SalesReturn: '/pages/wms/product/SalesReturn/index', + SalesReturndetail: '/pages/wms/product/SalesReturn/detail', + TransferWarehouse: '/pages/wms/product/TransferWarehouse/index', }, }; diff --git a/src/utils/url.ts b/src/utils/url.ts index 25d58b3..6932e2a 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -74,6 +74,14 @@ export const url = { //销售出库确认 confirmFinishedProductSales: qianzhuione + '/wms/WmsToWCSmission/confirmFinishedProductSales', }, + SalesReturn: { + FinishedProductSalesReturn: qianzhuione + '/wms/WmsToWCSmission/FinishedProductSalesReturn', + FinishedProductSalesReturnConfirm: qianzhuione + '/wms/WmsToWCSmission/FinishedProductSalesReturnConfirm', + }, + TransferWarehouse: { + selectFinishedProductTransferAndOutbound: qianzhuione + '/wms/WmsToWCSmission/selectFinishedProductTransferAndOutbound', + confirmFinishedProductTransferAndOutbound: qianzhuione + '/wms/WmsToWCSmission/confirmFinishedProductTransferAndOutbound', + }, }, raw: { ReceivePO: {