From 48fa2c1f59eab6a984b4e9a4706a88591a8b714d Mon Sep 17 00:00:00 2001 From: zhoulei Date: Fri, 19 Nov 2021 18:04:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A7=94=E5=A4=96=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8F=8A=E5=BA=93=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/raw/commission/goOut/index.vue | 64 +++++++++++++++++++----- src/pages/raw/commission/goOut/model.ts | 63 +++++++++-------------- src/utils/url.ts | 14 ++++++ 3 files changed, 90 insertions(+), 51 deletions(-) diff --git a/src/pages/raw/commission/goOut/index.vue b/src/pages/raw/commission/goOut/index.vue index 47de24e..cd8e043 100644 --- a/src/pages/raw/commission/goOut/index.vue +++ b/src/pages/raw/commission/goOut/index.vue @@ -8,16 +8,18 @@ - + + - + + + + + + + - + + + - + + + @@ -156,11 +168,24 @@ export default class stoOutboundDom extends BasePage { * 表单数据 */ form = { + // poNo + poNo:null, + // 物料号 + materialCode:null, + // 物料描述 + materialDesc:null, + poLine:null, + unit:null, + // 累计出库数量 + outAmount:null, + // 需求数量 + orderAmount: '', + locationCode:null,//库位 dockCode: null, // 月台类型code dockName: null, // 月台类型name orderNo: null, qty: 0, - orderAmount: '', + productCode: '', // 物料类型name productDescZh: '', scanAmount: '', @@ -179,6 +204,7 @@ export default class stoOutboundDom extends BasePage { returningTypeSelect = false; // 物料类型选择 materialCodeSelect = false; + locationCodeSelect = false; /** * 表单验证规则 */ @@ -189,7 +215,7 @@ export default class stoOutboundDom extends BasePage { // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 async onReady() { this.$form.setRules(this.rules); - model.queryReturningTypeList(); + model.queryByFactoryCodeAndWorkAreaCode(); } onCheck(e: any) { console.log('e.data', e.data); @@ -219,6 +245,18 @@ export default class stoOutboundDom extends BasePage { }); console.log('this.form', this.form); } + locationCodeConfirm(v: any) { + console.log('v[0].value', v[0]); + // this.form.productCode = v[0].value; + this.model.locationCodeList.forEach((item: any) => { + console.log('item',item) + if (v[0].value == item.value) { + this.form.locationCode = item.value; + } + }); + console.log('this.form', this.form); + } + /** * 清空 */ diff --git a/src/pages/raw/commission/goOut/model.ts b/src/pages/raw/commission/goOut/model.ts index f8d0098..de35a11 100644 --- a/src/pages/raw/commission/goOut/model.ts +++ b/src/pages/raw/commission/goOut/model.ts @@ -28,7 +28,7 @@ export class ReturningModule extends VuexModule { * 物料列表 */ materielList: any[] = []; - + locationCodeList: any[] =[]; //条码扫描的返回的结果 oneMaterielDetail: any = {}; /** @@ -37,51 +37,38 @@ export class ReturningModule extends VuexModule { orderInInfo: OrderInInfo = new OrderInInfo(); //记账按钮的code码 code = ''; - /** - * 查询月台列表 - */ - @MutationAction - async queryReturningTypeList() { - const list: [] = await http.post(url.outbound.stoOutbound.yuetaiType, { - factoryCode: session.factoryCode, - whCode: session.warehouseCode, - loginName: session.loginName, - }); - const returningTypeList = list.map((item: any) => ({ - label: item.dockName, - value: item.dockCode, - })); - return { returningTypeList }; - } + /** - * 查询订单号 + * 委外出库单号查询 * @param orderNo */ - @MutationAction - async queryOrderInInfo(stoNo: string) { - const result = await http.post(url.outbound.stoOutbound.info, { - stoNo, - deleteFlag: 2, - finalState: 3, + @Action + async queryOrder(form:any) { + const result = await http.post(url.material.commission.goOut.queryOrder, { + ...form, loginName: session.loginName, + factoryCode:session.factoryCode }); - let stoAmount = 0; - result.data.records.forEach((item: any) => { - stoAmount += item.orderAmount; - }); - const materielList = result.data.records.map((item: any) => ({ - label: item.materialCode, - value: item.stoItem, - ...item, - })); - console.log('materielList', materielList); - if (result.data.records[0]) { - result.data.records[0].stoAmount = stoAmount; - } const orderInInfo = result.data.records[0] || {}; - return { orderInInfo, materielList }; + return { orderInInfo }; } + /** + * 库位 + */ + @MutationAction + async queryByFactoryCodeAndWorkAreaCode() { + const list: [] = await http.post(url.material.commission.goOut.queryByFactoryCodeAndWorkAreaCode, { + factoryCode: session.factoryCode, + whCode: session.warehouseCode, + loginName: session.loginName, + }); + const locationCodeList = list.map((item: any) => ({ + label: item.locationCode, + value: item.locationCode, + })); + return { locationCodeList }; + } /** * 扫条码 diff --git a/src/utils/url.ts b/src/utils/url.ts index f3c5bbb..052b27f 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -84,6 +84,20 @@ export const url = { // 5.盘点完成 orderComplete: "/product/finished/checkRaw/orderComplete", }, + // 委外 commission + commission: { + // 出库 goOut + goOut:{ + // 出库单号查询 + queryOrder: "/material/outsourcing/queryOrder", + // 库位下拉列表 + queryByFactoryCodeAndWorkAreaCode: "/wmspda/fg/queryByFactoryCodeAndWorkAreaCode", + // 出库提交 + materialComplete: "/material/outsourcing/materialComplete", + // 出库明细查询 + outInfo: "/material/outsourcing/outInfo", + }, + }, }, SFG: { DumpListFH: { From 1779a0faf8767b32eed2c32c4def6d8126f2e254 Mon Sep 17 00:00:00 2001 From: zhoulei Date: Mon, 22 Nov 2021 11:30:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/cn.ts | 2 + src/pages/raw/commission/entrant/index.vue | 41 +++--- src/pages/raw/commission/goOut/config.ts | 19 ++- src/pages/raw/commission/goOut/index.vue | 147 ++++++++++++--------- src/pages/raw/commission/goOut/model.ts | 13 ++ 5 files changed, 131 insertions(+), 91 deletions(-) diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index 827a218..a4692fa 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -211,11 +211,13 @@ export default { CommissionedCumulativeData:'累计数据', CommissionedLocation:'库位', CommissionedThisNumber:'本次数量', + CommissionedNumber:'入库数量', CommissionedEntrantDetails:'入库明细', // 委外-出库 CommissionGoOut:'委外出库', CommissionedGoOutDetails:'出库明细', + CommissionedGoOutNumber:'出库数量', //移库 Warehouse_QueryCriteria: "查询条件", Warehouse_TransferOrderNo: "移库单号", diff --git a/src/pages/raw/commission/entrant/index.vue b/src/pages/raw/commission/entrant/index.vue index 1131968..b7b8d4d 100644 --- a/src/pages/raw/commission/entrant/index.vue +++ b/src/pages/raw/commission/entrant/index.vue @@ -85,32 +85,21 @@ - - {{ $t("message.po_MaterielNo") }} - {{ $t("message.po_MaterielDes") }} - {{ $t("message.operation") }} - - - {{ item.productCode }} - {{ item.productDescZh }} - -
- {{ $t("message.product_Delete") }} -
-
-
-
- + + {{ $t("message.po_MaterielNo") }} + {{ $t("message.po_MaterielDes") }} + {{ $t("message.operation") }} + + + {{ item.productCode }} + {{ item.productDescZh }} + +
+ {{ $t("message.product_Delete") }} +
+
+
+
diff --git a/src/pages/raw/commission/goOut/config.ts b/src/pages/raw/commission/goOut/config.ts index 1d45ca0..bf291c6 100644 --- a/src/pages/raw/commission/goOut/config.ts +++ b/src/pages/raw/commission/goOut/config.ts @@ -1,20 +1,29 @@ +/* + * @Author: zhou lei + * @Date: 2021-11-11 11:09:57 + * @LastEditTime: 2021-11-22 10:06:58 + * @LastEditors: zhou lei + * @Description: + * @FilePath: /wms_haiwai_app/src/pages/raw/commission/goOut/config.ts + * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 + */ /** * 看单明细表格列 */ import vm from '@/main'; export const headers = [ { - label: vm.$t('message.product_barCode'), - key: 'barcode', + label: vm.$t('message.CommissionedLocation'), + key: 'locationCode', width: 300, }, { - label: vm.$t('message.product_FGCode'), - key: 'materialCode', + label: vm.$t('message.CommissionedGoOutNumber'), + key: 'scanAmount', width: 300, }, { - label: vm.$t('message.product_FGDes'), + label: vm.$t('message.operation'), key: 'materialDesc', width: 300, }, diff --git a/src/pages/raw/commission/goOut/index.vue b/src/pages/raw/commission/goOut/index.vue index cd8e043..dd0d8a8 100644 --- a/src/pages/raw/commission/goOut/index.vue +++ b/src/pages/raw/commission/goOut/index.vue @@ -13,7 +13,7 @@ @@ -91,22 +91,27 @@ - {{$t('message.product_add')}} + {{$t('message.product_add')}} - + + + {{ $t("message.CommissionedLocation") }} + {{ $t("message.CommissionedGoOutNumber") }} + {{ $t("message.operation") }} + + + {{ item.locationCode }} + {{ item.scanAmount }} + +
+ {{ $t("message.product_Delete") }} +
+
+
+
@@ -120,7 +125,7 @@ - {{ $t('message.product_Upload') }} + {{ $t('message.product_Upload') }} {{ $t('message.po_Return') }} @@ -151,6 +156,7 @@ export default class stoOutboundDom extends BasePage { */ @Ref('table') readonly $table: any; + LocationList: any = []; /** * 页面Module */ @@ -232,6 +238,14 @@ export default class stoOutboundDom extends BasePage { uni.navigateBack({ delta: 1 }); this.$table.onEmpty(); } + +// 单号查询 + async queryOrder(poNo:string){ + const {orderInInfo} = await model.queryOrder(poNo) + Object.assign(this.form,{ + ...orderInInfo + }) + } materialConfirm(v: any) { console.log('v[0].value', v[0]); // this.form.productCode = v[0].value; @@ -271,63 +285,76 @@ export default class stoOutboundDom extends BasePage { } }); } + + confirm() { + // if (this.wlCode == "" || this.number == "") { + // uni.showToast({ + // icon: "none", + // title: "请输入正确的库位和数量", + // }); + // return; + // } + console.log('123') + this.LocationList.push(this.form) + } + + deleteItem(index: any) { + this.LocationList.splice(index, 1); + } + + /** - * 条码回车 + * 提交 */ 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) <= parseInt(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, - type: 0, - keepBy: session.loginName as string, - loginName: session.loginName as string, - }, - ]; + // 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) <= parseInt(this.form.scanAmount)) { + // uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string }); + // return; + // } + const list = this.LocationList.map( (item:any) =>({ + wlCode:item.locationCode, + nowAmount:item.scanAmount, + })) + if (valid) { - const res = await this.model.tluSubmit(list); + const res = await this.model.materialComplete({ + poNo:this.form.poNo, + materialCode:this.form.materialCode, + list + }); console.log('fanhui ', res); // if (res.barcode) { // // this.materialList.push(res); // this.form.scanAmount = res.scanAmount; // } - 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 }); - } - } + // 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 = { diff --git a/src/pages/raw/commission/goOut/model.ts b/src/pages/raw/commission/goOut/model.ts index de35a11..ab135bd 100644 --- a/src/pages/raw/commission/goOut/model.ts +++ b/src/pages/raw/commission/goOut/model.ts @@ -70,6 +70,19 @@ export class ReturningModule extends VuexModule { return { locationCodeList }; } + /** + * 提交 + */ + @Action + async materialComplete(form:any) { + const res = await http.post(url.material.commission.goOut.materialComplete, { + factoryCode: session.factoryCode, + loginName: session.loginName, + ...form + }); + console.log(res,'>>>>>res') + } + /** * 扫条码 */ From 2e9e10ce0eea1db8b568160456585c13ee6db8a9 Mon Sep 17 00:00:00 2001 From: zhoulei Date: Mon, 22 Nov 2021 17:53:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=94=B6=E3=80=81=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/cn.ts | 1 + src/i18n/lang/en.ts | 5 +- src/pages/raw/commission/entrant/config.ts | 29 ++- src/pages/raw/commission/entrant/detail.vue | 38 +-- src/pages/raw/commission/entrant/index.vue | 246 +++++++++++--------- src/pages/raw/commission/entrant/model.ts | 70 +++++- src/pages/raw/commission/goOut/config.ts | 28 ++- src/pages/raw/commission/goOut/detail.vue | 38 +-- src/pages/raw/commission/goOut/index.vue | 22 +- src/pages/raw/commission/goOut/model.ts | 19 ++ src/utils/url.ts | 11 + 11 files changed, 311 insertions(+), 196 deletions(-) diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index a4692fa..ed97940 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -213,6 +213,7 @@ export default { CommissionedThisNumber:'本次数量', CommissionedNumber:'入库数量', CommissionedEntrantDetails:'入库明细', + CommissionedReceiptQuantity:'收货数量', // 委外-出库 CommissionGoOut:'委外出库', diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index fe56c9e..ce7f77a 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -215,11 +215,14 @@ export default { CommissionedCumulativeData:'累计数据', CommissionedLocation:'库位', CommissionedThisNumber:'本次数量', + CommissionedNumber:'入库数量', CommissionedEntrantDetails:'入库明细', - + CommissionedReceiptQuantity:'收货数量', + // 委外-出库 CommissionGoOut:'委外出库', CommissionedGoOutDetails:'出库明细', + CommissionedGoOutNumber:'出库数量', //移库 Warehouse_QueryCriteria: "Query criteria", diff --git a/src/pages/raw/commission/entrant/config.ts b/src/pages/raw/commission/entrant/config.ts index 1d45ca0..0fe0d5b 100644 --- a/src/pages/raw/commission/entrant/config.ts +++ b/src/pages/raw/commission/entrant/config.ts @@ -1,21 +1,40 @@ +/* + * @Author: zhou lei + * @Date: 2021-11-10 17:14:44 + * @LastEditTime: 2021-11-22 17:43:40 + * @LastEditors: zhou lei + * @Description: + * @FilePath: /wms_haiwai_app/src/pages/raw/commission/entrant/config.ts + * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 + */ /** * 看单明细表格列 */ import vm from '@/main'; export const headers = [ { - label: vm.$t('message.product_barCode'), - key: 'barcode', - width: 300, + label: vm.$t('message.CommissionedSingleNumber'), + key: 'poNo', + width: 200, }, { - label: vm.$t('message.product_FGCode'), + label: vm.$t('message.po_MaterielNo'), key: 'materialCode', width: 300, }, { - label: vm.$t('message.product_FGDes'), + label: vm.$t('message.CommissionedMaterielDesc'), key: 'materialDesc', width: 300, }, + { + label: vm.$t('message.CommissionedReceiptQuantity'), + key: 'amount', + width: 200, + }, + { + label: vm.$t('message.CommissionedLocation'), + key: 'wlCode', + width: 200, + } ]; diff --git a/src/pages/raw/commission/entrant/detail.vue b/src/pages/raw/commission/entrant/detail.vue index 246b6e3..95103b0 100644 --- a/src/pages/raw/commission/entrant/detail.vue +++ b/src/pages/raw/commission/entrant/detail.vue @@ -26,41 +26,8 @@ >{{ $t('message.po_Total') }} {{ model.materielList.length }} {{ $t('message.po_Records') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -72,7 +39,7 @@ import model from './model'; import { headers } from './config'; @Component -export default class RawReceiptDetail extends BasePage { +export default class RawCommissionEntrantDetail extends BasePage { /** * 页面Module */ @@ -87,6 +54,9 @@ export default class RawReceiptDetail extends BasePage { * 表头 */ headers = headers; + onLoad(params:any){ + this.model.info(params.poNo) + } /** * 逐条修改 diff --git a/src/pages/raw/commission/entrant/index.vue b/src/pages/raw/commission/entrant/index.vue index b7b8d4d..c3f3b1a 100644 --- a/src/pages/raw/commission/entrant/index.vue +++ b/src/pages/raw/commission/entrant/index.vue @@ -8,68 +8,63 @@ - + + + - - - + + + - + + - + + - + + + @@ -86,13 +81,13 @@ - {{ $t("message.po_MaterielNo") }} - {{ $t("message.po_MaterielDes") }} + {{ $t("message.CommissionedLocation") }} + {{ $t("message.CommissionedGoOutNumber") }} {{ $t("message.operation") }} - {{ item.productCode }} - {{ item.productDescZh }} + {{ item.locationCode }} + {{ item.scanAmount }}
{{ $t("message.product_Delete") }} @@ -106,17 +101,17 @@ - + {{ - $t('message.CommissionedEntrantDetails') + $t('message.CommissionedGoOutDetails') }} - {{ $t('message.product_Upload') }} + {{ $t('message.product_Upload') }} - {{ $t('message.po_Return') }} + {{ $t('message.po_Return') }} @@ -143,7 +138,8 @@ export default class stoOutboundDom extends BasePage { * 表格引用 */ @Ref('table') readonly $table: any; -LocationList: any = []; + + LocationList: any = []; /** * 页面Module */ @@ -161,13 +157,26 @@ LocationList: any = []; * 表单数据 */ form = { + // poNo + poNo:null, + // 物料号 + materialCode:null, + // 物料描述 + materialDesc:null, + poLine:null, + unit:null, + // 累计出库数量 + receiptAmount:null, + // 需求数量 + poAmount: '', + locationCode:null,//库位 dockCode: null, // 月台类型code dockName: null, // 月台类型name orderNo: null, qty: 0, - orderAmount: '', - productCode: 'test', // 物料类型name - productDescZh: 'test', + + productCode: '', // 物料类型name + productDescZh: '', scanAmount: '', barCode: '', }; @@ -184,30 +193,30 @@ LocationList: any = []; returningTypeSelect = false; // 物料类型选择 materialCodeSelect = false; + locationCodeSelect = false; /** * 表单验证规则 */ rules: VFormRules = { orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }], }; - confirm() { - // if (this.wlCode == "" || this.number == "") { - // uni.showToast({ - // icon: "none", - // title: "请输入正确的库位和数量", - // }); - // return; - // } - this.LocationList.push(this.form) - } - deleteItem(index: any) { - this.LocationList.splice(index, 1); - } // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 async onReady() { this.$form.setRules(this.rules); - model.queryReturningTypeList(); + model.queryByFactoryCodeAndWorkAreaCode(); + } + gooutInfo(){ + if(this.form.poNo){ + this.toPage(`${this.page.raw.commission.entrant.detail}?poNo=${this.form.poNo}`) + }else{ + let tip = this.$t('message.borrow_Tip') + uni.showToast({ + icon: "none", + title: tip as string, + }); + } + } onCheck(e: any) { console.log('e.data', e.data); @@ -218,11 +227,15 @@ LocationList: any = []; }); } back() { - this.form.barCode = ''; - this.model.orderInInfo.stoAmount = 0; - this.selectMaterielList = []; uni.navigateBack({ delta: 1 }); - this.$table.onEmpty(); + } + +// 单号查询 + async queryOrder(poNo:string){ + const {orderInInfo} = await model.queryOrder(poNo) + Object.assign(this.form,{ + orderInInfo + }) } materialConfirm(v: any) { console.log('v[0].value', v[0]); @@ -231,12 +244,24 @@ LocationList: any = []; if (v[0].value == item.stoItem) { this.form.productCode = item.materialCode; this.form.productDescZh = item.materialDesc; - this.form.orderAmount = item.orderAmount; + this.form.poAmount = item.poAmount; this.form.scanAmount = item.scanAmount; } }); console.log('this.form', this.form); } + locationCodeConfirm(v: any) { + console.log('v[0].value', v[0]); + // this.form.productCode = v[0].value; + this.model.locationCodeList.forEach((item: any) => { + console.log('item',item) + if (v[0].value == item.value) { + this.form.locationCode = item.value; + } + }); + console.log('this.form', this.form); + } + /** * 清空 */ @@ -246,68 +271,81 @@ LocationList: any = []; this.model.materielList.forEach((item: any) => { if (this.form.productCode == item.label) { this.form.productDescZh = item.materialDesc; - this.form.orderAmount = item.orderAmount; + this.form.poAmount = item.poAmount; this.form.scanAmount = item.scanAmount; } }); } + + confirm() { + // if (this.wlCode == "" || this.number == "") { + // uni.showToast({ + // icon: "none", + // title: "请输入正确的库位和数量", + // }); + // return; + // } + console.log('123') + this.LocationList.push(this.form) + } + + deleteItem(index: any) { + this.LocationList.splice(index, 1); + } + + /** - * 条码回车 + * 提交 */ 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) <= parseInt(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, - type: 0, - keepBy: session.loginName as string, - loginName: session.loginName as string, - }, - ]; + // 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.poAmount) <= parseInt(this.form.scanAmount)) { + // uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string }); + // return; + // } + const list = this.LocationList.map( (item:any) =>({ + wlCode:item.locationCode, + nowAmount:item.scanAmount, + })) + if (valid) { - const res = await this.model.tluSubmit(list); + const res = await this.model.materialComplete({ + poNo:this.form.poNo, + materialCode:this.form.materialCode, + list + }); console.log('fanhui ', res); // if (res.barcode) { // // this.materialList.push(res); // this.form.scanAmount = res.scanAmount; // } - 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 }); - } - } + // 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 = { @@ -361,7 +399,7 @@ LocationList: any = []; this.form.productCode = ''; // this.form.orderNo = null; this.form.scanAmount = ''; - this.form.orderAmount = ''; + this.form.poAmount = ''; this.form.productDescZh = ''; this.selectMaterielList = []; this.$table.onEmpty(); diff --git a/src/pages/raw/commission/entrant/model.ts b/src/pages/raw/commission/entrant/model.ts index f8d0098..ddb1f6e 100644 --- a/src/pages/raw/commission/entrant/model.ts +++ b/src/pages/raw/commission/entrant/model.ts @@ -24,10 +24,12 @@ export class ReturningModule extends VuexModule { * 月台列表 */ returningTypeList: any[] = []; - /** + + /** * 物料列表 */ - materielList: any[] = []; + materielList: any[] = []; + locationCodeList: any[] =[]; //条码扫描的返回的结果 oneMaterielDetail: any = {}; @@ -37,6 +39,69 @@ export class ReturningModule extends VuexModule { orderInInfo: OrderInInfo = new OrderInInfo(); //记账按钮的code码 code = ''; + /** + * 委外出库单号查询 + * @param orderNo + */ + @Action + async queryOrder(form:any) { + const result = await http.post(url.material.commission.entrant.queryOrder, { + ...form, + loginName: session.loginName, + factoryCode:session.factoryCode + }); + const orderInInfo = result.data.records[0] || {}; + return { orderInInfo }; + } + + /** + * 库位 + */ + @MutationAction + async queryByFactoryCodeAndWorkAreaCode() { + const list: [] = await http.post(url.material.commission.goOut.queryByFactoryCodeAndWorkAreaCode, { + factoryCode: session.factoryCode, + whCode: session.warehouseCode, + loginName: session.loginName, + }); + const locationCodeList = list.map((item: any) => ({ + label: item.locationCode, + value: item.locationCode, + })); + return { locationCodeList }; + } + + /** + * 提交 + */ + @Action + async materialComplete(form:any) { + const res = await http.post(url.material.commission.goOut.materialComplete, { + factoryCode: session.factoryCode, + loginName: session.loginName, + ...form + }); + console.log(res,'>>>>>res') + } + /** + * 获取物料 + * + * @returns + * @memberof ReturningModule + */ + @MutationAction + async info(poNo:string) { + const list: [] = await http.post(url.material.commission.entrant.info, { + factoryCode: session.factoryCode, + poNo: poNo, + loginName: session.loginName, + }); + const locationCodeList = list.map((item: any) => ({ + label: item.locationCode, + value: item.locationCode, + })); + return { locationCodeList }; + } /** * 查询月台列表 */ @@ -54,6 +119,7 @@ export class ReturningModule extends VuexModule { return { returningTypeList }; } + /** * 查询订单号 * @param orderNo diff --git a/src/pages/raw/commission/goOut/config.ts b/src/pages/raw/commission/goOut/config.ts index bf291c6..7e6a1b2 100644 --- a/src/pages/raw/commission/goOut/config.ts +++ b/src/pages/raw/commission/goOut/config.ts @@ -1,7 +1,7 @@ /* * @Author: zhou lei * @Date: 2021-11-11 11:09:57 - * @LastEditTime: 2021-11-22 10:06:58 + * @LastEditTime: 2021-11-22 15:16:21 * @LastEditors: zhou lei * @Description: * @FilePath: /wms_haiwai_app/src/pages/raw/commission/goOut/config.ts @@ -13,18 +13,28 @@ import vm from '@/main'; export const headers = [ { - label: vm.$t('message.CommissionedLocation'), - key: 'locationCode', + label: vm.$t('message.CommissionedSingleNumber'), + key: 'poNo', + width: 200, + }, + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 300, + }, + { + label: vm.$t('message.CommissionedMaterielDesc'), + key: 'materialDesc', width: 300, }, { label: vm.$t('message.CommissionedGoOutNumber'), - key: 'scanAmount', - width: 300, + key: 'outAmount', + width: 200, }, { - label: vm.$t('message.operation'), - key: 'materialDesc', - width: 300, - }, + label: vm.$t('message.CommissionedLocation'), + key: 'wlCode', + width: 200, + } ]; diff --git a/src/pages/raw/commission/goOut/detail.vue b/src/pages/raw/commission/goOut/detail.vue index f1b6367..abdc38b 100644 --- a/src/pages/raw/commission/goOut/detail.vue +++ b/src/pages/raw/commission/goOut/detail.vue @@ -26,41 +26,8 @@ >{{ $t('message.po_Total') }} {{ model.materielList.length }} {{ $t('message.po_Records') }} - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
@@ -72,7 +39,7 @@ import model from './model'; import { headers } from './config'; @Component -export default class RawReceiptDetail extends BasePage { +export default class RawCommissionGoOutDetail extends BasePage { /** * 页面Module */ @@ -87,6 +54,9 @@ export default class RawReceiptDetail extends BasePage { * 表头 */ headers = headers; + onLoad(params:any){ + this.model.outInfo(params.poNo) + } /** * 逐条修改 diff --git a/src/pages/raw/commission/goOut/index.vue b/src/pages/raw/commission/goOut/index.vue index dd0d8a8..c77f742 100644 --- a/src/pages/raw/commission/goOut/index.vue +++ b/src/pages/raw/commission/goOut/index.vue @@ -118,7 +118,7 @@ - + {{ $t('message.CommissionedGoOutDetails') }} @@ -128,7 +128,7 @@ {{ $t('message.product_Upload') }} - {{ $t('message.po_Return') }} + {{ $t('message.po_Return') }} @@ -223,6 +223,18 @@ export default class stoOutboundDom extends BasePage { this.$form.setRules(this.rules); model.queryByFactoryCodeAndWorkAreaCode(); } + gooutInfo(){ + if(this.form.poNo){ + this.toPage(`${this.page.raw.commission.goOut.detail}?poNo=${this.form.poNo}`) + }else{ + let tip = this.$t('message.borrow_Tip') + uni.showToast({ + icon: "none", + title: tip as string, + }); + } + + } onCheck(e: any) { console.log('e.data', e.data); this.selectMaterielList = []; @@ -232,18 +244,14 @@ export default class stoOutboundDom extends BasePage { }); } back() { - this.form.barCode = ''; - this.model.orderInInfo.stoAmount = 0; - this.selectMaterielList = []; uni.navigateBack({ delta: 1 }); - this.$table.onEmpty(); } // 单号查询 async queryOrder(poNo:string){ const {orderInInfo} = await model.queryOrder(poNo) Object.assign(this.form,{ - ...orderInInfo + orderInInfo }) } materialConfirm(v: any) { diff --git a/src/pages/raw/commission/goOut/model.ts b/src/pages/raw/commission/goOut/model.ts index ab135bd..c5483d7 100644 --- a/src/pages/raw/commission/goOut/model.ts +++ b/src/pages/raw/commission/goOut/model.ts @@ -69,6 +69,25 @@ export class ReturningModule extends VuexModule { })); return { locationCodeList }; } + /** + * 获取物料 + * + * @returns + * @memberof ReturningModule + */ + @MutationAction + async outInfo(poNo:string) { + const list: [] = await http.post(url.material.commission.goOut.outInfo, { + factoryCode: session.factoryCode, + poNo: poNo, + loginName: session.loginName, + }); + const locationCodeList = list.map((item: any) => ({ + label: item.locationCode, + value: item.locationCode, + })); + return { locationCodeList }; + } /** * 提交 diff --git a/src/utils/url.ts b/src/utils/url.ts index 052b27f..f7bb58e 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -97,6 +97,17 @@ export const url = { // 出库明细查询 outInfo: "/material/outsourcing/outInfo", }, + entrant:{ + // 单号查询 + queryOrder:'/material/outsourcing/into/queryOrder', + // 库位下拉列表 + queryByFactoryCodeAndWorkAreaCode: "/wmspda/fg/queryByFactoryCodeAndWorkAreaCode", + // 提交 + materialComplete:'/material/outsourcing/into/materialComplete', + // 明细查询 + info:'/material/outsourcing/into/info', + + } }, }, SFG: {