Browse Source

HL-5862供应商开票时可以修改开票数量

hella_online_20240913
yufei_wang 2 months ago
parent
commit
42cdd144c2
  1. 2
      src/components/Detail/src/Detail.vue
  2. 66
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

2
src/components/Detail/src/Detail.vue

@ -1099,7 +1099,7 @@ const openImage=(item)=>{
* @param cur 改变后值 * @param cur 改变后值
*/ */
const detailBasicFormOnChange = (field, cur) => { const detailBasicFormOnChange = (field, cur) => {
emit('detailBasicFormOnChange', field, cur,detailData.value) emit('detailBasicFormOnChange', field, cur)
} }
/** /**

66
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -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 {

Loading…
Cancel
Save