From 152dbaa65b3eb3400098180f0ed8e6d0c480c9dc Mon Sep 17 00:00:00 2001 From: zhoulei Date: Sat, 25 Dec 2021 13:10:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=AD=9B=E9=80=89=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=8F=B7=E7=9A=84=E4=BB=93=E5=BA=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../raw/ingoods/dnReceipt/dnReceiving.vue | 34 +++--- .../raw/ingoods/dnReceipt/model.location.ts | 107 ++++++++++++++++++ src/pages/raw/ingoods/dnReceipt/model.ts | 14 ++- 3 files changed, 133 insertions(+), 22 deletions(-) create mode 100644 src/pages/raw/ingoods/dnReceipt/model.location.ts diff --git a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue index 52cdb63..8c48c7b 100644 --- a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue @@ -104,6 +104,7 @@ import { BasePage } from '@/components/base/page'; import jPicker from '@/components/J-Picker/jPicker.vue'; import { session } from '@/store/modules/session'; import model from './model'; +import LocationDetail from './model.location'; @Component({ components: { jPicker, @@ -126,8 +127,7 @@ export default class dnReceiptDom extends BasePage { //本次数量 receiptAmount: any = ''; //库位 - Location: any = []; - newLocation: any = []; + Location: LocationDetail[] = []; //添加的库位和数量的列表 LocationList: any = []; //所选择的库位对象 @@ -144,8 +144,9 @@ export default class dnReceiptDom extends BasePage { } // 页面初始化 // 页面需要清空仓库,因此需要复用该方法 - async initLocation() { + async initLocation(condition): Promise { //页面初始化 获取可选库位 + let list: Array = []; let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any); let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any); let content = { @@ -155,15 +156,16 @@ export default class dnReceiptDom extends BasePage { workArea: session.workareaCode, }; let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content); - res.forEach((item: any) => { - console.log('res is:', res); - let pickerName: any = {}; - pickerName.label = item.locationCode; - pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; - pickerName.sendSpot = item.sendSpot; - this.Location.push(pickerName); - console.log('this.Locaton', this.Location); + res.forEach((item: LocationDetail) => { + if (item.sendSpot === condition.sendSpot) { + let pickerName: any = {}; + pickerName.label = item.locationCode; + pickerName.value = item.locationCode + '(' + item.sendSpot + ')'; + pickerName.sendSpot = item.sendSpot; + list.push(pickerName); + } }); + return list; } //输入单号 查询数据 async query() { @@ -174,8 +176,6 @@ export default class dnReceiptDom extends BasePage { }); return; } - // 查询时初始化仓库 - this.initLocation(); await this.model.queryOrderInInfo(this.form.documentNo); if (model.code == '1') { uni.showToast({ @@ -235,13 +235,11 @@ export default class dnReceiptDom extends BasePage { }); } //选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount - materialChoice(e: any) { + async materialChoice(e: any) { // 待放入新增中的公共对象 this.every = { ...e.pickerName }; - console.log('this.every', this.every); - //guoshuang 修改库位下拉数据为 与选择的物料下SAP相同的所有库位 - this.newLocation = this.Location.filter((item: any) => item.sendSpot === this.every.sendSpot); - console.log('newLoction', this.newLocation); + // 查询时初始化仓库 + this.Location = await this.initLocation(this.every); } //选择库位后触发的回调事件 LocationChoice(e: any) { diff --git a/src/pages/raw/ingoods/dnReceipt/model.location.ts b/src/pages/raw/ingoods/dnReceipt/model.location.ts new file mode 100644 index 0000000..3567051 --- /dev/null +++ b/src/pages/raw/ingoods/dnReceipt/model.location.ts @@ -0,0 +1,107 @@ +/* + * @Author: zhou lei + * @Date: 2021-12-24 12:02:31 + * @LastEditTime: 2021-12-24 14:33:54 + * @LastEditors: zhou lei + * @Description: + * @FilePath: /wms_haiwai_app/src/pages/raw/ingoods/dnReceipt/model.location.ts + * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 + */ +/** + * 库位类型 + * @export + * @interface LocationDetail + */ +export default interface LocationDetail { + factoryCode?: string; + cosmoType?: null; + sapFactoryCode?: null; + user?: null; + loginName?: null; + sign?: null; + page?: number; + rows?: number; + schema?: null; + lastModifiedBy?: null; + gmtCreate?: null; + createdBy?: null; + createdByName?: null; + warehouseCode?: string; + warehouseName?: null; + warehouseType?: string; + workareaCode?: null; + createdDate?: null; + createdDateStr?: null; + createdDateMax?: null; + createdDateMaxStr?: null; + createdDateMin?: null; + createdDateMinStr?: null; + lastUpdBy?: null; + lastUpdByName?: null; + lastUpdDate?: null; + lastUpdDateStr?: null; + lastUpdDateMax?: null; + lastUpdDateMin?: null; + activeFlag?: string; + userDefined1?: null; + userDefined2?: null; + userDefined3?: null; + userDefined4?: null; + userDefined5?: null; + userDefined6?: null; + userDefined7?: null; + userDefined8?: null; + userDefined9?: null; + userDefined10?: null; + remark?: null; + createBy?: null; + gmtCreateMin?: null; + gmtCreateStr?: null; + gmtCreateMax?: null; + gmtModified?: null; + gmtModifiedStr?: null; + gmtModifiedMax?: null; + gmtModifiedMin?: null; + locationId?: null; + locationCode?: string; + shelfOrder?: null; + sendSpot?: string; + sendSpotDesc1?: string; + checkOrder?: null; + pickOrder?: null; + locationUse?: null; + pickFlag?: null; + isOpenKnFlag?: null; + locationType?: null; + locationAttr?: null; + turnDemand?: null; + stockEnv?: null; + regionCode?: string; + areaCode?: string; + checkCode?: null; + workArea?: string; + port1?: null; + port2?: null; + port3?: null; + volumeLimit?: null; + weightLimit?: null; + boxLimit?: null; + qtyLimit?: null; + palletLimit?: null; + length?: null; + width?: null; + height?: null; + xcoordinate?: null; + ycoordinate?: null; + zcoordinate?: null; + xpixels?: null; + ypixels?: null; + zpixels?: null; + locRow?: null; + layerNum?: null; + locColumn?: null; + bord?: null; + productMix?: null; + batchMix?: null; + ignoreId?: null; +} diff --git a/src/pages/raw/ingoods/dnReceipt/model.ts b/src/pages/raw/ingoods/dnReceipt/model.ts index 5d1574f..51ba0fc 100644 --- a/src/pages/raw/ingoods/dnReceipt/model.ts +++ b/src/pages/raw/ingoods/dnReceipt/model.ts @@ -3,8 +3,7 @@ import store from '@/store'; import http from '@/utils/request'; import { url } from '@/utils/url'; import { session } from '@/store/modules/session'; -import httpjson from '@/utils/location'; - +import LocationDetail from './model.location'; class OrderInInfo { checked?: boolean; dnNo?: string; @@ -225,15 +224,22 @@ export class ReceiptModule extends VuexModule { }); return kw; } + /** + * 库位查询 + * + * @param {*} content + * @returns + * @memberof ReceiptModule + */ @Action({ commit: 'updateCheckedOrderInInfoListKw' }) async queryByFactoryCodeAndWorkAreaCode(content: any) { - let res = await http.post('wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); + const res = await http.post('wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); return res; } //查询DN/海外DN收货明细 @Action({ commit: 'updateCheckedOrderInInfoListKw' }) async querydetaildlist(content: any) { - let res: any = await http.post('/wmspda/material/getDnRecSn', content); + const res: any = await http.post('/wmspda/material/getDnRecSn', content); console.log('明细》》》》》》》》》', res.list); this.DNdetailedList = res.list; return res;