From eb0a1e7296173bfae9acb90dce7bf781b53d8348 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Thu, 27 Oct 2022 16:13:47 +0800 Subject: [PATCH] =?UTF-8?q?cosmoim-852=20fix=20=E6=96=B0=E5=A2=9E=E6=B3=B0?= =?UTF-8?q?=E5=9B=BD=E8=99=9A=E6=8B=9F=E8=A1=A5=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/cn.ts | 6 + src/i18n/lang/en.ts | 6 + src/i18n/lang/ru.ts | 6 + src/pages.json | 24 + .../VirtualReplenishment/Local-details.vue | 78 +++ .../VirtualReplenishment/Location.vue | 658 ++++++++++++++++++ .../handover/VirtualReplenishment/config.ts | 153 ++++ .../handover/VirtualReplenishment/model.ts | 250 +++++++ src/utils/page.ts | 4 + src/utils/url.ts | 2 + 10 files changed, 1187 insertions(+) create mode 100644 src/pages/raw/handover/VirtualReplenishment/Local-details.vue create mode 100644 src/pages/raw/handover/VirtualReplenishment/Location.vue create mode 100644 src/pages/raw/handover/VirtualReplenishment/config.ts create mode 100644 src/pages/raw/handover/VirtualReplenishment/model.ts diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index 4ba1eed..fdae858 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -510,5 +510,11 @@ export default { rejectsOffline: '不良品下线', ResponsibleProcess: '责任工序', PleaseThere: '请输入责任工序', + rawWasteJudgment: '原材料判废', + reason1: '原因', + ResponsibilityCategory: '责任大类', + Please_category: '请选择责任大类', + VirtualReplenishment: '虚拟补料', + VirtualInventory: '虚拟库存', }, }; diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index b381f0b..c4f95c1 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -510,5 +510,11 @@ export default { rejectsOffline: 'Defective products offline', ResponsibleProcess: 'Responsible process', PleaseThere: 'Please enter the responsible operation', + rawWasteJudgment: 'Waste judgment of raw materials', + reason1: 'reason', + ResponsibilityCategory: 'Responsibility category', + Please_category: 'Please select the responsibility category', + VirtualReplenishment: 'Virtual replenishment', + VirtualInventory: 'Virtual inventory', }, }; diff --git a/src/i18n/lang/ru.ts b/src/i18n/lang/ru.ts index f1e1a42..ee4f9d9 100644 --- a/src/i18n/lang/ru.ts +++ b/src/i18n/lang/ru.ts @@ -510,5 +510,11 @@ export default { rejectsOffline: 'нижняя линия дефекта', ResponsibleProcess: 'ответственная операция', PleaseThere: 'Введите ответственную операцию', + rawWasteJudgment: 'утилизация сырья', + reason1: 'причина', + ResponsibilityCategory: 'категория ответственности', + Please_category: 'Выберите категорию ответственности', + VirtualReplenishment: 'виртуальная добавка', + VirtualInventory: 'виртуальный запас', }, }; diff --git a/src/pages.json b/src/pages.json index c29b941..9e61d34 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1250,6 +1250,14 @@ "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 } }, + // { + // "path": "pages/raw/LineSide/rawWasteJudgment/index", + // "style": { + // "navigationBarTitleText": "原材料判废", + // "navigationStyle": "custom", // 隐藏系统导航栏 + // "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + // } + // }, { "path": "pages/product/STO-Outbound/index", "style": { @@ -1263,6 +1271,22 @@ "style": { "navigationBarTitleText": "演示" } + }, + { + "path": "pages/raw/handover/VirtualReplenishment/Location", + "style": { + "navigationBarTitleText": "虚拟补料", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } + }, + { + "path": "pages/raw/handover/VirtualReplenishment/Local-details", + "style": { + "navigationBarTitleText": "虚拟补料详细页面", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } } ], "globalStyle": { diff --git a/src/pages/raw/handover/VirtualReplenishment/Local-details.vue b/src/pages/raw/handover/VirtualReplenishment/Local-details.vue new file mode 100644 index 0000000..6402ee1 --- /dev/null +++ b/src/pages/raw/handover/VirtualReplenishment/Local-details.vue @@ -0,0 +1,78 @@ + + + + +function go() { throw new Error('Function not implemented.'); } diff --git a/src/pages/raw/handover/VirtualReplenishment/Location.vue b/src/pages/raw/handover/VirtualReplenishment/Location.vue new file mode 100644 index 0000000..e7d76d9 --- /dev/null +++ b/src/pages/raw/handover/VirtualReplenishment/Location.vue @@ -0,0 +1,658 @@ + + + + + diff --git a/src/pages/raw/handover/VirtualReplenishment/config.ts b/src/pages/raw/handover/VirtualReplenishment/config.ts new file mode 100644 index 0000000..e1c5a08 --- /dev/null +++ b/src/pages/raw/handover/VirtualReplenishment/config.ts @@ -0,0 +1,153 @@ +/** + * 补料明细表格列 + */ +import vm from '@/main'; +export const headers = [ + { + label: vm.$t('message.InventoryOrderNo'), + key: 'prdOrder', //单号 + width: 220, + }, + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', //物料号 + width: 220, + }, + { + label: vm.$t('message.po_MaterielDes'), + key: 'materialDesc', //物料描述 + width: 350, + }, + { + label: vm.$t('message.po_ActualQuantity'), + key: 'fillAmount', //实际数量 + }, + { + label: vm.$t('message.Summary_Number'), + key: 'amount', //可退数量 + }, + { + label: vm.$t('message.Feeding_ReplenishedQuantity'), + key: 'totalFillAmount', //已拣数量 + }, + { + label: vm.$t('message.po_Location'), + key: 'locationCode', //库存地点 + }, + // { + // label: '工位', + // key: 'sendSpot', + // }, + // { + // label: '行项目', + // key: 'groupId', + // }, + // { + // label: '单位', + // key: 'unit', + // }, + // { + // label: '凭证号', + // key: 'credNo', + // }, + // { + // label: '发货地点', + // key: 'wkposCodeP', + // }, + // { + // label: '工厂', + // key: 'sapFactoryCode', + // }, + // { + // label: 'MRP', + // key: 'mrpCode', + // }, + // { + // label: '生产订单', + // key: 'prdOrder', + // }, +]; +export const detailHeader = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 260, + }, + { + label: vm.$t('message.receiveAStation'), + key: 'sendSpot', + }, + { + label: vm.$t('message.CommissionedLocation'), + key: 'wlCode', + }, + { + label: vm.$t('message.quantityNum'), + key: 'qty', + }, +]; +export const RUSdetailHeader = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 260, + }, + { + label: vm.$t('message.receiveAStation'), + key: 'sendSpot', + }, + { + label: vm.$t('message.CommissionedLocation'), + key: 'wlCode', + }, + { + label: vm.$t('message.quantityNum'), + key: 'qty', + }, + { + label: vm.$t('message.Container'), + key: 'barcode', + width: 700, + }, +]; +export const PropoHeader = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 300, + }, + { + label: vm.$t('message.po_MaterielDes'), + key: 'materialDesc', + width: 450, + }, + { + label: vm.$t('message.Pi_unit'), + key: 'unit', + width: 300, + }, + { + label: vm.$t('message.Production'), + key: 'prdOrder', + width: 300, + }, +]; +export const CreteListHeader = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 200, + }, + { + label: vm.$t('message.receiveAStation'), + key: 'sendSpot', + }, + { + label: vm.$t('message.Production'), + key: 'prdOrder', + }, + { + label: vm.$t('message.quantityNum'), + key: 'amount', + }, +]; diff --git a/src/pages/raw/handover/VirtualReplenishment/model.ts b/src/pages/raw/handover/VirtualReplenishment/model.ts new file mode 100644 index 0000000..f74b677 --- /dev/null +++ b/src/pages/raw/handover/VirtualReplenishment/model.ts @@ -0,0 +1,250 @@ +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 { auth } from '@/store/modules/auth'; +import { session } from '@/store/modules/session'; + +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'raw.handover.VirtualReplenishment', +}) +export class VirtualReplenishment extends VuexModule { + /** + * 补料明细列表 + */ + blDetailList: any[] = []; + detailedList: any; + LocList: any = []; + submitListCode: any = ''; + // 容器码 + ContainerCode: any = ''; + + /** + * 库位列表 + */ + locationList = []; + MaterialList: any = []; + + /** + * 补料明细列表是否有选择项 + */ + get hasBlDetailChecked() { + return this.checkedBlDetailList.length > 0; + } + + /** + * 获取选中的补料明细列表 + */ + get checkedBlDetailList() { + return this.blDetailList.filter((_: any) => _.checked); + } + + /** + * 补料明细列表中是否有本次补料数量 + */ + get hasBlDetailFillAmount() { + return this.blDetailList.findIndex((_: any) => _.fillAmount) > -1; + } + + /** + * 获取补料明细上传列表数据 + */ + get blDetailUploadList() { + return this.blDetailList.map((item: any) => { + if (!item.checked) { + item.fillAmount = 0; + } + return item; + }); + } + + /** + * 清理状态数据 + */ + @Mutation + clearState() { + this.blDetailList = []; + } + + /** + * 确认选中补料明细列表 + * @param params + */ + @Mutation + confirmCheckedBlDetailList(params: { locationCode: string; amount: number }) { + this.blDetailList + .filter((_: any) => _.checked) + .forEach((item: any) => { + if (params.locationCode) { + item.wkposCodeP = params.locationCode; + } + if (params.amount) { + item.fillAmount = params.amount; + } + }); + } + @MutationAction + async queryVirtual(params: any = {}) { + const res: any = await http.post(url.sortscan.save.queryVirtualOrderAmountBl, params); + const LocList = []; + console.log('res', res); + const arr: any = { + label: res.data.sendSpot, + value: res.data.sendSpot + '(' + res.data.amount + ')', + }; + LocList.push(arr); + + console.log('LocList', LocList); + return { LocList }; + } + /** + * 上传补料明细列表 + */ + @Action({ commit: 'clearState' }) + async saveBl(params: any) { + await auth.checkPassword({ + factoryCode: session.factoryCode as string, + loginName: params.operatorPass as string, + rfPwd: params.rfPwd, + }); + await http.post(url.bl.virtual, { + factoryCode: session.factoryCode, + loginName: session.loginName, + ...params, + }); + uni.showToast({ + //icon: "success", + title: 'success', + duration: 2000, + image: '/static/icons/icon-51.png', + }); + } + + /** + * 解锁补料明细列表数据 + */ + @Action + async unlockBlDetailList() { + try { + const sapSupplyIdList = this.blDetailList.map((_) => _.sapSupplyId); + const params = { + factoryCode: session.factoryCode, + loginName: session.loginName, + sapSupplyIdList, + }; + await http.post(url.bl.unlock, params, { + custom: { hideError: true }, + } as any); + } catch { + // + } + } + + /** + * 查询补料明细列表 + */ + @MutationAction + async queryBlDetailList(params: any) { + const { list: blDetailList } = await http.post(url.bl.query, { + factoryCode: session.factoryCode, + loginName: session.loginName, + ...params, + }); + return { blDetailList }; + } + //查询明细 + @Action({ commit: 'updateCheckedOrderInInfoListKw' }) + async querydetaildlist(content: any) { + const res: any = await http.post('/wmspda/tl/getBlListSn', content); + console.log('明细》》》》》》》》》', res.list); + this.detailedList = res.list; + return res; + } + /** + * 查询库位列表 + */ + @MutationAction + async queryLocationList() { + const result: any = await http.post(url.auth.query.location, { + factoryCode: session.factoryCode, + loginName: session.loginName, + workareaCode: session.workareaCode, + }); + const locationList = result.list.map((_: any) => ({ + label: _.locationCode, + value: _.locationCode, + })); + return { locationList }; + } + + @MutationAction + async queryMaterialList(params: any) { + const res: any = await http.post(url.auth.query.queryAppendDetail, { + factoryCode: session.factoryCode, + loginName: session.loginName, + prdOrder: params.prdOrder, + materialCode: params.materialCode, + }); + const MaterialList = res.list; + return { MaterialList }; + } + @MutationAction + async submitList(params: any) { + const res: any = await http.post(url.auth.query.createAppendList, params); + const submitListCode = res.code; + return { submitListCode }; + } + //补料解锁 + @MutationAction + async lock(sapSupplyIdList: any) { + const res: any = await http.post(url.auth.query.lock, { + factoryCode: session.factoryCode, + loginName: session.loginName, + sapSupplyIdList, + }); + console.log(res); + return {}; + } + //俄罗斯补料扫描容器码 + @MutationAction + async searchBarcode(params: any) { + const res: any = await http.post(url.auth.query.barcode, { + factoryCode: session.factoryCode, + loginName: session.loginName, + barcode: params.barcode, + productCode: params.productCode, + }); + const ContainerCode = res.data; + return { ContainerCode }; + } + //俄罗斯补料提交 + @Action({ commit: 'clearState' }) + async saveBlDetailSubmit(params: any) { + await auth.checkPassword({ + factoryCode: session.factoryCode as string, + loginName: params.operatorPass as string, + rfPwd: params.rfPwd, + }); + await http.post(url.bl.uRussia, { + factoryCode: session.factoryCode, + loginName: session.loginName, + ...params, + }); + uni.showToast({ + //icon: "success", + title: 'success', + duration: 2000, + image: '/static/icons/icon-51.png', + }); + } + @Action({ commit: 'updateCheckedOrderInInfoListKw' }) + async queryByFactoryCodeAndWorkAreaCode(content: any) { + const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); + return res; + } +} + +export default getModule(VirtualReplenishment); diff --git a/src/utils/page.ts b/src/utils/page.ts index 3fc69df..0472338 100644 --- a/src/utils/page.ts +++ b/src/utils/page.ts @@ -120,6 +120,10 @@ export const page = { result: '/pages/raw/handover/virtual/result', summary: '/pages/raw/handover/virtual/summary', }, + feeVirtualReplenishmentding: { + Location: '/pages/raw/handover/feeVirtualReplenishmentding/Location', + Local: '/pages/raw/handover/feeVirtualReplenishmentding/Local-details', + }, }, ingoods: { index: '/pages/raw/ingoods/index', diff --git a/src/utils/url.ts b/src/utils/url.ts index 60d1fd7..cc5e5be 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -199,6 +199,7 @@ export const url = { orderRussia: 'wmspda/sortscan/save/order/russia', queryWlByMat: '/wmspda/sortscan/queryWlByMat', queryWlByMatBL: '/wmspda/sortscan/queryWlByMatBL', + queryVirtualOrderAmountBl: '/wmspda/bl/queryVirtualOrderAmountBl', }, unlock: { list: '/wmspda/sortscan/unlock/list', @@ -303,6 +304,7 @@ export const url = { u: '/wmspda/bl/u', uRussia: '/wmspda/bl/uRussia', unlock: '/wmspda/bl/unlock', + virtual: '/wmspda/bl/u/virtual', }, bj: { query: '/wmspda/material/hei/spareIn/queryOrder',