Browse Source

供应商发票修改打印标签

intex_online20250311
叶佳兴 1 month ago
parent
commit
ba4bf18f27
  1. 235
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  2. 18
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

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

@ -88,7 +88,7 @@
beforeTaxDiffAmount = 0,
taxAmountDiff = 0,
rebateTax = 0,
claimAmount = 0,
claimAmount = 0
} = formModel
// 2X*2
if (formType == 'update') {
@ -109,8 +109,8 @@
beforeTaxDiffAmount: beforeTaxAmount - amount, //-
taxAmountDiff: totalTaxAmount - taxAmount, // -
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff, // =+
rebateTax:Number(Number(discountAmount1*taxRate*0.01).toFixed(2)),
rebateTotal:rebateTax+discountAmount1
rebateTax: Number(Number(discountAmount1 * taxRate * 0.01).toFixed(2)),
rebateTotal: rebateTax + discountAmount1
})
} else if (formType == 'create') {
//
@ -138,8 +138,8 @@
beforeTaxDiffAmount: beforeTaxAmount - amount, //-
taxAmountDiff: totalTaxAmount - taxAmount, // -
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff, // =+
rebateTax:Number(Number(discountAmount1*taxRate*0.01).toFixed(2)),
rebateTotal:rebateTax+discountAmount1
rebateTax: Number(Number(discountAmount1 * taxRate * 0.01).toFixed(2)),
rebateTotal: rebateTax + discountAmount1
})
}
}
@ -166,9 +166,11 @@
),
0
)
}
sumObject.invoiceAmountMain = (Number(sumObject.amount) -Number(formRef.value.formModel.claimAmount)).toFixed(2), // -
formRef.value.setValues(sumObject)
}
;(sumObject.invoiceAmountMain = (
Number(sumObject.amount) - Number(formRef.value.formModel.claimAmount)
).toFixed(2)), // -
formRef.value.setValues(sumObject)
}
"
:apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain"
@ -202,7 +204,7 @@
}}
</div>
</template>
<!-- <template #foorter>
<div style="text-align: left">
{{ basicFormFooter }}
@ -216,8 +218,17 @@
/>
</template>
<template #table>
<div >
<div style="padding-left: 10px;border-left: 6px solid #409eff;margin:10px 0px;font-size: 16px;font-weight: bold;">索赔明细</div>
<div>
<div
style="
padding-left: 10px;
border-left: 6px solid #409eff;
margin: 10px 0px;
font-size: 16px;
font-weight: bold;
"
>索赔明细</div
>
<!-- <Table
:columns="ClaimDetails.allSchemas.tableColumns"
:data="tableObject.tableList"
@ -231,11 +242,14 @@
style='width: calc(100% - 32px);'
/> -->
<div
style="border: 1px solid #dedede;
border-radius: 8px;
padding: 10px;
width: calc(100% - 32px);
display: flex;">
style="
border: 1px solid #dedede;
border-radius: 8px;
padding: 10px;
width: calc(100% - 32px);
display: flex;
"
>
<TableForm
ref="tableFormRef"
class="w-[100%]"
@ -245,8 +259,6 @@
:isShowReduceButton="false"
/>
</div>
</div>
</template>
</BasicForm>
@ -359,15 +371,24 @@
>
<!-- 价税合计尾差 -->
<template #Descriptions_totalTaxDiffAmount="{ row }">
<span>{{row['totalTaxDiffAmount']}}<span class="red-text"> (含返利合计:{{ row['rebateTotal'] }})</span></span>
<span
>{{ row['totalTaxDiffAmount']
}}<span class="red-text"> (含返利合计:{{ row['rebateTotal'] }})</span></span
>
</template>
<!-- 未税尾差 -->
<template #Descriptions_beforeTaxDiffAmount="{ row }">
<span>{{row['beforeTaxDiffAmount']}}<span class="red-text"> (含返利未税:{{ row['discountAmount1'] }})</span></span>
<span
>{{ row['beforeTaxDiffAmount']
}}<span class="red-text"> (含返利未税:{{ row['discountAmount1'] }})</span></span
>
</template>
<!-- 税额尾差 -->
<template #Descriptions_taxAmountDiff="{ row }">
<span>{{row['taxAmountDiff']}}<span class="red-text"> (含返利税额:{{ row['rebateTax'] }})</span></span>
<span
>{{ row['taxAmountDiff']
}}<span class="red-text"> (含返利税额:{{ row['rebateTax'] }})</span></span
>
</template>
<template #differencePrice="{ row }">
<span :class="{ 'red-text': row.differencePrice != 0 }">{{ row.differencePrice }}</span>
@ -501,24 +522,23 @@ const searchTableSuccessDetail = async (
// })
const detailData = ref()
const detailOpenForm = (type, row)=>{
const detailOpenForm = (type, row) => {
detailData.value = row
}
const detailBasicFormOnChange = (field, cur) => {
console.log('detailBasicFormOnChange',field, cur)
const detailBasicFormOnChange = (field, cur) => {
console.log('detailBasicFormOnChange', field, cur)
if (field == 'invoicableQuantity') {
// 0
// 0
if(detailData.value.maxInvoicableQuantity){
if(detailData.value.maxInvoicableQuantity>0){
if(cur<0||cur>detailData.value.maxInvoicableQuantity){
message.error(t('ts.可开票数量范围是')+`:0~${detailData.value.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.value.maxInvoicableQuantity){
message.error(t('ts.可开票数量范围是')+`:${detailData.value.maxInvoicableQuantity}~0`)
} else {
if (cur > 0 || cur < detailData.value.maxInvoicableQuantity) {
message.error(t('ts.可开票数量范围是') + `:${detailData.value.maxInvoicableQuantity}~0`)
}
}
}
@ -526,18 +546,18 @@ const detailBasicFormOnChange = (field, cur) => {
}
const handleDetailSubmitForm = async (formType, data) => {
if (formType === 'update') {
console.log('handleDetailSubmitForm',data)
if(data.invoicableQuantity==0){
console.log('handleDetailSubmitForm', data)
if (data.invoicableQuantity == 0) {
message.error(t('ts.可开票数量不能为0'))
return
}else if(data.maxInvoicableQuantity>0){
if(data.invoicableQuantity<0||data.invoicableQuantity>data.maxInvoicableQuantity){
message.error(t('ts.可开票数量范围是')+`:0~${data.maxInvoicableQuantity}`)
} else 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`)
} else {
if (data.invoicableQuantity > 0 || data.invoicableQuantity < data.maxInvoicableQuantity) {
message.error(t('ts.可开票数量范围是') + `:${data.maxInvoicableQuantity}~0`)
return
}
}
@ -550,22 +570,22 @@ const inputNumberChange = (field, index, row, val) => {
if (field == 'invoicableQuantity') {
// 0
// 0
console.log('inputNumberChange',field, index, row, val)
if(row.maxInvoicableQuantity>0){
if(row.invoicableQuantity<0||row.invoicableQuantity>row.maxInvoicableQuantity){
message.error(t('ts.可开票数量范围是')+`:0~${row.maxInvoicableQuantity}`)
console.log('inputNumberChange', field, index, row, val)
if (row.maxInvoicableQuantity > 0) {
if (row.invoicableQuantity < 0 || row.invoicableQuantity > row.maxInvoicableQuantity) {
message.error(t('ts.可开票数量范围是') + `:0~${row.maxInvoicableQuantity}`)
}
}else{
if(row.invoicableQuantity>0||row.invoicableQuantity<row.maxInvoicableQuantity){
message.error(t('ts.可开票数量范围是')+`:${row.maxInvoicableQuantity}~0`)
} else {
if (row.invoicableQuantity > 0 || row.invoicableQuantity < row.maxInvoicableQuantity) {
message.error(t('ts.可开票数量范围是') + `:${row.maxInvoicableQuantity}~0`)
}
}
handleAllocationPrice()
}
}
const onChange = (field, cur) => {
console.log('onChange',field)
if(field=='orderType'){
console.log('onChange', field)
if (field == 'orderType') {
tableData.value = []
}
}
@ -614,8 +634,8 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
handleAllocationPrice()
} else {
//
console.log(11,val[0][searchField])
console.log(11,searchFormRef.formModel.supplierCode)
console.log(11, val[0][searchField])
console.log(11, searchFormRef.formModel.supplierCode)
if (
formField == 'supplierCode' &&
val[0][searchField] != searchFormRef.formModel.supplierCode
@ -636,16 +656,15 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
})
}
//
const handleAllocationPrice = async ()=>{
const handleAllocationPrice = async () => {
let res = await SupplierinvoiceRequestDetailApi.handleAllocationPrice(tableData.value)
tableData.value.forEach(item=>{
let findItem = res.find(item1=>item1.id == item?.id)
if(findItem){
tableData.value.forEach((item) => {
let findItem = res.find((item1) => item1.id == item?.id)
if (findItem) {
item['allocationPrice'] = findItem['allocationPrice']
}
})
console.log('模具分摊单价',res)
console.log('模具分摊单价', res)
}
const Echo = []
@ -797,7 +816,7 @@ const butttondata = (row, $index) => {
{
label: t('ts.打印'),
name: 'mian_print',
hide: !(roleList.value.indexOf('financial_accounting') > -1 && row.status == 5),
hide: !(row.goldenTaxInvoiceNumber != null && row.goldenTaxInvoiceNumber != ''),
type: 'primary',
color: '',
link: true, //
@ -929,7 +948,7 @@ const openForm = async (type: string, row?: any) => {
}
}
})
await claimDetailsForUpdate(row.supplierCode,row.id)
await claimDetailsForUpdate(row.supplierCode, row.id)
} else {
//
SupplierinvoiceRequestMain.allSchemas.formSchema.forEach((item) => {
@ -939,8 +958,8 @@ const openForm = async (type: string, row?: any) => {
item.value = defaultSupplierCode.value
item.componentProps.isSearchList = true
item.componentProps.disabled = false
claimDetailsList.value = [];
claimDetails(item.value);
claimDetailsList.value = []
claimDetails(item.value)
}
//
if (item.field == 'orderType') {
@ -989,13 +1008,21 @@ const openForm = async (type: string, row?: any) => {
//
const claimDetailsList = ref([])
const claimDetails = async (supplierCode) => {
claimDetailsList.value = await PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailList(supplierCode)
formRef.value.formRef.formModel.claimAmount = claimDetailsList.value.map(item => item.claimAmount).reduce((prev, item) => prev + item).toFixed(5)
formRef.value.formRef.formModel.invoiceAmountMain = (Number(formRef.value.formRef.formModel.amount) -Number(formRef.value.formModel.claimAmount)).toFixed(2) // -
claimDetailsList.value = await PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailList(
supplierCode
)
formRef.value.formRef.formModel.claimAmount = claimDetailsList.value
.map((item) => item.claimAmount)
.reduce((prev, item) => prev + item)
.toFixed(5)
formRef.value.formRef.formModel.invoiceAmountMain = (
Number(formRef.value.formRef.formModel.amount) - Number(formRef.value.formModel.claimAmount)
).toFixed(2) // -
}
//
const claimDetailsForUpdate = async (supplierCode,id) => {
claimDetailsList.value = await PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailListForUpdate(supplierCode,id)
//
const claimDetailsForUpdate = async (supplierCode, id) => {
claimDetailsList.value =
await PurchaseClaimRequestDetailApi.getPurchaseClaimRequestDetailListForUpdate(supplierCode, id)
}
//
const checkInvoicingCalendar = async () => {
@ -1016,7 +1043,6 @@ const getDefaultSupplier = async () => {
console.log('defaultSupplierCode', defaultSupplierCode)
}
//
const { wsCache } = useCache()
/** 详情操作 */
@ -1029,7 +1055,7 @@ const detailAnnexTable = ref([
tableName: 'contract',
hiddenDelete: false,
showPreview: true,
showDownload:true,
showDownload: true,
hiddenUpload: false,
fileSize: 20
},
@ -1040,11 +1066,11 @@ const detailAnnexTable = ref([
hiddenDelete: false,
hiddenUpload: false,
showPreview: true,
showDownload:true,
showDownload: true,
fileSize: 20,
maxLength:1,
limit:1,
fileType:['pdf','ofd']
maxLength: 1,
limit: 1,
fileType: ['pdf', 'ofd']
},
{
label: t('ts.发货单附件'),
@ -1245,7 +1271,7 @@ const submitFormFinance = async (formType, submitData) => {
} catch {
formFinanceRef.value.formLoading = false
}
// try {
// //
// await message.confirm(t('ts.'))
@ -1455,7 +1481,7 @@ const sumFormDataHandle = async (
}
//
const submitForm = async (formType, submitData) => {
console.log('submitForm',tableData.value)
console.log('submitForm', tableData.value)
let data = { ...submitData }
tableData.value.forEach((item) => {
item.differencePrice = Number(
@ -1463,27 +1489,31 @@ const submitForm = async (formType, submitData) => {
)
})
let flagInvoicableQuantity = false
tableData.value.forEach(item => {
tableData.value.forEach((item) => {
// 0
// 0
if(item.invoicableQuantity==0){
if (item.invoicableQuantity == 0) {
flagInvoicableQuantity = true
message.error(`${item.itemCode}`+t('ts.可开票数量不能为0'))
}else if(item.maxInvoicableQuantity){
if(item.maxInvoicableQuantity>0){
if(item.invoicableQuantity<0||item.invoicableQuantity>item.maxInvoicableQuantity){
message.error(`${item.itemCode}` + t('ts.可开票数量不能为0'))
} else 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}`)
message.error(
`${item.itemCode}` + t('ts.可开票数量范围是') + `:0~${item.maxInvoicableQuantity}`
)
}
}else{
if(item.invoicableQuantity>0||item.invoicableQuantity<item.maxInvoicableQuantity){
} else {
if (item.invoicableQuantity > 0 || item.invoicableQuantity < item.maxInvoicableQuantity) {
flagInvoicableQuantity = true
message.error(`${item.itemCode}`+t('ts.可开票数量范围是')+`:${item.maxInvoicableQuantity}~0`)
message.error(
`${item.itemCode}` + t('ts.可开票数量范围是') + `:${item.maxInvoicableQuantity}~0`
)
}
}
}
});
if(flagInvoicableQuantity){
})
if (flagInvoicableQuantity) {
return
}
data.subList = tableData.value //
@ -1592,24 +1622,33 @@ const handleSupplierdeliverRecordPrint = async (id) => {
window.open(documentSupplierdeliverRecordSrc.value + '&id=' + id)
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/936875675614240768?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}
const srcPoint = ref(BASE_URL + '/jmreport/view/972723426543935488?token=' + getAccessToken())
const srcPoint = ref(BASE_URL + '/jmreport/view/1055372875454808064?token=' + getAccessToken())
const handleSelectionPoint = async () => {
console.log(selectionRows.value)
let rows: any = []
let rows1: any = []
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.id)]
item.selectionRows.forEach((cur) => {
if (cur.goldenTaxInvoiceNumber == null || cur.goldenTaxInvoiceNumber == '') {
// rows = [...rows, ...item.selectionRows.map((item1) => item1.id)]
rows.push(cur.id)
} else {
rows1.push(cur.id)
}
})
})
if (rows.length == 0) {
message.warning('至少选择一条数据!')
if (rows.length != 0&&rows1.length == 0) {
message.warning('所选数据中金税票号不能为空!')
return
}
console.log('批量打印', rows.join(','))
window.open(srcPoint.value + '&ids=' + rows.join(','))
window.open(srcPoint.value + '&ids=' + rows1.join(','))
}
//
const handleDocumentPrint = async (id) => {
window.open(srcPoint.value + '&ids=' + id)
}
const handlePrintAll = async (masterId) => {

18
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -640,6 +640,8 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
isTable:true,
isDetail:true,
table: {
width: 200,
},
@ -1635,6 +1637,22 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
precision: 2,
},
},
{
label: '金税票号',
field: 'goldenTaxInvoiceNumber',
isTable:true,
isDetail:true,
table: {
width: 200,
},
sortTableDefault:10,
form:{
componentProps: {
maxlength:20,
showWordLimit:true
}
}
},
]))

Loading…
Cancel
Save