Browse Source

供应商发票修改打印标签

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

Loading…
Cancel
Save