From beff5a95c7cf3de8eeee9655265dc1eff3ab2e6c Mon Sep 17 00:00:00 2001 From: guoshuang Date: Thu, 14 Sep 2023 16:48:53 +0800 Subject: [PATCH] =?UTF-8?q?mes=E6=89=98=E7=9B=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD&=E7=94=9F=E4=BA=A7=E8=B4=A8=E6=A3=80?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=83=98=E6=88=BF=E4=B8=8B=E5=8F=91=E6=90=AC?= =?UTF-8?q?=E8=BF=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/mes/PalletChange/index.vue | 31 ++++++++++++++++++++++- src/pages/mes/PalletChange/model.ts | 8 ++++++ src/pages/mes/ProductionQtyInsp/index.vue | 30 +++++++++++++++++++++- src/pages/mes/ProductionQtyInsp/model.ts | 7 +++++ src/pages/shouye/index.vue | 21 ++++++++++----- src/utils/url.ts | 2 ++ 6 files changed, 90 insertions(+), 9 deletions(-) diff --git a/src/pages/mes/PalletChange/index.vue b/src/pages/mes/PalletChange/index.vue index f499dd6..38fce7c 100644 --- a/src/pages/mes/PalletChange/index.vue +++ b/src/pages/mes/PalletChange/index.vue @@ -18,6 +18,9 @@ 提交 + + + @@ -39,12 +42,38 @@ export default class PalletChange extends BasePage { // this.remove = e.pickerName; // } orderNo: any = ''; + location: any = ''; + generateGUID() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = (Math.random() * 16) | 0, + v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + } async query() { if (this.orderNo == '' || this.orderNo.length == 0) { this.customToast('请输入nficl'); return; } - await this.model.queryOrderNo(this.orderNo); + var currentDate = new Date(); + + // 获取年份、月份、日期、小时、分钟和秒 + var year = currentDate.getFullYear(); + var month = ('0' + (currentDate.getMonth() + 1)).slice(-2); + var day = ('0' + currentDate.getDate()).slice(-2); + var hours = ('0' + currentDate.getHours()).slice(-2); + var minutes = ('0' + currentDate.getMinutes()).slice(-2); + var seconds = ('0' + currentDate.getSeconds()).slice(-2); + + // 格式化为 "YYYY-MM-DD HH:mm:ss" 结构 + var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; + let params = { + rfidNo: this.orderNo, + reqCode: this.generateGUID(), + reqTime: formattedDate, + location: this.location, + }; + await this.model.palletInforUpdate(params); } } diff --git a/src/pages/mes/PalletChange/model.ts b/src/pages/mes/PalletChange/model.ts index a806771..c6d8f3b 100644 --- a/src/pages/mes/PalletChange/model.ts +++ b/src/pages/mes/PalletChange/model.ts @@ -28,6 +28,14 @@ export class PalletChange extends VuexModule { const orderNoItemList = []; return { orderNoItemList }; } + SubmitCode: any = ''; + //托盘信息变更x + @MutationAction + async palletInforUpdate(params: any) { + const result: any = await http.post(url.lanjumes.product.palletInforUpdate, params); + const SubmitCode = result.code; + return { SubmitCode }; + } } export default getModule(PalletChange); diff --git a/src/pages/mes/ProductionQtyInsp/index.vue b/src/pages/mes/ProductionQtyInsp/index.vue index ac3a02c..203c4b9 100644 --- a/src/pages/mes/ProductionQtyInsp/index.vue +++ b/src/pages/mes/ProductionQtyInsp/index.vue @@ -214,8 +214,36 @@ export default class productCheckReceipt extends BasePage { await this.model.queryOrderNo(this.orderNo); } histroyItem: any = {}; - selectProductCode(e: any) { + generateGUID() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = (Math.random() * 16) | 0, + v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + } + async selectProductCode(e: any) { this.productCodeList = e.pickerName; + if (this.productCodeList.value == '1') { + // 创建一个新的日期对象 + var currentDate = new Date(); + + // 获取年份、月份、日期、小时、分钟和秒 + var year = currentDate.getFullYear(); + var month = ('0' + (currentDate.getMonth() + 1)).slice(-2); + var day = ('0' + currentDate.getDate()).slice(-2); + var hours = ('0' + currentDate.getHours()).slice(-2); + var minutes = ('0' + currentDate.getMinutes()).slice(-2); + var seconds = ('0' + currentDate.getSeconds()).slice(-2); + + // 格式化为 "YYYY-MM-DD HH:mm:ss" 结构 + var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; + let params = { + rfidNo: this.orderNo, + reqCode: this.generateGUID(), + reqTime: formattedDate, + }; + await this.model.sendDestinationStations(params); + } } barcode: any = ''; async onSubmit() { diff --git a/src/pages/mes/ProductionQtyInsp/model.ts b/src/pages/mes/ProductionQtyInsp/model.ts index ce9e34f..592a6ff 100644 --- a/src/pages/mes/ProductionQtyInsp/model.ts +++ b/src/pages/mes/ProductionQtyInsp/model.ts @@ -60,6 +60,13 @@ export class wholeTransfer extends VuexModule { const SubmitCode = result.code; return { SubmitCode }; } + //烘房出来下发搬运任务 + @MutationAction + async sendDestinationStations(params: any) { + const result: any = await http.post(url.lanjumes.product.sendDestinationStations, params); + const SubmitCode = result.code; + return { SubmitCode }; + } @MutationAction async empty() { const orderNoItemList = []; diff --git a/src/pages/shouye/index.vue b/src/pages/shouye/index.vue index 1ea178d..027c751 100644 --- a/src/pages/shouye/index.vue +++ b/src/pages/shouye/index.vue @@ -19,13 +19,7 @@ - + {{ item.menuName }} @@ -80,6 +74,9 @@ export default class RawHome extends BasePage { factoryList: any = {}; today = dayjs().format('YYYY-MM-DD dddd'); onReady() { + if (session.FactoryCode != undefined) { + this.factoryList.value = session.FactoryCode; + } this.newmenuList = this.menuList.filter((item) => item.perms == 'wms' || item.perms == 'mes'); console.log('1234', this.menuList); } @@ -93,6 +90,16 @@ export default class RawHome extends BasePage { url: `/pages/mes/index`, }); } + togopage(path) { + //console.log('guoguo',session.FactoryCode) + if (session.FactoryCode == undefined) { + this.customToast('请选择工厂'); + } else { + uni.navigateTo({ + url: path, + }); + } + } selectProductCode(e: any) { this.factoryList = e.pickerName; const factory: string = this.factoryList.factory; diff --git a/src/utils/url.ts b/src/utils/url.ts index 2a15c8f..845c8b4 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -405,6 +405,8 @@ export const url = { getInfoByRfid: '/dev-api/quality/handCheck/getInfoByRfid', saveQcProCheck: '/dev-api/quality/handCheck/saveQcProCheck', queryhandChecklist: '/dev-api/quality/handCheck/list', + sendDestinationStations: '/api/ReceivingAndFeedingMaterials/sendDestinationStations', + palletInforUpdate: '/api/ReceivingAndFeedingMaterials/palletInforUpdate', }, }, lanjuwms: {