From 485efcda90a969e4d92e2f09c7c04eb0a776b857 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Wed, 20 Nov 2024 09:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=BC=80=E7=A5=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/customerSaleInvoiceDetail/index.ts | 7 +++- .../CustomerSaleInvoiceBasicForm.vue | 8 +++- .../customerSaleInvoiceRequestMain.data.ts | 22 +++++++++- .../customerSaleInvoiceRequestMain/index.vue | 42 ++++++++++++++++++- 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/src/api/wms/customerSaleInvoiceDetail/index.ts b/src/api/wms/customerSaleInvoiceDetail/index.ts index af4c750bd..48acdabac 100644 --- a/src/api/wms/customerSaleInvoiceDetail/index.ts +++ b/src/api/wms/customerSaleInvoiceDetail/index.ts @@ -61,7 +61,12 @@ export const deleteCustomerSaleInvoiceDetail = async (id: number) => { // 导出客户销售开票子信息表(WMS) Excel export const exportCustomerSaleInvoiceDetail = async (params) => { - return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params }) + if (params.isSearch) { + const data = { ...params } + return await request.downloadPost({ url: `/wms/customer-sale-invoice-detail/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params }) + } } // 下载用户导入模板 diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue index d16bb0b12..1b5c63917 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue @@ -91,6 +91,9 @@ const inputNumberChange = (field, index, row, val) => { // 模具分摊单价 默认从模具分摊对账单带出,未税金额修改后重新计算,等于未税金额/数量-销售单价 row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price'] + + // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 + row['taxAmount'] = (row['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //含税金额 } @@ -205,12 +208,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => item['sumPrice'] = item['price'] + item['allocationPrice'] // 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 item['beforeTaxAmount'] = item['sumPrice']*item['qty'] - // 含税金额 未税价格+税额,四舍五入保留2位小数 - item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //含税金额 + // 含税金额 未税价格+税额,四舍五入保留2位小数 + item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 + }) diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts index a286401fc..cbaa842c8 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts @@ -53,7 +53,14 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ dictClass: 'string', table:{ width:120 - } + }, + search:{ + component:'Select', + componentProps: { + multiple:true, + } + + }, }, { label: '客户对账单', @@ -200,6 +207,9 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + }, form: { component: 'DatePicker', componentProps: { @@ -232,6 +242,16 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x', + } + }, isForm: false, table:{ width:180 diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue index 5b5e64477..f89ebbd09 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue @@ -56,6 +56,8 @@ :detailButtonIsShowAddStatusArray="['0']" :detailButtonIsShowDelete="false" :detailButtonIsShowAdd="false" + :otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-request-main:export` })]" + @buttonBaseClick="detailButtonBaseClick" @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -75,6 +77,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as AreabasicApi from '@/api/wms/areabasic' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import { status } from 'nprogress' const { loadStart, loadDone } = usePageLoading() // 销售开票申请 defineOptions({ name: 'customerSaleInvoiceMain' }) @@ -102,7 +105,28 @@ const updataTableColumns = (val) => { tableColumns.value = val } +// 点击子表按钮事件 +const detailButtonBaseClick = async (val, item,tableObject) => { + if (val == 'export') { + // 子表导出 + console.log('子表导出',val, tableObject) + try { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出 + loadStart() + const excelTitle = ref(route.meta.title) + const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceDetail(tableObject.params) + download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) + } catch { + + } finally { + loadDone() + } + + } +} // 查询页面返回——详情 const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { nextTick(() => { @@ -276,6 +300,22 @@ const searchFormClick = (searchData) => { } const seachRef = ref() const onSearchChange = (field, value)=>{ + console.log('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'){ @@ -293,7 +333,7 @@ const onSearchChange = (field, value)=>{ } const searchClick = async (data)=>{ console.log('查询',data) - setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL')}) + setSearchParams({...data,customerCode:data.customerCode.filter(item=>item!='ALL'),status:data.status.filter(item=>item!='')}) } /** 初始化 **/ onMounted(async () => {