From 78f5ee4ca67eb1535a2c65ac45682485350b5159 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Wed, 20 Nov 2024 14:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=A8=A1=E5=85=B7=E5=88=86?= =?UTF-8?q?=E6=91=8A=E5=AF=B9=E8=B4=A6=E5=8D=95=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index.ts | 155 +++++++++++ src/components/Detail/src/Detail.vue | 33 +++ src/utils/dict.ts | 1 + src/utils/formatTime.ts | 9 + .../customerSaleInvoiceRecordMain.data.ts | 46 +++- .../customerSaleInvoiceRequestMain.data.ts | 39 ++- .../customerStatementShareRecordMain.data.ts | 220 +++++++++++++++ .../customerStatementShareRecord/index.vue | 251 ++++++++++++++++++ 8 files changed, 746 insertions(+), 8 deletions(-) create mode 100644 src/api/wms/customerStatementShareRecordDetail/index.ts create mode 100644 src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/customerStatementShareRecordMain.data.ts create mode 100644 src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/index.vue diff --git a/src/api/wms/customerStatementShareRecordDetail/index.ts b/src/api/wms/customerStatementShareRecordDetail/index.ts new file mode 100644 index 000000000..79ae1f06e --- /dev/null +++ b/src/api/wms/customerStatementShareRecordDetail/index.ts @@ -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 }) +// } diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index f465845f0..976055482 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -385,6 +385,12 @@ const props = defineProps({ required: false, default: null }, + // tableObject 数据过滤条件 针对 详情扩展标签页 传入不同条件 + extendRowKeyValue: { + type: Array, + required: false, + default: null + }, // 子列表 筛选 展示与隐藏 ,默认展示 detailButtonIsShowFilter:{ type: Boolean, @@ -795,6 +801,14 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: tableObjectRef.value.params = { masterId: row.masterId||row.id } + if (props.extendRowKeyValue) { + // params 扩展的字段 + props.extendRowKeyValue.forEach(item => { + tableObject.params[item.key] = row[item.value] + masterParmas.value[item.key] =row[item.value] + + }) + } await getList() } isShowDrawer.value = true @@ -1139,6 +1153,25 @@ const searchFormClick = async (searchData) => { ? searchData.filters : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] } + if (props.extendRowKeyValue) { + // params 扩展的字段 + props.extendRowKeyValue.forEach(item => { + let findItem = tableObjectRef.value.params.filters.find(item1=>item1.column == [item.key]) + if(findItem){ + findItem.value = masterParmas.value[item.key] + }else{ + tableObjectRef.value.params.filters.push({ + column : item.key, + action : "==", + value : masterParmas.value[item.key] + }) + } + + }) + } + + + tableObjectRef.value.params.filters // const { tableObject, tableMethods } = useTable({ // getListApi: props.apiPage // 分页接口 // }) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 57bdadce7..841762eac 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -411,6 +411,7 @@ export enum DICT_TYPE { RECEIVE_STATUS = 'receive_status', // 收货确认状态 LINE_SCRAP_REASON = 'Reason_or_scrapping_of_production_line', // 线边报废原因(现场史力维护的字典) CUSTOMER_STATEMENT_TYPE = 'customer_statement_type', // wms客户对账单 模具分摊状态 + CUSTOMER_TOOL_APPORT_STATEMENT_TYPE = 'customer_tool_apport_statement_type', // wms客户对账单 模具分摊状态 DELIVER_METHOD = 'deliver_method', CUSTOMER_SALE_INVOICE_TYPE = 'customer_saleInvoice_type' // 销售开票 diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index db7948081..f1463f58a 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -162,6 +162,15 @@ export const dateFormatter = (row, column, cellValue) => { } return formatDate(cellValue) } + +export const dateFormatterYM = (row, column, cellValue) => { + if (!cellValue) { + return + } + return formatDate(cellValue, 'YYYY-MM') +} + + /** * element plus 的时间 Formatter 实现,使用 YYYY-MM-DD HH:mm:ss 格式 * diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts index a3c7a12e7..0544c52b0 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts @@ -204,29 +204,65 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ field: 'remark', sort: 'custom', }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + isDetail:true, + isForm: false, + isTable:false + }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, - isTable:false, - isDetail:true, + 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 + } + }, + { + label: '更新者', + field: 'updater', + sort: 'custom', + isDetail:true, isForm: false, + isTable:false }, { - label: '最后更新时间', + label: '更新时间', field: 'updateTime', sort: 'custom', formatter: dateFormatter, - isTable:false, - isDetail:true, + 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 + } }, ])) // 表单校验 diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts index e3736494e..48a011078 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts @@ -38,6 +38,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ sort: 'custom', isSearch: true, isForm: false, + fixed: 'left', table:{ width:180 } @@ -231,6 +232,14 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ width:150 } }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + isDetail:true, + isForm: false, + isTable:false + }, { label: '创建时间', field: 'createTime', @@ -247,13 +256,37 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ detail: { dateFormat : 'YYYY-MM-DD HH:mm:ss' }, - form: { + isTable:false, + 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: { - type: 'datetime', - valueFormat: 'x', + 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 diff --git a/src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/customerStatementShareRecordMain.data.ts b/src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/customerStatementShareRecordMain.data.ts new file mode 100644 index 000000000..915536333 --- /dev/null +++ b/src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/customerStatementShareRecordMain.data.ts @@ -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([ + + { + 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([ + + { + 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, + } +])) + + diff --git a/src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/index.vue b/src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/index.vue new file mode 100644 index 000000000..b99e25fc1 --- /dev/null +++ b/src/views/wms/deliversettlementManage/moldAllocation/customerStatementShareRecord/index.vue @@ -0,0 +1,251 @@ + + +