diff --git a/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue b/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue index db22cb30d..dd394b284 100644 --- a/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue @@ -324,7 +324,13 @@ const onChange = (field, value)=>{ const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { const setV = {} - setV[formField] = val[0][searchField] + if(formField == 'outAreaCodes'||formField == 'inAreaCodes'){ + //出库库区范围 入库库区范围 + setV[formField] = val.map(item=>(item[searchField])).join(',') + + }else{ + setV[formField] = val[0][searchField] + } formRef.setValues(setV) }) } diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue index 6f4d808c1..310ab5d88 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue @@ -97,6 +97,8 @@ @searchTableSuccess="searchTableBomSuccess" :footButttondata="footButttondata" @footButtonClick="buttonBaseClickBom" + @inputNumberChange="inputNumberChange" + /> @@ -229,13 +231,18 @@ const banchBomPage = async (fromLocationCode,item) => { } // 新增 tableform 按钮 -const buttonOperationClick = async (row, label, index)=> { +const buttonOperationClick = async (row, label, index,isSave = false)=> { + console.log('buttonOperationClick',row, label, index) if (row.itemCode == '') { - message.warning('请选择物料代码!') + if(!isSave){ + message.warning('请选择物料代码!') + } return } if(row.qty <= 0){ - message.warning('数量需要大于0!') + if(!isSave){ + message.warning('数量需要大于0!') + } return } detatableDataBom.params.itemCode = row.itemCode @@ -244,7 +251,7 @@ const buttonOperationClick = async (row, label, index)=> { bomModelVisible.value = true await getDetailListBom() console.log(row.fromLocationCode); - detatableDataBom.tableList.forEach(async item => { + detatableDataBom.tableList.forEach(async (item) => { console.log(333,item) ProdcutscrapBomScrap.allSchemas.tableFormColumns.map((bomItem) => { if (bomItem.field == 'batch') { @@ -277,7 +284,11 @@ const buttonOperationClick = async (row, label, index)=> { const obj = await banchBomPage(row.fromLocationCode, item) item.batch = obj.batch }) - detailBomRef.value.open('create', row, null,'viewDetail')//查看明细数据 + if(isSave){ + buttonBaseClickBom('save') + }else{ + detailBomRef.value.open('create', row, null,'viewDetail')//查看明细数据 + } } // 查询页面返回 @@ -358,10 +369,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => console.log(res) if(res?.list?.length>0){ row['bomVersion'] = res.list[0].version + buttonOperationClick(row,'Bom',tableData.value.indexOf(row),true) } }) }else if(formField == 'bomVersion'){ row['bomVersion'] = val[0]['version'] + buttonOperationClick(row,'Bom',tableData.value.indexOf(row),true) + } else { row[formField] = val[0][searchField] } @@ -699,12 +713,14 @@ const submitForm = async (formType, submitData) => { if(data.masterId){ data.id = data.masterId } + + console.log('tableData.value',tableData.value) data.subList = tableData.value // 拼接子表数据参数 // 判断 bom 是否添加 let childListRs = true // 根据 填写的数量 为基准 不填写数量的忽略 tableData.value.forEach((item) => { - if (!item.childList) { + if (!item.childList||item.childList.length==0) { childListRs = false } item.productionLineCode = data.productionLineCode @@ -763,6 +779,9 @@ const inputNumberChange = (field, index, row, val) => { if(field == 'qty' || field == 'singlePrice'){ row.amount = row.qty * row.singlePrice } + if(field == 'qty'){ + buttonOperationClick(row,'Bom',index,true) + } } const qtyOnChange = (field,val) =>{ diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts b/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts index bb03638d1..ea7e4fc5b 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts @@ -925,6 +925,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive([ }, tableForm: { type: 'InputNumber', + default:1, min: 0, precision: 6 } @@ -1243,6 +1244,14 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive([ } }, ])) +function validateQty(rule, value, callback) { + if (value>0) { + callback() + }else{ + callback(new Error('数量必须大于0')) + } +} + //表单校验 export const ProductscrapRequestDetailRules = reactive({ @@ -1252,6 +1261,9 @@ export const ProductscrapRequestDetailRules = reactive({ workStationCode: [ { required: true, message: '请选择工位代码', trigger: 'change' } ], + qty:[ + { validator:validateQty, message: '数量必须大于0', trigger: 'blur'} + ], // processCode: [ // { required: true, message: '请选择工序代码', trigger: 'change' } // ], @@ -1438,5 +1450,5 @@ export const ProdcutscrapBomScrap = useCrudSchemas(reactive([ //表单校验 export const ProdcutscrapBomScrapRules = reactive({ - + })