From ef6ba8b00e19c28502647c6844cb0a346e5f4b9d Mon Sep 17 00:00:00 2001 From: guoshuang Date: Thu, 7 Sep 2023 17:50:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=B4=A8=E6=A3=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/J-Picker/jPicker.vue | 4 +-- src/pages/login/area/model.ts | 1 + src/pages/login/login/index.vue | 2 +- src/pages/mes/ProductionQtyInsp/detail.vue | 4 +-- src/pages/mes/ProductionQtyInsp/index.vue | 4 +-- src/pages/mes/ProductionQtyInsp/listdata.vue | 18 ++++++++----- src/pages/mes/ProductionQtyInsp/model.ts | 6 ++--- src/pages/shouye/index.vue | 6 +++-- src/store/modules/session.ts | 27 +++++++++++++++++--- 9 files changed, 49 insertions(+), 23 deletions(-) diff --git a/src/components/J-Picker/jPicker.vue b/src/components/J-Picker/jPicker.vue index 4a4c3dd..b183913 100644 --- a/src/components/J-Picker/jPicker.vue +++ b/src/components/J-Picker/jPicker.vue @@ -19,7 +19,7 @@ - {{ $t('message.product_Cancel') }} + 取消 - {{ $t('message.workArea_Confirm') }} + 确定 diff --git a/src/pages/login/area/model.ts b/src/pages/login/area/model.ts index 1a2d4a1..457333f 100644 --- a/src/pages/login/area/model.ts +++ b/src/pages/login/area/model.ts @@ -32,6 +32,7 @@ class AreaService extends VuexModule { factoryname: area.parkName, value: area.poolName.split('_')[1], label: area.parkName, + poolName: area.poolName, })); } else { return []; diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index d4c31b6..83bdd20 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -75,7 +75,7 @@ hover-class="button-hover" type="primary" @click="login" - >login登录 diff --git a/src/pages/mes/ProductionQtyInsp/detail.vue b/src/pages/mes/ProductionQtyInsp/detail.vue index 464bc92..64e45d1 100644 --- a/src/pages/mes/ProductionQtyInsp/detail.vue +++ b/src/pages/mes/ProductionQtyInsp/detail.vue @@ -43,7 +43,7 @@ - + @@ -52,7 +52,7 @@ - + 照片 diff --git a/src/pages/mes/ProductionQtyInsp/index.vue b/src/pages/mes/ProductionQtyInsp/index.vue index cae2a6d..361adbc 100644 --- a/src/pages/mes/ProductionQtyInsp/index.vue +++ b/src/pages/mes/ProductionQtyInsp/index.vue @@ -166,7 +166,7 @@ export default class productCheckReceipt extends BasePage { fileType: 'image', filePath: item, header: { - Authorization: 'Bearer ' + session.user.access_token, + Authorization: 'Bearer ' + session.user?.access_token, // 'cosmo-env-sitecode': this.$store.state.siteCode }, name: 'file', @@ -234,7 +234,7 @@ export default class productCheckReceipt extends BasePage { console.log('tupian', this.imgList.join(',')); let params = { rfid: this.orderNo, - factoryCode: session.FactoryCode.factoryCode, + factoryCode: session.FactoryCode, orderCode: model.orderNoItemList.orderCode, workorderCode: model.orderNoItemList.workorderCode, machineCode: model.orderNoItemList.machineCode, diff --git a/src/pages/mes/ProductionQtyInsp/listdata.vue b/src/pages/mes/ProductionQtyInsp/listdata.vue index 63e35a2..fa4406e 100644 --- a/src/pages/mes/ProductionQtyInsp/listdata.vue +++ b/src/pages/mes/ProductionQtyInsp/listdata.vue @@ -94,8 +94,8 @@ export default class productCheckReceipt extends BasePage { this.query(); } changeContent(e) { - console.log('eee', e.data); - this.rowdata = e.data[0].lineData; + //console.log('eee', e.data); + this.rowdata = e.data[0]?.lineData; // uni.$emit('changeContent',e); } gozhijian() { @@ -105,11 +105,15 @@ export default class productCheckReceipt extends BasePage { } goxiangxi() { //debugger - console.log('xssss',this.rowdata); - this.model.rowdata = this.rowdata; - this.uni.navigateTo({ - url: this.page.mes.ProductionQtyInspDetail, - }); + //console.log('xssss',this.rowdata); + if (JSON.stringify(this.rowdata) === '{}' || this.rowdata === undefined) { + this.customToast('请选择一行进行查看'); + } else { + this.model.rowdata = this.rowdata; + this.uni.navigateTo({ + url: this.page.mes.ProductionQtyInspDetail, + }); + } } async query() { this.tableData = []; diff --git a/src/pages/mes/ProductionQtyInsp/model.ts b/src/pages/mes/ProductionQtyInsp/model.ts index ea8c1bb..ce9e34f 100644 --- a/src/pages/mes/ProductionQtyInsp/model.ts +++ b/src/pages/mes/ProductionQtyInsp/model.ts @@ -33,7 +33,7 @@ export class wholeTransfer extends VuexModule { const result: any = await http.get(url.lanjumes.product.getInfoByRfid, { //loginName: session.loginName, params: { - factoryCode: session.FactoryCode.factoryCode, + factoryCode: session.FactoryCode, rfid: orderNo, }, }); @@ -45,8 +45,8 @@ export class wholeTransfer extends VuexModule { const result: any = await http.get(url.lanjumes.product.queryhandChecklist, { //loginName: session.loginName, params: { - factoryCode: session.FactoryCode.factoryCode, - createBy: session.user.createBy, + factoryCode: session.FactoryCode, + createBy: session.user?.createBy, }, }); const Checklist = result; diff --git a/src/pages/shouye/index.vue b/src/pages/shouye/index.vue index cd9e208..53a6ee3 100644 --- a/src/pages/shouye/index.vue +++ b/src/pages/shouye/index.vue @@ -92,11 +92,13 @@ export default class RawHome extends BasePage { selectProductCode(e: any) { this.factoryList = e.pickerName; const factory: string = this.factoryList.factory; + const poolName: string = this.factoryList.poolName; console.log('ccccc', this.factoryList); - session.setfactoryCode({ + session.setFactory({ factoryCode: factory, + poolName: poolName, }); - console.log('gongchang', session.FactoryCode); + console.log('gongchang', session.factory); } } diff --git a/src/store/modules/session.ts b/src/store/modules/session.ts index f7c5c05..fb9ee44 100644 --- a/src/store/modules/session.ts +++ b/src/store/modules/session.ts @@ -16,6 +16,10 @@ export interface User { poolNameList?: Array; createBy: string; } +export interface FactoryCode { + factoryCode?: string; + poolName?: string; +} @Module({ dynamic: true, @@ -28,6 +32,7 @@ class SessionService extends VuexModule { * 当前登录用户 */ user: User | null = null; + factory: FactoryCode | null = null; factoryCode: string; //factoryCode: factoryCode | null = null; Version = ''; @@ -85,10 +90,17 @@ class SessionService extends VuexModule { } get FactoryCode(): any { - if (this.factoryCode === null) { + if (this.factory === null) { return null; } else { - return this.factoryCode; + return this.factory.factoryCode; + } + } + get PoolName(): any { + if (this.factory === null) { + return null; + } else { + return this.factory.poolName; } } /** @@ -141,6 +153,13 @@ class SessionService extends VuexModule { return this.user; } } + get getFactory(): FactoryCode { + if (this.factory === null) { + throw new Error('当前无选择工厂'); + } else { + return this.factory; + } + } // 登录 @Action({ rawError: true }) @@ -175,8 +194,8 @@ class SessionService extends VuexModule { this.user = user; } @Mutation - setfactoryCode(factoryCode): void { - this.factoryCode = factoryCode; + setFactory(factory: FactoryCode): void { + this.factory = factory; } // 保存工作区信息