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