From e876df2bde723750ea4712cc6951a08d9e02177c Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Tue, 30 Sep 2025 14:42:08 +0800 Subject: [PATCH] update --- config/proxy.ts | 5 + package.json | 2 +- src/pages/BussinessProject/search.tsx | 87 +- src/pages/User/ForgetPassword/index.tsx | 61 +- src/pages/User/login/index.tsx | 45 +- src/pages/account/setting/sevice.tsx | 19 + src/pages/reports/BusinessProject/index.tsx | 756 ++++++++--------- .../reports/ConfirmationDifference/index.tsx | 12 +- .../Finance/InvestmentPromotion/index.tsx | 41 +- src/pages/reports/Finance/RevenueSplit.tsx | 157 ++-- .../reports/Finance/SpringFestival/index.tsx | 284 +++---- .../Finance/StoreDetailRevenue/index.tsx | 309 +++---- src/pages/reports/Finance/accountMonthly.tsx | 13 +- .../reports/Finance/accountServerpart.tsx | 652 +++++++-------- .../reports/Finance/businessWarning/index.tsx | 559 ++++++------- .../reports/Finance/revenueAnalysis/index.tsx | 37 +- .../reports/Finance/revenueServerpart.tsx | 775 +++++++++--------- .../reports/MerchantInformation/index.tsx | 214 ++--- .../reports/audit/abnormalAmount/index.tsx | 15 +- .../reports/audit/abnormalAudit/index.tsx | 7 +- .../reports/audit/abnormalExamine/index.tsx | 14 +- .../reports/audit/abnormalReport/index.tsx | 89 +- .../reports/audit/abnormalSale/index.tsx | 15 +- src/pages/reports/audit/auditTasks/index.tsx | 6 +- .../audit/checkAccountReport/index.tsx | 62 +- src/pages/reports/audit/checkAcount/index.tsx | 253 +++--- .../reports/audit/curDailyReport/index.tsx | 55 +- src/pages/reports/audit/feedback/index.tsx | 6 +- .../reports/audit/spAbnormalReport/index.tsx | 73 +- .../reports/audit/specialReport/index.tsx | 75 +- src/pages/reports/cashierDeduction/index.tsx | 15 +- .../productControl/commodityInfo/index.tsx | 1 + .../productControl/shopCommodity/index.tsx | 6 +- src/pages/reports/receivedAccounts/index.tsx | 15 +- .../reports/revenueConfirmation/index.tsx | 12 +- .../component/YearExamineDetailTable.tsx | 4 +- src/pages/reports/shareRoyalty/index.tsx | 74 +- src/utils/exportExcelFun.ts | 32 +- src/utils/format.ts | 116 +++ src/versionEnv.ts | 6 +- 40 files changed, 2664 insertions(+), 2315 deletions(-) diff --git a/config/proxy.ts b/config/proxy.ts index 9ddb2f2..6cdd50b 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -30,6 +30,11 @@ export default { target: 'http://127.0.0.1:8900', // 'http://dev.eshangtech.com:8001', changeOrigin: true, pathRewrite: { '^/EShangApiDashboard': '/EShangApiDashboard' } + }, + '/baidu-api/': { + target: 'https://api.map.baidu.com', + changeOrigin: true, + pathRewrite: { '^/baidu-api': '' }, } }, test: { diff --git a/package.json b/package.json index cbf8ca3..85ebee6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.62", + "version": "4.5.64", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/BussinessProject/search.tsx b/src/pages/BussinessProject/search.tsx index 7aa2938..14c8edf 100644 --- a/src/pages/BussinessProject/search.tsx +++ b/src/pages/BussinessProject/search.tsx @@ -20,6 +20,7 @@ import { contractType } from "../contract/emun"; import ProjectDetail from './detail' import PageTitleBox from '@/components/PageTitleBox'; import { CurrentUser } from 'umi'; +import LeftSelectTree from '../reports/settlementAccount/component/leftSelectTree'; const { Text } = Typography; @@ -191,43 +192,16 @@ const ProjecetTable: React.FC<{ currentUser?: CurrentUser }> = (props) => { ]; return ( - - - { setCollapsible(!collapsible) }} />} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - actionRef?.current?.reload() - }} - // switcherIcon={} - /> : ''} - - +
+
+ + +
{/* 项目页面 表格主体 */} headerTitle={} @@ -302,25 +276,26 @@ const ProjecetTable: React.FC<{ currentUser?: CurrentUser }> = (props) => { // }} pagination={{ defaultPageSize: 10 }} // 翻页默认10条分页 /> - {/* 查看项目详情 右侧弹出的抽屉 */} - { // 关闭抽屉 则在清空选中行数据 并 设置抽屉状态为关闭 - setCurrentRow(undefined); - setShowDetail(false); - }} - bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} - closable={false} - > - {/* 抽屉打开时 加载项目详情组件 */} - {showDetail && } - - - - +
+ + {/* 查看项目详情 右侧弹出的抽屉 */} + { // 关闭抽屉 则在清空选中行数据 并 设置抽屉状态为关闭 + setCurrentRow(undefined); + setShowDetail(false); + }} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} + closable={false} + > + {/* 抽屉打开时 加载项目详情组件 */} + {showDetail && } + +
+
); } diff --git a/src/pages/User/ForgetPassword/index.tsx b/src/pages/User/ForgetPassword/index.tsx index 51f3002..e5dfefc 100644 --- a/src/pages/User/ForgetPassword/index.tsx +++ b/src/pages/User/ForgetPassword/index.tsx @@ -7,7 +7,7 @@ * @Description: 商户忘记密码页面 */ -import { getSMSIdentityCode, modifyUserPassword } from "@/pages/account/setting/sevice"; +import { getSMSIdentityCode, handleModifyPasswordByPassport, modifyUserPassword } from "@/pages/account/setting/sevice"; import ProForm, { ProFormCaptcha, ProFormText } from "@ant-design/pro-form"; import type { FormInstance } from "antd"; @@ -70,21 +70,32 @@ const ForgetPasswordContent: React.FC = () => { const newValue = { ...values, DataType: 2000 } let success = null - delete newValue.ComfirmPassword + delete newValue.USER_COMFIRMPASSWORD - success = await handelResetPassWord({ ...newValue }) - setSubmitting(false) - if (success) { + console.log('newValue', newValue); + + success = await handleModifyPasswordByPassport({ ...newValue }) + console.log('success', success); + if (success.Result_Code === 100) { + message.success(success.Result_Data) setStep(2) return true + } else { + message.error(success.Result_Desc) + return false } - return false + // success = await handelResetPassWord({ ...newValue }) + // setSubmitting(false) + // if (success) { + // setStep(2) + // return true + // } + // return false }} > - - + {/* 原手机号验证方式 - 已注释 { ]} /> + */} + + {/* 新的账号+原密码验证方式 */} + 账号, + }} + name="PassportName" + rules={[ + { + required: true, + message: '请输入账号' + } + ]} + + validateTrigger="onBlur" + hasFeedback + placeholder="请输入账号" + /> + 原密码, + }} + name="OriPassword" + rules={[ + { + required: true, + message: '请输入原密码' + } + ]} + placeholder="请输入原密码" + /> = (props) => { function successCallBack(req: any) { } - useEffect(() => { + useEffect(async () => { // 第三方 说是不安全 // fetch('https://api.ipify.org?format=json').then(response => response.json()) // .then(json => console.log(json.ip)); @@ -118,16 +119,31 @@ const Login: React.FC = (props) => { // alert('您的浏览器不支持定位功能') // } - // 可以一条龙拿到的 - fetch('https://qifu-api.baidubce.com/ip/local/geo/v1/district').then(response => response.text()).then(data => { - const obj: any = JSON.parse(data).data - const res = { - ...obj, - ip: JSON.parse(data).ip - } - session.set('basicInfo', res); - setBaseInfo(res) - }); + // 先拿到ip + let IpInfo: any = await getUserIP() + console.log('IpInfoIpInfoIpInfoIpInfo', IpInfo); + // 用ip 去获取信息 + let ipDetail: any = await getLocationByIP(IpInfo, 'XrQQuNQRGxap9YH2xmvx3dzuJVkXhTzT') + console.log('ipDetailipDetailipDetail', ipDetail); + const ipRes: any = { + country: ipDetail.country, + prov: ipDetail.province, + city: ipDetail.city, + district: ipDetail.district, + ip: IpInfo, + } + session.set('basicInfo', ipRes); + setBaseInfo(ipRes) + // // 可以一条龙拿到的 + // fetch('https://qifu-api.baidubce.com/ip/local/geo/v1/district').then(response => response.text()).then(data => { + // const obj: any = JSON.parse(data).data + // const res = { + // ...obj, + // ip: JSON.parse(data).ip + // } + // session.set('basicInfo', res); + // setBaseInfo(res) + // }); const browserVersion = getBrowserVersion(); session.set('browserVersion', browserVersion); @@ -328,11 +344,12 @@ const Login: React.FC = (props) => { - {/*
+
- 商户注册 | 忘记密码? + {/* 商户注册 | */} + 忘记密码? -
*/} +
温馨提示

diff --git a/src/pages/account/setting/sevice.tsx b/src/pages/account/setting/sevice.tsx index fd40f11..e3cfc3b 100644 --- a/src/pages/account/setting/sevice.tsx +++ b/src/pages/account/setting/sevice.tsx @@ -1,5 +1,6 @@ import request from "@/utils/request"; import type { CloudChangeUserModel, CloudChangePassword } from './data'; +import requestEncryption from "@/utils/requestEncryption"; // 更新账户信息 export async function modifyUserInfo(data: CloudChangeUserModel) { @@ -48,3 +49,21 @@ export async function modifyUserMobilePhone(data: CloudChangeUserModel) { // requestType: 'form', }); } + + +// 根据用户账号修改密码 +export async function handleModifyPasswordByPassport(params: any) { + const data = await requestEncryption(`/Logging/ModifyPasswordByPassport`, { + method: 'POST', + data: { + ...params, + requestEncryption: true + }, + }) + + if (data.Result_Code !== 100) { + return data + } + + return data +} \ No newline at end of file diff --git a/src/pages/reports/BusinessProject/index.tsx b/src/pages/reports/BusinessProject/index.tsx index 31b9343..dc1d0d0 100644 --- a/src/pages/reports/BusinessProject/index.tsx +++ b/src/pages/reports/BusinessProject/index.tsx @@ -39,6 +39,8 @@ import '@/pages/merchantManagement/style.less'; import session from "@/utils/session"; import { getDetail } from "@/pages/basicManage/Serverpart/service"; import PageTitleBox from '@/components/PageTitleBox'; +import { formatTreeData } from '@/utils/format'; +import { exportXlsxFromProColumnsExcelJS } from '@/utils/exportExcelFun'; const { Text } = Typography; @@ -82,6 +84,8 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { const [collapsible, setCollapsible] = useState(false) // 选中的服务区名称 const [serviceName, setSelectServiceName] = useState() + // 导出excel数据 + const [reqDetailList, setReqDetailList] = useState(); // 加载服务区树 const { loading: treeLoading, data: treeView = [] } = useRequest(() => { return getServerpartTree(currentUser?.ProvinceCode) }) // 表格数据 @@ -245,375 +249,391 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { // 打印报表 setPrintOut(el); }}> - - - { setCollapsible(!collapsible) }} />} - colSpan={!collapsible ? "300px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {!treeLoading &&

{ - // 拿到选择的服务区名称给导出的文件赋值 - if (treeView && treeView.length > 0) { - treeView.forEach((i: any) => { - if (i.children && i.children.length > 0) { - i.children.forEach((subItem: any) => { - if (subItem.key === item.key) { - setSelectServiceName(subItem.label) - } - }) - } - }) - } - loadSelectedId(item) - }} - > - {getMenuDom(treeView, loadSelectedId)} - } - - - - cardProps={{ // 去除表格内边距 - bodyStyle: { padding: 24 } - }} - bordered={true} - rowKey="REVENUECONFIRM_ID" - headerTitle={} - actionRef={actionRef} - search={{ span: 6, labelWidth: 'auto' }} - // manualRequest={true} // 是否需要手动触发首次请求, 配置为 true 时不可隐藏搜索表单 - request={async (pramas, sorter) => { - const sortstr = Object.keys(sorter).map(n => { - const value = sorter[n] - return value ? `${n} ${value.replace('end', '')}` : '' - }) - - const data = await getRevenueConfirmList({ - ServerpartId: selectedId && selectedId.length > 0 ? selectedId[0].split('-')[1] : currenMenu || '0', - StartDate: pramas.StartDate || '', - EndDate: pramas.EndDate || '', - sortstr: sortstr.toString() - } as RevenueConfirmParams - ) - setTableData(data.data) - return { - ...data, data: data.data.map((n: RevenueConfirmModel) => { - return { ...n, shopids: n.SERVERPARTSHOP_ID ? n.SERVERPARTSHOP_ID.split(',') : [] } - }) - } - }} - options={false} - columns={revenuenColumns} - pagination={false} - rowSelection={{ - onChange: (selectedRowKeys, selectedRows) => { - setSelectShops(selectedRows) - } - }} - toolbar={{ - actions: [ - // react打印插件 - ( - - )} - // 点击触发的事件 - content={() => { - // printOut是整个页面的dom 一般情况都是有的 - if (printOut) { - // 标题 先找到标题的dom元素 - const title = document.createElement('p') - // 设置标题dom元素的内容 - title.innerHTML = `${currentServiceName}合作单位保底提成结算表` - // 给标题dom设置样式 - title.setAttribute('style', 'font-size:20px;font-weight:600;display:flex;width:100%;justify-content: center;') - - // 日期时间 timeUnit为父节点 time和date为子节点 显示打印内容标题下面 表格上面的那一块区域 - const timeUnit = document.createElement('div') - const time = document.createElement('div') - const date = document.createElement('div') - // 时间显示的内容 - time.innerHTML = `日期: ${moment().format('YYYY年MM月DD日')}` - date.innerHTML = `单位: 元` - // 加入到父节点中去 - timeUnit.appendChild(time) - timeUnit.appendChild(date) - // 样式 - timeUnit.setAttribute('style', 'width:100%;display:flex;justify-content: space-between;margin-bottom:15px;') - - // 数据内容 打印的表格dom - // 表格的dom元素 - const dataList = document.getElementsByClassName('ant-table-content') - // 克隆出来不影响原页面 - const domNoChange = dataList[0].cloneNode(true) - // 拿到是不是有已经被选中的行 - const length = selectShops ? selectShops.length : false - if (length) { - // 拿到表头的dom - const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') - // 表头增加样式 - tableHeader[0].setAttribute('style', 'width:100%;background: #fafafa;') - // 拿到每一列的标题 - const th = tableHeader[0].getElementsByTagName("th"); - // 由于页面的表头和效果图要的不一样 所以就自定义一个效果图上要的表头数组 - // 由于这个页面莫名其妙在每行的后面都有一个空节点,所以最后给他赋值个空的 - const titleText = ['合作单位', '结算起止时间', '营业额', '提成标准', '提成额', '保证租金', '备注说明', ''] - const headList: { innerHTML: string; }[] = [] - // th的第一个节点删除是因为要把选择框的节点去掉 打印不能有选择框出现 - th.forEach((item: { innerHTML: string; }, index: string | number) => { - if (index === 0) { - item.remove() - } else if (index <= 7 && index !== 0) { - // 页面需要的节点 给他赋值上需要的标题 然后添加到一个数组里面 - item.innerHTML = titleText[index] - headList.push(item) - } - }) - // 不让标题内容换行 minWidth无法适配 只能不换行来满足需求 - th.forEach((item: { innerHTML: string; }, index: string | number) => { - // 因为最后一个节点还是空节点所以不让最后一个不换行 其实问题也不大 - if (index !== th.length - 1) { - item.style.whiteSpace = 'nowrap' - } - }) - // 表单打印的数据内容 - // 表单的数据节点 - const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') - // 每一行数据 - const tr = tableBody[0].getElementsByTagName('tr') - // 哪几行是没被选中的索引列表 - const numList: any[] = [] - // 遍历每一行数据 - tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any) => { - // 拿到打钩的那个节点 如果这个节点下的checked节点为true那就是被选中了 false就是没选中 - const isChecked = item.getElementsByClassName('ant-checkbox-input') - // 没被选中的行数的索引被添加到数组中 - if (!isChecked[0].checked) { - numList.push(index) - } - }) - // 倒序的for循环 正序的话当一个节点删除时 下一个节点会到刚刚删除的节点位置 无法参与判断 - // 如果是没选中的节点就直接移除掉 留下来的节点都是选中的节点 - for (let i = tr.length - 1; i >= 0; i -= 1) { - numList.forEach(item => { - if (i === item) { - tr[i].remove() - } - }) - } - // 选中的节点继续遍历 - tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any) => { - // 因为页面的dom元素和要求图的dom元素不一样 所以用list先存页面中的数据 - const list: any[] = [] - // 获得每一行的 每一列对应的节点 - const td = item.getElementsByTagName('td') - // 遍历一行的数据 - td.forEach((subItem: { innerHTML: any; }, subIndex: number) => { - // 背景都变成白色 - subItem.style.backgroundColor = 'white' - // 因为td的第一项是选择框 所以不放进数据列表中 - if (subIndex >= 1) { - list.push(subItem.innerHTML) - } - }) - // 把选择框的dom节点移除 - td[0].remove() - // 拼接数据 - td.forEach((subItem: { innerHTML: string; }, subIndex: number) => { - subItem.style.backgroundColor = 'white' - if (subIndex === 0) { - subItem.innerHTML = list[0] - subItem.style.whiteSpace = 'nowrap' - } else if (subIndex === 1) { - // 时间数据的拼接 - subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` - subItem.style.whiteSpace = 'nowrap' - } else if (subIndex > 1 && subIndex <= 6) { - // 因为上面拼接了一个 所以索引加1 小于6 是因为 要求的数据只有七行 但是会有一个空节点 - subItem.innerHTML = list[subIndex + 1] - if (subIndex !== 6) { - // 备注就让它可以换行 - subItem.style.whiteSpace = 'nowrap' - } - } else { - subItem.style.backgroundColor = 'white' - } - }) - }) - } else { - // 没有选中任何一行 就默认打印全部 - // 表头dom节点 逻辑和上面差不多 就是没有了是否选中的判断 - const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') - const th = tableHeader[0].getElementsByTagName("th"); - const titleText = ['合作单位', '结算起止时间', '营业额', '提成标准', '提成额', '保证租金', '备注说明', ''] - const headList: { innerHTML: string; }[] = [] - th[0].remove() - th.forEach((item: { innerHTML: string; }, index: string | number) => { - if (index !== th.length - 1) { - item.style.whiteSpace = 'nowrap' - } - if (index <= 7 && index >= 0) { - item.innerHTML = titleText[index] - headList.push(item) - } else { - item.style.maxWidth = '0px' - } - }) - // 数据内容 - const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') - const tr = tableBody[0].getElementsByTagName('tr') - // 先遍历每一行的数据 拿到每一行中的数据 - tr.forEach((item: { getElementsByTagName: (arg0: string) => any; }, index: any) => { - const list: any[] = [] - const td = item.getElementsByTagName('td') - // 再对每一行的数据进行遍历 把原本的值先存一份 - td.forEach((subItem: { innerHTML: any; }, subIndex: number) => { - if (subIndex >= 1) { - list.push(subItem.innerHTML) - } - }) - td[0].remove() - td.forEach((subItem: { innerHTML: string; }, subIndex: number) => { - if (subIndex === 0) { - subItem.innerHTML = list[0] - subItem.style.whiteSpace = 'nowrap' - } else if (subIndex === 1) { - subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` - subItem.style.whiteSpace = 'nowrap' - } else if (subIndex > 1 && subIndex <= 6) { - subItem.innerHTML = list[subIndex + 1] - if (subIndex !== 6) { - subItem.style.whiteSpace = 'nowrap' - } - } else { - item.setAttribute('style', 'width: 0%') - } - }) - }) - } - // 表单底部签字盖章数据 - // 创建一个父节点 下面三个子节点 然后flex布局变掉 加一个当前用户的名称就可以 - const currentUser = session.get('currentUser'); - const signAndSeal = document.createElement('div') - signAndSeal.setAttribute('style', 'width:100%;display:flex;align-item:center;justify-content: space-between;margin-top:20px') - const serviceSeal = document.createElement('div') - const companySeal = document.createElement('div') - const makeExcel = document.createElement('div') - serviceSeal.innerHTML = '服务区 (签字盖章) :' - companySeal.innerHTML = '合作单位 (签字盖章) :' - makeExcel.innerHTML = `制表人 : ${currentUser.Name}` - makeExcel.setAttribute('style', 'text-align:right') - signAndSeal.appendChild(serviceSeal) - signAndSeal.appendChild(companySeal) - signAndSeal.appendChild(makeExcel) - // printContract方法也就是把第一个形参数组里面的每一项拼到一个父节点的里面 然后return出来 - const ele = printContract([title || '', timeUnit || '', domNoChange || '', signAndSeal || ''], ''); - // content方法中return出来的值 就会自动调起ReactToPrint依赖 然后根据ele来打印 - return ele - } - // 拿不到整个页面dom就输出空 但是一般不会拿不到 - return '' - }} - />, - - // ( - // - // )} - // content={() => { - // // printOut是整个页面的dom 一般情况都是有的 - // if (printOut){ - // const ele = handlePrint(printOut) - // return ele - // } - // return '' - // }} - // /> - ] - }} - /> - - - {/* 查看项目详情 右侧弹出的抽屉 */} - { // 关闭抽屉 设置抽屉状态为关闭 - setShowDetail(false); - setProject(undefined); - setCurrentRow(undefined); - }} - bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} - closable={false} +
+ { setCollapsible(!collapsible) }} />} + colSpan={!collapsible ? "300px" : "60px"} + title={!collapsible ? "请选择服务区" : ""} + headerBordered + collapsed={collapsible} > - {/* 抽屉打开时 加载项目详情组件 */} - {showDetail && } - - -
+ {!treeLoading && { + // 拿到选择的服务区名称给导出的文件赋值 + if (treeView && treeView.length > 0) { + treeView.forEach((i: any) => { + if (i.children && i.children.length > 0) { + i.children.forEach((subItem: any) => { + if (subItem.key === item.key) { + setSelectServiceName(subItem.label) + } + }) + } + }) + } + loadSelectedId(item) + }} + > + {getMenuDom(treeView, loadSelectedId)} + } + +
+ } + actionRef={actionRef} + scroll={{ x: "100%", y: "calc(100vh - 400px)" }} + search={{ span: 6, labelWidth: 'auto' }} + // manualRequest={true} // 是否需要手动触发首次请求, 配置为 true 时不可隐藏搜索表单 + request={async (pramas, sorter) => { + const sortstr = Object.keys(sorter).map(n => { + const value = sorter[n] + return value ? `${n} ${value.replace('end', '')}` : '' + }) + + const data = await getRevenueConfirmList({ + ServerpartId: selectedId && selectedId.length > 0 ? selectedId[0].split('-')[1] : currenMenu || '0', + StartDate: pramas.StartDate || '', + EndDate: pramas.EndDate || '', + sortstr: sortstr.toString() + } as RevenueConfirmParams + ) + let fieldData: any = [ + "ACTUAL_REVENUE", + "PARTYA_SHAREPROFIT", + "GUARANTEE_AMOUNT", + ] + let enumList: any = [] + let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data.data)), fieldData, enumList, [], ["GUARANTEERATIO"]) + setReqDetailList(newPrintData) + setTableData(data.data) + return { + ...data, data: data.data.map((n: RevenueConfirmModel) => { + return { ...n, shopids: n.SERVERPARTSHOP_ID ? n.SERVERPARTSHOP_ID.split(',') : [] } + }) + } + }} + options={false} + columns={revenuenColumns} + pagination={false} + rowSelection={{ + onChange: (selectedRowKeys, selectedRows) => { + setSelectShops(selectedRows) + } + }} + toolbar={{ + actions: [ + // react打印插件 + ( + + )} + // 点击触发的事件 + content={() => { + // printOut是整个页面的dom 一般情况都是有的 + if (printOut) { + // 标题 先找到标题的dom元素 + const title = document.createElement('p') + // 设置标题dom元素的内容 + title.innerHTML = `${currentServiceName}合作单位保底提成结算表` + // 给标题dom设置样式 + title.setAttribute('style', 'font-size:20px;font-weight:600;display:flex;width:100%;justify-content: center;') + + // 日期时间 timeUnit为父节点 time和date为子节点 显示打印内容标题下面 表格上面的那一块区域 + const timeUnit = document.createElement('div') + const time = document.createElement('div') + const date = document.createElement('div') + // 时间显示的内容 + time.innerHTML = `日期: ${moment().format('YYYY年MM月DD日')}` + date.innerHTML = `单位: 元` + // 加入到父节点中去 + timeUnit.appendChild(time) + timeUnit.appendChild(date) + // 样式 + timeUnit.setAttribute('style', 'width:100%;display:flex;justify-content: space-between;margin-bottom:15px;') + + // 数据内容 打印的表格dom + // 表格的dom元素 + const dataList = document.getElementsByClassName('ant-table-content') + // 克隆出来不影响原页面 + const domNoChange = dataList[0].cloneNode(true) + // 拿到是不是有已经被选中的行 + const length = selectShops ? selectShops.length : false + if (length) { + // 拿到表头的dom + const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') + // 表头增加样式 + tableHeader[0].setAttribute('style', 'width:100%;background: #fafafa;') + // 拿到每一列的标题 + const th = tableHeader[0].getElementsByTagName("th"); + // 由于页面的表头和效果图要的不一样 所以就自定义一个效果图上要的表头数组 + // 由于这个页面莫名其妙在每行的后面都有一个空节点,所以最后给他赋值个空的 + const titleText = ['合作单位', '结算起止时间', '营业额', '提成标准', '提成额', '保证租金', '备注说明', ''] + const headList: { innerHTML: string; }[] = [] + // th的第一个节点删除是因为要把选择框的节点去掉 打印不能有选择框出现 + th.forEach((item: { innerHTML: string; }, index: string | number) => { + if (index === 0) { + item.remove() + } else if (index <= 7 && index !== 0) { + // 页面需要的节点 给他赋值上需要的标题 然后添加到一个数组里面 + item.innerHTML = titleText[index] + headList.push(item) + } + }) + // 不让标题内容换行 minWidth无法适配 只能不换行来满足需求 + th.forEach((item: { innerHTML: string; }, index: string | number) => { + // 因为最后一个节点还是空节点所以不让最后一个不换行 其实问题也不大 + if (index !== th.length - 1) { + item.style.whiteSpace = 'nowrap' + } + }) + // 表单打印的数据内容 + // 表单的数据节点 + const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') + // 每一行数据 + const tr = tableBody[0].getElementsByTagName('tr') + // 哪几行是没被选中的索引列表 + const numList: any[] = [] + // 遍历每一行数据 + tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any) => { + // 拿到打钩的那个节点 如果这个节点下的checked节点为true那就是被选中了 false就是没选中 + const isChecked = item.getElementsByClassName('ant-checkbox-input') + // 没被选中的行数的索引被添加到数组中 + if (!isChecked[0].checked) { + numList.push(index) + } + }) + // 倒序的for循环 正序的话当一个节点删除时 下一个节点会到刚刚删除的节点位置 无法参与判断 + // 如果是没选中的节点就直接移除掉 留下来的节点都是选中的节点 + for (let i = tr.length - 1; i >= 0; i -= 1) { + numList.forEach(item => { + if (i === item) { + tr[i].remove() + } + }) + } + // 选中的节点继续遍历 + tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any) => { + // 因为页面的dom元素和要求图的dom元素不一样 所以用list先存页面中的数据 + const list: any[] = [] + // 获得每一行的 每一列对应的节点 + const td = item.getElementsByTagName('td') + // 遍历一行的数据 + td.forEach((subItem: { innerHTML: any; }, subIndex: number) => { + // 背景都变成白色 + subItem.style.backgroundColor = 'white' + // 因为td的第一项是选择框 所以不放进数据列表中 + if (subIndex >= 1) { + list.push(subItem.innerHTML) + } + }) + // 把选择框的dom节点移除 + td[0].remove() + // 拼接数据 + td.forEach((subItem: { innerHTML: string; }, subIndex: number) => { + subItem.style.backgroundColor = 'white' + if (subIndex === 0) { + subItem.innerHTML = list[0] + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex === 1) { + // 时间数据的拼接 + subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex > 1 && subIndex <= 6) { + // 因为上面拼接了一个 所以索引加1 小于6 是因为 要求的数据只有七行 但是会有一个空节点 + subItem.innerHTML = list[subIndex + 1] + if (subIndex !== 6) { + // 备注就让它可以换行 + subItem.style.whiteSpace = 'nowrap' + } + } else { + subItem.style.backgroundColor = 'white' + } + }) + }) + } else { + // 没有选中任何一行 就默认打印全部 + // 表头dom节点 逻辑和上面差不多 就是没有了是否选中的判断 + const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') + const th = tableHeader[0].getElementsByTagName("th"); + const titleText = ['合作单位', '结算起止时间', '营业额', '提成标准', '提成额', '保证租金', '备注说明', ''] + const headList: { innerHTML: string; }[] = [] + th[0].remove() + th.forEach((item: { innerHTML: string; }, index: string | number) => { + if (index !== th.length - 1) { + item.style.whiteSpace = 'nowrap' + } + if (index <= 7 && index >= 0) { + item.innerHTML = titleText[index] + headList.push(item) + } else { + item.style.maxWidth = '0px' + } + }) + // 数据内容 + const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') + const tr = tableBody[0].getElementsByTagName('tr') + // 先遍历每一行的数据 拿到每一行中的数据 + tr.forEach((item: { getElementsByTagName: (arg0: string) => any; }, index: any) => { + const list: any[] = [] + const td = item.getElementsByTagName('td') + // 再对每一行的数据进行遍历 把原本的值先存一份 + td.forEach((subItem: { innerHTML: any; }, subIndex: number) => { + if (subIndex >= 1) { + list.push(subItem.innerHTML) + } + }) + td[0].remove() + td.forEach((subItem: { innerHTML: string; }, subIndex: number) => { + if (subIndex === 0) { + subItem.innerHTML = list[0] + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex === 1) { + subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex > 1 && subIndex <= 6) { + subItem.innerHTML = list[subIndex + 1] + if (subIndex !== 6) { + subItem.style.whiteSpace = 'nowrap' + } + } else { + item.setAttribute('style', 'width: 0%') + } + }) + }) + } + // 表单底部签字盖章数据 + // 创建一个父节点 下面三个子节点 然后flex布局变掉 加一个当前用户的名称就可以 + const currentUser = session.get('currentUser'); + const signAndSeal = document.createElement('div') + signAndSeal.setAttribute('style', 'width:100%;display:flex;align-item:center;justify-content: space-between;margin-top:20px') + const serviceSeal = document.createElement('div') + const companySeal = document.createElement('div') + const makeExcel = document.createElement('div') + serviceSeal.innerHTML = '服务区 (签字盖章) :' + companySeal.innerHTML = '合作单位 (签字盖章) :' + makeExcel.innerHTML = `制表人 : ${currentUser.Name}` + makeExcel.setAttribute('style', 'text-align:right') + signAndSeal.appendChild(serviceSeal) + signAndSeal.appendChild(companySeal) + signAndSeal.appendChild(makeExcel) + // printContract方法也就是把第一个形参数组里面的每一项拼到一个父节点的里面 然后return出来 + const ele = printContract([title || '', timeUnit || '', domNoChange || '', signAndSeal || ''], ''); + // content方法中return出来的值 就会自动调起ReactToPrint依赖 然后根据ele来打印 + return ele + } + // 拿不到整个页面dom就输出空 但是一般不会拿不到 + return '' + }} + />, + + // ( + // + // )} + // content={() => { + // // printOut是整个页面的dom 一般情况都是有的 + // if (printOut){ + // const ele = handlePrint(printOut) + // return ele + // } + // return '' + // }} + // /> + ] + }} + /> +
+
+ {/* 查看项目详情 右侧弹出的抽屉 */} + { // 关闭抽屉 设置抽屉状态为关闭 + setShowDetail(false); + setProject(undefined); + setCurrentRow(undefined); + }} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} + closable={false} + > + {/* 抽屉打开时 加载项目详情组件 */} + {showDetail && } + + ); } diff --git a/src/pages/reports/ConfirmationDifference/index.tsx b/src/pages/reports/ConfirmationDifference/index.tsx index 7385d07..f1f5385 100644 --- a/src/pages/reports/ConfirmationDifference/index.tsx +++ b/src/pages/reports/ConfirmationDifference/index.tsx @@ -31,6 +31,7 @@ import RevenueSecondList from "../revenueConfirmation/components/RevenueSecondLi import { point } from "@antv/g2plot"; import CalibrationDifference from "./component/calibrationDifference"; import { handleHighPrecision } from "@/utils/utils"; +import LeftSelectTree from "../settlementAccount/component/leftSelectTree"; const revenueConfirmationDifference: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props @@ -1239,7 +1240,14 @@ const revenueConfirmationDifference: React.FC<{ currentUser: CurrentUser }> = (p
- { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + const selectedAreaIds = info.checkedNodes.filter(n => n?.type === 0) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + console.log('selectedAreaIds', selectedAreaIds.map(n => n?.value)?.toString() || ''); + setSelectAreaId(selectedAreaIds.map(n => n?.value)?.toString() || '') + }} /> + {/* = (p }} // switcherIcon={} /> : ''} - + */}
{ @@ -294,7 +295,7 @@ const INVESTMENTANALYSISTable: React.FC<{ currentUser: CurrentUser | undefined } }, { - dataIndex: 'SERVERPART_NAME', + dataIndex: 'SERVERPARTSHOP_NAME|SERVERPART_NAME|SERVERPART_NAME', title: '服务区名称', align: 'center', hideInSearch: true, @@ -970,7 +971,43 @@ const INVESTMENTANALYSISTable: React.FC<{ currentUser: CurrentUser | undefined } } }) - setReqDetailList(data) + + + let fieldData: any = [ + "ADJUST_RENT", + "MINTURNOVER", + "ADJUST_AMOUNT", + "GUARANTEE_MINPRICE", + "GUARANTEE_MAXPRICE", + "GUARANTEE_AVGPRICE", + "PROFIT_AMOUNT", + "REVENUE_LASTAMOUNT", + "PROFIT_TOTALAMOUNT", + ] + + let enumList: any = [ + "SERVERPART_TYPE", + "BUSINESS_TRADE", + "BUSINESS_PTRADE", + ] + + let rateList: any = [ + "RENT_RATIO", + "PERIOD_DEGREE", + "ADJUST_RATIO", + "GUARANTEERATIO", + "RATIOCHANGE", + "COMMISSION_RATIO", + "PROFIT_AVG", + "COMMISSION_MINRATIO", + "COMMISSION_MAXRATIO", + "COMMISSION_AVGRATIO", + ] + + let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [ServerpartTypeObj, BusinessTradeIdsObj, BusinessTradeIdsObj], rateList) + setReqDetailList(newPrintData) + + setUpdateTime(data[0].RECORD_DATE ? moment(data[0].RECORD_DATE).format('YYYY-MM-DD') : '') console.log('datadatadata', data); diff --git a/src/pages/reports/Finance/RevenueSplit.tsx b/src/pages/reports/Finance/RevenueSplit.tsx index ba98ef3..bdc65d5 100644 --- a/src/pages/reports/Finance/RevenueSplit.tsx +++ b/src/pages/reports/Finance/RevenueSplit.tsx @@ -25,6 +25,7 @@ import ReactHTMLTableToExcel from "react-html-table-to-excel"; import Finance from "@/pages/reports/Finance/index"; import Merchant from '@/pages/reports/ShopExpenseDetail/detail' import './RevenueSplit.less' +import LeftSelectTree from '../settlementAccount/component/leftSelectTree'; const { Text } = Typography; @@ -63,12 +64,12 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { const [printOut, setPrintOut] = useState(); // 打印数据的内容 const [expandRow, setExpandRow] = useState([]); // 选择打开的服务区 const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 - const [fileName,setFileName] = useState()// 文件名称 - const [showDrawer,setShowDrawer] = useState(false)// 抽屉是否打开 - const [showAmount,setShowAmount] = useState(false)// 商家缴款的抽屉 - const [currentRow,setCurrentRow] = useState() - const [searchTime,setSearchTime] = useState()// 时间 - const [serviceShopId,setServiceShopId] = useState('')// 选中的门店id + const [fileName, setFileName] = useState()// 文件名称 + const [showDrawer, setShowDrawer] = useState(false)// 抽屉是否打开 + const [showAmount, setShowAmount] = useState(false)// 商家缴款的抽屉 + const [currentRow, setCurrentRow] = useState() + const [searchTime, setSearchTime] = useState()// 时间 + const [serviceShopId, setServiceShopId] = useState('')// 选中的门店id // 请求服务区树列表 const { loading: treeLoading, data: treeView } = useRequest(async () => { return getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, false, true) @@ -76,7 +77,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { const [collapsible, setCollapsible] = useState(false) const [selectedId, setSelectedId] = useState() // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) const columns: ProColumns[] = [ { title: '序号', @@ -89,16 +90,16 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { dataIndex: 'MERCHANTS_NAME', title: '经营单位', align: 'left', - ellipsis:true, + ellipsis: true, hideInSearch: true, hideInDescriptions: true, render: (_, record) => { - return { - if (record.index && record.index.indexOf('.')!==-1){ + return { + if (record.index && record.index.indexOf('.') !== -1) { setCurrentRow(record.BUSINESSPROJECT_ID) setShowDrawer(true) } - }} style={{color:record.index && record.index.indexOf('.')!==-1?'#1890ff':'',cursor:record.index && record.index.indexOf('.')!==-1?'pointer':''}}> + }} style={{ color: record.index && record.index.indexOf('.') !== -1 ? '#1890ff' : '', cursor: record.index && record.index.indexOf('.') !== -1 ? 'pointer' : '' }}> {record?.MERCHANTS_NAME || record?.SERVERPART_NAME || record?.SPREGIONTYPE_NAME} }, @@ -126,13 +127,13 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { hideInDescriptions: true, valueType: 'digit', render: (_, record) => { - return { - if (record.index && record.index.indexOf('.')!==-1){ + return { + if (record.index && record.index.indexOf('.') !== -1) { setServiceShopId(record.SERVERPARTSHOP_ID.split(',')[0]) setShowAmount(true) } - }}style={{color:record.index && record.index.indexOf('.')!==-1?'#1890ff':'',cursor:record.index && record.index.indexOf('.')!==-1?'pointer':''}}> + }} style={{ color: record.index && record.index.indexOf('.') !== -1 ? '#1890ff' : '', cursor: record.index && record.index.indexOf('.') !== -1 ? 'pointer' : '' }}> {record?.ACCOUNT_AMOUNT} }, @@ -195,21 +196,21 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, }, ] - useEffect(()=>{ + useEffect(() => { actionRef.current?.reload() - },[props.ServerpartId]) + }, [props.ServerpartId]) // 把数据处理的更加细节 - const handleGetDateDetail = (showIndexList: any,params: any,objList: any,item: any)=>{ - showIndexList.forEach((smallItem: any,smallIndex: number)=>{ - const res = params.filter((paramsItem: any)=>smallItem.dataIndex===paramsItem.name) - if (res && res.length>0){ - if (res[0].type==='render'){ + const handleGetDateDetail = (showIndexList: any, params: any, objList: any, item: any) => { + showIndexList.forEach((smallItem: any, smallIndex: number) => { + const res = params.filter((paramsItem: any) => smallItem.dataIndex === paramsItem.name) + if (res && res.length > 0) { + if (res[0].type === 'render') { objList[smallIndex].innerText = res[0].fun(item) - }else if(res[0].type==='select'){ - objList[smallIndex].innerText = res[0].fun[item[smallItem.dataIndex]] ? res[0].fun[item[smallItem.dataIndex]] :'-' + } else if (res[0].type === 'select') { + objList[smallIndex].innerText = res[0].fun[item[smallItem.dataIndex]] ? res[0].fun[item[smallItem.dataIndex]] : '-' } - }else{ + } else { objList[smallIndex].innerText = item[smallItem.dataIndex] } }) @@ -316,7 +317,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { // const tableToXls = document.getElementById('RevenueSplit-to-xls') // container.removeChild(tableToXls) // } - const handleMERCHANTSNAME = (record: any)=>{ + const handleMERCHANTSNAME = (record: any) => { return record?.MERCHANTS_NAME || record?.SERVERPART_NAME || record?.SPREGIONTYPE_NAME } @@ -345,7 +346,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { // 打印报表 setPrintOut(el); }}> -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
- +
+
{ // 判断是不是组件 是组件的话 左边的选择列表就不会显示 props.isComponents ? <> : - { - setCollapsible(!collapsible) - }}/>} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - // actionRef?.current?.reload() - }} - // switcherIcon={} - /> : ''} - + } - -
+
rowKey={(record) => { return `${`${record?.SPREGIONTYPE_ID}|${record?.SERVERPART_ID}|${record?.SERVERPARTSHOP_ID}`}` }} className={props.isComponents && reqDetailList && reqDetailList.length === 0 ? 'RevenueSplitProTable hideBottom' : props.isComponents ? 'RevenueSplitProTable' : ''} headerTitle={ 0 ? '' : 'red'}}>{reqDetailList && reqDetailList.length > 0 ? "合作单位营业额分成到账汇总表" : "*服务区未有营收分润项目"}} // 列表表头 + style={{ color: reqDetailList && reqDetailList.length > 0 ? "#1890ff" : 'red', fontSize: 14, fontWeight: 600 }}>{reqDetailList && reqDetailList.length > 0 ? "合作单位营业额分成到账汇总表" : "*服务区未有营收分润项目"}} // 列表表头 actionRef={actionRef} formRef={formRef} - scroll={{y: 'calc(100vh - 560px)'}} - search={{span: 6, labelWidth: 'auto'}} + scroll={{ y: 'calc(100vh - 560px)' }} + search={{ span: 6, labelWidth: 'auto' }} // 请求数据 request={async (params) => { if (selectedId || props.ServerpartId) { @@ -462,15 +429,15 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { pagination={false} toolbar={{ actions: [ - - - , + + + , 单位:元, ( @@ -494,12 +461,12 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { key="new" type="primary" onClick={async (e) => { - if(reqDetailList && reqDetailList.length>0){ + if (reqDetailList && reqDetailList.length > 0) { setShowExportTable(true) - setTimeout(()=>{ + setTimeout(() => { exportTable(e) - },100) - }else{ + }, 100) + } else { message.error('暂无数据可导出!') } // if (reqDetailList) { @@ -550,7 +517,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { CASHPAY_AMOUNT: number, MOBILEPAY_AMOUNT: number, REVENUE_AMOUNT: number, SUBROYALTY_PRICE: number, ROYALTY_PRICE: number, }, currentValue: ProjectSplitSummaryModel) => { - const previousValue = {...p} + const previousValue = { ...p } previousValue.CASHPAY_AMOUNT = numeral(numeral(previousValue.CASHPAY_AMOUNT + (currentValue.CASHPAY_AMOUNT || 0)).format('0.00')).value() || 0; previousValue.MOBILEPAY_AMOUNT = numeral(numeral(previousValue.MOBILEPAY_AMOUNT + @@ -566,17 +533,17 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { CASHPAY_AMOUNT: 0, MOBILEPAY_AMOUNT: 0, REVENUE_AMOUNT: 0, SUBROYALTY_PRICE: 0, ROYALTY_PRICE: 0 }); // 显示在列表上方是的类型合计 - return
+ return
分润金额汇总}> + labelStyle={{ color: "#00000073" }} + title={分润金额汇总}> ¥{amountDom(reduceData.ROYALTY_PRICE)} ¥{amountDom(reduceData.SUBROYALTY_PRICE)} - + ¥{amountDom(reduceData.REVENUE_AMOUNT)} = (props) => { return <> }} /> - - +
+
{/* 经营门店 */} = (props) => { onClose={() => { setShowDrawer(false); }} - // maskClosable={false} + // maskClosable={false} > { showDrawer ? - + : '' } @@ -617,13 +584,13 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { > { showAmount ? - + : '' }
); } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(ShareBenefit); diff --git a/src/pages/reports/Finance/SpringFestival/index.tsx b/src/pages/reports/Finance/SpringFestival/index.tsx index a096267..bb8a6fd 100644 --- a/src/pages/reports/Finance/SpringFestival/index.tsx +++ b/src/pages/reports/Finance/SpringFestival/index.tsx @@ -19,6 +19,7 @@ import session from "@/utils/session"; import PageTitleBox from "@/components/PageTitleBox"; import AiDrawer from "@/components/AiDrawer"; import { handleChangeKeyTo, handleSetPublicLog } from "@/utils/format"; +import LeftSelectTree from "../../settlementAccount/component/leftSelectTree"; const { Text } = Typography; @@ -886,41 +887,7 @@ const SpringFestival: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, []) return ( -
- { - setCollapsible(!collapsible) - }} />} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "可筛选门店" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - // actionRef?.current?.reload() - }} - /> : ''} - +
{ @@ -936,131 +903,136 @@ const SpringFestival: React.FC<{ currentUser?: CurrentUser }> = (props) => { : '' }
- - { - return [ - , - - ] - } - }} - loading={tableLoading} - headerTitle={} - id={'table-to-xls'} - columns={columns} - bordered={true} - scroll={{ x: "100%", y: 'calc(100vh - 450px)' }} - pagination={false} - dataSource={tableData} - request={async (params) => { - console.log('params', params) - - if (!selectedId) { - setReqDetailList([]) - return - } - if (clickTableBtnRef.current) { - if (params.STATISTICS_DATE) { - setSearchDate(params.STATISTICS_DATE) - } else { - setReqDetailList([]) - setSearchDate(undefined) +
+ +
+ { + return [ + , + + ] } + }} + loading={tableLoading} + headerTitle={} + id={'table-to-xls'} + columns={columns} + bordered={true} + scroll={{ x: "100%", y: 'calc(100vh - 450px)' }} + pagination={false} + dataSource={tableData} + request={async (params) => { + console.log('params', params) - handleGetTableData(params) - } - // return {data: list || [], success: true,} - }} - toolbar={{ - actions: [ - - - , - - ], - }} - /> - - + } else { + message.error('暂无数据可导出!') + } + // const nowColumns = columns.filter(n => !n.hideInTable) + // const fat = nowColumns.map((n: any, index: number) => { + // if (n?.children) { + // return n?.children.map((m: { title: any; }) => { + // const title = index === 0 ? m.title : n.title + m.title + // return { ...m, title } + // }) + // } + // return n + // }) + // if (reqDetailList && reqDetailList.length>0){ + // const list: any = JSON.parse(JSON.stringify(reqDetailList)) + // list.forEach((item: any,index: number)=>{ + // item.index = index + 1 + // }) + // const curDate = moment(formRef.current?.getFieldValue('STATISTICS_DATE')).format('YYYYMMDD') + // const success = await exportExcelReceivedSum( + // fat.flat(), + // list || [], + // `春运营收分析_${curDate}`, + // ); + // if (success.message !== 'ok') { + // message.info({ content: success.message }); + // } + // }else{ + // message.error('暂无数据可导出!') + // } + }} + > + 导出excel + + ], + }} + /> +
+
= (props) => { return getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, false, true) }) const [reqDetailList, setReqDetailList] = useState(); // 导出excel表格 - const [fileName,setFileName] = useState() - const [exportColumns,setExportColumns] = useState() + const [fileName, setFileName] = useState() + const [exportColumns, setExportColumns] = useState() // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) const columns: any = [ { title: '服务区', @@ -234,22 +235,22 @@ const StoreDetailRevenue: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, []) - const handleGetExportTime = (cYear: string,lYeaStr: string)=>{ - if (columns && columns.length>0){ + const handleGetExportTime = (cYear: string, lYeaStr: string) => { + if (columns && columns.length > 0) { // 由于什么循环引用 导致不能深拷贝 所以重新搞个数组 const list: any = [] - columns.forEach((item: any)=>{ + columns.forEach((item: any) => { list.push(item) }) - list.forEach((item: any)=>{ - if (item.dataIndex==='lYear'){ + list.forEach((item: any) => { + if (item.dataIndex === 'lYear') { item.title = moment(lYeaStr).format('YYYY-MM-DD') - }else if(item.dataIndex==='curYear'){ + } else if (item.dataIndex === 'curYear') { item.title = moment(cYear).format('YYYY-MM-DD') } - if (item.children && item.children.length>0){ - item.children.forEach((subItem: any)=>{ - if (subItem.dataIndex === 'CurGuaranteeRatio' || subItem.dataIndex === 'CyGuaranteeRatio'){ + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { + if (subItem.dataIndex === 'CurGuaranteeRatio' || subItem.dataIndex === 'CyGuaranteeRatio') { subItem.title = '提成比例/固定租金' } }) @@ -279,25 +280,25 @@ const StoreDetailRevenue: React.FC<{ currentUser?: CurrentUser }> = (props) => { } return ( -
-
+
+
{ - showExportTable && reqDetailList && reqDetailList.length>0? + showExportTable && reqDetailList && reqDetailList.length > 0 ? - :'' + : '' }
-
+
- = (props) => { // actionRef?.current?.reload() }} /> : ''} - - - record?.Id + record?.Name} - search={{ - span: 6, - labelWidth: 100, - }} - columns={columns} - bordered={true} - headerTitle={} - scroll={{y: 'calc(100vh - 450px)'}} - pagination={false} - request={async (params: any) => { - if (curYear && curYear) { - if (!selectedId) { - return - } - const cyDate = params.lYear + */} +
+ +
+ record?.Id + record?.Name} + search={{ + span: 6, + labelWidth: 100, + }} + columns={columns} + bordered={true} + headerTitle={} + scroll={{ y: 'calc(100vh - 450px)' }} + pagination={false} + request={async (params: any) => { + if (curYear && curYear) { + if (!selectedId) { + return + } + const cyDate = params.lYear - const req = { - StatisticsDate: moment(curYear).format('YYYY-MM-DD'), - ContrastDate: moment(cyDate).format('YYYY-MM-DD'), - ServerpartIds: selectedId || '' - } - const data = await handleGetShopInCome(req) - const list = wrapTreeNode(data.List) + const req = { + StatisticsDate: moment(curYear).format('YYYY-MM-DD'), + ContrastDate: moment(cyDate).format('YYYY-MM-DD'), + ServerpartIds: selectedId || '' + } + const data = await handleGetShopInCome(req) + const list = wrapTreeNode(data.List) - let CurRevenueDailyAmountSum: number = 0 - let CurRoyaltyDailyPriceSum: number = 0 - let CurRoyaltyDailyTheorySum: number = 0 - let CurRoyaltyDailyTheoryTaxSum: number = 0 - let CyRevenueDailyAmountSum: number = 0 - let CyRoyaltyDailyPriceSum: number = 0 - let CyRoyaltyDailyTheorySum: number = 0 - let CyRoyaltyDailyTheoryTaxSum: number = 0 - if (list && list.length > 0) { - list.forEach((item: any) => { - CurRevenueDailyAmountSum += item.CurRevenueDailyAmount - CurRoyaltyDailyPriceSum += item.CurRoyaltyDailyPrice - CurRoyaltyDailyTheorySum += item.CurRoyaltyDailyTheory - CurRoyaltyDailyTheoryTaxSum += item.CurRoyaltyDailyTheoryTax - CyRevenueDailyAmountSum += item.CyRevenueDailyAmount - CyRoyaltyDailyPriceSum += item.CyRoyaltyDailyPrice - CyRoyaltyDailyTheorySum += item.CyRoyaltyDailyTheory - CyRoyaltyDailyTheoryTaxSum += item.CyRoyaltyDailyTheoryTax + let CurRevenueDailyAmountSum: number = 0 + let CurRoyaltyDailyPriceSum: number = 0 + let CurRoyaltyDailyTheorySum: number = 0 + let CurRoyaltyDailyTheoryTaxSum: number = 0 + let CyRevenueDailyAmountSum: number = 0 + let CyRoyaltyDailyPriceSum: number = 0 + let CyRoyaltyDailyTheorySum: number = 0 + let CyRoyaltyDailyTheoryTaxSum: number = 0 + if (list && list.length > 0) { + list.forEach((item: any) => { + CurRevenueDailyAmountSum += item.CurRevenueDailyAmount + CurRoyaltyDailyPriceSum += item.CurRoyaltyDailyPrice + CurRoyaltyDailyTheorySum += item.CurRoyaltyDailyTheory + CurRoyaltyDailyTheoryTaxSum += item.CurRoyaltyDailyTheoryTax + CyRevenueDailyAmountSum += item.CyRevenueDailyAmount + CyRoyaltyDailyPriceSum += item.CyRoyaltyDailyPrice + CyRoyaltyDailyTheorySum += item.CyRoyaltyDailyTheory + CyRoyaltyDailyTheoryTaxSum += item.CyRoyaltyDailyTheoryTax + }) + } + list.unshift({ + Name: '总计', + CurRevenueDailyAmount: CurRevenueDailyAmountSum.toFixed(2), + CurRoyaltyDailyPrice: CurRoyaltyDailyPriceSum.toFixed(2), + CurRoyaltyDailyTheory: CurRoyaltyDailyTheorySum.toFixed(2), + CurRoyaltyDailyTheoryTax: CurRoyaltyDailyTheoryTaxSum.toFixed(2), + CyRevenueDailyAmount: CyRevenueDailyAmountSum.toFixed(2), + CyRoyaltyDailyPrice: CyRoyaltyDailyPriceSum.toFixed(2), + CyRoyaltyDailyTheory: CyRoyaltyDailyTheorySum.toFixed(2), + CyRoyaltyDailyTheoryTax: CyRoyaltyDailyTheoryTaxSum.toFixed(2), }) + + // const curResList = wrapTreeNode(data.List[0].Container.children) + // const lResList = wrapTreeNode(data.List[1].Container.children) + const curDate = moment(curYear).format('YYYYMMDD') + const cyDateStr = moment(cyDate).format('YYYYMMDD') + + setShowlYear(cyDate) + setShowCurYear(curYear) + + setFileName(`商户收入明细表_${curDate}_${cyDateStr}`) + handleGetExportTime(curDate, cyDateStr) + setReqDetailList(list); + return { data: list || [], success: true } } - list.unshift({ - Name: '总计', - CurRevenueDailyAmount: CurRevenueDailyAmountSum.toFixed(2), - CurRoyaltyDailyPrice: CurRoyaltyDailyPriceSum.toFixed(2), - CurRoyaltyDailyTheory: CurRoyaltyDailyTheorySum.toFixed(2), - CurRoyaltyDailyTheoryTax: CurRoyaltyDailyTheoryTaxSum.toFixed(2), - CyRevenueDailyAmount: CyRevenueDailyAmountSum.toFixed(2), - CyRoyaltyDailyPrice: CyRoyaltyDailyPriceSum.toFixed(2), - CyRoyaltyDailyTheory: CyRoyaltyDailyTheorySum.toFixed(2), - CyRoyaltyDailyTheoryTax: CyRoyaltyDailyTheoryTaxSum.toFixed(2), - }) - - // const curResList = wrapTreeNode(data.List[0].Container.children) - // const lResList = wrapTreeNode(data.List[1].Container.children) - const curDate = moment(curYear).format('YYYYMMDD') - const cyDateStr = moment(cyDate).format('YYYYMMDD') - - setShowlYear(cyDate) - setShowCurYear(curYear) - - setFileName(`商户收入明细表_${curDate}_${cyDateStr}`) - handleGetExportTime(curDate,cyDateStr) - setReqDetailList(list); - return {data: list || [], success: true} - } - }} - toolbar={{ - actions: [ - - - , - - ], - }} - /> - + }} + toolbar={{ + actions: [ + + + , + + ], + }} + /> +
+
) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(StoreDetailRevenue); diff --git a/src/pages/reports/Finance/accountMonthly.tsx b/src/pages/reports/Finance/accountMonthly.tsx index eccbf2c..06d360e 100644 --- a/src/pages/reports/Finance/accountMonthly.tsx +++ b/src/pages/reports/Finance/accountMonthly.tsx @@ -44,6 +44,7 @@ import './accountMonthly.less' import { trimEnd } from 'lodash'; import DifferenceAmount from '../shareRoyalty/component/differenceAmount'; import PageTitleBox from '@/components/PageTitleBox'; +import LeftSelectTree from '../settlementAccount/component/leftSelectTree'; const { Text } = Typography; @@ -986,8 +987,9 @@ const ReportTable: React.FC<{ currentUser?: CurrentUser }> = (props) => {
{/* height: 'calc(100vh - 66px)', */} -
- + + {/* = (props) => { // actionRef?.current?.reload() }} /> : ''} - + */}
+ { showNotice ?
{ diff --git a/src/pages/reports/Finance/accountServerpart.tsx b/src/pages/reports/Finance/accountServerpart.tsx index f480c13..8b4ea0f 100644 --- a/src/pages/reports/Finance/accountServerpart.tsx +++ b/src/pages/reports/Finance/accountServerpart.tsx @@ -26,6 +26,7 @@ import Merchant from "@/pages/reports/ShopExpenseDetail/detail"; import './accountServerpart.less' import AccountChildren from './components/accountChildren' import PageTitleBox from '@/components/PageTitleBox'; +import LeftSelectTree from '../settlementAccount/component/leftSelectTree'; const { Text } = Typography; @@ -736,359 +737,332 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { // 打印报表 setPrintOut(el); }}> - - { setCollapsible(!collapsible) }} />} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? + + + +
+ + rowKey={(record) => { + return `${`${record?.SPREGIONTYPE_ID}|${record?.index}`}` }} - blockNode - defaultExpandedKeys={['0-0']} - onCheck={(checkedKeys: React.Key[] | any, info) => { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - // 取消掉选择点击左侧 右侧列表就直接调用接口拿到数据 - // actionRef?.current?.reload() + loading={tableLoading} + headerTitle={} // 列表表头 + actionRef={actionRef} + formRef={formRef} + // scroll={{ y: 'calc(100vh - 500px)' }} + scroll={{ x: 'calc(100vw - 500px)', y: 700 }} + search={{ + span: 6, + labelWidth: 'auto', + optionRender: (searchConfig, formProps, dom) => { + return [ + , + + ] + } }} - // switcherIcon={} - /> : ''} - -
- -
- - rowKey={(record) => { - return `${`${record?.SPREGIONTYPE_ID}|${record?.index}`}` - }} - loading={tableLoading} - headerTitle={} // 列表表头 - actionRef={actionRef} - formRef={formRef} - // scroll={{ y: 'calc(100vh - 500px)' }} - scroll={{ x: 'calc(100vw - 500px)', y: 700 }} - search={{ - span: 6, - labelWidth: 'auto', - optionRender: (searchConfig, formProps, dom) => { - return [ - , - - ] - } - }} - // 请求数据 - request={(params, sort) => { - if (!sort || canSearch.current === 1) { - handleGetTableData(params) - } - }} - columns={columns} - dataSource={reqDetailList} - rowClassName={(record) => record?.SPREGIONTYPE_ID || record?.SERVERPART_ID ? 'expanded' : ''} - expandable={ - { - rowExpandable: () => true, - // defaultExpandedRowKeys: ['0|0|0'], - indentSize: 0, - expandRowByClick: true, - defaultExpandAllRows: true, - onExpand: (expanded, record) => { - if (expanded) { - setExpandRow([...expandRow, `${record?.SPREGIONTYPE_ID}|${record?.SERVERPART_ID}|${record?.SERVERPARTSHOP_ID}`]) - } else { - const nowData = expandRow?.reduce((p: string[], c) => { - if (c !== `${record?.SPREGIONTYPE_ID}|${record?.SERVERPART_ID}|${record?.SERVERPARTSHOP_ID}`) { - p.push(c) - } - return p - }, []) - setExpandRow(nowData || []) - } + // 请求数据 + request={(params, sort) => { + if (!sort || canSearch.current === 1) { + handleGetTableData(params) + } + }} + columns={columns} + dataSource={reqDetailList} + rowClassName={(record) => record?.SPREGIONTYPE_ID || record?.SERVERPART_ID ? 'expanded' : ''} + expandable={ + { + rowExpandable: () => true, + // defaultExpandedRowKeys: ['0|0|0'], + indentSize: 0, + expandRowByClick: true, + defaultExpandAllRows: true, + onExpand: (expanded, record) => { + if (expanded) { + setExpandRow([...expandRow, `${record?.SPREGIONTYPE_ID}|${record?.SERVERPART_ID}|${record?.SERVERPARTSHOP_ID}`]) + } else { + const nowData = expandRow?.reduce((p: string[], c) => { + if (c !== `${record?.SPREGIONTYPE_ID}|${record?.SERVERPART_ID}|${record?.SERVERPARTSHOP_ID}`) { + p.push(c) + } + return p + }, []) + setExpandRow(nowData || []) } } } - bordered - // options={false} - pagination={false} - columnsState={{ - value: columnsStateMap, - onChange: setColumnsStateMap, - }} - toolbar={{ - actions: [ - 单位:元, - ( - - )} - content={() => { - if (printOut) { - const content: HTMLElement | Node | undefined = printOut?.getElementsByClassName('ant-card-body')[0] - // const extra: HTMLElement | Node | undefined = printOut?.getElementsByClassName('ant-pro-table-extra')[0] - const [start, end] = formRef.current?.getFieldValue('search_date') || []; - const innerText = start && end ? `统计时间:${moment(start).format('YYYY/MM/DD')}-${moment(end).format('YYYY/MM/DD')}` : ''; - const ele = printOutInternal(content ? content.cloneNode(true) : [], innerText); - return ele - } - return '' - }} - />, - + )} + content={() => { + if (printOut) { + const content: HTMLElement | Node | undefined = printOut?.getElementsByClassName('ant-card-body')[0] + // const extra: HTMLElement | Node | undefined = printOut?.getElementsByClassName('ant-pro-table-extra')[0] + const [start, end] = formRef.current?.getFieldValue('search_date') || []; + const innerText = start && end ? `统计时间:${moment(start).format('YYYY/MM/DD')}-${moment(end).format('YYYY/MM/DD')}` : ''; + const ele = printOutInternal(content ? content.cloneNode(true) : [], innerText); + return ele + } + return '' + }} + />, + , - { - e.stopPropagation(); - // 传入需要特别修改的字段及第二个参数 数组对象的格式 type是判断是render还是select的 fun是拿到值的方法 - exportTable(e, [ - { - name: 'MERCHANTS_NAME', - type: 'render', - fun: handleMERCHANTSNAME - }, - { - name: 'BUSINESS_TRADE', - type: 'select', - fun: businessType - } - ]) - }}> - - - ] - }} - tableExtraRender={() => { - if (reqDetailList && reqDetailList.length > 0) { - const reduceData = reqDetailList.reduce((p: { - REVENUE_AMOUNT: number, ROYALTY_PRICE: number, ACCOUNT_AMOUNT: number, SUBROYALTY_PRICE?: number, TICKET_FEE?: number, ROYALTY_THEORY?: number, - SUBROYALTY_THEORY?: number, DIFDAILY_REVENUE?: number - }, currentValue: ProjectSplitSummaryModel) => { - // 数据累加拿合计值 - const previousValue = { ...p } - previousValue.REVENUE_AMOUNT = numeral(numeral(previousValue.REVENUE_AMOUNT + - (currentValue.REVENUE_AMOUNT || 0)).format('0.00')).value() || 0; - previousValue.ROYALTY_PRICE = numeral(numeral(previousValue.ROYALTY_PRICE + - (currentValue.ROYALTY_PRICE || 0)).format('0.00')).value() || 0; - previousValue.ACCOUNT_AMOUNT = numeral(numeral(previousValue.ACCOUNT_AMOUNT + - (currentValue.ACCOUNT_AMOUNT || 0)).format('0.00')).value() || 0; - previousValue.SUBROYALTY_PRICE = numeral(numeral((previousValue.SUBROYALTY_PRICE || 0) + - (currentValue.SUBROYALTY_PRICE || 0)).format('0.00')).value() || 0; - previousValue.TICKET_FEE = numeral(numeral((previousValue.TICKET_FEE || 0) + - (currentValue.TICKET_FEE || 0)).format('0.00')).value() || 0; - previousValue.ROYALTY_THEORY = numeral(numeral((previousValue.ROYALTY_THEORY || 0) + - (currentValue.ROYALTYDAILY_THEORY || 0)).format('0.00')).value() || 0; - previousValue.SUBROYALTY_THEORY = numeral(numeral((previousValue.SUBROYALTY_THEORY || 0) + - (currentValue.SUBROYALTYDAILY_THEORY || 0)).format('0.00')).value() || 0; - previousValue.DIFDAILY_REVENUE = numeral(numeral((previousValue.DIFDAILY_REVENUE || 0) + - (currentValue.DIFDAILY_REVENUE || 0)).format('0.00')).value() || 0; - return previousValue - }, { - REVENUE_AMOUNT: 0, ROYALTY_PRICE: 0, ACCOUNT_AMOUNT: 0 - }); - // 显示在列表上方是的类型合计 - return
- 项目到账汇总}> - ¥{amountDom(otherData?.ProjectCoopRevenue)} - ¥{amountDom(otherData?.ProjectRentRevenue)} - ¥{amountDom(otherData?.ProjectSelfCoopRevenue)} - ¥{amountDom(otherData?.ProjectSelfRevenue)} - ¥{amountDom(reduceData?.REVENUE_AMOUNT)} - - 推送金额汇总}> - ¥{amountDom(otherData?.PushCoopRevenue)} - ¥{amountDom(otherData?.PushRentRevenue)} - ¥{amountDom(otherData?.PushSelfCoopRevenue)} - ¥{amountDom(otherData?.PushSelfRevenue)} - ¥{amountDom(otherData?.PushRevenue)} - - 营收差异(项目到账-推送金额)}> - ¥{amountDom(numeral(numeral((otherData?.ProjectCoopRevenue || 0) - - (otherData?.PushCoopRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((otherData?.ProjectRentRevenue || 0) - - (otherData?.PushRentRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((otherData?.ProjectSelfCoopRevenue || 0) - - (otherData?.PushSelfCoopRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((otherData?.ProjectSelfRevenue || 0) - - (otherData?.PushSelfRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((reduceData.REVENUE_AMOUNT || 0) - - (otherData?.PushRevenue || 0))).format('0.00'))} - - 银行到账汇总}> - {amountDom(numeral(otherData?.ProjectCount).format('0.00'))} - ¥{amountDom(reduceData.ROYALTY_PRICE)} - ¥{amountDom(reduceData.SUBROYALTY_PRICE)} - ¥{amountDom(reduceData.TICKET_FEE)} - ¥{amountDom(numeral(numeral((reduceData.ROYALTY_PRICE || 0) + (reduceData.SUBROYALTY_PRICE || 0) + - (reduceData.TICKET_FEE || 0) - (reduceData.REVENUE_AMOUNT || 0)).format('0.00')).format('0.00'))} - - 财务入账汇总}> - - ¥{amountDom(reduceData.ROYALTY_THEORY)} - ¥{amountDom(reduceData.SUBROYALTY_THEORY)} - - ¥{amountDom(numeral(reduceData.DIFDAILY_REVENUE).format('0.00'))} - - 差额(到账-入账)}> - - -
{ - setChildrenType(1) - setShowSmallDrawer(true) - }}> - ¥{amountDom(numeral((reduceData.ROYALTY_PRICE || 0) - - (reduceData.ROYALTY_THEORY || 0)).format('0.00'))} -
-
- -
{ - setChildrenType(2) - setShowSmallDrawer(true) - }}> - ¥{amountDom(numeral((reduceData.SUBROYALTY_PRICE || 0) - - (reduceData.SUBROYALTY_THEORY || 0)).format('0.00'))} -
-
- ¥{amountDom(numeral((reduceData.ROYALTY_PRICE || 0) - - (reduceData.ROYALTY_THEORY || 0) + (reduceData.SUBROYALTY_PRICE || 0) - - (reduceData.SUBROYALTY_THEORY || 0)).format('0.00'))} - ¥{amountDom(numeral((reduceData.REVENUE_AMOUNT || 0) - - (otherData?.PushRevenue || 0) - (reduceData.DIFDAILY_REVENUE || 0)).format('0.00'))} -
-
- } + } + }} + > + 导出excel + , + { + e.stopPropagation(); + // 传入需要特别修改的字段及第二个参数 数组对象的格式 type是判断是render还是select的 fun是拿到值的方法 + exportTable(e, [ + { + name: 'MERCHANTS_NAME', + type: 'render', + fun: handleMERCHANTSNAME + }, + { + name: 'BUSINESS_TRADE', + type: 'select', + fun: businessType + } + ]) + }}> + + + ] + }} + tableExtraRender={() => { + if (reqDetailList && reqDetailList.length > 0) { + const reduceData = reqDetailList.reduce((p: { + REVENUE_AMOUNT: number, ROYALTY_PRICE: number, ACCOUNT_AMOUNT: number, SUBROYALTY_PRICE?: number, TICKET_FEE?: number, ROYALTY_THEORY?: number, + SUBROYALTY_THEORY?: number, DIFDAILY_REVENUE?: number + }, currentValue: ProjectSplitSummaryModel) => { + // 数据累加拿合计值 + const previousValue = { ...p } + previousValue.REVENUE_AMOUNT = numeral(numeral(previousValue.REVENUE_AMOUNT + + (currentValue.REVENUE_AMOUNT || 0)).format('0.00')).value() || 0; + previousValue.ROYALTY_PRICE = numeral(numeral(previousValue.ROYALTY_PRICE + + (currentValue.ROYALTY_PRICE || 0)).format('0.00')).value() || 0; + previousValue.ACCOUNT_AMOUNT = numeral(numeral(previousValue.ACCOUNT_AMOUNT + + (currentValue.ACCOUNT_AMOUNT || 0)).format('0.00')).value() || 0; + previousValue.SUBROYALTY_PRICE = numeral(numeral((previousValue.SUBROYALTY_PRICE || 0) + + (currentValue.SUBROYALTY_PRICE || 0)).format('0.00')).value() || 0; + previousValue.TICKET_FEE = numeral(numeral((previousValue.TICKET_FEE || 0) + + (currentValue.TICKET_FEE || 0)).format('0.00')).value() || 0; + previousValue.ROYALTY_THEORY = numeral(numeral((previousValue.ROYALTY_THEORY || 0) + + (currentValue.ROYALTYDAILY_THEORY || 0)).format('0.00')).value() || 0; + previousValue.SUBROYALTY_THEORY = numeral(numeral((previousValue.SUBROYALTY_THEORY || 0) + + (currentValue.SUBROYALTYDAILY_THEORY || 0)).format('0.00')).value() || 0; + previousValue.DIFDAILY_REVENUE = numeral(numeral((previousValue.DIFDAILY_REVENUE || 0) + + (currentValue.DIFDAILY_REVENUE || 0)).format('0.00')).value() || 0; + return previousValue + }, { + REVENUE_AMOUNT: 0, ROYALTY_PRICE: 0, ACCOUNT_AMOUNT: 0 + }); + // 显示在列表上方是的类型合计 + return
+ 项目到账汇总}> + ¥{amountDom(otherData?.ProjectCoopRevenue)} + ¥{amountDom(otherData?.ProjectRentRevenue)} + ¥{amountDom(otherData?.ProjectSelfCoopRevenue)} + ¥{amountDom(otherData?.ProjectSelfRevenue)} + ¥{amountDom(reduceData?.REVENUE_AMOUNT)} + + 推送金额汇总}> + ¥{amountDom(otherData?.PushCoopRevenue)} + ¥{amountDom(otherData?.PushRentRevenue)} + ¥{amountDom(otherData?.PushSelfCoopRevenue)} + ¥{amountDom(otherData?.PushSelfRevenue)} + ¥{amountDom(otherData?.PushRevenue)} + + 营收差异(项目到账-推送金额)}> + ¥{amountDom(numeral(numeral((otherData?.ProjectCoopRevenue || 0) - + (otherData?.PushCoopRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((otherData?.ProjectRentRevenue || 0) - + (otherData?.PushRentRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((otherData?.ProjectSelfCoopRevenue || 0) - + (otherData?.PushSelfCoopRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((otherData?.ProjectSelfRevenue || 0) - + (otherData?.PushSelfRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((reduceData.REVENUE_AMOUNT || 0) - + (otherData?.PushRevenue || 0))).format('0.00'))} + + 银行到账汇总}> + {amountDom(numeral(otherData?.ProjectCount).format('0.00'))} + ¥{amountDom(reduceData.ROYALTY_PRICE)} + ¥{amountDom(reduceData.SUBROYALTY_PRICE)} + ¥{amountDom(reduceData.TICKET_FEE)} + ¥{amountDom(numeral(numeral((reduceData.ROYALTY_PRICE || 0) + (reduceData.SUBROYALTY_PRICE || 0) + + (reduceData.TICKET_FEE || 0) - (reduceData.REVENUE_AMOUNT || 0)).format('0.00')).format('0.00'))} + + 财务入账汇总}> + + ¥{amountDom(reduceData.ROYALTY_THEORY)} + ¥{amountDom(reduceData.SUBROYALTY_THEORY)} + + ¥{amountDom(numeral(reduceData.DIFDAILY_REVENUE).format('0.00'))} + + 差额(到账-入账)}> + + +
{ + setChildrenType(1) + setShowSmallDrawer(true) + }}> + ¥{amountDom(numeral((reduceData.ROYALTY_PRICE || 0) - + (reduceData.ROYALTY_THEORY || 0)).format('0.00'))} +
+
+ +
{ + setChildrenType(2) + setShowSmallDrawer(true) + }}> + ¥{amountDom(numeral((reduceData.SUBROYALTY_PRICE || 0) - + (reduceData.SUBROYALTY_THEORY || 0)).format('0.00'))} +
+
+ ¥{amountDom(numeral((reduceData.ROYALTY_PRICE || 0) - + (reduceData.ROYALTY_THEORY || 0) + (reduceData.SUBROYALTY_PRICE || 0) - + (reduceData.SUBROYALTY_THEORY || 0)).format('0.00'))} + ¥{amountDom(numeral((reduceData.REVENUE_AMOUNT || 0) - + (otherData?.PushRevenue || 0) - (reduceData.DIFDAILY_REVENUE || 0)).format('0.00'))} +
+
+ } - return <> - }} - /> - + return <> + }} + />
-
+
{/* 经营单位 */} = (props) => { const downloadBtnRef = useRef() const actionDetailRef = useRef(); const formDetailRef = useRef(); - const { currentUser,route } = props + const { currentUser, route } = props // 左侧树展开还是收缩 const [collapsible, setCollapsible] = useState(false) const [selectedId, setSelectedId] = useState() @@ -2064,7 +2065,6 @@ const businessWarning: React.FC<{ currentUser?: CurrentUser }> = (props) => { clickTableBtnRef.current = false } - // 把精算了的数据传给后端 const handleBeforeData = async (list: any, isReset?: boolean) => { setActuaryTableLoading(true) @@ -2843,7 +2843,6 @@ const businessWarning: React.FC<{ currentUser?: CurrentUser }> = (props) => { // handleBeforeData(sumList) } - // 给精算算出具体的今年单车价值和去年单车价值 const handleGetVehicleAmount = (list: any) => { console.log('list', list); @@ -2923,51 +2922,14 @@ const businessWarning: React.FC<{ currentUser?: CurrentUser }> = (props) => { } } - // 改变表格在加载过程中显示的字 const handleLoadingText = (str: string) => { } return ( -
+
- { - setCollapsible(!collapsible) - }} />} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "可筛选门店" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - const selectedAreas = info.checkedNodes.filter(n => n?.type === 0) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - setSelectArea(selectedAreas.map(n => n?.value)?.toString() || '') - // actionRef?.current?.reload() - }} - /> : ''} -
{ @@ -2987,280 +2949,293 @@ const businessWarning: React.FC<{ currentUser?: CurrentUser }> = (props) => { : '' }
- - { - return [ - , - - ] - } - }} - rowKey={(record) => { - return `${record?.SPRegionTypeId}-${record?.ServerpartId}-${record?.ServerpartShopId}-${record?.ServerpartShopName}-${record?.Name}-${record?.testIndex}-${record?.ServerpartName}` - }} - rowClassName={(record) => { - return `${record?.SPRegionTypeId}-${record?.ServerpartId}-${record?.ServerpartShopId}-${record?.ServerpartShopName}-${record?.Name}-${record?.testIndex}-${record?.ServerpartName}` - }} - headerTitle={ -
- {tableHeaderTitle || ''} -
- {warnType.current ? '预警说明:' : ''} - - {warnType.current === '1' ? '请重点关注入区车流增加自营商超营收同步增长,服务区整体营收呈现下降的情况!' : - warnType.current === '2' ? '请重点关注入区车流增加自营商超营收同步增长,服务区部分门店营收呈现下降的情况!' : - warnType.current === '3' ? '请重点关注营收与车流增幅产生较大差异的服务区!增幅差额=车流增幅-营收增幅,越大越不好,倒序排列' : - warnType.current === '4' ? '请重点关注营收与车流降幅产生较大差异的服务区!增幅差额=销售增幅-车流降幅,越大越不好,倒序排列' : ''} - -
- -
?
-
-
} - id={'table-to-xls'} - columns={columns} - bordered={true} - scroll={{ y: 'calc(100vh - 450px)' }} - pagination={false} - loading={showTableLoading} - className={'revenueTable'} - dataSource={tableData} - request={async (params, sort, options) => { - console.log('params22', params) - // 没选服务区就return出去 - if (!selectedId) { - setReqDetailList([]) - return - } - setShowSort(false) - if (clickTableBtnRef.current) { - let paramsObj: any = {} - warnType.current = params.warningType - // setWarnType(params.warningType) - if (params?.solidType === '1') { - paramsObj = params - } else { - if (params.warningType === '1') { - paramsObj = { - ...params, - showBayonet: '1', - showRevenue: '2', - showLevel: '1' - } - } else if (params.warningType === '2') { - paramsObj = { - ...params, - showBayonet: '1', - showRevenue: '2', - showLevel: '2' - } - } else if (params.warningType === '3') { - paramsObj = { - ...params, - showBayonet: '1', - showRevenue: '1' - } - setShowSort(true) - } else if (params.warningType === '4') { - paramsObj = { - ...params, - showBayonet: '2', - showRevenue: '2', - } - setShowSort(true) - } +
+ { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + const selectedAreas = info.checkedNodes.filter(n => n?.type === 0) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + setSelectArea(selectedAreas.map(n => n?.value)?.toString() || '') + }} /> +
+ { + return [ + , + + ] } + }} + rowKey={(record) => { + return `${record?.SPRegionTypeId}-${record?.ServerpartId}-${record?.ServerpartShopId}-${record?.ServerpartShopName}-${record?.Name}-${record?.testIndex}-${record?.ServerpartName}` + }} + rowClassName={(record) => { + return `${record?.SPRegionTypeId}-${record?.ServerpartId}-${record?.ServerpartShopId}-${record?.ServerpartShopName}-${record?.Name}-${record?.testIndex}-${record?.ServerpartName}` + }} + headerTitle={ +
+ {tableHeaderTitle || ''} - - - handleGetTableData(paramsObj) - } - }} - toolbar={{ - actions: [ - - - , - 单位:{statisticalUnit === 1 ? "万元,万辆" : "元,辆"}, - - ], - }} - columnsState={{ - value: columnsStateMap, - onChange: (value: any) => { - setColumnsStateMap(value) - }, - }} - options={{ - manualRequest: true - }} - expandable={{ - expandedRowKeys, - // defaultExpandedRowKeys: ['null-null-undefined-undefined-undefined-undefined-null'], - onExpand: async (record, event) => { - console.log('record', record) - console.log('event', event) - console.log('expandedRowKeys', expandedRowKeys) - if (record) { - if (expandedRowKeys && expandedRowKeys.length > 0) { - const list: any = JSON.parse(JSON.stringify(expandedRowKeys)) - list.push(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) - setExpandedRowKeys(list) - } else { - const list: any = [] - list.push(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) - setExpandedRowKeys(list) - } - } else { - const list: any = JSON.parse(JSON.stringify(expandedRowKeys)) - const newList: any = list.filter((item) => item !== `${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) - console.log('newList', newList) - setExpandedRowKeys(newList) - } - - - if (columnsLoading) { +
+ {warnType.current ? '预警说明:' : ''} + + {warnType.current === '1' ? '请重点关注入区车流增加自营商超营收同步增长,服务区整体营收呈现下降的情况!' : + warnType.current === '2' ? '请重点关注入区车流增加自营商超营收同步增长,服务区部分门店营收呈现下降的情况!' : + warnType.current === '3' ? '请重点关注营收与车流增幅产生较大差异的服务区!增幅差额=车流增幅-营收增幅,越大越不好,倒序排列' : + warnType.current === '4' ? '请重点关注营收与车流降幅产生较大差异的服务区!增幅差额=销售增幅-车流降幅,越大越不好,倒序排列' : ''} + +
+ +
?
+
+
} + id={'table-to-xls'} + columns={columns} + bordered={true} + scroll={{ y: 'calc(100vh - 450px)' }} + pagination={false} + loading={showTableLoading} + className={'revenueTable'} + dataSource={tableData} + request={async (params, sort, options) => { + console.log('params22', params) + // 没选服务区就return出去 + if (!selectedId) { + setReqDetailList([]) return } - let isHave: boolean = true - if (event.children && event.children.length > 0) { - isHave = false - } - if (record && event.ServerpartId && isHave) { - setColumnsLoading(true) - addLoadingRow(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) - const req: any = { - ...searchParams, - pushProvinceCode: currentUser?.USER_PROVINCE || '340000', - ServerpartId: event.ServerpartId, - BusinessTradeType: BusinessTradeType || '', - calcYOY: isCalcYOYFlag,// 同比 - calcQOQ: isCalcQOQFlag,// 环比 - calcBayonet: isCalcBayonetFlag,// 最后一大列是否显示 - } - const result = await handleGetMonthINCAnalysis(req) - const data = result.List && result.List.length > 0 ? wrapTreeNode(result.List) : [] - console.log('data121', data) - let res: any = [] - if (data && data.length > 0) { - data.forEach((item: any) => { - if (item.children && item.children.length > 0) { - item.children.forEach((subItem: any) => { - if (subItem.children && subItem.children.length > 0) { - subItem.children.forEach((thirdItem: any) => { - if (thirdItem.ServerpartId === event.ServerpartId) { - res = thirdItem.ShopINCList - } - }) - } - }) + setShowSort(false) + if (clickTableBtnRef.current) { + let paramsObj: any = {} + warnType.current = params.warningType + // setWarnType(params.warningType) + if (params?.solidType === '1') { + paramsObj = params + } else { + if (params.warningType === '1') { + paramsObj = { + ...params, + showBayonet: '1', + showRevenue: '2', + showLevel: '1' } - }) + } else if (params.warningType === '2') { + paramsObj = { + ...params, + showBayonet: '1', + showRevenue: '2', + showLevel: '2' + } + } else if (params.warningType === '3') { + paramsObj = { + ...params, + showBayonet: '1', + showRevenue: '1' + } + setShowSort(true) + } else if (params.warningType === '4') { + paramsObj = { + ...params, + showBayonet: '2', + showRevenue: '2', + } + setShowSort(true) + } } - console.log('res', res) - if (res && res.length > 0) { - res.forEach((item: any, index: number) => { - item = handleChangeItem(item) - item.testIndex = index + 1 - }) + + + + handleGetTableData(paramsObj) + } + }} + toolbar={{ + actions: [ + + + , + 单位:{statisticalUnit === 1 ? "万元,万辆" : "元,辆"}, + + ], + }} + columnsState={{ + value: columnsStateMap, + onChange: (value: any) => { + setColumnsStateMap(value) + }, + }} + options={{ + manualRequest: true + }} + expandable={{ + expandedRowKeys, + // defaultExpandedRowKeys: ['null-null-undefined-undefined-undefined-undefined-null'], + onExpand: async (record, event) => { + console.log('record', record) + console.log('event', event) + console.log('expandedRowKeys', expandedRowKeys) + if (record) { + if (expandedRowKeys && expandedRowKeys.length > 0) { + const list: any = JSON.parse(JSON.stringify(expandedRowKeys)) + list.push(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) + setExpandedRowKeys(list) + } else { + const list: any = [] + list.push(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) + setExpandedRowKeys(list) + } + } else { + const list: any = JSON.parse(JSON.stringify(expandedRowKeys)) + const newList: any = list.filter((item) => item !== `${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) + console.log('newList', newList) + setExpandedRowKeys(newList) } - if (tableData && tableData.length > 0) { - const tableList: any = JSON.parse(JSON.stringify(tableData)) - console.log('tableList', tableList) - if (haveIsOneService) { - tableList.forEach((item: any) => { - item.children = res - }) - } else if (!haveIsOneArea) { - tableList.forEach((item: any) => { + + + if (columnsLoading) { + return + } + let isHave: boolean = true + if (event.children && event.children.length > 0) { + isHave = false + } + if (record && event.ServerpartId && isHave) { + setColumnsLoading(true) + addLoadingRow(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}-${event?.ServerpartName}`) + const req: any = { + ...searchParams, + pushProvinceCode: currentUser?.USER_PROVINCE || '340000', + ServerpartId: event.ServerpartId, + BusinessTradeType: BusinessTradeType || '', + calcYOY: isCalcYOYFlag,// 同比 + calcQOQ: isCalcQOQFlag,// 环比 + calcBayonet: isCalcBayonetFlag,// 最后一大列是否显示 + } + const result = await handleGetMonthINCAnalysis(req) + const data = result.List && result.List.length > 0 ? wrapTreeNode(result.List) : [] + console.log('data121', data) + let res: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { if (item.children && item.children.length > 0) { item.children.forEach((subItem: any) => { if (subItem.children && subItem.children.length > 0) { subItem.children.forEach((thirdItem: any) => { if (thirdItem.ServerpartId === event.ServerpartId) { - thirdItem.children = res + res = thirdItem.ShopINCList } }) } }) } }) - } else { - tableList.forEach((item: any) => { - if (item.children && item.children.length > 0) { - item.children.forEach((subItem: any) => { - if (subItem.ServerpartId === event.ServerpartId) { - subItem.children = res - } - }) - } + } + console.log('res', res) + if (res && res.length > 0) { + res.forEach((item: any, index: number) => { + item = handleChangeItem(item) + item.testIndex = index + 1 }) } - setTableData(tableList) + if (tableData && tableData.length > 0) { + const tableList: any = JSON.parse(JSON.stringify(tableData)) + console.log('tableList', tableList) + if (haveIsOneService) { + tableList.forEach((item: any) => { + item.children = res + }) + } else if (!haveIsOneArea) { + tableList.forEach((item: any) => { + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { + if (subItem.children && subItem.children.length > 0) { + subItem.children.forEach((thirdItem: any) => { + if (thirdItem.ServerpartId === event.ServerpartId) { + thirdItem.children = res + } + }) + } + }) + } + }) + } else { + tableList.forEach((item: any) => { + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { + if (subItem.ServerpartId === event.ServerpartId) { + subItem.children = res + } + }) + } + }) + } + setTableData(tableList) + } + removeLoadingRow(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}`) + setColumnsLoading(false) } - removeLoadingRow(`${event?.SPRegionTypeId}-${event?.ServerpartId}-${event?.ServerpartShopId}-${event?.ServerpartShopName}-${event?.Name}-${event?.testIndex}`) - setColumnsLoading(false) } - } - }} - /> - + }} + /> +
+
+ = return (
- = // actionRef?.current?.reload() }} /> : ''} - + */}
+ { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + const selectedAreas = info.checkedNodes.filter(n => n?.type === 0) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + setSelectArea(selectedAreas.map(n => n?.value)?.toString() || '') + }} /> +
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? @@ -2435,9 +2443,12 @@ const revenueAnalysis: React.FC<{ currentUser?: CurrentUser, route?: string }> = : '' }
- +
= } }} /> - - - {/*
- { - showAiLoading ? -
- -
: -
- {aiRes || ''} -
- } -
*/} - - +
{/* 月度信息抽屉 */} = (props) => { const [currentRow, setCurrentRow] = useState() const [currentDetail, setCurrentDetail] = useState() const [isFirst, setIsFirst] = useState(true) - const [showSmallDrawer,setShowSmallDrawer] = useState(false) + const [showSmallDrawer, setShowSmallDrawer] = useState(false) // 请求服务区树列表 const { loading: treeLoading, data: treeView } = useRequest(async () => { return getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true) @@ -80,14 +81,14 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { const [selectedId, setSelectedId] = useState() const [showAmount, setShowAmount] = useState()// 显示商家缴款的抽屉 const [serviceShopId, setServiceShopId] = useState()// 选择的门店id - const [childrenType,setChildrenType] = useState(0) - const [zIndexNumber,setZIndexNumber] = useState(102) + const [childrenType, setChildrenType] = useState(0) + const [zIndexNumber, setZIndexNumber] = useState(102) const canSearch = useRef(2) - const [tableLoading,setTableLoading] = useState(false) - const [SETTLEMENTMODESOBJ,SETSETTLEMENTMODESOBJ] = useState() - const [COMPACTTYPEOBJ,SETCOMPACTTYPEOBJ] = useState() - const [defaultCompactType,setDefaultCompactType]= useState() - const [isCollapsed,setIsCollapsed] = useState(true) + const [tableLoading, setTableLoading] = useState(false) + const [SETTLEMENTMODESOBJ, SETSETTLEMENTMODESOBJ] = useState() + const [COMPACTTYPEOBJ, SETCOMPACTTYPEOBJ] = useState() + const [defaultCompactType, setDefaultCompactType] = useState() + const [isCollapsed, setIsCollapsed] = useState(true) const columns: ProColumns[] = [ { title: '查询日期', @@ -117,49 +118,49 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { align: 'center', width: 40, hideInSearch: true, - render:(_,record)=>{ - return { + render: (_, record) => { + return { }} style={{ - color: (!(record?.MERCHANTS_NAME || record?.SERVERPART_NAME || record?.SPREGIONTYPE_NAME)&& (record.BUSINESS_TYPE===1000 || record.BUSINESS_TYPE===2000)) || + color: (!(record?.MERCHANTS_NAME || record?.SERVERPART_NAME || record?.SPREGIONTYPE_NAME) && (record.BUSINESS_TYPE === 1000 || record.BUSINESS_TYPE === 2000)) || - // ( - // (record.BUSINESS_TYPE===1000 || record.BUSINESS_TYPE===2000) && - // - // (!record?.TICKET_FEE && record?.TICKET_FEE!==0) && - // (!record?.REVENUE_AMOUNT && record?.REVENUE_AMOUNT!==0) && - // // 商家入账没有值 且也不是0 - // !record?.SUBROYALTYDAILY_THEORY && record?.SUBROYALTYDAILY_THEORY!==0 && - // // 商家到账没有值 且也不是0 - // (!record?.SUBROYALTY_PRICE && record?.SUBROYALTY_PRICE!==0) && - // // 业主入账没有值 且也不是0 - // !record?.ROYALTYDAILY_THEORY && record?.ROYALTYDAILY_THEORY!==0 && - // // 业主到账 没有值 且也不是0 - // (!record?.ROYALTY_PRICE && record?.ROYALTY_PRICE!==0) && - // - // // 到账差额 没有值 且也不是0 - // !record?.PUSHREVENUE_AMOUNT) + // ( + // (record.BUSINESS_TYPE===1000 || record.BUSINESS_TYPE===2000) && + // + // (!record?.TICKET_FEE && record?.TICKET_FEE!==0) && + // (!record?.REVENUE_AMOUNT && record?.REVENUE_AMOUNT!==0) && + // // 商家入账没有值 且也不是0 + // !record?.SUBROYALTYDAILY_THEORY && record?.SUBROYALTYDAILY_THEORY!==0 && + // // 商家到账没有值 且也不是0 + // (!record?.SUBROYALTY_PRICE && record?.SUBROYALTY_PRICE!==0) && + // // 业主入账没有值 且也不是0 + // !record?.ROYALTYDAILY_THEORY && record?.ROYALTYDAILY_THEORY!==0 && + // // 业主到账 没有值 且也不是0 + // (!record?.ROYALTY_PRICE && record?.ROYALTY_PRICE!==0) && + // + // // 到账差额 没有值 且也不是0 + // !record?.PUSHREVENUE_AMOUNT) ( - (record.BUSINESS_TYPE===1000 || record.BUSINESS_TYPE===2000) && + (record.BUSINESS_TYPE === 1000 || record.BUSINESS_TYPE === 2000) && - (!record?.TICKET_FEE || record?.TICKET_FEE===0) && - (!record?.REVENUE_AMOUNT|| record?.REVENUE_AMOUNT===0) && - // 商家入账没有值 且也不是0 - (!record?.SUBROYALTYDAILY_THEORY || record?.SUBROYALTYDAILY_THEORY===0)&& - // 商家到账没有值 且也不是0 - (!record?.SUBROYALTY_PRICE || record?.SUBROYALTY_PRICE===0) && - // 业主入账没有值 且也不是0 - (!record?.ROYALTYDAILY_THEORY || record?.ROYALTYDAILY_THEORY===0) && - // 业主到账 没有值 且也不是0 - (!record?.ROYALTY_PRICE || record?.ROYALTY_PRICE===0) && + (!record?.TICKET_FEE || record?.TICKET_FEE === 0) && + (!record?.REVENUE_AMOUNT || record?.REVENUE_AMOUNT === 0) && + // 商家入账没有值 且也不是0 + (!record?.SUBROYALTYDAILY_THEORY || record?.SUBROYALTYDAILY_THEORY === 0) && + // 商家到账没有值 且也不是0 + (!record?.SUBROYALTY_PRICE || record?.SUBROYALTY_PRICE === 0) && + // 业主入账没有值 且也不是0 + (!record?.ROYALTYDAILY_THEORY || record?.ROYALTYDAILY_THEORY === 0) && + // 业主到账 没有值 且也不是0 + (!record?.ROYALTY_PRICE || record?.ROYALTY_PRICE === 0) && - // 到账差额 没有值 且也不是0 - !record?.PUSHREVENUE_AMOUNT) || - record?.showRed || - // 有推送金额 业主和商家的入账都为0时 变红色 - (record?.PUSHREVENUE_AMOUNT && (!record?.ROYALTYDAILY_THEORY || record?.ROYALTYDAILY_THEORY===0) && (!record?.SUBROYALTYDAILY_THEORY || record?.SUBROYALTYDAILY_THEORY===0)) - ?'red':'#000' + // 到账差额 没有值 且也不是0 + !record?.PUSHREVENUE_AMOUNT) || + record?.showRed || + // 有推送金额 业主和商家的入账都为0时 变红色 + (record?.PUSHREVENUE_AMOUNT && (!record?.ROYALTYDAILY_THEORY || record?.ROYALTYDAILY_THEORY === 0) && (!record?.SUBROYALTYDAILY_THEORY || record?.SUBROYALTYDAILY_THEORY === 0)) + ? 'red' : '#000' }}> - {record.index||'-'} + {record.index || '-'} } }, @@ -168,10 +169,10 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { title: '服务区', align: 'center', hideInSearch: true, - ellipsis:true, + ellipsis: true, hideInDescriptions: true, width: 70, - render:(_,record)=>{ + render: (_, record) => { return record.BUSINESSPROJECT_ID ? { if (record.index && record.index.indexOf('.') !== -1) { setCurrentRow(record.BUSINESSPROJECT_ID) @@ -180,17 +181,17 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }} style={{ color: record.index && record.index.indexOf('.') !== -1 ? record?.SERVERPARTSHOP_ID ? - '#1890ff':'red' : '#000', + '#1890ff' : 'red' : '#000', cursor: record.index && record.index.indexOf('.') !== -1 ? 'pointer' : '' }}> - {record?.SERVERPARTSHOP_ID ?record?.SERVERPARTSHOP_NAME:'未设置门店,请添加'} + {record?.SERVERPARTSHOP_ID ? record?.SERVERPARTSHOP_NAME : '未设置门店,请添加'} : { - record.index? - record.index.indexOf('.')===-1?record?.SERVERPART_NAME - : - record?.SERVERPARTSHOP_ID ?record?.SERVERPARTSHOP_NAME:'未设置门店,请添加' - :record?.SPREGIONTYPE_NAME + record.index ? + record.index.indexOf('.') === -1 ? record?.SERVERPART_NAME + : + record?.SERVERPARTSHOP_ID ? record?.SERVERPARTSHOP_NAME : '未设置门店,请添加' + : record?.SPREGIONTYPE_NAME } {/* {record?.SERVERPARTSHOP_NAME?record?.SERVERPARTSHOP_NAME: */} @@ -226,34 +227,34 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { // } // }, { - title:'营收分润', - dataIndex:'profitShar', + title: '营收分润', + dataIndex: 'profitShar', align: 'right', hideInSearch: true, hideInDescriptions: true, width: 50, - render:(_,record)=>{ - return record?.index? - record?.index.indexOf('.')===-1?record?.profitShar: - record?.SETTLEMENT_MODES === 3000?'营收分润':record?.SETTLEMENT_MODES === 4000?'组合分润':'-' - :record?.profitShar + render: (_, record) => { + return record?.index ? + record?.index.indexOf('.') === -1 ? record?.profitShar : + record?.SETTLEMENT_MODES === 3000 ? '营收分润' : record?.SETTLEMENT_MODES === 4000 ? '组合分润' : '-' + : record?.profitShar } }, { - title:'营收回款', - dataIndex:'collection', + title: '营收回款', + dataIndex: 'collection', align: 'right', hideInSearch: true, hideInDescriptions: true, width: 50, - render:(_,record)=>{ - return record?.index? - record?.index.indexOf('.')===-1?record?.collection: - record?.SETTLEMENT_MODES === 1000?'营收回款': - record?.SETTLEMENT_MODES === 2000?'资金返款': - record?.SETTLEMENT_MODES === 9998?'阶段提成': - record?.SETTLEMENT_MODES === 9999?'分段提成':'-' - :record?.collection + render: (_, record) => { + return record?.index ? + record?.index.indexOf('.') === -1 ? record?.collection : + record?.SETTLEMENT_MODES === 1000 ? '营收回款' : + record?.SETTLEMENT_MODES === 2000 ? '资金返款' : + record?.SETTLEMENT_MODES === 9998 ? '阶段提成' : + record?.SETTLEMENT_MODES === 9999 ? '分段提成' : '-' + : record?.collection } }, { @@ -381,7 +382,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, }, { - title:'自然日营业差额', + title: '自然日营业差额', // title:
// 自然日 // 营业差额 @@ -394,7 +395,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { sorter: (a, b) => a.DIFDAILY_REVENUE || 0 - (b.DIFDAILY_REVENUE || 0), }, { - title:'矫正差异', + title: '矫正差异', // title:
// 自然日 // 营业差额 @@ -404,8 +405,8 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { valueType: 'digit', hideInSearch: true, width: 50, - render:(_,record)=>{ - const difference = ((record?.REVENUE_AMOUNT || 0) - (record?.PUSHREVENUE_AMOUNT || 0)-(record.DIFDAILY_REVENUE || 0)) + render: (_, record) => { + const difference = ((record?.REVENUE_AMOUNT || 0) - (record?.PUSHREVENUE_AMOUNT || 0) - (record.DIFDAILY_REVENUE || 0)) // if (numeral(difference.toFixed(2)).format('0.00') === '0.00') { // return '-' // } @@ -467,13 +468,13 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { { title: '结算模式', dataIndex: 'SETTLEMENT_MODES', - hideInTable:true, + hideInTable: true, valueType: 'select', request: async () => { const options = await getFieldEnum({ FieldExplainField: 'SETTLEMENT_MODES' }); const obj: any = {} - if (options && options.length>0){ - options.forEach((item: any)=>{ + if (options && options.length > 0) { + options.forEach((item: any) => { obj[item.value] = item.label }) } @@ -507,20 +508,21 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { initialValue: defaultCompactType, request: async () => { const options = await getFieldEnum({ FieldExplainField: 'COMPACT_CHARACTER' }); - console.log('options',options) + console.log('options', options) const obj: any = {} let firstValue: any = '' - if (options && options.length>0){ - options.forEach((item: any,index: number)=>{ - if(index === 0){ + if (options && options.length > 0) { + options.forEach((item: any, index: number) => { + if (index === 0) { firstValue = item.value } obj[item.value] = item.label }) } - console.log('obj',obj) + console.log('obj', obj) SETCOMPACTTYPEOBJ(obj) - setDefaultCompactType(obj[firstValue]) + console.log('obj[firstValue]obj[firstValue]', obj[firstValue]) + setDefaultCompactType(firstValue) return options }, @@ -543,28 +545,28 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, ] // 合作经营+固定租金 钱 - const [firstMoney,setFirstMoney] = useState(0) + const [firstMoney, setFirstMoney] = useState(0) // 合作经营+固定租金 数量 - const [firstNumber,setFirstNumber] = useState(0) + const [firstNumber, setFirstNumber] = useState(0) // 业主自营+自营提成 钱 - const [secondMoney,setSecondMoney] = useState(0) + const [secondMoney, setSecondMoney] = useState(0) // 业主自营+自营提成 数量 - const [secondNumber,setSecondNumber] = useState(0) - const [searchDate,setSearchDate] = useState() + const [secondNumber, setSecondNumber] = useState(0) + const [searchDate, setSearchDate] = useState() // 项目总数的总数 - const [allProjectSum,setAllProjectSum] = useState(0) + const [allProjectSum, setAllProjectSum] = useState(0) // 存一份params给子组件 - const [tableParams,setTableParams] = useState() + const [tableParams, setTableParams] = useState() // 汇总的悬浮框 - const [showNoticeDetail,setShowNoticeDetail] = useState(false) + const [showNoticeDetail, setShowNoticeDetail] = useState(false) // 汇总悬浮框的Y轴坐标 - const [noticeY,setNoticeY] = useState(0) + const [noticeY, setNoticeY] = useState(0) // ProTable上方计算的汇总信息数据 - const [reduceTableData,setReduceTableData] = useState() + const [reduceTableData, setReduceTableData] = useState() // 营收分润数量 - const [revenueOne,setRevenueOne] = useState() + const [revenueOne, setRevenueOne] = useState() // 营收回款数量 - const [backTwo,setBackTwo] = useState() + const [backTwo, setBackTwo] = useState() // 禁止组件按钮的默认点击事件 useEffect(() => { const button = document.querySelector('#accountMonthly-table-xls-button'); @@ -572,12 +574,12 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, []); // 给子组件代替点击经营单位的方法 - const handleMerchants = (record: any)=>{ + const handleMerchants = (record: any) => { setCurrentRow(record.BUSINESSPROJECT_ID) setShowDrawer(true) } // 给子组件代替点击经营门店的方法 - const handleShopName = (record: any)=>{ + const handleShopName = (record: any) => { setCurrentRow(record.BUSINESSPROJECT_ID) setShopNameDrawer(true) } @@ -714,30 +716,30 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { DIFDAILY_REVENUE: { show: false, }, - SUBROYALTY_PRICE:{ + SUBROYALTY_PRICE: { show: false, }, - SUBROYALTYDAILY_THEORY:{ + SUBROYALTYDAILY_THEORY: { show: false, }, - TICKET_FEE:{ + TICKET_FEE: { show: false, }, - PUSHREVENUE_AMOUNT:{ + PUSHREVENUE_AMOUNT: { show: false, }, - correctiDiff:{ + correctiDiff: { show: false, }, - COMPACT_TYPE:{ - show:false + COMPACT_TYPE: { + show: false } }); // 因为要排序不调用接口 所以要把请求拆到外面去 - const handleGetTableData = async (params?: any)=>{ + const handleGetTableData = async (params?: any) => { setTableLoading(true) - console.log('params',params) + console.log('params', params) setIsFirst(false) canSearch.current = 2 const projectData = await GetProjectSummary({ @@ -756,31 +758,31 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { setSearchTime([moment(start).format('YYYY-MM-DD'), moment(end).format('YYYY-MM-DD')]) setFileName(`资金到账汇总(${moment(start).format('YYYY-MM-DD')} - ${moment(end).format('YYYY-MM-DD')})`) const list = JSON.parse(JSON.stringify(projectData.data)) - console.log('list',list) - list.forEach((item: any)=>{ - if (item.children && item.children.length>0){ - item.children.forEach((subItem: any)=>{ - if (subItem.children && subItem.children.length>0){ - subItem.children.forEach((thirdItem: any)=>{ - if ((!(thirdItem?.MERCHANTS_NAME || thirdItem?.SERVERPART_NAME || thirdItem?.SPREGIONTYPE_NAME)&& (thirdItem.BUSINESS_TYPE===1000 || thirdItem.BUSINESS_TYPE===2000)) || + console.log('list', list) + list.forEach((item: any) => { + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { + if (subItem.children && subItem.children.length > 0) { + subItem.children.forEach((thirdItem: any) => { + if ((!(thirdItem?.MERCHANTS_NAME || thirdItem?.SERVERPART_NAME || thirdItem?.SPREGIONTYPE_NAME) && (thirdItem.BUSINESS_TYPE === 1000 || thirdItem.BUSINESS_TYPE === 2000)) || ( - (thirdItem.BUSINESS_TYPE===1000 || thirdItem.BUSINESS_TYPE===2000) && + (thirdItem.BUSINESS_TYPE === 1000 || thirdItem.BUSINESS_TYPE === 2000) && - (!thirdItem?.TICKET_FEE || thirdItem?.TICKET_FEE===0) && - (!thirdItem?.REVENUE_AMOUNT|| thirdItem?.REVENUE_AMOUNT===0) && + (!thirdItem?.TICKET_FEE || thirdItem?.TICKET_FEE === 0) && + (!thirdItem?.REVENUE_AMOUNT || thirdItem?.REVENUE_AMOUNT === 0) && // 商家入账没有值 且也不是0 - (!thirdItem?.SUBROYALTYDAILY_THEORY || thirdItem?.SUBROYALTYDAILY_THEORY===0)&& + (!thirdItem?.SUBROYALTYDAILY_THEORY || thirdItem?.SUBROYALTYDAILY_THEORY === 0) && // 商家到账没有值 且也不是0 - (!thirdItem?.SUBROYALTY_PRICE || thirdItem?.SUBROYALTY_PRICE===0) && + (!thirdItem?.SUBROYALTY_PRICE || thirdItem?.SUBROYALTY_PRICE === 0) && // 业主入账没有值 且也不是0 - (!thirdItem?.ROYALTYDAILY_THEORY || thirdItem?.ROYALTYDAILY_THEORY===0) && + (!thirdItem?.ROYALTYDAILY_THEORY || thirdItem?.ROYALTYDAILY_THEORY === 0) && // 业主到账 没有值 且也不是0 - (!thirdItem?.ROYALTY_PRICE || thirdItem?.ROYALTY_PRICE===0) && + (!thirdItem?.ROYALTY_PRICE || thirdItem?.ROYALTY_PRICE === 0) && // 到账差额 没有值 且也不是0 !thirdItem?.PUSHREVENUE_AMOUNT) || // 有推送金额 业主和商家的入账都为0时 变红色 - (thirdItem?.PUSHREVENUE_AMOUNT && (!thirdItem?.ROYALTYDAILY_THEORY || thirdItem?.ROYALTYDAILY_THEORY===0) && (!thirdItem?.SUBROYALTYDAILY_THEORY || thirdItem?.SUBROYALTYDAILY_THEORY===0))){ + (thirdItem?.PUSHREVENUE_AMOUNT && (!thirdItem?.ROYALTYDAILY_THEORY || thirdItem?.ROYALTYDAILY_THEORY === 0) && (!thirdItem?.SUBROYALTYDAILY_THEORY || thirdItem?.SUBROYALTYDAILY_THEORY === 0))) { item.showRed = true subItem.showRed = true } @@ -789,7 +791,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }) } }) - console.log('list',list) + console.log('list', list) let firstM: number = 0 // 钱 let firstN: number = 0 // 数量 let secondM: number = 0 // 钱 @@ -798,40 +800,40 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { let oneNumber: number = 0 let twoNumber: number = 0 - list.forEach((item: any)=>{ - if (item.children && item.children.length>0){ + list.forEach((item: any) => { + if (item.children && item.children.length > 0) { let sum: number = 0 let profitSharItem: number = 0 // 营收分润 let collectionItem: number = 0 // 营收回款 - item.children.forEach((subItem: any)=>{ + item.children.forEach((subItem: any) => { subItem.ProjectCount = subItem.children.length sum += subItem.ProjectCount - if (subItem.children && subItem.children.length>0){ + if (subItem.children && subItem.children.length > 0) { let profitSharSubItem: number = 0 // 营收分润 let collectionSubItem: number = 0 // 营收回款 - subItem.children.forEach((thirdItem: any)=>{ - if (thirdItem.BUSINESS_TYPE===1000 || thirdItem.BUSINESS_TYPE===2000){ + subItem.children.forEach((thirdItem: any) => { + if (thirdItem.BUSINESS_TYPE === 1000 || thirdItem.BUSINESS_TYPE === 2000) { firstM += thirdItem.ROYALTY_PRICE - firstN +=1 - if (thirdItem.SETTLEMENT_MODES){ - if (thirdItem.SETTLEMENT_MODES===3000 || thirdItem.SETTLEMENT_MODES===4000){ - oneNumber+=1 - }else{ - twoNumber+=1 + firstN += 1 + if (thirdItem.SETTLEMENT_MODES) { + if (thirdItem.SETTLEMENT_MODES === 3000 || thirdItem.SETTLEMENT_MODES === 4000) { + oneNumber += 1 + } else { + twoNumber += 1 } - }else{ - console.log('thirdItem',thirdItem) + } else { + console.log('thirdItem', thirdItem) } - }else if(thirdItem.BUSINESS_TYPE===3000 || thirdItem.BUSINESS_TYPE===4000){ + } else if (thirdItem.BUSINESS_TYPE === 3000 || thirdItem.BUSINESS_TYPE === 4000) { secondM += thirdItem.ROYALTY_PRICE - secondN +=1 + secondN += 1 } - if (thirdItem.SETTLEMENT_MODES){ - if (thirdItem.SETTLEMENT_MODES===3000 || thirdItem.SETTLEMENT_MODES===4000){ - profitSharSubItem+=1 - }else{ - collectionSubItem+=1 + if (thirdItem.SETTLEMENT_MODES) { + if (thirdItem.SETTLEMENT_MODES === 3000 || thirdItem.SETTLEMENT_MODES === 4000) { + profitSharSubItem += 1 + } else { + collectionSubItem += 1 } } }) @@ -848,17 +850,17 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }) setRevenueOne(oneNumber) setBackTwo(twoNumber) - console.log('list',list) - console.log('oneNumber',oneNumber) - console.log('twoNumber',twoNumber) + console.log('list', list) + console.log('oneNumber', oneNumber) + console.log('twoNumber', twoNumber) let allSum: number = 0 - list.forEach((item: any)=>{ - allSum+=item.ProjectCount + list.forEach((item: any) => { + allSum += item.ProjectCount }) setAllProjectSum(allSum) - if (list && list.length>0){ + if (list && list.length > 0) { const reduceData = list.reduce((p: { REVENUE_AMOUNT: number, ROYALTY_PRICE: number, @@ -891,7 +893,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }, { REVENUE_AMOUNT: 0, ROYALTY_PRICE: 0, ACCOUNT_AMOUNT: 0 }); - console.log('reduceData',reduceData) + console.log('reduceData', reduceData) setReduceTableData(reduceData) } setFirstMoney(firstM) @@ -954,40 +956,17 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { // 打印报表 setPrintOut(el); }}> - - { setCollapsible(!collapsible) }} />} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - // 取消掉选择点击左侧 右侧列表就直接调用接口拿到数据 - // actionRef?.current?.reload() - }} - // switcherIcon={} - /> : ''} - -
+
+ + + +
+
{ @@ -1004,101 +983,103 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { }}>
: '' } { - showNoticeDetail? + showNoticeDetail ?
{ - setShowNoticeDetail(!showNoticeDetail) - }} style={{position: 'fixed', background: '#fff', padding: '15px', - borderRadius: '8px', - width:'70vw', - left:'440px', - top:`${noticeY}px`, - zIndex: 99, - boxShadow:'0px 9px 28px 8px rgba(0,0,0,0.05), 0px 6px 16px 0px rgba(0,0,0,0.08), 0px 3px 6px -4px rgba(0,0,0,0.12)'}}> - 项目到账汇总}> - ¥{amountDom(otherData?.ProjectCoopRevenue)} - ¥{amountDom(otherData?.ProjectRentRevenue)} - ¥{amountDom(otherData?.ProjectSelfCoopRevenue)} - ¥{amountDom(otherData?.ProjectSelfRevenue)} - ¥{amountDom(reduceTableData?.REVENUE_AMOUNT)} - - 推送金额汇总}> - ¥{amountDom(otherData?.PushCoopRevenue)} - ¥{amountDom(otherData?.PushRentRevenue)} - ¥{amountDom(otherData?.PushSelfCoopRevenue)} - ¥{amountDom(otherData?.PushSelfRevenue)} - ¥{amountDom(otherData?.PushRevenue)} - - 营收差异(项目到账-推送金额)}> - ¥{amountDom(numeral(numeral((otherData?.ProjectCoopRevenue || 0) - - (otherData?.PushCoopRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((otherData?.ProjectRentRevenue || 0) - - (otherData?.PushRentRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((otherData?.ProjectSelfCoopRevenue || 0) - - (otherData?.PushSelfCoopRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((otherData?.ProjectSelfRevenue || 0) - - (otherData?.PushSelfRevenue || 0))).format('0.00'))} - ¥{amountDom(numeral(numeral((reduceTableData.REVENUE_AMOUNT || 0) - - (otherData?.PushRevenue || 0))).format('0.00'))} - - 银行到账汇总}> - {amountDom(numeral(allProjectSum).format('0.00'))} - ¥{amountDom(reduceTableData.ROYALTY_PRICE)} - ¥{amountDom(reduceTableData.SUBROYALTY_PRICE)} - ¥{amountDom(reduceTableData.TICKET_FEE)} - ¥{amountDom(numeral(numeral((reduceTableData.ROYALTY_PRICE || 0) + (reduceTableData.SUBROYALTY_PRICE || 0) + - (reduceTableData.TICKET_FEE || 0) - (reduceTableData.REVENUE_AMOUNT || 0)).format('0.00')).format('0.00'))} - - 财务入账汇总}> - - ¥{amountDom(reduceTableData.ROYALTY_THEORY)} - ¥{amountDom(reduceTableData.SUBROYALTY_THEORY)} - - ¥{amountDom(numeral(reduceTableData.DIFDAILY_REVENUE).format('0.00'))} - - 差额(到账-入账)}> - - -
{ - setChildrenType(1) - setShowSmallDrawer(true) - }}> - ¥{amountDom(numeral((reduceTableData.ROYALTY_PRICE || 0) - + onClick={() => { + setShowNoticeDetail(!showNoticeDetail) + }} style={{ + position: 'fixed', background: '#fff', padding: '15px', + borderRadius: '8px', + width: '70vw', + left: '440px', + top: `${noticeY}px`, + zIndex: 99, + boxShadow: '0px 9px 28px 8px rgba(0,0,0,0.05), 0px 6px 16px 0px rgba(0,0,0,0.08), 0px 3px 6px -4px rgba(0,0,0,0.12)' + }}> + 项目到账汇总}> + ¥{amountDom(otherData?.ProjectCoopRevenue)} + ¥{amountDom(otherData?.ProjectRentRevenue)} + ¥{amountDom(otherData?.ProjectSelfCoopRevenue)} + ¥{amountDom(otherData?.ProjectSelfRevenue)} + ¥{amountDom(reduceTableData?.REVENUE_AMOUNT)} + + 推送金额汇总}> + ¥{amountDom(otherData?.PushCoopRevenue)} + ¥{amountDom(otherData?.PushRentRevenue)} + ¥{amountDom(otherData?.PushSelfCoopRevenue)} + ¥{amountDom(otherData?.PushSelfRevenue)} + ¥{amountDom(otherData?.PushRevenue)} + + 营收差异(项目到账-推送金额)}> + ¥{amountDom(numeral(numeral((otherData?.ProjectCoopRevenue || 0) - + (otherData?.PushCoopRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((otherData?.ProjectRentRevenue || 0) - + (otherData?.PushRentRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((otherData?.ProjectSelfCoopRevenue || 0) - + (otherData?.PushSelfCoopRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((otherData?.ProjectSelfRevenue || 0) - + (otherData?.PushSelfRevenue || 0))).format('0.00'))} + ¥{amountDom(numeral(numeral((reduceTableData.REVENUE_AMOUNT || 0) - + (otherData?.PushRevenue || 0))).format('0.00'))} + + 银行到账汇总}> + {amountDom(numeral(allProjectSum).format('0.00'))} + ¥{amountDom(reduceTableData.ROYALTY_PRICE)} + ¥{amountDom(reduceTableData.SUBROYALTY_PRICE)} + ¥{amountDom(reduceTableData.TICKET_FEE)} + ¥{amountDom(numeral(numeral((reduceTableData.ROYALTY_PRICE || 0) + (reduceTableData.SUBROYALTY_PRICE || 0) + + (reduceTableData.TICKET_FEE || 0) - (reduceTableData.REVENUE_AMOUNT || 0)).format('0.00')).format('0.00'))} + + 财务入账汇总}> + + ¥{amountDom(reduceTableData.ROYALTY_THEORY)} + ¥{amountDom(reduceTableData.SUBROYALTY_THEORY)} + + ¥{amountDom(numeral(reduceTableData.DIFDAILY_REVENUE).format('0.00'))} + + 差额(到账-入账)}> + + +
{ + setChildrenType(1) + setShowSmallDrawer(true) + }}> + ¥{amountDom(numeral((reduceTableData.ROYALTY_PRICE || 0) - (reduceTableData.ROYALTY_THEORY || 0)).format('0.00'))} -
-
- -
{ - setChildrenType(2) - setShowSmallDrawer(true) - }}> - ¥{amountDom(numeral((reduceTableData.SUBROYALTY_PRICE || 0) - +
+
+ +
{ + setChildrenType(2) + setShowSmallDrawer(true) + }}> + ¥{amountDom(numeral((reduceTableData.SUBROYALTY_PRICE || 0) - (reduceTableData.SUBROYALTY_THEORY || 0)).format('0.00'))} -
-
- ¥{amountDom(numeral((reduceTableData.ROYALTY_PRICE || 0) - - (reduceTableData.ROYALTY_THEORY || 0) + (reduceTableData.SUBROYALTY_PRICE || 0) - - (reduceTableData.SUBROYALTY_THEORY || 0)).format('0.00'))} - ¥{amountDom(numeral((reduceTableData.REVENUE_AMOUNT || 0) - - (otherData?.PushRevenue || 0)-(reduceTableData.DIFDAILY_REVENUE || 0)).format('0.00'))} -
-
:'' +
+ + ¥{amountDom(numeral((reduceTableData.ROYALTY_PRICE || 0) - + (reduceTableData.ROYALTY_THEORY || 0) + (reduceTableData.SUBROYALTY_PRICE || 0) - + (reduceTableData.SUBROYALTY_THEORY || 0)).format('0.00'))} + ¥{amountDom(numeral((reduceTableData.REVENUE_AMOUNT || 0) - + (otherData?.PushRevenue || 0) - (reduceTableData.DIFDAILY_REVENUE || 0)).format('0.00'))} + +
: '' } rowKey={(record) => { @@ -1115,11 +1096,11 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { search={{ span: 6, labelWidth: 'auto', - collapsed:isCollapsed, - onCollapse:()=>{ + collapsed: isCollapsed, + onCollapse: () => { setIsCollapsed(!isCollapsed) }, - optionRender:(searchConfig, formProps, dom)=>{ + optionRender: (searchConfig, formProps, dom) => { return [
{/* 经营单位 */} = (props) => { closable={false} > {/* 抽屉打开时 加载项目详情组件 */} - {showDrawer && } + {showDrawer && } {/* 商家缴款 */} = (props) => { {/* 经营门店 */} { // 关闭抽屉 则在清空选中行数据 并 设置抽屉状态为关闭 - setCurrentRow(undefined); - setShopNameDrawer(false); - }} - bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} - closable={false} + zIndex={zIndexNumber} + width="90%" + className="project-drawer" + visible={showShopNameDrawer} // 抽屉弹框是否显示状态 + onClose={() => { // 关闭抽屉 则在清空选中行数据 并 设置抽屉状态为关闭 + setCurrentRow(undefined); + setShopNameDrawer(false); + }} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} + closable={false} > {showShopNameDrawer && } - {/* 点击差额的业主分润和商家分润的值出现的抽屉 */} + {/* 点击差额的业主分润和商家分润的值出现的抽屉 */} { + onClose={() => { setShowSmallDrawer(false) }} bodyStyle={{ padding: 0 }} @@ -1476,7 +1457,7 @@ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { destroyOnClose > + childrenType={childrenType} searchDate={searchDate} tableParams={tableParams}>
); diff --git a/src/pages/reports/MerchantInformation/index.tsx b/src/pages/reports/MerchantInformation/index.tsx index 9fb56d2..a061e89 100644 --- a/src/pages/reports/MerchantInformation/index.tsx +++ b/src/pages/reports/MerchantInformation/index.tsx @@ -1,27 +1,28 @@ -import React, {useRef, useState} from "react"; -import type {CurrentUser} from "umi"; -import { useRequest} from "umi"; -import {connect} from "umi"; -import type {ConnectState} from "@/models/connect"; -import type {SHOPEXPENSEListModel} from "@/pages/reports/ShopExpenses/data"; -import {MenuFoldOutlined} from "@ant-design/icons"; -import type {FormInstance} from "antd"; -import {Button, Drawer, message, Spin, Tree, Typography} from "antd"; +import React, { useRef, useState } from "react"; +import type { CurrentUser } from "umi"; +import { useRequest } from "umi"; +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import type { SHOPEXPENSEListModel } from "@/pages/reports/ShopExpenses/data"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Button, Drawer, message, Spin, Tree, Typography } from "antd"; import ProCard from "@ant-design/pro-card"; import { getServerpartTree } from "@/services/options"; -import type {ActionType} from "@ant-design/pro-table"; +import type { ActionType } from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table"; import ReactHTMLTableToExcel from "react-html-table-to-excel"; import moment from "moment/moment"; -import {handleGetTableBasicData} from "@/pages/reports/ShopExpenseDetail/service"; +import { handleGetTableBasicData } from "@/pages/reports/ShopExpenseDetail/service"; import session from "@/utils/session"; -import {contractType} from "@/pages/contract/emun"; +import { contractType } from "@/pages/contract/emun"; import ProjectDetail from "@/pages/BussinessProject/detail"; -import type {BusinessProjectModel} from "@/pages/BussinessProject/data"; -import {auto} from "@antv/s2"; // 枚举和树相关的引用,没有使用可以删除 +import type { BusinessProjectModel } from "@/pages/BussinessProject/data"; +import { auto } from "@antv/s2"; // 枚举和树相关的引用,没有使用可以删除 +import LeftSelectTree from "../settlementAccount/component/leftSelectTree"; -const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { +const MerchantInformation: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props const actionRef = useRef(); const formRef = useRef(); @@ -35,13 +36,13 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { // 树相关的属性和方法 const [selectedId, setSelectedId] = useState() const [collapsible, setCollapsible] = useState(false) - const [treeView,setTreeView] = useState() + const [treeView, setTreeView] = useState() // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) // 导出excel的时间 - const [exportTime,setExportTime] = useState() + const [exportTime, setExportTime] = useState() // 导出的加载效果 - const [showLoading,setShowLoading] = useState(false) + const [showLoading, setShowLoading] = useState(false) // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) @@ -70,17 +71,17 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { // fixed:'left' // }, { - title:
门店名称
, + title:
门店名称
, dataIndex: 'Name', hideInSearch: true, width: 200, - ellipsis:true, - fixed:'left', + ellipsis: true, + fixed: 'left', align: 'left', - render:(_,record)=>{ - return { - if (record.BUSINESSPROJECT_ID){ - console.log('record',record) + render: (_, record) => { + return { + if (record.BUSINESSPROJECT_ID) { + console.log('record', record) setCurrentRow(record) setShowDetail(true) } @@ -107,7 +108,7 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:'结算模式', + title: '结算模式', dataIndex: 'SETTLEMENT_MODES', hideInTable: true, hideInDescriptions: true, @@ -115,22 +116,22 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { fieldProps: { mode: 'multiple' }, - request: ()=>{ + request: () => { return SETTLEMENT_MODESList } }, { - title:
经营商户
, + title:
经营商户
, align: 'left', dataIndex: 'MERCHANTS_NAME', width: 200, - ellipsis:true, - render:(_,record)=>{ + ellipsis: true, + render: (_, record) => { return record?.MERCHANTS_NAME || record?.projectNumber || '-' } }, { - title:
租金类别
, + title:
租金类别
, align: 'left', dataIndex: 'BusinessType', hideInSearch: true, @@ -139,97 +140,97 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { valueEnum: contractType }, { - title:
合同开始
, + title:
合同开始
, align: 'left', dataIndex: 'COMPACT_STARTDATE', width: 90, hideInSearch: true, }, { - title:
合同结束
, + title:
合同结束
, align: 'left', dataIndex: 'COMPACT_ENDDATE', width: 90, hideInSearch: true, }, { - title:
合同金额
, + title:
合同金额
, dataIndex: 'COMPACT_AMOUNT', - align:'right', - valueType:'digit', + align: 'right', + valueType: 'digit', width: 90, hideInSearch: true, }, { - title:
履约保证金
, + title:
履约保证金
, dataIndex: 'SECURITYDEPOSIT', - align:'right', - valueType:'digit', + align: 'right', + valueType: 'digit', width: 90, hideInSearch: true, }, { - title:
年保底租金
, + title:
年保底租金
, dataIndex: 'MINTURNOVER', - align:'right', - valueType:'digit', + align: 'right', + valueType: 'digit', width: 100, hideInSearch: true, }, { - title:
提成比例
, + title:
提成比例
, dataIndex: 'GUARANTEERATIO', - align:'right', + align: 'right', width: 90, hideInSearch: true, - render:(_,record)=>{ - return {record.GUARANTEERATIO?`${record.GUARANTEERATIO}%`:'-'} + render: (_, record) => { + return {record.GUARANTEERATIO ? `${record.GUARANTEERATIO}%` : '-'} } }, { - title:'固定(保底)租金', + title: '固定(保底)租金', dataIndex: '', hideInSearch: true, children: [ { - title:
第1年
, + title:
第1年
, dataIndex: 'MINTURNOVERFirst', - align:'right', - valueType:'digit', + align: 'right', + valueType: 'digit', width: 100, hideInSearch: true, }, { - title:
第2年
, + title:
第2年
, dataIndex: 'MINTURNOVERSecond', - align:'right', - valueType:'digit', + align: 'right', + valueType: 'digit', width: 100, hideInSearch: true, }, { - title:
第3年
, + title:
第3年
, dataIndex: 'MINTURNOVERThird', - align:'right', + align: 'right', width: 100, - valueType:'digit', + valueType: 'digit', hideInSearch: true, }, { - title:
第4年
, + title:
第4年
, dataIndex: 'MINTURNOVERFourth', - align:'right', - valueType:'digit', + align: 'right', + valueType: 'digit', width: 100, hideInSearch: true, }, { - title:
第5年
, + title:
第5年
, dataIndex: 'MINTURNOVERFifth', - align:'right', + align: 'right', width: 100, - valueType:'digit', + valueType: 'digit', hideInSearch: true, }, ] @@ -285,14 +286,14 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser}> = (props) => { borderRadius: '8px', width: '200px' }}> - - 数据加载中... + + 数据加载中...
-
:'' +
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
-
- +
+ {/* = (props) => { }} // switcherIcon={} /> : ''} - + */} +
= (props) => { columns={columns} bordered rowKey={(record) => record?.Name + record?.Id + record?.BUSINESSPROJECT_ID} - search={{span: 6}} - scroll={{x: 1000,y: 'calc(100vh - 470px)'}} - pagination={{pageSize: 20}} + search={{ span: 6 }} + scroll={{ x: 1000, y: 'calc(100vh - 470px)' }} + pagination={{ pageSize: 20 }} className={'overFlowYTable'} - request={async (params)=>{ - if (!selectedId){ + request={async (params) => { + if (!selectedId) { setReqDetailList([]) return [] } - if (params.StartDate && params.EndDate){ + if (params.StartDate && params.EndDate) { setExportTime(`${moment(params.StartDate).format('YYYY-MM-DD')}_${moment(params.EndDate).format('YYYY-MM-DD')}`) - }else{ + } else { setExportTime('') setReqDetailList([]) return [] } - console.log('selectedId',selectedId) + console.log('selectedId', selectedId) let SETTLEMENT_MODESSTR: string = '' - if (params.SETTLEMENT_MODES && params.SETTLEMENT_MODES.length>0){ - params.SETTLEMENT_MODES.forEach((item: any)=>{ - if (SETTLEMENT_MODESSTR){ - SETTLEMENT_MODESSTR+=`,${item}` - }else{ + if (params.SETTLEMENT_MODES && params.SETTLEMENT_MODES.length > 0) { + params.SETTLEMENT_MODES.forEach((item: any) => { + if (SETTLEMENT_MODESSTR) { + SETTLEMENT_MODESSTR += `,${item}` + } else { SETTLEMENT_MODESSTR = item } }) } let isOneServer: boolean = false - if (selectedId.indexOf(',')===-1){ + if (selectedId.indexOf(',') === -1) { isOneServer = true } const req = { ServerpartIds: selectedId, - SETTLEMENT_MODES:SETTLEMENT_MODESSTR || '', - startDate:params.StartDate || '', - endDate:params.EndDate || '', - keyword:params.MERCHANTS_NAME + SETTLEMENT_MODES: SETTLEMENT_MODESSTR || '', + startDate: params.StartDate || '', + endDate: params.EndDate || '', + keyword: params.MERCHANTS_NAME } const data = await handleGetTableBasicData(req) - if (data && data.length>0){ - data.forEach((item: any)=>{ - if (item.children && item.children.length>0){ + if (data && data.length > 0) { + data.forEach((item: any) => { + if (item.children && item.children.length > 0) { let itemProjectNumber: number = 0 - item.children.forEach((subItem: any)=>{ + item.children.forEach((subItem: any) => { subItem.projectNumber = subItem.children.length - itemProjectNumber+=subItem.projectNumber + itemProjectNumber += subItem.projectNumber }) item.projectNumber = itemProjectNumber } }) } - console.log('data',data) + console.log('data', data) let res: any = [] - if (isOneServer){ - if (data && data.length>0){ - data.forEach((item: any)=>{ - if (item.children && item.children.length>0){ - item.children.forEach((subItem: any)=>{ + if (isOneServer) { + if (data && data.length > 0) { + data.forEach((item: any) => { + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { res.push(subItem) }) } }) } - }else{ + } else { res = data } setReqDetailList(data) - return {data: res, success: true} + return { data: res, success: true } }} - headerTitle={"合同商户信息统计表(分账收银)"} // 列表表头 + headerTitle={合同商户信息统计表(分账收银)} // 列表表头 toolbar={{ actions: [ - + = (props) => { ) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(MerchantInformation); diff --git a/src/pages/reports/audit/abnormalAmount/index.tsx b/src/pages/reports/audit/abnormalAmount/index.tsx index 6f4ebb6..c61eac9 100644 --- a/src/pages/reports/audit/abnormalAmount/index.tsx +++ b/src/pages/reports/audit/abnormalAmount/index.tsx @@ -25,6 +25,7 @@ import PageTitleBox from "@/components/PageTitleBox"; import { formatTreeData } from "@/utils/format"; import { handleGetListObj } from "@/utils/utils"; import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun"; +import LeftSelectTree from "../../settlementAccount/component/leftSelectTree"; const abnormalAmount: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props @@ -279,7 +280,7 @@ const abnormalAmount: React.FC<{ currentUser: CurrentUser }> = (props) => { : '' } - = (props) => { }} // switcherIcon={} /> : ''} - + */} + { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + if (selectedIds.map(n => n?.value)?.toString().indexOf(',') === -1) { + handleGetShopList(selectedIds) + } else { + setServerpartShopObj({}) + } + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + }} /> +
= (props) => { @@ -253,7 +254,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser }> = (props) => {
- = (props) => { }} // switcherIcon={} /> : ''} - + */} + +
= (props) => { const { currentUser } = props @@ -289,7 +290,7 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => { : '' } - = (props) => { }} // switcherIcon={} /> : ''} - + */} + { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + if (selectedIds.map(n => n?.value)?.toString().indexOf(',') === -1) { + handleGetShopList(selectedIds) + } else { + setServerpartShopObj({}) + } + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + }} />
= (props) => { @@ -308,7 +312,7 @@ const abnormalReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
- = (props) => { }} // switcherIcon={} /> : ''} - + */} +
= (props) => { bordered headerTitle={} search={{ span: 6 }} - scroll={{ x: 2000, y: 'calc(100vh - 470px)' }} + scroll={{ x: '100%', y: 'calc(100vh - 470px)' }} request={async (params) => { if (!selectedId) { return @@ -373,37 +378,81 @@ const abnormalReport: React.FC<{ currentUser: CurrentUser }> = (props) => { const data = await handleGetAbnormalRateReport(req) console.log('data', data) if (data && data.length > 0) { - setReqDetailList(data) + + let fieldData: any = [ + "TOTALCOUNT", + "TICKETCOUNT", + "EXCEPTIONCOUNT_1011", + "EXCEPTIONCOUNT_1050", + "EXCEPTIONCOUNT_1099", + "EXCEPTIONCOUNT_1060", + "EXCEPTIONCOUNT_2010", + "EXCEPTIONCOUNT_3030", + "EXCEPTIONCOUNT_3050", + "EXCEPTIONCOUNT_3010", + "EXCEPTIONCOUNT_3020", + "EXCEPTIONCOUNT_3990" + ] + let enumList: any = [] + + let rateList: any = [ + "EXCEPTIONCOUNT_1011Rate", + "EXCEPTIONCOUNT_1050Rate", + "EXCEPTIONCOUNT_1099Rate", + "EXCEPTIONCOUNT_1060Rate", + "EXCEPTIONCOUNT_2010Rate", + "EXCEPTIONCOUNT_3030Rate", + "EXCEPTIONCOUNT_3050Rate", + "EXCEPTIONCOUNT_3010Rate", + "EXCEPTIONCOUNT_3020Rate", + "EXCEPTIONCOUNT_3990Rate", + ] + + let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], rateList) + + setReqDetailList(newPrintData) return { data, success: true } } return { data: [], success: true } }} toolbar={{ actions: [ - - - , + // + // + // ,
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
+
-
- + {/* = (props) => { }} // switcherIcon={} /> : ''} - + */} + +
= (props) => { columns={columns} bordered headerTitle={} - search={{span: 6}} - request={async(params)=>{ - console.log('bigCurrenMenu',bigCurrenMenu) - console.log('currenMenu',currenMenu) - if (!selectedId){ + search={{ span: 6 }} + request={async (params) => { + console.log('bigCurrenMenu', bigCurrenMenu) + console.log('currenMenu', currenMenu) + if (!selectedId) { return } const req = { - SearchParameter:{ + SearchParameter: { ...params, - TREATMENT_MARKSTATE:params.TREATMENT_MARKSTATE==='0'?'':params.TREATMENT_MARKSTATE, + TREATMENT_MARKSTATE: params.TREATMENT_MARKSTATE === '0' ? '' : params.TREATMENT_MARKSTATE, SERVERPART_IDS: selectedId, }, - PageIndex:1, - PageSize:99999 + PageIndex: 1, + PageSize: 99999 } handleCallLogs() setSearchParams(params) const data = await handleGetCHECKACCOUNTList(req) - console.log('data',data) - if (data && data.length>0){ - setReqDetailList(data) - return {data,success: true} + console.log('data', data) + if (data && data.length > 0) { + + let fieldData: any = [ + "TOTALSELLAMOUNT" + ] + let enumList: any = [] + + let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], []) + setReqDetailList(newPrintData) + return { data, success: true } } - return {data: [],success: true} + return { data: [], success: true } }} toolbar={{ actions: [ - - - , + // + // + // ,
- @@ -443,32 +456,32 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { const req: any = { CHECKACCOUNTId: currentRow?.Audit_Id } - console.log('req',req) + console.log('req', req) const data = await handleDeleteCHECKACCOUNT(req) - if (data.Result_Code===100){ + if (data.Result_Code === 100) { message.success(data.Result_Desc) setCurrentRow(undefined) setInspectionModal(false); actionRef.current?.reload() - }else{ + } else { message.error(data.Result_Desc) } }} > - +
} > - +
) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(checkAcount); diff --git a/src/pages/reports/audit/curDailyReport/index.tsx b/src/pages/reports/audit/curDailyReport/index.tsx index a5d7f1d..09f1d37 100644 --- a/src/pages/reports/audit/curDailyReport/index.tsx +++ b/src/pages/reports/audit/curDailyReport/index.tsx @@ -17,6 +17,7 @@ import moment from "moment"; import * as numeral from "numeral"; import ProDescriptions from "@ant-design/pro-descriptions"; import PageTitleBox from "@/components/PageTitleBox"; +import LeftSelectTree from "../../settlementAccount/component/leftSelectTree"; const curDailyReport: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -353,48 +354,18 @@ const curDailyReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
- { - setCollapsible(!collapsible) - }} />} - colSpan={!collapsible ? "300px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const all = info.checkedNodes.filter(n => n?.key === '0-0') - if (all && all.length > 0) { - // setIsAll(true) - setSelectedId(undefined) - } else { - // setIsAll(false) - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - } - // actionRef?.current?.reload() - // getData(selectedIds.map(n => n?.value)?.toString() || '') - }} - // switcherIcon={} - /> : ''} - + { + const all = info.checkedNodes.filter(n => n?.key === '0-0') + if (all && all.length > 0) { + // setIsAll(true) + setSelectedId(undefined) + } else { + // setIsAll(false) + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + } + }} /> +
= (props) => { @@ -311,7 +312,7 @@ const checkAcount: React.FC<{ currentUser: CurrentUser }> = (props) => {
- = (props) => { }} // switcherIcon={} /> : ''} - + */} +
= (props) => { @@ -305,7 +308,7 @@ const spAbnormalReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
- = (props) => { }} // switcherIcon={} /> : ''} - + */} + +
= (props) => { columns={columns} rowKey={(record) => record?.Id + record?.Name} bordered - scroll={{ x: 2000 }} + scroll={{ x: '100%', y: 'calc(100vh - 470px)' }} headerTitle={} search={{ span: 6 }} request={async (params) => { @@ -370,7 +375,6 @@ const spAbnormalReport: React.FC<{ currentUser: CurrentUser }> = (props) => { const data = await handleGetYsabnormalityReport(req) console.log('data', data) if (data && data.length > 0) { - setReqDetailList(data) const list: any = JSON.parse(JSON.stringify(data)) list.forEach((item: any, index: number) => { item.index = index + 1 @@ -385,33 +389,62 @@ const spAbnormalReport: React.FC<{ currentUser: CurrentUser }> = (props) => { }) } }) + + let fieldData: any = [ + "EXCEPTIONTYPE", + "EXCEPTIONTYPE_B", + "EXCEPTIONTYPE_C", + "EXCEPTIONTYPE_Z", + "EXCEPTIONTYPE_F", + "EXCEPTIONTYPE_G", + "EXCEPTIONTYPE_L", + "EXCEPTIONTYPE_M", + "EXCEPTIONTYPE_R", + "TotalMust", + "EXCEPTIONTYPE_A", + "EXCEPTIONTYPE_H", + "EXCEPTIONTYPE_I", + "EXCEPTIONTYPE_J", + "EXCEPTIONTYPE_N", + "EXCEPTIONTYPE_O", + "EXCEPTIONTYPE_P", + "EXCEPTIONTYPE_Q", + "TotalMay", + ] + let enumList: any = [] + + + let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(list)), fieldData, enumList, [], []) + setReqDetailList(newPrintData) + return { data: list, success: true } } return { data: [], success: true } }} toolbar={{ actions: [ - - - , + // + // + // ,
- = (props) => { }} // switcherIcon={} /> : ''} - + */} + { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + + const selectedAreaIds = info.checkedNodes.filter(n => n?.type === 0) + setSelectedAreaId(selectedAreaIds.map(n => n?.value)?.toString() || '') + }} /> +
= (props) => { console.log('res', res) return { data: res, success: true } }} - headerTitle={`分账收银扣费明细表(${searchMonth || '-'}月)`} // 列表表头 + headerTitle={{`分账收银扣费明细表(${searchMonth || '-'}月)`}} // 列表表头 toolbar={{ actions: [ diff --git a/src/pages/reports/productControl/commodityInfo/index.tsx b/src/pages/reports/productControl/commodityInfo/index.tsx index c14106a..c0b60c5 100644 --- a/src/pages/reports/productControl/commodityInfo/index.tsx +++ b/src/pages/reports/productControl/commodityInfo/index.tsx @@ -960,6 +960,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { }} closable={false} destroyOnClose + bodyStyle={{ padding: '12px 24px' }} > diff --git a/src/pages/reports/productControl/shopCommodity/index.tsx b/src/pages/reports/productControl/shopCommodity/index.tsx index b76a30c..e0cf681 100644 --- a/src/pages/reports/productControl/shopCommodity/index.tsx +++ b/src/pages/reports/productControl/shopCommodity/index.tsx @@ -23,6 +23,7 @@ import session from "@/utils/session"; import PageTitleBox from "@/components/PageTitleBox"; import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun"; import { formatTreeData } from "@/utils/format"; +import LeftSelectTree from "../../settlementAccount/component/leftSelectTree"; const shopCommodity: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -251,7 +252,7 @@ const shopCommodity: React.FC<{ currentUser: CurrentUser }> = (props) => { }
- = (props) => { }} // switcherIcon={} /> : ''} - + */} +
= (props) => { const { currentUser } = props @@ -438,7 +439,7 @@ const receivedAccounts: React.FC<{ currentUser: CurrentUser }> = (props) => {
- = (props) => { }} // switcherIcon={} /> : ''} - + */} + { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + + // 选中的片区 + const selectedAreas = info.checkedNodes.filter(n => n?.type === 0) + setSelectedAreaId(selectedAreas.map(n => n?.value)?.toString() || '') + }} />
= (props) => { console.log('res', res) return { data: res, success: true } }} - headerTitle={`分账收银到账统计表(${searchMonth || '-'}月)`} // 列表表头 + headerTitle={{`分账收银到账统计表(${searchMonth || '-'}月)`}} // 列表表头 toolbar={{ actions: [ diff --git a/src/pages/reports/revenueConfirmation/index.tsx b/src/pages/reports/revenueConfirmation/index.tsx index 9e1495f..f9d3579 100644 --- a/src/pages/reports/revenueConfirmation/index.tsx +++ b/src/pages/reports/revenueConfirmation/index.tsx @@ -29,6 +29,7 @@ import { handleGetProjectPeriodIncome, handleStorageMonthProjectAccount } from " import { wrapTreeNode } from "@/utils/format"; import { handleGetSERVERPARTCRTList } from "@/pages/basicManage/costing/service"; import { handleHighPrecision } from "@/utils/utils"; +import LeftSelectTree from "../settlementAccount/component/leftSelectTree"; const revenueConfirmation: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props @@ -1096,7 +1097,7 @@ const revenueConfirmation: React.FC<{ currentUser: CurrentUser }> = (props) => {
- = (props) => { }} // switcherIcon={} /> : ''} - + */} + { + const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + const selectedAreaIds = info.checkedNodes.filter(n => n?.type === 0) + setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + setSelectAreaId(selectedAreaIds.map(n => n?.value)?.toString() || '') + }} /> +
{record?.RevenueAmount ? `${handleFormatNumber(record?.RevenueAmount)}${record?.addRevenueMoney ? `(${record?.addRevenueMoney > 0 ? '+' : record?.addRevenueMoney < 0 ? '' : ''}${record?.addRevenueMoney})` : ''}` : '0'} : diff --git a/src/pages/reports/shareRoyalty/index.tsx b/src/pages/reports/shareRoyalty/index.tsx index 6d4a4cc..5f07fb2 100644 --- a/src/pages/reports/shareRoyalty/index.tsx +++ b/src/pages/reports/shareRoyalty/index.tsx @@ -46,6 +46,7 @@ import ReactHTMLTableToExcel from "react-html-table-to-excel"; import ChangeRevenue from "@/pages/reports/shareRoyalty/component/changeRevenue"; import DifferenceAmount from './component/differenceAmount'; import PageTitleBox from '@/components/PageTitleBox'; +import LeftSelectTree from '../settlementAccount/component/leftSelectTree'; const { Text } = Typography; @@ -303,6 +304,7 @@ const ReportTable: React.FC<{ currentUser?: CurrentUser, isComponents?: boolean, title: '经营商家', dataIndex: 'Business_Unit', ellipsis: true, + width: 150, key: 'Business_Unit', hideInSearch: true, render: (_, record) => { @@ -1256,40 +1258,42 @@ const ReportTable: React.FC<{ currentUser?: CurrentUser, isComponents?: boolean,
{ isComponents ? '' : - { - setCollapsible(!collapsible) - }} />} - colSpan={!collapsible ? "240px" : "60px"} - title={!collapsible ? "可筛选门店" : ""} - headerBordered - collapsed={collapsible} - > - {treeView && treeView.length > 0 ? { - const selectedIds = info.checkedNodes.filter(n => n?.type === 1) - setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') - // actionRef?.current?.reload() - }} - /> : ''} - + + + // { + // setCollapsible(!collapsible) + // }} />} + // colSpan={!collapsible ? "240px" : "60px"} + // title={!collapsible ? "可筛选门店" : ""} + // headerBordered + // collapsed={collapsible} + // > + // {treeView && treeView.length > 0 ? { + // const selectedIds = info.checkedNodes.filter(n => n?.type === 1) + // setSelectedId(selectedIds.map(n => n?.value)?.toString() || '') + // // actionRef?.current?.reload() + // }} + // /> : ''} + // }
diff --git a/src/utils/exportExcelFun.ts b/src/utils/exportExcelFun.ts index c8c4346..6f997cc 100644 --- a/src/utils/exportExcelFun.ts +++ b/src/utils/exportExcelFun.ts @@ -48,6 +48,36 @@ const toPath = (di?: AnyCol['dataIndex']): (string | number)[] => const getByPath = (obj: any, path: (string | number)[]) => path.reduce((acc, k) => (acc == null ? acc : acc[k]), obj); +/** 支持 A|B 或逻辑的取值 */ +const getValueWithOr = (obj: any, dataIndex?: AnyCol['dataIndex']): any => { + if (!dataIndex) return undefined; + + // 如果是数组,直接使用原逻辑 + if (Array.isArray(dataIndex)) { + return getByPath(obj, dataIndex); + } + + // 如果是字符串,检查是否包含 | 符号 + if (typeof dataIndex === 'string') { + if (dataIndex.includes('|')) { + // 分割并按优先级取值 + const keys = dataIndex.split('|').map(key => key.trim()); + for (const key of keys) { + const value = getByPath(obj, toPath(key)); + if (value != null && value !== '') { + return value; + } + } + return null; + } else { + // 普通路径,使用原逻辑 + return getByPath(obj, toPath(dataIndex)); + } + } + + return undefined; +}; + /** 过滤 hideInTable(父级联动) */ function pruneHiddenColumns(cols: AnyCol[]): AnyCol[] { const walk = (arr: AnyCol[]): AnyCol[] => @@ -129,7 +159,7 @@ function getCellValue(col: AnyCol, record: any, rowIndex: number) { // << 新增:序号列 if (col.valueType === 'index') return rowIndex + 1; - const raw = getByPath(record, toPath(col.dataIndex)); + const raw = getValueWithOr(record, col.dataIndex); if (col.valueEnum) { const ve = col.valueEnum[raw as any]; if (typeof ve === 'string') return ve; diff --git a/src/utils/format.ts b/src/utils/format.ts index 0831b1b..671d643 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -1090,4 +1090,120 @@ export function formatTreeData( } return formatRecursive(data); +} + +export async function getUserIP(): Promise { + try { + // 尝试多个第三方API服务 + const apis = [ + 'https://api.ipify.org?format=json', + 'https://ipapi.co/json/', + 'https://jsonip.com/', + 'https://httpbin.org/ip' + ]; + + for (const api of apis) { + try { + const response = await fetch(api, { + method: 'GET', + timeout: 5000, // 5秒超时 + }); + + if (!response.ok) { + continue; + } + + const data = await response.json(); + + // 根据不同API返回格式获取IP + if (data.ip) { + return data.ip; + } else if (data.origin) { + // httpbin返回格式 + return data.origin; + } + } catch (error) { + console.warn(`IP API ${api} 请求失败:`, error); + continue; + } + } + + throw new Error('所有IP服务都无法访问'); + } catch (error) { + console.error('获取IP地址失败:', error); + return '获取失败'; + } +} + +/** + * 根据IP地址获取地理位置信息 + * @param ip IP地址 + * @returns Promise 地理位置信息 + */ +export async function getLocationByIP(ip: string, ak: string): Promise<{ + country?: string; + province?: string; + city?: string; + district?: string; + isp?: string; + success: boolean; + message?: string; +}> { + if (!ip || ip === '获取失败') { + return { + success: false, + message: 'IP地址无效' + }; + } + + if (!ak) { + return { + success: false, + message: '百度地图API密钥(ak)不能为空' + }; + } + + try { + const response = await fetch(`/baidu-api/location/ip?ip=${ip}&ak=${ak}`, { + method: 'GET', + timeout: 8000, + headers: { + 'Accept': 'application/json' + } + }); + + if (!response.ok) { + throw new Error(`HTTP错误: ${response.status}`); + } + + const data = await response.json(); + + // 检查百度API返回状态 + if (data.status !== 0) { + return { + success: false, + message: `百度API错误: ${data.message || '未知错误'}` + }; + } + + // 解析百度地图返回的数据 + const content = data.content; + const addressDetail = content.address_detail; + + return { + country: '中国', // 百度地图IP定位默认中国 + province: addressDetail.province || '', + city: addressDetail.city || '', + district: addressDetail.district || '', + isp: content.address || '', + success: true + }; + + } catch (error) { + console.error('获取地理位置失败:', error); + return { + success: false, + message: '获取地理位置失败' + }; + } } \ No newline at end of file diff --git a/src/versionEnv.ts b/src/versionEnv.ts index f58b960..d7d9b67 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -1,4 +1,4 @@ // 由 scripts/writeVersion.js 自动生成 -export const VERSION = "4.5.62"; -export const GIT_HASH = "d0c4edd"; -export const BUILD_TIME = "2025-09-23T05:40:18.538Z"; +export const VERSION = "4.5.64"; +export const GIT_HASH = "5a7f174"; +export const BUILD_TIME = "2025-09-26T03:21:11.008Z";