diff --git a/src/api/wms/purchaseClaimRequestDetail/index.ts b/src/api/wms/purchaseClaimRequestDetail/index.ts
index 49edb64be..807f97df5 100644
--- a/src/api/wms/purchaseClaimRequestDetail/index.ts
+++ b/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 })
diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue
index 3f709f814..ac09e7190 100644
--- a/src/components/BasicForm/src/BasicForm.vue
+++ b/src/components/BasicForm/src/BasicForm.vue
@@ -145,6 +145,8 @@
:tableData="tableData"
>
+
+
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
index 899bf6789..83c6fa0db 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
+++ b/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
// 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留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 @@
}}
+
+
+
+
+
+
@@ -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,7 +964,15 @@ 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 = ''
await SupplierinvoiceRequestMainApi.checkInvoicingCalendar({}).then((res) => {
@@ -937,6 +991,7 @@ const getDefaultSupplier = async () => {
console.log('defaultSupplierCode', defaultSupplierCode)
}
+
// 获取部门 用于详情 部门回显
const { wsCache } = useCache()
/** 详情操作 */
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
index 89aa1311d..0c4a62e5b 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
+++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
@@ -910,21 +910,28 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive(
},
}
},
- // {
- // 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([
+ {
+ 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,
+
+ }
+ }
+]))