From 6330086a779347b482ae1b33d22b6bac2a4f9cb9 Mon Sep 17 00:00:00 2001 From: hou <1601990943@qq.com> Date: Fri, 18 Feb 2022 11:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=87=E8=B4=A6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../outbound/stoOutbound/DN-delivergoods.vue | 122 +++++------------- .../product/outbound/stoOutbound/model.ts | 29 +++-- .../raw/warehouse/rowInventory/index.vue | 3 +- src/utils/url.ts | 1 + 4 files changed, 57 insertions(+), 98 deletions(-) diff --git a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue index 9afa09f..678122d 100644 --- a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue +++ b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue @@ -145,7 +145,7 @@ export default class stoOutboundDom extends BasePage { // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 async onReady() { this.$form.setRules(this.rules); - model.queryReturningTypeList(); + await model.queryReturningTypeList(); this.form.orderNo = JSON.parse(sessionStorage.getItem('SweepCode')); sessionStorage.removeItem('SweepCode'); if (this.form.orderNo == null) { @@ -231,94 +231,38 @@ export default class stoOutboundDom extends BasePage { } }); } - /** - * 条码回车 - */ - //扫码也要改,扫码 - // onSubmit() { - // this.$form.validate(async (valid: boolean) => { - // // if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) { - // // uni.showToast({ - // // icon: "none", - // // title: this.$t("message.product_Tip5") as string, - // // }); - // // return; - // // } - // if (parseInt(this.form.orderAmount) <= this.form.scanAmount) { - // uni.showToast({ - // icon: 'none', - // title: this.$t('message.product_Tip6') as string, - // }); - // return; - // } - // // let list = [ - // // { - // // order3: this.form.orderNo, - // // productCode: this.form.productCode, - // // productDescZh: this.form.productDescZh, - // // barCode: this.form.barCode, - // // dockCode: this.form.dockCode, - // // dockName: this.form.dockName, - // // // orderType: 3, - // // orderType: 4, - // // type: 0, - // // keepBy: session.loginName as string, - // // loginName: session.loginName as string, - // // }, - // // ]; - // if (valid) { - // let list: any = { - // productCode: this.form.productCode, - // barcode: this.form.barCode, - // loginName: session.loginName, - // factoryCode: session.factoryCode, - // }; - // const res = await this.model.getMaterialByCode(list); - // console.log('fanhui', res); - // // if (res.barcode) { - // // // this.materialList.push(res); - // // this.form.scanAmount = res.scanAmount; - // // } - // //guoshuang 注掉 - // if (this.materialList.length == 0) { - // await this.materialList.push(res); - // this.form.scanAmount += 1; - // this.$table.onCheckAllTap(); - // } else { - // let flag = 0; - // for (let i = 0; i < this.materialList.length; i++) { - // console.log('11111', this.materialList[i]); - // if (this.form.barCode == this.materialList[i].barcode) { - // flag = 1; - // break; - // } - // } - // if (flag == 0) { - // await this.$table.onCheckAllTap(); - // await this.materialList.push(res); - // this.form.scanAmount += 1; - // this.$table.onCheckAllTap(); - // } else { - // uni.showToast({ - // icon: 'none', - // title: this.$t('message.product_Tip7') as string, - // }); - // } - // } - // } - // }); - // const item = { - // ...this.form, - // barCode: String(''), - // }; - // this.firstFocus = false; - // setTimeout(() => { - // this.form = item; - // this.firstFocus = true; - // }, 0); - // } - Posting() { - + //过账 + async Posting() { + if(!this.form.orderNo){ + this.customToast(this.$t('message.Commission_tips1') as string); + return + } + let params = { + nxOutCode:this.form.orderNo, + rowItem:this.form.row, + materialCode:this.form.rowItem, + loginName:session.loginName, + factoryCode:session.factoryCode, + } + await this.model.Posting(params) + if(this.model.PostingCode == '1'){ + uni.showToast({ title: this.$t('message.Warehouse_Tip9') as any }); + this.empty() + } + } + empty(){ + this.form.dockCode = null + this.form.dockName = null + this.form.orderNo = null + this.form.qty = 0 + this.form.orderAmount = '' + this.form.productCode = '' + this.form.productDescZh = '' + this.form.scanAmount = 0 + this.form.rowItem = '' + this.form.row = '' + this.form.barCode = '' + this.model.empty() } onOk() { this.$form.validate(async (valid: boolean) => { diff --git a/src/pages/product/outbound/stoOutbound/model.ts b/src/pages/product/outbound/stoOutbound/model.ts index e0a113f..4610e61 100644 --- a/src/pages/product/outbound/stoOutbound/model.ts +++ b/src/pages/product/outbound/stoOutbound/model.ts @@ -24,6 +24,7 @@ export class ReturningModule extends VuexModule { * 月台列表 */ returningTypeList: any[] = []; + PostingCode: any = ''; /** * 物料列表 */ @@ -35,7 +36,7 @@ export class ReturningModule extends VuexModule { * 订单号查询结果 */ orderInInfo: OrderInInfo = new OrderInInfo(); - resCode:any = '' + resCode: any = ''; //记账按钮的code码 code = ''; DNcode: any = ''; @@ -102,7 +103,7 @@ export class ReturningModule extends VuexModule { }); const materielList = result.data.map((item: any) => ({ value: item.materialCode, - rowItem:item.rowItem, + rowItem: item.rowItem, label: item.rowItem + '(' + item.materialCode + ')', ...item, })); @@ -115,10 +116,10 @@ export class ReturningModule extends VuexModule { } //退扫 @MutationAction - async delCode(params:any = {}){ - const res:any = await http.post(url.outbound.stoOutbound.del,params) - const resCode = res.code - return { resCode } + async delCode(params: any = {}) { + const res: any = await http.post(url.outbound.stoOutbound.del, params); + const resCode = res.code; + return { resCode }; } /** * 扫条码 @@ -170,9 +171,9 @@ export class ReturningModule extends VuexModule { */ @MutationAction async confirmMove(list: any) { - const res:any = await http.post(url.outbound.stoOutbound.Bookkeeping, list); + const res: any = await http.post(url.outbound.stoOutbound.Bookkeeping, list); console.log('res数据', res); - const code = res.code + const code = res.code; // if (code == '1') { // uni.showToast({ icon: 'success', title: msg }); // } else { @@ -213,6 +214,18 @@ export class ReturningModule extends VuexModule { console.log('退扫>>>>>>>>>>>>>>>>>>>>>>>>.', res); return {}; } + //过账 + @MutationAction + async Posting(params: any) { + const res: any = await http.post(url.outbound.stoOutbound.Posting, params); + const PostingCode = res.code; + return { PostingCode }; + } + @MutationAction + async empty() { + const orderInInfo = {}; + return { orderInInfo }; + } } export default getModule(ReturningModule); diff --git a/src/pages/raw/warehouse/rowInventory/index.vue b/src/pages/raw/warehouse/rowInventory/index.vue index 9c37856..5e53404 100644 --- a/src/pages/raw/warehouse/rowInventory/index.vue +++ b/src/pages/raw/warehouse/rowInventory/index.vue @@ -18,7 +18,7 @@ - + @@ -136,6 +136,7 @@ export default class rawMaterialInventory extends BasePage { async checkRawOrderComplete() { await model.checkRawOrderComplete(this.pddNo); if (this.model.code == '1') { + uni.showToast({ title: this.$t('message.Warehouse_Tip9') as any }); this.empty(); this.pddNo = ''; } diff --git a/src/utils/url.ts b/src/utils/url.ts index 834614e..35abeaa 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -136,6 +136,7 @@ export const url = { getDetailByorderNo: '/wmspda/fg/queryListInfoByDnNo', scanBarcodeDN: '/wmspda/fg/scanBarcodeDN/del', queryAmount: '/wmspda/fg/queryAmountByDn', + Posting:'/wmspda/fg/dnPosting', }, }, inbound: {