|
|
@ -175,6 +175,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
row['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
row['qty'] = val[0]['qty'] |
|
|
|
// 如果有批次 赋值库存余额批次 无批次 赋值 000000 |
|
|
|
if (val[0]['batch'] !== '') { |
|
|
|
row['batch'] = val[0]['batch'] |
|
|
|
} else { |
|
|
|
row['batch'] = '000000' |
|
|
|
} |
|
|
|
// 修改 tableform 属性 数量最大值设置为库存余额中数量 |
|
|
|
// TODO: tableFormColumns 修改属性目前只限于整个列 并不满足行要求 例如: 第一条数据最大10 第二条数据最大20 那么第一条数据会变成最大20限制 |
|
|
|
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
@ -186,6 +192,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
} else if(formField == 'workStationCode') { |
|
|
|
row['workStationCode'] = val[0]['code'] |
|
|
|
row['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
|
} else if(formField == 'packUnit') { |
|
|
|
row['packUnit'] = val[0]['packUnit'] |
|
|
|
row['packQty'] = val[0]['packQty'] |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
@ -210,6 +219,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
setV['uom'] = val[0]['uom'] |
|
|
|
setV['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
setV['qty'] = val[0]['qty'] |
|
|
|
// 如果有批次 赋值库存余额批次 无批次 赋值 000000 |
|
|
|
if (val[0]['batch'] !== '') { |
|
|
|
setV['batch'] = val[0]['batch'] |
|
|
|
} else { |
|
|
|
setV['batch'] = '000000' |
|
|
|
} |
|
|
|
// 修改 tableform 属性 数量最大值设置为库存余额中数量 |
|
|
|
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'qty' && val[0]['qty'] > 0) { |
|
|
@ -220,6 +235,9 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
} else if(formField == 'workStationCode') { |
|
|
|
setV['workStationCode'] = val[0]['code'] |
|
|
|
setV['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
|
} else if(formField == 'packUnit') { |
|
|
|
setV['packUnit'] = val[0]['packUnit'] |
|
|
|
setV['packQty'] = val[0]['packQty'] |
|
|
|
} else { |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
} |
|
|
@ -381,7 +399,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
// dialogVisible.value = true |
|
|
|
formLabelRef.value.open('create', row) |
|
|
|
detatableData.tableList.map((item) => { |
|
|
|
item.batch = '000000' |
|
|
|
// item.batch = '000000' |
|
|
|
// 查询物料类型 原料 只能选择 供应商代码 半成品成品其他 只能选择 生产线 |
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
pageSize: 10, |
|
|
@ -498,7 +516,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
/** 详情操作——子表表单 */ |
|
|
|
const detailOpenForm = (type, row) => { |
|
|
|
nextTick(()=>{ |
|
|
|
detailRef.value.formRef.formRef.formModel.batch = '000000' |
|
|
|
// detailRef.value.formRef.formRef.formModel.batch = '000000' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@ -545,7 +563,7 @@ const tableData = ref([]) |
|
|
|
// 添加明细 |
|
|
|
const handleAddTable = () => { |
|
|
|
let tfk = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
|
tfk.batch = '000000' |
|
|
|
// tfk.batch = '000000' |
|
|
|
tableData.value.push(tfk) |
|
|
|
} |
|
|
|
// 删除明细 |
|
|
@ -556,6 +574,17 @@ const handleDeleteTable = (item, index) => { |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
let isZC = true // 数量和标包数量 是否整除 |
|
|
|
data.subList.forEach(item => { |
|
|
|
if (item.qty % item.packQty !== 0) { |
|
|
|
isZC = false |
|
|
|
} |
|
|
|
}) |
|
|
|
if(!isZC) { |
|
|
|
formRef.value.formLoading = false |
|
|
|
await message.confirm('含有不整箱情况,是否继续?') |
|
|
|
formRef.value.formLoading = true |
|
|
|
} |
|
|
|
// 合格退料 添加参数 isOK |
|
|
|
data.isOK = true |
|
|
|
try { |
|
|
@ -583,6 +612,7 @@ const submitForm = async (formType, data) => { |
|
|
|
const submitFormLabel = async (formType, data) => { |
|
|
|
try { |
|
|
|
detatableData.tableList.forEach(async (item) => { |
|
|
|
item.toLocationCode = item.fromLocationCode |
|
|
|
await PackageApi.createPackageLabel(item).then(() => { |
|
|
|
isCreateLabel.value = true |
|
|
|
message.success('创建标签成功') |
|
|
|