From f0af527afe9886f09757e73f3b47563f4192c15a Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Fri, 5 Jan 2024 13:36:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E5=93=81=E6=8B=86=E8=A7=A3=EF=BC=8C?= =?UTF-8?q?=E8=BF=94=E4=BF=AE=EF=BC=8C=E6=8A=A5=E5=BA=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productdismantleRequestMain/index.vue | 16 ++++-- .../productdismantleRequestMain.data.ts | 7 +++ .../productrepairRequestMain/index.vue | 15 +++++- .../productrepairRequestMain.data.ts | 7 +++ .../productscrapRequestMain/index.vue | 22 ++++++-- .../productscrapRequestMain.data.ts | 54 +++++++++++++++++++ 6 files changed, 112 insertions(+), 9 deletions(-) diff --git a/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue b/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue index 573628a29..9f3c36eca 100644 --- a/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue +++ b/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/index.vue @@ -133,6 +133,7 @@ const buttondataTable = ref([{ const DialogTitle = ref('Bom信息') const bomModelVisible = ref(false) const tableListBom = ref() +const detailQty = ref() const lsBomSave = ref() const rowId = ref() const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ @@ -140,6 +141,7 @@ const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useT }) const { getList:getDetailListBom } = detatableMethodsBom /** bom 列表 表单 按钮 */ +const mainStatus = ref() const ButttondataBom = ref([ defaultButtons.formSaveBtn(null), // 保存 defaultButtons.formCloseBtn(null) // 关闭 @@ -151,7 +153,7 @@ const buttonBaseClickBom = async (val) => { // 新增bom保存 临时的 let flag = false; detatableDataBom.tableList.forEach((item) => { - if(item.qty!=0 && item.bomQty < item.qty){ + if(item.qty!=0 && (item.bomQty * detailQty.value < item.qty)){ flag = true; return; } @@ -160,7 +162,7 @@ const buttonBaseClickBom = async (val) => { message.warning('数量需要小于Bom数量!') return } - tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && item.bomQty >= item.qty)) + tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && item.bomQty * detailQty.value >= item.qty)) if (lsBomSave.value) { // 根据 填写的数量 为基准 不填写数量的忽略 tableData.value.forEach((item, index) => { @@ -190,6 +192,7 @@ const buttonOperationClick = async (row, label, index)=> { detatableDataBom.params.bomVersion = row.bomVersion detatableDataBom.params.masterId = '' DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息' + detailQty.value = row.qty bomModelVisible.value = true await getDetailListBom() // console.log(183, detatableDataBom.tableList) @@ -208,6 +211,8 @@ const buttonOperationClick = async (row, label, index)=> { item.qty = itemChild.qty } }) + }else { + item.qty = item.bomQty * row.qty } }) } @@ -223,6 +228,7 @@ const tableFormButton = async (val , row) => { masterId: row.id } rowId.value = row.id + detailQty.value = row.qty await getDetailListBom() } } @@ -398,12 +404,16 @@ const openForm =async (type: string, row?: number) => { tableData.value = [] // 重置明细数据 // 临时存储 新增/编辑 还是 详情操作 区别第二子表Detailb 的窗体保存 是直接调用接口,还是临时存储 lsBomSave.value = true + mainStatus.value = '1' + ButttondataBom.value = [ + defaultButtons.formSaveBtn({ hide : mainStatus.value != 1 }), // 保存 + defaultButtons.formCloseBtn(null) // 关闭 + ] formRef.value.open(type, row) } /** 详情操作 */ const detailRef = ref() -const mainStatus = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { lsBomSave.value = false mainStatus.value = row.status; diff --git a/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/productdismantleRequestMain.data.ts b/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/productdismantleRequestMain.data.ts index 4a8dd484b..4bb2fb515 100644 --- a/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/productdismantleRequestMain.data.ts +++ b/src/views/wms/productionManage/productdismantle/productdismantleRequestMain/productdismantleRequestMain.data.ts @@ -1227,6 +1227,13 @@ export const BomDismantle = useCrudSchemas(reactive([ precision: 6 } }, + { + label: 'Bom版本', + field: 'version', + tableForm:{ + disabled: true + } + }, { label: '数量', field: 'qty', diff --git a/src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue b/src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue index 07c10425e..1dc259f70 100644 --- a/src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue +++ b/src/views/wms/productionManage/productrepair/productrepairRequestMain/index.vue @@ -139,6 +139,7 @@ const DialogTitle = ref('Bom信息') const bomModelVisible = ref(false) const tableListBom = ref() const lsBomSave = ref() +const detailQty = ref() const rowId = ref() const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ getListApi: BomDismantleApi.getBomDismantlePage @@ -157,7 +158,7 @@ const buttonBaseClickBom = (val) => { // 根据 填写的数量 为基准 不填写数量的忽略 let flag = false; detatableDataBom.tableList.forEach((item) => { - if(item.qty!=0 && item.bomQty < item.qty){ + if(item.qty!=0 && (item.bomQty * detailQty.value < item.qty)){ flag = true; return; } @@ -166,7 +167,7 @@ const buttonBaseClickBom = (val) => { message.warning('数量需要小于Bom数量!') return } - tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && item.bomQty >= item.qty)) + tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && (item.bomQty * detailQty.value >= item.qty))) if(lsBomSave.value){ tableData.value.forEach((item, index) => { if(tableListBom.value[0].rowId == index) { @@ -192,7 +193,9 @@ const buttonOperationClick = async (row, label, index)=> { return } detatableDataBom.params.itemCode = row.itemCode + detatableDataBom.params.bomVersion = row.bomVersion DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息' + detailQty.value = row.qty bomModelVisible.value = true await getDetailListBom() detatableDataBom.tableList.map(item => { @@ -203,6 +206,8 @@ const buttonOperationClick = async (row, label, index)=> { item.qty = itemChild.qty } }) + }else { + item.qty = item.bomQty * row.qty } }) } @@ -429,6 +434,11 @@ const openForm =async (type: string, row?: number) => { tableData.value = [] // 重置明细数据 detatableDataBom.params = []; // 重置Bom请求参数 lsBomSave.value = true + mainStatus.value = '1' + ButttondataBom.value = [ + defaultButtons.formSaveBtn({ hide : mainStatus.value != 1 }), // 保存 + defaultButtons.formCloseBtn(null) // 关闭 + ] formRef.value.open(type, row) } @@ -567,6 +577,7 @@ const tableFormButton = async (val , row) => { bomVersion: row.bomVersion, masterId: row.id } + detailQty.value = row.qty rowId.value = row.id await getDetailListBom() } diff --git a/src/views/wms/productionManage/productrepair/productrepairRequestMain/productrepairRequestMain.data.ts b/src/views/wms/productionManage/productrepair/productrepairRequestMain/productrepairRequestMain.data.ts index 54a887515..66170f62c 100644 --- a/src/views/wms/productionManage/productrepair/productrepairRequestMain/productrepairRequestMain.data.ts +++ b/src/views/wms/productionManage/productrepair/productrepairRequestMain/productrepairRequestMain.data.ts @@ -1162,6 +1162,13 @@ export const BomDismantle = useCrudSchemas(reactive([ precision: 6 } }, + { + label: 'Bom版本', + field: 'bomVersion', + tableForm:{ + disabled: true + } + }, { label: '数量', field: 'qty', diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue index 8ce0b2ebd..cb4705de9 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue @@ -140,6 +140,7 @@ const bomModelVisible = ref(false) const tableListBom = ref() const lsBomSave = ref() const rowId = ref() +const detailQty = ref() const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ getListApi: BomDismantleApi.getProductscrapBomDismantlePage }) @@ -156,7 +157,7 @@ const buttonBaseClickBom = (val) => { // 根据 填写的数量 为基准 不填写数量的忽略 let flag = false; detatableDataBom.tableList.forEach((item) => { - if(item.qty!=0 && item.bomQty < item.qty){ + if(item.qty!=0 && (item.bomQty * detailQty.value < item.qty)){ flag = true; return; } @@ -165,7 +166,7 @@ const buttonBaseClickBom = (val) => { message.warning('数量需要小于Bom数量!') return } - tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && item.bomQty >= item.qty)) + tableListBom.value = detatableDataBom.tableList.filter(item => (item.qty!=0 && (item.bomQty * detailQty.value >= item.qty))) if (lsBomSave.value) { tableData.value.forEach((item, index) => { if(tableListBom.value[0].rowId == index) { @@ -193,10 +194,12 @@ const buttonOperationClick = async (row, label, index)=> { return } detatableDataBom.params.itemCode = row.itemCode + detatableDataBom.params.bomVersion = row.bomVersion DialogTitle.value = '物品代码:【' + row.itemCode + '】 Bom 信息' + detailQty.value = row.qty bomModelVisible.value = true await getDetailListBom() - detatableDataBom.tableList.map(item => { + detatableDataBom.tableList.forEach(item => { item.rowId = index if(tableData.value[index].childList) { tableData.value[index].childList.forEach(itemChild => { @@ -204,6 +207,8 @@ const buttonOperationClick = async (row, label, index)=> { item.qty = itemChild.qty } }) + }else { + item.qty = item.bomQty * row.qty } }) } @@ -219,6 +224,7 @@ const tableFormButton = async (val , row) => { masterId: row.id } rowId.value = row.id + detailQty.value = row.qty await getDetailListBom() } } @@ -242,7 +248,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['processCode'] = val[0]['code'] }else if(formField == 'itemCode'){ row['itemCode'] = val[0]['itemCode'] - + }else if(formField == 'bomVersion'){ + row['bomVersion'] = val[0]['version'] } } else { const setV = {} @@ -266,6 +273,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { setV['processCode'] = val[0]['code'] }else if(formField == 'itemCode'){ setV['itemCode'] = val[0]['itemCode'] + }else if(formField == 'bomVersion'){ + setV['bomVersion'] = val[0]['version'] } formRef.setValues(setV) }) @@ -432,6 +441,11 @@ const openForm =async (type: string, row?: number) => { tableData.value = [] // 重置明细数据 detatableDataBom.params = []; // 重置Bom请求参数 lsBomSave.value = true + mainStatus.value = '1' + ButttondataBom.value = [ + defaultButtons.formSaveBtn({ hide : mainStatus.value != 1 }), // 保存 + defaultButtons.formCloseBtn(null) // 关闭 + ] formRef.value.open(type, row) } diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts b/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts index 3ddedcefb..7a4f788a9 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts @@ -36,6 +36,8 @@ import {Process} from "@/views/wms/basicDataManage/factoryModeling/process/proce import * as ProcessApi from "@/api/wms/process"; import * as ProductionlineitemApi from '@/api/wms/productionlineitem' import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data' +import {Bom} from "@/views/wms/basicDataManage/itemManage/bom/bom.data"; +import * as BomApi from "@/api/wms/bom"; const userStore = useUserStore() const userDept = userStore.userSelfInfo.dept @@ -908,6 +910,51 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive([ isTableForm: false, isForm: false }, + { + label: 'Bom版本', + field: 'bomVersion', + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择Bom版本', // 输入框占位文本 + searchField: 'version', // 查询弹窗赋值字段 + searchTitle: '物料清单信息', // 查询弹窗标题 + searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类 + searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key:'productItemCode', + value:'itemCode', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择Bom版本', // 输入框占位文本 + searchField: 'version', // 查询弹窗赋值字段 + searchTitle: '物料清单信息', // 查询弹窗标题 + searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类 + searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key:'productItemCode', + value:'itemCode', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + }, + }, { label: '操作', field: 'action', @@ -977,6 +1024,13 @@ export const ProdcutscrapBomDismantle = useCrudSchemas(reactive([ precision: 6 } }, + { + label: 'Bom版本', + field: 'bomVersion', + tableForm:{ + disabled: true + } + }, { label: '数量', field: 'qty',