From 5e827cf95955c396d4e5346e9278b3d8c66f551f Mon Sep 17 00:00:00 2001 From: guoshuang Date: Mon, 26 Dec 2022 16:03:32 +0800 Subject: [PATCH] =?UTF-8?q?cosmoim-852=20fix=20=E4=BF=84=E7=BD=97=E6=96=AF?= =?UTF-8?q?=E5=8D=8A=E6=88=90=E5=93=81=E7=9B=98=E7=82=B9=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=8E=9F=E6=9D=90=E6=96=99=E7=9B=98?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 8 + src/pages/login/login/index.vue | 2 +- .../Semi-finished-inventory/index.vue | 11 +- .../Raw-material-inventory/index.vue | 304 ++++++++++++++++ .../warehouse/Raw-material-inventory/model.ts | 338 ++++++++++++++++++ 5 files changed, 657 insertions(+), 6 deletions(-) create mode 100644 src/pages/raw/warehouse/Raw-material-inventory/index.vue create mode 100644 src/pages/raw/warehouse/Raw-material-inventory/model.ts diff --git a/src/pages.json b/src/pages.json index 512e6f3..e6d0af1 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1343,6 +1343,14 @@ "navigationStyle": "custom", // 隐藏系统导航栏 "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 } + }, + { + "path": "pages/raw/warehouse/Raw-material-inventory/index", + "style": { + "navigationBarTitleText": "俄罗斯原材料盘点(扫描条码)", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } } ], "globalStyle": { diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index c7f71f9..75292c4 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -171,7 +171,7 @@ export default class LoginPage extends BasePage { console.log('......', server.serverAddress); if (server.serverAddress.includes('https://eurmom.haier.net')) { //修改俄罗斯版本号 - this.Version = '1.1.16'; + this.Version = '1.1.17'; } else { this.Version = '1.0.46'; } diff --git a/src/pages/raw/Semi-finished/Semi-finished-inventory/index.vue b/src/pages/raw/Semi-finished/Semi-finished-inventory/index.vue index 1334341..a493c05 100644 --- a/src/pages/raw/Semi-finished/Semi-finished-inventory/index.vue +++ b/src/pages/raw/Semi-finished/Semi-finished-inventory/index.vue @@ -44,18 +44,18 @@ - + - + + {{ $t('message.InventoryFinish') }} - + {{ $t('message.po_Return') }} @@ -223,6 +223,7 @@ export default class rawMaterialInventory extends BasePage { // this.productCodeList = {}; // this.model.empty(); // await this.query(); + this.checkRawCreateInfo(); } } } diff --git a/src/pages/raw/warehouse/Raw-material-inventory/index.vue b/src/pages/raw/warehouse/Raw-material-inventory/index.vue new file mode 100644 index 0000000..c0bbb6b --- /dev/null +++ b/src/pages/raw/warehouse/Raw-material-inventory/index.vue @@ -0,0 +1,304 @@ + + + + + diff --git a/src/pages/raw/warehouse/Raw-material-inventory/model.ts b/src/pages/raw/warehouse/Raw-material-inventory/model.ts new file mode 100644 index 0000000..499a21d --- /dev/null +++ b/src/pages/raw/warehouse/Raw-material-inventory/model.ts @@ -0,0 +1,338 @@ +import { Action, getModule, Module, Mutation, MutationAction, VuexModule } from 'vuex-module-decorators'; +import store from '@/store'; +import http from '@/utils/request'; +import { url } from '@/utils/url'; +import { session } from '@/store/modules/session'; + +class OrderInInfo { + checked?: boolean; + dnNo?: string; + kw?: string; + userDefined10?: string; + orderStatus?: string; + carNo?: string; + bookingTime?: string; + supplyCode?: string; + poType?: string; + location?: string; +} + +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'raw.warehouse.Raw-material-inventory', +}) +export class ReceiptModule extends VuexModule { + // 是否有 + isState = true; + sendSpot = ''; + code: any = ''; + /** + * sap库存地点列表 + */ + cboPlaceList = []; + /** + * 隐藏看单号 + */ + dnNo = ''; + /** + * 看单号查询结果 + */ + orderInInfo: OrderInInfo = new OrderInInfo(); + /** + * 看单明细 + */ + orderInInfoList: OrderInInfo[] = []; + /** + * 看单明细未通过明细 + */ + orderInInfoListEx: OrderInInfo[] = []; + InventoryList: any = []; + InventoryItemList: any = []; + Semifedcode: any = ''; + scandata: any = {}; + SubmitCode: any = ''; + + /** + * 库位列表 + */ + returningTypeList: any[] = []; + + /** + * 是否已查询看单号 + */ + get hasDnInfo() { + return !!this.orderInInfo.dnNo; + } + + /** + * 是否全选 + */ + get isCheckedAll() { + return !this.orderInInfoList.filter((_) => !_.checked).length; + } + + /** + * 是否有选择项 + */ + get hasChecked() { + return this.orderInInfoList.filter((_) => _.checked).length > 0; + } + + /** + * 更新看单明细库位 + * @param kw 库位 + */ + @Mutation + updateOrderInInfoListKw(kw: string) { + this.orderInInfoList = this.orderInInfoList.map((item) => { + item.kw = kw; + return item; + }); + } + + /** + * 更新选中的看单明细库位 + * @param kw 库位 + */ + @Mutation + updateCheckedOrderInInfoListKw(kw: string) { + this.orderInInfoList = this.orderInInfoList.map((item) => { + if (item.checked) { + item.kw = kw; + } + return item; + }); + } + + /** + * 看单明细全选/全不选 + */ + @Mutation + checkAllOrderInInfoList(checked: boolean) { + this.orderInInfoList = this.orderInInfoList.map((item) => { + item.checked = checked; + return item; + }); + } + + /** + * 查询库位列表 + */ + @MutationAction + async queryLocation() { + const result: any = await http.post(url.auth.query.location1, { + factoryCode: session.factoryCode, + loginName: session.loginName, + userDefined3: 1, + }); + console.log('result', result); + const cboPlaceList = result.data.records.map((_: any) => ({ + label: _.sendSpot, + value: _.sendSpot, + })); + return { cboPlaceList }; + } + + /** + * 查询单号 + * 查询DN单号 + * @param dnNo + */ + @MutationAction + async queryOrderInInfo(dnNo: string) { + const { list }: any = await http.post(url.material.DNorderin.info, { + dnNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + const orderInInfo = list[0] || {}; + const orderInInfoList = list.filter((_: OrderInInfo) => _.userDefined10 === '1'); + const orderInInfoListEx = list.filter((_: OrderInInfo) => _.userDefined10 === '0'); + // orderInInfoList.forEach((item: any) => { + // item.receiptAmount = item.requestAmount; + // }); + uni.setStorageSync('sendSpot', JSON.stringify(list[0].sendSpot) as any); + return { dnNo, orderInInfo, orderInInfoList, orderInInfoListEx }; + } + + /** + * 查询单号 + * 查询盘点单号 + * @param pddNo + */ + @MutationAction + async rawMaterialInventoryCheckRaw(pddNo: string) { + const res: any = await http.post(url.material.rawMaterialInventory.checkRaw, { + pddNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + const InventoryList = res.data; + const InventoryItemList = []; + InventoryList.forEach((item: any) => { + const arr = { + value: item.productCode, + label: item.productCode, + }; + InventoryItemList.push(arr); + }); + return { InventoryList, InventoryItemList }; + // uni.showToast({ + // icon: "none", + // title: msg, + // }); + } + /** + * 查询条码 + * 查询盘点条码 + * @param barcode + */ + @MutationAction + async getRawStorageSnNew(barcode: string) { + const res: any = await http.post(url.material.rawMaterialInventory.getRawStorageSnNew, { + barcode, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + const Semifedcode = res.code; + const scandata = res.data; + // const InventoryItemList = []; + // InventoryList.forEach((item: any) => { + // const arr = { + // value: item.productCode, + // label: item.productCode, + // }; + // InventoryItemList.push(arr); + // }); + return { Semifedcode, scandata }; + // 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 + */ + @MutationAction + async barcodeConfirm(form: any) { + const res: any = await http.post(url.material.rawMaterialInventory.barcodeConfirm, { + ...form, + // factoryCode: session.factoryCode, + // loginName: session.loginName, + }); + const code = res.code; + return { code }; + } + + /** + * 物料盘点完成 + * + * @param {string} productCode + * @param {string} pddNo + * @memberof ReceiptModule + */ + @MutationAction + async checkRawOrderComplete(pddNo?: string | null) { + const res: any = await http.post(url.material.rawMaterialInventory.orderComplete, { + pddNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + const code = res.code; + return { code }; + } + + /** + * 提交看单明细 + */ + @MutationAction + async submitOrderInEnter() { + const list = (this.state as any).orderInInfoList.map((item: any) => { + item.orderStatus = item.checked ? '2' : '1'; + return item; + }); + const result: any = await http.post(url.material.DNorderin.enter, { + dnNo: this.dnNo, + factoryCode: session.factoryCode, + loginName: session.loginName, + list, + }); + uni.showToast({ + icon: 'none', + title: result.msg, + }); + const orderInInfoList = result.list.sort((a: any, b: any) => Number(a.accountingStatus) - Number(b.accountingStatus)); + return { orderInInfoList }; + } + + /** + * 修改库位 + */ + @Action({ commit: 'updateCheckedOrderInInfoListKw' }) + async changeOrderInLocation(kw: string) { + await http.post('/wmspda/material/orderin/enter', { + warehouseCode: session.warehouseCode, + factoryCode: session.factoryCode, + loginName: session.loginName, + locationCode: kw, + }); + return kw; + } + @Action({ commit: 'updateCheckedOrderInInfoListKw' }) + async queryByFactoryCodeAndWorkAreaCode(content: any) { + const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); + return res; + } +} + +export default getModule(ReceiptModule);