|
@ -53,18 +53,32 @@ |
|
|
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
|
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
|
:tableFormRules="SupplierinvoiceRequestDetailRules" |
|
|
:tableFormRules="SupplierinvoiceRequestDetailRules" |
|
|
:tableData="tableData" |
|
|
:tableData="tableData" |
|
|
:sumFormDataByForm ="(formRef,formModel,tableData,formType,originFormModel,updateOriginFormModel)=>{ |
|
|
:sumFormDataByForm ="(formRef,formModel,tableData,formType,originFormModel,updateOriginFormModel,sumFormDataHandle1)=>{ |
|
|
const {taxRate=0,amount=0,taxAmount=0,beforeTaxAmount=0,totalTaxAmount=0,discountAmount1=0,beforeTaxDiffAmount=0,taxAmountDiff=0} = formModel |
|
|
const {taxRate=0,amount=0,taxAmount=0,beforeTaxAmount=0,totalTaxAmount=0,discountAmount1=0,beforeTaxDiffAmount=0,taxAmountDiff=0} = formModel |
|
|
// 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 |
|
|
// 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 |
|
|
let taxAmount_ = 0.00 |
|
|
|
|
|
if(formType=='update'){ // 编辑 |
|
|
if(formType=='update'){ // 编辑 |
|
|
taxAmount_ = taxAmount |
|
|
console.log('taxRate',taxRate) |
|
|
|
|
|
console.log('originFormModel',originFormModel.taxRate) |
|
|
|
|
|
console.log('taxAmount',taxAmount) |
|
|
|
|
|
if(taxRate!=originFormModel.taxRate){ |
|
|
|
|
|
if(originFormModel){ |
|
|
|
|
|
sumFormDataHandle1() |
|
|
|
|
|
} |
|
|
|
|
|
updateOriginFormModel(formModel) |
|
|
|
|
|
} |
|
|
|
|
|
formRef.value.setValues({ |
|
|
|
|
|
afterTaxAmount:amount+taxAmount, // 3、系统价税合计:系统未税金额+系统税额 |
|
|
|
|
|
adTaxAmount:beforeTaxAmount+totalTaxAmount, //6、价税合计金额:未税金额+税额 |
|
|
|
|
|
beforeTaxDiffAmount:beforeTaxAmount-amount-discountAmount1,//未税差额:未税金额-系统未税金额-折扣金额 |
|
|
|
|
|
taxAmountDiff:totalTaxAmount-taxAmount,// 税额差异:税额-系统税额 |
|
|
|
|
|
totalTaxDiffAmount:beforeTaxDiffAmount+taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
|
|
|
}) |
|
|
}else if(formType=='create'){ // 新增 |
|
|
}else if(formType=='create'){ // 新增 |
|
|
|
|
|
let taxAmount_ = taxAmount |
|
|
if(taxRate!=originFormModel.taxRate){ |
|
|
if(taxRate!=originFormModel.taxRate){ |
|
|
taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) |
|
|
taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) |
|
|
updateOriginFormModel(formModel) |
|
|
updateOriginFormModel(formModel) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
formRef.value.setValues({ |
|
|
formRef.value.setValues({ |
|
|
taxAmount:taxAmount_, |
|
|
taxAmount:taxAmount_, |
|
|
afterTaxAmount:amount+taxAmount, // 3、系统价税合计:系统未税金额+系统税额 |
|
|
afterTaxAmount:amount+taxAmount, // 3、系统价税合计:系统未税金额+系统税额 |
|
@ -73,6 +87,8 @@ |
|
|
taxAmountDiff:totalTaxAmount-taxAmount,// 税额差异:税额-系统税额 |
|
|
taxAmountDiff:totalTaxAmount-taxAmount,// 税额差异:税额-系统税额 |
|
|
totalTaxDiffAmount:beforeTaxDiffAmount+taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
totalTaxDiffAmount:beforeTaxDiffAmount+taxAmountDiff // 价税合计差额=未税差额+税额差异 |
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}" |
|
|
}" |
|
|
|
|
|
|
|
|
:sumFormDataByTableCustom ="(formRef,formModel,tableData)=>{ |
|
|
:sumFormDataByTableCustom ="(formRef,formModel,tableData)=>{ |
|
@ -92,6 +108,7 @@ |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
|
|
|
@sumFormDataHandle="sumFormDataHandle" |
|
|
> |
|
|
> |
|
|
<!-- <template #foorter> |
|
|
<!-- <template #foorter> |
|
|
<div style="text-align: left"> |
|
|
<div style="text-align: left"> |
|
@ -185,6 +202,7 @@ |
|
|
@tableFormButton="tableFormButton" |
|
|
@tableFormButton="tableFormButton" |
|
|
:mainSubmitCreateApi="true" |
|
|
:mainSubmitCreateApi="true" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
@handleMainFefresh="handleMainFefresh" |
|
|
> |
|
|
> |
|
|
<template #differencePrice="{row}"> |
|
|
<template #differencePrice="{row}"> |
|
|
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span> |
|
|
<span :class="{'red-text':row.differencePrice!=0}">{{ row.differencePrice }}</span> |
|
@ -204,6 +222,7 @@ |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
|
|
|
import dayjs from 'dayjs' |
|
|
// 供应商发票申请 |
|
|
// 供应商发票申请 |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
@ -267,6 +286,9 @@ const getSelectionRows = (currentPage,currentPageSelectionRows) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const handleMainFefresh = ()=>{ |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const searchTableSuccessDetail = async (formField, searchField, val, formRef,searchTableFormModel)=>{ |
|
|
const searchTableSuccessDetail = async (formField, searchField, val, formRef,searchTableFormModel)=>{ |
|
|
console.log('详情',formField, searchField, val, formRef,searchTableFormModel) |
|
|
console.log('详情',formField, searchField, val, formRef,searchTableFormModel) |
|
@ -279,6 +301,7 @@ const searchTableSuccessDetail = async (formField, searchField, val, formRef,sea |
|
|
subList:val |
|
|
subList:val |
|
|
}) |
|
|
}) |
|
|
detailRef.value.updateList() |
|
|
detailRef.value.updateList() |
|
|
|
|
|
getList() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// const basicFormFooter = computed(()=>{ |
|
|
// const basicFormFooter = computed(()=>{ |
|
@ -754,6 +777,7 @@ const handleImport = () => { |
|
|
/** 审批通过按钮操作 finance_mainPlanSub */ |
|
|
/** 审批通过按钮操作 finance_mainPlanSub */ |
|
|
const formFinanceRef = ref() |
|
|
const formFinanceRef = ref() |
|
|
const handleFinanceApp = async (row) => { |
|
|
const handleFinanceApp = async (row) => { |
|
|
|
|
|
row.postingDate = dayjs().valueOf() |
|
|
formFinanceRef.value.open('update', row,null,'财务通过','财务通过') |
|
|
formFinanceRef.value.open('update', row,null,'财务通过','财务通过') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -941,6 +965,17 @@ const handleImport = () => { |
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const sumFormDataHandle = async (formRef1,formModel,tableData,formType,originFormModel,updateOriginFormModel)=>{ |
|
|
|
|
|
if(formType=='update'){ |
|
|
|
|
|
if(formModel&&formModel.id&&formModel.taxRate&&originFormModel){ |
|
|
|
|
|
let res = await SupplierinvoiceRequestMainApi.getTaxAmount({id:formModel.id,taxRate:formModel.taxRate}) |
|
|
|
|
|
console.log('更新taxAmount',res) |
|
|
|
|
|
formRef1.value.setValues({ |
|
|
|
|
|
taxAmount:res |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, submitData) => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
let data = {...submitData} |
|
|
let data = {...submitData} |
|
|