|
|
@ -59,7 +59,6 @@ |
|
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
|
@tableFormSelectOnBlur="tableFormSelectOnBlur" |
|
|
|
> |
|
|
|
</BasicForm> |
|
|
@ -76,7 +75,6 @@ |
|
|
|
:Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
:detailValidate="detailValidate" |
|
|
|
|
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
@onBlur="onBlur" |
|
|
|
/> |
|
|
@ -162,6 +160,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
}) |
|
|
|
} |
|
|
|
const handleDetailSubmitForm = async (formType, data) => { |
|
|
|
if(data.qty > data.inventoryQty){ |
|
|
|
message.warning("换货数量不能大于库存数量") |
|
|
|
return |
|
|
|
} |
|
|
|
if (formType === 'create') { |
|
|
|
await PurchaseBarterRequestDetailApi.createPurchaseBarterRequestDetail(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -171,7 +173,7 @@ const handleDetailSubmitForm = async (formType, data) => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
detailRef.value.submitUpdateList() |
|
|
|
|
|
|
|
getList() |
|
|
|
} |
|
|
|
// 查询页面返回——详情 |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
@ -181,9 +183,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
if(formField == 'itemCode'){ |
|
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
|
setV['itemName'] = val[0]['itemName'] |
|
|
|
setV['uom'] = val[0]['supplierUom'] |
|
|
|
setV['packUnit'] = val[0]['packUnit'] |
|
|
|
setV['batch'] = formatTime(new Date(), 'yyyyMMdd') |
|
|
|
setV['uom'] = val[0]['uom'] |
|
|
|
setV['batch'] = val[0]['batch'] |
|
|
|
setV['location'] = val[0]['batch'] |
|
|
|
setV['inventoryQty'] = val[0]['qty'] |
|
|
|
setV['locationCode'] = val[0]['locationCode'] |
|
|
|
setV['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
@ -490,6 +495,10 @@ const submitForm = async (formType, submitData) => { |
|
|
|
data.id = data.masterId |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
const cmdExists = data.subList.some(filter => |
|
|
|
parseFloat(filter.inventoryQty) < parseFloat(filter.qty) |
|
|
|
); |
|
|
|
|
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
if(data.subList.length == 0){ |
|
|
@ -507,6 +516,10 @@ const submitForm = async (formType, submitData) => { |
|
|
|
if(flag){ |
|
|
|
return |
|
|
|
} |
|
|
|
if(cmdExists){ |
|
|
|
message.warning("换货数量不能大于库存数量") |
|
|
|
return |
|
|
|
} |
|
|
|
formRef.value.formLoading = true |
|
|
|
await PurchaseBarterRequestMainApi.createPurchaseBarterRequestMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
@ -566,14 +579,6 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
// 创建标签 |
|
|
|
const inputNumberChange = (field, index, row, val) => { |
|
|
|
if(field == 'qty' || field == 'singlePrice'){ |
|
|
|
row.amount = row.qty * row.singlePrice |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let validityDays = 0 |
|
|
|
const detailOpenForm = (type, row)=>{ |
|
|
|
console.log('detailOpenForm',row) |
|
|
@ -607,7 +612,6 @@ const tableFormSelectOnBlur = (field, val, row, index) => { |
|
|
|
tableData.value[index][field] = val.target.value |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|