Browse Source

高级筛选导出功能

intex
yufei_wang 3 days ago
parent
commit
b283fc00b7
  1. 11
      src/api/wms/customerStatementDetail/index.ts
  2. 2
      src/api/wms/customerStatementMain/index.ts
  3. 37
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  4. 63
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

11
src/api/wms/customerStatementDetail/index.ts

@ -111,6 +111,17 @@ export const exportCustomerStatementCompareDetail = async (params) => {
}
}
//导出详情模具分摊对账单列表数据 需要传masterId
export const exportCustomerStatementShareReconciliatioDetail = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/customer-tool-apport-statement-detail/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/customer-tool-apport-statement-detail/export-excel`, params })
}
}
// 客户模具分摊对账单修改调整金额
export const updateAdjustmentAmount = async (id: number, masterId: number, amount: number) => {

2
src/api/wms/customerStatementMain/index.ts

@ -107,7 +107,7 @@ export const getCustomerList = async () => {
export const exportCustomerStatementMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/eam/basic-eam-workshop/export-excel-senior`, data })
return await request.downloadPost({ url: `/wms/customer-statement-main/export-excel-senior`, data })
}else{
return await request.download({ url: `/wms/customer-statement-main/export-excel`, params })
}

37
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts

@ -1,6 +1,22 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum } from '@/utils/validator'
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain'
const { t } = useI18n() // 国际化
let custormList = []
try {
custormList = await CustomerSaleInvoiceMainApi.getCustomerList()
if(custormList.length>0){
custormList.unshift({
customerCode:'ALL',
customerName:t('ts.全选'),
})
}
console.log('custormList11',custormList)
} catch (error) {
}
// 表单校验
export const CustomerStatementMainRules = reactive({
@ -29,6 +45,22 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'customerCode',
sort: 'custom',
isSearch: true,
search:{
component:'Select',
value:custormList.length>1?[custormList[0]['customerCode']]:[],
componentProps: {
showAll:true,// 备用做全选
multiple:true,
// emptyValues:[null, undefined],
valueOnClear:null,
options:custormList.length>0?custormList.map(item=>({
label:item.customerName,
value:item.customerCode
})):[]
}
},
},
{
label: '客户名称',
@ -82,6 +114,11 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
//value: '',//可以添加默认值 有无都可
component: 'Select',
},
search:{
componentProps: {
multiple:true
}
},
},
{

63
src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

@ -1,11 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
<Search ref="seachRef"
:schema="CustomerStatementMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
@search="searchClick" @reset="searchClick" @onChange="onSearchChange"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -428,7 +428,42 @@ const searchFormClick = (searchData) => {
}
getList() //
}
const seachRef = ref()
const onSearchChange = (field, value)=>{
if(field=='status'){
//
if(value.length>0){
if(value[value.length-1]==''){
//
seachRef.value.setFormValues({
status:['']
})
}else{
seachRef.value.setFormValues({
status:value.filter(item=>item!='')
})
}
}
}
if(field=='customerCode'){
if(value.length>0){
if(value[value.length-1]=='ALL'){
//
seachRef.value.setFormValues({
customerCode:['ALL']
})
}else{
seachRef.value.setFormValues({
customerCode:value.filter(item=>item!='ALL')
})
}
}
}
}
const searchClick = async (data)=>{
console.log('查询',data)
setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL'),status:data.status.filter(item=>item!='')})
}
/** 初始化 **/
onMounted(async () => {
getList()
@ -640,6 +675,7 @@ const detailButtonBaseClick = async (val, item, detailTableObject) => {
handleExportReconciliation(detailTableObject)
} else if (tabCurrent.value.prop == 'ShareReconciliation') {
//
handleExportShareReconciliation(detailTableObject)
}
} else if (val == 'againContrast') {
//
@ -693,7 +729,24 @@ const handleExportDetail = async (detailTableObject) => {
const data = await CustomerStatementDetailApi.exportCustomerStatementDetail(
detailTableObject.params
)
download.excel(data, `对账差异【${formatDate(new Date())}】.xlsx`)
download.excel(data, `客户对账单明细子【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
//
const handleExportShareReconciliation = async (detailTableObject) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CustomerStatementDetailApi.exportCustomerStatementShareReconciliatioDetail(
detailTableObject.params
)
download.excel(data, `模具分摊对账单子${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
exportLoading.value = false

Loading…
Cancel
Save