From abbdf211a302acff192831eeaab56ed0bef88477 Mon Sep 17 00:00:00 2001 From: hou <1601990943@qq.com> Date: Thu, 6 Jan 2022 11:29:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=20=E9=A2=86=E7=94=A8?= =?UTF-8?q?=E5=80=9F=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/cn.ts | 2 + src/i18n/lang/en.ts | 2 + .../product/warehouse/wholeCollect/index.vue | 225 ++++++++++++------ .../product/warehouse/wholeCollect/model.ts | 51 ++-- .../product/warehouse/wholeScrap/index.vue | 83 +++---- 5 files changed, 216 insertions(+), 147 deletions(-) diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index d26df54..7ea55e8 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -197,8 +197,10 @@ export default { return_Tip4: '退料数量不能大于总数', quantitys: '不能大于应退货数量', actual: '实际退货数量不等于应退货数量', + Requisition: '领用单', greater: '不能大于总数', receiveAStation: '接收工位', + collecting: '请输入领用单号', //库内主菜单 Warehouse: '成品库内', diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index a9b85e4..9785a11 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -216,6 +216,7 @@ export default { InventoryTotalNumber: 'Total', InventoryPleaseScan: 'Please scan No.', InventoryFinish: 'Finish', + collecting: 'Please enter the collecting doc No', // 委外-入库 CommissionEntrant: 'Subcontracting receipt', @@ -224,6 +225,7 @@ export default { CommissionedMaterielDesc: 'describe', SourceLocation: 'Source location', barcode: 'Please enter barcode', + Requisition: 'Requisition', scrapForm: 'Please scan the scrap form first', finishedProduct: 'Please select finished product code first', CommissionedDemandData: 'Demand', diff --git a/src/pages/product/warehouse/wholeCollect/index.vue b/src/pages/product/warehouse/wholeCollect/index.vue index a6acf9a..2bc35b8 100644 --- a/src/pages/product/warehouse/wholeCollect/index.vue +++ b/src/pages/product/warehouse/wholeCollect/index.vue @@ -8,37 +8,50 @@ - - - - + + + + {{ $t('message.Requisition') }} + + + + {{ $t('message.Query') }} + + - + - + - + - - - + + + - + + + + + - - {{ $t('message.workArea_Confirm') }} + + {{ $t('message.detailed') }} - + + {{ $t('message.InventoryFinish') }} + + {{ $t('message.po_Return') }} @@ -50,33 +63,27 @@ import { Component, Ref } from 'vue-property-decorator'; import { BasePage } from '@/components/base/page'; import { VForm, VFormRules } from 'vue/types/form'; import model from './model'; +import jPicker from '@/components/J-Picker/jPicker.vue'; import { session } from '@/store/modules/session'; interface OptionType { label: string; value: string; } -@Component +@Component({ + components: { + jPicker, + }, +}) export default class ProductCheckReceipt extends BasePage { @Ref('form') readonly $form!: VForm; model = model; //表单 form = { - ...this.model.orderInInfo, - originWl: {} as OptionType, - aimWl: {} as OptionType, - qty: {} as OptionType, + order3: '', + barcode: '', }; - originWlSelect = false; - aimWlSelect = false; - cboPlaceSelect = false; - rules: VFormRules = { - documentNo: [{ required: true, message: this.$t('message.Warehouse_Tip1') as string }], - originWl: [{ required: true, message: this.$t('message.Warehouse_Tip2') as string }], - aimWl: [{ required: true, message: this.$t('message.Warehouse_Tip3') as string }], - cboPlace: [{ required: true, message: this.$t('message.Warehouse_Tip4') as string }], - }; - value = ''; - show = false; + wl: any = {}; + Some: any = {}; // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 onReady() { this.model.orderInInfo.productDescZh = ''; @@ -84,49 +91,107 @@ export default class ProductCheckReceipt extends BasePage { this.model.orderInInfo.qty = ''; this.model.orderInInfo.locCode = ''; this.model.orderInInfo.costCenter = ''; - this.$form.setRules(this.rules); - this.model.queryLocation(); } - onSubmit() { - this.$form.validate((valid: boolean) => { - if (!valid) return; - if (!this.form.productCode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, - }); - return; + //单号查询 + async query() { + if (!this.form.order3) { + uni.showToast({ + icon: 'none', + title: this.$t('message.Commission_tips1') as string, + }); + return; + } + let param = { + factoryCode: session.factoryCode, + loginName: session.loginName, + order3: this.form.order3, + orderType: 'LY', + page: '1', + rows: '50', + }; + await this.model.queryScrapList(param); + if (this.model.code == '1') { + uni.showToast({ + icon: 'none', + title: this.$t('message.product_Tip8') as string, + }); + this.wl.value = this.model.choiceCodeList[0].value; + this.Some = this.model.recordsList[0]; + } + } + //选择成品编码 + materialChoice(e: any) { + this.wl = e.pickerName; + this.model.recordsList.forEach((item: any) => { + if (item.productCode == e.pickerName.value) { + this.Some = item; } - if (!this.model.orderInInfo.costCenter) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip8') as string, - }); - return; - } - console.log('orderlist'); - const orderlist = [ - { - ...this.model.orderInInfo, - // originWl: this.form.originWl.value, - originWl: this.model.orderInInfo.locCode, - // aimWl: this.form.aimWl.value, custcode - type: '0', - orderType: '2', - keepBy: session.loginName, - factoryCode: session.factoryCode, - }, - ]; - console.log('orderlist', orderlist); - this.model.onTakeoutConfirm(orderlist); - this.model.orderInInfo.productDescZh = ''; - this.model.orderInInfo.productCode = ''; - this.model.orderInInfo.qty = ''; - this.model.orderInInfo.locCode = ''; - this.model.orderInInfo.costCenter = ''; - this.form.productCode = ''; }); } + //条码扫码 + async scanning() { + if (!this.form.order3) { + uni.showToast({ + icon: 'none', + title: this.$t('message.scrapForm') as string, + }); + } + if (!this.Some) { + uni.showToast({ + icon: 'none', + title: this.$t('message.finishedProduct') as string, + }); + } + if (!this.form.barcode) { + uni.showToast({ + icon: 'none', + title: this.$t('message.barcode') as string, + }); + return; + } + let params = { + factoryCode: session.factoryCode, + loginName: session.loginName, + barcode: this.form.barcode, + productCode: this.wl.value, + locCode: this.Some.originWl, + }; + await this.model.getProductCode(params); + if (this.model.code == '1') { + uni.showToast({ + icon: 'none', + title: this.$t('message.product_Tip8') as string, + }); + } + } + //确定 + async onSubmit() { + const orderlist = [ + { + ...this.model.orderInInfo, + originWl: this.Some.originWl, + barCode: this.form.barcode, + aimWl: this.Some.aimWl, + type: '0', + orderType: '2', + keepBy: session.loginName as string, + factoryCode: session.factoryCode as string, + order3: this.form.order3, + costCenter: this.Some.costCenter, + }, + ]; + await this.model.onTakeoutConfirm(orderlist); + if (this.model.code == '1') { + uni.showToast({ + icon: 'none', + title: this.$t('message.success') as string, + }); + } + this.Some = {}; + this.wl = {}; + this.form.order3 = ''; + this.form.barcode = ''; + } }