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 改变后值
*/
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"
/>
<!-- 详情 -->
<!-- :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 {

Loading…
Cancel
Save