diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index 8800476..d5ba0e0 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -548,5 +548,7 @@ export default { SPDR: '备件DN收货', Nodefectname: '没有缺陷名称', Nozonename: '没有区域名称', + isdeffrent: '容器码的物料与选择的物料不相同', + Notcompleted: '物料没有收货完成', }, }; diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 727dd19..ed865b3 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -547,5 +547,7 @@ export default { SPDR: 'Spare Part DN Receive', Nodefectname: 'No defect name', Nozonename: 'No zone name', + isdeffrent: 'The material with container code is different from the selected material', + Notcompleted: 'material has not been received', }, }; diff --git a/src/i18n/lang/ru.ts b/src/i18n/lang/ru.ts index c47c43f..b9a3b11 100644 --- a/src/i18n/lang/ru.ts +++ b/src/i18n/lang/ru.ts @@ -547,5 +547,7 @@ export default { SPDR: 'Запасные части DN Получение', Nodefectname: 'Имя дефекта отсутствует', Nozonename: 'Нет названия региона', + isdeffrent: 'Материал кода контейнера отличается от выбранного материала.', + Notcompleted: 'Материалы пока не получены', }, }; diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 4487e9f..5d93e36 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -171,9 +171,9 @@ export default class LoginPage extends BasePage { console.log('......', server.serverAddress); if (server.serverAddress.includes('https://eurmom.haier.net')) { //修改俄罗斯版本号 - this.Version = '1.1.22'; + this.Version = '1.1.23'; } else { - this.Version = '1.0.47'; + this.Version = '1.0.48'; } console.log('////', this.Version); } diff --git a/src/pages/raw/handover/aggregating/index.vue b/src/pages/raw/handover/aggregating/index.vue index bd9bc91..ff55a9e 100644 --- a/src/pages/raw/handover/aggregating/index.vue +++ b/src/pages/raw/handover/aggregating/index.vue @@ -212,6 +212,17 @@ export default class Aggregating extends BasePage { async onLoad() { this.getLoc(); } + async onShow() { + await this.getMRP(); + } + async getMRP() { + let params = { + factoryCode: session.factoryCode, + loginName: session.loginName, + }; + let res: any = await this.model.getMRP(params); + this.form.mrpScope = res.data; + } async getLoc() { //debugger; await this.model.getSendSpotList1({ @@ -293,9 +304,12 @@ export default class Aggregating extends BasePage { async onQuery() { this.$form.validate(async (valid: boolean) => { if (!valid) return; - await this.model.queryProOrder(Object.assign(this.formParams, { sendSpot: this.formone.aimWl.value })); - this.isFormChange = false; - this.model.isFormChange = this.formParams; + await this.model.checkUserAndMrp({ mrpCodeRegion: this.form.mrpScope, loginName: session.loginName, factoryCode: session.factoryCode }); + if (this.model.mrpcode == 1) { + await this.model.queryProOrder(Object.assign(this.formParams, { sendSpot: this.formone.aimWl.value })); + this.isFormChange = false; + this.model.isFormChange = this.formParams; + } }); } } diff --git a/src/pages/raw/handover/aggregating/model.ts b/src/pages/raw/handover/aggregating/model.ts index 59f3185..698bb0b 100644 --- a/src/pages/raw/handover/aggregating/model.ts +++ b/src/pages/raw/handover/aggregating/model.ts @@ -45,6 +45,8 @@ export class AggregatingModule extends VuexModule { * 库存地点列表 */ locationList = []; + // mrp校验 + mrpcode: any = ''; /** * 是否全选 @@ -323,6 +325,25 @@ export class AggregatingModule extends VuexModule { const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); return res; } + //获取MRP + @Action + async getMRP(params: any = {}) { + const res = await http.post(url.sortscan.save.queryMrpByUser, params); + // const code = res.code; + // const mrpdata = res.data; + // console.log('mrpdata', mrpdata); + return res; + } + /** + * mrp校验 + * @param params + */ + @MutationAction + async checkUserAndMrp(params: any) { + const res: any = await http.post(url.sortscan.save.checkUserAndMrp, params); + const mrpcode = res.code; + return { mrpcode }; + } } export default getModule(AggregatingModule); diff --git a/src/pages/raw/handover/picking/ByOrder.vue b/src/pages/raw/handover/picking/ByOrder.vue index 20d5f84..d5ce109 100644 --- a/src/pages/raw/handover/picking/ByOrder.vue +++ b/src/pages/raw/handover/picking/ByOrder.vue @@ -324,8 +324,25 @@ export default class RawReceiptDetail extends BasePage { } } async onAggregate() { - await this.model.queryProOrder(this.model.formParams); - await this.model.queryProOrderResult(this.model.NEWparams); + try { + //this.model.formParams + await this.model.queryProOrder(this.model.formParams); + } catch { + this.model.proOrderResultList.forEach((item, index) => { + if (parseFloat(item.amount) <= parseFloat(item.currentAmount) + parseFloat(item.totalMoAmount)) { + this.model.proOrderResultList.splice(index, 1); + } + }); + } + try { + await this.model.queryProOrderResult(this.model.NEWparams); + } catch { + this.model.proOrderResultList.forEach((item, index) => { + if (parseFloat(item.amount) <= parseFloat(item.currentAmount) + parseFloat(item.totalMoAmount)) { + this.model.proOrderResultList.splice(index, 1); + } + }); + } if (this.model.proOrderResultList.length == 0) { this.disableflg = false; this.some = {}; diff --git a/src/pages/raw/handover/picking/BySummary.vue b/src/pages/raw/handover/picking/BySummary.vue index bd82407..16cb3ec 100644 --- a/src/pages/raw/handover/picking/BySummary.vue +++ b/src/pages/raw/handover/picking/BySummary.vue @@ -310,8 +310,24 @@ export default class RawReceiptDetail extends BasePage { } } async onAggregate() { - await this.model.queryProOrder(this.model.formParams); - await this.model.queryProOrderResult(this.model.NEWparams); + try { + await this.model.queryProOrder(this.model.formParams); + } catch { + this.model.aggregateList.forEach((item, index) => { + if (parseFloat(item.amount) <= parseFloat(item.currentAmount) + parseFloat(item.totalMoAmount)) { + this.model.aggregateList.splice(index, 1); + } + }); + } + try { + await this.model.queryProOrderResult(this.model.NEWparams); + } catch { + this.model.aggregateList.forEach((item, index) => { + if (parseFloat(item.amount) <= parseFloat(item.currentAmount) + parseFloat(item.totalMoAmount)) { + this.model.aggregateList.splice(index, 1); + } + }); + } const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId); const params = { factoryCode: session.factoryCode, diff --git a/src/pages/raw/handover/picking/index.vue b/src/pages/raw/handover/picking/index.vue index 027482b..7f02c08 100644 --- a/src/pages/raw/handover/picking/index.vue +++ b/src/pages/raw/handover/picking/index.vue @@ -172,14 +172,17 @@ export default class pickingDom extends BasePage { } return params; } - // async onLoad() { - // await this.getMRP(); - // } - // async getMRP() { - // let params = {}; - // await this.model.getMRP(params); - // this.form.mrpCodeRegion = model.mrpdata; - // } + async onShow() { + await this.getMRP(); + } + async getMRP() { + let params = { + factoryCode: session.factoryCode, + loginName: session.loginName, + }; + let res: any = await this.model.getMRP(params); + this.form.mrpCodeRegion = res.data; + } // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 onReady() { this.$form.setRules(this.rules); @@ -241,12 +244,15 @@ export default class pickingDom extends BasePage { onQuery() { this.$form.validate(async (valid: boolean) => { if (!valid) return; - await this.model.queryProOrder(this.formParams); - this.model.checkAllProOrderList(true); - this.isFormChange = false; - model.mrpCodeRegion = this.form.mrpCodeRegion as any; - model.sapFactoryCode = this.form.sapFactoryCode as any; - model.formParams = this.formParams; + await this.model.checkUserAndMrp({ mrpCodeRegion: this.form.mrpCodeRegion, loginName: session.loginName, factoryCode: session.factoryCode }); + if (this.model.mrpcode == 1) { + await this.model.queryProOrder(this.formParams); + this.model.checkAllProOrderList(true); + this.isFormChange = false; + model.mrpCodeRegion = this.form.mrpCodeRegion as any; + model.sapFactoryCode = this.form.sapFactoryCode as any; + model.formParams = this.formParams; + } }); } } diff --git a/src/pages/raw/handover/picking/model.ts b/src/pages/raw/handover/picking/model.ts index 1f33e9a..e29372b 100644 --- a/src/pages/raw/handover/picking/model.ts +++ b/src/pages/raw/handover/picking/model.ts @@ -20,11 +20,12 @@ export class PickingModule extends VuexModule { sapFactoryCode: ''; formParams: ''; code = ''; - //mrpdata: any; + mrpdata: any; orderOutIdList: any; NEWparams: any; LocList: any = []; lockCode: any = ''; + mrpcode: any = ''; /** * 查询结果列表(按单列表) @@ -247,6 +248,16 @@ export class PickingModule extends VuexModule { } return { proOrderList }; } + /** + * mrp校验 + * @param params + */ + @MutationAction + async checkUserAndMrp(params: any) { + const res: any = await http.post(url.sortscan.save.checkUserAndMrp, params); + const mrpcode = res.code; + return { mrpcode }; + } @MutationAction async queryOrder() { const { list: proOrderList }: any = await http.post(url.sortscan.query.prdorder, this.formParams); @@ -407,14 +418,14 @@ export class PickingModule extends VuexModule { return res; } //获取MRP - // @MutationAction - // async getMRP(params: any = {}) { - // const res: any = await http.post(url.sortscan.save.order, params); - // const code = res.code; - // const mrpdata = res.data; - // console.log('code', code); - // return { code, mrpdata }; - // } + @Action + async getMRP(params: any = {}) { + const res = await http.post(url.sortscan.save.queryMrpByUser, params); + // const code = res.code; + // const mrpdata = res.data; + // console.log('mrpdata', mrpdata); + return res; + } } export default getModule(PickingModule); diff --git a/src/pages/raw/handover/virtual/index.vue b/src/pages/raw/handover/virtual/index.vue index 98160dd..3c44f18 100644 --- a/src/pages/raw/handover/virtual/index.vue +++ b/src/pages/raw/handover/virtual/index.vue @@ -195,6 +195,17 @@ export default class Virtual extends BasePage { async onLoad() { this.getLoc(); } + async onShow() { + await this.getMRP(); + } + async getMRP() { + let params = { + factoryCode: session.factoryCode, + loginName: session.loginName, + }; + let res: any = await this.model.getMRP(params); + this.form.mrpScope = res.data; + } async getLoc() { await this.model.getSendSpotList1({ loginName: session.loginName, @@ -250,8 +261,11 @@ export default class Virtual extends BasePage { onQuery() { this.$form.validate(async (valid: boolean) => { if (!valid) return; - this.model.queryProOrder(Object.assign(this.formParams, { sendSpot: this.formone.aimWl.value })); - this.isFormChange = false; + await this.model.checkUserAndMrp({ mrpCodeRegion: this.form.mrpScope, loginName: session.loginName, factoryCode: session.factoryCode }); + if (this.model.mrpcode == 1) { + this.model.queryProOrder(Object.assign(this.formParams, { sendSpot: this.formone.aimWl.value })); + this.isFormChange = false; + } }); } ondelete() { diff --git a/src/pages/raw/handover/virtual/model.ts b/src/pages/raw/handover/virtual/model.ts index 23b38cf..0e9451e 100644 --- a/src/pages/raw/handover/virtual/model.ts +++ b/src/pages/raw/handover/virtual/model.ts @@ -40,7 +40,8 @@ export class VirtualModule extends VuexModule { * 查询列表 */ proOrderList = []; - + //mrp校验 + mrpcode: any = ''; /** * 查询结果列表 */ @@ -179,6 +180,25 @@ export class VirtualModule extends VuexModule { async uploadSummaryList(params: { sapFactoryCode: string; operatorPass: string; factoryCode: string; loginName: string; dataList: any[]; includeOrderOutIdList: string[] }) { return await http.post(url.virtual.u.hzlist, params); } + //获取MRP + @Action + async getMRP(params: any = {}) { + const res = await http.post(url.sortscan.save.queryMrpByUser, params); + // const code = res.code; + // const mrpdata = res.data; + // console.log('mrpdata', mrpdata); + return res; + } + /** + * mrp校验 + * @param params + */ + @MutationAction + async checkUserAndMrp(params: any) { + const res: any = await http.post(url.sortscan.save.checkUserAndMrp, params); + const mrpcode = res.code; + return { mrpcode }; + } } export default getModule(VirtualModule); diff --git a/src/pages/raw/ingoods/RUS-dnReceipt/ImportDN.vue b/src/pages/raw/ingoods/RUS-dnReceipt/ImportDN.vue index cb11728..559826f 100644 --- a/src/pages/raw/ingoods/RUS-dnReceipt/ImportDN.vue +++ b/src/pages/raw/ingoods/RUS-dnReceipt/ImportDN.vue @@ -151,7 +151,12 @@ export default class dnReceiptDom extends BasePage { pickerName.sendSpot = item.sendSpot; this.Location.push(pickerName); }); - this.wl = this.Location[0]; + this.Location.forEach((item, index) => { + if (item.label == '0011') { + this.wl = this.Location[index]; + } + }); + //this.wl = this.Location[0]; } // 页面需要清空仓库,因此需要复用该方法 async initLocation(condition): Promise { @@ -412,6 +417,31 @@ export default class dnReceiptDom extends BasePage { this.customToast(this.$t('message.Commission_tips5') as any); return null; } + let materialCodeListarr = []; + this.DNReceivingList.forEach((item) => { + if (parseFloat(item.receiptAmount) < parseFloat(item.requestAmount)) { + materialCodeListarr.push(item.materialCode); + } + }); + if (materialCodeListarr.length != 0) { + let materialCodeListString = materialCodeListarr.toString(); + //this.customToast((materialCodeListString + this.$t('message.Notcompleted')) as any); + this.uni.showModal({ + content: (materialCodeListString + this.$t('message.Notcompleted')) as any, + showCancel: false, + success: (res) => { + if (res.confirm) { + //console.log('继续执行!') + this.realysubmit(); + } else if (res.cancel) { + //console.log('继续执行!') + this.realysubmit(); + } + }, + }); + } + } + async realysubmit() { await this.model.submitOrderInEnter(this.DNReceivingList); if (this.model.SubmitCode == '1') { const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__')); diff --git a/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue index b146b1c..2c03bea 100644 --- a/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/RUS-dnReceipt/dnReceiving.vue @@ -166,7 +166,12 @@ export default class dnReceiptDom extends BasePage { pickerName.sendSpot = item.sendSpot; this.Location.push(pickerName); }); - this.wl = this.Location[0]; + this.Location.forEach((item, index) => { + if (item.label == '0011') { + this.wl = this.Location[index]; + } + }); + //this.wl = this.Location[0]; } // 页面需要清空仓库,因此需要复用该方法 async initLocation(condition): Promise { @@ -278,20 +283,21 @@ export default class dnReceiptDom extends BasePage { //选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount async materialChoice(e: any) { this.receiptAmount = ''; + this.Barcode = ''; // 待放入新增中的公共对象 this.every = { ...e.pickerName }; //清空库位列表 避免库位重复添加 console.log('this.every', this.every); - this.Location = []; + //this.Location = []; // 查询时初始化仓库 - this.Location = await this.initLocation(this.every); - if (this.Location.length == 0) { - await this.queryLoction(); - } + // this.Location = await this.initLocation(this.every); + // if (this.Location.length == 0) { + // await this.queryLoction(); + // } // 自动化流程改造测试 - this.LocationChoice({ - pickerName: this.Location.find(() => true), - }); + // this.LocationChoice({ + // pickerName: this.Location.find(() => true), + // }); this.DNReceivingList.forEach((item: any, index: any) => { if (item.poNo == this.every.poNo && item.materialCode == this.every.materialCode && item.poLine == this.every.poLine) { this.everyIndex = index; @@ -362,6 +368,10 @@ export default class dnReceiptDom extends BasePage { this.customToast(this.$t('message.Commission_tips4') as any); return; } + if (this.Container.materialCode != this.every.materialCode) { + this.customToast(this.$t('message.isdeffrent') as any); + return; + } let isTrue = true; if (this.LocationList.length != 0) { this.LocationList.forEach((item: any) => { @@ -432,13 +442,13 @@ export default class dnReceiptDom extends BasePage { // 清空 add table this.LocationList = []; // 仓库 - this.Location = []; + // this.Location = []; this.poNo = ''; this.poList = []; // 清空 当前选择的库位对象 - this.wl = { - value: null, - }; + // this.wl = { + // value: null, + // }; // 清空 物料对象 this.every = {}; // 清空 原始物料列表 @@ -455,12 +465,12 @@ export default class dnReceiptDom extends BasePage { this.Container = {}; this.Barcode = ''; this.LocationList = []; - this.Location = []; + //this.Location = []; this.poNo = ''; this.poList = []; - this.wl = { - value: null, - }; + // this.wl = { + // value: null, + // }; this.every = {}; this.materialList = []; this.receiptAmount = null; @@ -476,11 +486,62 @@ export default class dnReceiptDom extends BasePage { }, time); }; } + // checknumber(arr: any = {}) { + // var map = {}, + // dest = []; + // for (var i = 0; i < arr.length; i++) { + // var ai = arr[i]; + // if (!map[ai.id]) { + // dest.push({ + // id: ai.id, + // name: ai.name, + // value: ai.value, + // }); + // map[ai.id] = ai; + // } else { + // for (var j = 0; j < dest.length; j++) { + // var dj = dest[j]; + // if (dj.id == ai.id) { + // dj.value = (parseFloat(dj.value) + parseFloat(ai.value)).toString(); + // break; + // } + // } + // } + // } + // console.log(dest); + // } async onSubmit() { if (this.LocationList.length === 0) { this.customToast(this.$t('message.Commission_tips5') as any); return null; } + //this.checknumber(this.LocationList); + let materialCodeListarr = []; + this.DNReceivingList.forEach((item) => { + if (parseFloat(item.receiptAmount) < parseFloat(item.requestAmount)) { + materialCodeListarr.push(item.materialCode); + } + }); + if (materialCodeListarr.length != 0) { + let materialCodeListString = materialCodeListarr.toString(); + //this.customToast((materialCodeListString + this.$t('message.Notcompleted')) as any); + this.uni.showModal({ + content: (materialCodeListString + this.$t('message.Notcompleted')) as any, + showCancel: false, + success: (res) => { + if (res.confirm) { + //console.log('继续执行!') + this.realysubmit(); + } else if (res.cancel) { + //console.log('继续执行!') + this.realysubmit(); + } + }, + }); + } + } + async realysubmit() { + //console.log('继续执行!'); await this.model.submitOrderInEnter(this.DNReceivingList); if (this.model.SubmitCode == '1') { const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__')); diff --git a/src/pages/raw/ingoods/RUS-dnReceipt/model.location.ts b/src/pages/raw/ingoods/RUS-dnReceipt/model.location.ts index 3567051..cb7c094 100644 --- a/src/pages/raw/ingoods/RUS-dnReceipt/model.location.ts +++ b/src/pages/raw/ingoods/RUS-dnReceipt/model.location.ts @@ -1,10 +1,10 @@ /* * @Author: zhou lei * @Date: 2021-12-24 12:02:31 - * @LastEditTime: 2021-12-24 14:33:54 + * @LastEditTime: 2023-01-15 09:33:43 * @LastEditors: zhou lei * @Description: - * @FilePath: /wms_haiwai_app/src/pages/raw/ingoods/dnReceipt/model.location.ts + * @FilePath: \hgwms-factory-app\src\pages\raw\ingoods\RUS-dnReceipt\model.location.ts * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 */ /** @@ -104,4 +104,5 @@ export default interface LocationDetail { productMix?: null; batchMix?: null; ignoreId?: null; + label?: string; } diff --git a/src/pages/raw/ingoods/dnReceipt/ImportPOReceive.vue b/src/pages/raw/ingoods/dnReceipt/ImportPOReceive.vue index 5c2efa2..5c25cec 100644 --- a/src/pages/raw/ingoods/dnReceipt/ImportPOReceive.vue +++ b/src/pages/raw/ingoods/dnReceipt/ImportPOReceive.vue @@ -88,7 +88,12 @@ export default class dnReceiptDom extends BasePage { pickerName.sendSpot = item.sendSpot; this.Location.push(pickerName); }); - this.wl = this.Location[0]; + this.Location.forEach((item, index) => { + if (item.label == '0011') { + this.wl = this.Location[index]; + } + }); + //this.wl = this.Location[0]; } LocationChoice(e: any) { this.wl = e.pickerName; diff --git a/src/utils/url.ts b/src/utils/url.ts index 6e44967..6085f74 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -207,6 +207,8 @@ export const url = { queryWlByMat: '/wmspda/sortscan/queryWlByMat', queryWlByMatBL: '/wmspda/sortscan/queryWlByMatBL', queryVirtualOrderAmountBl: '/wmspda/bl/queryVirtualOrderAmountBl', + queryMrpByUser: '/wmspda/material/queryMrpByUser', + checkUserAndMrp: '/wmspda/material/checkUserAndMrp', }, unlock: { list: '/wmspda/sortscan/unlock/list',