diff --git a/src/pages/raw/handover/aggregating-vn/ByOrder.vue b/src/pages/raw/handover/aggregating-vn/ByOrder.vue new file mode 100644 index 0000000..660bc33 --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/ByOrder.vue @@ -0,0 +1,441 @@ + + + + + diff --git a/src/pages/raw/handover/aggregating-vn/accessory.vue b/src/pages/raw/handover/aggregating-vn/accessory.vue new file mode 100644 index 0000000..5b3ba7a --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/accessory.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/pages/raw/handover/aggregating-vn/config.ts b/src/pages/raw/handover/aggregating-vn/config.ts new file mode 100644 index 0000000..266d77a --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/config.ts @@ -0,0 +1,221 @@ +/** + * 汇总查询表格列 + */ +import vm from '@/main'; +export const headers = [ + { + label: vm.$t('message.Pi_OrderNo'), + key: 'prdOrder', + width: 250, + }, + { + label: vm.$t('message.po_DemandQuantity'), + key: 'amount', //需求数量 + width: 255, + }, + { + label: vm.$t('message.Pi_materielNo'), + key: 'materialCode', //物料号 + width: 250, + }, + { + label: vm.$t('message.CommissionedMaterielDesc'), + key: 'materialDesc', //物料描述 + width: 300, + }, + { + label: vm.$t('message.Summary_ProductionDate'), + key: 'requireDate', //生产日期 + width: 300, + }, + { + label: vm.$t('message.product_FGCode'), + key: 'prodCode', //成品编码 + }, + { + label: vm.$t('message.Pi_FinishedProductModel'), + key: 'prodDesc', //成品型号 + width: 300, + }, +]; + +/** + * 汇总查询结果表格列 + */ +export const resultHeaders = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 220, + }, + { + label: vm.$t('message.po_DemandQuantity'), + key: 'amount', + }, + { + label: vm.$t('message.Pi_CumulativePickingQuantity'), + key: 'totalMoAmount', + width: 300, + }, + { + label: vm.$t('message.Pi_HandoverQuantity'), + key: 'totalHvAmount', + }, + { + label: vm.$t('message.Pi_Station'), + key: 'sendSpot', + }, + { + label: vm.$t('message.po_MaterielDes'), + key: 'materialDesc', + width: 350, + }, + { + label: 'MRP', + key: 'mrpCode', + }, + { + label: vm.$t('message.Pi_unit'), + key: 'unit', + }, + { + label: vm.$t('message.Pi_OrderNo'), + key: 'prdOrder', + }, + { + label: vm.$t('message.Pi_FinishedProductModel'), + key: 'proType', + }, + { + label: vm.$t('message.po_Location'), + key: 'wkposCode', + }, + { + label: vm.$t('message.product_FGCode'), + key: 'prodCode', //成品编码 + }, + { + label: vm.$t('message.Pi_FinishedProductModel'), + key: 'prodDesc', //成品型号 + width: 300, + }, +]; + +/** + * 汇总交接查询结果表格列 + */ +export const summaryHeaders = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 220, + }, + { + label: vm.$t('message.Summary_QuantityOfThisHandover'), + key: 'hvAmount', + }, + // { + // label: vm.$t('message.po_DemandQuantity'), + // key: 'amount', + // }, + { + label: vm.$t('message.Pi_CumulativePickingQuantity'), + key: 'totalMoAmount', + width: 300, + }, + { + label: vm.$t('message.Pi_HandoverQuantity'), + key: 'totalHvAmount', + }, + { + label: vm.$t('message.po_DemandQuantity'), + key: 'amount', + }, + { + label: vm.$t('message.Pi_Station'), + key: 'sendSpot', + }, + { + label: vm.$t('message.po_MaterielDes'), + key: 'materialDesc', + width: 350, + }, + { + label: vm.$t('message.Pi_unit'), + key: 'unit', + }, + { + label: vm.$t('message.Summary_FinishedProductMaterialNumber'), + key: 'prdMaterialCode', + }, + { + label: vm.$t('message.po_Location'), + key: 'wkposCode', + }, +]; + +/** + * 按单查询结果表格列 + */ +export const orderHeaders = [ + { + label: vm.$t('message.po_MaterielNo'), + key: 'materialCode', + width: 220, + }, + { + label: vm.$t('message.Summary_QuantityOfThisHandover'), + key: 'hvAmount', + }, + // { + // label: vm.$t('message.po_DemandQuantity'), + // key: 'amount', + // }, + { + label: vm.$t('message.Pi_CumulativePickingQuantity'), + key: 'totalMoAmount', + width: 300, + }, + { + label: vm.$t('message.Pi_HandoverQuantity'), + key: 'totalHvAmount', + }, + { + label: vm.$t('message.po_DemandQuantity'), + key: 'amount', + }, + { + label: vm.$t('message.Pi_Station'), + key: 'sendSpot', + }, + { + label: vm.$t('message.po_MaterielDes'), + key: 'materialDesc', + width: 350, + }, + { + label: vm.$t('message.Pi_unit'), + key: 'unit', + }, + { + label: 'MRP', + key: 'mrpCode', + }, + { + label: vm.$t('message.Pi_OrderNo'), + key: 'prdOrder', + }, + { + label: vm.$t('message.po_Location'), + key: 'wkposCode', + }, + { + label: vm.$t('message.product_FGCode'), + key: 'prodCode', //成品编码 + }, + { + label: vm.$t('message.Pi_FinishedProductModel'), + key: 'prodDesc', //成品型号 + width: 300, + }, +]; diff --git a/src/pages/raw/handover/aggregating-vn/index.vue b/src/pages/raw/handover/aggregating-vn/index.vue new file mode 100644 index 0000000..3a74349 --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/index.vue @@ -0,0 +1,355 @@ + + + diff --git a/src/pages/raw/handover/aggregating-vn/model.ts b/src/pages/raw/handover/aggregating-vn/model.ts new file mode 100644 index 0000000..b339325 --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/model.ts @@ -0,0 +1,312 @@ +import { getModule, Module, Mutation, Action, MutationAction, VuexModule } from 'vuex-module-decorators'; +import store from '@/store'; +import http from '@/utils/request'; +import { url } from '@/utils/url'; +import { cloneDeep } from 'lodash/fp'; +import vm from '@/main'; +@Module({ + namespaced: true, + dynamic: true, + store, + name: 'raw.handover.aggregating', +}) +export class AggregatingModule extends VuexModule { + /** + * 查询列表 + */ + proOrderList = []; + param: any; + orderOutIdListParams: any; + SubmitCode: any = ''; + /** + * 查询结果列表 + */ + proOrderResultList = []; + isFormChange: any; + + /** + * 查询结果汇总列表 + */ + aggregateList: any[] = []; + + /** + * 查询结果按单列表 + */ + orderList: any[] = []; + + /** + * 查询结果辅料列表 + */ + accessoryList: any[] = []; + lockCode: any = ''; + + /** + * 库存地点列表 + */ + locationList = []; + + /** + * 是否全选 + */ + get isCheckedAll() { + return !this.proOrderList.filter((_: any) => !_.checked).length; + } + + /** + * 是否有选择项 + */ + get hasChecked() { + return this.checkedProOrderList.length > 0; + } + + /** + * 获取选中的查询列表 + */ + get checkedProOrderList() { + return this.proOrderList.filter((_: any) => _.checked); + } + + /** + * 清空查询结果列表 + */ + @Mutation + clearProOrderResultList() { + this.proOrderResultList = []; + } + /** + * 查询列表 + */ + @Mutation + clearProOrderList() { + this.proOrderList = []; + } + + /** + * 全选/取消全选汇总列表 + * @param checked + */ + @Mutation + checkAllAggregateList(checked: boolean) { + this.aggregateList.map((item: any) => { + Object.assign(item, { checked, hvAmount: (checked && item.totalMoAmount - item.totalHvAmount) || 0 }); + }); + } + /** + * 全选/取消按单列表 + * @param checked + */ + @Mutation + checkAllOrderList(checked: boolean) { + this.orderList.map((item: any) => { + Object.assign(item, { checked, hvAmount: (checked && item.totalMoAmount - item.totalHvAmount) || 0 }); + }); + } + /** + * 列表提交-汇总交接 + * @param params + */ + @MutationAction + async uploadAggregateList(params: any) { + const result: any = await http.post(url.sumscan.u.hzlist, params); + const SubmitCode = result.code; + console.log('yayayyayyayayayyayyayayayyay', SubmitCode); + uni.showToast({ + //icon: 'success', + title: 'success', + duration: 2000, + image: '/static/icons/icon-51.png', + }); + return { SubmitCode }; + } + + /** + * 设置汇总列表项本次交接数量 + * @param params + */ + @Mutation + setAggregateListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) { + this.aggregateList[index].hvAmount = hvAmount; + // this.aggregateList.splice(index, 1, newItem); + // if (this.aggregateList[index].checked) { + // this.aggregateList[index].hvAmount = this.aggregateList[index].totalMoAmount - this.aggregateList[index].totalHvAmount; + // } else { + // this.aggregateList[index].hvAmount = 0; + // } + } + + /** + * 设置按单列表项本次交接数量 + * @param params + */ + @Mutation + setOrderListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) { + // this.orderList.splice(index, 1, newItem); + this.orderList[index].hvAmount = hvAmount; + } + // setOrderListItemHvAmount() { + // this.orderList + // .filter((_: any) => _.checked) + // .forEach((item: any) => { + // item.hvAmount = item.totalMoAmount - item.totalHvAmount; + // // if (params.hvAmount) { + // // item.currentAmount = params.hvAmount; + // // } + // }); + // } + + /** + * 设置辅料列表项本次交接数量 + * @param params + */ + @Mutation + setAccessoryListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) { + const original = this.accessoryList[index]; + const newItem = { ...original, hvAmount }; + this.accessoryList.splice(index, 1, newItem); + } + /** + * 汇总列表是否全选 + */ + get isAggregateCheckedAll() { + return !this.aggregateList.filter((_: any) => !_.checked).length; + } + /** + * 按单列表是否全选 + */ + get isOrderCheckedAll() { + return !this.orderList.filter((_: any) => !_.checked).length; + } + /** + * 全选/取消全选查询列表 + * @param checked + */ + @Mutation + checkAllProOrderList(checked: boolean) { + this.proOrderList = this.proOrderList.map((item: any) => ({ + ...item, + checked, + })); + } + + /** + * 查询看单号 + * @param params + */ + @MutationAction + async queryProOrder(params: any) { + const { list: proOrderList }: any = await http.post(url.sumscan.query.orderno, params); + //const proOrderList = values.map((v: string) => ({ prdOrder, amount: v, materialCode: v, materialDesc: v })); + //const proOrderList = values; + //console.log(">>>>>?????proOrderList",proOrderList); + proOrderList.forEach((_: any) => (_.checked = true)); + if (!proOrderList.length) { + // uni.showToast({ + // icon: 'none', + // title: 'No Data Found!', + // }); + vm.customToast(vm.$t('message.Pi_NoDataFound') as any); + } + return { proOrderList }; + } + + /** + * 查询结果列表 + * @param params + */ + @MutationAction + async queryProOrderResult(params: any) { + const { list: proOrderResultList }: any = await http.post(url.sumscan.query.ordoutlist, params); + return { proOrderResultList }; + } + + /** + * 查询结果-汇总列表 + * @param params + */ + @MutationAction + async queryAggregateList(params: any) { + const { list: aggregateList }: any = await http.post(url.sumscan.query.hzlist, params); + if (!aggregateList.length) { + // uni.showToast({ + // icon: 'none', + // title: 'No Data Found!', + // }); + vm.customToast(vm.$t('message.Pi_NoDataFound') as any); + return { aggregateList }; + } + console.log('aggregateList', aggregateList); + return { aggregateList }; + } + + /** + * 查询结果-按单列表 + * @param params + */ + @MutationAction + async queryOrderList(params: any) { + const { queryParams, proOrderResultList } = params; + await http.post(url.sumscan.lock.list, queryParams); + const orderList = cloneDeep(proOrderResultList); + orderList.map((item: any) => { + Object.assign(item, { checked: false }); + }); + return { orderList }; + } + @MutationAction + async lock(params: any) { + const res: any = await http.post(url.sortscan.lock.list, params); + const lockCode = res.code; + return { lockCode }; + } + /** + * 查询结果-辅料列表 + * @param params + */ + @MutationAction + async queryAccessoryList(params: any) { + const { list: accessoryList }: any = await http.post(url.sumscan.query.fllist, params); + if (!accessoryList.length) { + // uni.showToast({ + // icon: 'none', + // title: 'No Data Found!', + // }); + vm.customToast(vm.$t('message.Pi_NoDataFound') as any); + } + return { accessoryList }; + } + + /** + * 列表提交-按单交接 + * @param params + */ + @MutationAction + async uploadOrderList(params: any) { + const result: any = await http.post(url.sumscan.u.order, params); + const SubmitCode = result.code; + console.log('yayayyayyayayayyayyayayayyay', SubmitCode); + uni.showToast({ + //icon: 'success', + title: 'success', + duration: 2000, + image: '/static/icons/icon-51.png', + }); + return { SubmitCode }; + } + + /** + * 列表提交-辅料交接 + * @param params + */ + @Action + async uploadAccessoryList(params: any) { + return http.post(url.sumscan.u.fllist, params); + } + + @Action({ commit: 'updateCheckedOrderInInfoListKw' }) + async queryByFactoryCodeAndWorkAreaCode(content: any) { + const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); + return res; + } +} + +export default getModule(AggregatingModule); diff --git a/src/pages/raw/handover/aggregating-vn/order.vue b/src/pages/raw/handover/aggregating-vn/order.vue new file mode 100644 index 0000000..d784a62 --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/order.vue @@ -0,0 +1,414 @@ + + + + + diff --git a/src/pages/raw/handover/aggregating-vn/result.vue b/src/pages/raw/handover/aggregating-vn/result.vue new file mode 100644 index 0000000..949e159 --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/result.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/src/pages/raw/handover/aggregating-vn/summary.vue b/src/pages/raw/handover/aggregating-vn/summary.vue new file mode 100644 index 0000000..c138e30 --- /dev/null +++ b/src/pages/raw/handover/aggregating-vn/summary.vue @@ -0,0 +1,462 @@ + + + + +