From 98b370b4af0d33c7803b9da65a02520a01ee83c9 Mon Sep 17 00:00:00 2001 From: hou <1601990943@qq.com> Date: Mon, 7 Mar 2022 14:47:57 +0800 Subject: [PATCH] =?UTF-8?q?dam-7=20feat=20=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E8=A1=A5=E6=96=99=E5=A2=9E=E5=8A=A0=E5=BA=93=E4=BD=8D=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=20=20=E6=98=8E=E7=BB=86=E5=A2=9E=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../raw/handover/feeding/Local-details.vue | 8 ++- src/pages/raw/handover/feeding/Location.vue | 60 ++++++++++++++++++- src/pages/raw/handover/feeding/config.ts | 5 ++ src/pages/raw/handover/feeding/model.ts | 17 +++++- 4 files changed, 86 insertions(+), 4 deletions(-) diff --git a/src/pages/raw/handover/feeding/Local-details.vue b/src/pages/raw/handover/feeding/Local-details.vue index c48fa6e..6402ee1 100644 --- a/src/pages/raw/handover/feeding/Local-details.vue +++ b/src/pages/raw/handover/feeding/Local-details.vue @@ -2,7 +2,7 @@ - + {{ $t('message.Pi_QueryResults') }} @@ -17,11 +17,13 @@ import { Component } from 'vue-property-decorator'; import { BasePage } from '@/components/base/page'; import { headers } from './config'; import model from './model'; - @Component export default class RawReceiptDetail extends BasePage { model = model; headers = headers; + go() { + this.redirectTo(this.page.raw.handover.feeding.Location); + } } + +function go() { throw new Error('Function not implemented.'); } diff --git a/src/pages/raw/handover/feeding/Location.vue b/src/pages/raw/handover/feeding/Location.vue index ddc6192..a49a2f9 100644 --- a/src/pages/raw/handover/feeding/Location.vue +++ b/src/pages/raw/handover/feeding/Location.vue @@ -219,14 +219,72 @@ export default class RawReceiptDetail extends BasePage { this.some = this.model.blDetailList[0]; this.someIndex = 0; }); + await this.model.queryItemLoc({ + workArea: session.workareaCode, + loginName: session.loginName, + sendSpot: null, + materialCode: this.some.materialCode, + factoryCode: session.factoryCode, + }); + if (this.model.LocList.length != 0) { + this.Location = []; + this.Location = this.model.LocList; + this.wlCode = this.Location[0]; + } else { + this.Location = []; + let content = { + loginName: session.loginName, + sendSpot: null, + factoryCode: session.factoryCode, + workArea: session.workareaCode, + }; + let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); + res.forEach((item: any) => { + let pickerName: any = {}; + pickerName.label = item.locationCode; + pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; + pickerName.sendSpot = item.sendSpot; + this.Location.push(pickerName); + }); + this.wlCode = this.Location[0]; + } } - materialChoice(e: any) { + async materialChoice(e: any) { this.model.blDetailList.forEach((item: any, index: any) => { if (item.materialCode == e.pickerName.label) { this.some = item; this.someIndex = index; } }); + await this.model.queryItemLoc({ + workArea: session.workareaCode, + loginName: session.loginName, + sendSpot: null, + materialCode: this.some.materialCode, + factoryCode: session.factoryCode, + }); + if (this.model.LocList.length != 0) { + this.Location = []; + this.Location = this.model.LocList; + this.wlCode = this.Location[0]; + } else { + this.Location = []; + let content = { + loginName: session.loginName, + sendSpot: null, + factoryCode: session.factoryCode, + workArea: session.workareaCode, + }; + let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); + res.forEach((item: any) => { + let pickerName: any = {}; + pickerName.label = item.locationCode; + pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; + pickerName.sendSpot = item.sendSpot; + this.Location.push(pickerName); + }); + this.wlCode = this.Location[0]; + } this.qty = ''; } LocationChoice(e: any) { diff --git a/src/pages/raw/handover/feeding/config.ts b/src/pages/raw/handover/feeding/config.ts index 485bc8d..0daa152 100644 --- a/src/pages/raw/handover/feeding/config.ts +++ b/src/pages/raw/handover/feeding/config.ts @@ -3,6 +3,11 @@ */ import vm from '@/main'; export const headers = [ + { + label: vm.$t('message.InventoryOrderNo'), + key: 'prdOrder', //单号 + width: 220, + }, { label: vm.$t('message.po_MaterielNo'), key: 'materialCode', //物料号 diff --git a/src/pages/raw/handover/feeding/model.ts b/src/pages/raw/handover/feeding/model.ts index 1b6a059..c3d78c8 100644 --- a/src/pages/raw/handover/feeding/model.ts +++ b/src/pages/raw/handover/feeding/model.ts @@ -17,6 +17,7 @@ export class FeedingModule extends VuexModule { */ blDetailList: any[] = []; detailedList: any; + LocList: any = []; /** * 库位列表 @@ -81,7 +82,21 @@ export class FeedingModule extends VuexModule { } }); } - + @MutationAction + async queryItemLoc(params: any = {}) { + const res: any = await http.post(url.sortscan.save.queryWlByMat, params); + const LocList = []; + res.forEach((item: any) => { + const arr: any = { + label: item.locationCode, + value: item.locationCode + '(' + item.sendSpot + ')', + }; + LocList.push(arr); + }); + console.log('res', res); + console.log('LocList', LocList); + return { LocList }; + } /** * 上传补料明细列表 */