Browse Source

供应商发票申请

intex
zhang_li 1 week 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 })
}
}
//获得采购索赔子列表
export const getPurchaseClaimRequestDetailList = async (supplierCode) => {
return await request.get({ url: `/wms/purchaseClaim-request-detail/getPurchaseclaim?supplierCode=` + supplierCode })
}
// 创建采购索赔子
export const createPurchaseClaimRequestDetail = async (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"
></CollectionTable>
</div>
<slot name="table"></slot>
</div>
<template #footer>
<slot name="foorter"></slot>

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

@ -87,7 +87,8 @@
discountAmount1 = 0,
beforeTaxDiffAmount = 0,
taxAmountDiff = 0,
rebateTax=0
rebateTax=0,
claimAmount=0
} = formModel
// 2X*2
if (formType == 'update') {
@ -102,7 +103,7 @@
updateOriginFormModel(formModel)
}
formRef.value.setValues({
afterTaxAmount: amount + taxAmount, // 3+
afterTaxAmount: amount + taxAmount - claimAmount, // 3+-
adTaxAmount: beforeTaxAmount + totalTaxAmount, //6+
beforeTaxDiffAmount: beforeTaxAmount - amount, //-
taxAmountDiff: totalTaxAmount - taxAmount, // -
@ -130,7 +131,7 @@
}
formRef.value.setValues({
taxAmount: taxAmount_,
afterTaxAmount: amount + taxAmount, // 3+
afterTaxAmount: amount + taxAmount - claimAmount, // 3+-
adTaxAmount: beforeTaxAmount + totalTaxAmount, //6+
beforeTaxDiffAmount: beforeTaxAmount - amount, //-
taxAmountDiff: totalTaxAmount - taxAmount, // -
@ -198,6 +199,7 @@
}}
</div>
</template>
<!-- <template #foorter>
<div style="text-align: left">
{{ basicFormFooter }}
@ -210,6 +212,40 @@
:modelValue="(row['singlePrice'] - row['purchasePrice']).toFixed(5)"
/>
</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>
<!-- 财务通过窗口 finance_mainPlanSub -->
@ -350,6 +386,7 @@
import dayjs from 'dayjs'
//
import download from '@/utils/download'
import TableForm from '@/components/TableForm/src/TableForm.vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {
SupplierinvoiceRequestMain,
@ -360,10 +397,13 @@ import {
SupplierinvoiceRequestFinanceRules,
PurchasePass,
PurchasePassRules,
SupplierinvoiceRequestDetailMain
SupplierinvoiceRequestDetailMain,
ClaimDetails
} from './supplierinvoiceRequestMain.data'
import * as SupplierinvoiceRequestMainApi from '@/api/wms/supplierinvoiceRequestMain'
import * as SupplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail'
import * as PurchaseClaimRequestDetailApi from '@/api/wms/purchaseClaimRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '../../../basicDataManage/supplierManage/supplier/supplier.data'
@ -566,12 +606,17 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
})
} else {
//
console.log(11,val[0][searchField])
console.log(11,searchFormRef.formModel.supplierCode)
if (
formField == 'supplierCode' &&
val[0][searchField] != searchFormRef.formModel.supplierCode
) {
tableData.value = []
}
if (formField == 'supplierCode') {
claimDetails(val[0][searchField])
}
//
if (formField == 'orderType' && val[0][searchField] != searchFormRef.formModel.orderType) {
tableData.value = []
@ -873,6 +918,7 @@ const openForm = async (type: string, row?: any) => {
item.value = defaultSupplierCode.value
item.componentProps.isSearchList = true
item.componentProps.disabled = false
claimDetails(defaultSupplierCode.value)
}
//
if (item.field == 'orderType') {
@ -918,6 +964,14 @@ const openForm = async (type: string, row?: any) => {
tableData.value = [] //
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 () => {
let resData = ''
@ -937,6 +991,7 @@ const getDefaultSupplier = async () => {
console.log('defaultSupplierCode', defaultSupplierCode)
}
//
const { wsCache } = useCache()
/** 详情操作 */

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

@ -910,21 +910,28 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
},
}
},
// {
// label: '采购审批人',
// field: 'procurementCreatorName',
// sort: 'custom',
// table: {
// width: 180
// },
// isTable:true,
// isDetail: true,
// isTableForm: false,
// isForm:false,
// isSearch:false,
// sortTableDefault:12
// },
{
label: '索赔总额',
field: 'claimAmount',
sort: 'custom',
table: {
width: 180
},
isTable:true,
isDetail: true,
isTableForm: false,
isForm: true,
isSearch:false,
sortTableDefault: 12,
form: {
component: 'InputNumber',
componentProps: {
precision: 5,
disabled: true,
}
},
},
{
label: '采购审批时间',
field: 'procurementCreateTime',
@ -2240,3 +2247,52 @@ export const PurchasePassRules = reactive({
{ 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