|
|
@ -231,6 +231,7 @@ |
|
|
|
@success="submitPurchasePass" |
|
|
|
/> |
|
|
|
<!-- 详情 --> |
|
|
|
<!-- :apiUpdate="SupplierinvoiceRequestDetailApi.updateSupplierinvoiceRequestDetail" --> |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
@ -301,7 +302,6 @@ |
|
|
|
:detailAllSchemasRules="SupplierinvoiceRequestDetailRules" |
|
|
|
:searchTableParams="searchTableParams" |
|
|
|
:apiCreate="SupplierinvoiceRequestDetailApi.createSupplierinvoiceRequestDetail" |
|
|
|
:apiUpdate="SupplierinvoiceRequestDetailApi.updateSupplierinvoiceRequestDetail" |
|
|
|
:apiPage="SupplierinvoiceRequestDetailApi.getSupplierinvoiceRequestDetailPage" |
|
|
|
:apiDelete="SupplierinvoiceRequestDetailApi.deleteSupplierinvoiceRequestDetail" |
|
|
|
:Echo="Echo" |
|
|
@ -314,7 +314,9 @@ |
|
|
|
:mainSubmitCreateApi="true" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
@handleMainFefresh="handleMainFefresh" |
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
@detailBasicFormOnChange="detailBasicFormOnChange" |
|
|
|
@handleSubmitForm="handleDetailSubmitForm" |
|
|
|
> |
|
|
|
<!-- 价税合计尾差 --> |
|
|
|
<template #Descriptions_totalTaxDiffAmount="{ row }"> |
|
|
@ -456,23 +458,47 @@ const searchTableSuccessDetail = async ( |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
const detailBasicFormOnChange = (field, cur, detailData) => { |
|
|
|
console.log('detailBasicFormOnChange',field, cur, detailData) |
|
|
|
|
|
|
|
const detailData = ref() |
|
|
|
const detailOpenForm = (type, row)=>{ |
|
|
|
detailData.value = row |
|
|
|
} |
|
|
|
const detailBasicFormOnChange = (field, cur) => { |
|
|
|
console.log('detailBasicFormOnChange',field, cur) |
|
|
|
if (field == 'invoicableQuantity') { |
|
|
|
// 负数:默认默认开票数~0 |
|
|
|
// 正数:0~默认开票数 |
|
|
|
if(detailData.maxInvoicableQuantity){ |
|
|
|
if(detailData.maxInvoicableQuantity>0){ |
|
|
|
if(cur<0||cur>detailData.maxInvoicableQuantity){ |
|
|
|
message.error(t('ts.可开票数量范围是')+`:0~${detailData.maxInvoicableQuantity}`) |
|
|
|
if(detailData.value.maxInvoicableQuantity){ |
|
|
|
if(detailData.value.maxInvoicableQuantity>0){ |
|
|
|
if(cur<0||cur>detailData.value.maxInvoicableQuantity){ |
|
|
|
message.error(t('ts.可开票数量范围是')+`:0~${detailData.value.maxInvoicableQuantity}`) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(cur>0||cur<detailData.maxInvoicableQuantity){ |
|
|
|
message.error(t('ts.可开票数量范围是')+`:${detailData.maxInvoicableQuantity}~0`) |
|
|
|
if(cur>0||cur<detailData.value.maxInvoicableQuantity){ |
|
|
|
message.error(t('ts.可开票数量范围是')+`:${detailData.value.maxInvoicableQuantity}~0`) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const handleDetailSubmitForm = async (formType, data) => { |
|
|
|
if (formType === 'update') { |
|
|
|
console.log('handleDetailSubmitForm',data) |
|
|
|
if(data.maxInvoicableQuantity>0){ |
|
|
|
if(data.invoicableQuantity<0||data.invoicableQuantity>data.maxInvoicableQuantity){ |
|
|
|
message.error(t('ts.可开票数量范围是')+`:0~${data.maxInvoicableQuantity}`) |
|
|
|
return |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(data.invoicableQuantity>0||data.invoicableQuantity<data.maxInvoicableQuantity){ |
|
|
|
message.error(t('ts.可开票数量范围是')+`:${data.maxInvoicableQuantity}~0`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
await SupplierinvoiceRequestDetailApi.updateSupplierinvoiceRequestDetail(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
detailRef.value.submitUpdateList() |
|
|
|
} |
|
|
|
const inputNumberChange = (field, index, row, val) => { |
|
|
|
if (field == 'invoicableQuantity') { |
|
|
@ -1338,12 +1364,34 @@ const sumFormDataHandle = async ( |
|
|
|
} |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, submitData) => { |
|
|
|
console.log('submitForm',tableData.value) |
|
|
|
let data = { ...submitData } |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
item.differencePrice = Number( |
|
|
|
(Number(item?.singlePrice) - Number(item?.purchasePrice)).toFixed(5) |
|
|
|
) |
|
|
|
}) |
|
|
|
let flagInvoicableQuantity = false |
|
|
|
tableData.value.forEach(item => { |
|
|
|
// 负数:默认默认开票数~0 |
|
|
|
// 正数:0~默认开票数 |
|
|
|
if(item.maxInvoicableQuantity){ |
|
|
|
if(item.maxInvoicableQuantity>0){ |
|
|
|
if(item.invoicableQuantity<0||item.invoicableQuantity>item.maxInvoicableQuantity){ |
|
|
|
flagInvoicableQuantity = true |
|
|
|
message.error(`${item.itemCode}`+t('ts.可开票数量范围是')+`:0~${item.maxInvoicableQuantity}`) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if(item.invoicableQuantity>0||item.invoicableQuantity<item.maxInvoicableQuantity){ |
|
|
|
flagInvoicableQuantity = true |
|
|
|
message.error(`${item.itemCode}`+t('ts.可开票数量范围是')+`:${item.maxInvoicableQuantity}~0`) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
if(flagInvoicableQuantity){ |
|
|
|
return |
|
|
|
} |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
console.log('data', data) |
|
|
|
try { |
|
|
|