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. 12
      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) => {
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)
})
}

31
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) =>{

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

@ -925,6 +925,7 @@ export const ProductscrapRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
},
tableForm: {
type: 'InputNumber',
default:1,
min: 0,
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({
@ -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' }
// ],

Loading…
Cancel
Save