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: {