Browse Source

长春海拉测试环境WMS制品子件报废申请Boom中批次和数量不应该可编辑,且保存申请时去掉校验必须点Boom中的保存

hella_online_20240829
wangyufei 2 months ago
parent
commit
4b92c53cb2
  1. 8
      src/views/wms/basicDataManage/documentSetting/businesstype/index.vue
  2. 31
      src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue
  3. 14
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

8
src/views/wms/basicDataManage/documentSetting/businesstype/index.vue

@ -324,7 +324,13 @@ const onChange = (field, value)=>{
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} 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) formRef.setValues(setV)
}) })
} }

31
src/views/wms/productionManage/productscrap/productscrapRequestMain/index.vue

@ -97,6 +97,8 @@
@searchTableSuccess="searchTableBomSuccess" @searchTableSuccess="searchTableBomSuccess"
:footButttondata="footButttondata" :footButttondata="footButttondata"
@footButtonClick="buttonBaseClickBom" @footButtonClick="buttonBaseClickBom"
@inputNumberChange="inputNumberChange"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -229,13 +231,18 @@ const banchBomPage = async (fromLocationCode,item) => {
} }
// tableform // tableform
const buttonOperationClick = async (row, label, index)=> { const buttonOperationClick = async (row, label, index,isSave = false)=> {
console.log('buttonOperationClick',row, label, index)
if (row.itemCode == '') { if (row.itemCode == '') {
message.warning('请选择物料代码!') if(!isSave){
message.warning('请选择物料代码!')
}
return return
} }
if(row.qty <= 0){ if(row.qty <= 0){
message.warning('数量需要大于0!') if(!isSave){
message.warning('数量需要大于0!')
}
return return
} }
detatableDataBom.params.itemCode = row.itemCode detatableDataBom.params.itemCode = row.itemCode
@ -244,7 +251,7 @@ const buttonOperationClick = async (row, label, index)=> {
bomModelVisible.value = true bomModelVisible.value = true
await getDetailListBom() await getDetailListBom()
console.log(row.fromLocationCode); console.log(row.fromLocationCode);
detatableDataBom.tableList.forEach(async item => { detatableDataBom.tableList.forEach(async (item) => {
console.log(333,item) console.log(333,item)
ProdcutscrapBomScrap.allSchemas.tableFormColumns.map((bomItem) => { ProdcutscrapBomScrap.allSchemas.tableFormColumns.map((bomItem) => {
if (bomItem.field == 'batch') { if (bomItem.field == 'batch') {
@ -277,7 +284,11 @@ const buttonOperationClick = async (row, label, index)=> {
const obj = await banchBomPage(row.fromLocationCode, item) const obj = await banchBomPage(row.fromLocationCode, item)
item.batch = obj.batch 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) console.log(res)
if(res?.list?.length>0){ if(res?.list?.length>0){
row['bomVersion'] = res.list[0].version row['bomVersion'] = res.list[0].version
buttonOperationClick(row,'Bom',tableData.value.indexOf(row),true)
} }
}) })
}else if(formField == 'bomVersion'){ }else if(formField == 'bomVersion'){
row['bomVersion'] = val[0]['version'] row['bomVersion'] = val[0]['version']
buttonOperationClick(row,'Bom',tableData.value.indexOf(row),true)
} else { } else {
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
} }
@ -699,12 +713,14 @@ const submitForm = async (formType, submitData) => {
if(data.masterId){ if(data.masterId){
data.id = data.masterId data.id = data.masterId
} }
console.log('tableData.value',tableData.value)
data.subList = tableData.value // data.subList = tableData.value //
// bom // bom
let childListRs = true let childListRs = true
// //
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
if (!item.childList) { if (!item.childList||item.childList.length==0) {
childListRs = false childListRs = false
} }
item.productionLineCode = data.productionLineCode item.productionLineCode = data.productionLineCode
@ -763,6 +779,9 @@ const inputNumberChange = (field, index, row, val) => {
if(field == 'qty' || field == 'singlePrice'){ if(field == 'qty' || field == 'singlePrice'){
row.amount = row.qty * row.singlePrice row.amount = row.qty * row.singlePrice
} }
if(field == 'qty'){
buttonOperationClick(row,'Bom',index,true)
}
} }
const qtyOnChange = (field,val) =>{ const qtyOnChange = (field,val) =>{

14
src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

@ -925,6 +925,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
default:1,
min: 0, min: 0,
precision: 6 precision: 6
} }
@ -1243,6 +1244,14 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
])) ]))
function validateQty(rule, value, callback) {
if (value>0) {
callback()
}else{
callback(new Error('数量必须大于0'))
}
}
//表单校验 //表单校验
export const ProductscrapRequestDetailRules = reactive({ export const ProductscrapRequestDetailRules = reactive({
@ -1252,6 +1261,9 @@ export const ProductscrapRequestDetailRules = reactive({
workStationCode: [ workStationCode: [
{ required: true, message: '请选择工位代码', trigger: 'change' } { required: true, message: '请选择工位代码', trigger: 'change' }
], ],
qty:[
{ validator:validateQty, message: '数量必须大于0', trigger: 'blur'}
],
// processCode: [ // processCode: [
// { required: true, message: '请选择工序代码', trigger: 'change' } // { required: true, message: '请选择工序代码', trigger: 'change' }
// ], // ],
@ -1438,5 +1450,5 @@ export const ProdcutscrapBomScrap = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验 //表单校验
export const ProdcutscrapBomScrapRules = reactive({ export const ProdcutscrapBomScrapRules = reactive({
}) })

Loading…
Cancel
Save