From 908d8a2f172057491172510bf10bf949d527de9f Mon Sep 17 00:00:00 2001 From: zhoulei Date: Thu, 18 Nov 2021 16:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development.local.rename | 3 - src/i18n/lang/cn.ts | 1 + src/i18n/lang/en.ts | 1 + .../raw/warehouse/rowInventory/index.vue | 122 ++++++++++++------ src/pages/raw/warehouse/rowInventory/model.ts | 111 ++++++++++++++++ src/utils/url.ts | 13 ++ 6 files changed, 207 insertions(+), 44 deletions(-) delete mode 100644 .env.development.local.rename diff --git a/.env.development.local.rename b/.env.development.local.rename deleted file mode 100644 index e2f2090..0000000 --- a/.env.development.local.rename +++ /dev/null @@ -1,3 +0,0 @@ -# 复制本文件并重命名为.env.development.local -# 本地开发版本 -VUE_APP_BASE_URL=http://localhost:8181 diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index 035a684..827a218 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -200,6 +200,7 @@ export default { InventoryMateriel:'物料名', InventoryTotalNumber:'盘点总数', InventoryPleaseScan: "请扫描单号", + InventoryFinish: "完成", // 委外-入库 CommissionEntrant:'委外入库', diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 803d39a..fe56c9e 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -204,6 +204,7 @@ export default { InventoryMateriel:'MAT name', InventoryTotalNumber:'Total', InventoryPleaseScan: "Please scan No.", + InventoryFinish: "Finish", // 委外-入库 CommissionEntrant:'委外入库', diff --git a/src/pages/raw/warehouse/rowInventory/index.vue b/src/pages/raw/warehouse/rowInventory/index.vue index e04ad6b..3e39ec3 100644 --- a/src/pages/raw/warehouse/rowInventory/index.vue +++ b/src/pages/raw/warehouse/rowInventory/index.vue @@ -13,43 +13,51 @@ - + + + + - + - - - - - {{ + + {{ $t("message.workArea_Confirm") }} - + + {{ + $t("message.InventoryFinish") + }} + + {{ $t("message.po_Return") }} @@ -65,13 +73,13 @@ import { BasePage } from "@/components/base/page"; import { VForm, VFormRules } from "vue/types/form"; import model from "./model"; -interface OptionType { - label: string; - value: string; -} +// interface OptionType { +// label: string; +// value: string; +// } @Component -export default class dnReceiptDom extends BasePage { +export default class rawMaterialInventory extends BasePage { /** * 表单引用 */ @@ -84,17 +92,26 @@ export default class dnReceiptDom extends BasePage { index() { this.toPage(this.page.raw.index); } + + status = false; /** * 表单数据 */ form = { - documentNo: null, - cboPlace: {} as OptionType, + // 盘点单号 + pddNo: null, + // 物料号 + productCode: null, + productDescZh: null, + // 盘点数量 + spQty: null, + + // cboPlace: {} as OptionType, }; cboPlaceSelect = false; rules: VFormRules = { - documentNo: [ + pddNo: [ { required: true, message: this.$t("message.dn_PleaseScan") as string }, ], // cboPlace: [{ required: true, message: this.$t('message.Warehouse_Tip10') as string }], @@ -103,6 +120,27 @@ export default class dnReceiptDom extends BasePage { value = ""; show = false; +// 扫描物料号检查 + async checkRawProductCode(productCode:string){ + let result = await model.checkRawProductCode({ + productCode,pddNo:this.form.pddNo + }) + console.log('result:::',result) + this.status = result.isState + } + checkRawCreateInfo(){ + + if(this.status){ + model.checkRawProductComplete(this.form) + }else{ + model.checkRawCreateInfo(this.form) + } + } + // + async checkRawOrderComplete(){ + await model.checkRawOrderComplete(this.form.pddNo) + } + // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕 onReady() { this.$form.setRules(this.rules); @@ -118,22 +156,24 @@ export default class dnReceiptDom extends BasePage { back() { uni.navigateBack({ delta: 1 }); } - onSubmit() { + async onSubmit() { this.$form.validate((valid: boolean) => { if (!valid) return; - // if (!this.model.hasDnInfo) { - // uni.showToast({ - // icon: 'none', - // title: this.$t('message.dn_PleaseScan') as string, - // }); - // return; - // } - sessionStorage.setItem( - "dnNo", - JSON.stringify(this.form.documentNo) as any - ); - this.toPage(this.page.raw.ingoods.dnReceipt.detail); + if (!this.model.hasDnInfo) { + uni.showToast({ + icon: 'none', + title: this.$t('message.dn_PleaseScan') as string, + }); + return; + } + // sessionStorage.setItem( + // "dnNo", + // JSON.stringify(this.form.pddNo) as any + // ); + + // this.toPage(this.page.raw.ingoods.dnReceipt.detail); }); + await this.model.submitOrderInEnter(); } } diff --git a/src/pages/raw/warehouse/rowInventory/model.ts b/src/pages/raw/warehouse/rowInventory/model.ts index 6c9f4b2..489840d 100644 --- a/src/pages/raw/warehouse/rowInventory/model.ts +++ b/src/pages/raw/warehouse/rowInventory/model.ts @@ -32,6 +32,9 @@ class OrderInInfo { name: "raw.ingoods.dnReceipt", }) export class ReceiptModule extends VuexModule { + + // 是否有 + isState = true; sendSpot = ""; /** * sap库存地点列表 @@ -161,6 +164,114 @@ export class ReceiptModule extends VuexModule { return { dnNo, orderInInfo, orderInInfoList, orderInInfoListEx }; } + /** + * 查询单号 + * 查询盘点单号 + * @param pddNo + */ + @Action + async rawMaterialInventoryCheckRaw(pddNo: string) { + + const { msg }: any = await http.post(url.material.rawMaterialInventory.checkRaw, { + pddNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + uni.showToast({ + icon: "none", + title: msg, + }); + } + + /** + * 扫描物料号检查 + * + * @param {string} productCode + * @param {string} pddNo + * @memberof ReceiptModule + */ + @Action + async checkRawProductCode(form:any) { + + const { code,msg }: any = await http.post(url.material.rawMaterialInventory.productCode, { + productCode:form.productCode, + pddNo:form.pddNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + uni.showToast({ + icon: "none", + title: msg, + }); + console.log('code:::',code,msg) + const isState = !!+code + return {isState} + } + /** + * 新增单号、物料信息 + * + * @param {string} productCode + * @param {string} pddNo + * @memberof ReceiptModule + */ + @Action + async checkRawCreateInfo(form:any) { + + const { msg }: any = await http.post(url.material.rawMaterialInventory.createInfo, { + ...form, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + uni.showToast({ + icon: "none", + title: msg, + }); + } + + /** + * 物料盘点确定 + * + * @param {string} productCode + * @param {string} pddNo + * @memberof ReceiptModule + */ + @Action + async checkRawProductComplete(form:any) { + + const { msg }: any = await http.post(url.material.rawMaterialInventory.productComplete, { + ...form, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + uni.showToast({ + icon: "none", + title: msg, + }); + + } + + /** + * 物料盘点完成 + * + * @param {string} productCode + * @param {string} pddNo + * @memberof ReceiptModule + */ + @Action + async checkRawOrderComplete(pddNo?: string|null) { + + const { msg }: any = await http.post(url.material.rawMaterialInventory.orderComplete, { + pddNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + uni.showToast({ + icon: "none", + title: msg, + }); + + } + /** * 提交看单明细 */ diff --git a/src/utils/url.ts b/src/utils/url.ts index 895cee4..f3c5bbb 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -71,6 +71,19 @@ export const url = { unlock: "/material/orderout/unlock", takeout: "/material/orderout/takeout", }, + // 原材料盘点 + rawMaterialInventory: { + // 盘点单号查询检查 + checkRaw: "/product/finished/checkRaw/order", + // 扫描物料号检查 + productCode: "/product/finished/checkRaw/productCode", + // 3.盘点单中不存在该物料但继续盘点,需要新增单号和物料信息 + createInfo: "/product/finished/checkRaw/createInfo", + // 4.物料盘点确定 + productComplete: "/product/finished/checkRaw/productComplete", + // 5.盘点完成 + orderComplete: "/product/finished/checkRaw/orderComplete", + }, }, SFG: { DumpListFH: {