From e5cf803cd7c8687fc7f6b083dac60c842cb275ea Mon Sep 17 00:00:00 2001 From: hou <1601990943@qq.com> Date: Tue, 7 Jun 2022 17:50:18 +0800 Subject: [PATCH] =?UTF-8?q?cosmoim-852=20fix=20=E6=96=B0=E5=A2=9E=E5=A4=87?= =?UTF-8?q?=E4=BB=B6=E5=85=A5=E5=BA=93=E5=8A=9F=E8=83=BD?= 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/pages.json | 32 ++ .../outbound/SpareDeliverGoods/config.ts | 26 + .../outbound/SpareDeliverGoods/index.vue | 451 ++++++++++++++++++ .../outbound/SpareDeliverGoods/model.ts | 231 +++++++++ .../SpareInbound/Inbound/Local-details.vue | 112 +++++ .../ingoods/SpareInbound/Inbound/config.ts | 132 +++++ .../ingoods/SpareInbound/Inbound/index.vue | 421 ++++++++++++++++ .../raw/ingoods/SpareInbound/Inbound/model.ts | 219 +++++++++ src/pages/raw/ingoods/SpareInbound/index.vue | 129 +++++ src/utils/page.ts | 3 + src/utils/url.ts | 5 + 13 files changed, 1773 insertions(+) create mode 100644 src/pages/product/outbound/SpareDeliverGoods/config.ts create mode 100644 src/pages/product/outbound/SpareDeliverGoods/index.vue create mode 100644 src/pages/product/outbound/SpareDeliverGoods/model.ts create mode 100644 src/pages/raw/ingoods/SpareInbound/Inbound/Local-details.vue create mode 100644 src/pages/raw/ingoods/SpareInbound/Inbound/config.ts create mode 100644 src/pages/raw/ingoods/SpareInbound/Inbound/index.vue create mode 100644 src/pages/raw/ingoods/SpareInbound/Inbound/model.ts create mode 100644 src/pages/raw/ingoods/SpareInbound/index.vue diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index f64d34e..d5e1be8 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -483,5 +483,11 @@ export default { WPMInformation: 'WPM信息', Container: '容器码', returner: '退料人必须等于登录人', + Inbound: '备件入库', + InboundDetail: '入库明细', + orderNum: '订单数量', + totalNum: '累计数量', + Operation: '操作人', + StorageTime: '入库时间', }, }; diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 2e14f2d..1f07e24 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -488,5 +488,11 @@ export default { WPMInformation: 'WPM-Information', Container: 'Container Code', returner: 'The returner must be equal to the login', + Inbound: 'Spare Inbound', + InboundDetail: 'Inbound Detail', + orderNum: 'Order Num', + totalNum: 'total Num', + Operation: 'Operation', + StorageTime: 'Storage Time', }, }; diff --git a/src/pages.json b/src/pages.json index 90c3df7..5cef026 100644 --- a/src/pages.json +++ b/src/pages.json @@ -818,6 +818,38 @@ "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 } }, + { + "path": "pages/raw/ingoods/SpareInbound/index", + "style": { + "navigationBarTitleText": "备件管理", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } + }, + { + "path": "pages/raw/ingoods/SpareInbound/Inbound/index", + "style": { + "navigationBarTitleText": "备件入库", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } + }, + { + "path": "pages/product/outbound/SpareDeliverGoods/index", + "style": { + "navigationBarTitleText": "备件发货", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } + }, + { + "path": "pages/raw/ingoods/SpareInbound/Inbound/Local-details", + "style": { + "navigationBarTitleText": "备件明细", + "navigationStyle": "custom", // 隐藏系统导航栏 + "navigationBarTextStyle": "white" // 状态栏字体为白色,只能为 white-白色,black-黑色 二选一 + } + }, { "path": "pages/demo/index", "style": { diff --git a/src/pages/product/outbound/SpareDeliverGoods/config.ts b/src/pages/product/outbound/SpareDeliverGoods/config.ts new file mode 100644 index 0000000..fa4b24d --- /dev/null +++ b/src/pages/product/outbound/SpareDeliverGoods/config.ts @@ -0,0 +1,26 @@ +/** + * 看单明细表格列 + */ +import vm from '@/main'; +export const headers = [ + { + label: vm.$t('message.product_barCode'), + key: 'barcode', + width: 300, + }, + { + label: vm.$t('message.product_FGCode'), + key: 'productCode', + width: 300, + }, + { + label: vm.$t('message.product_FGDes'), + key: 'productDescZh', + width: 300, + }, + { + label: vm.$t('message.Line'), + key: 'order2', + width: 300, + }, +]; diff --git a/src/pages/product/outbound/SpareDeliverGoods/index.vue b/src/pages/product/outbound/SpareDeliverGoods/index.vue new file mode 100644 index 0000000..084f1f4 --- /dev/null +++ b/src/pages/product/outbound/SpareDeliverGoods/index.vue @@ -0,0 +1,451 @@ + + + + + diff --git a/src/pages/product/outbound/SpareDeliverGoods/model.ts b/src/pages/product/outbound/SpareDeliverGoods/model.ts new file mode 100644 index 0000000..c49d00a --- /dev/null +++ b/src/pages/product/outbound/SpareDeliverGoods/model.ts @@ -0,0 +1,231 @@ +import { Action, getModule, Module, 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'; +// import vm from '@/main'; + +class OrderInInfo { + stoAmount?: 0; + stoNo?: string; //STO采购单号 + orderAmount?: string; //单据总数 + Allocated?: string; //已分配 + Unallocated?: string; //未分配 +} + +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'product.outbound.SpareDeliverGoods', +}) +export class ReturningModule extends VuexModule { + /** + * 月台列表 + */ + returningTypeList: any[] = []; + PostingCode: any = ''; + /** + * 物料列表 + */ + materielList: any[] = []; + + //条码扫描的返回的结果 + oneMaterielDetail: any = {}; + /** + * 订单号查询结果 + */ + orderInInfo: OrderInInfo = new OrderInInfo(); + resCode: any = ''; + //记账按钮的code码 + code = ''; + DNcode: any = ''; + /** + * 查询月台列表 + */ + @MutationAction + async queryReturningTypeList() { + const list: [] = await http.post(url.outbound.stoOutbound.yuetaiType, { + factoryCode: session.factoryCode, + whCode: session.warehouseCode, + loginName: session.loginName, + }); + const returningTypeList = list.map((item: any) => ({ + label: item.dockName, + value: item.dockCode, + })); + return { returningTypeList }; + } + + /** + * 查询订单号 + * @param orderNo + */ + @MutationAction + async queryOrderInInfo(nxOutCode: string) { + const result = await http.post(url.outbound.stoOutbound.info, { + nxOutCode, + deleteFlag: 2, + finalState: 3, + loginName: session.loginName, + }); + let stoAmount = 0; + result.data.records.forEach((item: any) => { + stoAmount += item.orderAmount; + }); + const materielList = result.data.records.map((item: any) => ({ + label: item.materialCode, + value: item.stoItem, + ...item, + })); + console.log('materielList', materielList); + if (result.data.records[0]) { + result.data.records[0].stoAmount = stoAmount; + } + const orderInInfo = result.data.records[0] || {}; + return { orderInInfo, materielList }; + } + /** + * 查询订单号 + */ + @MutationAction + async findProdInfoByDN(nxOutCode: string) { + const result: any = await http.post(url.outbound.stoOutbound.findProdInfoByDN, { + nxOutCode, + loginName: session.loginName, + factoryCode: session.factoryCode, + }); + console.log('resule>>>>>>>>>>>>>>>>>>>>>>>', result); + let stoAmount = 0; + const DNcode = result.code; + result.data.forEach((item: any) => { + stoAmount += item.orderAmount; + }); + const materielList = result.data.map((item: any) => ({ + value: item.materialCode, + rowItem: item.rowItem, + label: item.rowItem + '(' + item.materialCode + ')', + ...item, + })); + console.log('materielList', materielList); + if (result.data[0]) { + result.data[0].stoAmount = stoAmount; + } + const orderInInfo = result.data[0] || {}; + return { orderInInfo, materielList, DNcode }; + } + //退扫 + @MutationAction + async delCode(params: any = {}) { + const res: any = await http.post(url.outbound.stoOutbound.del, params); + const resCode = res.code; + return { resCode }; + } + /** + * 扫条码 + */ + @Action + async tluSubmit(list: any[]) { + const obj = { + barcode: list[0].barCode, + loginName: session.loginName, + }; + let oneMaterielDetail: any = {}; + const { data }: any = await http.post(url.outbound.stoOutbound.checkScan, obj); + console.log('shneme a ', data.records); + oneMaterielDetail = data.records[0]; + data.records[0].materialCode = list[0].productCode; + data.records[0].materialDesc = list[0].productDescZh; + console.log('aaaaa', oneMaterielDetail); + return oneMaterielDetail; + } + /** + * 扫条码 + */ + @Action + async getMaterialByCode(list: any = {}) { + let oneMaterielDetail: any = {}; + const { data }: any = await http.post(url.outbound.stoOutbound.getMaterialByCode, list); + oneMaterielDetail = data.records[0]; + return oneMaterielDetail; + } + /** + * 确认按钮 + * @param orderNo + */ + @MutationAction + async confirm(list: any[]) { + const { code, data } = await http.post(url.outbound.stoOutbound.Bookkeeping, list); + console.log('res数据', data, code); + // if (code == '1') { + // uni.showToast({ icon: 'success', title: msg }); + // } else { + // uni.showToast({ icon: 'none', title: msg }); + // } + const materielList: any = []; + return { code, materielList }; + } + /** + * 确认按钮 + * @param orderNo + */ + @MutationAction + async confirmMove(list: any) { + const res: any = await http.post(url.outbound.stoOutbound.Bookkeeping, list); + console.log('res数据', res); + const code = res.code; + // if (code == '1') { + // uni.showToast({ icon: 'success', title: msg }); + // } else { + // uni.showToast({ icon: 'none', title: msg }); + // } + const materielList: any = []; + return { code, materielList }; + } + /** + * 查询详细 + * @param orderNo + */ + @MutationAction + async queryDetailed(order1: string) { + const { code, data } = await http.post(url.outbound.stoOutbound.getDetailByorderNo, { + order1, + loginName: session.loginName, + factoryCode: session.factoryCode, + }); + console.log('res数据', data, code); + const materielList = data; + console.log('>>>>>>>', materielList); + return { code, materielList }; + } + + //退扫接口 + @MutationAction + async BackSweep(params: any) { + const res: any = await http.post(url.outbound.stoOutbound.scanBarcodeDN, params); + console.log('res>>>>>>>>>>>>>>>>>>>>>>>>.', res); + const code = res.code; + return { code }; + } + //退扫查询接口 + @MutationAction + async queryAmount(params: any) { + const res: any = await http.post(url.outbound.stoOutbound.queryAmount, params); + console.log('退扫>>>>>>>>>>>>>>>>>>>>>>>>.', res); + return {}; + } + //过账 + @MutationAction + async Posting(params: any) { + const res: any = await http.post(url.outbound.stoOutbound.Posting, params); + const PostingCode = res.code; + return { PostingCode }; + } + @MutationAction + async empty() { + const orderInInfo = {}; + return { orderInInfo }; + } +} + +export default getModule(ReturningModule); diff --git a/src/pages/raw/ingoods/SpareInbound/Inbound/Local-details.vue b/src/pages/raw/ingoods/SpareInbound/Inbound/Local-details.vue new file mode 100644 index 0000000..d3b0427 --- /dev/null +++ b/src/pages/raw/ingoods/SpareInbound/Inbound/Local-details.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/pages/raw/ingoods/SpareInbound/Inbound/config.ts b/src/pages/raw/ingoods/SpareInbound/Inbound/config.ts new file mode 100644 index 0000000..4feaf13 --- /dev/null +++ b/src/pages/raw/ingoods/SpareInbound/Inbound/config.ts @@ -0,0 +1,132 @@ +/** + * 补料明细表格列 + */ +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', //库存地点 + }, +]; +export const bjheaders = [ + { + label: vm.$t('message.InventoryOrderNo'), + key: 'prdOrder', //单号 + width: 220, + }, + { + label: vm.$t('message.CommissionedMaterielNo'), + key: 'materialCode', //物料号 + width: 220, + }, + { + label: vm.$t('message.CommissionedMaterielDesc'), + key: 'materialDesc', //物料描述 + width: 450, + }, + { + label: vm.$t('message.CommissionedLocation'), + key: 'userDefined1', //库位 + }, + { + label: vm.$t('message.CommissionedNumber'), + key: 'amount', //入库数量 + }, + { + label: vm.$t('message.Operation'), + key: 'createBy', //操作人 + }, + { + label: vm.$t('message.StorageTime'), + key: 'gmtCreate', //入库时间 + width: 550, + }, +]; +export const detailHeader = [ + { + label: vm.$t('message.Pi_OrderNo'), + key: 'prdOrder', + width: 270, + }, + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 270, + }, + { + label: vm.$t('message.CommissionedLocation'), + key: 'wlCode', + }, + { + label: vm.$t('message.CommissionedNumber'), + key: 'qty', + }, +]; +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/ingoods/SpareInbound/Inbound/index.vue b/src/pages/raw/ingoods/SpareInbound/Inbound/index.vue new file mode 100644 index 0000000..366ac2c --- /dev/null +++ b/src/pages/raw/ingoods/SpareInbound/Inbound/index.vue @@ -0,0 +1,421 @@ + + + + + diff --git a/src/pages/raw/ingoods/SpareInbound/Inbound/model.ts b/src/pages/raw/ingoods/SpareInbound/Inbound/model.ts new file mode 100644 index 0000000..66a379d --- /dev/null +++ b/src/pages/raw/ingoods/SpareInbound/Inbound/model.ts @@ -0,0 +1,219 @@ +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'; + +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'raw.ingoods.SpareInbound.Inbound', +}) +export class FeedingModule extends VuexModule { + /** + * 补料明细列表 + */ + blDetailList: any[] = []; + detailedList: any; + LocList: any = []; + submitListCode: any = ''; + + /** + * 库位列表 + */ + locationList = []; + MaterialList: any = []; + bjDetailList: 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 queryItemLoc(params: any = {}) { + const res: any = await http.post(url.sortscan.save.queryWlByMatBL, params); + const LocList = []; + res.forEach((item: any) => { + const arr: any = { + label: item.locationCode, + value: item.locationCode + '(' + item.sendSpot + ')', + }; + LocList.push(arr); + }); + console.log('res', res); + console.log('LocList', LocList); + return { LocList }; + } + /** + * 上传补料明细列表 + */ + @Action({ commit: 'clearState' }) + async saveBlDetailUpload(params: any) { + await http.post(url.bj.submit, { + ...params, + factoryCode: session.factoryCode, + loginName: session.loginName, + }); + uni.showToast({ + 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(order: any) { + const res: any = await http.post(url.bj.query, { + factoryCode: session.factoryCode, + loginName: session.loginName, + prdOrder: order, + }); + res.data.wlList = []; + const blDetailList: any = res.data; + 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 {}; + } + @Action({ commit: 'updateCheckedOrderInInfoListKw' }) + async queryByFactoryCodeAndWorkAreaCode(content: any) { + const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); + return res; + } + @MutationAction + async querybjdetail(prdOrder) { + const res: any = await http.post(url.bj.detail, prdOrder); + const bjDetailList: any = res.data; + return { bjDetailList }; + } +} + +export default getModule(FeedingModule); diff --git a/src/pages/raw/ingoods/SpareInbound/index.vue b/src/pages/raw/ingoods/SpareInbound/index.vue new file mode 100644 index 0000000..a373897 --- /dev/null +++ b/src/pages/raw/ingoods/SpareInbound/index.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/src/utils/page.ts b/src/utils/page.ts index ccd11fb..35882ec 100644 --- a/src/utils/page.ts +++ b/src/utils/page.ts @@ -141,6 +141,9 @@ export const page = { detailEx: '/pages/raw/ingoods/dnReturnGoods/detail-ex', idetailed: '/pages/raw/ingoods/dnReturnGoods/idetailed', }, + SpareInboun: { + details: '/pages/raw/ingoods/SpareInbound/Inbound/Local-details', + }, }, warehouse: { index: '/pages/raw/warehouse/index', diff --git a/src/utils/url.ts b/src/utils/url.ts index 70af5ed..fb10ac1 100644 --- a/src/utils/url.ts +++ b/src/utils/url.ts @@ -248,6 +248,11 @@ export const url = { u: '/wmspda/bl/u', unlock: '/wmspda/bl/unlock', }, + bj: { + query: '/wmspda/material/hei/spareIn/queryOrder', + submit: '/wmspda/material/hei/spareIn/complete', + detail: '/wmspda/material/hei/spareIn/queryOrder/detail', + }, tl: { get: { type: '/wmspda/tl/get/type',