王宇飞
3 months ago
8 changed files with 746 additions and 8 deletions
@ -0,0 +1,155 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface CustomerStatementDetailVO { |
|||
id: number |
|||
number: string |
|||
masterId: number |
|||
invoiceType: string |
|||
releaseNumber: string |
|||
ingress: string |
|||
ingress2: string |
|||
itemCode: string |
|||
articleNumber: string |
|||
articleName: string |
|||
backNumber: string |
|||
checkTime: Date |
|||
uom: string |
|||
qty: number |
|||
price: number |
|||
amount: number |
|||
allocationPrice: number |
|||
tftmQuantity: number |
|||
intexQuantity: number |
|||
quantityVariance: number |
|||
tftmPrice: number |
|||
intexPrice: number |
|||
priceVariance: number |
|||
tftmAmount: number |
|||
intexAmount: number |
|||
amountVariance: number |
|||
dischargingTime: Date |
|||
acceptCheckTime: Date |
|||
remark: string |
|||
available: string |
|||
siteId: string |
|||
concurrencyStamp: string |
|||
} |
|||
|
|||
|
|||
export const getCustomerStatementShareRecordMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/customer-tool-apport-statement-detail/seniorGroup', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/pageGroup`, params }) |
|||
} |
|||
} |
|||
|
|||
|
|||
export const getCustomerStatementShareRecordDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/wms/customer-tool-apport-statement-detail/seniorDetail', data }) |
|||
} else { |
|||
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/pageDetail`, params }) |
|||
} |
|||
} |
|||
|
|||
|
|||
export const exportCustomerStatementShareRecordDetail = async (params) => { |
|||
if (params.isSearch) { |
|||
const data = {...params} |
|||
return await request.downloadPost({ url: `/wms/customer-tool-apport-statement-detail/export-excel-senior-detail`, data }) |
|||
}else{ |
|||
return await request.download({ url: `/wms/customer-tool-apport-statement-detail/export-excel-detail`, params }) |
|||
} |
|||
} |
|||
|
|||
// // 查询客户对账单子信息明细表(WMS)列表或者查询客户对账单对账差异列表 二者共用一个
|
|||
// export const getCustomerStatementDetailPage = async (params) => {
|
|||
// if (params.isSearch) {
|
|||
// delete params.isSearch
|
|||
// const data = {...params}
|
|||
// return await request.post({ url: '/wms/customer-statement-detail/senior', data })
|
|||
// } else {
|
|||
// return await request.get({ url: `/wms/customer-statement-detail/page`, params })
|
|||
// }
|
|||
// }
|
|||
// // 查询客户对账单子信息明细表(WMS)列表或者查询客户对账单对账差异列表 二者共用一个
|
|||
// export const getCustomerStatementReconciliationPage = async (params) => {
|
|||
// if (params.isSearch) {
|
|||
// delete params.isSearch
|
|||
// const data = { ...params }
|
|||
// return await request.post({ url: '/wms/customer-statement-detail/senior', data })
|
|||
// } else {
|
|||
// return await request.get({ url: `/wms/customer-statement-detail/page`, params })
|
|||
// }
|
|||
// }
|
|||
// // 查询模具分摊明细列表
|
|||
// export const getCustomerToolApportStatementPage = async (params) => {
|
|||
// if (params.isSearch) {
|
|||
// delete params.isSearch
|
|||
// const data = { ...params }
|
|||
// return await request.post({ url: '/wms/customer-tool-apport-statement-detail/senior', data })
|
|||
// } else {
|
|||
// return await request.get({ url: `/wms/customer-tool-apport-statement-detail/page`, params })
|
|||
// }
|
|||
// }
|
|||
|
|||
// // 查询客户对账单子信息表(WMS)详情
|
|||
// export const getCustomerStatementDetail = async (id: number) => {
|
|||
// return await request.get({ url: `/wms/customer-statement-detail/get?id=` + id })
|
|||
// }
|
|||
|
|||
// // 新增客户对账单子信息表(WMS)
|
|||
// export const createCustomerStatementDetail = async (data: CustomerStatementDetailVO) => {
|
|||
// return await request.post({ url: `/wms/customer-statement-detail/create`, data })
|
|||
// }
|
|||
|
|||
// // 修改客户对账单子信息表(WMS)
|
|||
// export const updateCustomerStatementDetail = async (data: CustomerStatementDetailVO) => {
|
|||
// return await request.put({ url: `/wms/customer-statement-detail/update`, data })
|
|||
// }
|
|||
|
|||
// // 删除客户对账单子信息表(WMS)
|
|||
// export const deleteCustomerStatementDetail = async (id: number) => {
|
|||
// return await request.delete({ url: `/wms/customer-statement-detail/delete?id=` + id })
|
|||
// }
|
|||
|
|||
// // 下载用户导入模板
|
|||
// export const importTemplate = () => {
|
|||
// return request.download({ url: '/wms/customer-statement-detail/get-import-template' })
|
|||
// }
|
|||
|
|||
// //导出明细数据需要传masterId
|
|||
// export const exportCustomerStatementDetail = async (params) => {
|
|||
// if (params.isSearch) {
|
|||
// const data = {...params}
|
|||
// return await request.downloadPost({ url: `/wms/customer-statement-detail/export-excel-senior`, data })
|
|||
// }else{
|
|||
// return await request.download({ url: `/wms/customer-statement-detail/export-excel`, params })
|
|||
// }
|
|||
// }
|
|||
|
|||
// //导出详情对账差异列表数据 需要传masterId
|
|||
// export const exportCustomerStatementCompareDetail = async (params) => {
|
|||
// if (params.isSearch) {
|
|||
// const data = {...params}
|
|||
// return await request.downloadPost({ url: `/wms/customer-statement-detail/export-excel-compare-senior`, data })
|
|||
// }else{
|
|||
// return await request.download({ url: `/wms/customer-statement-detail/export-excel-compare`, params })
|
|||
// }
|
|||
// }
|
|||
|
|||
|
|||
// // 客户模具分摊对账单修改调整金额
|
|||
// export const updateAdjustmentAmount = async (id: number, masterId: number, amount: number) => {
|
|||
// return await request.get({ url: `wms/customer-tool-apport-statement-detail/updateAdjustmentAmount?id=` + id + '&masterId=' + masterId + '&amount=' + amount })
|
|||
// }
|
|||
|
|||
// // 客户对账单直接创建开票申请查询子分页数据
|
|||
// export const pageInvoice = async (params) => {
|
|||
// return await request.get({ url: `/wms/customer-statement-detail/pageInvoice`, params })
|
|||
// }
|
@ -0,0 +1,220 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatterYM } from '@/utils/formatTime' |
|||
import { validateTwoNum } from '@/utils/validator' |
|||
import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain' |
|||
|
|||
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 CustomerStatementShareRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
|
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
fixed: 'left', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.CUSTOMER_TOOL_APPORT_STATEMENT_TYPE, |
|||
dictClass: 'string', |
|||
form: { |
|||
//value: '',//可以添加默认值 有无都可
|
|||
component: 'Select', |
|||
}, |
|||
}, |
|||
{ |
|||
label: '版本号', |
|||
field: 'versionNumber', |
|||
sort: 'custom', |
|||
isTable: false |
|||
}, |
|||
{ |
|||
label: '客户代码', |
|||
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: '客户名称', |
|||
field: 'customerName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '年月', |
|||
field: 'yearsMonth', |
|||
sort: 'custom', |
|||
formatter: dateFormatterYM, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'YYYY-MM' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
sort: 'custom', |
|||
isDetail:true, |
|||
isForm: false, |
|||
isTable:true |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat : 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
isTable:true, |
|||
isForm: false, |
|||
table:{ |
|||
width:180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '更新者', |
|||
field: 'updater', |
|||
sort: 'custom', |
|||
isDetail:true, |
|||
isForm: false, |
|||
isTable:false |
|||
}, |
|||
{ |
|||
label: '更新时间', |
|||
field: 'updateTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
detail: { |
|||
dateFormat : 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
isTable:false, |
|||
isForm: false, |
|||
table:{ |
|||
width:180 |
|||
} |
|||
}, |
|||
])) |
|||
|
|||
|
|||
export const CustomerStatementShareRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
|
|||
{ |
|||
label: '厂家编号', |
|||
field: 'factoryCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
}, |
|||
|
|||
{ |
|||
label: '厂家名称', |
|||
field: 'factoryName', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '帐票号', |
|||
field: 'invoiceNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '品号', |
|||
field: 'articleNumber', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '车型', |
|||
field: 'vehicleType', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'qty', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '模具分摊金额', |
|||
field: 'amount', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '调整金额', |
|||
field: 'adjustmentAmount', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
} |
|||
])) |
|||
|
|||
|
@ -0,0 +1,251 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search ref="seachRef" |
|||
:schema="CustomerStatementShareRecordMain.allSchemas.searchSchema" |
|||
@search="searchClick" |
|||
@reset="searchClick" |
|||
@onChange="onSearchChange" |
|||
/> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="CustomerStatementShareRecordMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="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" |
|||
> |
|||
<template #number="{ row }"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row, $index }"> |
|||
<ButtonBase |
|||
:Butttondata="butttondata(row, $index)" |
|||
@button-base-click="buttonTableClick($event, row)" |
|||
/> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="CustomerStatementShareRecordMain.allSchemas" |
|||
:detailAllSchemas="CustomerStatementShareRecordDetail.allSchemas" |
|||
:extendRowKeyValue = "[{ |
|||
key:'number', |
|||
value:'number' |
|||
}]" |
|||
:apiPage="CustomerStatementShareRecordDetailApi.getCustomerStatementShareRecordDetailPage" |
|||
:detailButtonIsShowAdd="false" |
|||
:otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` })]" |
|||
@buttonBaseClick="detailButtonBaseClick" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { |
|||
CustomerStatementShareRecordMain, |
|||
CustomerStatementShareRecordDetail |
|||
} from './customerStatementShareRecordMain.data' |
|||
import * as CustomerStatementShareRecordDetailApi from '@/api/wms/customerStatementShareRecordDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
import Detail from '@/components/Detail/src/Detail.vue' |
|||
import { formatDate } from '@/utils/formatTime' |
|||
|
|||
defineOptions({ name: 'CustomerStatementShareRecordMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(CustomerStatementShareRecordMain.allSchemas.tableColumns) |
|||
|
|||
const otherHeadButttonData = ref() |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: CustomerStatementShareRecordDetailApi.getCustomerStatementShareRecordMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null) // 设置 |
|||
|
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'refresh') { |
|||
// 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { |
|||
// 筛选 |
|||
} else { |
|||
// 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row, $index) => { |
|||
const findIndex = row['masterId'] |
|||
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId']) |
|||
: -1 |
|||
if (findIndex > -1 && findIndex < $index) { |
|||
return [] |
|||
} |
|||
return [ |
|||
|
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
|
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const tableObjectExtend = ref([]) |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
tableObjectExtend.value = [{ |
|||
key: 'number', |
|||
value: row.number |
|||
}] |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerStatementMain') |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: `【${route.meta.title}】导入模版.xlsx` |
|||
}) |
|||
//导入客户模具对账单参数 |
|||
const importShareTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '模具分摊对账单导入模版.xlsx', |
|||
customerId: 0 |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
const seachRef = ref() |
|||
const onSearchChange = (field, value)=>{ |
|||
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')}) |
|||
} |
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
|
|||
|
|||
// 根据状态返回该按钮是否显示 |
|||
const isShowMainButton = (row, val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
// 点击子表按钮事件 |
|||
const detailButtonBaseClick = async (val, item, detailTableObject) => { |
|||
console.log(val, item, detailTableObject) |
|||
if (val == 'export') { |
|||
// 子表导出明细 |
|||
handleExportDetail(detailTableObject) |
|||
} |
|||
} |
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
// 子表导出明细 |
|||
const handleExportDetail = async (detailTableObject) => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await CustomerStatementShareRecordDetailApi.exportCustomerStatementShareRecordDetail( |
|||
detailTableObject.params |
|||
) |
|||
download.excel(data, `对账差异【${formatDate(new Date())}】.xlsx`) |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
|
|||
</script> |
Loading…
Reference in new issue