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 }; + } /** * 上传补料明细列表 */