Browse Source

供应商发票修改打印标签

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

113
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') {
@ -167,7 +167,9 @@
0 0
) )
} }
sumObject.invoiceAmountMain = (Number(sumObject.amount) -Number(formRef.value.formModel.claimAmount)).toFixed(2), // - ;(sumObject.invoiceAmountMain = (
Number(sumObject.amount) - Number(formRef.value.formModel.claimAmount)
).toFixed(2)), // -
formRef.value.setValues(sumObject) formRef.value.setValues(sumObject)
} }
" "
@ -217,7 +219,16 @@
</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: 1px solid #dedede;
border-radius: 8px; border-radius: 8px;
padding: 10px; padding: 10px;
width: calc(100% - 32px); width: calc(100% - 32px);
display: flex;"> 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,7 +522,6 @@ const searchTableSuccessDetail = async (
// }) // })
const detailData = ref() const detailData = ref()
const detailOpenForm = (type, row) => { const detailOpenForm = (type, row) => {
detailData.value = row detailData.value = row
@ -638,14 +658,13 @@ 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, //
@ -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()
/** 详情操作 */ /** 详情操作 */
@ -1463,7 +1489,7 @@ 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) {
@ -1473,16 +1499,20 @@ const submitForm = async (formType, submitData) => {
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
} }
@ -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) { })
message.warning('至少选择一条数据!') if (rows.length != 0&&rows1.length == 0) {
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