Browse Source

供应商发票申请

intex
zhang_li 2 weeks ago
parent
commit
f006072ea1
  1. 5
      src/api/wms/purchaseClaimRequestDetail/index.ts
  2. 2
      src/components/BasicForm/src/BasicForm.vue
  3. 63
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
  4. 84
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

5
src/api/wms/purchaseClaimRequestDetail/index.ts

@ -9,7 +9,10 @@ export const getPurchaseClaimRequestDetailPage = async (params) => {
return await request.get({ url: `/wms/purchaseClaim-request-detail/page`, params }) return await request.get({ url: `/wms/purchaseClaim-request-detail/page`, params })
} }
} }
//获得采购索赔子列表
export const getPurchaseClaimRequestDetailList = async (supplierCode) => {
return await request.get({ url: `/wms/purchaseClaim-request-detail/getPurchaseclaim?supplierCode=` + supplierCode })
}
// 创建采购索赔子 // 创建采购索赔子
export const createPurchaseClaimRequestDetail = async (data) => { export const createPurchaseClaimRequestDetail = async (data) => {
return await request.post({ url: `/wms/purchase-claim-request-detail/create`, data }) return await request.post({ url: `/wms/purchase-claim-request-detail/create`, data })

2
src/components/BasicForm/src/BasicForm.vue

@ -145,6 +145,8 @@
:tableData="tableData" :tableData="tableData"
></CollectionTable> ></CollectionTable>
</div> </div>
<slot name="table"></slot>
</div> </div>
<template #footer> <template #footer>
<slot name="foorter"></slot> <slot name="foorter"></slot>

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

@ -87,7 +87,8 @@
discountAmount1 = 0, discountAmount1 = 0,
beforeTaxDiffAmount = 0, beforeTaxDiffAmount = 0,
taxAmountDiff = 0, taxAmountDiff = 0,
rebateTax=0 rebateTax=0,
claimAmount=0
} = formModel } = formModel
// 2X*2 // 2X*2
if (formType == 'update') { if (formType == 'update') {
@ -102,7 +103,7 @@
updateOriginFormModel(formModel) updateOriginFormModel(formModel)
} }
formRef.value.setValues({ formRef.value.setValues({
afterTaxAmount: amount + taxAmount, // 3+ afterTaxAmount: amount + taxAmount - claimAmount, // 3+-
adTaxAmount: beforeTaxAmount + totalTaxAmount, //6+ adTaxAmount: beforeTaxAmount + totalTaxAmount, //6+
beforeTaxDiffAmount: beforeTaxAmount - amount, //- beforeTaxDiffAmount: beforeTaxAmount - amount, //-
taxAmountDiff: totalTaxAmount - taxAmount, // - taxAmountDiff: totalTaxAmount - taxAmount, // -
@ -130,7 +131,7 @@
} }
formRef.value.setValues({ formRef.value.setValues({
taxAmount: taxAmount_, taxAmount: taxAmount_,
afterTaxAmount: amount + taxAmount, // 3+ afterTaxAmount: amount + taxAmount - claimAmount, // 3+-
adTaxAmount: beforeTaxAmount + totalTaxAmount, //6+ adTaxAmount: beforeTaxAmount + totalTaxAmount, //6+
beforeTaxDiffAmount: beforeTaxAmount - amount, //- beforeTaxDiffAmount: beforeTaxAmount - amount, //-
taxAmountDiff: totalTaxAmount - taxAmount, // - taxAmountDiff: totalTaxAmount - taxAmount, // -
@ -198,6 +199,7 @@
}} }}
</div> </div>
</template> </template>
<!-- <template #foorter> <!-- <template #foorter>
<div style="text-align: left"> <div style="text-align: left">
{{ basicFormFooter }} {{ basicFormFooter }}
@ -210,6 +212,40 @@
:modelValue="(row['singlePrice'] - row['purchasePrice']).toFixed(5)" :modelValue="(row['singlePrice'] - row['purchasePrice']).toFixed(5)"
/> />
</template> </template>
<template #table>
<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"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
style='width: calc(100% - 32px);'
/> -->
<div
style="border: 1px solid #dedede;
border-radius: 8px;
padding: 10px;
width: calc(100% - 32px);
display: flex;">
<TableForm
ref="tableFormRef"
class="w-[100%]"
:tableFields="ClaimDetails.allSchemas.tableFormColumns"
:tableData="claimDetailsList"
:isShowButton="false"
:isShowReduceButton="false"
/>
</div>
</div>
</template>
</BasicForm> </BasicForm>
<!-- 财务通过窗口 finance_mainPlanSub --> <!-- 财务通过窗口 finance_mainPlanSub -->
@ -350,6 +386,7 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
// //
import download from '@/utils/download' import download from '@/utils/download'
import TableForm from '@/components/TableForm/src/TableForm.vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { import {
SupplierinvoiceRequestMain, SupplierinvoiceRequestMain,
@ -360,10 +397,13 @@ import {
SupplierinvoiceRequestFinanceRules, SupplierinvoiceRequestFinanceRules,
PurchasePass, PurchasePass,
PurchasePassRules, PurchasePassRules,
SupplierinvoiceRequestDetailMain SupplierinvoiceRequestDetailMain,
ClaimDetails
} from './supplierinvoiceRequestMain.data' } from './supplierinvoiceRequestMain.data'
import * as SupplierinvoiceRequestMainApi from '@/api/wms/supplierinvoiceRequestMain' import * as SupplierinvoiceRequestMainApi from '@/api/wms/supplierinvoiceRequestMain'
import * as SupplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail' import * as SupplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail'
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as SupplierApi from '@/api/wms/supplier' import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data' import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data'
@ -566,12 +606,17 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
}) })
} else { } else {
// //
console.log(11,val[0][searchField])
console.log(11,searchFormRef.formModel.supplierCode)
if ( if (
formField == 'supplierCode' && formField == 'supplierCode' &&
val[0][searchField] != searchFormRef.formModel.supplierCode val[0][searchField] != searchFormRef.formModel.supplierCode
) { ) {
tableData.value = [] tableData.value = []
} }
if (formField == 'supplierCode') {
claimDetails(val[0][searchField])
}
// //
if (formField == 'orderType' && val[0][searchField] != searchFormRef.formModel.orderType) { if (formField == 'orderType' && val[0][searchField] != searchFormRef.formModel.orderType) {
tableData.value = [] tableData.value = []
@ -873,6 +918,7 @@ 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
claimDetails(defaultSupplierCode.value)
} }
// //
if (item.field == 'orderType') { if (item.field == 'orderType') {
@ -918,6 +964,14 @@ const openForm = async (type: string, row?: any) => {
tableData.value = [] // tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
} }
//
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.afterTaxAmount = (parseFloat(formRef.value.formRef.formModel.afterTaxAmount) - parseFloat(formRef.value.formRef.formModel.claimAmount)).toFixed(2)
console.log(formRef.value.formRef.formModel.afterTaxAmount)
}
// //
const checkInvoicingCalendar = async () => { const checkInvoicingCalendar = async () => {
let resData = '' let resData = ''
@ -937,6 +991,7 @@ const getDefaultSupplier = async () => {
console.log('defaultSupplierCode', defaultSupplierCode) console.log('defaultSupplierCode', defaultSupplierCode)
} }
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */

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

@ -910,21 +910,28 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
} }
}, },
// { {
// label: '采购审批人', label: '索赔总额',
// field: 'procurementCreatorName', field: 'claimAmount',
// sort: 'custom', sort: 'custom',
// table: { table: {
// width: 180 width: 180
// }, },
// isTable:true, isTable:true,
// isDetail: true, isDetail: true,
// isTableForm: false, isTableForm: false,
// isForm:false, isForm: true,
// isSearch:false, isSearch:false,
// sortTableDefault:12 sortTableDefault: 12,
// }, form: {
component: 'InputNumber',
componentProps: {
precision: 5,
disabled: true,
}
},
},
{ {
label: '采购审批时间', label: '采购审批时间',
field: 'procurementCreateTime', field: 'procurementCreateTime',
@ -2240,3 +2247,52 @@ export const PurchasePassRules = reactive({
{ max: 100, message: '最多100字符', trigger: 'blur'} { max: 100, message: '最多100字符', trigger: 'blur'}
], ],
}) })
/**
* @returns {Array}
*/
export const ClaimDetails = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '索赔申请单单号',
field: 'number',
table: {
width: 150
},
tableForm: {
disabled:true
}
},
{
label: '物料代码',
field: 'itemCode',
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '索赔数量',
field: 'claimQty',
table: {
width: 150
},
tableForm: {
disabled: true
}
},
//仅是主列表页面的筛选搜索条件
{
label: '索赔金额',
field: 'claimAmount',
sort: 'custom',
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 5,
}
}
]))

Loading…
Cancel
Save